18fc2d0c6Smrg# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
254b44505Smrg
38fc2d0c6Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
44a041c5bSmacallan
54a041c5bSmacallan# This file is free software; the Free Software Foundation
64a041c5bSmacallan# gives unlimited permission to copy and/or distribute it,
74a041c5bSmacallan# with or without modifications, as long as this notice is preserved.
84a041c5bSmacallan
94a041c5bSmacallan# This program is distributed in the hope that it will be useful,
104a041c5bSmacallan# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
114a041c5bSmacallan# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
124a041c5bSmacallan# PARTICULAR PURPOSE.
134a041c5bSmacallan
140a392d7eSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
154a041c5bSmacallanm4_ifndef([AC_AUTOCONF_VERSION],
164a041c5bSmacallan  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
178fc2d0c6Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
188fc2d0c6Smrg[m4_warning([this file was generated for autoconf 2.71.
194a041c5bSmacallanYou have another version of autoconf.  It may work, but is not guaranteed to.
204a041c5bSmacallanIf you have problems, you may need to regenerate the build system entirely.
2154b44505SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
224a041c5bSmacallan
238fc2d0c6Smrg# Copyright (C) 2002-2021 Free Software Foundation, Inc.
2454b44505Smrg#
258fc2d0c6Smrg# This file is free software; the Free Software Foundation
268fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
278fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
280a392d7eSmrg
298fc2d0c6Smrg# AM_AUTOMAKE_VERSION(VERSION)
308fc2d0c6Smrg# ----------------------------
318fc2d0c6Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
328fc2d0c6Smrg# generated from the m4 files accompanying Automake X.Y.
338fc2d0c6Smrg# (This private macro should not be called outside this file.)
348fc2d0c6SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
358fc2d0c6Smrg[am__api_version='1.16'
368fc2d0c6Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
378fc2d0c6Smrgdnl require some minimum version.  Point them to the right macro.
388fc2d0c6Smrgm4_if([$1], [1.16.5], [],
398fc2d0c6Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
4054b44505Smrg])
414a041c5bSmacallan
428fc2d0c6Smrg# _AM_AUTOCONF_VERSION(VERSION)
438fc2d0c6Smrg# -----------------------------
448fc2d0c6Smrg# aclocal traces this macro to find the Autoconf version.
458fc2d0c6Smrg# This is a private macro too.  Using m4_define simplifies
468fc2d0c6Smrg# the logic in aclocal, which can simply ignore this definition.
478fc2d0c6Smrgm4_define([_AM_AUTOCONF_VERSION], [])
484a041c5bSmacallan
498fc2d0c6Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
508fc2d0c6Smrg# -------------------------------
518fc2d0c6Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
528fc2d0c6Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
538fc2d0c6SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
548fc2d0c6Smrg[AM_AUTOMAKE_VERSION([1.16.5])dnl
558fc2d0c6Smrgm4_ifndef([AC_AUTOCONF_VERSION],
568fc2d0c6Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
578fc2d0c6Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
584a041c5bSmacallan
598fc2d0c6Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
604a041c5bSmacallan
618fc2d0c6Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
628fc2d0c6Smrg#
638fc2d0c6Smrg# This file is free software; the Free Software Foundation
648fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
658fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
664a041c5bSmacallan
678fc2d0c6Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
688fc2d0c6Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
698fc2d0c6Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
708fc2d0c6Smrg#
718fc2d0c6Smrg# Of course, Automake must honor this variable whenever it calls a
728fc2d0c6Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
738fc2d0c6Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
748fc2d0c6Smrg# depending on how configure is run.  This is pretty annoying, since
758fc2d0c6Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
768fc2d0c6Smrg# source directory, any form will work fine, but in subdirectories a
778fc2d0c6Smrg# relative path needs to be adjusted first.
788fc2d0c6Smrg#
798fc2d0c6Smrg# $ac_aux_dir/missing
808fc2d0c6Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
818fc2d0c6Smrg# $top_srcdir/$ac_aux_dir/missing
828fc2d0c6Smrg#    fails if $ac_aux_dir is absolute,
838fc2d0c6Smrg#    fails when called from a subdirectory in a VPATH build with
848fc2d0c6Smrg#          a relative $ac_aux_dir
858fc2d0c6Smrg#
868fc2d0c6Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
878fc2d0c6Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
888fc2d0c6Smrg# harmless because $srcdir is '.', but things will broke when you
898fc2d0c6Smrg# start a VPATH build or use an absolute $srcdir.
908fc2d0c6Smrg#
918fc2d0c6Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
928fc2d0c6Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
938fc2d0c6Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
948fc2d0c6Smrg# and then we would define $MISSING as
958fc2d0c6Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
968fc2d0c6Smrg# This will work as long as MISSING is not called from configure, because
978fc2d0c6Smrg# unfortunately $(top_srcdir) has no meaning in configure.
988fc2d0c6Smrg# However there are other variables, like CC, which are often used in
998fc2d0c6Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1008fc2d0c6Smrg#
1018fc2d0c6Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1028fc2d0c6Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1038fc2d0c6Smrg# configured tree to be moved without reconfiguration.
1048fc2d0c6Smrg
1058fc2d0c6SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1068fc2d0c6Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1078fc2d0c6Smrg# Expand $ac_aux_dir to an absolute path.
1088fc2d0c6Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
10954b44505Smrg])
11054b44505Smrg
1118fc2d0c6Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11254b44505Smrg
1138fc2d0c6Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
1148fc2d0c6Smrg#
1158fc2d0c6Smrg# This file is free software; the Free Software Foundation
1168fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
1178fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
11854b44505Smrg
1198fc2d0c6Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1208fc2d0c6Smrg# -------------------------------------
1218fc2d0c6Smrg# Define a conditional.
1228fc2d0c6SmrgAC_DEFUN([AM_CONDITIONAL],
1238fc2d0c6Smrg[AC_PREREQ([2.52])dnl
1248fc2d0c6Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1258fc2d0c6Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1268fc2d0c6SmrgAC_SUBST([$1_TRUE])dnl
1278fc2d0c6SmrgAC_SUBST([$1_FALSE])dnl
1288fc2d0c6Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1298fc2d0c6Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1308fc2d0c6Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1318fc2d0c6Smrgif $2; then
1328fc2d0c6Smrg  $1_TRUE=
1338fc2d0c6Smrg  $1_FALSE='#'
1348fc2d0c6Smrgelse
1358fc2d0c6Smrg  $1_TRUE='#'
1368fc2d0c6Smrg  $1_FALSE=
1378fc2d0c6Smrgfi
1388fc2d0c6SmrgAC_CONFIG_COMMANDS_PRE(
1398fc2d0c6Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1408fc2d0c6Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1418fc2d0c6SmrgUsually this means the macro was only invoked conditionally.]])
1428fc2d0c6Smrgfi])])
14354b44505Smrg
1448fc2d0c6Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
1458fc2d0c6Smrg#
1468fc2d0c6Smrg# This file is free software; the Free Software Foundation
1478fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
1488fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
14954b44505Smrg
1504a041c5bSmacallan
1518fc2d0c6Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1528fc2d0c6Smrg# written in clear, in which case automake, when reading aclocal.m4,
1538fc2d0c6Smrg# will think it sees a *use*, and therefore will trigger all it's
1548fc2d0c6Smrg# C support machinery.  Also note that it means that autoscan, seeing
1558fc2d0c6Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1564a041c5bSmacallan
1574a041c5bSmacallan
1588fc2d0c6Smrg# _AM_DEPENDENCIES(NAME)
1598fc2d0c6Smrg# ----------------------
1608fc2d0c6Smrg# See how the compiler implements dependency checking.
1618fc2d0c6Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1628fc2d0c6Smrg# We try a few techniques and use that to set a single cache variable.
1638fc2d0c6Smrg#
1648fc2d0c6Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1658fc2d0c6Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1668fc2d0c6Smrg# dependency, and given that the user is not expected to run this macro,
1678fc2d0c6Smrg# just rely on AC_PROG_CC.
1688fc2d0c6SmrgAC_DEFUN([_AM_DEPENDENCIES],
1698fc2d0c6Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1708fc2d0c6SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1718fc2d0c6SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1728fc2d0c6SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1734a041c5bSmacallan
1748fc2d0c6Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1758fc2d0c6Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1768fc2d0c6Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1778fc2d0c6Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1788fc2d0c6Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1798fc2d0c6Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1808fc2d0c6Smrg                    [depcc="$$1"   am_compiler_list=])
1814a041c5bSmacallan
1828fc2d0c6SmrgAC_CACHE_CHECK([dependency style of $depcc],
1838fc2d0c6Smrg               [am_cv_$1_dependencies_compiler_type],
1848fc2d0c6Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1858fc2d0c6Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1868fc2d0c6Smrg  # making bogus files that we don't know about and never remove.  For
1878fc2d0c6Smrg  # instance it was reported that on HP-UX the gcc test will end up
1888fc2d0c6Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1898fc2d0c6Smrg  # in D".
1908fc2d0c6Smrg  rm -rf conftest.dir
1918fc2d0c6Smrg  mkdir conftest.dir
1928fc2d0c6Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1938fc2d0c6Smrg  # using a relative directory.
1948fc2d0c6Smrg  cp "$am_depcomp" conftest.dir
1958fc2d0c6Smrg  cd conftest.dir
1968fc2d0c6Smrg  # We will build objects and dependencies in a subdirectory because
1978fc2d0c6Smrg  # it helps to detect inapplicable dependency modes.  For instance
1988fc2d0c6Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1998fc2d0c6Smrg  # side effect of compilation, but ICC will put the dependencies in
2008fc2d0c6Smrg  # the current directory while Tru64 will put them in the object
2018fc2d0c6Smrg  # directory.
2028fc2d0c6Smrg  mkdir sub
20354b44505Smrg
2048fc2d0c6Smrg  am_cv_$1_dependencies_compiler_type=none
2058fc2d0c6Smrg  if test "$am_compiler_list" = ""; then
2068fc2d0c6Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2078fc2d0c6Smrg  fi
2088fc2d0c6Smrg  am__universal=false
2098fc2d0c6Smrg  m4_case([$1], [CC],
2108fc2d0c6Smrg    [case " $depcc " in #(
2118fc2d0c6Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2128fc2d0c6Smrg     esac],
2138fc2d0c6Smrg    [CXX],
2148fc2d0c6Smrg    [case " $depcc " in #(
2158fc2d0c6Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2168fc2d0c6Smrg     esac])
21754b44505Smrg
2188fc2d0c6Smrg  for depmode in $am_compiler_list; do
2198fc2d0c6Smrg    # Setup a source with many dependencies, because some compilers
2208fc2d0c6Smrg    # like to wrap large dependency lists on column 80 (with \), and
2218fc2d0c6Smrg    # we should not choose a depcomp mode which is confused by this.
2228fc2d0c6Smrg    #
2238fc2d0c6Smrg    # We need to recreate these files for each test, as the compiler may
2248fc2d0c6Smrg    # overwrite some of them when testing with obscure command lines.
2258fc2d0c6Smrg    # This happens at least with the AIX C compiler.
2268fc2d0c6Smrg    : > sub/conftest.c
2278fc2d0c6Smrg    for i in 1 2 3 4 5 6; do
2288fc2d0c6Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2298fc2d0c6Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2308fc2d0c6Smrg      # Solaris 10 /bin/sh.
2318fc2d0c6Smrg      echo '/* dummy */' > sub/conftst$i.h
2320a392d7eSmrg    done
2338fc2d0c6Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2340a392d7eSmrg
2358fc2d0c6Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
2368fc2d0c6Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2378fc2d0c6Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
2388fc2d0c6Smrg    # versions had trouble with output in subdirs.
2398fc2d0c6Smrg    am__obj=sub/conftest.${OBJEXT-o}
2408fc2d0c6Smrg    am__minus_obj="-o $am__obj"
2418fc2d0c6Smrg    case $depmode in
2428fc2d0c6Smrg    gcc)
2438fc2d0c6Smrg      # This depmode causes a compiler race in universal mode.
2448fc2d0c6Smrg      test "$am__universal" = false || continue
2458fc2d0c6Smrg      ;;
2468fc2d0c6Smrg    nosideeffect)
2478fc2d0c6Smrg      # After this tag, mechanisms are not by side-effect, so they'll
2488fc2d0c6Smrg      # only be used when explicitly requested.
2498fc2d0c6Smrg      if test "x$enable_dependency_tracking" = xyes; then
2508fc2d0c6Smrg	continue
2518fc2d0c6Smrg      else
2528fc2d0c6Smrg	break
2538fc2d0c6Smrg      fi
2548fc2d0c6Smrg      ;;
2558fc2d0c6Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2568fc2d0c6Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
2578fc2d0c6Smrg      # not run yet.  These depmodes are late enough in the game, and
2588fc2d0c6Smrg      # so weak that their functioning should not be impacted.
2598fc2d0c6Smrg      am__obj=conftest.${OBJEXT-o}
2608fc2d0c6Smrg      am__minus_obj=
2618fc2d0c6Smrg      ;;
2628fc2d0c6Smrg    none) break ;;
2638fc2d0c6Smrg    esac
2648fc2d0c6Smrg    if depmode=$depmode \
2658fc2d0c6Smrg       source=sub/conftest.c object=$am__obj \
2668fc2d0c6Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2678fc2d0c6Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2688fc2d0c6Smrg         >/dev/null 2>conftest.err &&
2698fc2d0c6Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2708fc2d0c6Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2718fc2d0c6Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2728fc2d0c6Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2738fc2d0c6Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2748fc2d0c6Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2758fc2d0c6Smrg      # that says an option was ignored or not supported.
2768fc2d0c6Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2778fc2d0c6Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2788fc2d0c6Smrg      # The diagnosis changed in icc 8.0:
2798fc2d0c6Smrg      #   icc: Command line remark: option '-MP' not supported
2808fc2d0c6Smrg      if (grep 'ignoring option' conftest.err ||
2818fc2d0c6Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2828fc2d0c6Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2838fc2d0c6Smrg        break
2848fc2d0c6Smrg      fi
2858fc2d0c6Smrg    fi
2868fc2d0c6Smrg  done
2870a392d7eSmrg
2888fc2d0c6Smrg  cd ..
2898fc2d0c6Smrg  rm -rf conftest.dir
2908fc2d0c6Smrgelse
2918fc2d0c6Smrg  am_cv_$1_dependencies_compiler_type=none
2928fc2d0c6Smrgfi
2938fc2d0c6Smrg])
2948fc2d0c6SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2958fc2d0c6SmrgAM_CONDITIONAL([am__fastdep$1], [
2968fc2d0c6Smrg  test "x$enable_dependency_tracking" != xno \
2978fc2d0c6Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
29854b44505Smrg])
29954b44505Smrg
30054b44505Smrg
3018fc2d0c6Smrg# AM_SET_DEPDIR
3028fc2d0c6Smrg# -------------
3038fc2d0c6Smrg# Choose a directory name for dependency files.
3048fc2d0c6Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
3058fc2d0c6SmrgAC_DEFUN([AM_SET_DEPDIR],
3068fc2d0c6Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3078fc2d0c6SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3088fc2d0c6Smrg])
3094a041c5bSmacallan
31054b44505Smrg
3118fc2d0c6Smrg# AM_DEP_TRACK
3128fc2d0c6Smrg# ------------
3138fc2d0c6SmrgAC_DEFUN([AM_DEP_TRACK],
3148fc2d0c6Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
3158fc2d0c6SmrgAS_HELP_STRING(
3168fc2d0c6Smrg  [--enable-dependency-tracking],
3178fc2d0c6Smrg  [do not reject slow dependency extractors])
3188fc2d0c6SmrgAS_HELP_STRING(
3198fc2d0c6Smrg  [--disable-dependency-tracking],
3208fc2d0c6Smrg  [speeds up one-time build])])
3218fc2d0c6Smrgif test "x$enable_dependency_tracking" != xno; then
3228fc2d0c6Smrg  am_depcomp="$ac_aux_dir/depcomp"
3238fc2d0c6Smrg  AMDEPBACKSLASH='\'
3248fc2d0c6Smrg  am__nodep='_no'
32554b44505Smrgfi
3268fc2d0c6SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3278fc2d0c6SmrgAC_SUBST([AMDEPBACKSLASH])dnl
3288fc2d0c6Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3298fc2d0c6SmrgAC_SUBST([am__nodep])dnl
3308fc2d0c6Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
33154b44505Smrg])
33254b44505Smrg
3338fc2d0c6Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3344a041c5bSmacallan
3358fc2d0c6Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
3368fc2d0c6Smrg#
3378fc2d0c6Smrg# This file is free software; the Free Software Foundation
3388fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
3398fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
3404a041c5bSmacallan
3418fc2d0c6Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3428fc2d0c6Smrg# ------------------------------
3438fc2d0c6SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3448fc2d0c6Smrg[{
3458fc2d0c6Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
3468fc2d0c6Smrg  # are listed without --file.  Let's play safe and only enable the eval
3478fc2d0c6Smrg  # if we detect the quoting.
3488fc2d0c6Smrg  # TODO: see whether this extra hack can be removed once we start
3498fc2d0c6Smrg  # requiring Autoconf 2.70 or later.
3508fc2d0c6Smrg  AS_CASE([$CONFIG_FILES],
3518fc2d0c6Smrg          [*\'*], [eval set x "$CONFIG_FILES"],
3528fc2d0c6Smrg          [*], [set x $CONFIG_FILES])
3538fc2d0c6Smrg  shift
3548fc2d0c6Smrg  # Used to flag and report bootstrapping failures.
3558fc2d0c6Smrg  am_rc=0
3568fc2d0c6Smrg  for am_mf
3578fc2d0c6Smrg  do
3588fc2d0c6Smrg    # Strip MF so we end up with the name of the file.
3598fc2d0c6Smrg    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
3608fc2d0c6Smrg    # Check whether this is an Automake generated Makefile which includes
3618fc2d0c6Smrg    # dependency-tracking related rules and includes.
3628fc2d0c6Smrg    # Grep'ing the whole file directly is not great: AIX grep has a line
3638fc2d0c6Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
3648fc2d0c6Smrg    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
3658fc2d0c6Smrg      || continue
3668fc2d0c6Smrg    am_dirpart=`AS_DIRNAME(["$am_mf"])`
3678fc2d0c6Smrg    am_filepart=`AS_BASENAME(["$am_mf"])`
3688fc2d0c6Smrg    AM_RUN_LOG([cd "$am_dirpart" \
3698fc2d0c6Smrg      && sed -e '/# am--include-marker/d' "$am_filepart" \
3708fc2d0c6Smrg        | $MAKE -f - am--depfiles]) || am_rc=$?
3718fc2d0c6Smrg  done
3728fc2d0c6Smrg  if test $am_rc -ne 0; then
3738fc2d0c6Smrg    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
3748fc2d0c6Smrg    for automatic dependency tracking.  If GNU make was not used, consider
3758fc2d0c6Smrg    re-running the configure script with MAKE="gmake" (or whatever is
3768fc2d0c6Smrg    necessary).  You can also try re-running configure with the
3778fc2d0c6Smrg    '--disable-dependency-tracking' option to at least be able to build
3788fc2d0c6Smrg    the package (albeit without support for automatic dependency tracking).])
3794a041c5bSmacallan  fi
3808fc2d0c6Smrg  AS_UNSET([am_dirpart])
3818fc2d0c6Smrg  AS_UNSET([am_filepart])
3828fc2d0c6Smrg  AS_UNSET([am_mf])
3838fc2d0c6Smrg  AS_UNSET([am_rc])
3848fc2d0c6Smrg  rm -f conftest-deps.mk
3858fc2d0c6Smrg}
3868fc2d0c6Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3874a041c5bSmacallan
3884a041c5bSmacallan
3898fc2d0c6Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3908fc2d0c6Smrg# -----------------------------
3918fc2d0c6Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3928fc2d0c6Smrg#
3938fc2d0c6Smrg# This code is only required when automatic dependency tracking is enabled.
3948fc2d0c6Smrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
3958fc2d0c6Smrg# order to bootstrap the dependency handling code.
3968fc2d0c6SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3978fc2d0c6Smrg[AC_CONFIG_COMMANDS([depfiles],
3988fc2d0c6Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3998fc2d0c6Smrg     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
4004a041c5bSmacallan
4018fc2d0c6Smrg# Do all the work for Automake.                             -*- Autoconf -*-
4024a041c5bSmacallan
4038fc2d0c6Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
4048fc2d0c6Smrg#
4058fc2d0c6Smrg# This file is free software; the Free Software Foundation
4068fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
4078fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
4084a041c5bSmacallan
4098fc2d0c6Smrg# This macro actually does too much.  Some checks are only needed if
4108fc2d0c6Smrg# your package does certain things.  But this isn't really a big deal.
4114a041c5bSmacallan
4128fc2d0c6Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
4138fc2d0c6Smrgm4_define([AC_PROG_CC],
4148fc2d0c6Smrgm4_defn([AC_PROG_CC])
4158fc2d0c6Smrg[_AM_PROG_CC_C_O
4168fc2d0c6Smrg])
4174a041c5bSmacallan
4188fc2d0c6Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4198fc2d0c6Smrg# AM_INIT_AUTOMAKE([OPTIONS])
4208fc2d0c6Smrg# -----------------------------------------------
4218fc2d0c6Smrg# The call with PACKAGE and VERSION arguments is the old style
4228fc2d0c6Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4238fc2d0c6Smrg# and VERSION should now be passed to AC_INIT and removed from
4248fc2d0c6Smrg# the call to AM_INIT_AUTOMAKE.
4258fc2d0c6Smrg# We support both call styles for the transition.  After
4268fc2d0c6Smrg# the next Automake release, Autoconf can make the AC_INIT
4278fc2d0c6Smrg# arguments mandatory, and then we can depend on a new Autoconf
4288fc2d0c6Smrg# release and drop the old call support.
4298fc2d0c6SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4308fc2d0c6Smrg[AC_PREREQ([2.65])dnl
4318fc2d0c6Smrgm4_ifdef([_$0_ALREADY_INIT],
4328fc2d0c6Smrg  [m4_fatal([$0 expanded multiple times
4338fc2d0c6Smrg]m4_defn([_$0_ALREADY_INIT]))],
4348fc2d0c6Smrg  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
4358fc2d0c6Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4368fc2d0c6Smrgdnl the ones we care about.
4378fc2d0c6Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4388fc2d0c6SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4398fc2d0c6SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4408fc2d0c6Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4418fc2d0c6Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4428fc2d0c6Smrg  # is not polluted with repeated "-I."
4438fc2d0c6Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4448fc2d0c6Smrg  # test to see if srcdir already configured
4458fc2d0c6Smrg  if test -f $srcdir/config.status; then
4468fc2d0c6Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4478fc2d0c6Smrg  fi
4488fc2d0c6Smrgfi
4494a041c5bSmacallan
4508fc2d0c6Smrg# test whether we have cygpath
4518fc2d0c6Smrgif test -z "$CYGPATH_W"; then
4528fc2d0c6Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4538fc2d0c6Smrg    CYGPATH_W='cygpath -w'
4548fc2d0c6Smrg  else
4558fc2d0c6Smrg    CYGPATH_W=echo
4568fc2d0c6Smrg  fi
4578fc2d0c6Smrgfi
4588fc2d0c6SmrgAC_SUBST([CYGPATH_W])
4594a041c5bSmacallan
4608fc2d0c6Smrg# Define the identity of the package.
4618fc2d0c6Smrgdnl Distinguish between old-style and new-style calls.
4628fc2d0c6Smrgm4_ifval([$2],
4638fc2d0c6Smrg[AC_DIAGNOSE([obsolete],
4648fc2d0c6Smrg             [$0: two- and three-arguments forms are deprecated.])
4658fc2d0c6Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4668fc2d0c6Smrg AC_SUBST([PACKAGE], [$1])dnl
4678fc2d0c6Smrg AC_SUBST([VERSION], [$2])],
4688fc2d0c6Smrg[_AM_SET_OPTIONS([$1])dnl
4698fc2d0c6Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4708fc2d0c6Smrgm4_if(
4718fc2d0c6Smrg  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
4728fc2d0c6Smrg  [ok:ok],,
4738fc2d0c6Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4748fc2d0c6Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4758fc2d0c6Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4764a041c5bSmacallan
4778fc2d0c6Smrg_AM_IF_OPTION([no-define],,
4788fc2d0c6Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4798fc2d0c6Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4804a041c5bSmacallan
4818fc2d0c6Smrg# Some tools Automake needs.
4828fc2d0c6SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4838fc2d0c6SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4848fc2d0c6SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4858fc2d0c6SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
4868fc2d0c6SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4878fc2d0c6SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
4888fc2d0c6SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
4898fc2d0c6SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4908fc2d0c6SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4918fc2d0c6SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
4928fc2d0c6Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
4938fc2d0c6Smrg# dies out for good.  For more background, see:
4948fc2d0c6Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
4958fc2d0c6Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
4968fc2d0c6SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
4978fc2d0c6Smrg# We need awk for the "check" target (and possibly the TAP driver).  The
4988fc2d0c6Smrg# system "awk" is bad on some platforms.
4998fc2d0c6SmrgAC_REQUIRE([AC_PROG_AWK])dnl
5008fc2d0c6SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5018fc2d0c6SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5028fc2d0c6Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5038fc2d0c6Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5048fc2d0c6Smrg			     [_AM_PROG_TAR([v7])])])
5058fc2d0c6Smrg_AM_IF_OPTION([no-dependencies],,
5068fc2d0c6Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5078fc2d0c6Smrg		  [_AM_DEPENDENCIES([CC])],
5088fc2d0c6Smrg		  [m4_define([AC_PROG_CC],
5098fc2d0c6Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
5108fc2d0c6SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5118fc2d0c6Smrg		  [_AM_DEPENDENCIES([CXX])],
5128fc2d0c6Smrg		  [m4_define([AC_PROG_CXX],
5138fc2d0c6Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
5148fc2d0c6SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5158fc2d0c6Smrg		  [_AM_DEPENDENCIES([OBJC])],
5168fc2d0c6Smrg		  [m4_define([AC_PROG_OBJC],
5178fc2d0c6Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
5188fc2d0c6SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
5198fc2d0c6Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
5208fc2d0c6Smrg		  [m4_define([AC_PROG_OBJCXX],
5218fc2d0c6Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
52254b44505Smrg])
5238fc2d0c6Smrg# Variables for tags utilities; see am/tags.am
5248fc2d0c6Smrgif test -z "$CTAGS"; then
5258fc2d0c6Smrg  CTAGS=ctags
5268fc2d0c6Smrgfi
5278fc2d0c6SmrgAC_SUBST([CTAGS])
5288fc2d0c6Smrgif test -z "$ETAGS"; then
5298fc2d0c6Smrg  ETAGS=etags
5308fc2d0c6Smrgfi
5318fc2d0c6SmrgAC_SUBST([ETAGS])
5328fc2d0c6Smrgif test -z "$CSCOPE"; then
5338fc2d0c6Smrg  CSCOPE=cscope
5348fc2d0c6Smrgfi
5358fc2d0c6SmrgAC_SUBST([CSCOPE])
5364a041c5bSmacallan
5378fc2d0c6SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
5388fc2d0c6Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
5398fc2d0c6Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
5408fc2d0c6Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
5418fc2d0c6SmrgAC_CONFIG_COMMANDS_PRE(dnl
5428fc2d0c6Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5438fc2d0c6Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5444a041c5bSmacallan
5458fc2d0c6Smrg# POSIX will say in a future version that running "rm -f" with no argument
5468fc2d0c6Smrg# is OK; and we want to be able to make that assumption in our Makefile
5478fc2d0c6Smrg# recipes.  So use an aggressive probe to check that the usage we want is
5488fc2d0c6Smrg# actually supported "in the wild" to an acceptable degree.
5498fc2d0c6Smrg# See automake bug#10828.
5508fc2d0c6Smrg# To make any issue more visible, cause the running configure to be aborted
5518fc2d0c6Smrg# by default if the 'rm' program in use doesn't match our expectations; the
5528fc2d0c6Smrg# user can still override this though.
5538fc2d0c6Smrgif rm -f && rm -fr && rm -rf; then : OK; else
5548fc2d0c6Smrg  cat >&2 <<'END'
5558fc2d0c6SmrgOops!
5564a041c5bSmacallan
5578fc2d0c6SmrgYour 'rm' program seems unable to run without file operands specified
5588fc2d0c6Smrgon the command line, even when the '-f' option is present.  This is contrary
5598fc2d0c6Smrgto the behaviour of most rm programs out there, and not conforming with
5608fc2d0c6Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
5614a041c5bSmacallan
5628fc2d0c6SmrgPlease tell bug-automake@gnu.org about your system, including the value
5638fc2d0c6Smrgof your $PATH and any error possibly output before this message.  This
5648fc2d0c6Smrgcan help us improve future automake versions.
5654a041c5bSmacallan
5668fc2d0c6SmrgEND
5678fc2d0c6Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
5688fc2d0c6Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
5698fc2d0c6Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
5708fc2d0c6Smrg    echo >&2
5718fc2d0c6Smrg  else
5728fc2d0c6Smrg    cat >&2 <<'END'
5738fc2d0c6SmrgAborting the configuration process, to ensure you take notice of the issue.
57454b44505Smrg
5758fc2d0c6SmrgYou can download and install GNU coreutils to get an 'rm' implementation
5768fc2d0c6Smrgthat behaves properly: <https://www.gnu.org/software/coreutils/>.
57754b44505Smrg
5788fc2d0c6SmrgIf you want to complete the configuration process using your problematic
5798fc2d0c6Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
5808fc2d0c6Smrgto "yes", and re-run configure.
58154b44505Smrg
5828fc2d0c6SmrgEND
5838fc2d0c6Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
5848fc2d0c6Smrg  fi
5858fc2d0c6Smrgfi
5868fc2d0c6Smrgdnl The trailing newline in this macro's definition is deliberate, for
5878fc2d0c6Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments
5888fc2d0c6Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
58954b44505Smrg])
5904a041c5bSmacallan
5918fc2d0c6Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5928fc2d0c6Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5938fc2d0c6Smrgdnl mangled by Autoconf and run in a shell conditional statement.
5948fc2d0c6Smrgm4_define([_AC_COMPILER_EXEEXT],
5958fc2d0c6Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5964a041c5bSmacallan
5978fc2d0c6Smrg# When config.status generates a header, we must update the stamp-h file.
5988fc2d0c6Smrg# This file resides in the same directory as the config header
5998fc2d0c6Smrg# that is generated.  The stamp files are numbered to have different names.
60054b44505Smrg
6018fc2d0c6Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
6028fc2d0c6Smrg# loop where config.status creates the headers, so we can generate
6038fc2d0c6Smrg# our stamp files there.
6048fc2d0c6SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
6058fc2d0c6Smrg[# Compute $1's index in $config_headers.
6068fc2d0c6Smrg_am_arg=$1
6078fc2d0c6Smrg_am_stamp_count=1
6088fc2d0c6Smrgfor _am_header in $config_headers :; do
6098fc2d0c6Smrg  case $_am_header in
6108fc2d0c6Smrg    $_am_arg | $_am_arg:* )
6118fc2d0c6Smrg      break ;;
6128fc2d0c6Smrg    * )
6138fc2d0c6Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
6148fc2d0c6Smrg  esac
6158fc2d0c6Smrgdone
6168fc2d0c6Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
61754b44505Smrg
6188fc2d0c6Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
6198fc2d0c6Smrg#
6208fc2d0c6Smrg# This file is free software; the Free Software Foundation
6218fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
6228fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
62354b44505Smrg
6248fc2d0c6Smrg# AM_PROG_INSTALL_SH
6258fc2d0c6Smrg# ------------------
6268fc2d0c6Smrg# Define $install_sh.
6278fc2d0c6SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
6288fc2d0c6Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6298fc2d0c6Smrgif test x"${install_sh+set}" != xset; then
6308fc2d0c6Smrg  case $am_aux_dir in
6318fc2d0c6Smrg  *\ * | *\	*)
6328fc2d0c6Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
6338fc2d0c6Smrg  *)
6348fc2d0c6Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
6358fc2d0c6Smrg  esac
6368fc2d0c6Smrgfi
6378fc2d0c6SmrgAC_SUBST([install_sh])])
6384a041c5bSmacallan
6398fc2d0c6Smrg# Copyright (C) 2003-2021 Free Software Foundation, Inc.
6408fc2d0c6Smrg#
6418fc2d0c6Smrg# This file is free software; the Free Software Foundation
6428fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
6438fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
6444a041c5bSmacallan
6458fc2d0c6Smrg# Check whether the underlying file-system supports filenames
6468fc2d0c6Smrg# with a leading dot.  For instance MS-DOS doesn't.
6478fc2d0c6SmrgAC_DEFUN([AM_SET_LEADING_DOT],
6488fc2d0c6Smrg[rm -rf .tst 2>/dev/null
6498fc2d0c6Smrgmkdir .tst 2>/dev/null
6508fc2d0c6Smrgif test -d .tst; then
6518fc2d0c6Smrg  am__leading_dot=.
6528fc2d0c6Smrgelse
6538fc2d0c6Smrg  am__leading_dot=_
6548fc2d0c6Smrgfi
6558fc2d0c6Smrgrmdir .tst 2>/dev/null
6568fc2d0c6SmrgAC_SUBST([am__leading_dot])])
6574a041c5bSmacallan
6588fc2d0c6Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
6598fc2d0c6Smrg# From Jim Meyering
6604a041c5bSmacallan
6618fc2d0c6Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
6628fc2d0c6Smrg#
6638fc2d0c6Smrg# This file is free software; the Free Software Foundation
6648fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
6658fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
6664a041c5bSmacallan
6678fc2d0c6Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6688fc2d0c6Smrg# ----------------------------------
6698fc2d0c6Smrg# Control maintainer-specific portions of Makefiles.
6708fc2d0c6Smrg# Default is to disable them, unless 'enable' is passed literally.
6718fc2d0c6Smrg# For symmetry, 'disable' may be passed as well.  Anyway, the user
6728fc2d0c6Smrg# can override the default with the --enable/--disable switch.
6738fc2d0c6SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6748fc2d0c6Smrg[m4_case(m4_default([$1], [disable]),
6758fc2d0c6Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
6768fc2d0c6Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
6778fc2d0c6Smrg       [m4_define([am_maintainer_other], [enable])
6788fc2d0c6Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6798fc2d0c6SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
6808fc2d0c6Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6818fc2d0c6Smrg  AC_ARG_ENABLE([maintainer-mode],
6828fc2d0c6Smrg    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
6838fc2d0c6Smrg      am_maintainer_other[ make rules and dependencies not useful
6848fc2d0c6Smrg      (and sometimes confusing) to the casual installer])],
6858fc2d0c6Smrg    [USE_MAINTAINER_MODE=$enableval],
6868fc2d0c6Smrg    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6878fc2d0c6Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6888fc2d0c6Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6898fc2d0c6Smrg  MAINT=$MAINTAINER_MODE_TRUE
6908fc2d0c6Smrg  AC_SUBST([MAINT])dnl
6918fc2d0c6Smrg]
6928fc2d0c6Smrg)
6934a041c5bSmacallan
6948fc2d0c6Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6954a041c5bSmacallan
6968fc2d0c6Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
6978fc2d0c6Smrg#
6988fc2d0c6Smrg# This file is free software; the Free Software Foundation
6998fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
7008fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
7014a041c5bSmacallan
7028fc2d0c6Smrg# AM_MAKE_INCLUDE()
7038fc2d0c6Smrg# -----------------
7048fc2d0c6Smrg# Check whether make has an 'include' directive that can support all
7058fc2d0c6Smrg# the idioms we need for our automatic dependency tracking code.
7068fc2d0c6SmrgAC_DEFUN([AM_MAKE_INCLUDE],
7078fc2d0c6Smrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
7088fc2d0c6Smrgcat > confinc.mk << 'END'
7098fc2d0c6Smrgam__doit:
7108fc2d0c6Smrg	@echo this is the am__doit target >confinc.out
7118fc2d0c6Smrg.PHONY: am__doit
7128fc2d0c6SmrgEND
7138fc2d0c6Smrgam__include="#"
7148fc2d0c6Smrgam__quote=
7158fc2d0c6Smrg# BSD make does it like this.
7168fc2d0c6Smrgecho '.include "confinc.mk" # ignored' > confmf.BSD
7178fc2d0c6Smrg# Other make implementations (GNU, Solaris 10, AIX) do it like this.
7188fc2d0c6Smrgecho 'include confinc.mk # ignored' > confmf.GNU
7198fc2d0c6Smrg_am_result=no
7208fc2d0c6Smrgfor s in GNU BSD; do
7218fc2d0c6Smrg  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
7228fc2d0c6Smrg  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
7238fc2d0c6Smrg      ['0:this is the am__doit target'],
7248fc2d0c6Smrg      [AS_CASE([$s],
7258fc2d0c6Smrg          [BSD], [am__include='.include' am__quote='"'],
7268fc2d0c6Smrg          [am__include='include' am__quote=''])])
7278fc2d0c6Smrg  if test "$am__include" != "#"; then
7288fc2d0c6Smrg    _am_result="yes ($s style)"
7298fc2d0c6Smrg    break
7308fc2d0c6Smrg  fi
7318fc2d0c6Smrgdone
7328fc2d0c6Smrgrm -f confinc.* confmf.*
7338fc2d0c6SmrgAC_MSG_RESULT([${_am_result}])
7348fc2d0c6SmrgAC_SUBST([am__include])])
7358fc2d0c6SmrgAC_SUBST([am__quote])])
7364a041c5bSmacallan
7378fc2d0c6Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
7384a041c5bSmacallan
7398fc2d0c6Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
74054b44505Smrg#
7418fc2d0c6Smrg# This file is free software; the Free Software Foundation
7428fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
7438fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
7444a041c5bSmacallan
7458fc2d0c6Smrg# AM_MISSING_PROG(NAME, PROGRAM)
7468fc2d0c6Smrg# ------------------------------
7478fc2d0c6SmrgAC_DEFUN([AM_MISSING_PROG],
7488fc2d0c6Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7498fc2d0c6Smrg$1=${$1-"${am_missing_run}$2"}
7508fc2d0c6SmrgAC_SUBST($1)])
75154b44505Smrg
7528fc2d0c6Smrg# AM_MISSING_HAS_RUN
7538fc2d0c6Smrg# ------------------
7548fc2d0c6Smrg# Define MISSING if not defined so far and test if it is modern enough.
7558fc2d0c6Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
7568fc2d0c6SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7578fc2d0c6Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7588fc2d0c6SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7598fc2d0c6Smrgif test x"${MISSING+set}" != xset; then
7608fc2d0c6Smrg  MISSING="\${SHELL} '$am_aux_dir/missing'"
7618fc2d0c6Smrgfi
7628fc2d0c6Smrg# Use eval to expand $SHELL
7638fc2d0c6Smrgif eval "$MISSING --is-lightweight"; then
7648fc2d0c6Smrg  am_missing_run="$MISSING "
7658fc2d0c6Smrgelse
7668fc2d0c6Smrg  am_missing_run=
7678fc2d0c6Smrg  AC_MSG_WARN(['missing' script is too old or missing])
7688fc2d0c6Smrgfi
76954b44505Smrg])
77054b44505Smrg
7718fc2d0c6Smrg# Helper functions for option handling.                     -*- Autoconf -*-
77254b44505Smrg
7738fc2d0c6Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
77454b44505Smrg#
7758fc2d0c6Smrg# This file is free software; the Free Software Foundation
7768fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
7778fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
77854b44505Smrg
7798fc2d0c6Smrg# _AM_MANGLE_OPTION(NAME)
78054b44505Smrg# -----------------------
7818fc2d0c6SmrgAC_DEFUN([_AM_MANGLE_OPTION],
7828fc2d0c6Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
78354b44505Smrg
7848fc2d0c6Smrg# _AM_SET_OPTION(NAME)
7858fc2d0c6Smrg# --------------------
7868fc2d0c6Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7878fc2d0c6SmrgAC_DEFUN([_AM_SET_OPTION],
7888fc2d0c6Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
78954b44505Smrg
7908fc2d0c6Smrg# _AM_SET_OPTIONS(OPTIONS)
7918fc2d0c6Smrg# ------------------------
7928fc2d0c6Smrg# OPTIONS is a space-separated list of Automake options.
7938fc2d0c6SmrgAC_DEFUN([_AM_SET_OPTIONS],
7948fc2d0c6Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
79554b44505Smrg
7968fc2d0c6Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7978fc2d0c6Smrg# -------------------------------------------
7988fc2d0c6Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7998fc2d0c6SmrgAC_DEFUN([_AM_IF_OPTION],
8008fc2d0c6Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
80154b44505Smrg
8028fc2d0c6Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
8038fc2d0c6Smrg#
8048fc2d0c6Smrg# This file is free software; the Free Software Foundation
8058fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
8068fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
80754b44505Smrg
8088fc2d0c6Smrg# _AM_PROG_CC_C_O
8098fc2d0c6Smrg# ---------------
8108fc2d0c6Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
8118fc2d0c6Smrg# to automatically call this.
8128fc2d0c6SmrgAC_DEFUN([_AM_PROG_CC_C_O],
8138fc2d0c6Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8148fc2d0c6SmrgAC_REQUIRE_AUX_FILE([compile])dnl
8158fc2d0c6SmrgAC_LANG_PUSH([C])dnl
8168fc2d0c6SmrgAC_CACHE_CHECK(
8178fc2d0c6Smrg  [whether $CC understands -c and -o together],
8188fc2d0c6Smrg  [am_cv_prog_cc_c_o],
8198fc2d0c6Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
8208fc2d0c6Smrg  # Make sure it works both with $CC and with simple cc.
8218fc2d0c6Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
8228fc2d0c6Smrg  # compilers refuse to overwrite an existing .o file with -o,
8238fc2d0c6Smrg  # though they will create one.
8248fc2d0c6Smrg  am_cv_prog_cc_c_o=yes
8258fc2d0c6Smrg  for am_i in 1 2; do
8268fc2d0c6Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
8278fc2d0c6Smrg         && test -f conftest2.$ac_objext; then
8288fc2d0c6Smrg      : OK
8298fc2d0c6Smrg    else
8308fc2d0c6Smrg      am_cv_prog_cc_c_o=no
8318fc2d0c6Smrg      break
8328fc2d0c6Smrg    fi
8338fc2d0c6Smrg  done
8348fc2d0c6Smrg  rm -f core conftest*
8358fc2d0c6Smrg  unset am_i])
8368fc2d0c6Smrgif test "$am_cv_prog_cc_c_o" != yes; then
8378fc2d0c6Smrg   # Losing compiler, so override with the script.
8388fc2d0c6Smrg   # FIXME: It is wrong to rewrite CC.
8398fc2d0c6Smrg   # But if we don't then we get into trouble of one sort or another.
8408fc2d0c6Smrg   # A longer-term fix would be to have automake use am__CC in this case,
8418fc2d0c6Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
8428fc2d0c6Smrg   CC="$am_aux_dir/compile $CC"
8438fc2d0c6Smrgfi
8448fc2d0c6SmrgAC_LANG_POP([C])])
84554b44505Smrg
8468fc2d0c6Smrg# For backward compatibility.
8478fc2d0c6SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
84854b44505Smrg
8498fc2d0c6Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
8508fc2d0c6Smrg#
8518fc2d0c6Smrg# This file is free software; the Free Software Foundation
8528fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
8538fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
85454b44505Smrg
8558fc2d0c6Smrg# AM_RUN_LOG(COMMAND)
8568fc2d0c6Smrg# -------------------
8578fc2d0c6Smrg# Run COMMAND, save the exit status in ac_status, and log it.
8588fc2d0c6Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
8598fc2d0c6SmrgAC_DEFUN([AM_RUN_LOG],
8608fc2d0c6Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
8618fc2d0c6Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
8628fc2d0c6Smrg   ac_status=$?
8638fc2d0c6Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
8648fc2d0c6Smrg   (exit $ac_status); }])
86554b44505Smrg
8668fc2d0c6Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
86754b44505Smrg
8688fc2d0c6Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
8698fc2d0c6Smrg#
8708fc2d0c6Smrg# This file is free software; the Free Software Foundation
8718fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
8728fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
87354b44505Smrg
8748fc2d0c6Smrg# AM_SANITY_CHECK
8758fc2d0c6Smrg# ---------------
8768fc2d0c6SmrgAC_DEFUN([AM_SANITY_CHECK],
8778fc2d0c6Smrg[AC_MSG_CHECKING([whether build environment is sane])
8788fc2d0c6Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8798fc2d0c6Smrg# name.  Accept space and tab only in the latter.
8808fc2d0c6Smrgam_lf='
8818fc2d0c6Smrg'
8828fc2d0c6Smrgcase `pwd` in
8838fc2d0c6Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8848fc2d0c6Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8858fc2d0c6Smrgesac
8868fc2d0c6Smrgcase $srcdir in
8878fc2d0c6Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8888fc2d0c6Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
8898fc2d0c6Smrgesac
8904a041c5bSmacallan
8918fc2d0c6Smrg# Do 'set' in a subshell so we don't clobber the current shell's
8928fc2d0c6Smrg# arguments.  Must try -L first in case configure is actually a
8938fc2d0c6Smrg# symlink; some systems play weird games with the mod time of symlinks
8948fc2d0c6Smrg# (eg FreeBSD returns the mod time of the symlink's containing
8958fc2d0c6Smrg# directory).
8968fc2d0c6Smrgif (
8978fc2d0c6Smrg   am_has_slept=no
8988fc2d0c6Smrg   for am_try in 1 2; do
8998fc2d0c6Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
9008fc2d0c6Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
9018fc2d0c6Smrg     if test "$[*]" = "X"; then
9028fc2d0c6Smrg	# -L didn't work.
9038fc2d0c6Smrg	set X `ls -t "$srcdir/configure" conftest.file`
9048fc2d0c6Smrg     fi
9058fc2d0c6Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
9068fc2d0c6Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
9074a041c5bSmacallan
9088fc2d0c6Smrg	# If neither matched, then we have a broken ls.  This can happen
9098fc2d0c6Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
9108fc2d0c6Smrg	# broken ls alias from the environment.  This has actually
9118fc2d0c6Smrg	# happened.  Such a system could not be considered "sane".
9128fc2d0c6Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
9138fc2d0c6Smrg  alias in your environment])
9148fc2d0c6Smrg     fi
9158fc2d0c6Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
9168fc2d0c6Smrg       break
9178fc2d0c6Smrg     fi
9188fc2d0c6Smrg     # Just in case.
9198fc2d0c6Smrg     sleep 1
9208fc2d0c6Smrg     am_has_slept=yes
9218fc2d0c6Smrg   done
9228fc2d0c6Smrg   test "$[2]" = conftest.file
9238fc2d0c6Smrg   )
9248fc2d0c6Smrgthen
9258fc2d0c6Smrg   # Ok.
9268fc2d0c6Smrg   :
9278fc2d0c6Smrgelse
9288fc2d0c6Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
9298fc2d0c6SmrgCheck your system clock])
9308fc2d0c6Smrgfi
9318fc2d0c6SmrgAC_MSG_RESULT([yes])
9328fc2d0c6Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
9338fc2d0c6Smrg# generated files are strictly newer.
9348fc2d0c6Smrgam_sleep_pid=
9358fc2d0c6Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
9368fc2d0c6Smrg  ( sleep 1 ) &
9378fc2d0c6Smrg  am_sleep_pid=$!
9388fc2d0c6Smrgfi
9398fc2d0c6SmrgAC_CONFIG_COMMANDS_PRE(
9408fc2d0c6Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
9418fc2d0c6Smrg   if test -n "$am_sleep_pid"; then
9428fc2d0c6Smrg     # Hide warnings about reused PIDs.
9438fc2d0c6Smrg     wait $am_sleep_pid 2>/dev/null
9448fc2d0c6Smrg   fi
9458fc2d0c6Smrg   AC_MSG_RESULT([done])])
9468fc2d0c6Smrgrm -f conftest.file
94754b44505Smrg])
9484a041c5bSmacallan
9498fc2d0c6Smrg# Copyright (C) 2009-2021 Free Software Foundation, Inc.
9508fc2d0c6Smrg#
9518fc2d0c6Smrg# This file is free software; the Free Software Foundation
9528fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
9538fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
9544a041c5bSmacallan
9558fc2d0c6Smrg# AM_SILENT_RULES([DEFAULT])
9568fc2d0c6Smrg# --------------------------
9578fc2d0c6Smrg# Enable less verbose build rules; with the default set to DEFAULT
9588fc2d0c6Smrg# ("yes" being less verbose, "no" or empty being verbose).
9598fc2d0c6SmrgAC_DEFUN([AM_SILENT_RULES],
9608fc2d0c6Smrg[AC_ARG_ENABLE([silent-rules], [dnl
9618fc2d0c6SmrgAS_HELP_STRING(
9628fc2d0c6Smrg  [--enable-silent-rules],
9638fc2d0c6Smrg  [less verbose build output (undo: "make V=1")])
9648fc2d0c6SmrgAS_HELP_STRING(
9658fc2d0c6Smrg  [--disable-silent-rules],
9668fc2d0c6Smrg  [verbose build output (undo: "make V=0")])dnl
9678fc2d0c6Smrg])
9688fc2d0c6Smrgcase $enable_silent_rules in @%:@ (((
9698fc2d0c6Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
9708fc2d0c6Smrg   no) AM_DEFAULT_VERBOSITY=1;;
9718fc2d0c6Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
9728fc2d0c6Smrgesac
9738fc2d0c6Smrgdnl
9748fc2d0c6Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9758fc2d0c6Smrgdnl do not support nested variable expansions.
9768fc2d0c6Smrgdnl See automake bug#9928 and bug#10237.
9778fc2d0c6Smrgam_make=${MAKE-make}
9788fc2d0c6SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
9798fc2d0c6Smrg   [am_cv_make_support_nested_variables],
9808fc2d0c6Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
9818fc2d0c6SmrgBAR0=false
9828fc2d0c6SmrgBAR1=true
9838fc2d0c6SmrgV=1
9848fc2d0c6Smrgam__doit:
9858fc2d0c6Smrg	@$(TRUE)
9868fc2d0c6Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9878fc2d0c6Smrg  am_cv_make_support_nested_variables=yes
9888fc2d0c6Smrgelse
9898fc2d0c6Smrg  am_cv_make_support_nested_variables=no
9908fc2d0c6Smrgfi])
9918fc2d0c6Smrgif test $am_cv_make_support_nested_variables = yes; then
9928fc2d0c6Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9938fc2d0c6Smrg  AM_V='$(V)'
9948fc2d0c6Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9958fc2d0c6Smrgelse
9968fc2d0c6Smrg  AM_V=$AM_DEFAULT_VERBOSITY
9978fc2d0c6Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
9984a041c5bSmacallanfi
9998fc2d0c6SmrgAC_SUBST([AM_V])dnl
10008fc2d0c6SmrgAM_SUBST_NOTMAKE([AM_V])dnl
10018fc2d0c6SmrgAC_SUBST([AM_DEFAULT_V])dnl
10028fc2d0c6SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
10038fc2d0c6SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
10048fc2d0c6SmrgAM_BACKSLASH='\'
10058fc2d0c6SmrgAC_SUBST([AM_BACKSLASH])dnl
10068fc2d0c6Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10078fc2d0c6Smrg])
100854b44505Smrg
10098fc2d0c6Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
10108fc2d0c6Smrg#
10118fc2d0c6Smrg# This file is free software; the Free Software Foundation
10128fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
10138fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
101454b44505Smrg
10158fc2d0c6Smrg# AM_PROG_INSTALL_STRIP
10168fc2d0c6Smrg# ---------------------
10178fc2d0c6Smrg# One issue with vendor 'install' (even GNU) is that you can't
10188fc2d0c6Smrg# specify the program used to strip binaries.  This is especially
10198fc2d0c6Smrg# annoying in cross-compiling environments, where the build's strip
10208fc2d0c6Smrg# is unlikely to handle the host's binaries.
10218fc2d0c6Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
10228fc2d0c6Smrg# always use install-sh in "make install-strip", and initialize
10238fc2d0c6Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
10248fc2d0c6SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
10258fc2d0c6Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
10268fc2d0c6Smrg# Installed binaries are usually stripped using 'strip' when the user
10278fc2d0c6Smrg# run "make install-strip".  However 'strip' might not be the right
10288fc2d0c6Smrg# tool to use in cross-compilation environments, therefore Automake
10298fc2d0c6Smrg# will honor the 'STRIP' environment variable to overrule this program.
10308fc2d0c6Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
10318fc2d0c6Smrgif test "$cross_compiling" != no; then
10328fc2d0c6Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
10338fc2d0c6Smrgfi
10348fc2d0c6SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10358fc2d0c6SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
103654b44505Smrg
10378fc2d0c6Smrg# Copyright (C) 2006-2021 Free Software Foundation, Inc.
10388fc2d0c6Smrg#
10398fc2d0c6Smrg# This file is free software; the Free Software Foundation
10408fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
10418fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
10424a041c5bSmacallan
10438fc2d0c6Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
10448fc2d0c6Smrg# ---------------------------
10458fc2d0c6Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
10468fc2d0c6Smrg# This macro is traced by Automake.
10478fc2d0c6SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
10484a041c5bSmacallan
10498fc2d0c6Smrg# AM_SUBST_NOTMAKE(VARIABLE)
10508fc2d0c6Smrg# --------------------------
10518fc2d0c6Smrg# Public sister of _AM_SUBST_NOTMAKE.
10528fc2d0c6SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
10530a392d7eSmrg
10548fc2d0c6Smrg# Check how to create a tarball.                            -*- Autoconf -*-
10550a392d7eSmrg
10568fc2d0c6Smrg# Copyright (C) 2004-2021 Free Software Foundation, Inc.
10578fc2d0c6Smrg#
10588fc2d0c6Smrg# This file is free software; the Free Software Foundation
10598fc2d0c6Smrg# gives unlimited permission to copy and/or distribute it,
10608fc2d0c6Smrg# with or without modifications, as long as this notice is preserved.
10614a041c5bSmacallan
10628fc2d0c6Smrg# _AM_PROG_TAR(FORMAT)
10638fc2d0c6Smrg# --------------------
10648fc2d0c6Smrg# Check how to create a tarball in format FORMAT.
10658fc2d0c6Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
10668fc2d0c6Smrg#
10678fc2d0c6Smrg# Substitute a variable $(am__tar) that is a command
10688fc2d0c6Smrg# writing to stdout a FORMAT-tarball containing the directory
10698fc2d0c6Smrg# $tardir.
10708fc2d0c6Smrg#     tardir=directory && $(am__tar) > result.tar
10718fc2d0c6Smrg#
10728fc2d0c6Smrg# Substitute a variable $(am__untar) that extract such
10738fc2d0c6Smrg# a tarball read from stdin.
10748fc2d0c6Smrg#     $(am__untar) < result.tar
10758fc2d0c6Smrg#
10768fc2d0c6SmrgAC_DEFUN([_AM_PROG_TAR],
10778fc2d0c6Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
10788fc2d0c6Smrg# in the wild :-(  We should find a proper way to deprecate it ...
10798fc2d0c6SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
10800a392d7eSmrg
10818fc2d0c6Smrg# We'll loop over all known methods to create a tar archive until one works.
10828fc2d0c6Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10834a041c5bSmacallan
10848fc2d0c6Smrgm4_if([$1], [v7],
10858fc2d0c6Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
10860a392d7eSmrg
10878fc2d0c6Smrg  [m4_case([$1],
10888fc2d0c6Smrg    [ustar],
10898fc2d0c6Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
10908fc2d0c6Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
10918fc2d0c6Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
10928fc2d0c6Smrg      # and bug#13588).
10938fc2d0c6Smrg      am_max_uid=2097151 # 2^21 - 1
10948fc2d0c6Smrg      am_max_gid=$am_max_uid
10958fc2d0c6Smrg      # The $UID and $GID variables are not portable, so we need to resort
10968fc2d0c6Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
10978fc2d0c6Smrg      # below are definitely unexpected, so allow the users to see them
10988fc2d0c6Smrg      # (that is, avoid stderr redirection).
10998fc2d0c6Smrg      am_uid=`id -u || echo unknown`
11008fc2d0c6Smrg      am_gid=`id -g || echo unknown`
11018fc2d0c6Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
11028fc2d0c6Smrg      if test $am_uid -le $am_max_uid; then
11038fc2d0c6Smrg         AC_MSG_RESULT([yes])
11048fc2d0c6Smrg      else
11058fc2d0c6Smrg         AC_MSG_RESULT([no])
11068fc2d0c6Smrg         _am_tools=none
11078fc2d0c6Smrg      fi
11088fc2d0c6Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
11098fc2d0c6Smrg      if test $am_gid -le $am_max_gid; then
11108fc2d0c6Smrg         AC_MSG_RESULT([yes])
11118fc2d0c6Smrg      else
11128fc2d0c6Smrg        AC_MSG_RESULT([no])
11138fc2d0c6Smrg        _am_tools=none
11148fc2d0c6Smrg      fi],
11150a392d7eSmrg
11168fc2d0c6Smrg  [pax],
11178fc2d0c6Smrg    [],
11180a392d7eSmrg
11198fc2d0c6Smrg  [m4_fatal([Unknown tar format])])
11200a392d7eSmrg
11218fc2d0c6Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
11220a392d7eSmrg
11238fc2d0c6Smrg  # Go ahead even if we have the value already cached.  We do so because we
11248fc2d0c6Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
11258fc2d0c6Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
11264a041c5bSmacallan
11278fc2d0c6Smrg  for _am_tool in $_am_tools; do
11288fc2d0c6Smrg    case $_am_tool in
11298fc2d0c6Smrg    gnutar)
11308fc2d0c6Smrg      for _am_tar in tar gnutar gtar; do
11318fc2d0c6Smrg        AM_RUN_LOG([$_am_tar --version]) && break
11328fc2d0c6Smrg      done
11338fc2d0c6Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
11348fc2d0c6Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
11358fc2d0c6Smrg      am__untar="$_am_tar -xf -"
11368fc2d0c6Smrg      ;;
11378fc2d0c6Smrg    plaintar)
11388fc2d0c6Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
11398fc2d0c6Smrg      # ustar tarball either.
11408fc2d0c6Smrg      (tar --version) >/dev/null 2>&1 && continue
11418fc2d0c6Smrg      am__tar='tar chf - "$$tardir"'
11428fc2d0c6Smrg      am__tar_='tar chf - "$tardir"'
11438fc2d0c6Smrg      am__untar='tar xf -'
11448fc2d0c6Smrg      ;;
11458fc2d0c6Smrg    pax)
11468fc2d0c6Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
11478fc2d0c6Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
11488fc2d0c6Smrg      am__untar='pax -r'
11498fc2d0c6Smrg      ;;
11508fc2d0c6Smrg    cpio)
11518fc2d0c6Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11528fc2d0c6Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11538fc2d0c6Smrg      am__untar='cpio -i -H $1 -d'
11548fc2d0c6Smrg      ;;
11558fc2d0c6Smrg    none)
11568fc2d0c6Smrg      am__tar=false
11578fc2d0c6Smrg      am__tar_=false
11588fc2d0c6Smrg      am__untar=false
11598fc2d0c6Smrg      ;;
11608fc2d0c6Smrg    esac
11614a041c5bSmacallan
11628fc2d0c6Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
11638fc2d0c6Smrg    # and am__untar set.
11648fc2d0c6Smrg    test -n "${am_cv_prog_tar_$1}" && break
11654a041c5bSmacallan
11668fc2d0c6Smrg    # tar/untar a dummy directory, and stop if the command works.
11678fc2d0c6Smrg    rm -rf conftest.dir
11688fc2d0c6Smrg    mkdir conftest.dir
11698fc2d0c6Smrg    echo GrepMe > conftest.dir/file
11708fc2d0c6Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11718fc2d0c6Smrg    rm -rf conftest.dir
11728fc2d0c6Smrg    if test -s conftest.tar; then
11738fc2d0c6Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
11748fc2d0c6Smrg      AM_RUN_LOG([cat conftest.dir/file])
11758fc2d0c6Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11768fc2d0c6Smrg    fi
11778fc2d0c6Smrg  done
11788fc2d0c6Smrg  rm -rf conftest.dir
11794a041c5bSmacallan
11808fc2d0c6Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11818fc2d0c6Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
118254b44505Smrg
11838fc2d0c6SmrgAC_SUBST([am__tar])
11848fc2d0c6SmrgAC_SUBST([am__untar])
11858fc2d0c6Smrg]) # _AM_PROG_TAR
118654b44505Smrg
11878fc2d0c6Smrgdnl Copyright 2005 Red Hat, Inc
11888fc2d0c6Smrgdnl 
11898fc2d0c6Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11908fc2d0c6Smrgdnl documentation for any purpose is hereby granted without fee, provided that
11918fc2d0c6Smrgdnl the above copyright notice appear in all copies and that both that
11928fc2d0c6Smrgdnl copyright notice and this permission notice appear in supporting
11938fc2d0c6Smrgdnl documentation.
11948fc2d0c6Smrgdnl 
11958fc2d0c6Smrgdnl The above copyright notice and this permission notice shall be included
11968fc2d0c6Smrgdnl in all copies or substantial portions of the Software.
11978fc2d0c6Smrgdnl 
11988fc2d0c6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11998fc2d0c6Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12008fc2d0c6Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
12018fc2d0c6Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
12028fc2d0c6Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
12038fc2d0c6Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
12048fc2d0c6Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
12058fc2d0c6Smrgdnl 
12068fc2d0c6Smrgdnl Except as contained in this notice, the name of the copyright holders shall
12078fc2d0c6Smrgdnl not be used in advertising or otherwise to promote the sale, use or
12088fc2d0c6Smrgdnl other dealings in this Software without prior written authorization
12098fc2d0c6Smrgdnl from the copyright holders.
12108fc2d0c6Smrgdnl 
121154b44505Smrg
12128fc2d0c6Smrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
12138fc2d0c6Smrg# --------------------------
12148fc2d0c6Smrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
12158fc2d0c6Smrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
121654b44505Smrg
12178fc2d0c6SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
12188fc2d0c6Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
12198fc2d0c6Smrg	SAVE_CFLAGS="$CFLAGS"
12208fc2d0c6Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
12218fc2d0c6Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12228fc2d0c6Smrg#include "xorg-server.h"
12238fc2d0c6Smrg#if !defined $1
12248fc2d0c6Smrg#error $1 not defined
12258fc2d0c6Smrg#endif
12268fc2d0c6Smrg		]])],
12278fc2d0c6Smrg		[_EXT_CHECK=yes],
12288fc2d0c6Smrg		[_EXT_CHECK=no])
12298fc2d0c6Smrg	CFLAGS="$SAVE_CFLAGS"
12308fc2d0c6Smrg	AC_MSG_CHECKING([if $1 is defined])
12318fc2d0c6Smrg	AC_MSG_RESULT([$_EXT_CHECK])
12328fc2d0c6Smrg	if test "$_EXT_CHECK" != no; then
12338fc2d0c6Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
12348fc2d0c6Smrg	fi
12358fc2d0c6Smrg])
123654b44505Smrg
12378fc2d0c6Smrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
12388fc2d0c6Smrgdnl serial 11 (pkg-config-0.29)
12398fc2d0c6Smrgdnl
12408fc2d0c6Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
12418fc2d0c6Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
12428fc2d0c6Smrgdnl
12438fc2d0c6Smrgdnl This program is free software; you can redistribute it and/or modify
12448fc2d0c6Smrgdnl it under the terms of the GNU General Public License as published by
12458fc2d0c6Smrgdnl the Free Software Foundation; either version 2 of the License, or
12468fc2d0c6Smrgdnl (at your option) any later version.
12478fc2d0c6Smrgdnl
12488fc2d0c6Smrgdnl This program is distributed in the hope that it will be useful, but
12498fc2d0c6Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
12508fc2d0c6Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12518fc2d0c6Smrgdnl General Public License for more details.
12528fc2d0c6Smrgdnl
12538fc2d0c6Smrgdnl You should have received a copy of the GNU General Public License
12548fc2d0c6Smrgdnl along with this program; if not, write to the Free Software
12558fc2d0c6Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
12568fc2d0c6Smrgdnl 02111-1307, USA.
12578fc2d0c6Smrgdnl
12588fc2d0c6Smrgdnl As a special exception to the GNU General Public License, if you
12598fc2d0c6Smrgdnl distribute this file as part of a program that contains a
12608fc2d0c6Smrgdnl configuration script generated by Autoconf, you may include it under
12618fc2d0c6Smrgdnl the same distribution terms that you use for the rest of that
12628fc2d0c6Smrgdnl program.
12638fc2d0c6Smrg
12648fc2d0c6Smrgdnl PKG_PREREQ(MIN-VERSION)
12658fc2d0c6Smrgdnl -----------------------
12668fc2d0c6Smrgdnl Since: 0.29
12678fc2d0c6Smrgdnl
12688fc2d0c6Smrgdnl Verify that the version of the pkg-config macros are at least
12698fc2d0c6Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
12708fc2d0c6Smrgdnl installed version of pkg-config, this checks the developer's version
12718fc2d0c6Smrgdnl of pkg.m4 when generating configure.
12728fc2d0c6Smrgdnl
12738fc2d0c6Smrgdnl To ensure that this macro is defined, also add:
12748fc2d0c6Smrgdnl m4_ifndef([PKG_PREREQ],
12758fc2d0c6Smrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
12768fc2d0c6Smrgdnl
12778fc2d0c6Smrgdnl See the "Since" comment for each macro you use to see what version
12788fc2d0c6Smrgdnl of the macros you require.
12798fc2d0c6Smrgm4_defun([PKG_PREREQ],
12808fc2d0c6Smrg[m4_define([PKG_MACROS_VERSION], [0.29])
12818fc2d0c6Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
12828fc2d0c6Smrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
12838fc2d0c6Smrg])dnl PKG_PREREQ
12848fc2d0c6Smrg
12858fc2d0c6Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
12868fc2d0c6Smrgdnl ----------------------------------
12878fc2d0c6Smrgdnl Since: 0.16
12888fc2d0c6Smrgdnl
12898fc2d0c6Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
12908fc2d0c6Smrgdnl first found in the path. Checks that the version of pkg-config found
12918fc2d0c6Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
12928fc2d0c6Smrgdnl used since that's the first version where most current features of
12938fc2d0c6Smrgdnl pkg-config existed.
12948fc2d0c6SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
12958fc2d0c6Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
12968fc2d0c6Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
12978fc2d0c6Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
12988fc2d0c6SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
12998fc2d0c6SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
13008fc2d0c6SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
130154b44505Smrg
13028fc2d0c6Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
13038fc2d0c6Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
13048fc2d0c6Smrgfi
13058fc2d0c6Smrgif test -n "$PKG_CONFIG"; then
13068fc2d0c6Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
13078fc2d0c6Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
13088fc2d0c6Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
13098fc2d0c6Smrg		AC_MSG_RESULT([yes])
13108fc2d0c6Smrg	else
13118fc2d0c6Smrg		AC_MSG_RESULT([no])
13128fc2d0c6Smrg		PKG_CONFIG=""
13138fc2d0c6Smrg	fi
13148fc2d0c6Smrgfi[]dnl
13158fc2d0c6Smrg])dnl PKG_PROG_PKG_CONFIG
131654b44505Smrg
13178fc2d0c6Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
13188fc2d0c6Smrgdnl -------------------------------------------------------------------
13198fc2d0c6Smrgdnl Since: 0.18
13208fc2d0c6Smrgdnl
13218fc2d0c6Smrgdnl Check to see whether a particular set of modules exists. Similar to
13228fc2d0c6Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
13238fc2d0c6Smrgdnl
13248fc2d0c6Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
13258fc2d0c6Smrgdnl only at the first occurence in configure.ac, so if the first place
13268fc2d0c6Smrgdnl it's called might be skipped (such as if it is within an "if", you
13278fc2d0c6Smrgdnl have to call PKG_CHECK_EXISTS manually
13288fc2d0c6SmrgAC_DEFUN([PKG_CHECK_EXISTS],
13298fc2d0c6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
13308fc2d0c6Smrgif test -n "$PKG_CONFIG" && \
13318fc2d0c6Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
13328fc2d0c6Smrg  m4_default([$2], [:])
13338fc2d0c6Smrgm4_ifvaln([$3], [else
13348fc2d0c6Smrg  $3])dnl
13358fc2d0c6Smrgfi])
133654b44505Smrg
13378fc2d0c6Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
13388fc2d0c6Smrgdnl ---------------------------------------------
13398fc2d0c6Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
13408fc2d0c6Smrgdnl pkg_failed based on the result.
13418fc2d0c6Smrgm4_define([_PKG_CONFIG],
13428fc2d0c6Smrg[if test -n "$$1"; then
13438fc2d0c6Smrg    pkg_cv_[]$1="$$1"
13448fc2d0c6Smrg elif test -n "$PKG_CONFIG"; then
13458fc2d0c6Smrg    PKG_CHECK_EXISTS([$3],
13468fc2d0c6Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
13478fc2d0c6Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
13488fc2d0c6Smrg		     [pkg_failed=yes])
13498fc2d0c6Smrg else
13508fc2d0c6Smrg    pkg_failed=untried
13518fc2d0c6Smrgfi[]dnl
13528fc2d0c6Smrg])dnl _PKG_CONFIG
135354b44505Smrg
13548fc2d0c6Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED
13558fc2d0c6Smrgdnl ---------------------------
13568fc2d0c6Smrgdnl Internal check to see if pkg-config supports short errors.
13578fc2d0c6SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
13588fc2d0c6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
13598fc2d0c6Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
13608fc2d0c6Smrg        _pkg_short_errors_supported=yes
13618fc2d0c6Smrgelse
13628fc2d0c6Smrg        _pkg_short_errors_supported=no
13638fc2d0c6Smrgfi[]dnl
13648fc2d0c6Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
136554b44505Smrg
136654b44505Smrg
13678fc2d0c6Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
13688fc2d0c6Smrgdnl   [ACTION-IF-NOT-FOUND])
13698fc2d0c6Smrgdnl --------------------------------------------------------------
13708fc2d0c6Smrgdnl Since: 0.4.0
13718fc2d0c6Smrgdnl
13728fc2d0c6Smrgdnl Note that if there is a possibility the first call to
13738fc2d0c6Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
13748fc2d0c6Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
13758fc2d0c6SmrgAC_DEFUN([PKG_CHECK_MODULES],
13768fc2d0c6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
13778fc2d0c6SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
13788fc2d0c6SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
13790a392d7eSmrg
13808fc2d0c6Smrgpkg_failed=no
13818fc2d0c6SmrgAC_MSG_CHECKING([for $1])
13820a392d7eSmrg
13838fc2d0c6Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
13848fc2d0c6Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
138554b44505Smrg
13868fc2d0c6Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
13878fc2d0c6Smrgand $1[]_LIBS to avoid the need to call pkg-config.
13888fc2d0c6SmrgSee the pkg-config man page for more details.])
138954b44505Smrg
13908fc2d0c6Smrgif test $pkg_failed = yes; then
13918fc2d0c6Smrg   	AC_MSG_RESULT([no])
13928fc2d0c6Smrg        _PKG_SHORT_ERRORS_SUPPORTED
13938fc2d0c6Smrg        if test $_pkg_short_errors_supported = yes; then
13948fc2d0c6Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
13958fc2d0c6Smrg        else 
13968fc2d0c6Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
13978fc2d0c6Smrg        fi
13988fc2d0c6Smrg	# Put the nasty error message in config.log where it belongs
13998fc2d0c6Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
140054b44505Smrg
14018fc2d0c6Smrg	m4_default([$4], [AC_MSG_ERROR(
14028fc2d0c6Smrg[Package requirements ($2) were not met:
140354b44505Smrg
14048fc2d0c6Smrg$$1_PKG_ERRORS
14050a392d7eSmrg
14068fc2d0c6SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14078fc2d0c6Smrginstalled software in a non-standard prefix.
140854b44505Smrg
14098fc2d0c6Smrg_PKG_TEXT])[]dnl
14108fc2d0c6Smrg        ])
14118fc2d0c6Smrgelif test $pkg_failed = untried; then
14128fc2d0c6Smrg     	AC_MSG_RESULT([no])
14138fc2d0c6Smrg	m4_default([$4], [AC_MSG_FAILURE(
14148fc2d0c6Smrg[The pkg-config script could not be found or is too old.  Make sure it
14158fc2d0c6Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
14168fc2d0c6Smrgpath to pkg-config.
141754b44505Smrg
14188fc2d0c6Smrg_PKG_TEXT
141954b44505Smrg
14208fc2d0c6SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
14218fc2d0c6Smrg        ])
14228fc2d0c6Smrgelse
14238fc2d0c6Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
14248fc2d0c6Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
14258fc2d0c6Smrg        AC_MSG_RESULT([yes])
14268fc2d0c6Smrg	$3
14278fc2d0c6Smrgfi[]dnl
14288fc2d0c6Smrg])dnl PKG_CHECK_MODULES
142954b44505Smrg
143054b44505Smrg
14318fc2d0c6Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
14328fc2d0c6Smrgdnl   [ACTION-IF-NOT-FOUND])
14338fc2d0c6Smrgdnl ---------------------------------------------------------------------
14348fc2d0c6Smrgdnl Since: 0.29
14358fc2d0c6Smrgdnl
14368fc2d0c6Smrgdnl Checks for existence of MODULES and gathers its build flags with
14378fc2d0c6Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
14388fc2d0c6Smrgdnl and VARIABLE-PREFIX_LIBS from --libs.
14398fc2d0c6Smrgdnl
14408fc2d0c6Smrgdnl Note that if there is a possibility the first call to
14418fc2d0c6Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
14428fc2d0c6Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
14438fc2d0c6Smrgdnl configure.ac.
14448fc2d0c6SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
14458fc2d0c6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14468fc2d0c6Smrg_save_PKG_CONFIG=$PKG_CONFIG
14478fc2d0c6SmrgPKG_CONFIG="$PKG_CONFIG --static"
14488fc2d0c6SmrgPKG_CHECK_MODULES($@)
14498fc2d0c6SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
14508fc2d0c6Smrg])dnl PKG_CHECK_MODULES_STATIC
145154b44505Smrg
145254b44505Smrg
14538fc2d0c6Smrgdnl PKG_INSTALLDIR([DIRECTORY])
14548fc2d0c6Smrgdnl -------------------------
14558fc2d0c6Smrgdnl Since: 0.27
14568fc2d0c6Smrgdnl
14578fc2d0c6Smrgdnl Substitutes the variable pkgconfigdir as the location where a module
14588fc2d0c6Smrgdnl should install pkg-config .pc files. By default the directory is
14598fc2d0c6Smrgdnl $libdir/pkgconfig, but the default can be changed by passing
14608fc2d0c6Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
14618fc2d0c6Smrgdnl parameter.
14628fc2d0c6SmrgAC_DEFUN([PKG_INSTALLDIR],
14638fc2d0c6Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
14648fc2d0c6Smrgm4_pushdef([pkg_description],
14658fc2d0c6Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
14668fc2d0c6SmrgAC_ARG_WITH([pkgconfigdir],
14678fc2d0c6Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
14688fc2d0c6Smrg    [with_pkgconfigdir=]pkg_default)
14698fc2d0c6SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
14708fc2d0c6Smrgm4_popdef([pkg_default])
14718fc2d0c6Smrgm4_popdef([pkg_description])
14728fc2d0c6Smrg])dnl PKG_INSTALLDIR
147354b44505Smrg
147454b44505Smrg
14758fc2d0c6Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
14768fc2d0c6Smrgdnl --------------------------------
14778fc2d0c6Smrgdnl Since: 0.27
14788fc2d0c6Smrgdnl
14798fc2d0c6Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
14808fc2d0c6Smrgdnl module should install arch-independent pkg-config .pc files. By
14818fc2d0c6Smrgdnl default the directory is $datadir/pkgconfig, but the default can be
14828fc2d0c6Smrgdnl changed by passing DIRECTORY. The user can override through the
14838fc2d0c6Smrgdnl --with-noarch-pkgconfigdir parameter.
14848fc2d0c6SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
14858fc2d0c6Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
14868fc2d0c6Smrgm4_pushdef([pkg_description],
14878fc2d0c6Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
14888fc2d0c6SmrgAC_ARG_WITH([noarch-pkgconfigdir],
14898fc2d0c6Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
14908fc2d0c6Smrg    [with_noarch_pkgconfigdir=]pkg_default)
14918fc2d0c6SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
14928fc2d0c6Smrgm4_popdef([pkg_default])
14938fc2d0c6Smrgm4_popdef([pkg_description])
14948fc2d0c6Smrg])dnl PKG_NOARCH_INSTALLDIR
149554b44505Smrg
149654b44505Smrg
14978fc2d0c6Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
14988fc2d0c6Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
14998fc2d0c6Smrgdnl -------------------------------------------
15008fc2d0c6Smrgdnl Since: 0.28
15018fc2d0c6Smrgdnl
15028fc2d0c6Smrgdnl Retrieves the value of the pkg-config variable for the given module.
15038fc2d0c6SmrgAC_DEFUN([PKG_CHECK_VAR],
15048fc2d0c6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
15058fc2d0c6SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
150654b44505Smrg
15078fc2d0c6Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
15088fc2d0c6SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
150954b44505Smrg
15108fc2d0c6SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
15118fc2d0c6Smrg])dnl PKG_CHECK_VAR
15120a392d7eSmrg
15138fc2d0c6Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
15148fc2d0c6Smrgdnl
15158fc2d0c6Smrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
15168fc2d0c6Smrgdnl
15178fc2d0c6Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
15188fc2d0c6Smrgdnl copy of this software and associated documentation files (the "Software"),
15198fc2d0c6Smrgdnl to deal in the Software without restriction, including without limitation
15208fc2d0c6Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
15218fc2d0c6Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
15228fc2d0c6Smrgdnl Software is furnished to do so, subject to the following conditions:
15238fc2d0c6Smrgdnl
15248fc2d0c6Smrgdnl The above copyright notice and this permission notice (including the next
15258fc2d0c6Smrgdnl paragraph) shall be included in all copies or substantial portions of the
15268fc2d0c6Smrgdnl Software.
15278fc2d0c6Smrgdnl
15288fc2d0c6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15298fc2d0c6Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15308fc2d0c6Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
15318fc2d0c6Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15328fc2d0c6Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
15338fc2d0c6Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
15348fc2d0c6Smrgdnl DEALINGS IN THE SOFTWARE.
15350a392d7eSmrg
15368fc2d0c6Smrg# XORG_MACROS_VERSION(required-version)
15378fc2d0c6Smrg# -------------------------------------
15388fc2d0c6Smrg# Minimum version: 1.1.0
15398fc2d0c6Smrg#
15408fc2d0c6Smrg# If you're using a macro added in Version 1.1 or newer, include this in
15418fc2d0c6Smrg# your configure.ac with the minimum required version, such as:
15428fc2d0c6Smrg# XORG_MACROS_VERSION(1.1)
15438fc2d0c6Smrg#
15448fc2d0c6Smrg# To ensure that this macro is defined, also add:
15458fc2d0c6Smrg# m4_ifndef([XORG_MACROS_VERSION],
15468fc2d0c6Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
15478fc2d0c6Smrg#
15488fc2d0c6Smrg#
15498fc2d0c6Smrg# See the "minimum version" comment for each macro you use to see what
15508fc2d0c6Smrg# version you require.
15518fc2d0c6Smrgm4_defun([XORG_MACROS_VERSION],[
15528fc2d0c6Smrgm4_define([vers_have], [1.19.3])
15538fc2d0c6Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
15548fc2d0c6Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
15558fc2d0c6Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
15568fc2d0c6Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
15578fc2d0c6Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
15588fc2d0c6Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
15598fc2d0c6Smrgm4_undefine([vers_have])
15608fc2d0c6Smrgm4_undefine([maj_have])
15618fc2d0c6Smrgm4_undefine([maj_needed])
15628fc2d0c6Smrg]) # XORG_MACROS_VERSION
15634a041c5bSmacallan
15648fc2d0c6Smrg# XORG_PROG_RAWCPP()
15658fc2d0c6Smrg# ------------------
15668fc2d0c6Smrg# Minimum version: 1.0.0
15678fc2d0c6Smrg#
15688fc2d0c6Smrg# Find cpp program and necessary flags for use in pre-processing text files
15698fc2d0c6Smrg# such as man pages and config files
15708fc2d0c6SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
15718fc2d0c6SmrgAC_REQUIRE([AC_PROG_CPP])
15728fc2d0c6SmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
15738fc2d0c6Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
15744a041c5bSmacallan
15758fc2d0c6Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
15768fc2d0c6Smrg# which is not the best choice for supporting other OS'es, but covers most
15778fc2d0c6Smrg# of the ones we need for now.
15788fc2d0c6SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
15798fc2d0c6SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
15808fc2d0c6Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
15818fc2d0c6Smrg	AC_MSG_RESULT([no])
15828fc2d0c6Smrgelse
15838fc2d0c6Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
15848fc2d0c6Smrg		RAWCPPFLAGS=-undef
15858fc2d0c6Smrg		AC_MSG_RESULT([yes])
15868fc2d0c6Smrg	# under Cygwin unix is still defined even with -undef
15878fc2d0c6Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
15888fc2d0c6Smrg		RAWCPPFLAGS="-undef -ansi"
15898fc2d0c6Smrg		AC_MSG_RESULT([yes, with -ansi])
15908fc2d0c6Smrg	else
15918fc2d0c6Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
15928fc2d0c6Smrg	fi
15938fc2d0c6Smrgfi
15948fc2d0c6Smrgrm -f conftest.$ac_ext
15954a041c5bSmacallan
15968fc2d0c6SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
15978fc2d0c6SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
15988fc2d0c6Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
15998fc2d0c6Smrg	AC_MSG_RESULT([no])
16004a041c5bSmacallanelse
16018fc2d0c6Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
16028fc2d0c6Smrg		TRADITIONALCPPFLAGS="-traditional"
16038fc2d0c6Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
16048fc2d0c6Smrg		AC_MSG_RESULT([yes])
16058fc2d0c6Smrg	else
16068fc2d0c6Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
16078fc2d0c6Smrg	fi
160854b44505Smrgfi
16098fc2d0c6Smrgrm -f conftest.$ac_ext
16108fc2d0c6SmrgAC_SUBST(RAWCPPFLAGS)
16118fc2d0c6SmrgAC_SUBST(TRADITIONALCPPFLAGS)
16128fc2d0c6Smrg]) # XORG_PROG_RAWCPP
16134a041c5bSmacallan
16148fc2d0c6Smrg# XORG_MANPAGE_SECTIONS()
16158fc2d0c6Smrg# -----------------------
16168fc2d0c6Smrg# Minimum version: 1.0.0
16178fc2d0c6Smrg#
16188fc2d0c6Smrg# Determine which sections man pages go in for the different man page types
16198fc2d0c6Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
16208fc2d0c6Smrg# Not sure if there's any better way than just hardcoding by OS name.
16218fc2d0c6Smrg# Override default settings by setting environment variables
16228fc2d0c6Smrg# Added MAN_SUBSTS in version 1.8
16238fc2d0c6Smrg# Added AC_PROG_SED in version 1.8
16244a041c5bSmacallan
16258fc2d0c6SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
16268fc2d0c6SmrgAC_REQUIRE([AC_CANONICAL_HOST])
16278fc2d0c6SmrgAC_REQUIRE([AC_PROG_SED])
16284a041c5bSmacallan
16298fc2d0c6Smrgcase $host_os in
16308fc2d0c6Smrg    solaris*)
16318fc2d0c6Smrg        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
16328fc2d0c6Smrg        # check for a man page file found in later versions that use
16338fc2d0c6Smrg        # traditional section numbers instead
16348fc2d0c6Smrg        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
16358fc2d0c6Smrg                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
16368fc2d0c6Smrg        ;;
16378fc2d0c6Smrg    *) SYSV_MAN_SECTIONS=false ;;
16388fc2d0c6Smrgesac
16394a041c5bSmacallan
16408fc2d0c6Smrgif test x$APP_MAN_SUFFIX = x    ; then
16418fc2d0c6Smrg    APP_MAN_SUFFIX=1
16428fc2d0c6Smrgfi
16438fc2d0c6Smrgif test x$APP_MAN_DIR = x    ; then
16448fc2d0c6Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
16458fc2d0c6Smrgfi
16464a041c5bSmacallan
16478fc2d0c6Smrgif test x$LIB_MAN_SUFFIX = x    ; then
16488fc2d0c6Smrg    LIB_MAN_SUFFIX=3
16498fc2d0c6Smrgfi
16508fc2d0c6Smrgif test x$LIB_MAN_DIR = x    ; then
16518fc2d0c6Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
16528fc2d0c6Smrgfi
165354b44505Smrg
16548fc2d0c6Smrgif test x$FILE_MAN_SUFFIX = x    ; then
16558fc2d0c6Smrg    case $SYSV_MAN_SECTIONS in
16568fc2d0c6Smrg	true)				FILE_MAN_SUFFIX=4  ;;
16578fc2d0c6Smrg	*)				FILE_MAN_SUFFIX=5  ;;
16588fc2d0c6Smrg    esac
16598fc2d0c6Smrgfi
16608fc2d0c6Smrgif test x$FILE_MAN_DIR = x    ; then
16618fc2d0c6Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
166254b44505Smrgfi
16634a041c5bSmacallan
16648fc2d0c6Smrgif test x$MISC_MAN_SUFFIX = x    ; then
16658fc2d0c6Smrg    case $SYSV_MAN_SECTIONS in
16668fc2d0c6Smrg	true)				MISC_MAN_SUFFIX=5  ;;
16678fc2d0c6Smrg	*)				MISC_MAN_SUFFIX=7  ;;
16688fc2d0c6Smrg    esac
16698fc2d0c6Smrgfi
16708fc2d0c6Smrgif test x$MISC_MAN_DIR = x    ; then
16718fc2d0c6Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
16728fc2d0c6Smrgfi
16734a041c5bSmacallan
16748fc2d0c6Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
16758fc2d0c6Smrg    case $SYSV_MAN_SECTIONS in
16768fc2d0c6Smrg	true)				DRIVER_MAN_SUFFIX=7  ;;
16778fc2d0c6Smrg	*)				DRIVER_MAN_SUFFIX=4  ;;
16788fc2d0c6Smrg    esac
16798fc2d0c6Smrgfi
16808fc2d0c6Smrgif test x$DRIVER_MAN_DIR = x    ; then
16818fc2d0c6Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
16828fc2d0c6Smrgfi
16834a041c5bSmacallan
16848fc2d0c6Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
16858fc2d0c6Smrg    case $SYSV_MAN_SECTIONS in
16868fc2d0c6Smrg	true)				ADMIN_MAN_SUFFIX=1m ;;
16878fc2d0c6Smrg	*)				ADMIN_MAN_SUFFIX=8  ;;
16888fc2d0c6Smrg    esac
16898fc2d0c6Smrgfi
16908fc2d0c6Smrgif test x$ADMIN_MAN_DIR = x    ; then
16918fc2d0c6Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
16928fc2d0c6Smrgfi
16934a041c5bSmacallan
16944a041c5bSmacallan
16958fc2d0c6SmrgAC_SUBST([APP_MAN_SUFFIX])
16968fc2d0c6SmrgAC_SUBST([LIB_MAN_SUFFIX])
16978fc2d0c6SmrgAC_SUBST([FILE_MAN_SUFFIX])
16988fc2d0c6SmrgAC_SUBST([MISC_MAN_SUFFIX])
16998fc2d0c6SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
17008fc2d0c6SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
17018fc2d0c6SmrgAC_SUBST([APP_MAN_DIR])
17028fc2d0c6SmrgAC_SUBST([LIB_MAN_DIR])
17038fc2d0c6SmrgAC_SUBST([FILE_MAN_DIR])
17048fc2d0c6SmrgAC_SUBST([MISC_MAN_DIR])
17058fc2d0c6SmrgAC_SUBST([DRIVER_MAN_DIR])
17068fc2d0c6SmrgAC_SUBST([ADMIN_MAN_DIR])
17074a041c5bSmacallan
17088fc2d0c6SmrgXORG_MAN_PAGE="X Version 11"
17098fc2d0c6SmrgAC_SUBST([XORG_MAN_PAGE])
17108fc2d0c6SmrgMAN_SUBSTS="\
17118fc2d0c6Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
17128fc2d0c6Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
17138fc2d0c6Smrg	-e 's|__xservername__|Xorg|g' \
17148fc2d0c6Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
17158fc2d0c6Smrg	-e 's|__projectroot__|\$(prefix)|g' \
17168fc2d0c6Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
17178fc2d0c6Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
17188fc2d0c6Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
17198fc2d0c6Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
17208fc2d0c6Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
17218fc2d0c6Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
17228fc2d0c6Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
17238fc2d0c6SmrgAC_SUBST([MAN_SUBSTS])
172454b44505Smrg
17258fc2d0c6Smrg]) # XORG_MANPAGE_SECTIONS
17264a041c5bSmacallan
17278fc2d0c6Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
17288fc2d0c6Smrg# ------------------------
17298fc2d0c6Smrg# Minimum version: 1.7.0
17308fc2d0c6Smrg#
17318fc2d0c6Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
17328fc2d0c6Smrg# provided by xorg-sgml-doctools, if installed.
17338fc2d0c6SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
17348fc2d0c6SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
17358fc2d0c6SmrgXORG_SGML_PATH=
17368fc2d0c6SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
17378fc2d0c6Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
17388fc2d0c6Smrg    [m4_ifval([$1],[:],
17398fc2d0c6Smrg        [if test x"$cross_compiling" != x"yes" ; then
17408fc2d0c6Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
17418fc2d0c6Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
17428fc2d0c6Smrg         fi])
17438fc2d0c6Smrg    ])
17444a041c5bSmacallan
17458fc2d0c6Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
17468fc2d0c6Smrg# the path and the name of the doc stylesheet
17478fc2d0c6Smrgif test "x$XORG_SGML_PATH" != "x" ; then
17488fc2d0c6Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
17498fc2d0c6Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
17508fc2d0c6Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
17518fc2d0c6Smrgelse
17528fc2d0c6Smrg   AC_MSG_RESULT([no])
17538fc2d0c6Smrgfi
17544a041c5bSmacallan
17558fc2d0c6SmrgAC_SUBST(XORG_SGML_PATH)
17568fc2d0c6SmrgAC_SUBST(STYLESHEET_SRCDIR)
17578fc2d0c6SmrgAC_SUBST(XSL_STYLESHEET)
17588fc2d0c6SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
17598fc2d0c6Smrg]) # XORG_CHECK_SGML_DOCTOOLS
17604a041c5bSmacallan
17618fc2d0c6Smrg# XORG_CHECK_LINUXDOC
17628fc2d0c6Smrg# -------------------
17638fc2d0c6Smrg# Minimum version: 1.0.0
17648fc2d0c6Smrg#
17658fc2d0c6Smrg# Defines the variable MAKE_TEXT if the necessary tools and
17668fc2d0c6Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
17678fc2d0c6Smrg# Whether or not the necessary tools and files are found can be checked
17688fc2d0c6Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
17698fc2d0c6SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
17708fc2d0c6SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
17718fc2d0c6SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
17720a392d7eSmrg
17738fc2d0c6SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
17744a041c5bSmacallan
17758fc2d0c6SmrgAC_MSG_CHECKING([whether to build documentation])
17764a041c5bSmacallan
17778fc2d0c6Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
17788fc2d0c6Smrg   BUILDDOC=yes
17798fc2d0c6Smrgelse
17808fc2d0c6Smrg   BUILDDOC=no
17818fc2d0c6Smrgfi
17824a041c5bSmacallan
17838fc2d0c6SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
17844a041c5bSmacallan
17858fc2d0c6SmrgAC_MSG_RESULT([$BUILDDOC])
178654b44505Smrg
17878fc2d0c6SmrgAC_MSG_CHECKING([whether to build pdf documentation])
17884a041c5bSmacallan
17898fc2d0c6Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
17908fc2d0c6Smrg   BUILDPDFDOC=yes
179154b44505Smrgelse
17928fc2d0c6Smrg   BUILDPDFDOC=no
179354b44505Smrgfi
17944a041c5bSmacallan
17958fc2d0c6SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
17964a041c5bSmacallan
17978fc2d0c6SmrgAC_MSG_RESULT([$BUILDPDFDOC])
17984a041c5bSmacallan
17998fc2d0c6SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
18008fc2d0c6SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
18018fc2d0c6SmrgMAKE_PDF="$PS2PDF"
18028fc2d0c6SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
180354b44505Smrg
18048fc2d0c6SmrgAC_SUBST(MAKE_TEXT)
18058fc2d0c6SmrgAC_SUBST(MAKE_PS)
18068fc2d0c6SmrgAC_SUBST(MAKE_PDF)
18078fc2d0c6SmrgAC_SUBST(MAKE_HTML)
18088fc2d0c6Smrg]) # XORG_CHECK_LINUXDOC
180954b44505Smrg
18108fc2d0c6Smrg# XORG_CHECK_DOCBOOK
18118fc2d0c6Smrg# -------------------
18128fc2d0c6Smrg# Minimum version: 1.0.0
18138fc2d0c6Smrg#
18148fc2d0c6Smrg# Checks for the ability to build output formats from SGML DocBook source.
18158fc2d0c6Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
18168fc2d0c6Smrg# indicates whether the necessary tools and files are found and, if set,
18178fc2d0c6Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
18188fc2d0c6SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
18198fc2d0c6SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
182054b44505Smrg
18218fc2d0c6SmrgBUILDTXTDOC=no
18228fc2d0c6SmrgBUILDPDFDOC=no
18238fc2d0c6SmrgBUILDPSDOC=no
18248fc2d0c6SmrgBUILDHTMLDOC=no
18254a041c5bSmacallan
18268fc2d0c6SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
18278fc2d0c6SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
18288fc2d0c6SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
18298fc2d0c6SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
18304a041c5bSmacallan
18318fc2d0c6SmrgAC_MSG_CHECKING([whether to build text documentation])
18328fc2d0c6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
18338fc2d0c6Smrg   test x$BUILD_TXTDOC != xno; then
18348fc2d0c6Smrg	BUILDTXTDOC=yes
18358fc2d0c6Smrgfi
18368fc2d0c6SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
18378fc2d0c6SmrgAC_MSG_RESULT([$BUILDTXTDOC])
18384a041c5bSmacallan
18398fc2d0c6SmrgAC_MSG_CHECKING([whether to build PDF documentation])
18408fc2d0c6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
18418fc2d0c6Smrg   test x$BUILD_PDFDOC != xno; then
18428fc2d0c6Smrg	BUILDPDFDOC=yes
18438fc2d0c6Smrgfi
18448fc2d0c6SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
18458fc2d0c6SmrgAC_MSG_RESULT([$BUILDPDFDOC])
18464a041c5bSmacallan
18478fc2d0c6SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
18488fc2d0c6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
18498fc2d0c6Smrg   test x$BUILD_PSDOC != xno; then
18508fc2d0c6Smrg	BUILDPSDOC=yes
18514a041c5bSmacallanfi
18528fc2d0c6SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
18538fc2d0c6SmrgAC_MSG_RESULT([$BUILDPSDOC])
18544a041c5bSmacallan
18558fc2d0c6SmrgAC_MSG_CHECKING([whether to build HTML documentation])
18568fc2d0c6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
18578fc2d0c6Smrg   test x$BUILD_HTMLDOC != xno; then
18588fc2d0c6Smrg	BUILDHTMLDOC=yes
18598fc2d0c6Smrgfi
18608fc2d0c6SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
18618fc2d0c6SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
18624a041c5bSmacallan
18638fc2d0c6SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
18648fc2d0c6SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
18658fc2d0c6SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
18668fc2d0c6SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
186754b44505Smrg
18688fc2d0c6SmrgAC_SUBST(MAKE_TEXT)
18698fc2d0c6SmrgAC_SUBST(MAKE_PS)
18708fc2d0c6SmrgAC_SUBST(MAKE_PDF)
18718fc2d0c6SmrgAC_SUBST(MAKE_HTML)
18728fc2d0c6Smrg]) # XORG_CHECK_DOCBOOK
187354b44505Smrg
18748fc2d0c6Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
18758fc2d0c6Smrg# ----------------
18768fc2d0c6Smrg# Minimum version: 1.5.0
18778fc2d0c6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
18788fc2d0c6Smrg#
18798fc2d0c6Smrg# Documentation tools are not always available on all platforms and sometimes
18808fc2d0c6Smrg# not at the appropriate level. This macro enables a module to test for the
18818fc2d0c6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
18828fc2d0c6Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
18838fc2d0c6Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
18848fc2d0c6Smrg# --with-xmlto assumes 'auto'.
18858fc2d0c6Smrg#
18868fc2d0c6Smrg# Interface to module:
18878fc2d0c6Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
18888fc2d0c6Smrg# XMLTO:	returns the path of the xmlto program found
18898fc2d0c6Smrg#		returns the path set by the user in the environment
18908fc2d0c6Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
18918fc2d0c6Smrg#		'no' user instructs the module not to use xmlto
18928fc2d0c6Smrg#
18938fc2d0c6Smrg# Added in version 1.10.0
18948fc2d0c6Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
18958fc2d0c6Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
18968fc2d0c6Smrg#
18978fc2d0c6Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
18988fc2d0c6Smrg#
18998fc2d0c6SmrgAC_DEFUN([XORG_WITH_XMLTO],[
19008fc2d0c6SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
19018fc2d0c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
19028fc2d0c6SmrgAC_ARG_WITH(xmlto,
19038fc2d0c6Smrg	AS_HELP_STRING([--with-xmlto],
19048fc2d0c6Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
19058fc2d0c6Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
19068fc2d0c6Smrgm4_undefine([_defopt])
19078fc2d0c6Smrg
19088fc2d0c6Smrgif test "x$use_xmlto" = x"auto"; then
19098fc2d0c6Smrg   AC_PATH_PROG([XMLTO], [xmlto])
19108fc2d0c6Smrg   if test "x$XMLTO" = "x"; then
19118fc2d0c6Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
19128fc2d0c6Smrg	have_xmlto=no
19138fc2d0c6Smrg   else
19148fc2d0c6Smrg        have_xmlto=yes
19158fc2d0c6Smrg   fi
19168fc2d0c6Smrgelif test "x$use_xmlto" = x"yes" ; then
19178fc2d0c6Smrg   AC_PATH_PROG([XMLTO], [xmlto])
19188fc2d0c6Smrg   if test "x$XMLTO" = "x"; then
19198fc2d0c6Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
19208fc2d0c6Smrg   fi
19218fc2d0c6Smrg   have_xmlto=yes
19228fc2d0c6Smrgelif test "x$use_xmlto" = x"no" ; then
19238fc2d0c6Smrg   if test "x$XMLTO" != "x"; then
19248fc2d0c6Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
19258fc2d0c6Smrg   fi
19268fc2d0c6Smrg   have_xmlto=no
19274a041c5bSmacallanelse
19288fc2d0c6Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
19294a041c5bSmacallanfi
19304a041c5bSmacallan
19318fc2d0c6Smrg# Test for a minimum version of xmlto, if provided.
19328fc2d0c6Smrgm4_ifval([$1],
19338fc2d0c6Smrg[if test "$have_xmlto" = yes; then
19348fc2d0c6Smrg    # scrape the xmlto version
19358fc2d0c6Smrg    AC_MSG_CHECKING([the xmlto version])
19368fc2d0c6Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
19378fc2d0c6Smrg    AC_MSG_RESULT([$xmlto_version])
19388fc2d0c6Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
19398fc2d0c6Smrg        [if test "x$use_xmlto" = xauto; then
19408fc2d0c6Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
19418fc2d0c6Smrg            have_xmlto=no
19428fc2d0c6Smrg        else
19438fc2d0c6Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
19448fc2d0c6Smrg        fi])
19458fc2d0c6Smrgfi])
19464a041c5bSmacallan
19478fc2d0c6Smrg# Test for the ability of xmlto to generate a text target
19488fc2d0c6Smrg#
19498fc2d0c6Smrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
19508fc2d0c6Smrg# following test for empty XML docbook files.
19518fc2d0c6Smrg# For compatibility reasons use the following empty XML docbook file and if
19528fc2d0c6Smrg# it fails try it again with a non-empty XML file.
19538fc2d0c6Smrghave_xmlto_text=no
19548fc2d0c6Smrgcat > conftest.xml << "EOF"
19558fc2d0c6SmrgEOF
19568fc2d0c6SmrgAS_IF([test "$have_xmlto" = yes],
19578fc2d0c6Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
19588fc2d0c6Smrg             [have_xmlto_text=yes],
19598fc2d0c6Smrg             [# Try it again with a non-empty XML file.
19608fc2d0c6Smrg              cat > conftest.xml << "EOF"
19618fc2d0c6Smrg<x></x>
19628fc2d0c6SmrgEOF
19638fc2d0c6Smrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
19648fc2d0c6Smrg                    [have_xmlto_text=yes],
19658fc2d0c6Smrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
19668fc2d0c6Smrgrm -f conftest.xml
19678fc2d0c6SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
19688fc2d0c6SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
19698fc2d0c6Smrg]) # XORG_WITH_XMLTO
19704a041c5bSmacallan
19718fc2d0c6Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
19728fc2d0c6Smrg# --------------------------------------------
19738fc2d0c6Smrg# Minimum version: 1.12.0
19748fc2d0c6Smrg# Minimum version for optional DEFAULT argument: 1.12.0
19758fc2d0c6Smrg#
19768fc2d0c6Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
19778fc2d0c6Smrg# XML-based language used for the transformation of XML documents.
19788fc2d0c6Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
19798fc2d0c6Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
19808fc2d0c6Smrg# The XSLT processor is often used as a standalone tool for transformations.
19818fc2d0c6Smrg# It should not be assumed that this tool is used only to work with documnetation.
19828fc2d0c6Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
19838fc2d0c6Smrg#
19848fc2d0c6Smrg# Interface to module:
19858fc2d0c6Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
19868fc2d0c6Smrg# XSLTPROC:	 returns the path of the xsltproc program found
19878fc2d0c6Smrg#		 returns the path set by the user in the environment
19888fc2d0c6Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
19898fc2d0c6Smrg#		  'no' user instructs the module not to use xsltproc
19908fc2d0c6Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
19918fc2d0c6Smrg#
19928fc2d0c6Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
19938fc2d0c6Smrg#
19948fc2d0c6SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
19958fc2d0c6SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
19968fc2d0c6Smrg# Preserves the interface, should it be implemented later
19978fc2d0c6Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
19988fc2d0c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
19998fc2d0c6SmrgAC_ARG_WITH(xsltproc,
20008fc2d0c6Smrg	AS_HELP_STRING([--with-xsltproc],
20018fc2d0c6Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
20028fc2d0c6Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
20038fc2d0c6Smrgm4_undefine([_defopt])
20044a041c5bSmacallan
20058fc2d0c6Smrgif test "x$use_xsltproc" = x"auto"; then
20068fc2d0c6Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
20078fc2d0c6Smrg   if test "x$XSLTPROC" = "x"; then
20088fc2d0c6Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
20098fc2d0c6Smrg	have_xsltproc=no
20108fc2d0c6Smrg   else
20118fc2d0c6Smrg        have_xsltproc=yes
20128fc2d0c6Smrg   fi
20138fc2d0c6Smrgelif test "x$use_xsltproc" = x"yes" ; then
20148fc2d0c6Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
20158fc2d0c6Smrg   if test "x$XSLTPROC" = "x"; then
20168fc2d0c6Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
20178fc2d0c6Smrg   fi
20188fc2d0c6Smrg   have_xsltproc=yes
20198fc2d0c6Smrgelif test "x$use_xsltproc" = x"no" ; then
20208fc2d0c6Smrg   if test "x$XSLTPROC" != "x"; then
20218fc2d0c6Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
20228fc2d0c6Smrg   fi
20238fc2d0c6Smrg   have_xsltproc=no
20248fc2d0c6Smrgelse
20258fc2d0c6Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
20268fc2d0c6Smrgfi
20274a041c5bSmacallan
20288fc2d0c6SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
20298fc2d0c6Smrg]) # XORG_WITH_XSLTPROC
20304a041c5bSmacallan
20318fc2d0c6Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
20328fc2d0c6Smrg# ----------------------------------------
20338fc2d0c6Smrg# Minimum version: 1.15.0
20348fc2d0c6Smrg#
20358fc2d0c6Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
20368fc2d0c6Smrg# scanning arbitrary text files, extracting information from those text files,
20378fc2d0c6Smrg# and printing reports based on that information.
20388fc2d0c6Smrg#
20398fc2d0c6Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
20408fc2d0c6Smrg#
20418fc2d0c6Smrg# Interface to module:
20428fc2d0c6Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
20438fc2d0c6Smrg# PERL:	     returns the path of the perl program found
20448fc2d0c6Smrg#	     returns the path set by the user in the environment
20458fc2d0c6Smrg# --with-perl: 'yes' user instructs the module to use perl
20468fc2d0c6Smrg#	       'no' user instructs the module not to use perl
20478fc2d0c6Smrg# have_perl: returns yes if perl found in PATH or no
20488fc2d0c6Smrg#
20498fc2d0c6Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
20508fc2d0c6Smrg#
20518fc2d0c6SmrgAC_DEFUN([XORG_WITH_PERL],[
20528fc2d0c6SmrgAC_ARG_VAR([PERL], [Path to perl command])
20538fc2d0c6Smrg# Preserves the interface, should it be implemented later
20548fc2d0c6Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
20558fc2d0c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
20568fc2d0c6SmrgAC_ARG_WITH(perl,
20578fc2d0c6Smrg	AS_HELP_STRING([--with-perl],
20588fc2d0c6Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
20598fc2d0c6Smrg	   [use_perl=$withval], [use_perl=]_defopt)
20608fc2d0c6Smrgm4_undefine([_defopt])
20614a041c5bSmacallan
20628fc2d0c6Smrgif test "x$use_perl" = x"auto"; then
20638fc2d0c6Smrg   AC_PATH_PROG([PERL], [perl])
20648fc2d0c6Smrg   if test "x$PERL" = "x"; then
20658fc2d0c6Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
20668fc2d0c6Smrg	have_perl=no
20678fc2d0c6Smrg   else
20688fc2d0c6Smrg        have_perl=yes
20698fc2d0c6Smrg   fi
20708fc2d0c6Smrgelif test "x$use_perl" = x"yes" ; then
20718fc2d0c6Smrg   AC_PATH_PROG([PERL], [perl])
20728fc2d0c6Smrg   if test "x$PERL" = "x"; then
20738fc2d0c6Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
20748fc2d0c6Smrg   fi
20758fc2d0c6Smrg   have_perl=yes
20768fc2d0c6Smrgelif test "x$use_perl" = x"no" ; then
20778fc2d0c6Smrg   if test "x$PERL" != "x"; then
20788fc2d0c6Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
20798fc2d0c6Smrg   fi
20808fc2d0c6Smrg   have_perl=no
20818fc2d0c6Smrgelse
20828fc2d0c6Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
20838fc2d0c6Smrgfi
20844a041c5bSmacallan
20858fc2d0c6SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
20868fc2d0c6Smrg]) # XORG_WITH_PERL
208754b44505Smrg
20888fc2d0c6Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
20898fc2d0c6Smrg# ----------------
20908fc2d0c6Smrg# Minimum version: 1.5.0
20918fc2d0c6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
20928fc2d0c6Smrg#
20938fc2d0c6Smrg# Documentation tools are not always available on all platforms and sometimes
20948fc2d0c6Smrg# not at the appropriate level. This macro enables a module to test for the
20958fc2d0c6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
20968fc2d0c6Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
20978fc2d0c6Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
20988fc2d0c6Smrg# --with-asciidoc assumes 'auto'.
20998fc2d0c6Smrg#
21008fc2d0c6Smrg# Interface to module:
21018fc2d0c6Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
21028fc2d0c6Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
21038fc2d0c6Smrg#		 returns the path set by the user in the environment
21048fc2d0c6Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
21058fc2d0c6Smrg#		  'no' user instructs the module not to use asciidoc
21068fc2d0c6Smrg#
21078fc2d0c6Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
21088fc2d0c6Smrg#
21098fc2d0c6SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
21108fc2d0c6SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
21118fc2d0c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
21128fc2d0c6SmrgAC_ARG_WITH(asciidoc,
21138fc2d0c6Smrg	AS_HELP_STRING([--with-asciidoc],
21148fc2d0c6Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
21158fc2d0c6Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
21168fc2d0c6Smrgm4_undefine([_defopt])
21174a041c5bSmacallan
21188fc2d0c6Smrgif test "x$use_asciidoc" = x"auto"; then
21198fc2d0c6Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
21208fc2d0c6Smrg   if test "x$ASCIIDOC" = "x"; then
21218fc2d0c6Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
21228fc2d0c6Smrg	have_asciidoc=no
21238fc2d0c6Smrg   else
21248fc2d0c6Smrg        have_asciidoc=yes
21258fc2d0c6Smrg   fi
21268fc2d0c6Smrgelif test "x$use_asciidoc" = x"yes" ; then
21278fc2d0c6Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
21288fc2d0c6Smrg   if test "x$ASCIIDOC" = "x"; then
21298fc2d0c6Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
21308fc2d0c6Smrg   fi
21318fc2d0c6Smrg   have_asciidoc=yes
21328fc2d0c6Smrgelif test "x$use_asciidoc" = x"no" ; then
21338fc2d0c6Smrg   if test "x$ASCIIDOC" != "x"; then
21348fc2d0c6Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
21358fc2d0c6Smrg   fi
21368fc2d0c6Smrg   have_asciidoc=no
21378fc2d0c6Smrgelse
21388fc2d0c6Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
21398fc2d0c6Smrgfi
21408fc2d0c6Smrgm4_ifval([$1],
21418fc2d0c6Smrg[if test "$have_asciidoc" = yes; then
21428fc2d0c6Smrg    # scrape the asciidoc version
21438fc2d0c6Smrg    AC_MSG_CHECKING([the asciidoc version])
21448fc2d0c6Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
21458fc2d0c6Smrg    AC_MSG_RESULT([$asciidoc_version])
21468fc2d0c6Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
21478fc2d0c6Smrg        [if test "x$use_asciidoc" = xauto; then
21488fc2d0c6Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
21498fc2d0c6Smrg            have_asciidoc=no
21508fc2d0c6Smrg        else
21518fc2d0c6Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
21528fc2d0c6Smrg        fi])
21538fc2d0c6Smrgfi])
21548fc2d0c6SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
21558fc2d0c6Smrg]) # XORG_WITH_ASCIIDOC
21564a041c5bSmacallan
21578fc2d0c6Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
21588fc2d0c6Smrg# -------------------------------------------
21598fc2d0c6Smrg# Minimum version: 1.5.0
21608fc2d0c6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
21618fc2d0c6Smrg# Minimum version for optional DOT checking: 1.18.0
21628fc2d0c6Smrg#
21638fc2d0c6Smrg# Documentation tools are not always available on all platforms and sometimes
21648fc2d0c6Smrg# not at the appropriate level. This macro enables a module to test for the
21658fc2d0c6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
21668fc2d0c6Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
21678fc2d0c6Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
21688fc2d0c6Smrg# --with-doxygen assumes 'auto'.
21698fc2d0c6Smrg#
21708fc2d0c6Smrg# Interface to module:
21718fc2d0c6Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
21728fc2d0c6Smrg# DOXYGEN:	 returns the path of the doxygen program found
21738fc2d0c6Smrg#		 returns the path set by the user in the environment
21748fc2d0c6Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
21758fc2d0c6Smrg#		  'no' user instructs the module not to use doxygen
21768fc2d0c6Smrg#
21778fc2d0c6Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
21788fc2d0c6Smrg#
21798fc2d0c6SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
21808fc2d0c6SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
21818fc2d0c6SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
21828fc2d0c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
21838fc2d0c6SmrgAC_ARG_WITH(doxygen,
21848fc2d0c6Smrg	AS_HELP_STRING([--with-doxygen],
21858fc2d0c6Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
21868fc2d0c6Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
21878fc2d0c6Smrgm4_undefine([_defopt])
21880a392d7eSmrg
21898fc2d0c6Smrgif test "x$use_doxygen" = x"auto"; then
21908fc2d0c6Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
21918fc2d0c6Smrg   if test "x$DOXYGEN" = "x"; then
21928fc2d0c6Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
21938fc2d0c6Smrg	have_doxygen=no
21948fc2d0c6Smrg   else
21958fc2d0c6Smrg        have_doxygen=yes
21968fc2d0c6Smrg   fi
21978fc2d0c6Smrgelif test "x$use_doxygen" = x"yes" ; then
21988fc2d0c6Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
21998fc2d0c6Smrg   if test "x$DOXYGEN" = "x"; then
22008fc2d0c6Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
22018fc2d0c6Smrg   fi
22028fc2d0c6Smrg   have_doxygen=yes
22038fc2d0c6Smrgelif test "x$use_doxygen" = x"no" ; then
22048fc2d0c6Smrg   if test "x$DOXYGEN" != "x"; then
22058fc2d0c6Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
22068fc2d0c6Smrg   fi
22078fc2d0c6Smrg   have_doxygen=no
220854b44505Smrgelse
22098fc2d0c6Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
221054b44505Smrgfi
22118fc2d0c6Smrgm4_ifval([$1],
22128fc2d0c6Smrg[if test "$have_doxygen" = yes; then
22138fc2d0c6Smrg    # scrape the doxygen version
22148fc2d0c6Smrg    AC_MSG_CHECKING([the doxygen version])
22158fc2d0c6Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
22168fc2d0c6Smrg    AC_MSG_RESULT([$doxygen_version])
22178fc2d0c6Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
22188fc2d0c6Smrg        [if test "x$use_doxygen" = xauto; then
22198fc2d0c6Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
22208fc2d0c6Smrg            have_doxygen=no
22218fc2d0c6Smrg        else
22228fc2d0c6Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
22238fc2d0c6Smrg        fi])
22248fc2d0c6Smrgfi])
22254a041c5bSmacallan
22268fc2d0c6Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
22278fc2d0c6Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
22288fc2d0c6Smrgdnl 	HAVE_DOT = @HAVE_DOT@
22298fc2d0c6SmrgHAVE_DOT=no
22308fc2d0c6Smrgif test "x$have_doxygen" = "xyes"; then
22318fc2d0c6Smrg  AC_PATH_PROG([DOT], [dot])
22328fc2d0c6Smrg    if test "x$DOT" != "x"; then
22338fc2d0c6Smrg      HAVE_DOT=yes
22348fc2d0c6Smrg    fi
22358fc2d0c6Smrgfi
22364a041c5bSmacallan
22378fc2d0c6SmrgAC_SUBST([HAVE_DOT])
22388fc2d0c6SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
22398fc2d0c6SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
22408fc2d0c6Smrg]) # XORG_WITH_DOXYGEN
22414a041c5bSmacallan
22428fc2d0c6Smrg# XORG_WITH_GROFF([DEFAULT])
224354b44505Smrg# ----------------
22448fc2d0c6Smrg# Minimum version: 1.6.0
22458fc2d0c6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
22468fc2d0c6Smrg#
22478fc2d0c6Smrg# Documentation tools are not always available on all platforms and sometimes
22488fc2d0c6Smrg# not at the appropriate level. This macro enables a module to test for the
22498fc2d0c6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
22508fc2d0c6Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
22518fc2d0c6Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
22528fc2d0c6Smrg# --with-groff assumes 'auto'.
22538fc2d0c6Smrg#
22548fc2d0c6Smrg# Interface to module:
22558fc2d0c6Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
22568fc2d0c6Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
22578fc2d0c6Smrg# HAVE_GROFF_MS: the -ms macros package
22588fc2d0c6Smrg# GROFF:	 returns the path of the groff program found
22598fc2d0c6Smrg#		 returns the path set by the user in the environment
22608fc2d0c6Smrg# --with-groff:	 'yes' user instructs the module to use groff
22618fc2d0c6Smrg#		 'no' user instructs the module not to use groff
22628fc2d0c6Smrg#
22638fc2d0c6Smrg# Added in version 1.9.0:
22648fc2d0c6Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
22658fc2d0c6Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
22668fc2d0c6Smrg#		   psselect from the psutils package.
22678fc2d0c6Smrg#		   the ghostcript package. Refer to the grohtml man pages
22688fc2d0c6Smrg#
22698fc2d0c6Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
22708fc2d0c6Smrg#
22718fc2d0c6Smrg# OS and distros often splits groff in a basic and full package, the former
22728fc2d0c6Smrg# having the groff program and the later having devices, fonts and macros
22738fc2d0c6Smrg# Checking for the groff executable is not enough.
22748fc2d0c6Smrg#
22758fc2d0c6Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
22768fc2d0c6Smrg# unset HAVE_GROFF or GROFF env variables.
22778fc2d0c6Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
22788fc2d0c6Smrg#
22798fc2d0c6SmrgAC_DEFUN([XORG_WITH_GROFF],[
22808fc2d0c6SmrgAC_ARG_VAR([GROFF], [Path to groff command])
22818fc2d0c6Smrgm4_define([_defopt], m4_default([$1], [auto]))
22828fc2d0c6SmrgAC_ARG_WITH(groff,
22838fc2d0c6Smrg	AS_HELP_STRING([--with-groff],
22848fc2d0c6Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
22858fc2d0c6Smrg	   [use_groff=$withval], [use_groff=]_defopt)
22868fc2d0c6Smrgm4_undefine([_defopt])
22874a041c5bSmacallan
22888fc2d0c6Smrgif test "x$use_groff" = x"auto"; then
22898fc2d0c6Smrg   AC_PATH_PROG([GROFF], [groff])
22908fc2d0c6Smrg   if test "x$GROFF" = "x"; then
22918fc2d0c6Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
22928fc2d0c6Smrg	have_groff=no
22938fc2d0c6Smrg   else
22948fc2d0c6Smrg        have_groff=yes
22958fc2d0c6Smrg   fi
22968fc2d0c6Smrgelif test "x$use_groff" = x"yes" ; then
22978fc2d0c6Smrg   AC_PATH_PROG([GROFF], [groff])
22988fc2d0c6Smrg   if test "x$GROFF" = "x"; then
22998fc2d0c6Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
23008fc2d0c6Smrg   fi
23018fc2d0c6Smrg   have_groff=yes
23028fc2d0c6Smrgelif test "x$use_groff" = x"no" ; then
23038fc2d0c6Smrg   if test "x$GROFF" != "x"; then
23048fc2d0c6Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
23058fc2d0c6Smrg   fi
23068fc2d0c6Smrg   have_groff=no
23078fc2d0c6Smrgelse
23088fc2d0c6Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
23098fc2d0c6Smrgfi
23104a041c5bSmacallan
23118fc2d0c6Smrg# We have groff, test for the presence of the macro packages
23128fc2d0c6Smrgif test "x$have_groff" = x"yes"; then
23138fc2d0c6Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
23148fc2d0c6Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
23158fc2d0c6Smrg        groff_ms_works=yes
23168fc2d0c6Smrg    else
23178fc2d0c6Smrg        groff_ms_works=no
23188fc2d0c6Smrg    fi
23198fc2d0c6Smrg    AC_MSG_RESULT([$groff_ms_works])
23208fc2d0c6Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
23218fc2d0c6Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
23228fc2d0c6Smrg        groff_mm_works=yes
23238fc2d0c6Smrg    else
23248fc2d0c6Smrg        groff_mm_works=no
23258fc2d0c6Smrg    fi
23268fc2d0c6Smrg    AC_MSG_RESULT([$groff_mm_works])
23278fc2d0c6Smrgfi
23284a041c5bSmacallan
23298fc2d0c6Smrg# We have groff, test for HTML dependencies, one command per package
23308fc2d0c6Smrgif test "x$have_groff" = x"yes"; then
23318fc2d0c6Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
23328fc2d0c6Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
23338fc2d0c6Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
23348fc2d0c6Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
23358fc2d0c6Smrg      have_groff_html=yes
23368fc2d0c6Smrg   else
23378fc2d0c6Smrg      have_groff_html=no
23388fc2d0c6Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
23398fc2d0c6Smrg   fi
23408fc2d0c6Smrgfi
23414a041c5bSmacallan
23428fc2d0c6Smrg# Set Automake conditionals for Makefiles
23438fc2d0c6SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
23448fc2d0c6SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
23458fc2d0c6SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
23468fc2d0c6SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
23478fc2d0c6Smrg]) # XORG_WITH_GROFF
234854b44505Smrg
23498fc2d0c6Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
23508fc2d0c6Smrg# ---------------------------------------
23518fc2d0c6Smrg# Minimum version: 1.6.0
23528fc2d0c6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
23538fc2d0c6Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
23548fc2d0c6Smrg#
23558fc2d0c6Smrg# Documentation tools are not always available on all platforms and sometimes
23568fc2d0c6Smrg# not at the appropriate level. This macro enables a module to test for the
23578fc2d0c6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
23588fc2d0c6Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
23598fc2d0c6Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
23608fc2d0c6Smrg# --with-fop assumes 'auto'.
23618fc2d0c6Smrg#
23628fc2d0c6Smrg# Interface to module:
23638fc2d0c6Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
23648fc2d0c6Smrg# FOP:	 	returns the path of the fop program found
23658fc2d0c6Smrg#		returns the path set by the user in the environment
23668fc2d0c6Smrg# --with-fop: 	'yes' user instructs the module to use fop
23678fc2d0c6Smrg#		'no' user instructs the module not to use fop
23688fc2d0c6Smrg#
23698fc2d0c6Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
23708fc2d0c6Smrg#
23718fc2d0c6SmrgAC_DEFUN([XORG_WITH_FOP],[
23728fc2d0c6SmrgAC_ARG_VAR([FOP], [Path to fop command])
23738fc2d0c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
23748fc2d0c6SmrgAC_ARG_WITH(fop,
23758fc2d0c6Smrg	AS_HELP_STRING([--with-fop],
23768fc2d0c6Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
23778fc2d0c6Smrg	   [use_fop=$withval], [use_fop=]_defopt)
23788fc2d0c6Smrgm4_undefine([_defopt])
237954b44505Smrg
23808fc2d0c6Smrgif test "x$use_fop" = x"auto"; then
23818fc2d0c6Smrg   AC_PATH_PROG([FOP], [fop])
23828fc2d0c6Smrg   if test "x$FOP" = "x"; then
23838fc2d0c6Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
23848fc2d0c6Smrg	have_fop=no
23858fc2d0c6Smrg   else
23868fc2d0c6Smrg        have_fop=yes
23878fc2d0c6Smrg   fi
23888fc2d0c6Smrgelif test "x$use_fop" = x"yes" ; then
23898fc2d0c6Smrg   AC_PATH_PROG([FOP], [fop])
23908fc2d0c6Smrg   if test "x$FOP" = "x"; then
23918fc2d0c6Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
23928fc2d0c6Smrg   fi
23938fc2d0c6Smrg   have_fop=yes
23948fc2d0c6Smrgelif test "x$use_fop" = x"no" ; then
23958fc2d0c6Smrg   if test "x$FOP" != "x"; then
23968fc2d0c6Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
23978fc2d0c6Smrg   fi
23988fc2d0c6Smrg   have_fop=no
23998fc2d0c6Smrgelse
24008fc2d0c6Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
240154b44505Smrgfi
240254b44505Smrg
24038fc2d0c6Smrg# Test for a minimum version of fop, if provided.
24048fc2d0c6Smrgm4_ifval([$1],
24058fc2d0c6Smrg[if test "$have_fop" = yes; then
24068fc2d0c6Smrg    # scrape the fop version
24078fc2d0c6Smrg    AC_MSG_CHECKING([for fop minimum version])
24088fc2d0c6Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
24098fc2d0c6Smrg    AC_MSG_RESULT([$fop_version])
24108fc2d0c6Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
24118fc2d0c6Smrg        [if test "x$use_fop" = xauto; then
24128fc2d0c6Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
24138fc2d0c6Smrg            have_fop=no
24148fc2d0c6Smrg        else
24158fc2d0c6Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
24168fc2d0c6Smrg        fi])
24178fc2d0c6Smrgfi])
24188fc2d0c6SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
24198fc2d0c6Smrg]) # XORG_WITH_FOP
242054b44505Smrg
24218fc2d0c6Smrg# XORG_WITH_M4([MIN-VERSION])
24228fc2d0c6Smrg# ---------------------------
24238fc2d0c6Smrg# Minimum version: 1.19.0
24248fc2d0c6Smrg#
24258fc2d0c6Smrg# This macro attempts to locate an m4 macro processor which supports
24268fc2d0c6Smrg# -I option and is only useful for modules relying on M4 in order to
24278fc2d0c6Smrg# expand macros in source code files.
24288fc2d0c6Smrg#
24298fc2d0c6Smrg# Interface to module:
24308fc2d0c6Smrg# M4:	 	returns the path of the m4 program found
24318fc2d0c6Smrg#		returns the path set by the user in the environment
24328fc2d0c6Smrg#
24338fc2d0c6SmrgAC_DEFUN([XORG_WITH_M4], [
24348fc2d0c6SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
24358fc2d0c6Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
24368fc2d0c6Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
24378fc2d0c6Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
24388fc2d0c6Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
24398fc2d0c6Smrg   [$PATH:/usr/gnu/bin])])
244054b44505Smrg
24418fc2d0c6SmrgAC_SUBST([M4], [$ac_cv_path_M4])
24428fc2d0c6Smrg]) # XORG_WITH_M4
24434a041c5bSmacallan
24448fc2d0c6Smrg# XORG_WITH_PS2PDF([DEFAULT])
24458fc2d0c6Smrg# ----------------
24468fc2d0c6Smrg# Minimum version: 1.6.0
24478fc2d0c6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
24488fc2d0c6Smrg#
24498fc2d0c6Smrg# Documentation tools are not always available on all platforms and sometimes
24508fc2d0c6Smrg# not at the appropriate level. This macro enables a module to test for the
24518fc2d0c6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
24528fc2d0c6Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
24538fc2d0c6Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
24548fc2d0c6Smrg# --with-ps2pdf assumes 'auto'.
24558fc2d0c6Smrg#
24568fc2d0c6Smrg# Interface to module:
24578fc2d0c6Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
24588fc2d0c6Smrg# PS2PDF:	returns the path of the ps2pdf program found
24598fc2d0c6Smrg#		returns the path set by the user in the environment
24608fc2d0c6Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
24618fc2d0c6Smrg#		 'no' user instructs the module not to use ps2pdf
24628fc2d0c6Smrg#
24638fc2d0c6Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
24648fc2d0c6Smrg#
24658fc2d0c6SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
24668fc2d0c6SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
24678fc2d0c6Smrgm4_define([_defopt], m4_default([$1], [auto]))
24688fc2d0c6SmrgAC_ARG_WITH(ps2pdf,
24698fc2d0c6Smrg	AS_HELP_STRING([--with-ps2pdf],
24708fc2d0c6Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
24718fc2d0c6Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
24728fc2d0c6Smrgm4_undefine([_defopt])
247354b44505Smrg
24748fc2d0c6Smrgif test "x$use_ps2pdf" = x"auto"; then
24758fc2d0c6Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
24768fc2d0c6Smrg   if test "x$PS2PDF" = "x"; then
24778fc2d0c6Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
24788fc2d0c6Smrg	have_ps2pdf=no
24798fc2d0c6Smrg   else
24808fc2d0c6Smrg        have_ps2pdf=yes
24818fc2d0c6Smrg   fi
24828fc2d0c6Smrgelif test "x$use_ps2pdf" = x"yes" ; then
24838fc2d0c6Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
24848fc2d0c6Smrg   if test "x$PS2PDF" = "x"; then
24858fc2d0c6Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
24868fc2d0c6Smrg   fi
24878fc2d0c6Smrg   have_ps2pdf=yes
24888fc2d0c6Smrgelif test "x$use_ps2pdf" = x"no" ; then
24898fc2d0c6Smrg   if test "x$PS2PDF" != "x"; then
24908fc2d0c6Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
24918fc2d0c6Smrg   fi
24928fc2d0c6Smrg   have_ps2pdf=no
24938fc2d0c6Smrgelse
24948fc2d0c6Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
249554b44505Smrgfi
24968fc2d0c6SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
24978fc2d0c6Smrg]) # XORG_WITH_PS2PDF
24984a041c5bSmacallan
24998fc2d0c6Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
25008fc2d0c6Smrg# ----------------
25018fc2d0c6Smrg# Minimum version: 1.6.0
25028fc2d0c6Smrg#
25038fc2d0c6Smrg# Documentation tools are not always available on all platforms and sometimes
25048fc2d0c6Smrg# not at the appropriate level. This macro enables a builder to skip all
25058fc2d0c6Smrg# documentation targets except traditional man pages.
25068fc2d0c6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
25078fc2d0c6Smrg# maximum flexibilty in controlling documentation building.
25088fc2d0c6Smrg# Refer to:
25098fc2d0c6Smrg# XORG_WITH_XMLTO         --with-xmlto
25108fc2d0c6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
25118fc2d0c6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
25128fc2d0c6Smrg# XORG_WITH_FOP           --with-fop
25138fc2d0c6Smrg# XORG_WITH_GROFF         --with-groff
25148fc2d0c6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
25158fc2d0c6Smrg#
25168fc2d0c6Smrg# Interface to module:
25178fc2d0c6Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
25188fc2d0c6Smrg# --enable-docs: 'yes' user instructs the module to generate docs
25198fc2d0c6Smrg#		 'no' user instructs the module not to generate docs
25208fc2d0c6Smrg# parm1:	specify the default value, yes or no.
25218fc2d0c6Smrg#
25228fc2d0c6SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
25238fc2d0c6Smrgm4_define([docs_default], m4_default([$1], [yes]))
25248fc2d0c6SmrgAC_ARG_ENABLE(docs,
25258fc2d0c6Smrg	AS_HELP_STRING([--enable-docs],
25268fc2d0c6Smrg	   [Enable building the documentation (default: ]docs_default[)]),
25278fc2d0c6Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
25288fc2d0c6Smrgm4_undefine([docs_default])
25298fc2d0c6SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
25308fc2d0c6SmrgAC_MSG_CHECKING([whether to build documentation])
25318fc2d0c6SmrgAC_MSG_RESULT([$build_docs])
25328fc2d0c6Smrg]) # XORG_ENABLE_DOCS
25334a041c5bSmacallan
25348fc2d0c6Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
25358fc2d0c6Smrg# ----------------
25368fc2d0c6Smrg# Minimum version: 1.6.0
25378fc2d0c6Smrg#
25388fc2d0c6Smrg# This macro enables a builder to skip all developer documentation.
25398fc2d0c6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
25408fc2d0c6Smrg# maximum flexibilty in controlling documentation building.
25418fc2d0c6Smrg# Refer to:
25428fc2d0c6Smrg# XORG_WITH_XMLTO         --with-xmlto
25438fc2d0c6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
25448fc2d0c6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
25458fc2d0c6Smrg# XORG_WITH_FOP           --with-fop
25468fc2d0c6Smrg# XORG_WITH_GROFF         --with-groff
25478fc2d0c6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
25488fc2d0c6Smrg#
25498fc2d0c6Smrg# Interface to module:
25508fc2d0c6Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
25518fc2d0c6Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
25528fc2d0c6Smrg#			'no' user instructs the module not to generate developer docs
25538fc2d0c6Smrg# parm1:		specify the default value, yes or no.
25548fc2d0c6Smrg#
25558fc2d0c6SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
25568fc2d0c6Smrgm4_define([devel_default], m4_default([$1], [yes]))
25578fc2d0c6SmrgAC_ARG_ENABLE(devel-docs,
25588fc2d0c6Smrg	AS_HELP_STRING([--enable-devel-docs],
25598fc2d0c6Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
25608fc2d0c6Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
25618fc2d0c6Smrgm4_undefine([devel_default])
25628fc2d0c6SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
25638fc2d0c6SmrgAC_MSG_CHECKING([whether to build developer documentation])
25648fc2d0c6SmrgAC_MSG_RESULT([$build_devel_docs])
25658fc2d0c6Smrg]) # XORG_ENABLE_DEVEL_DOCS
25664a041c5bSmacallan
25678fc2d0c6Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
25688fc2d0c6Smrg# ----------------
25698fc2d0c6Smrg# Minimum version: 1.6.0
25708fc2d0c6Smrg#
25718fc2d0c6Smrg# This macro enables a builder to skip all functional specification targets.
25728fc2d0c6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
25738fc2d0c6Smrg# maximum flexibilty in controlling documentation building.
25748fc2d0c6Smrg# Refer to:
25758fc2d0c6Smrg# XORG_WITH_XMLTO         --with-xmlto
25768fc2d0c6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
25778fc2d0c6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
25788fc2d0c6Smrg# XORG_WITH_FOP           --with-fop
25798fc2d0c6Smrg# XORG_WITH_GROFF         --with-groff
25808fc2d0c6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
25818fc2d0c6Smrg#
25828fc2d0c6Smrg# Interface to module:
25838fc2d0c6Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
25848fc2d0c6Smrg# --enable-specs:	'yes' user instructs the module to generate specs
25858fc2d0c6Smrg#			'no' user instructs the module not to generate specs
25868fc2d0c6Smrg# parm1:		specify the default value, yes or no.
25878fc2d0c6Smrg#
25888fc2d0c6SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
25898fc2d0c6Smrgm4_define([spec_default], m4_default([$1], [yes]))
25908fc2d0c6SmrgAC_ARG_ENABLE(specs,
25918fc2d0c6Smrg	AS_HELP_STRING([--enable-specs],
25928fc2d0c6Smrg	   [Enable building the specs (default: ]spec_default[)]),
25938fc2d0c6Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
25948fc2d0c6Smrgm4_undefine([spec_default])
25958fc2d0c6SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
25968fc2d0c6SmrgAC_MSG_CHECKING([whether to build functional specifications])
25978fc2d0c6SmrgAC_MSG_RESULT([$build_specs])
25988fc2d0c6Smrg]) # XORG_ENABLE_SPECS
259954b44505Smrg
26008fc2d0c6Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
26018fc2d0c6Smrg# ----------------------------------------------
26028fc2d0c6Smrg# Minimum version: 1.13.0
26038fc2d0c6Smrg#
26048fc2d0c6Smrg# This macro enables a builder to enable/disable unit testing
26058fc2d0c6Smrg# It makes no assumption about the test cases implementation
26068fc2d0c6Smrg# Test cases may or may not use Automake "Support for test suites"
26078fc2d0c6Smrg# They may or may not use the software utility library GLib
26088fc2d0c6Smrg#
26098fc2d0c6Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
26108fc2d0c6Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
26118fc2d0c6Smrg# The variable enable_unit_tests is used by other macros in this file.
26128fc2d0c6Smrg#
26138fc2d0c6Smrg# Interface to module:
26148fc2d0c6Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
26158fc2d0c6Smrg# enable_unit_tests:    used in configure.ac for additional configuration
26168fc2d0c6Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
26178fc2d0c6Smrg#			'no' user instructs the module not to build tests
26188fc2d0c6Smrg# parm1:		specify the default value, yes or no.
26198fc2d0c6Smrg#
26208fc2d0c6SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
26218fc2d0c6SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
26228fc2d0c6SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
26238fc2d0c6SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
26248fc2d0c6Smrgm4_define([_defopt], m4_default([$1], [auto]))
26258fc2d0c6SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
26268fc2d0c6Smrg	[Enable building unit test cases (default: ]_defopt[)]),
26278fc2d0c6Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
26288fc2d0c6Smrgm4_undefine([_defopt])
26298fc2d0c6SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
26308fc2d0c6SmrgAC_MSG_CHECKING([whether to build unit test cases])
26318fc2d0c6SmrgAC_MSG_RESULT([$enable_unit_tests])
26328fc2d0c6Smrg]) # XORG_ENABLE_UNIT_TESTS
263354b44505Smrg
26348fc2d0c6Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
26358fc2d0c6Smrg# ------------------------------------------------------
26368fc2d0c6Smrg# Minimum version: 1.17.0
26378fc2d0c6Smrg#
26388fc2d0c6Smrg# This macro enables a builder to enable/disable integration testing
26398fc2d0c6Smrg# It makes no assumption about the test cases' implementation
26408fc2d0c6Smrg# Test cases may or may not use Automake "Support for test suites"
26418fc2d0c6Smrg#
26428fc2d0c6Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
26438fc2d0c6Smrg# usually requires less dependencies and may be built and run under less
26448fc2d0c6Smrg# stringent environments than integration tests.
26458fc2d0c6Smrg#
26468fc2d0c6Smrg# Interface to module:
26478fc2d0c6Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
26488fc2d0c6Smrg# enable_integration_tests:   used in configure.ac for additional configuration
26498fc2d0c6Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
26508fc2d0c6Smrg#                             'no' user instructs the module not to build tests
26518fc2d0c6Smrg# parm1:                      specify the default value, yes or no.
26528fc2d0c6Smrg#
26538fc2d0c6SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
26548fc2d0c6SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
26558fc2d0c6Smrgm4_define([_defopt], m4_default([$1], [auto]))
26568fc2d0c6SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
26578fc2d0c6Smrg	[Enable building integration test cases (default: ]_defopt[)]),
26588fc2d0c6Smrg	[enable_integration_tests=$enableval],
26598fc2d0c6Smrg	[enable_integration_tests=]_defopt)
26608fc2d0c6Smrgm4_undefine([_defopt])
26618fc2d0c6SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
26628fc2d0c6Smrg	[test "x$enable_integration_tests" != xno])
26638fc2d0c6SmrgAC_MSG_CHECKING([whether to build unit test cases])
26648fc2d0c6SmrgAC_MSG_RESULT([$enable_integration_tests])
26658fc2d0c6Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
266654b44505Smrg
26678fc2d0c6Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
26688fc2d0c6Smrg# ----------------------------------------
26698fc2d0c6Smrg# Minimum version: 1.13.0
26708fc2d0c6Smrg#
26718fc2d0c6Smrg# GLib is a library which provides advanced data structures and functions.
26728fc2d0c6Smrg# This macro enables a module to test for the presence of Glib.
26738fc2d0c6Smrg#
26748fc2d0c6Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
26758fc2d0c6Smrg# Otherwise the value of $enable_unit_tests is blank.
26768fc2d0c6Smrg#
26778fc2d0c6Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
26788fc2d0c6Smrg# test support usually requires less dependencies and may be built and run under
26798fc2d0c6Smrg# less stringent environments than integration tests.
26808fc2d0c6Smrg#
26818fc2d0c6Smrg# Interface to module:
26828fc2d0c6Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
26838fc2d0c6Smrg# with_glib: used in configure.ac to know if GLib has been found
26848fc2d0c6Smrg# --with-glib:	'yes' user instructs the module to use glib
26858fc2d0c6Smrg#		'no' user instructs the module not to use glib
26868fc2d0c6Smrg#
26878fc2d0c6SmrgAC_DEFUN([XORG_WITH_GLIB],[
26888fc2d0c6SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
26898fc2d0c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
26908fc2d0c6SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
26918fc2d0c6Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
26928fc2d0c6Smrg	[with_glib=$withval], [with_glib=]_defopt)
26938fc2d0c6Smrgm4_undefine([_defopt])
269454b44505Smrg
26958fc2d0c6Smrghave_glib=no
26968fc2d0c6Smrg# Do not probe GLib if user explicitly disabled unit testing
26978fc2d0c6Smrgif test "x$enable_unit_tests" != x"no"; then
26988fc2d0c6Smrg  # Do not probe GLib if user explicitly disabled it
26998fc2d0c6Smrg  if test "x$with_glib" != x"no"; then
27008fc2d0c6Smrg    m4_ifval(
27018fc2d0c6Smrg      [$1],
27028fc2d0c6Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
27038fc2d0c6Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
27048fc2d0c6Smrg    )
27054a041c5bSmacallan  fi
270654b44505Smrgfi
27074a041c5bSmacallan
27088fc2d0c6Smrg# Not having GLib when unit testing has been explicitly requested is an error
27098fc2d0c6Smrgif test "x$enable_unit_tests" = x"yes"; then
27108fc2d0c6Smrg  if test "x$have_glib" = x"no"; then
27118fc2d0c6Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
27128fc2d0c6Smrg  fi
27138fc2d0c6Smrgfi
27144a041c5bSmacallan
27158fc2d0c6Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
27168fc2d0c6Smrgif test "x$enable_unit_tests" = x"no"; then
27178fc2d0c6Smrg  if test "x$with_glib" = x"yes"; then
27188fc2d0c6Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
27198fc2d0c6Smrg  fi
272054b44505Smrgfi
272154b44505Smrg
27228fc2d0c6Smrg# Not having GLib when it has been explicitly requested is an error
27238fc2d0c6Smrgif test "x$with_glib" = x"yes"; then
27248fc2d0c6Smrg  if test "x$have_glib" = x"no"; then
27258fc2d0c6Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
27268fc2d0c6Smrg  fi
27278fc2d0c6Smrgfi
272854b44505Smrg
27298fc2d0c6SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
27308fc2d0c6Smrg]) # XORG_WITH_GLIB
273154b44505Smrg
27328fc2d0c6Smrg# XORG_LD_WRAP([required|optional])
27338fc2d0c6Smrg# ---------------------------------
27348fc2d0c6Smrg# Minimum version: 1.13.0
27358fc2d0c6Smrg#
27368fc2d0c6Smrg# Check if linker supports -wrap, passed via compiler flags
27378fc2d0c6Smrg#
27388fc2d0c6Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
27398fc2d0c6Smrg# Otherwise the value of $enable_unit_tests is blank.
27408fc2d0c6Smrg#
27418fc2d0c6Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
27428fc2d0c6Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
27438fc2d0c6Smrg# available, an argument of "optional" allows use when some unit tests require
27448fc2d0c6Smrg# ld -wrap and others do not.
27458fc2d0c6Smrg#
27468fc2d0c6SmrgAC_DEFUN([XORG_LD_WRAP],[
27478fc2d0c6SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
27488fc2d0c6Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
27498fc2d0c6Smrg                      void __wrap_exit(int status) { return; }],
27508fc2d0c6Smrg                     [exit(0);])])
27518fc2d0c6Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
27528fc2d0c6Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
27538fc2d0c6Smrg  if test "x$have_ld_wrap" = x"no"; then
27548fc2d0c6Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
27554a041c5bSmacallan  fi
275654b44505Smrgfi
27578fc2d0c6SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
27588fc2d0c6Smrg#
27598fc2d0c6Smrg]) # XORG_LD_WRAP
27604a041c5bSmacallan
27618fc2d0c6Smrg# XORG_CHECK_LINKER_FLAGS
27628fc2d0c6Smrg# -----------------------
27638fc2d0c6Smrg# SYNOPSIS
27648fc2d0c6Smrg#
27658fc2d0c6Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
27668fc2d0c6Smrg#
27678fc2d0c6Smrg# DESCRIPTION
27688fc2d0c6Smrg#
27698fc2d0c6Smrg#   Check whether the given linker FLAGS work with the current language's
27708fc2d0c6Smrg#   linker, or whether they give an error.
27718fc2d0c6Smrg#
27728fc2d0c6Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
27738fc2d0c6Smrg#   success/failure.
27748fc2d0c6Smrg#
27758fc2d0c6Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
27768fc2d0c6Smrg#
27778fc2d0c6Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
27788fc2d0c6Smrg#
27798fc2d0c6Smrg# LICENSE
27808fc2d0c6Smrg#
27818fc2d0c6Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
27828fc2d0c6Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
27838fc2d0c6Smrg#   Copyright (c) 2009 Matteo Frigo
27848fc2d0c6Smrg#
27858fc2d0c6Smrg#   This program is free software: you can redistribute it and/or modify it
27868fc2d0c6Smrg#   under the terms of the GNU General Public License as published by the
27878fc2d0c6Smrg#   Free Software Foundation, either version 3 of the License, or (at your
27888fc2d0c6Smrg#   option) any later version.
27898fc2d0c6Smrg#
27908fc2d0c6Smrg#   This program is distributed in the hope that it will be useful, but
27918fc2d0c6Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
27928fc2d0c6Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
27938fc2d0c6Smrg#   Public License for more details.
27948fc2d0c6Smrg#
27958fc2d0c6Smrg#   You should have received a copy of the GNU General Public License along
27968fc2d0c6Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
27978fc2d0c6Smrg#
27988fc2d0c6Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
27998fc2d0c6Smrg#   gives unlimited permission to copy, distribute and modify the configure
28008fc2d0c6Smrg#   scripts that are the output of Autoconf when processing the Macro. You
28018fc2d0c6Smrg#   need not follow the terms of the GNU General Public License when using
28028fc2d0c6Smrg#   or distributing such scripts, even though portions of the text of the
28038fc2d0c6Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
28048fc2d0c6Smrg#   all other use of the material that constitutes the Autoconf Macro.
28058fc2d0c6Smrg#
28068fc2d0c6Smrg#   This special exception to the GPL applies to versions of the Autoconf
28078fc2d0c6Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
28088fc2d0c6Smrg#   modified version of the Autoconf Macro, you may extend this special
28098fc2d0c6Smrg#   exception to the GPL to apply to your modified version as well.#
28108fc2d0c6SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
28118fc2d0c6Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
28128fc2d0c6Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
28138fc2d0c6SmrgAS_LITERAL_IF([$1],
28148fc2d0c6Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
28158fc2d0c6Smrg      ax_save_FLAGS=$LDFLAGS
28168fc2d0c6Smrg      LDFLAGS="$1"
28178fc2d0c6Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
28188fc2d0c6Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
28198fc2d0c6Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
28208fc2d0c6Smrg      LDFLAGS=$ax_save_FLAGS])],
28218fc2d0c6Smrg  [ax_save_FLAGS=$LDFLAGS
28228fc2d0c6Smrg   LDFLAGS="$1"
28238fc2d0c6Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
28248fc2d0c6Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
28258fc2d0c6Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
28268fc2d0c6Smrg   LDFLAGS=$ax_save_FLAGS])
28278fc2d0c6Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
28288fc2d0c6SmrgAC_MSG_RESULT($xorg_check_linker_flags)
28298fc2d0c6Smrgif test "x$xorg_check_linker_flags" = xyes; then
28308fc2d0c6Smrg	m4_default([$2], :)
283154b44505Smrgelse
28328fc2d0c6Smrg	m4_default([$3], :)
283354b44505Smrgfi
28348fc2d0c6Smrg]) # XORG_CHECK_LINKER_FLAGS
28354a041c5bSmacallan
28368fc2d0c6Smrg# XORG_MEMORY_CHECK_FLAGS
28378fc2d0c6Smrg# -----------------------
28388fc2d0c6Smrg# Minimum version: 1.16.0
28398fc2d0c6Smrg#
28408fc2d0c6Smrg# This macro attempts to find appropriate memory checking functionality
28418fc2d0c6Smrg# for various platforms which unit testing code may use to catch various
28428fc2d0c6Smrg# forms of memory allocation and access errors in testing.
28438fc2d0c6Smrg#
28448fc2d0c6Smrg# Interface to module:
28458fc2d0c6Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
28468fc2d0c6Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
28478fc2d0c6Smrg#
28488fc2d0c6Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
28498fc2d0c6Smrg#
28508fc2d0c6SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
28514a041c5bSmacallan
28528fc2d0c6SmrgAC_REQUIRE([AC_CANONICAL_HOST])
28538fc2d0c6SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
28548fc2d0c6Smrg           [Environment variables to enable memory checking in tests])
28558fc2d0c6Smrg
28568fc2d0c6Smrg# Check for different types of support on different platforms
28578fc2d0c6Smrgcase $host_os in
28588fc2d0c6Smrg    solaris*)
28598fc2d0c6Smrg        AC_CHECK_LIB([umem], [umem_alloc],
28608fc2d0c6Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
28610a392d7eSmrg        ;;
28628fc2d0c6Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
28638fc2d0c6Smrg        # both directly and inverted, so should not be 0 or 255.
28648fc2d0c6Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
28650a392d7eSmrg        ;;
28668fc2d0c6Smrg    darwin*)
28678fc2d0c6Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
28680a392d7eSmrg        ;;
28698fc2d0c6Smrg    *bsd*)
28708fc2d0c6Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
28710a392d7eSmrg        ;;
28728fc2d0c6Smrgesac
28730a392d7eSmrg
28748fc2d0c6Smrg# User supplied flags override default flags
28758fc2d0c6Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
28768fc2d0c6Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
28778fc2d0c6Smrgfi
28780a392d7eSmrg
28798fc2d0c6SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
28808fc2d0c6Smrg]) # XORG_WITH_LINT
28818fc2d0c6Smrg
28828fc2d0c6Smrg# XORG_CHECK_MALLOC_ZERO
28838fc2d0c6Smrg# ----------------------
28848fc2d0c6Smrg# Minimum version: 1.0.0
28858fc2d0c6Smrg#
28868fc2d0c6Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
28878fc2d0c6Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
28888fc2d0c6Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
28898fc2d0c6SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
28908fc2d0c6SmrgAC_ARG_ENABLE(malloc0returnsnull,
28918fc2d0c6Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
28928fc2d0c6Smrg		       [malloc(0) returns NULL (default: auto)]),
28938fc2d0c6Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
28948fc2d0c6Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
28958fc2d0c6Smrg
28968fc2d0c6SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
28978fc2d0c6Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
28988fc2d0c6SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
28998fc2d0c6Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
29008fc2d0c6Smrg#include <stdlib.h>
29018fc2d0c6Smrg],[
29028fc2d0c6Smrg    char *m0, *r0, *c0, *p;
29038fc2d0c6Smrg    m0 = malloc(0);
29048fc2d0c6Smrg    p = malloc(10);
29058fc2d0c6Smrg    r0 = realloc(p,0);
29068fc2d0c6Smrg    c0 = calloc(0,10);
29078fc2d0c6Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
29088fc2d0c6Smrg])],
29098fc2d0c6Smrg		[xorg_cv_malloc0_returns_null=yes],
29108fc2d0c6Smrg		[xorg_cv_malloc0_returns_null=no])])
29118fc2d0c6SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
29128fc2d0c6Smrgfi
29138fc2d0c6SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
29148fc2d0c6Smrg
29158fc2d0c6Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
29168fc2d0c6Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
29178fc2d0c6Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
29188fc2d0c6Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
291954b44505Smrgelse
29208fc2d0c6Smrg	MALLOC_ZERO_CFLAGS=""
29218fc2d0c6Smrg	XMALLOC_ZERO_CFLAGS=""
29228fc2d0c6Smrg	XTMALLOC_ZERO_CFLAGS=""
29238fc2d0c6Smrgfi
29244a041c5bSmacallan
29258fc2d0c6SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
29268fc2d0c6SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
29278fc2d0c6SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
29288fc2d0c6Smrg]) # XORG_CHECK_MALLOC_ZERO
29294a041c5bSmacallan
29308fc2d0c6Smrg# XORG_WITH_LINT()
29318fc2d0c6Smrg# ----------------
29328fc2d0c6Smrg# Minimum version: 1.1.0
29338fc2d0c6Smrg#
29348fc2d0c6Smrg# This macro enables the use of a tool that flags some suspicious and
29358fc2d0c6Smrg# non-portable constructs (likely to be bugs) in C language source code.
29368fc2d0c6Smrg# It will attempt to locate the tool and use appropriate options.
29378fc2d0c6Smrg# There are various lint type tools on different platforms.
29388fc2d0c6Smrg#
29398fc2d0c6Smrg# Interface to module:
29408fc2d0c6Smrg# LINT:		returns the path to the tool found on the platform
29418fc2d0c6Smrg#		or the value set to LINT on the configure cmd line
29428fc2d0c6Smrg#		also an Automake conditional
29438fc2d0c6Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
29448fc2d0c6Smrg#
29458fc2d0c6Smrg# --with-lint:	'yes' user instructs the module to use lint
29468fc2d0c6Smrg#		'no' user instructs the module not to use lint (default)
29478fc2d0c6Smrg#
29488fc2d0c6Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
29498fc2d0c6Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
29508fc2d0c6Smrg#
29518fc2d0c6SmrgAC_DEFUN([XORG_WITH_LINT],[
29528fc2d0c6Smrg
29538fc2d0c6SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
29548fc2d0c6SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
29558fc2d0c6SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
29568fc2d0c6Smrg		[Use a lint-style source code checker (default: disabled)])],
29578fc2d0c6Smrg		[use_lint=$withval], [use_lint=no])
29580a392d7eSmrg
29598fc2d0c6Smrg# Obtain platform specific info like program name and options
29608fc2d0c6Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
296154b44505Smrgcase $host_os in
29628fc2d0c6Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
29638fc2d0c6Smrg	lint_name=splint
29648fc2d0c6Smrg	lint_options="-badflag"
29658fc2d0c6Smrg	;;
29668fc2d0c6Smrg  *freebsd* | *netbsd*)
29678fc2d0c6Smrg	lint_name=lint
29688fc2d0c6Smrg	lint_options="-u -b"
29698fc2d0c6Smrg	;;
29708fc2d0c6Smrg  *solaris*)
29718fc2d0c6Smrg	lint_name=lint
29728fc2d0c6Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
29738fc2d0c6Smrg	;;
29748fc2d0c6Smrgesac
29754a041c5bSmacallan
29768fc2d0c6Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
29778fc2d0c6Smrgif test "x$use_lint" = x"yes" ; then
29788fc2d0c6Smrg   AC_PATH_PROG([LINT], [$lint_name])
29798fc2d0c6Smrg   if test "x$LINT" = "x"; then
29808fc2d0c6Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
29818fc2d0c6Smrg   fi
29828fc2d0c6Smrgelif test "x$use_lint" = x"no" ; then
29838fc2d0c6Smrg   if test "x$LINT" != "x"; then
29848fc2d0c6Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
29858fc2d0c6Smrg   fi
29868fc2d0c6Smrgelse
29878fc2d0c6Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
29888fc2d0c6Smrgfi
29894a041c5bSmacallan
29908fc2d0c6Smrg# User supplied flags override default flags
29918fc2d0c6Smrgif test "x$LINT_FLAGS" != "x"; then
29928fc2d0c6Smrg   lint_options=$LINT_FLAGS
29938fc2d0c6Smrgfi
29940a392d7eSmrg
29958fc2d0c6SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
29968fc2d0c6SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
29974a041c5bSmacallan
29988fc2d0c6Smrg]) # XORG_WITH_LINT
299954b44505Smrg
30008fc2d0c6Smrg# XORG_LINT_LIBRARY(LIBNAME)
30018fc2d0c6Smrg# --------------------------
30028fc2d0c6Smrg# Minimum version: 1.1.0
30038fc2d0c6Smrg#
30048fc2d0c6Smrg# Sets up flags for building lint libraries for checking programs that call
30058fc2d0c6Smrg# functions in the library.
30068fc2d0c6Smrg#
30078fc2d0c6Smrg# Interface to module:
30088fc2d0c6Smrg# LINTLIB		- Automake variable with the name of lint library file to make
30098fc2d0c6Smrg# MAKE_LINT_LIB		- Automake conditional
30108fc2d0c6Smrg#
30118fc2d0c6Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
30128fc2d0c6Smrg#			  - 'no' user instructs the module not to create a lint library (default)
301354b44505Smrg
30148fc2d0c6SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
30158fc2d0c6SmrgAC_REQUIRE([XORG_WITH_LINT])
30168fc2d0c6SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
30178fc2d0c6Smrg	[Create lint library (default: disabled)])],
30188fc2d0c6Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
30194a041c5bSmacallan
30208fc2d0c6Smrgif test "x$make_lint_lib" = x"yes" ; then
30218fc2d0c6Smrg   LINTLIB=llib-l$1.ln
30228fc2d0c6Smrg   if test "x$LINT" = "x"; then
30238fc2d0c6Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
30248fc2d0c6Smrg   fi
30258fc2d0c6Smrgelif test "x$make_lint_lib" != x"no" ; then
30268fc2d0c6Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
30278fc2d0c6Smrgfi
30284a041c5bSmacallan
30298fc2d0c6SmrgAC_SUBST(LINTLIB)
30308fc2d0c6SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
30314a041c5bSmacallan
30328fc2d0c6Smrg]) # XORG_LINT_LIBRARY
30334a041c5bSmacallan
30348fc2d0c6Smrg# XORG_COMPILER_BRAND
30358fc2d0c6Smrg# -------------------
30368fc2d0c6Smrg# Minimum version: 1.14.0
30378fc2d0c6Smrg#
30388fc2d0c6Smrg# Checks for various brands of compilers and sets flags as appropriate:
30398fc2d0c6Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
30408fc2d0c6Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
30418fc2d0c6Smrg#   clang compiler - sets CLANGCC to "yes"
30428fc2d0c6Smrg#   Intel compiler - sets INTELCC to "yes"
30438fc2d0c6Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
30448fc2d0c6Smrg#
30458fc2d0c6SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
30468fc2d0c6SmrgAC_LANG_CASE(
30478fc2d0c6Smrg	[C], [
30488fc2d0c6Smrg		AC_REQUIRE([AC_PROG_CC_C99])
30498fc2d0c6Smrg	],
30508fc2d0c6Smrg	[C++], [
30518fc2d0c6Smrg		AC_REQUIRE([AC_PROG_CXX])
30528fc2d0c6Smrg	]
30538fc2d0c6Smrg)
30548fc2d0c6SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
30558fc2d0c6SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
30568fc2d0c6SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
30578fc2d0c6Smrg]) # XORG_COMPILER_BRAND
30584a041c5bSmacallan
30598fc2d0c6Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
30608fc2d0c6Smrg# ---------------
30618fc2d0c6Smrg# Minimum version: 1.16.0
30628fc2d0c6Smrg#
30638fc2d0c6Smrg# Test if the compiler works when passed the given flag as a command line argument.
30648fc2d0c6Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
30658fc2d0c6Smrg# next flag in the list until there are no more options.
30668fc2d0c6Smrg#
30678fc2d0c6Smrg# Note that this does not guarantee that the compiler supports the flag as some
30688fc2d0c6Smrg# compilers will simply ignore arguments that they do not understand, but we do
30698fc2d0c6Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
30708fc2d0c6Smrg# -Werror=unused-command-line-argument
30718fc2d0c6Smrg#
30728fc2d0c6SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
30738fc2d0c6Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
30748fc2d0c6Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
30754a041c5bSmacallan
30768fc2d0c6SmrgAC_LANG_COMPILER_REQUIRE
30774a041c5bSmacallan
30788fc2d0c6SmrgAC_LANG_CASE(
30798fc2d0c6Smrg	[C], [
30808fc2d0c6Smrg		AC_REQUIRE([AC_PROG_CC_C99])
30818fc2d0c6Smrg		define([PREFIX], [C])
30828fc2d0c6Smrg		define([CACHE_PREFIX], [cc])
30838fc2d0c6Smrg		define([COMPILER], [$CC])
30848fc2d0c6Smrg	],
30858fc2d0c6Smrg	[C++], [
30868fc2d0c6Smrg		define([PREFIX], [CXX])
30878fc2d0c6Smrg		define([CACHE_PREFIX], [cxx])
30888fc2d0c6Smrg		define([COMPILER], [$CXX])
30898fc2d0c6Smrg	]
30908fc2d0c6Smrg)
30914a041c5bSmacallan
30928fc2d0c6Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
30934a041c5bSmacallan
30948fc2d0c6Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
30958fc2d0c6Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
30968fc2d0c6Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
30978fc2d0c6Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
30988fc2d0c6Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
30998fc2d0c6Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
31008fc2d0c6Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
31018fc2d0c6Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
31028fc2d0c6Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
31038fc2d0c6Smrgfi
31044a041c5bSmacallan
31058fc2d0c6Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
31068fc2d0c6Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
31078fc2d0c6Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
31088fc2d0c6Smrg	fi
31098fc2d0c6Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
31108fc2d0c6Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
31118fc2d0c6Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
31128fc2d0c6Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
31138fc2d0c6Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
31148fc2d0c6Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
31158fc2d0c6Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
31168fc2d0c6Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
31178fc2d0c6Smrgfi
31184a041c5bSmacallan
31198fc2d0c6Smrgfound="no"
31208fc2d0c6Smrgm4_foreach([flag], m4_cdr($@), [
31218fc2d0c6Smrg	if test $found = "no" ; then
31228fc2d0c6Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
31238fc2d0c6Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
31248fc2d0c6Smrg		fi
31254a041c5bSmacallan
31268fc2d0c6Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
31278fc2d0c6Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
31288fc2d0c6Smrg		fi
31294a041c5bSmacallan
31308fc2d0c6Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
31314a041c5bSmacallan
31328fc2d0c6Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
31338fc2d0c6Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
31348fc2d0c6Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
31358fc2d0c6Smrg		AC_CACHE_VAL($cacheid,
31368fc2d0c6Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
31378fc2d0c6Smrg					     [eval $cacheid=yes],
31388fc2d0c6Smrg					     [eval $cacheid=no])])
313954b44505Smrg
31408fc2d0c6Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
31414a041c5bSmacallan
31428fc2d0c6Smrg		eval supported=\$$cacheid
31438fc2d0c6Smrg		AC_MSG_RESULT([$supported])
31448fc2d0c6Smrg		if test "$supported" = "yes" ; then
31458fc2d0c6Smrg			$1="$$1 ]flag["
31468fc2d0c6Smrg			found="yes"
31478fc2d0c6Smrg		fi
31488fc2d0c6Smrg	fi
31498fc2d0c6Smrg])
31508fc2d0c6Smrg]) # XORG_TESTSET_CFLAG
31510a392d7eSmrg
31528fc2d0c6Smrg# XORG_COMPILER_FLAGS
31538fc2d0c6Smrg# ---------------
31548fc2d0c6Smrg# Minimum version: 1.16.0
31558fc2d0c6Smrg#
31568fc2d0c6Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
31578fc2d0c6Smrg# arguments supported by the selected compiler which do NOT alter the generated
31588fc2d0c6Smrg# code.  These arguments will cause the compiler to print various warnings
31598fc2d0c6Smrg# during compilation AND turn a conservative set of warnings into errors.
31608fc2d0c6Smrg#
31618fc2d0c6Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
31628fc2d0c6Smrg# future versions of util-macros as options are added to new compilers.
31638fc2d0c6Smrg#
31648fc2d0c6SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
31658fc2d0c6SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
31660a392d7eSmrg
31678fc2d0c6SmrgAC_ARG_ENABLE(selective-werror,
31688fc2d0c6Smrg              AS_HELP_STRING([--disable-selective-werror],
31698fc2d0c6Smrg                             [Turn off selective compiler errors. (default: enabled)]),
31708fc2d0c6Smrg              [SELECTIVE_WERROR=$enableval],
31718fc2d0c6Smrg              [SELECTIVE_WERROR=yes])
31720a392d7eSmrg
31738fc2d0c6SmrgAC_LANG_CASE(
31748fc2d0c6Smrg        [C], [
31758fc2d0c6Smrg                define([PREFIX], [C])
31768fc2d0c6Smrg        ],
31778fc2d0c6Smrg        [C++], [
31788fc2d0c6Smrg                define([PREFIX], [CXX])
31798fc2d0c6Smrg        ]
31808fc2d0c6Smrg)
31818fc2d0c6Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
31828fc2d0c6Smrgif test "x$SUNCC" = "xyes"; then
31838fc2d0c6Smrg    [BASE_]PREFIX[FLAGS]="-v"
31848fc2d0c6Smrgelse
31858fc2d0c6Smrg    [BASE_]PREFIX[FLAGS]=""
31868fc2d0c6Smrgfi
318754b44505Smrg
31888fc2d0c6Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
31898fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
31908fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
31918fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
31928fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
319354b44505Smrg
31948fc2d0c6SmrgAC_LANG_CASE(
31958fc2d0c6Smrg	[C], [
31968fc2d0c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
31978fc2d0c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
31988fc2d0c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
31998fc2d0c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
32008fc2d0c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
32018fc2d0c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
32028fc2d0c6Smrg	]
32038fc2d0c6Smrg)
320454b44505Smrg
32058fc2d0c6Smrg# This chunk adds additional warnings that could catch undesired effects.
32068fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
32078fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
32088fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
32098fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
32108fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
32118fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
32128fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
32134a041c5bSmacallan
32148fc2d0c6Smrg# These are currently disabled because they are noisy.  They will be enabled
32158fc2d0c6Smrg# in the future once the codebase is sufficiently modernized to silence
32168fc2d0c6Smrg# them.  For now, I don't want them to drown out the other warnings.
32178fc2d0c6Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
32188fc2d0c6Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
32198fc2d0c6Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
32204a041c5bSmacallan
32218fc2d0c6Smrg# Turn some warnings into errors, so we don't accidently get successful builds
32228fc2d0c6Smrg# when there are problems that should be fixed.
32234a041c5bSmacallan
32248fc2d0c6Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
32258fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
32268fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
32278fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
32288fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
32298fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
32308fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
32318fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
32328fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
32338fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
32348fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
32358fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
32368fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
32378fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
32388fc2d0c6Smrgelse
32398fc2d0c6SmrgAC_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])
32408fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
32418fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
32428fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
32438fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
32448fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
32458fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
32468fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
32478fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
32488fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
32498fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
32508fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
32518fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
32528fc2d0c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
32538fc2d0c6Smrgfi
32544a041c5bSmacallan
32558fc2d0c6SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
32568fc2d0c6Smrg]) # XORG_COMPILER_FLAGS
32574a041c5bSmacallan
32588fc2d0c6Smrg# XORG_CWARNFLAGS
32598fc2d0c6Smrg# ---------------
32608fc2d0c6Smrg# Minimum version: 1.2.0
32618fc2d0c6Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
32628fc2d0c6Smrg#
32638fc2d0c6Smrg# Defines CWARNFLAGS to enable C compiler warnings.
32648fc2d0c6Smrg#
32658fc2d0c6Smrg# This function is deprecated because it defines -fno-strict-aliasing
32668fc2d0c6Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
32678fc2d0c6Smrg# is needed, then it should be added explicitly in the module when
32688fc2d0c6Smrg# it is updated to use BASE_CFLAGS.
32698fc2d0c6Smrg#
32708fc2d0c6SmrgAC_DEFUN([XORG_CWARNFLAGS], [
32718fc2d0c6SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
32728fc2d0c6SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
32738fc2d0c6SmrgAC_LANG_CASE(
32748fc2d0c6Smrg	[C], [
32758fc2d0c6Smrg		CWARNFLAGS="$BASE_CFLAGS"
32768fc2d0c6Smrg		if  test "x$GCC" = xyes ; then
32778fc2d0c6Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
32788fc2d0c6Smrg		fi
32798fc2d0c6Smrg		AC_SUBST(CWARNFLAGS)
32808fc2d0c6Smrg	]
32818fc2d0c6Smrg)
32828fc2d0c6Smrg]) # XORG_CWARNFLAGS
328354b44505Smrg
32848fc2d0c6Smrg# XORG_STRICT_OPTION
32858fc2d0c6Smrg# -----------------------
32868fc2d0c6Smrg# Minimum version: 1.3.0
32878fc2d0c6Smrg#
32888fc2d0c6Smrg# Add configure option to enable strict compilation flags, such as treating
32898fc2d0c6Smrg# warnings as fatal errors.
32908fc2d0c6Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
32918fc2d0c6Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
32928fc2d0c6Smrg#
32938fc2d0c6Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
32948fc2d0c6Smrg# when strict compilation is unconditionally desired.
32958fc2d0c6SmrgAC_DEFUN([XORG_STRICT_OPTION], [
32968fc2d0c6SmrgAC_REQUIRE([XORG_CWARNFLAGS])
32978fc2d0c6SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
32984a041c5bSmacallan
32998fc2d0c6SmrgAC_ARG_ENABLE(strict-compilation,
33008fc2d0c6Smrg			  AS_HELP_STRING([--enable-strict-compilation],
33018fc2d0c6Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
33028fc2d0c6Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
33034a041c5bSmacallan
33048fc2d0c6SmrgAC_LANG_CASE(
33058fc2d0c6Smrg        [C], [
33068fc2d0c6Smrg                define([PREFIX], [C])
33078fc2d0c6Smrg        ],
33088fc2d0c6Smrg        [C++], [
33098fc2d0c6Smrg                define([PREFIX], [CXX])
33108fc2d0c6Smrg        ]
33118fc2d0c6Smrg)
331254b44505Smrg
33138fc2d0c6Smrg[STRICT_]PREFIX[FLAGS]=""
33148fc2d0c6SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
33158fc2d0c6SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
33164a041c5bSmacallan
33178fc2d0c6Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
33188fc2d0c6Smrg# activate it with -Werror, so we add it here explicitly.
33198fc2d0c6SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
33204a041c5bSmacallan
33218fc2d0c6Smrgif test "x$STRICT_COMPILE" = "xyes"; then
33228fc2d0c6Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
33238fc2d0c6Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
33248fc2d0c6Smrgfi
33258fc2d0c6SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
33268fc2d0c6SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
33278fc2d0c6SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
33288fc2d0c6Smrg]) # XORG_STRICT_OPTION
33294a041c5bSmacallan
33308fc2d0c6Smrg# XORG_DEFAULT_OPTIONS
33318fc2d0c6Smrg# --------------------
33328fc2d0c6Smrg# Minimum version: 1.3.0
33338fc2d0c6Smrg#
33348fc2d0c6Smrg# Defines default options for X.Org modules.
33358fc2d0c6Smrg#
33368fc2d0c6SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
33378fc2d0c6SmrgAC_REQUIRE([AC_PROG_INSTALL])
33388fc2d0c6SmrgXORG_COMPILER_FLAGS
33398fc2d0c6SmrgXORG_CWARNFLAGS
33408fc2d0c6SmrgXORG_STRICT_OPTION
33418fc2d0c6SmrgXORG_RELEASE_VERSION
33428fc2d0c6SmrgXORG_CHANGELOG
33438fc2d0c6SmrgXORG_INSTALL
33448fc2d0c6SmrgXORG_MANPAGE_SECTIONS
33458fc2d0c6Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
33468fc2d0c6Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
33478fc2d0c6Smrg]) # XORG_DEFAULT_OPTIONS
33484a041c5bSmacallan
33498fc2d0c6Smrg# XORG_INSTALL()
33508fc2d0c6Smrg# ----------------
33518fc2d0c6Smrg# Minimum version: 1.4.0
33528fc2d0c6Smrg#
33538fc2d0c6Smrg# Defines the variable INSTALL_CMD as the command to copy
33548fc2d0c6Smrg# INSTALL from $prefix/share/util-macros.
33558fc2d0c6Smrg#
33568fc2d0c6SmrgAC_DEFUN([XORG_INSTALL], [
33578fc2d0c6SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
33588fc2d0c6Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
33598fc2d0c6SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
33608fc2d0c6Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
33618fc2d0c6Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
33628fc2d0c6Smrgtouch \$(top_srcdir)/INSTALL; \
33638fc2d0c6Smrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
33648fc2d0c6SmrgAC_SUBST([INSTALL_CMD])
33658fc2d0c6Smrg]) # XORG_INSTALL
33668fc2d0c6Smrgdnl Copyright 2005 Red Hat, Inc
33678fc2d0c6Smrgdnl
33688fc2d0c6Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
33698fc2d0c6Smrgdnl documentation for any purpose is hereby granted without fee, provided that
33708fc2d0c6Smrgdnl the above copyright notice appear in all copies and that both that
33718fc2d0c6Smrgdnl copyright notice and this permission notice appear in supporting
33728fc2d0c6Smrgdnl documentation.
33738fc2d0c6Smrgdnl
33748fc2d0c6Smrgdnl The above copyright notice and this permission notice shall be included
33758fc2d0c6Smrgdnl in all copies or substantial portions of the Software.
33768fc2d0c6Smrgdnl
33778fc2d0c6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
33788fc2d0c6Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33798fc2d0c6Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
33808fc2d0c6Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
33818fc2d0c6Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
33828fc2d0c6Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
33838fc2d0c6Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
33848fc2d0c6Smrgdnl
33858fc2d0c6Smrgdnl Except as contained in this notice, the name of the copyright holders shall
33868fc2d0c6Smrgdnl not be used in advertising or otherwise to promote the sale, use or
33878fc2d0c6Smrgdnl other dealings in this Software without prior written authorization
33888fc2d0c6Smrgdnl from the copyright holders.
33898fc2d0c6Smrgdnl
339054b44505Smrg
33918fc2d0c6Smrg# XORG_RELEASE_VERSION
33928fc2d0c6Smrg# --------------------
33938fc2d0c6Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
339454b44505Smrg
33958fc2d0c6SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
33968fc2d0c6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
33978fc2d0c6Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
33988fc2d0c6Smrg		[Major version of this package])
33998fc2d0c6Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
34008fc2d0c6Smrg	if test "x$PVM" = "x"; then
34018fc2d0c6Smrg		PVM="0"
34028fc2d0c6Smrg	fi
34038fc2d0c6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
34048fc2d0c6Smrg		[$PVM],
34058fc2d0c6Smrg		[Minor version of this package])
34068fc2d0c6Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
34078fc2d0c6Smrg	if test "x$PVP" = "x"; then
34088fc2d0c6Smrg		PVP="0"
34098fc2d0c6Smrg	fi
34108fc2d0c6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
34118fc2d0c6Smrg		[$PVP],
34128fc2d0c6Smrg		[Patch version of this package])
34138fc2d0c6Smrg])
34144a041c5bSmacallan
34158fc2d0c6Smrg# XORG_CHANGELOG()
34168fc2d0c6Smrg# ----------------
34178fc2d0c6Smrg# Minimum version: 1.2.0
34188fc2d0c6Smrg#
34198fc2d0c6Smrg# Defines the variable CHANGELOG_CMD as the command to generate
34208fc2d0c6Smrg# ChangeLog from git.
34218fc2d0c6Smrg#
34228fc2d0c6Smrg#
34238fc2d0c6SmrgAC_DEFUN([XORG_CHANGELOG], [
34248fc2d0c6SmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
34258fc2d0c6Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
34268fc2d0c6Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
34278fc2d0c6Smrgtouch \$(top_srcdir)/ChangeLog; \
34288fc2d0c6Smrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
34298fc2d0c6SmrgAC_SUBST([CHANGELOG_CMD])
34308fc2d0c6Smrg]) # XORG_CHANGELOG
34314a041c5bSmacallan
34328fc2d0c6Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
34338fc2d0c6Smrg#
34348fc2d0c6Smrg#   Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
34358fc2d0c6Smrg#   Foundation, Inc.
34368fc2d0c6Smrg#   Written by Gordon Matzigkeit, 1996
34378fc2d0c6Smrg#
34388fc2d0c6Smrg# This file is free software; the Free Software Foundation gives
34398fc2d0c6Smrg# unlimited permission to copy and/or distribute it, with or without
34408fc2d0c6Smrg# modifications, as long as this notice is preserved.
34410a392d7eSmrg
34428fc2d0c6Smrgm4_define([_LT_COPYING], [dnl
34438fc2d0c6Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
34448fc2d0c6Smrg# This is free software; see the source for copying conditions.  There is NO
34458fc2d0c6Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
34464a041c5bSmacallan
34478fc2d0c6Smrg# GNU Libtool is free software; you can redistribute it and/or modify
34488fc2d0c6Smrg# it under the terms of the GNU General Public License as published by
34498fc2d0c6Smrg# the Free Software Foundation; either version 2 of of the License, or
34508fc2d0c6Smrg# (at your option) any later version.
34518fc2d0c6Smrg#
34528fc2d0c6Smrg# As a special exception to the GNU General Public License, if you
34538fc2d0c6Smrg# distribute this file as part of a program or library that is built
34548fc2d0c6Smrg# using GNU Libtool, you may include this file under the  same
34558fc2d0c6Smrg# distribution terms that you use for the rest of that program.
34568fc2d0c6Smrg#
34578fc2d0c6Smrg# GNU Libtool is distributed in the hope that it will be useful, but
34588fc2d0c6Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
34598fc2d0c6Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
34608fc2d0c6Smrg# GNU General Public License for more details.
34618fc2d0c6Smrg#
34628fc2d0c6Smrg# You should have received a copy of the GNU General Public License
34638fc2d0c6Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
34648fc2d0c6Smrg])
34650a392d7eSmrg
34668fc2d0c6Smrg# serial 59 LT_INIT
34670a392d7eSmrg
346854b44505Smrg
34698fc2d0c6Smrg# LT_PREREQ(VERSION)
34708fc2d0c6Smrg# ------------------
34718fc2d0c6Smrg# Complain and exit if this libtool version is less that VERSION.
34728fc2d0c6Smrgm4_defun([LT_PREREQ],
34738fc2d0c6Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
34748fc2d0c6Smrg       [m4_default([$3],
34758fc2d0c6Smrg		   [m4_fatal([Libtool version $1 or higher is required],
34768fc2d0c6Smrg		             63)])],
34778fc2d0c6Smrg       [$2])])
347854b44505Smrg
34794a041c5bSmacallan
34808fc2d0c6Smrg# _LT_CHECK_BUILDDIR
34818fc2d0c6Smrg# ------------------
34828fc2d0c6Smrg# Complain if the absolute build directory name contains unusual characters
34838fc2d0c6Smrgm4_defun([_LT_CHECK_BUILDDIR],
34848fc2d0c6Smrg[case `pwd` in
34858fc2d0c6Smrg  *\ * | *\	*)
34868fc2d0c6Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
34878fc2d0c6Smrgesac
34888fc2d0c6Smrg])
34894a041c5bSmacallan
34904a041c5bSmacallan
34918fc2d0c6Smrg# LT_INIT([OPTIONS])
34928fc2d0c6Smrg# ------------------
34938fc2d0c6SmrgAC_DEFUN([LT_INIT],
34948fc2d0c6Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
34958fc2d0c6SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
34968fc2d0c6SmrgAC_BEFORE([$0], [LT_LANG])dnl
34978fc2d0c6SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
34988fc2d0c6SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
34998fc2d0c6Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
35004a041c5bSmacallan
35018fc2d0c6Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
35028fc2d0c6Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
35038fc2d0c6Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
35048fc2d0c6Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
35058fc2d0c6Smrgdnl unless we require an AC_DEFUNed macro:
35068fc2d0c6SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
35078fc2d0c6SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
35088fc2d0c6SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
35098fc2d0c6SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
35108fc2d0c6Smrgm4_require([_LT_PROG_LTMAIN])dnl
35114a041c5bSmacallan
35128fc2d0c6Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
35134a041c5bSmacallan
35148fc2d0c6Smrgdnl Parse OPTIONS
35158fc2d0c6Smrg_LT_SET_OPTIONS([$0], [$1])
35164a041c5bSmacallan
35178fc2d0c6Smrg# This can be used to rebuild libtool when needed
35188fc2d0c6SmrgLIBTOOL_DEPS=$ltmain
35194a041c5bSmacallan
35208fc2d0c6Smrg# Always use our own libtool.
35218fc2d0c6SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
35228fc2d0c6SmrgAC_SUBST(LIBTOOL)dnl
35234a041c5bSmacallan
35248fc2d0c6Smrg_LT_SETUP
35254a041c5bSmacallan
35268fc2d0c6Smrg# Only expand once:
35278fc2d0c6Smrgm4_define([LT_INIT])
35288fc2d0c6Smrg])# LT_INIT
35294a041c5bSmacallan
353054b44505Smrg# Old names:
35318fc2d0c6SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
35328fc2d0c6SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
353354b44505Smrgdnl aclocal-1.4 backwards compatibility:
35348fc2d0c6Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
35358fc2d0c6Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
35364a041c5bSmacallan
35374a041c5bSmacallan
35388fc2d0c6Smrg# _LT_PREPARE_CC_BASENAME
35398fc2d0c6Smrg# -----------------------
35408fc2d0c6Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
35418fc2d0c6Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
35428fc2d0c6Smrgfunc_cc_basename ()
35438fc2d0c6Smrg{
35448fc2d0c6Smrg    for cc_temp in @S|@*""; do
35458fc2d0c6Smrg      case $cc_temp in
35468fc2d0c6Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
35478fc2d0c6Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
35488fc2d0c6Smrg        \-*) ;;
35498fc2d0c6Smrg        *) break;;
35508fc2d0c6Smrg      esac
35518fc2d0c6Smrg    done
35528fc2d0c6Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
35538fc2d0c6Smrg}
35548fc2d0c6Smrg])# _LT_PREPARE_CC_BASENAME
35554a041c5bSmacallan
35564a041c5bSmacallan
35578fc2d0c6Smrg# _LT_CC_BASENAME(CC)
35588fc2d0c6Smrg# -------------------
35598fc2d0c6Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
35608fc2d0c6Smrg# but that macro is also expanded into generated libtool script, which
35618fc2d0c6Smrg# arranges for $SED and $ECHO to be set by different means.
35628fc2d0c6Smrgm4_defun([_LT_CC_BASENAME],
35638fc2d0c6Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
35648fc2d0c6SmrgAC_REQUIRE([_LT_DECL_SED])dnl
35658fc2d0c6SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
35668fc2d0c6Smrgfunc_cc_basename $1
35678fc2d0c6Smrgcc_basename=$func_cc_basename_result
35688fc2d0c6Smrg])
35694a041c5bSmacallan
35704a041c5bSmacallan
35718fc2d0c6Smrg# _LT_FILEUTILS_DEFAULTS
35728fc2d0c6Smrg# ----------------------
35738fc2d0c6Smrg# It is okay to use these file commands and assume they have been set
35748fc2d0c6Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
35758fc2d0c6Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
35768fc2d0c6Smrg[: ${CP="cp -f"}
35778fc2d0c6Smrg: ${MV="mv -f"}
35788fc2d0c6Smrg: ${RM="rm -f"}
35798fc2d0c6Smrg])# _LT_FILEUTILS_DEFAULTS
35800a392d7eSmrg
35810a392d7eSmrg
35828fc2d0c6Smrg# _LT_SETUP
35838fc2d0c6Smrg# ---------
35848fc2d0c6Smrgm4_defun([_LT_SETUP],
35858fc2d0c6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
35868fc2d0c6SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
35878fc2d0c6SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
35888fc2d0c6SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
35898fc2d0c6Smrg
35908fc2d0c6Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
35918fc2d0c6Smrgdnl
35928fc2d0c6Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
35938fc2d0c6Smrg_LT_DECL([], [host], [0])dnl
35948fc2d0c6Smrg_LT_DECL([], [host_os], [0])dnl
35958fc2d0c6Smrgdnl
35968fc2d0c6Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
35978fc2d0c6Smrg_LT_DECL([], [build], [0])dnl
35988fc2d0c6Smrg_LT_DECL([], [build_os], [0])dnl
35998fc2d0c6Smrgdnl
36008fc2d0c6SmrgAC_REQUIRE([AC_PROG_CC])dnl
36018fc2d0c6SmrgAC_REQUIRE([LT_PATH_LD])dnl
36028fc2d0c6SmrgAC_REQUIRE([LT_PATH_NM])dnl
36038fc2d0c6Smrgdnl
36048fc2d0c6SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
36058fc2d0c6Smrgtest -z "$LN_S" && LN_S="ln -s"
36068fc2d0c6Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
36078fc2d0c6Smrgdnl
36088fc2d0c6SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
36098fc2d0c6Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
36108fc2d0c6Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
36118fc2d0c6Smrgdnl
36128fc2d0c6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
36138fc2d0c6Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
36148fc2d0c6Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
36158fc2d0c6Smrgm4_require([_LT_CMD_RELOAD])dnl
36168fc2d0c6Smrgm4_require([_LT_DECL_FILECMD])dnl
36178fc2d0c6Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
36188fc2d0c6Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
36198fc2d0c6Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
36208fc2d0c6Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
36218fc2d0c6Smrgm4_require([_LT_WITH_SYSROOT])dnl
36228fc2d0c6Smrgm4_require([_LT_CMD_TRUNCATE])dnl
36238fc2d0c6Smrg
36248fc2d0c6Smrg_LT_CONFIG_LIBTOOL_INIT([
36258fc2d0c6Smrg# See if we are running on zsh, and set the options that allow our
36268fc2d0c6Smrg# commands through without removal of \ escapes INIT.
36278fc2d0c6Smrgif test -n "\${ZSH_VERSION+set}"; then
36288fc2d0c6Smrg   setopt NO_GLOB_SUBST
36298fc2d0c6Smrgfi
36308fc2d0c6Smrg])
36318fc2d0c6Smrgif test -n "${ZSH_VERSION+set}"; then
36328fc2d0c6Smrg   setopt NO_GLOB_SUBST
36330a392d7eSmrgfi
36340a392d7eSmrg
36358fc2d0c6Smrg_LT_CHECK_OBJDIR
36360a392d7eSmrg
36378fc2d0c6Smrgm4_require([_LT_TAG_COMPILER])dnl
36384a041c5bSmacallan
363954b44505Smrgcase $host_os in
36408fc2d0c6Smrgaix3*)
36418fc2d0c6Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
36428fc2d0c6Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
36438fc2d0c6Smrg  # vanish in a puff of smoke.
36448fc2d0c6Smrg  if test set != "${COLLECT_NAMES+set}"; then
36458fc2d0c6Smrg    COLLECT_NAMES=
36468fc2d0c6Smrg    export COLLECT_NAMES
36478fc2d0c6Smrg  fi
364854b44505Smrg  ;;
36498fc2d0c6Smrgesac
36504a041c5bSmacallan
36518fc2d0c6Smrg# Global variables:
36528fc2d0c6Smrgofile=libtool
36538fc2d0c6Smrgcan_build_shared=yes
36544a041c5bSmacallan
36558fc2d0c6Smrg# All known linkers require a '.a' archive for static linking (except MSVC and
36568fc2d0c6Smrg# ICC, which need '.lib').
36578fc2d0c6Smrglibext=a
36584a041c5bSmacallan
36598fc2d0c6Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
36604a041c5bSmacallan
36618fc2d0c6Smrgold_CC=$CC
36628fc2d0c6Smrgold_CFLAGS=$CFLAGS
36634a041c5bSmacallan
36648fc2d0c6Smrg# Set sane defaults for various variables
36658fc2d0c6Smrgtest -z "$CC" && CC=cc
36668fc2d0c6Smrgtest -z "$LTCC" && LTCC=$CC
36678fc2d0c6Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
36688fc2d0c6Smrgtest -z "$LD" && LD=ld
36698fc2d0c6Smrgtest -z "$ac_objext" && ac_objext=o
36704a041c5bSmacallan
36718fc2d0c6Smrg_LT_CC_BASENAME([$compiler])
36728fc2d0c6Smrg
36738fc2d0c6Smrg# Only perform the check for file, if the check method requires it
36748fc2d0c6Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
36758fc2d0c6Smrgcase $deplibs_check_method in
36768fc2d0c6Smrgfile_magic*)
36778fc2d0c6Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
36788fc2d0c6Smrg    _LT_PATH_MAGIC
36798fc2d0c6Smrg  fi
368054b44505Smrg  ;;
36818fc2d0c6Smrgesac
36824a041c5bSmacallan
36838fc2d0c6Smrg# Use C for the default configuration in the libtool script
36848fc2d0c6SmrgLT_SUPPORTED_TAG([CC])
36858fc2d0c6Smrg_LT_LANG_C_CONFIG
36868fc2d0c6Smrg_LT_LANG_DEFAULT_CONFIG
36878fc2d0c6Smrg_LT_CONFIG_COMMANDS
36888fc2d0c6Smrg])# _LT_SETUP
36894a041c5bSmacallan
36904a041c5bSmacallan
36918fc2d0c6Smrg# _LT_PREPARE_SED_QUOTE_VARS
36928fc2d0c6Smrg# --------------------------
36938fc2d0c6Smrg# Define a few sed substitution that help us do robust quoting.
36948fc2d0c6Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
36958fc2d0c6Smrg[# Backslashify metacharacters that are still active within
36968fc2d0c6Smrg# double-quoted strings.
36978fc2d0c6Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
36984a041c5bSmacallan
36998fc2d0c6Smrg# Same as above, but do not quote variable references.
37008fc2d0c6Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
37014a041c5bSmacallan
37028fc2d0c6Smrg# Sed substitution to delay expansion of an escaped shell variable in a
37038fc2d0c6Smrg# double_quote_subst'ed string.
37048fc2d0c6Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
37054a041c5bSmacallan
37068fc2d0c6Smrg# Sed substitution to delay expansion of an escaped single quote.
37078fc2d0c6Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
37084a041c5bSmacallan
37098fc2d0c6Smrg# Sed substitution to avoid accidental globbing in evaled expressions
37108fc2d0c6Smrgno_glob_subst='s/\*/\\\*/g'
37118fc2d0c6Smrg])
37124a041c5bSmacallan
37138fc2d0c6Smrg# _LT_PROG_LTMAIN
37148fc2d0c6Smrg# ---------------
37158fc2d0c6Smrg# Note that this code is called both from 'configure', and 'config.status'
37168fc2d0c6Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
37178fc2d0c6Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
37188fc2d0c6Smrg# so we pass a copy along to make sure it has a sensible value anyway.
37198fc2d0c6Smrgm4_defun([_LT_PROG_LTMAIN],
37208fc2d0c6Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
37218fc2d0c6Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
37228fc2d0c6Smrgltmain=$ac_aux_dir/ltmain.sh
37238fc2d0c6Smrg])# _LT_PROG_LTMAIN
37244a041c5bSmacallan
37254a041c5bSmacallan
37264a041c5bSmacallan
37278fc2d0c6Smrg# So that we can recreate a full libtool script including additional
37288fc2d0c6Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
37298fc2d0c6Smrg# in macros and then make a single call at the end using the 'libtool'
37308fc2d0c6Smrg# label.
37314a041c5bSmacallan
37324a041c5bSmacallan
37338fc2d0c6Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
37348fc2d0c6Smrg# ----------------------------------------
37358fc2d0c6Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
37368fc2d0c6Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
37378fc2d0c6Smrg[m4_ifval([$1],
37388fc2d0c6Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
37398fc2d0c6Smrg                     [$1
37408fc2d0c6Smrg])])])
37414a041c5bSmacallan
37428fc2d0c6Smrg# Initialize.
37438fc2d0c6Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
37444a041c5bSmacallan
37454a041c5bSmacallan
37468fc2d0c6Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
37478fc2d0c6Smrg# ------------------------------
37488fc2d0c6Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
37498fc2d0c6Smrgm4_define([_LT_CONFIG_LIBTOOL],
37508fc2d0c6Smrg[m4_ifval([$1],
37518fc2d0c6Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
37528fc2d0c6Smrg                     [$1
37538fc2d0c6Smrg])])])
37548fc2d0c6Smrg
37558fc2d0c6Smrg# Initialize.
37568fc2d0c6Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
37578fc2d0c6Smrg
37588fc2d0c6Smrg
37598fc2d0c6Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
37608fc2d0c6Smrg# -----------------------------------------------------
37618fc2d0c6Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
37628fc2d0c6Smrg[_LT_CONFIG_LIBTOOL([$1])
37638fc2d0c6Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
376454b44505Smrg])
37654a041c5bSmacallan
37664a041c5bSmacallan
37678fc2d0c6Smrg# _LT_FORMAT_COMMENT([COMMENT])
37688fc2d0c6Smrg# -----------------------------
37698fc2d0c6Smrg# Add leading comment marks to the start of each line, and a trailing
37708fc2d0c6Smrg# full-stop to the whole comment if one is not present already.
37718fc2d0c6Smrgm4_define([_LT_FORMAT_COMMENT],
37728fc2d0c6Smrg[m4_ifval([$1], [
37738fc2d0c6Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
37748fc2d0c6Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
37758fc2d0c6Smrg)])
37764a041c5bSmacallan
37774a041c5bSmacallan
37784a041c5bSmacallan
377954b44505Smrg
37804a041c5bSmacallan
37818fc2d0c6Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
37828fc2d0c6Smrg# -------------------------------------------------------------------
37838fc2d0c6Smrg# CONFIGNAME is the name given to the value in the libtool script.
37848fc2d0c6Smrg# VARNAME is the (base) name used in the configure script.
37858fc2d0c6Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
37868fc2d0c6Smrg# VARNAME.  Any other value will be used directly.
37878fc2d0c6Smrgm4_define([_LT_DECL],
37888fc2d0c6Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
37898fc2d0c6Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
37908fc2d0c6Smrg	[m4_ifval([$1], [$1], [$2])])
37918fc2d0c6Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
37928fc2d0c6Smrg    m4_ifval([$4],
37938fc2d0c6Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
37948fc2d0c6Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
37958fc2d0c6Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
379654b44505Smrg])
37974a041c5bSmacallan
37984a041c5bSmacallan
37998fc2d0c6Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
38008fc2d0c6Smrg# --------------------------------------------------------
38018fc2d0c6Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
38024a041c5bSmacallan
38034a041c5bSmacallan
38048fc2d0c6Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
38058fc2d0c6Smrg# ------------------------------------------------
38068fc2d0c6Smrgm4_define([lt_decl_tag_varnames],
38078fc2d0c6Smrg[_lt_decl_filter([tagged?], [yes], $@)])
38084a041c5bSmacallan
38090a392d7eSmrg
38108fc2d0c6Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
38118fc2d0c6Smrg# ---------------------------------------------------------
38128fc2d0c6Smrgm4_define([_lt_decl_filter],
38138fc2d0c6Smrg[m4_case([$#],
38148fc2d0c6Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
38158fc2d0c6Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
38168fc2d0c6Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
38178fc2d0c6Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
38188fc2d0c6Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
38198fc2d0c6Smrg])
38200a392d7eSmrg
38214a041c5bSmacallan
38228fc2d0c6Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
38238fc2d0c6Smrg# --------------------------------------------------
38248fc2d0c6Smrgm4_define([lt_decl_quote_varnames],
38258fc2d0c6Smrg[_lt_decl_filter([value], [1], $@)])
38264a041c5bSmacallan
38274a041c5bSmacallan
38288fc2d0c6Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
38298fc2d0c6Smrg# ---------------------------------------------------
38308fc2d0c6Smrgm4_define([lt_decl_dquote_varnames],
38318fc2d0c6Smrg[_lt_decl_filter([value], [2], $@)])
38324a041c5bSmacallan
38334a041c5bSmacallan
38348fc2d0c6Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
38358fc2d0c6Smrg# ---------------------------------------------------
38368fc2d0c6Smrgm4_define([lt_decl_varnames_tagged],
38378fc2d0c6Smrg[m4_assert([$# <= 2])dnl
38388fc2d0c6Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
38398fc2d0c6Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
38408fc2d0c6Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
38418fc2d0c6Smrgm4_define([_lt_decl_varnames_tagged],
38428fc2d0c6Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
38434a041c5bSmacallan
38444a041c5bSmacallan
38458fc2d0c6Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
38468fc2d0c6Smrg# ------------------------------------------------
38478fc2d0c6Smrgm4_define([lt_decl_all_varnames],
38488fc2d0c6Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
38498fc2d0c6Smrg     m4_if([$2], [],
38508fc2d0c6Smrg	   m4_quote(lt_decl_varnames),
38518fc2d0c6Smrg	m4_quote(m4_shift($@))))[]dnl
38528fc2d0c6Smrg])
38538fc2d0c6Smrgm4_define([_lt_decl_all_varnames],
38548fc2d0c6Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
38558fc2d0c6Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
38568fc2d0c6Smrg])
38574a041c5bSmacallan
38584a041c5bSmacallan
38598fc2d0c6Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
38608fc2d0c6Smrg# ------------------------------------
38618fc2d0c6Smrg# Quote a variable value, and forward it to 'config.status' so that its
38628fc2d0c6Smrg# declaration there will have the same value as in 'configure'.  VARNAME
38638fc2d0c6Smrg# must have a single quote delimited value for this to work.
38648fc2d0c6Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
38658fc2d0c6Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
38664a041c5bSmacallan
38674a041c5bSmacallan
38688fc2d0c6Smrg# _LT_CONFIG_STATUS_DECLARATIONS
38698fc2d0c6Smrg# ------------------------------
38708fc2d0c6Smrg# We delimit libtool config variables with single quotes, so when
38718fc2d0c6Smrg# we write them to config.status, we have to be sure to quote all
38728fc2d0c6Smrg# embedded single quotes properly.  In configure, this macro expands
38738fc2d0c6Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
38748fc2d0c6Smrg#
38758fc2d0c6Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
38768fc2d0c6Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
38778fc2d0c6Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
38788fc2d0c6Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
38794a041c5bSmacallan
38804a041c5bSmacallan
38818fc2d0c6Smrg# _LT_LIBTOOL_TAGS
38828fc2d0c6Smrg# ----------------
38838fc2d0c6Smrg# Output comment and list of tags supported by the script
38848fc2d0c6Smrgm4_defun([_LT_LIBTOOL_TAGS],
38858fc2d0c6Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
38868fc2d0c6Smrgavailable_tags='_LT_TAGS'dnl
38878fc2d0c6Smrg])
38880a392d7eSmrg
38894a041c5bSmacallan
38908fc2d0c6Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
38918fc2d0c6Smrg# -----------------------------------
38928fc2d0c6Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
38938fc2d0c6Smrg# expand to a commented shell variable setting:
38948fc2d0c6Smrg#
38958fc2d0c6Smrg#    # Some comment about what VAR is for.
38968fc2d0c6Smrg#    visible_name=$lt_internal_name
38978fc2d0c6Smrgm4_define([_LT_LIBTOOL_DECLARE],
38988fc2d0c6Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
38998fc2d0c6Smrg					   [description])))[]dnl
39008fc2d0c6Smrgm4_pushdef([_libtool_name],
39018fc2d0c6Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
39028fc2d0c6Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
39038fc2d0c6Smrg    [0], [_libtool_name=[$]$1],
39048fc2d0c6Smrg    [1], [_libtool_name=$lt_[]$1],
39058fc2d0c6Smrg    [2], [_libtool_name=$lt_[]$1],
39068fc2d0c6Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
39078fc2d0c6Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
39088fc2d0c6Smrg])
39090a392d7eSmrg
39104a041c5bSmacallan
39118fc2d0c6Smrg# _LT_LIBTOOL_CONFIG_VARS
39128fc2d0c6Smrg# -----------------------
39138fc2d0c6Smrg# Produce commented declarations of non-tagged libtool config variables
39148fc2d0c6Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
39158fc2d0c6Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
39168fc2d0c6Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
39178fc2d0c6Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
39188fc2d0c6Smrg[m4_foreach([_lt_var],
39198fc2d0c6Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
39208fc2d0c6Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
39214a041c5bSmacallan
39224a041c5bSmacallan
39238fc2d0c6Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
39248fc2d0c6Smrg# -------------------------
39258fc2d0c6Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
39268fc2d0c6Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
39278fc2d0c6Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
39284a041c5bSmacallan
39294a041c5bSmacallan
39308fc2d0c6Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
39318fc2d0c6Smrg# ------------------------------
39328fc2d0c6Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
39334a041c5bSmacallan
39344a041c5bSmacallan
39358fc2d0c6Smrg# _LT_CONFIG_COMMANDS
39368fc2d0c6Smrg# -------------------
39378fc2d0c6Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
39388fc2d0c6Smrg# variables for single and double quote escaping we saved from calls
39398fc2d0c6Smrg# to _LT_DECL, we can put quote escaped variables declarations
39408fc2d0c6Smrg# into 'config.status', and then the shell code to quote escape them in
39418fc2d0c6Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
39428fc2d0c6Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
39438fc2d0c6Smrgm4_defun([_LT_CONFIG_COMMANDS],
39448fc2d0c6Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
39458fc2d0c6Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
39468fc2d0c6Smrg	dnl instead of duplicating it all over again into config.status,
39478fc2d0c6Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
39488fc2d0c6Smrg	dnl needs to know what name is stored there:
39498fc2d0c6Smrg        [AC_CONFIG_COMMANDS([libtool],
39508fc2d0c6Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
39518fc2d0c6Smrg    dnl If the libtool generation code is destined for config.status,
39528fc2d0c6Smrg    dnl expand the accumulated commands and init code now:
39538fc2d0c6Smrg    [AC_CONFIG_COMMANDS([libtool],
39548fc2d0c6Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
39558fc2d0c6Smrg])#_LT_CONFIG_COMMANDS
39564a041c5bSmacallan
39574a041c5bSmacallan
39588fc2d0c6Smrg# Initialize.
39598fc2d0c6Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
39608fc2d0c6Smrg[
39614a041c5bSmacallan
39628fc2d0c6Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
39638fc2d0c6Smrg# if CDPATH is set.
39648fc2d0c6Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
39654a041c5bSmacallan
39668fc2d0c6Smrgsed_quote_subst='$sed_quote_subst'
39678fc2d0c6Smrgdouble_quote_subst='$double_quote_subst'
39688fc2d0c6Smrgdelay_variable_subst='$delay_variable_subst'
39698fc2d0c6Smrg_LT_CONFIG_STATUS_DECLARATIONS
39708fc2d0c6SmrgLTCC='$LTCC'
39718fc2d0c6SmrgLTCFLAGS='$LTCFLAGS'
39728fc2d0c6Smrgcompiler='$compiler_DEFAULT'
39734a041c5bSmacallan
39748fc2d0c6Smrg# A function that is used when there is no print builtin or printf.
39758fc2d0c6Smrgfunc_fallback_echo ()
397654b44505Smrg{
39778fc2d0c6Smrg  eval 'cat <<_LTECHO_EOF
39788fc2d0c6Smrg\$[]1
39798fc2d0c6Smrg_LTECHO_EOF'
398054b44505Smrg}
39814a041c5bSmacallan
39828fc2d0c6Smrg# Quote evaled strings.
39838fc2d0c6Smrgfor var in lt_decl_all_varnames([[ \
39848fc2d0c6Smrg]], lt_decl_quote_varnames); do
39858fc2d0c6Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
39868fc2d0c6Smrg    *[[\\\\\\\`\\"\\\$]]*)
39878fc2d0c6Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
39888fc2d0c6Smrg      ;;
39898fc2d0c6Smrg    *)
39908fc2d0c6Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
39918fc2d0c6Smrg      ;;
39928fc2d0c6Smrg    esac
39938fc2d0c6Smrgdone
39944a041c5bSmacallan
39958fc2d0c6Smrg# Double-quote double-evaled strings.
39968fc2d0c6Smrgfor var in lt_decl_all_varnames([[ \
39978fc2d0c6Smrg]], lt_decl_dquote_varnames); do
39988fc2d0c6Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
39998fc2d0c6Smrg    *[[\\\\\\\`\\"\\\$]]*)
40008fc2d0c6Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
40018fc2d0c6Smrg      ;;
40028fc2d0c6Smrg    *)
40038fc2d0c6Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
40048fc2d0c6Smrg      ;;
40058fc2d0c6Smrg    esac
400654b44505Smrgdone
40078fc2d0c6Smrg
40088fc2d0c6Smrg_LT_OUTPUT_LIBTOOL_INIT
400954b44505Smrg])
40104a041c5bSmacallan
40118fc2d0c6Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
40128fc2d0c6Smrg# ------------------------------------
40138fc2d0c6Smrg# Generate a child script FILE with all initialization necessary to
40148fc2d0c6Smrg# reuse the environment learned by the parent script, and make the
40158fc2d0c6Smrg# file executable.  If COMMENT is supplied, it is inserted after the
40168fc2d0c6Smrg# '#!' sequence but before initialization text begins.  After this
40178fc2d0c6Smrg# macro, additional text can be appended to FILE to form the body of
40188fc2d0c6Smrg# the child script.  The macro ends with non-zero status if the
40198fc2d0c6Smrg# file could not be fully written (such as if the disk is full).
40208fc2d0c6Smrgm4_ifdef([AS_INIT_GENERATED],
40218fc2d0c6Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
40228fc2d0c6Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
40238fc2d0c6Smrg[m4_require([AS_PREPARE])]dnl
40248fc2d0c6Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
40258fc2d0c6Smrg[lt_write_fail=0
40268fc2d0c6Smrgcat >$1 <<_ASEOF || lt_write_fail=1
40278fc2d0c6Smrg#! $SHELL
40288fc2d0c6Smrg# Generated by $as_me.
40298fc2d0c6Smrg$2
40308fc2d0c6SmrgSHELL=\${CONFIG_SHELL-$SHELL}
40318fc2d0c6Smrgexport SHELL
40328fc2d0c6Smrg_ASEOF
40338fc2d0c6Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
40348fc2d0c6SmrgAS_SHELL_SANITIZE
40358fc2d0c6Smrg_AS_PREPARE
40368fc2d0c6Smrgexec AS_MESSAGE_FD>&1
40378fc2d0c6Smrg_ASEOF
40388fc2d0c6Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
40398fc2d0c6Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
40404a041c5bSmacallan
40418fc2d0c6Smrg# LT_OUTPUT
40428fc2d0c6Smrg# ---------
40438fc2d0c6Smrg# This macro allows early generation of the libtool script (before
40448fc2d0c6Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
40458fc2d0c6Smrg# tests.
40468fc2d0c6SmrgAC_DEFUN([LT_OUTPUT],
40478fc2d0c6Smrg[: ${CONFIG_LT=./config.lt}
40488fc2d0c6SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
40498fc2d0c6Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
40508fc2d0c6Smrg[# Run this file to recreate a libtool stub with the current configuration.])
405154b44505Smrg
40528fc2d0c6Smrgcat >>"$CONFIG_LT" <<\_LTEOF
40538fc2d0c6Smrglt_cl_silent=false
40548fc2d0c6Smrgexec AS_MESSAGE_LOG_FD>>config.log
40558fc2d0c6Smrg{
40568fc2d0c6Smrg  echo
40578fc2d0c6Smrg  AS_BOX([Running $as_me.])
40588fc2d0c6Smrg} >&AS_MESSAGE_LOG_FD
405954b44505Smrg
40608fc2d0c6Smrglt_cl_help="\
40618fc2d0c6Smrg'$as_me' creates a local libtool stub from the current configuration,
40628fc2d0c6Smrgfor use in further configure time tests before the real libtool is
40638fc2d0c6Smrggenerated.
40644a041c5bSmacallan
40658fc2d0c6SmrgUsage: $[0] [[OPTIONS]]
40664a041c5bSmacallan
40678fc2d0c6Smrg  -h, --help      print this help, then exit
40688fc2d0c6Smrg  -V, --version   print version number, then exit
40698fc2d0c6Smrg  -q, --quiet     do not print progress messages
40708fc2d0c6Smrg  -d, --debug     don't remove temporary files
40714a041c5bSmacallan
40728fc2d0c6SmrgReport bugs to <bug-libtool@gnu.org>."
40734a041c5bSmacallan
40748fc2d0c6Smrglt_cl_version="\
40758fc2d0c6Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
40768fc2d0c6Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
40778fc2d0c6Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
40784a041c5bSmacallan
40798fc2d0c6SmrgCopyright (C) 2011 Free Software Foundation, Inc.
40808fc2d0c6SmrgThis config.lt script is free software; the Free Software Foundation
40818fc2d0c6Smrggives unlimited permision to copy, distribute and modify it."
40824a041c5bSmacallan
40838fc2d0c6Smrgwhile test 0 != $[#]
40848fc2d0c6Smrgdo
40858fc2d0c6Smrg  case $[1] in
40868fc2d0c6Smrg    --version | --v* | -V )
40878fc2d0c6Smrg      echo "$lt_cl_version"; exit 0 ;;
40888fc2d0c6Smrg    --help | --h* | -h )
40898fc2d0c6Smrg      echo "$lt_cl_help"; exit 0 ;;
40908fc2d0c6Smrg    --debug | --d* | -d )
40918fc2d0c6Smrg      debug=: ;;
40928fc2d0c6Smrg    --quiet | --q* | --silent | --s* | -q )
40938fc2d0c6Smrg      lt_cl_silent=: ;;
40944a041c5bSmacallan
40958fc2d0c6Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
40968fc2d0c6SmrgTry '$[0] --help' for more information.]) ;;
40974a041c5bSmacallan
40988fc2d0c6Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
40998fc2d0c6SmrgTry '$[0] --help' for more information.]) ;;
41008fc2d0c6Smrg  esac
41018fc2d0c6Smrg  shift
41028fc2d0c6Smrgdone
41034a041c5bSmacallan
41048fc2d0c6Smrgif $lt_cl_silent; then
41058fc2d0c6Smrg  exec AS_MESSAGE_FD>/dev/null
41068fc2d0c6Smrgfi
41078fc2d0c6Smrg_LTEOF
41084a041c5bSmacallan
41098fc2d0c6Smrgcat >>"$CONFIG_LT" <<_LTEOF
41108fc2d0c6Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
41118fc2d0c6Smrg_LTEOF
41124a041c5bSmacallan
41138fc2d0c6Smrgcat >>"$CONFIG_LT" <<\_LTEOF
41148fc2d0c6SmrgAC_MSG_NOTICE([creating $ofile])
41158fc2d0c6Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
41168fc2d0c6SmrgAS_EXIT(0)
41178fc2d0c6Smrg_LTEOF
41188fc2d0c6Smrgchmod +x "$CONFIG_LT"
41194a041c5bSmacallan
41208fc2d0c6Smrg# configure is writing to config.log, but config.lt does its own redirection,
41218fc2d0c6Smrg# appending to config.log, which fails on DOS, as config.log is still kept
41228fc2d0c6Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
41238fc2d0c6Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
41248fc2d0c6Smrglt_cl_success=:
41258fc2d0c6Smrgtest yes = "$silent" &&
41268fc2d0c6Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
41278fc2d0c6Smrgexec AS_MESSAGE_LOG_FD>/dev/null
41288fc2d0c6Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
41298fc2d0c6Smrgexec AS_MESSAGE_LOG_FD>>config.log
41308fc2d0c6Smrg$lt_cl_success || AS_EXIT(1)
41318fc2d0c6Smrg])# LT_OUTPUT
41324a041c5bSmacallan
41334a041c5bSmacallan
41348fc2d0c6Smrg# _LT_CONFIG(TAG)
41358fc2d0c6Smrg# ---------------
41368fc2d0c6Smrg# If TAG is the built-in tag, create an initial libtool script with a
41378fc2d0c6Smrg# default configuration from the untagged config vars.  Otherwise add code
41388fc2d0c6Smrg# to config.status for appending the configuration named by TAG from the
41398fc2d0c6Smrg# matching tagged config vars.
41408fc2d0c6Smrgm4_defun([_LT_CONFIG],
41418fc2d0c6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
41428fc2d0c6Smrg_LT_CONFIG_SAVE_COMMANDS([
41438fc2d0c6Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
41448fc2d0c6Smrg  m4_if(_LT_TAG, [C], [
41458fc2d0c6Smrg    # See if we are running on zsh, and set the options that allow our
41468fc2d0c6Smrg    # commands through without removal of \ escapes.
41478fc2d0c6Smrg    if test -n "${ZSH_VERSION+set}"; then
41488fc2d0c6Smrg      setopt NO_GLOB_SUBST
41498fc2d0c6Smrg    fi
41504a041c5bSmacallan
41518fc2d0c6Smrg    cfgfile=${ofile}T
41528fc2d0c6Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
41538fc2d0c6Smrg    $RM "$cfgfile"
41544a041c5bSmacallan
41558fc2d0c6Smrg    cat <<_LT_EOF >> "$cfgfile"
41568fc2d0c6Smrg#! $SHELL
41578fc2d0c6Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
41588fc2d0c6Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
41598fc2d0c6Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
41604a041c5bSmacallan
41618fc2d0c6Smrg# Provide generalized library-building support services.
41628fc2d0c6Smrg# Written by Gordon Matzigkeit, 1996
41634a041c5bSmacallan
41648fc2d0c6Smrg_LT_COPYING
41658fc2d0c6Smrg_LT_LIBTOOL_TAGS
41660a392d7eSmrg
41678fc2d0c6Smrg# Configured defaults for sys_lib_dlsearch_path munging.
41688fc2d0c6Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
41694a041c5bSmacallan
41708fc2d0c6Smrg# ### BEGIN LIBTOOL CONFIG
41718fc2d0c6Smrg_LT_LIBTOOL_CONFIG_VARS
41728fc2d0c6Smrg_LT_LIBTOOL_TAG_VARS
41738fc2d0c6Smrg# ### END LIBTOOL CONFIG
41744a041c5bSmacallan
41758fc2d0c6Smrg_LT_EOF
41764a041c5bSmacallan
41778fc2d0c6Smrg    cat <<'_LT_EOF' >> "$cfgfile"
41784a041c5bSmacallan
41798fc2d0c6Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
41804a041c5bSmacallan
41818fc2d0c6Smrg_LT_PREPARE_MUNGE_PATH_LIST
41828fc2d0c6Smrg_LT_PREPARE_CC_BASENAME
41834a041c5bSmacallan
41848fc2d0c6Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
41854a041c5bSmacallan
41868fc2d0c6Smrg_LT_EOF
41874a041c5bSmacallan
41888fc2d0c6Smrg  case $host_os in
41898fc2d0c6Smrg  aix3*)
41908fc2d0c6Smrg    cat <<\_LT_EOF >> "$cfgfile"
41918fc2d0c6Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
41928fc2d0c6Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
41938fc2d0c6Smrg# vanish in a puff of smoke.
41948fc2d0c6Smrgif test set != "${COLLECT_NAMES+set}"; then
41958fc2d0c6Smrg  COLLECT_NAMES=
41968fc2d0c6Smrg  export COLLECT_NAMES
41978fc2d0c6Smrgfi
41988fc2d0c6Smrg_LT_EOF
41998fc2d0c6Smrg    ;;
42008fc2d0c6Smrg  esac
42014a041c5bSmacallan
42028fc2d0c6Smrg  _LT_PROG_LTMAIN
42034a041c5bSmacallan
42048fc2d0c6Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
42058fc2d0c6Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
42068fc2d0c6Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
42078fc2d0c6Smrg  # is reportedly fixed, but why not run on old versions too?
42088fc2d0c6Smrg  $SED '$q' "$ltmain" >> "$cfgfile" \
42098fc2d0c6Smrg     || (rm -f "$cfgfile"; exit 1)
42104a041c5bSmacallan
42118fc2d0c6Smrg   mv -f "$cfgfile" "$ofile" ||
42128fc2d0c6Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
42138fc2d0c6Smrg  chmod +x "$ofile"
42148fc2d0c6Smrg],
42158fc2d0c6Smrg[cat <<_LT_EOF >> "$ofile"
42164a041c5bSmacallan
42178fc2d0c6Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
42188fc2d0c6Smrgdnl in a comment (ie after a #).
42198fc2d0c6Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
42208fc2d0c6Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
42218fc2d0c6Smrg# ### END LIBTOOL TAG CONFIG: $1
42228fc2d0c6Smrg_LT_EOF
42238fc2d0c6Smrg])dnl /m4_if
42248fc2d0c6Smrg],
42258fc2d0c6Smrg[m4_if([$1], [], [
42268fc2d0c6Smrg    PACKAGE='$PACKAGE'
42278fc2d0c6Smrg    VERSION='$VERSION'
42288fc2d0c6Smrg    RM='$RM'
42298fc2d0c6Smrg    ofile='$ofile'], [])
42308fc2d0c6Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
42318fc2d0c6Smrg])# _LT_CONFIG
42324a041c5bSmacallan
42334a041c5bSmacallan
42348fc2d0c6Smrg# LT_SUPPORTED_TAG(TAG)
42358fc2d0c6Smrg# ---------------------
42368fc2d0c6Smrg# Trace this macro to discover what tags are supported by the libtool
42378fc2d0c6Smrg# --tag option, using:
42388fc2d0c6Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
42398fc2d0c6SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
42404a041c5bSmacallan
42414a041c5bSmacallan
42428fc2d0c6Smrg# C support is built-in for now
42438fc2d0c6Smrgm4_define([_LT_LANG_C_enabled], [])
42448fc2d0c6Smrgm4_define([_LT_TAGS], [])
42454a041c5bSmacallan
42468fc2d0c6Smrg
42478fc2d0c6Smrg# LT_LANG(LANG)
42488fc2d0c6Smrg# -------------
42498fc2d0c6Smrg# Enable libtool support for the given language if not already enabled.
42508fc2d0c6SmrgAC_DEFUN([LT_LANG],
42518fc2d0c6Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
42528fc2d0c6Smrgm4_case([$1],
42538fc2d0c6Smrg  [C],			[_LT_LANG(C)],
42548fc2d0c6Smrg  [C++],		[_LT_LANG(CXX)],
42558fc2d0c6Smrg  [Go],			[_LT_LANG(GO)],
42568fc2d0c6Smrg  [Java],		[_LT_LANG(GCJ)],
42578fc2d0c6Smrg  [Fortran 77],		[_LT_LANG(F77)],
42588fc2d0c6Smrg  [Fortran],		[_LT_LANG(FC)],
42598fc2d0c6Smrg  [Windows Resource],	[_LT_LANG(RC)],
42608fc2d0c6Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
42618fc2d0c6Smrg    [_LT_LANG($1)],
42628fc2d0c6Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
42638fc2d0c6Smrg])# LT_LANG
42648fc2d0c6Smrg
42658fc2d0c6Smrg
42668fc2d0c6Smrg# _LT_LANG(LANGNAME)
42678fc2d0c6Smrg# ------------------
42688fc2d0c6Smrgm4_defun([_LT_LANG],
42698fc2d0c6Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
42708fc2d0c6Smrg  [LT_SUPPORTED_TAG([$1])dnl
42718fc2d0c6Smrg  m4_append([_LT_TAGS], [$1 ])dnl
42728fc2d0c6Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
42738fc2d0c6Smrg  _LT_LANG_$1_CONFIG($1)])dnl
42748fc2d0c6Smrg])# _LT_LANG
42758fc2d0c6Smrg
42768fc2d0c6Smrg
42778fc2d0c6Smrgm4_ifndef([AC_PROG_GO], [
42788fc2d0c6Smrg# NOTE: This macro has been submitted for inclusion into   #
42798fc2d0c6Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
42808fc2d0c6Smrg#  a released version of Autoconf we should remove this    #
42818fc2d0c6Smrg#  macro and use it instead.                               #
42828fc2d0c6Smrgm4_defun([AC_PROG_GO],
42838fc2d0c6Smrg[AC_LANG_PUSH(Go)dnl
42848fc2d0c6SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
42858fc2d0c6SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
42868fc2d0c6Smrg_AC_ARG_VAR_LDFLAGS()dnl
42878fc2d0c6SmrgAC_CHECK_TOOL(GOC, gccgo)
42888fc2d0c6Smrgif test -z "$GOC"; then
42898fc2d0c6Smrg  if test -n "$ac_tool_prefix"; then
42908fc2d0c6Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
42918fc2d0c6Smrg  fi
429254b44505Smrgfi
42938fc2d0c6Smrgif test -z "$GOC"; then
42948fc2d0c6Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
42958fc2d0c6Smrgfi
42968fc2d0c6Smrg])#m4_defun
42978fc2d0c6Smrg])#m4_ifndef
42984a041c5bSmacallan
42994a041c5bSmacallan
43008fc2d0c6Smrg# _LT_LANG_DEFAULT_CONFIG
43018fc2d0c6Smrg# -----------------------
43028fc2d0c6Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
43038fc2d0c6Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
43048fc2d0c6Smrg  [LT_LANG(CXX)],
43058fc2d0c6Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
43064a041c5bSmacallan
43078fc2d0c6SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
43088fc2d0c6Smrg  [LT_LANG(F77)],
43098fc2d0c6Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
43104a041c5bSmacallan
43118fc2d0c6SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
43128fc2d0c6Smrg  [LT_LANG(FC)],
43138fc2d0c6Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
43144a041c5bSmacallan
43158fc2d0c6Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
43168fc2d0c6Smrgdnl pulling things in needlessly.
43178fc2d0c6SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
43188fc2d0c6Smrg  [LT_LANG(GCJ)],
43198fc2d0c6Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
43208fc2d0c6Smrg    [LT_LANG(GCJ)],
43218fc2d0c6Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
43228fc2d0c6Smrg      [LT_LANG(GCJ)],
43238fc2d0c6Smrg      [m4_ifdef([AC_PROG_GCJ],
43248fc2d0c6Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
43258fc2d0c6Smrg       m4_ifdef([A][M_PROG_GCJ],
43268fc2d0c6Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
43278fc2d0c6Smrg       m4_ifdef([LT_PROG_GCJ],
43288fc2d0c6Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
43294a041c5bSmacallan
43308fc2d0c6SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
43318fc2d0c6Smrg  [LT_LANG(GO)],
43328fc2d0c6Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
43334a041c5bSmacallan
43348fc2d0c6SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
43358fc2d0c6Smrg  [LT_LANG(RC)],
43368fc2d0c6Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
43378fc2d0c6Smrg])# _LT_LANG_DEFAULT_CONFIG
43384a041c5bSmacallan
43398fc2d0c6Smrg# Obsolete macros:
43408fc2d0c6SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
43418fc2d0c6SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
43428fc2d0c6SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
43438fc2d0c6SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
43448fc2d0c6SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
43458fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
43468fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
43478fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
43488fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
43498fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
43508fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
43514a041c5bSmacallan
43524a041c5bSmacallan
43538fc2d0c6Smrg# _LT_TAG_COMPILER
43548fc2d0c6Smrg# ----------------
43558fc2d0c6Smrgm4_defun([_LT_TAG_COMPILER],
43568fc2d0c6Smrg[AC_REQUIRE([AC_PROG_CC])dnl
43574a041c5bSmacallan
43588fc2d0c6Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
43598fc2d0c6Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
43608fc2d0c6Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
43618fc2d0c6Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
43624a041c5bSmacallan
43638fc2d0c6Smrg# If no C compiler was specified, use CC.
43648fc2d0c6SmrgLTCC=${LTCC-"$CC"}
43654a041c5bSmacallan
43668fc2d0c6Smrg# If no C compiler flags were specified, use CFLAGS.
43678fc2d0c6SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
43684a041c5bSmacallan
43698fc2d0c6Smrg# Allow CC to be a program name with arguments.
43708fc2d0c6Smrgcompiler=$CC
43718fc2d0c6Smrg])# _LT_TAG_COMPILER
437254b44505Smrg
43734a041c5bSmacallan
43748fc2d0c6Smrg# _LT_COMPILER_BOILERPLATE
43758fc2d0c6Smrg# ------------------------
43768fc2d0c6Smrg# Check for compiler boilerplate output or warnings with
43778fc2d0c6Smrg# the simple compiler test code.
43788fc2d0c6Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
43798fc2d0c6Smrg[m4_require([_LT_DECL_SED])dnl
43808fc2d0c6Smrgac_outfile=conftest.$ac_objext
43818fc2d0c6Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
43828fc2d0c6Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
43838fc2d0c6Smrg_lt_compiler_boilerplate=`cat conftest.err`
43848fc2d0c6Smrg$RM conftest*
43858fc2d0c6Smrg])# _LT_COMPILER_BOILERPLATE
43864a041c5bSmacallan
43874a041c5bSmacallan
43888fc2d0c6Smrg# _LT_LINKER_BOILERPLATE
43898fc2d0c6Smrg# ----------------------
43908fc2d0c6Smrg# Check for linker boilerplate output or warnings with
43918fc2d0c6Smrg# the simple link test code.
43928fc2d0c6Smrgm4_defun([_LT_LINKER_BOILERPLATE],
43938fc2d0c6Smrg[m4_require([_LT_DECL_SED])dnl
43948fc2d0c6Smrgac_outfile=conftest.$ac_objext
43958fc2d0c6Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
43968fc2d0c6Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
43978fc2d0c6Smrg_lt_linker_boilerplate=`cat conftest.err`
43988fc2d0c6Smrg$RM -r conftest*
43998fc2d0c6Smrg])# _LT_LINKER_BOILERPLATE
44004a041c5bSmacallan
44018fc2d0c6Smrg# _LT_REQUIRED_DARWIN_CHECKS
44028fc2d0c6Smrg# -------------------------
44038fc2d0c6Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
44048fc2d0c6Smrg  case $host_os in
44058fc2d0c6Smrg    rhapsody* | darwin*)
44068fc2d0c6Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
44078fc2d0c6Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
44088fc2d0c6Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
44098fc2d0c6Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
44108fc2d0c6Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
44118fc2d0c6Smrg    _LT_DECL([], [DSYMUTIL], [1],
44128fc2d0c6Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
44138fc2d0c6Smrg    _LT_DECL([], [NMEDIT], [1],
44148fc2d0c6Smrg      [Tool to change global to local symbols on Mac OS X])
44158fc2d0c6Smrg    _LT_DECL([], [LIPO], [1],
44168fc2d0c6Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
44178fc2d0c6Smrg    _LT_DECL([], [OTOOL], [1],
44188fc2d0c6Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
44198fc2d0c6Smrg    _LT_DECL([], [OTOOL64], [1],
44208fc2d0c6Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
44214a041c5bSmacallan
44228fc2d0c6Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
44238fc2d0c6Smrg      [lt_cv_apple_cc_single_mod=no
44248fc2d0c6Smrg      if test -z "$LT_MULTI_MODULE"; then
44258fc2d0c6Smrg	# By default we will add the -single_module flag. You can override
44268fc2d0c6Smrg	# by either setting the environment variable LT_MULTI_MODULE
44278fc2d0c6Smrg	# non-empty at configure time, or by adding -multi_module to the
44288fc2d0c6Smrg	# link flags.
44298fc2d0c6Smrg	rm -rf libconftest.dylib*
44308fc2d0c6Smrg	echo "int foo(void){return 1;}" > conftest.c
44318fc2d0c6Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
44328fc2d0c6Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
44338fc2d0c6Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
44348fc2d0c6Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
44358fc2d0c6Smrg        _lt_result=$?
44368fc2d0c6Smrg	# If there is a non-empty error log, and "single_module"
44378fc2d0c6Smrg	# appears in it, assume the flag caused a linker warning
44388fc2d0c6Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
44398fc2d0c6Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
44408fc2d0c6Smrg	# Otherwise, if the output was created with a 0 exit code from
44418fc2d0c6Smrg	# the compiler, it worked.
44428fc2d0c6Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
44438fc2d0c6Smrg	  lt_cv_apple_cc_single_mod=yes
44448fc2d0c6Smrg	else
44458fc2d0c6Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
44468fc2d0c6Smrg	fi
44478fc2d0c6Smrg	rm -rf libconftest.dylib*
44488fc2d0c6Smrg	rm -f conftest.*
44498fc2d0c6Smrg      fi])
44504a041c5bSmacallan
44518fc2d0c6Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
44528fc2d0c6Smrg      [lt_cv_ld_exported_symbols_list],
44538fc2d0c6Smrg      [lt_cv_ld_exported_symbols_list=no
44548fc2d0c6Smrg      save_LDFLAGS=$LDFLAGS
44558fc2d0c6Smrg      echo "_main" > conftest.sym
44568fc2d0c6Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
44578fc2d0c6Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
44588fc2d0c6Smrg	[lt_cv_ld_exported_symbols_list=yes],
44598fc2d0c6Smrg	[lt_cv_ld_exported_symbols_list=no])
44608fc2d0c6Smrg	LDFLAGS=$save_LDFLAGS
44618fc2d0c6Smrg    ])
44624a041c5bSmacallan
44638fc2d0c6Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
44648fc2d0c6Smrg      [lt_cv_ld_force_load=no
44658fc2d0c6Smrg      cat > conftest.c << _LT_EOF
44668fc2d0c6Smrgint forced_loaded() { return 2;}
446754b44505Smrg_LT_EOF
44688fc2d0c6Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
44698fc2d0c6Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
44708fc2d0c6Smrg      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
44718fc2d0c6Smrg      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
44728fc2d0c6Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
44738fc2d0c6Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
44748fc2d0c6Smrg      cat > conftest.c << _LT_EOF
44758fc2d0c6Smrgint main() { return 0;}
44768fc2d0c6Smrg_LT_EOF
44778fc2d0c6Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
44788fc2d0c6Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
44798fc2d0c6Smrg      _lt_result=$?
44808fc2d0c6Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
44818fc2d0c6Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
44828fc2d0c6Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
44838fc2d0c6Smrg	lt_cv_ld_force_load=yes
448454b44505Smrg      else
44858fc2d0c6Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
448654b44505Smrg      fi
44878fc2d0c6Smrg        rm -f conftest.err libconftest.a conftest conftest.c
44888fc2d0c6Smrg        rm -rf conftest.dSYM
44898fc2d0c6Smrg    ])
44908fc2d0c6Smrg    case $host_os in
44918fc2d0c6Smrg    rhapsody* | darwin1.[[012]])
44928fc2d0c6Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
44938fc2d0c6Smrg    darwin1.*)
44948fc2d0c6Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
44958fc2d0c6Smrg    darwin*)
44968fc2d0c6Smrg      case $MACOSX_DEPLOYMENT_TARGET,$host in
44978fc2d0c6Smrg        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
44988fc2d0c6Smrg          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
44998fc2d0c6Smrg        *)
45008fc2d0c6Smrg          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
450154b44505Smrg      esac
45028fc2d0c6Smrg    ;;
45038fc2d0c6Smrg  esac
45048fc2d0c6Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
45058fc2d0c6Smrg      _lt_dar_single_mod='$single_module'
45068fc2d0c6Smrg    fi
45078fc2d0c6Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
45088fc2d0c6Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
45098fc2d0c6Smrg    else
45108fc2d0c6Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
45118fc2d0c6Smrg    fi
45128fc2d0c6Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
45138fc2d0c6Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
45148fc2d0c6Smrg    else
45158fc2d0c6Smrg      _lt_dsymutil=
45168fc2d0c6Smrg    fi
45178fc2d0c6Smrg    ;;
45188fc2d0c6Smrg  esac
45198fc2d0c6Smrg])
45204a041c5bSmacallan
45214a041c5bSmacallan
45228fc2d0c6Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
45238fc2d0c6Smrg# ---------------------------------
45248fc2d0c6Smrg# Checks for linker and compiler features on darwin
45258fc2d0c6Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
45268fc2d0c6Smrg[
45278fc2d0c6Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
45288fc2d0c6Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
45298fc2d0c6Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
45308fc2d0c6Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
45318fc2d0c6Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
45328fc2d0c6Smrg  if test yes = "$lt_cv_ld_force_load"; then
45338fc2d0c6Smrg    _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\"`'
45348fc2d0c6Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
45358fc2d0c6Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
45368fc2d0c6Smrg  else
45378fc2d0c6Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
45388fc2d0c6Smrg  fi
45398fc2d0c6Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
45408fc2d0c6Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
45418fc2d0c6Smrg  case $cc_basename in
45428fc2d0c6Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
45438fc2d0c6Smrg     *) _lt_dar_can_shared=$GCC ;;
45448fc2d0c6Smrg  esac
45458fc2d0c6Smrg  if test yes = "$_lt_dar_can_shared"; then
45468fc2d0c6Smrg    output_verbose_link_cmd=func_echo_all
45478fc2d0c6Smrg    _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"
45488fc2d0c6Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
45498fc2d0c6Smrg    _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"
45508fc2d0c6Smrg    _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"
45518fc2d0c6Smrg    m4_if([$1], [CXX],
45528fc2d0c6Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
45538fc2d0c6Smrg      _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"
45548fc2d0c6Smrg      _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"
455554b44505Smrg    fi
45568fc2d0c6Smrg],[])
455754b44505Smrg  else
45588fc2d0c6Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
45598fc2d0c6Smrg  fi
45608fc2d0c6Smrg])
45614a041c5bSmacallan
45628fc2d0c6Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
45638fc2d0c6Smrg# ----------------------------------
45648fc2d0c6Smrg# Links a minimal program and checks the executable
45658fc2d0c6Smrg# for the system default hardcoded library path. In most cases,
45668fc2d0c6Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
45678fc2d0c6Smrg# the location of the communication and MPI libs are included too.
45688fc2d0c6Smrg# If we don't find anything, use the default library path according
45698fc2d0c6Smrg# to the aix ld manual.
45708fc2d0c6Smrg# Store the results from the different compilers for each TAGNAME.
45718fc2d0c6Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
45728fc2d0c6Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
45738fc2d0c6Smrg[m4_require([_LT_DECL_SED])dnl
45748fc2d0c6Smrgif test set = "${lt_cv_aix_libpath+set}"; then
45758fc2d0c6Smrg  aix_libpath=$lt_cv_aix_libpath
45768fc2d0c6Smrgelse
45778fc2d0c6Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
45788fc2d0c6Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
45798fc2d0c6Smrg  lt_aix_libpath_sed='[
45808fc2d0c6Smrg      /Import File Strings/,/^$/ {
45818fc2d0c6Smrg	  /^0/ {
45828fc2d0c6Smrg	      s/^0  *\([^ ]*\) *$/\1/
45838fc2d0c6Smrg	      p
45848fc2d0c6Smrg	  }
45858fc2d0c6Smrg      }]'
45868fc2d0c6Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
45878fc2d0c6Smrg  # Check for a 64-bit object if we didn't find anything.
45888fc2d0c6Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
45898fc2d0c6Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
45908fc2d0c6Smrg  fi],[])
45918fc2d0c6Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
45928fc2d0c6Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
45938fc2d0c6Smrg  fi
45948fc2d0c6Smrg  ])
45958fc2d0c6Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
45968fc2d0c6Smrgfi
45978fc2d0c6Smrg])# _LT_SYS_MODULE_PATH_AIX
45984a041c5bSmacallan
45994a041c5bSmacallan
46008fc2d0c6Smrg# _LT_SHELL_INIT(ARG)
46018fc2d0c6Smrg# -------------------
46028fc2d0c6Smrgm4_define([_LT_SHELL_INIT],
46038fc2d0c6Smrg[m4_divert_text([M4SH-INIT], [$1
46048fc2d0c6Smrg])])# _LT_SHELL_INIT
46054a041c5bSmacallan
46064a041c5bSmacallan
46074a041c5bSmacallan
46088fc2d0c6Smrg# _LT_PROG_ECHO_BACKSLASH
46098fc2d0c6Smrg# -----------------------
46108fc2d0c6Smrg# Find how we can fake an echo command that does not interpret backslash.
46118fc2d0c6Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
46128fc2d0c6Smrg# of the generated configure script that will find a shell with a builtin
46138fc2d0c6Smrg# printf (that we can use as an echo command).
46148fc2d0c6Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
46158fc2d0c6Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
46168fc2d0c6SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
46178fc2d0c6SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
46184a041c5bSmacallan
46198fc2d0c6SmrgAC_MSG_CHECKING([how to print strings])
46208fc2d0c6Smrg# Test print first, because it will be a builtin if present.
46218fc2d0c6Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
46228fc2d0c6Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
46238fc2d0c6Smrg  ECHO='print -r --'
46248fc2d0c6Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
46258fc2d0c6Smrg  ECHO='printf %s\n'
46268fc2d0c6Smrgelse
46278fc2d0c6Smrg  # Use this function as a fallback that always works.
46288fc2d0c6Smrg  func_fallback_echo ()
46298fc2d0c6Smrg  {
46308fc2d0c6Smrg    eval 'cat <<_LTECHO_EOF
46318fc2d0c6Smrg$[]1
46328fc2d0c6Smrg_LTECHO_EOF'
46338fc2d0c6Smrg  }
46348fc2d0c6Smrg  ECHO='func_fallback_echo'
46358fc2d0c6Smrgfi
46364a041c5bSmacallan
46378fc2d0c6Smrg# func_echo_all arg...
46388fc2d0c6Smrg# Invoke $ECHO with all args, space-separated.
46398fc2d0c6Smrgfunc_echo_all ()
46408fc2d0c6Smrg{
46418fc2d0c6Smrg    $ECHO "$*"
46428fc2d0c6Smrg}
46434a041c5bSmacallan
46448fc2d0c6Smrgcase $ECHO in
46458fc2d0c6Smrg  printf*) AC_MSG_RESULT([printf]) ;;
46468fc2d0c6Smrg  print*) AC_MSG_RESULT([print -r]) ;;
46478fc2d0c6Smrg  *) AC_MSG_RESULT([cat]) ;;
46488fc2d0c6Smrgesac
46494a041c5bSmacallan
46508fc2d0c6Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
46518fc2d0c6Smrg[_AS_DETECT_SUGGESTED([
46528fc2d0c6Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
46538fc2d0c6Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
46548fc2d0c6Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
46558fc2d0c6Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
46568fc2d0c6Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
46578fc2d0c6Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
46588fc2d0c6Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
46594a041c5bSmacallan
46608fc2d0c6Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
46618fc2d0c6Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
46628fc2d0c6Smrg])# _LT_PROG_ECHO_BACKSLASH
46634a041c5bSmacallan
46644a041c5bSmacallan
46658fc2d0c6Smrg# _LT_WITH_SYSROOT
46668fc2d0c6Smrg# ----------------
46678fc2d0c6SmrgAC_DEFUN([_LT_WITH_SYSROOT],
46688fc2d0c6Smrg[m4_require([_LT_DECL_SED])dnl
46698fc2d0c6SmrgAC_MSG_CHECKING([for sysroot])
46708fc2d0c6SmrgAC_ARG_WITH([sysroot],
46718fc2d0c6Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
46728fc2d0c6Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
46738fc2d0c6Smrg   if not specified).])],
46748fc2d0c6Smrg[], [with_sysroot=no])
46754a041c5bSmacallan
46768fc2d0c6Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
46778fc2d0c6Smrgdnl in case the user passed a directory name.
46788fc2d0c6Smrglt_sysroot=
46798fc2d0c6Smrgcase $with_sysroot in #(
46808fc2d0c6Smrg yes)
46818fc2d0c6Smrg   if test yes = "$GCC"; then
46828fc2d0c6Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
46838fc2d0c6Smrg   fi
46848fc2d0c6Smrg   ;; #(
46858fc2d0c6Smrg /*)
46868fc2d0c6Smrg   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
46878fc2d0c6Smrg   ;; #(
46888fc2d0c6Smrg no|'')
46898fc2d0c6Smrg   ;; #(
46908fc2d0c6Smrg *)
46918fc2d0c6Smrg   AC_MSG_RESULT([$with_sysroot])
46928fc2d0c6Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
46938fc2d0c6Smrg   ;;
46948fc2d0c6Smrgesac
46954a041c5bSmacallan
46968fc2d0c6Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
46978fc2d0c6Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
46988fc2d0c6Smrg[dependent libraries, and where our libraries should be installed.])])
46994a041c5bSmacallan
47008fc2d0c6Smrg# _LT_ENABLE_LOCK
47018fc2d0c6Smrg# ---------------
47028fc2d0c6Smrgm4_defun([_LT_ENABLE_LOCK],
47038fc2d0c6Smrg[AC_ARG_ENABLE([libtool-lock],
47048fc2d0c6Smrg  [AS_HELP_STRING([--disable-libtool-lock],
47058fc2d0c6Smrg    [avoid locking (might break parallel builds)])])
47068fc2d0c6Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
47074a041c5bSmacallan
47088fc2d0c6Smrg# Some flags need to be propagated to the compiler or linker for good
47098fc2d0c6Smrg# libtool support.
47108fc2d0c6Smrgcase $host in
47118fc2d0c6Smrgia64-*-hpux*)
47128fc2d0c6Smrg  # Find out what ABI is being produced by ac_compile, and set mode
47138fc2d0c6Smrg  # options accordingly.
47148fc2d0c6Smrg  echo 'int i;' > conftest.$ac_ext
47158fc2d0c6Smrg  if AC_TRY_EVAL(ac_compile); then
47168fc2d0c6Smrg    case `$FILECMD conftest.$ac_objext` in
47178fc2d0c6Smrg      *ELF-32*)
47188fc2d0c6Smrg	HPUX_IA64_MODE=32
47198fc2d0c6Smrg	;;
47208fc2d0c6Smrg      *ELF-64*)
47218fc2d0c6Smrg	HPUX_IA64_MODE=64
47228fc2d0c6Smrg	;;
47238fc2d0c6Smrg    esac
47248fc2d0c6Smrg  fi
47258fc2d0c6Smrg  rm -rf conftest*
47268fc2d0c6Smrg  ;;
47278fc2d0c6Smrg*-*-irix6*)
47288fc2d0c6Smrg  # Find out what ABI is being produced by ac_compile, and set linker
47298fc2d0c6Smrg  # options accordingly.
47308fc2d0c6Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
47318fc2d0c6Smrg  if AC_TRY_EVAL(ac_compile); then
47328fc2d0c6Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
47338fc2d0c6Smrg      case `$FILECMD conftest.$ac_objext` in
47348fc2d0c6Smrg	*32-bit*)
47358fc2d0c6Smrg	  LD="${LD-ld} -melf32bsmip"
473654b44505Smrg	  ;;
47378fc2d0c6Smrg	*N32*)
47388fc2d0c6Smrg	  LD="${LD-ld} -melf32bmipn32"
473954b44505Smrg	  ;;
47408fc2d0c6Smrg	*64-bit*)
47418fc2d0c6Smrg	  LD="${LD-ld} -melf64bmip"
47428fc2d0c6Smrg	;;
47438fc2d0c6Smrg      esac
47448fc2d0c6Smrg    else
47458fc2d0c6Smrg      case `$FILECMD conftest.$ac_objext` in
47468fc2d0c6Smrg	*32-bit*)
47478fc2d0c6Smrg	  LD="${LD-ld} -32"
474854b44505Smrg	  ;;
47498fc2d0c6Smrg	*N32*)
47508fc2d0c6Smrg	  LD="${LD-ld} -n32"
475154b44505Smrg	  ;;
47528fc2d0c6Smrg	*64-bit*)
47538fc2d0c6Smrg	  LD="${LD-ld} -64"
475454b44505Smrg	  ;;
47558fc2d0c6Smrg      esac
47568fc2d0c6Smrg    fi
47578fc2d0c6Smrg  fi
47588fc2d0c6Smrg  rm -rf conftest*
47598fc2d0c6Smrg  ;;
47604a041c5bSmacallan
47618fc2d0c6Smrgmips64*-*linux*)
47628fc2d0c6Smrg  # Find out what ABI is being produced by ac_compile, and set linker
47638fc2d0c6Smrg  # options accordingly.
47648fc2d0c6Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
47658fc2d0c6Smrg  if AC_TRY_EVAL(ac_compile); then
47668fc2d0c6Smrg    emul=elf
47678fc2d0c6Smrg    case `$FILECMD conftest.$ac_objext` in
47688fc2d0c6Smrg      *32-bit*)
47698fc2d0c6Smrg	emul="${emul}32"
47708fc2d0c6Smrg	;;
47718fc2d0c6Smrg      *64-bit*)
47728fc2d0c6Smrg	emul="${emul}64"
47738fc2d0c6Smrg	;;
47748fc2d0c6Smrg    esac
47758fc2d0c6Smrg    case `$FILECMD conftest.$ac_objext` in
47768fc2d0c6Smrg      *MSB*)
47778fc2d0c6Smrg	emul="${emul}btsmip"
47788fc2d0c6Smrg	;;
47798fc2d0c6Smrg      *LSB*)
47808fc2d0c6Smrg	emul="${emul}ltsmip"
47818fc2d0c6Smrg	;;
47828fc2d0c6Smrg    esac
47838fc2d0c6Smrg    case `$FILECMD conftest.$ac_objext` in
47848fc2d0c6Smrg      *N32*)
47858fc2d0c6Smrg	emul="${emul}n32"
47868fc2d0c6Smrg	;;
47878fc2d0c6Smrg    esac
47888fc2d0c6Smrg    LD="${LD-ld} -m $emul"
47898fc2d0c6Smrg  fi
47908fc2d0c6Smrg  rm -rf conftest*
47918fc2d0c6Smrg  ;;
47924a041c5bSmacallan
47938fc2d0c6Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
47948fc2d0c6Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
47958fc2d0c6Smrg  # Find out what ABI is being produced by ac_compile, and set linker
47968fc2d0c6Smrg  # options accordingly.  Note that the listed cases only cover the
47978fc2d0c6Smrg  # situations where additional linker options are needed (such as when
47988fc2d0c6Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
47998fc2d0c6Smrg  # vice versa); the common cases where no linker options are needed do
48008fc2d0c6Smrg  # not appear in the list.
48018fc2d0c6Smrg  echo 'int i;' > conftest.$ac_ext
48028fc2d0c6Smrg  if AC_TRY_EVAL(ac_compile); then
48038fc2d0c6Smrg    case `$FILECMD conftest.o` in
48048fc2d0c6Smrg      *32-bit*)
48058fc2d0c6Smrg	case $host in
48068fc2d0c6Smrg	  x86_64-*kfreebsd*-gnu)
48078fc2d0c6Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
48088fc2d0c6Smrg	    ;;
48098fc2d0c6Smrg	  x86_64-*linux*)
48108fc2d0c6Smrg	    case `$FILECMD conftest.o` in
48118fc2d0c6Smrg	      *x86-64*)
48128fc2d0c6Smrg		LD="${LD-ld} -m elf32_x86_64"
48138fc2d0c6Smrg		;;
48148fc2d0c6Smrg	      *)
48158fc2d0c6Smrg		LD="${LD-ld} -m elf_i386"
48168fc2d0c6Smrg		;;
48178fc2d0c6Smrg	    esac
48188fc2d0c6Smrg	    ;;
48198fc2d0c6Smrg	  powerpc64le-*linux*)
48208fc2d0c6Smrg	    LD="${LD-ld} -m elf32lppclinux"
48218fc2d0c6Smrg	    ;;
48228fc2d0c6Smrg	  powerpc64-*linux*)
48238fc2d0c6Smrg	    LD="${LD-ld} -m elf32ppclinux"
48248fc2d0c6Smrg	    ;;
48258fc2d0c6Smrg	  s390x-*linux*)
48268fc2d0c6Smrg	    LD="${LD-ld} -m elf_s390"
48278fc2d0c6Smrg	    ;;
48288fc2d0c6Smrg	  sparc64-*linux*)
48298fc2d0c6Smrg	    LD="${LD-ld} -m elf32_sparc"
48308fc2d0c6Smrg	    ;;
483154b44505Smrg	esac
48328fc2d0c6Smrg	;;
48338fc2d0c6Smrg      *64-bit*)
48348fc2d0c6Smrg	case $host in
48358fc2d0c6Smrg	  x86_64-*kfreebsd*-gnu)
48368fc2d0c6Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
48378fc2d0c6Smrg	    ;;
48388fc2d0c6Smrg	  x86_64-*linux*)
48398fc2d0c6Smrg	    LD="${LD-ld} -m elf_x86_64"
48408fc2d0c6Smrg	    ;;
48418fc2d0c6Smrg	  powerpcle-*linux*)
48428fc2d0c6Smrg	    LD="${LD-ld} -m elf64lppc"
48438fc2d0c6Smrg	    ;;
48448fc2d0c6Smrg	  powerpc-*linux*)
48458fc2d0c6Smrg	    LD="${LD-ld} -m elf64ppc"
48468fc2d0c6Smrg	    ;;
48478fc2d0c6Smrg	  s390*-*linux*|s390*-*tpf*)
48488fc2d0c6Smrg	    LD="${LD-ld} -m elf64_s390"
48498fc2d0c6Smrg	    ;;
48508fc2d0c6Smrg	  sparc*-*linux*)
48518fc2d0c6Smrg	    LD="${LD-ld} -m elf64_sparc"
48528fc2d0c6Smrg	    ;;
48538fc2d0c6Smrg	esac
48548fc2d0c6Smrg	;;
48558fc2d0c6Smrg    esac
48568fc2d0c6Smrg  fi
48578fc2d0c6Smrg  rm -rf conftest*
48588fc2d0c6Smrg  ;;
48594a041c5bSmacallan
48608fc2d0c6Smrg*-*-sco3.2v5*)
48618fc2d0c6Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
48628fc2d0c6Smrg  SAVE_CFLAGS=$CFLAGS
48638fc2d0c6Smrg  CFLAGS="$CFLAGS -belf"
48648fc2d0c6Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
48658fc2d0c6Smrg    [AC_LANG_PUSH(C)
48668fc2d0c6Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
48678fc2d0c6Smrg     AC_LANG_POP])
48688fc2d0c6Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
48698fc2d0c6Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
48708fc2d0c6Smrg    CFLAGS=$SAVE_CFLAGS
48718fc2d0c6Smrg  fi
48728fc2d0c6Smrg  ;;
48738fc2d0c6Smrg*-*solaris*)
48748fc2d0c6Smrg  # Find out what ABI is being produced by ac_compile, and set linker
48758fc2d0c6Smrg  # options accordingly.
48768fc2d0c6Smrg  echo 'int i;' > conftest.$ac_ext
48778fc2d0c6Smrg  if AC_TRY_EVAL(ac_compile); then
48788fc2d0c6Smrg    case `$FILECMD conftest.o` in
48798fc2d0c6Smrg    *64-bit*)
48808fc2d0c6Smrg      case $lt_cv_prog_gnu_ld in
48818fc2d0c6Smrg      yes*)
48828fc2d0c6Smrg        case $host in
48838fc2d0c6Smrg        i?86-*-solaris*|x86_64-*-solaris*)
48848fc2d0c6Smrg          LD="${LD-ld} -m elf_x86_64"
48858fc2d0c6Smrg          ;;
48868fc2d0c6Smrg        sparc*-*-solaris*)
48878fc2d0c6Smrg          LD="${LD-ld} -m elf64_sparc"
48888fc2d0c6Smrg          ;;
48898fc2d0c6Smrg        esac
48908fc2d0c6Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
48918fc2d0c6Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
48928fc2d0c6Smrg          LD=${LD-ld}_sol2
48938fc2d0c6Smrg        fi
48948fc2d0c6Smrg        ;;
48958fc2d0c6Smrg      *)
48968fc2d0c6Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
48978fc2d0c6Smrg	  LD="${LD-ld} -64"
489854b44505Smrg	fi
48990a392d7eSmrg	;;
49000a392d7eSmrg      esac
49010a392d7eSmrg      ;;
49028fc2d0c6Smrg    esac
49038fc2d0c6Smrg  fi
49048fc2d0c6Smrg  rm -rf conftest*
49058fc2d0c6Smrg  ;;
49068fc2d0c6Smrgesac
49070a392d7eSmrg
49088fc2d0c6Smrgneed_locks=$enable_libtool_lock
49098fc2d0c6Smrg])# _LT_ENABLE_LOCK
49104a041c5bSmacallan
49114a041c5bSmacallan
49128fc2d0c6Smrg# _LT_PROG_AR
49138fc2d0c6Smrg# -----------
49148fc2d0c6Smrgm4_defun([_LT_PROG_AR],
49158fc2d0c6Smrg[AC_CHECK_TOOLS(AR, [ar], false)
49168fc2d0c6Smrg: ${AR=ar}
49178fc2d0c6Smrg_LT_DECL([], [AR], [1], [The archiver])
49184a041c5bSmacallan
49198fc2d0c6Smrg# Use ARFLAGS variable as AR's operation code to sync the variable naming with
49208fc2d0c6Smrg# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
49218fc2d0c6Smrg# higher priority because thats what people were doing historically (setting
49228fc2d0c6Smrg# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
49238fc2d0c6Smrg# variable obsoleted/removed.
49244a041c5bSmacallan
49258fc2d0c6Smrgtest ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
49268fc2d0c6Smrglt_ar_flags=$AR_FLAGS
49278fc2d0c6Smrg_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
49284a041c5bSmacallan
49298fc2d0c6Smrg# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
49308fc2d0c6Smrg# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
49318fc2d0c6Smrg_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
49328fc2d0c6Smrg         [Flags to create an archive])
49338fc2d0c6Smrg
49348fc2d0c6SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
49358fc2d0c6Smrg  [lt_cv_ar_at_file=no
49368fc2d0c6Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
49378fc2d0c6Smrg     [echo conftest.$ac_objext > conftest.lst
49388fc2d0c6Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
49398fc2d0c6Smrg      AC_TRY_EVAL([lt_ar_try])
49408fc2d0c6Smrg      if test 0 -eq "$ac_status"; then
49418fc2d0c6Smrg	# Ensure the archiver fails upon bogus file names.
49428fc2d0c6Smrg	rm -f conftest.$ac_objext libconftest.a
49438fc2d0c6Smrg	AC_TRY_EVAL([lt_ar_try])
49448fc2d0c6Smrg	if test 0 -ne "$ac_status"; then
49458fc2d0c6Smrg          lt_cv_ar_at_file=@
49468fc2d0c6Smrg        fi
494754b44505Smrg      fi
49488fc2d0c6Smrg      rm -f conftest.* libconftest.a
49498fc2d0c6Smrg     ])
49508fc2d0c6Smrg  ])
49514a041c5bSmacallan
49528fc2d0c6Smrgif test no = "$lt_cv_ar_at_file"; then
49538fc2d0c6Smrg  archiver_list_spec=
49548fc2d0c6Smrgelse
49558fc2d0c6Smrg  archiver_list_spec=$lt_cv_ar_at_file
49568fc2d0c6Smrgfi
49578fc2d0c6Smrg_LT_DECL([], [archiver_list_spec], [1],
49588fc2d0c6Smrg  [How to feed a file listing to the archiver])
49598fc2d0c6Smrg])# _LT_PROG_AR
49604a041c5bSmacallan
49614a041c5bSmacallan
49628fc2d0c6Smrg# _LT_CMD_OLD_ARCHIVE
49638fc2d0c6Smrg# -------------------
49648fc2d0c6Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
49658fc2d0c6Smrg[_LT_PROG_AR
49664a041c5bSmacallan
49678fc2d0c6SmrgAC_CHECK_TOOL(STRIP, strip, :)
49688fc2d0c6Smrgtest -z "$STRIP" && STRIP=:
49698fc2d0c6Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
49704a041c5bSmacallan
49718fc2d0c6SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
49728fc2d0c6Smrgtest -z "$RANLIB" && RANLIB=:
49738fc2d0c6Smrg_LT_DECL([], [RANLIB], [1],
49748fc2d0c6Smrg    [Commands used to install an old-style archive])
49754a041c5bSmacallan
49768fc2d0c6Smrg# Determine commands to create old-style static archives.
49778fc2d0c6Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
49788fc2d0c6Smrgold_postinstall_cmds='chmod 644 $oldlib'
49798fc2d0c6Smrgold_postuninstall_cmds=
49804a041c5bSmacallan
49818fc2d0c6Smrgif test -n "$RANLIB"; then
49828fc2d0c6Smrg  case $host_os in
49838fc2d0c6Smrg  bitrig* | openbsd*)
49848fc2d0c6Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
49858fc2d0c6Smrg    ;;
49868fc2d0c6Smrg  *)
49878fc2d0c6Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
49888fc2d0c6Smrg    ;;
49898fc2d0c6Smrg  esac
49908fc2d0c6Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
49918fc2d0c6Smrgfi
49924a041c5bSmacallan
49938fc2d0c6Smrgcase $host_os in
49948fc2d0c6Smrg  darwin*)
49958fc2d0c6Smrg    lock_old_archive_extraction=yes ;;
49968fc2d0c6Smrg  *)
49978fc2d0c6Smrg    lock_old_archive_extraction=no ;;
49988fc2d0c6Smrgesac
49998fc2d0c6Smrg_LT_DECL([], [old_postinstall_cmds], [2])
50008fc2d0c6Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
50018fc2d0c6Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
50028fc2d0c6Smrg    [Commands used to build an old-style archive])
50038fc2d0c6Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
50048fc2d0c6Smrg    [Whether to use a lock for old archive extraction])
50058fc2d0c6Smrg])# _LT_CMD_OLD_ARCHIVE
50064a041c5bSmacallan
50074a041c5bSmacallan
50088fc2d0c6Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
50098fc2d0c6Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
50108fc2d0c6Smrg# ----------------------------------------------------------------
50118fc2d0c6Smrg# Check whether the given compiler option works
50128fc2d0c6SmrgAC_DEFUN([_LT_COMPILER_OPTION],
50138fc2d0c6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
50148fc2d0c6Smrgm4_require([_LT_DECL_SED])dnl
50158fc2d0c6SmrgAC_CACHE_CHECK([$1], [$2],
50168fc2d0c6Smrg  [$2=no
50178fc2d0c6Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
50188fc2d0c6Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
50198fc2d0c6Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
50208fc2d0c6Smrg   # Insert the option either (1) after the last *FLAGS variable, or
50218fc2d0c6Smrg   # (2) before a word containing "conftest.", or (3) at the end.
50228fc2d0c6Smrg   # Note that $ac_compile itself does not contain backslashes and begins
50238fc2d0c6Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
50248fc2d0c6Smrg   # The option is referenced via a variable to avoid confusing sed.
50258fc2d0c6Smrg   lt_compile=`echo "$ac_compile" | $SED \
50268fc2d0c6Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
50278fc2d0c6Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
50288fc2d0c6Smrg   -e 's:$: $lt_compiler_flag:'`
50298fc2d0c6Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
50308fc2d0c6Smrg   (eval "$lt_compile" 2>conftest.err)
50318fc2d0c6Smrg   ac_status=$?
50328fc2d0c6Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
50338fc2d0c6Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
50348fc2d0c6Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
50358fc2d0c6Smrg     # The compiler can only warn and ignore the option if not recognized
50368fc2d0c6Smrg     # So say no if there are warnings other than the usual output.
50378fc2d0c6Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
50388fc2d0c6Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
50398fc2d0c6Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
50408fc2d0c6Smrg       $2=yes
50418fc2d0c6Smrg     fi
50428fc2d0c6Smrg   fi
50438fc2d0c6Smrg   $RM conftest*
50448fc2d0c6Smrg])
50454a041c5bSmacallan
50468fc2d0c6Smrgif test yes = "[$]$2"; then
50478fc2d0c6Smrg    m4_if([$5], , :, [$5])
50488fc2d0c6Smrgelse
50498fc2d0c6Smrg    m4_if([$6], , :, [$6])
50508fc2d0c6Smrgfi
50518fc2d0c6Smrg])# _LT_COMPILER_OPTION
50524a041c5bSmacallan
50538fc2d0c6Smrg# Old name:
50548fc2d0c6SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
50558fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
50568fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
50574a041c5bSmacallan
50584a041c5bSmacallan
50598fc2d0c6Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
50608fc2d0c6Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
50618fc2d0c6Smrg# ----------------------------------------------------
50628fc2d0c6Smrg# Check whether the given linker option works
50638fc2d0c6SmrgAC_DEFUN([_LT_LINKER_OPTION],
50648fc2d0c6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
50658fc2d0c6Smrgm4_require([_LT_DECL_SED])dnl
50668fc2d0c6SmrgAC_CACHE_CHECK([$1], [$2],
50678fc2d0c6Smrg  [$2=no
50688fc2d0c6Smrg   save_LDFLAGS=$LDFLAGS
50698fc2d0c6Smrg   LDFLAGS="$LDFLAGS $3"
50708fc2d0c6Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
50718fc2d0c6Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
50728fc2d0c6Smrg     # The linker can only warn and ignore the option if not recognized
50738fc2d0c6Smrg     # So say no if there are warnings
50748fc2d0c6Smrg     if test -s conftest.err; then
50758fc2d0c6Smrg       # Append any errors to the config.log.
50768fc2d0c6Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
50778fc2d0c6Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
50788fc2d0c6Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
50798fc2d0c6Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
50808fc2d0c6Smrg         $2=yes
50818fc2d0c6Smrg       fi
50828fc2d0c6Smrg     else
50838fc2d0c6Smrg       $2=yes
50848fc2d0c6Smrg     fi
50858fc2d0c6Smrg   fi
50868fc2d0c6Smrg   $RM -r conftest*
50878fc2d0c6Smrg   LDFLAGS=$save_LDFLAGS
508854b44505Smrg])
50894a041c5bSmacallan
50908fc2d0c6Smrgif test yes = "[$]$2"; then
50918fc2d0c6Smrg    m4_if([$4], , :, [$4])
50928fc2d0c6Smrgelse
50938fc2d0c6Smrg    m4_if([$5], , :, [$5])
50948fc2d0c6Smrgfi
50958fc2d0c6Smrg])# _LT_LINKER_OPTION
50964a041c5bSmacallan
50978fc2d0c6Smrg# Old name:
50988fc2d0c6SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
50998fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
51008fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
51014a041c5bSmacallan
51024a041c5bSmacallan
51038fc2d0c6Smrg# LT_CMD_MAX_LEN
51048fc2d0c6Smrg#---------------
51058fc2d0c6SmrgAC_DEFUN([LT_CMD_MAX_LEN],
51068fc2d0c6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
51078fc2d0c6Smrg# find the maximum length of command line arguments
51088fc2d0c6SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
51098fc2d0c6SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
51108fc2d0c6Smrg  i=0
51118fc2d0c6Smrg  teststring=ABCD
511254b44505Smrg
51138fc2d0c6Smrg  case $build_os in
51148fc2d0c6Smrg  msdosdjgpp*)
51158fc2d0c6Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
51168fc2d0c6Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
51178fc2d0c6Smrg    # during glob expansion).  Even if it were fixed, the result of this
51188fc2d0c6Smrg    # check would be larger than it should be.
51198fc2d0c6Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
51208fc2d0c6Smrg    ;;
51214a041c5bSmacallan
51228fc2d0c6Smrg  gnu*)
51238fc2d0c6Smrg    # Under GNU Hurd, this test is not required because there is
51248fc2d0c6Smrg    # no limit to the length of command line arguments.
51258fc2d0c6Smrg    # Libtool will interpret -1 as no limit whatsoever
51268fc2d0c6Smrg    lt_cv_sys_max_cmd_len=-1;
51278fc2d0c6Smrg    ;;
51284a041c5bSmacallan
51298fc2d0c6Smrg  cygwin* | mingw* | cegcc*)
51308fc2d0c6Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
51318fc2d0c6Smrg    # about 5 minutes as the teststring grows exponentially.
51328fc2d0c6Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
51338fc2d0c6Smrg    # you end up with a "frozen" computer, even though with patience
51348fc2d0c6Smrg    # the test eventually succeeds (with a max line length of 256k).
51358fc2d0c6Smrg    # Instead, let's just punt: use the minimum linelength reported by
51368fc2d0c6Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
51378fc2d0c6Smrg    lt_cv_sys_max_cmd_len=8192;
51388fc2d0c6Smrg    ;;
51394a041c5bSmacallan
51408fc2d0c6Smrg  mint*)
51418fc2d0c6Smrg    # On MiNT this can take a long time and run out of memory.
51428fc2d0c6Smrg    lt_cv_sys_max_cmd_len=8192;
51438fc2d0c6Smrg    ;;
51444a041c5bSmacallan
51458fc2d0c6Smrg  amigaos*)
51468fc2d0c6Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
51478fc2d0c6Smrg    # So we just punt and use a minimum line length of 8192.
51488fc2d0c6Smrg    lt_cv_sys_max_cmd_len=8192;
51498fc2d0c6Smrg    ;;
515054b44505Smrg
51518fc2d0c6Smrg  bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
51528fc2d0c6Smrg    # This has been around since 386BSD, at least.  Likely further.
51538fc2d0c6Smrg    if test -x /sbin/sysctl; then
51548fc2d0c6Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
51558fc2d0c6Smrg    elif test -x /usr/sbin/sysctl; then
51568fc2d0c6Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
51578fc2d0c6Smrg    else
51588fc2d0c6Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
51598fc2d0c6Smrg    fi
51608fc2d0c6Smrg    # And add a safety zone
51618fc2d0c6Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
51628fc2d0c6Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
51638fc2d0c6Smrg    ;;
516454b44505Smrg
51658fc2d0c6Smrg  interix*)
51668fc2d0c6Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
51678fc2d0c6Smrg    lt_cv_sys_max_cmd_len=196608
51688fc2d0c6Smrg    ;;
516954b44505Smrg
51708fc2d0c6Smrg  os2*)
51718fc2d0c6Smrg    # The test takes a long time on OS/2.
51728fc2d0c6Smrg    lt_cv_sys_max_cmd_len=8192
517354b44505Smrg    ;;
51744a041c5bSmacallan
51758fc2d0c6Smrg  osf*)
51768fc2d0c6Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
51778fc2d0c6Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
51788fc2d0c6Smrg    # nice to cause kernel panics so lets avoid the loop below.
51798fc2d0c6Smrg    # First set a reasonable default.
51808fc2d0c6Smrg    lt_cv_sys_max_cmd_len=16384
51818fc2d0c6Smrg    #
51828fc2d0c6Smrg    if test -x /sbin/sysconfig; then
51838fc2d0c6Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
51848fc2d0c6Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
51850a392d7eSmrg      esac
518654b44505Smrg    fi
518754b44505Smrg    ;;
51888fc2d0c6Smrg  sco3.2v5*)
51898fc2d0c6Smrg    lt_cv_sys_max_cmd_len=102400
51908fc2d0c6Smrg    ;;
51918fc2d0c6Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
51928fc2d0c6Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
51938fc2d0c6Smrg    if test -n "$kargmax"; then
51948fc2d0c6Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
51958fc2d0c6Smrg    else
51968fc2d0c6Smrg      lt_cv_sys_max_cmd_len=32768
51978fc2d0c6Smrg    fi
51988fc2d0c6Smrg    ;;
51998fc2d0c6Smrg  *)
52008fc2d0c6Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
52018fc2d0c6Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
52028fc2d0c6Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
52038fc2d0c6Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
52048fc2d0c6Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
52058fc2d0c6Smrg    else
52068fc2d0c6Smrg      # Make teststring a little bigger before we do anything with it.
52078fc2d0c6Smrg      # a 1K string should be a reasonable start.
52088fc2d0c6Smrg      for i in 1 2 3 4 5 6 7 8; do
52098fc2d0c6Smrg        teststring=$teststring$teststring
52108fc2d0c6Smrg      done
52118fc2d0c6Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
52128fc2d0c6Smrg      # If test is not a shell built-in, we'll probably end up computing a
52138fc2d0c6Smrg      # maximum length that is only half of the actual maximum length, but
52148fc2d0c6Smrg      # we can't tell.
52158fc2d0c6Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
52168fc2d0c6Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
52178fc2d0c6Smrg	      test 17 != "$i" # 1/2 MB should be enough
52188fc2d0c6Smrg      do
52198fc2d0c6Smrg        i=`expr $i + 1`
52208fc2d0c6Smrg        teststring=$teststring$teststring
52218fc2d0c6Smrg      done
52228fc2d0c6Smrg      # Only check the string length outside the loop.
52238fc2d0c6Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
52248fc2d0c6Smrg      teststring=
52258fc2d0c6Smrg      # Add a significant safety factor because C++ compilers can tack on
52268fc2d0c6Smrg      # massive amounts of additional arguments before passing them to the
52278fc2d0c6Smrg      # linker.  It appears as though 1/2 is a usable value.
52288fc2d0c6Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
52298fc2d0c6Smrg    fi
52308fc2d0c6Smrg    ;;
523154b44505Smrg  esac
52328fc2d0c6Smrg])
52338fc2d0c6Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
52348fc2d0c6Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
52358fc2d0c6Smrgelse
52368fc2d0c6Smrg  AC_MSG_RESULT(none)
52378fc2d0c6Smrgfi
52388fc2d0c6Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
52398fc2d0c6Smrg_LT_DECL([], [max_cmd_len], [0],
52408fc2d0c6Smrg    [What is the maximum length of a command?])
52418fc2d0c6Smrg])# LT_CMD_MAX_LEN
52424a041c5bSmacallan
52438fc2d0c6Smrg# Old name:
52448fc2d0c6SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
52458fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
52468fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
52474a041c5bSmacallan
52484a041c5bSmacallan
52498fc2d0c6Smrg# _LT_HEADER_DLFCN
52508fc2d0c6Smrg# ----------------
52518fc2d0c6Smrgm4_defun([_LT_HEADER_DLFCN],
52528fc2d0c6Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
52538fc2d0c6Smrg])# _LT_HEADER_DLFCN
52544a041c5bSmacallan
52554a041c5bSmacallan
52568fc2d0c6Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
52578fc2d0c6Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
52588fc2d0c6Smrg# ----------------------------------------------------------------
52598fc2d0c6Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
52608fc2d0c6Smrg[m4_require([_LT_HEADER_DLFCN])dnl
52618fc2d0c6Smrgif test yes = "$cross_compiling"; then :
52628fc2d0c6Smrg  [$4]
52638fc2d0c6Smrgelse
52648fc2d0c6Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
52658fc2d0c6Smrg  lt_status=$lt_dlunknown
52668fc2d0c6Smrg  cat > conftest.$ac_ext <<_LT_EOF
52678fc2d0c6Smrg[#line $LINENO "configure"
52688fc2d0c6Smrg#include "confdefs.h"
526954b44505Smrg
52708fc2d0c6Smrg#if HAVE_DLFCN_H
52718fc2d0c6Smrg#include <dlfcn.h>
52728fc2d0c6Smrg#endif
527354b44505Smrg
52748fc2d0c6Smrg#include <stdio.h>
527554b44505Smrg
52768fc2d0c6Smrg#ifdef RTLD_GLOBAL
52778fc2d0c6Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
52788fc2d0c6Smrg#else
52798fc2d0c6Smrg#  ifdef DL_GLOBAL
52808fc2d0c6Smrg#    define LT_DLGLOBAL		DL_GLOBAL
52818fc2d0c6Smrg#  else
52828fc2d0c6Smrg#    define LT_DLGLOBAL		0
52838fc2d0c6Smrg#  endif
52848fc2d0c6Smrg#endif
528554b44505Smrg
52868fc2d0c6Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
52878fc2d0c6Smrg   find out it does not work in some platform. */
52888fc2d0c6Smrg#ifndef LT_DLLAZY_OR_NOW
52898fc2d0c6Smrg#  ifdef RTLD_LAZY
52908fc2d0c6Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
52918fc2d0c6Smrg#  else
52928fc2d0c6Smrg#    ifdef DL_LAZY
52938fc2d0c6Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
52948fc2d0c6Smrg#    else
52958fc2d0c6Smrg#      ifdef RTLD_NOW
52968fc2d0c6Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
52978fc2d0c6Smrg#      else
52988fc2d0c6Smrg#        ifdef DL_NOW
52998fc2d0c6Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
53008fc2d0c6Smrg#        else
53018fc2d0c6Smrg#          define LT_DLLAZY_OR_NOW	0
53028fc2d0c6Smrg#        endif
53038fc2d0c6Smrg#      endif
53048fc2d0c6Smrg#    endif
53058fc2d0c6Smrg#  endif
53068fc2d0c6Smrg#endif
530754b44505Smrg
53088fc2d0c6Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
53098fc2d0c6Smrg   correspondingly for the symbols needed.  */
53108fc2d0c6Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
53118fc2d0c6Smrgint fnord () __attribute__((visibility("default")));
53128fc2d0c6Smrg#endif
531354b44505Smrg
53148fc2d0c6Smrgint fnord () { return 42; }
53158fc2d0c6Smrgint main ()
53168fc2d0c6Smrg{
53178fc2d0c6Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
53188fc2d0c6Smrg  int status = $lt_dlunknown;
531954b44505Smrg
53208fc2d0c6Smrg  if (self)
53218fc2d0c6Smrg    {
53228fc2d0c6Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
53238fc2d0c6Smrg      else
53248fc2d0c6Smrg        {
53258fc2d0c6Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
53268fc2d0c6Smrg          else puts (dlerror ());
53278fc2d0c6Smrg	}
53288fc2d0c6Smrg      /* dlclose (self); */
53298fc2d0c6Smrg    }
53304a041c5bSmacallan  else
53318fc2d0c6Smrg    puts (dlerror ());
53328fc2d0c6Smrg
53338fc2d0c6Smrg  return status;
53348fc2d0c6Smrg}]
53358fc2d0c6Smrg_LT_EOF
53368fc2d0c6Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
53378fc2d0c6Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
53388fc2d0c6Smrg    lt_status=$?
53398fc2d0c6Smrg    case x$lt_status in
53408fc2d0c6Smrg      x$lt_dlno_uscore) $1 ;;
53418fc2d0c6Smrg      x$lt_dlneed_uscore) $2 ;;
53428fc2d0c6Smrg      x$lt_dlunknown|x*) $3 ;;
53438fc2d0c6Smrg    esac
53448fc2d0c6Smrg  else :
53458fc2d0c6Smrg    # compilation failed
53468fc2d0c6Smrg    $3
53474a041c5bSmacallan  fi
53488fc2d0c6Smrgfi
53498fc2d0c6Smrgrm -fr conftest*
53508fc2d0c6Smrg])# _LT_TRY_DLOPEN_SELF
53514a041c5bSmacallan
53524a041c5bSmacallan
53538fc2d0c6Smrg# LT_SYS_DLOPEN_SELF
53548fc2d0c6Smrg# ------------------
53558fc2d0c6SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
53568fc2d0c6Smrg[m4_require([_LT_HEADER_DLFCN])dnl
53578fc2d0c6Smrgif test yes != "$enable_dlopen"; then
53588fc2d0c6Smrg  enable_dlopen=unknown
53598fc2d0c6Smrg  enable_dlopen_self=unknown
53608fc2d0c6Smrg  enable_dlopen_self_static=unknown
53618fc2d0c6Smrgelse
53628fc2d0c6Smrg  lt_cv_dlopen=no
53638fc2d0c6Smrg  lt_cv_dlopen_libs=
53644a041c5bSmacallan
53658fc2d0c6Smrg  case $host_os in
53668fc2d0c6Smrg  beos*)
53678fc2d0c6Smrg    lt_cv_dlopen=load_add_on
53688fc2d0c6Smrg    lt_cv_dlopen_libs=
53698fc2d0c6Smrg    lt_cv_dlopen_self=yes
53708fc2d0c6Smrg    ;;
53714a041c5bSmacallan
53728fc2d0c6Smrg  mingw* | pw32* | cegcc*)
53738fc2d0c6Smrg    lt_cv_dlopen=LoadLibrary
53748fc2d0c6Smrg    lt_cv_dlopen_libs=
53758fc2d0c6Smrg    ;;
537654b44505Smrg
53778fc2d0c6Smrg  cygwin*)
53788fc2d0c6Smrg    lt_cv_dlopen=dlopen
53798fc2d0c6Smrg    lt_cv_dlopen_libs=
53808fc2d0c6Smrg    ;;
538154b44505Smrg
53828fc2d0c6Smrg  darwin*)
53838fc2d0c6Smrg    # if libdl is installed we need to link against it
53848fc2d0c6Smrg    AC_CHECK_LIB([dl], [dlopen],
53858fc2d0c6Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
53868fc2d0c6Smrg    lt_cv_dlopen=dyld
53878fc2d0c6Smrg    lt_cv_dlopen_libs=
53888fc2d0c6Smrg    lt_cv_dlopen_self=yes
53898fc2d0c6Smrg    ])
53908fc2d0c6Smrg    ;;
539154b44505Smrg
53928fc2d0c6Smrg  tpf*)
53938fc2d0c6Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
53948fc2d0c6Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
53958fc2d0c6Smrg    lt_cv_dlopen=dlopen
53968fc2d0c6Smrg    lt_cv_dlopen_libs=
53978fc2d0c6Smrg    lt_cv_dlopen_self=no
53988fc2d0c6Smrg    ;;
539954b44505Smrg
54008fc2d0c6Smrg  *)
54018fc2d0c6Smrg    AC_CHECK_FUNC([shl_load],
54028fc2d0c6Smrg	  [lt_cv_dlopen=shl_load],
54038fc2d0c6Smrg      [AC_CHECK_LIB([dld], [shl_load],
54048fc2d0c6Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
54058fc2d0c6Smrg	[AC_CHECK_FUNC([dlopen],
54068fc2d0c6Smrg	      [lt_cv_dlopen=dlopen],
54078fc2d0c6Smrg	  [AC_CHECK_LIB([dl], [dlopen],
54088fc2d0c6Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
54098fc2d0c6Smrg	    [AC_CHECK_LIB([svld], [dlopen],
54108fc2d0c6Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
54118fc2d0c6Smrg	      [AC_CHECK_LIB([dld], [dld_link],
54128fc2d0c6Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
54138fc2d0c6Smrg	      ])
54148fc2d0c6Smrg	    ])
54158fc2d0c6Smrg	  ])
54168fc2d0c6Smrg	])
54178fc2d0c6Smrg      ])
54188fc2d0c6Smrg    ;;
54198fc2d0c6Smrg  esac
542054b44505Smrg
54218fc2d0c6Smrg  if test no = "$lt_cv_dlopen"; then
54228fc2d0c6Smrg    enable_dlopen=no
54238fc2d0c6Smrg  else
54248fc2d0c6Smrg    enable_dlopen=yes
54258fc2d0c6Smrg  fi
542654b44505Smrg
54278fc2d0c6Smrg  case $lt_cv_dlopen in
54288fc2d0c6Smrg  dlopen)
54298fc2d0c6Smrg    save_CPPFLAGS=$CPPFLAGS
54308fc2d0c6Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
543154b44505Smrg
54328fc2d0c6Smrg    save_LDFLAGS=$LDFLAGS
54338fc2d0c6Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
543454b44505Smrg
54358fc2d0c6Smrg    save_LIBS=$LIBS
54368fc2d0c6Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
543754b44505Smrg
54388fc2d0c6Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
54398fc2d0c6Smrg	  lt_cv_dlopen_self, [dnl
54408fc2d0c6Smrg	  _LT_TRY_DLOPEN_SELF(
54418fc2d0c6Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
54428fc2d0c6Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
54438fc2d0c6Smrg    ])
544454b44505Smrg
54458fc2d0c6Smrg    if test yes = "$lt_cv_dlopen_self"; then
54468fc2d0c6Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
54478fc2d0c6Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
54488fc2d0c6Smrg	  lt_cv_dlopen_self_static, [dnl
54498fc2d0c6Smrg	  _LT_TRY_DLOPEN_SELF(
54508fc2d0c6Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
54518fc2d0c6Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
54528fc2d0c6Smrg      ])
54538fc2d0c6Smrg    fi
545454b44505Smrg
54558fc2d0c6Smrg    CPPFLAGS=$save_CPPFLAGS
54568fc2d0c6Smrg    LDFLAGS=$save_LDFLAGS
54578fc2d0c6Smrg    LIBS=$save_LIBS
54588fc2d0c6Smrg    ;;
54598fc2d0c6Smrg  esac
546054b44505Smrg
54618fc2d0c6Smrg  case $lt_cv_dlopen_self in
54628fc2d0c6Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
54638fc2d0c6Smrg  *) enable_dlopen_self=unknown ;;
54648fc2d0c6Smrg  esac
546554b44505Smrg
54668fc2d0c6Smrg  case $lt_cv_dlopen_self_static in
54678fc2d0c6Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
54688fc2d0c6Smrg  *) enable_dlopen_self_static=unknown ;;
54698fc2d0c6Smrg  esac
54708fc2d0c6Smrgfi
54718fc2d0c6Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
54728fc2d0c6Smrg	 [Whether dlopen is supported])
54738fc2d0c6Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
54748fc2d0c6Smrg	 [Whether dlopen of programs is supported])
54758fc2d0c6Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
54768fc2d0c6Smrg	 [Whether dlopen of statically linked programs is supported])
54778fc2d0c6Smrg])# LT_SYS_DLOPEN_SELF
547854b44505Smrg
54798fc2d0c6Smrg# Old name:
54808fc2d0c6SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
54818fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
54828fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
548354b44505Smrg
548454b44505Smrg
54858fc2d0c6Smrg# _LT_COMPILER_C_O([TAGNAME])
54868fc2d0c6Smrg# ---------------------------
54878fc2d0c6Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
54888fc2d0c6Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
54898fc2d0c6Smrgm4_defun([_LT_COMPILER_C_O],
54908fc2d0c6Smrg[m4_require([_LT_DECL_SED])dnl
54918fc2d0c6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
54928fc2d0c6Smrgm4_require([_LT_TAG_COMPILER])dnl
54938fc2d0c6SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
54948fc2d0c6Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
54958fc2d0c6Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
54968fc2d0c6Smrg   $RM -r conftest 2>/dev/null
54978fc2d0c6Smrg   mkdir conftest
54988fc2d0c6Smrg   cd conftest
54998fc2d0c6Smrg   mkdir out
55008fc2d0c6Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
55010a392d7eSmrg
55028fc2d0c6Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
55038fc2d0c6Smrg   # Insert the option either (1) after the last *FLAGS variable, or
55048fc2d0c6Smrg   # (2) before a word containing "conftest.", or (3) at the end.
55058fc2d0c6Smrg   # Note that $ac_compile itself does not contain backslashes and begins
55068fc2d0c6Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
55078fc2d0c6Smrg   lt_compile=`echo "$ac_compile" | $SED \
55088fc2d0c6Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
55098fc2d0c6Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
55108fc2d0c6Smrg   -e 's:$: $lt_compiler_flag:'`
55118fc2d0c6Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
55128fc2d0c6Smrg   (eval "$lt_compile" 2>out/conftest.err)
55138fc2d0c6Smrg   ac_status=$?
55148fc2d0c6Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
55158fc2d0c6Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
55168fc2d0c6Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
55178fc2d0c6Smrg   then
55188fc2d0c6Smrg     # The compiler can only warn and ignore the option if not recognized
55198fc2d0c6Smrg     # So say no if there are warnings
55208fc2d0c6Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
55218fc2d0c6Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
55228fc2d0c6Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
55238fc2d0c6Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
55248fc2d0c6Smrg     fi
55258fc2d0c6Smrg   fi
55268fc2d0c6Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
55278fc2d0c6Smrg   $RM conftest*
55288fc2d0c6Smrg   # SGI C++ compiler will create directory out/ii_files/ for
55298fc2d0c6Smrg   # template instantiation
55308fc2d0c6Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
55318fc2d0c6Smrg   $RM out/* && rmdir out
55328fc2d0c6Smrg   cd ..
55338fc2d0c6Smrg   $RM -r conftest
55348fc2d0c6Smrg   $RM conftest*
55358fc2d0c6Smrg])
55368fc2d0c6Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
55378fc2d0c6Smrg	[Does compiler simultaneously support -c and -o options?])
55388fc2d0c6Smrg])# _LT_COMPILER_C_O
553954b44505Smrg
554054b44505Smrg
55418fc2d0c6Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
55428fc2d0c6Smrg# ----------------------------------
55438fc2d0c6Smrg# Check to see if we can do hard links to lock some files if needed
55448fc2d0c6Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
55458fc2d0c6Smrg[m4_require([_LT_ENABLE_LOCK])dnl
55468fc2d0c6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
55478fc2d0c6Smrg_LT_COMPILER_C_O([$1])
554854b44505Smrg
55498fc2d0c6Smrghard_links=nottested
55508fc2d0c6Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
55518fc2d0c6Smrg  # do not overwrite the value of need_locks provided by the user
55528fc2d0c6Smrg  AC_MSG_CHECKING([if we can lock with hard links])
55538fc2d0c6Smrg  hard_links=yes
55548fc2d0c6Smrg  $RM conftest*
55558fc2d0c6Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
55568fc2d0c6Smrg  touch conftest.a
55578fc2d0c6Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
55588fc2d0c6Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
55598fc2d0c6Smrg  AC_MSG_RESULT([$hard_links])
55608fc2d0c6Smrg  if test no = "$hard_links"; then
55618fc2d0c6Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
55628fc2d0c6Smrg    need_locks=warn
55638fc2d0c6Smrg  fi
55648fc2d0c6Smrgelse
55658fc2d0c6Smrg  need_locks=no
55668fc2d0c6Smrgfi
55678fc2d0c6Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
55688fc2d0c6Smrg])# _LT_COMPILER_FILE_LOCKS
556954b44505Smrg
557054b44505Smrg
55718fc2d0c6Smrg# _LT_CHECK_OBJDIR
55728fc2d0c6Smrg# ----------------
55738fc2d0c6Smrgm4_defun([_LT_CHECK_OBJDIR],
55748fc2d0c6Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
55758fc2d0c6Smrg[rm -f .libs 2>/dev/null
55768fc2d0c6Smrgmkdir .libs 2>/dev/null
55778fc2d0c6Smrgif test -d .libs; then
55788fc2d0c6Smrg  lt_cv_objdir=.libs
55798fc2d0c6Smrgelse
55808fc2d0c6Smrg  # MS-DOS does not allow filenames that begin with a dot.
55818fc2d0c6Smrg  lt_cv_objdir=_libs
55828fc2d0c6Smrgfi
55838fc2d0c6Smrgrmdir .libs 2>/dev/null])
55848fc2d0c6Smrgobjdir=$lt_cv_objdir
55858fc2d0c6Smrg_LT_DECL([], [objdir], [0],
55868fc2d0c6Smrg         [The name of the directory that contains temporary libtool files])dnl
55878fc2d0c6Smrgm4_pattern_allow([LT_OBJDIR])dnl
55888fc2d0c6SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
55898fc2d0c6Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
55908fc2d0c6Smrg])# _LT_CHECK_OBJDIR
559154b44505Smrg
559254b44505Smrg
55938fc2d0c6Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
55948fc2d0c6Smrg# --------------------------------------
55958fc2d0c6Smrg# Check hardcoding attributes.
55968fc2d0c6Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
55978fc2d0c6Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
55988fc2d0c6Smrg_LT_TAGVAR(hardcode_action, $1)=
55998fc2d0c6Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
56008fc2d0c6Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
56018fc2d0c6Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
560254b44505Smrg
56038fc2d0c6Smrg  # We can hardcode non-existent directories.
56048fc2d0c6Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
56058fc2d0c6Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
56068fc2d0c6Smrg     # have to relink, otherwise we might link with an installed library
56078fc2d0c6Smrg     # when we should be linking with a yet-to-be-installed one
56088fc2d0c6Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
56098fc2d0c6Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
56108fc2d0c6Smrg    # Linking always hardcodes the temporary library directory.
56118fc2d0c6Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
56128fc2d0c6Smrg  else
56138fc2d0c6Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
56148fc2d0c6Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
56158fc2d0c6Smrg  fi
56168fc2d0c6Smrgelse
56178fc2d0c6Smrg  # We cannot hardcode anything, or else we can only hardcode existing
56188fc2d0c6Smrg  # directories.
56198fc2d0c6Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
56208fc2d0c6Smrgfi
56218fc2d0c6SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
562254b44505Smrg
56238fc2d0c6Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
56248fc2d0c6Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
56258fc2d0c6Smrg  # Fast installation is not supported
56268fc2d0c6Smrg  enable_fast_install=no
56278fc2d0c6Smrgelif test yes = "$shlibpath_overrides_runpath" ||
56288fc2d0c6Smrg     test no = "$enable_shared"; then
56298fc2d0c6Smrg  # Fast installation is not necessary
56308fc2d0c6Smrg  enable_fast_install=needless
56318fc2d0c6Smrgfi
56328fc2d0c6Smrg_LT_TAGDECL([], [hardcode_action], [0],
56338fc2d0c6Smrg    [How to hardcode a shared library path into an executable])
56348fc2d0c6Smrg])# _LT_LINKER_HARDCODE_LIBPATH
563554b44505Smrg
563654b44505Smrg
56378fc2d0c6Smrg# _LT_CMD_STRIPLIB
56388fc2d0c6Smrg# ----------------
56398fc2d0c6Smrgm4_defun([_LT_CMD_STRIPLIB],
56408fc2d0c6Smrg[m4_require([_LT_DECL_EGREP])
56418fc2d0c6Smrgstriplib=
56428fc2d0c6Smrgold_striplib=
56438fc2d0c6SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
56448fc2d0c6Smrgif test -z "$STRIP"; then
56458fc2d0c6Smrg  AC_MSG_RESULT([no])
56468fc2d0c6Smrgelse
56478fc2d0c6Smrg  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
56488fc2d0c6Smrg    old_striplib="$STRIP --strip-debug"
56498fc2d0c6Smrg    striplib="$STRIP --strip-unneeded"
56508fc2d0c6Smrg    AC_MSG_RESULT([yes])
56518fc2d0c6Smrg  else
56528fc2d0c6Smrg    case $host_os in
56538fc2d0c6Smrg    darwin*)
56548fc2d0c6Smrg      # FIXME - insert some real tests, host_os isn't really good enough
56558fc2d0c6Smrg      striplib="$STRIP -x"
56568fc2d0c6Smrg      old_striplib="$STRIP -S"
56578fc2d0c6Smrg      AC_MSG_RESULT([yes])
56588fc2d0c6Smrg      ;;
56598fc2d0c6Smrg    freebsd*)
56608fc2d0c6Smrg      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
56618fc2d0c6Smrg        old_striplib="$STRIP --strip-debug"
56628fc2d0c6Smrg        striplib="$STRIP --strip-unneeded"
56638fc2d0c6Smrg        AC_MSG_RESULT([yes])
56648fc2d0c6Smrg      else
56658fc2d0c6Smrg        AC_MSG_RESULT([no])
56668fc2d0c6Smrg      fi
56678fc2d0c6Smrg      ;;
56688fc2d0c6Smrg    *)
56698fc2d0c6Smrg      AC_MSG_RESULT([no])
56708fc2d0c6Smrg      ;;
56718fc2d0c6Smrg    esac
56728fc2d0c6Smrg  fi
56738fc2d0c6Smrgfi
56748fc2d0c6Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
56758fc2d0c6Smrg_LT_DECL([], [striplib], [1])
56768fc2d0c6Smrg])# _LT_CMD_STRIPLIB
567754b44505Smrg
567854b44505Smrg
56798fc2d0c6Smrg# _LT_PREPARE_MUNGE_PATH_LIST
56808fc2d0c6Smrg# ---------------------------
56818fc2d0c6Smrg# Make sure func_munge_path_list() is defined correctly.
56828fc2d0c6Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
56838fc2d0c6Smrg[[# func_munge_path_list VARIABLE PATH
56848fc2d0c6Smrg# -----------------------------------
56858fc2d0c6Smrg# VARIABLE is name of variable containing _space_ separated list of
56868fc2d0c6Smrg# directories to be munged by the contents of PATH, which is string
56878fc2d0c6Smrg# having a format:
56888fc2d0c6Smrg# "DIR[:DIR]:"
56898fc2d0c6Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
56908fc2d0c6Smrg# ":DIR[:DIR]"
56918fc2d0c6Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
56928fc2d0c6Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
56938fc2d0c6Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
56948fc2d0c6Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
56958fc2d0c6Smrg# "DIR[:DIR]"
56968fc2d0c6Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
56978fc2d0c6Smrgfunc_munge_path_list ()
56988fc2d0c6Smrg{
56998fc2d0c6Smrg    case x@S|@2 in
57008fc2d0c6Smrg    x)
57018fc2d0c6Smrg        ;;
57028fc2d0c6Smrg    *:)
57038fc2d0c6Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
57048fc2d0c6Smrg        ;;
57058fc2d0c6Smrg    x:*)
57068fc2d0c6Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
57078fc2d0c6Smrg        ;;
57088fc2d0c6Smrg    *::*)
57098fc2d0c6Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
57108fc2d0c6Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
57118fc2d0c6Smrg        ;;
57128fc2d0c6Smrg    *)
57138fc2d0c6Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
57148fc2d0c6Smrg        ;;
57158fc2d0c6Smrg    esac
57168fc2d0c6Smrg}
57178fc2d0c6Smrg]])# _LT_PREPARE_PATH_LIST
571854b44505Smrg
571954b44505Smrg
57208fc2d0c6Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
57218fc2d0c6Smrg# -----------------------------
57228fc2d0c6Smrg# PORTME Fill in your ld.so characteristics
57238fc2d0c6Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
57248fc2d0c6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
57258fc2d0c6Smrgm4_require([_LT_DECL_EGREP])dnl
57268fc2d0c6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
57278fc2d0c6Smrgm4_require([_LT_DECL_OBJDUMP])dnl
57288fc2d0c6Smrgm4_require([_LT_DECL_SED])dnl
57298fc2d0c6Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
57308fc2d0c6Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
57318fc2d0c6SmrgAC_MSG_CHECKING([dynamic linker characteristics])
57328fc2d0c6Smrgm4_if([$1],
57338fc2d0c6Smrg	[], [
57348fc2d0c6Smrgif test yes = "$GCC"; then
57358fc2d0c6Smrg  case $host_os in
57368fc2d0c6Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
57378fc2d0c6Smrg    *) lt_awk_arg='/^libraries:/' ;;
57388fc2d0c6Smrg  esac
57398fc2d0c6Smrg  case $host_os in
57408fc2d0c6Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
57418fc2d0c6Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
57428fc2d0c6Smrg  esac
57438fc2d0c6Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
57448fc2d0c6Smrg  case $lt_search_path_spec in
57458fc2d0c6Smrg  *\;*)
57468fc2d0c6Smrg    # if the path contains ";" then we assume it to be the separator
57478fc2d0c6Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
57488fc2d0c6Smrg    # assumed that no part of a normal pathname contains ";" but that should
57498fc2d0c6Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
57508fc2d0c6Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
57518fc2d0c6Smrg    ;;
57528fc2d0c6Smrg  *)
57538fc2d0c6Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
57548fc2d0c6Smrg    ;;
57558fc2d0c6Smrg  esac
57568fc2d0c6Smrg  # Ok, now we have the path, separated by spaces, we can step through it
57578fc2d0c6Smrg  # and add multilib dir if necessary...
57588fc2d0c6Smrg  lt_tmp_lt_search_path_spec=
57598fc2d0c6Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
57608fc2d0c6Smrg  # ...but if some path component already ends with the multilib dir we assume
57618fc2d0c6Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
57628fc2d0c6Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
57638fc2d0c6Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
57648fc2d0c6Smrg    lt_multi_os_dir=
57658fc2d0c6Smrg    ;;
57668fc2d0c6Smrg  esac
57678fc2d0c6Smrg  for lt_sys_path in $lt_search_path_spec; do
57688fc2d0c6Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
57698fc2d0c6Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
57708fc2d0c6Smrg    elif test -n "$lt_multi_os_dir"; then
57718fc2d0c6Smrg      test -d "$lt_sys_path" && \
57728fc2d0c6Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
57738fc2d0c6Smrg    fi
57748fc2d0c6Smrg  done
57758fc2d0c6Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
57768fc2d0c6SmrgBEGIN {RS = " "; FS = "/|\n";} {
57778fc2d0c6Smrg  lt_foo = "";
57788fc2d0c6Smrg  lt_count = 0;
57798fc2d0c6Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
57808fc2d0c6Smrg    if ($lt_i != "" && $lt_i != ".") {
57818fc2d0c6Smrg      if ($lt_i == "..") {
57828fc2d0c6Smrg        lt_count++;
57838fc2d0c6Smrg      } else {
57848fc2d0c6Smrg        if (lt_count == 0) {
57858fc2d0c6Smrg          lt_foo = "/" $lt_i lt_foo;
57868fc2d0c6Smrg        } else {
57878fc2d0c6Smrg          lt_count--;
57888fc2d0c6Smrg        }
57898fc2d0c6Smrg      }
57908fc2d0c6Smrg    }
57918fc2d0c6Smrg  }
57928fc2d0c6Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
57938fc2d0c6Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
57948fc2d0c6Smrg}'`
57958fc2d0c6Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
57968fc2d0c6Smrg  # for these hosts.
57978fc2d0c6Smrg  case $host_os in
57988fc2d0c6Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
57998fc2d0c6Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
58008fc2d0c6Smrg  esac
58018fc2d0c6Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
58028fc2d0c6Smrgelse
58038fc2d0c6Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
58048fc2d0c6Smrgfi])
58058fc2d0c6Smrglibrary_names_spec=
58068fc2d0c6Smrglibname_spec='lib$name'
58078fc2d0c6Smrgsoname_spec=
58088fc2d0c6Smrgshrext_cmds=.so
58098fc2d0c6Smrgpostinstall_cmds=
58108fc2d0c6Smrgpostuninstall_cmds=
58118fc2d0c6Smrgfinish_cmds=
58128fc2d0c6Smrgfinish_eval=
58138fc2d0c6Smrgshlibpath_var=
58148fc2d0c6Smrgshlibpath_overrides_runpath=unknown
58158fc2d0c6Smrgversion_type=none
58168fc2d0c6Smrgdynamic_linker="$host_os ld.so"
58178fc2d0c6Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
58188fc2d0c6Smrgneed_lib_prefix=unknown
58198fc2d0c6Smrghardcode_into_libs=no
582054b44505Smrg
58218fc2d0c6Smrg# when you set need_version to no, make sure it does not cause -set_version
58228fc2d0c6Smrg# flags to be left without arguments
58238fc2d0c6Smrgneed_version=unknown
582454b44505Smrg
58258fc2d0c6SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
58268fc2d0c6Smrg[User-defined run-time library search path.])
582754b44505Smrg
58288fc2d0c6Smrgcase $host_os in
58298fc2d0c6Smrgaix3*)
58308fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
58318fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
58328fc2d0c6Smrg  shlibpath_var=LIBPATH
583354b44505Smrg
58348fc2d0c6Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
58358fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
58368fc2d0c6Smrg  ;;
583754b44505Smrg
58388fc2d0c6Smrgaix[[4-9]]*)
58398fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
58408fc2d0c6Smrg  need_lib_prefix=no
58418fc2d0c6Smrg  need_version=no
58428fc2d0c6Smrg  hardcode_into_libs=yes
58438fc2d0c6Smrg  if test ia64 = "$host_cpu"; then
58448fc2d0c6Smrg    # AIX 5 supports IA64
58458fc2d0c6Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
58468fc2d0c6Smrg    shlibpath_var=LD_LIBRARY_PATH
58478fc2d0c6Smrg  else
58488fc2d0c6Smrg    # With GCC up to 2.95.x, collect2 would create an import file
58498fc2d0c6Smrg    # for dependence libraries.  The import file would start with
58508fc2d0c6Smrg    # the line '#! .'.  This would cause the generated library to
58518fc2d0c6Smrg    # depend on '.', always an invalid library.  This was fixed in
58528fc2d0c6Smrg    # development snapshots of GCC prior to 3.0.
58538fc2d0c6Smrg    case $host_os in
58548fc2d0c6Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
58558fc2d0c6Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
58568fc2d0c6Smrg	   echo ' yes '
58578fc2d0c6Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
58588fc2d0c6Smrg	:
58598fc2d0c6Smrg      else
58608fc2d0c6Smrg	can_build_shared=no
58618fc2d0c6Smrg      fi
58628fc2d0c6Smrg      ;;
58638fc2d0c6Smrg    esac
58648fc2d0c6Smrg    # Using Import Files as archive members, it is possible to support
58658fc2d0c6Smrg    # filename-based versioning of shared library archives on AIX. While
58668fc2d0c6Smrg    # this would work for both with and without runtime linking, it will
58678fc2d0c6Smrg    # prevent static linking of such archives. So we do filename-based
58688fc2d0c6Smrg    # shared library versioning with .so extension only, which is used
58698fc2d0c6Smrg    # when both runtime linking and shared linking is enabled.
58708fc2d0c6Smrg    # Unfortunately, runtime linking may impact performance, so we do
58718fc2d0c6Smrg    # not want this to be the default eventually. Also, we use the
58728fc2d0c6Smrg    # versioned .so libs for executables only if there is the -brtl
58738fc2d0c6Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
58748fc2d0c6Smrg    # To allow for filename-based versioning support, we need to create
58758fc2d0c6Smrg    # libNAME.so.V as an archive file, containing:
58768fc2d0c6Smrg    # *) an Import File, referring to the versioned filename of the
58778fc2d0c6Smrg    #    archive as well as the shared archive member, telling the
58788fc2d0c6Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
58798fc2d0c6Smrg    #    list of exported symbols of that shared object, eventually
58808fc2d0c6Smrg    #    decorated with the 'weak' keyword
58818fc2d0c6Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
58828fc2d0c6Smrg    #    it being seen by the linker.
58838fc2d0c6Smrg    # At run time we better use the real file rather than another symlink,
58848fc2d0c6Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
588554b44505Smrg
58868fc2d0c6Smrg    case $with_aix_soname,$aix_use_runtimelinking in
58878fc2d0c6Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
58888fc2d0c6Smrg    # soname into executable. Probably we can add versioning support to
58898fc2d0c6Smrg    # collect2, so additional links can be useful in future.
58908fc2d0c6Smrg    aix,yes) # traditional libtool
58918fc2d0c6Smrg      dynamic_linker='AIX unversionable lib.so'
58928fc2d0c6Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
58938fc2d0c6Smrg      # instead of lib<name>.a to let people know that these are not
58948fc2d0c6Smrg      # typical AIX shared libraries.
58958fc2d0c6Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
58968fc2d0c6Smrg      ;;
58978fc2d0c6Smrg    aix,no) # traditional AIX only
58988fc2d0c6Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
58998fc2d0c6Smrg      # We preserve .a as extension for shared libraries through AIX4.2
59008fc2d0c6Smrg      # and later when we are not doing run time linking.
59018fc2d0c6Smrg      library_names_spec='$libname$release.a $libname.a'
59028fc2d0c6Smrg      soname_spec='$libname$release$shared_ext$major'
59038fc2d0c6Smrg      ;;
59048fc2d0c6Smrg    svr4,*) # full svr4 only
59058fc2d0c6Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
59068fc2d0c6Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
59078fc2d0c6Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
59088fc2d0c6Smrg      shlibpath_overrides_runpath=yes
59098fc2d0c6Smrg      ;;
59108fc2d0c6Smrg    *,yes) # both, prefer svr4
59118fc2d0c6Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
59128fc2d0c6Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
59138fc2d0c6Smrg      # unpreferred sharedlib libNAME.a needs extra handling
59148fc2d0c6Smrg      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
59158fc2d0c6Smrg      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
59168fc2d0c6Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
59178fc2d0c6Smrg      shlibpath_overrides_runpath=yes
59188fc2d0c6Smrg      ;;
59198fc2d0c6Smrg    *,no) # both, prefer aix
59208fc2d0c6Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
59218fc2d0c6Smrg      library_names_spec='$libname$release.a $libname.a'
59228fc2d0c6Smrg      soname_spec='$libname$release$shared_ext$major'
59238fc2d0c6Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
59248fc2d0c6Smrg      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
59258fc2d0c6Smrg      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
59268fc2d0c6Smrg      ;;
59278fc2d0c6Smrg    esac
59288fc2d0c6Smrg    shlibpath_var=LIBPATH
59298fc2d0c6Smrg  fi
59308fc2d0c6Smrg  ;;
593154b44505Smrg
59328fc2d0c6Smrgamigaos*)
59338fc2d0c6Smrg  case $host_cpu in
59348fc2d0c6Smrg  powerpc)
59358fc2d0c6Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
59368fc2d0c6Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
59378fc2d0c6Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
59388fc2d0c6Smrg    ;;
59398fc2d0c6Smrg  m68k)
59408fc2d0c6Smrg    library_names_spec='$libname.ixlibrary $libname.a'
59418fc2d0c6Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
59428fc2d0c6Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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'
59438fc2d0c6Smrg    ;;
59448fc2d0c6Smrg  esac
59458fc2d0c6Smrg  ;;
594654b44505Smrg
59478fc2d0c6Smrgbeos*)
59488fc2d0c6Smrg  library_names_spec='$libname$shared_ext'
59498fc2d0c6Smrg  dynamic_linker="$host_os ld.so"
59508fc2d0c6Smrg  shlibpath_var=LIBRARY_PATH
59518fc2d0c6Smrg  ;;
595254b44505Smrg
59538fc2d0c6Smrgbsdi[[45]]*)
59548fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
59558fc2d0c6Smrg  need_version=no
59568fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
59578fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
59588fc2d0c6Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
59598fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
59608fc2d0c6Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
59618fc2d0c6Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
59628fc2d0c6Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
59638fc2d0c6Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
59648fc2d0c6Smrg  # libtool to hard-code these into programs
59658fc2d0c6Smrg  ;;
596654b44505Smrg
59678fc2d0c6Smrgcygwin* | mingw* | pw32* | cegcc*)
59688fc2d0c6Smrg  version_type=windows
59698fc2d0c6Smrg  shrext_cmds=.dll
59708fc2d0c6Smrg  need_version=no
59718fc2d0c6Smrg  need_lib_prefix=no
597254b44505Smrg
59738fc2d0c6Smrg  case $GCC,$cc_basename in
59748fc2d0c6Smrg  yes,*)
59758fc2d0c6Smrg    # gcc
59768fc2d0c6Smrg    library_names_spec='$libname.dll.a'
59778fc2d0c6Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
59788fc2d0c6Smrg    postinstall_cmds='base_file=`basename \$file`~
59798fc2d0c6Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
59808fc2d0c6Smrg      dldir=$destdir/`dirname \$dlpath`~
59818fc2d0c6Smrg      test -d \$dldir || mkdir -p \$dldir~
59828fc2d0c6Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
59838fc2d0c6Smrg      chmod a+x \$dldir/$dlname~
59848fc2d0c6Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
59858fc2d0c6Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
59868fc2d0c6Smrg      fi'
59878fc2d0c6Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
59888fc2d0c6Smrg      dlpath=$dir/\$dldll~
59898fc2d0c6Smrg       $RM \$dlpath'
59908fc2d0c6Smrg    shlibpath_overrides_runpath=yes
599154b44505Smrg
59928fc2d0c6Smrg    case $host_os in
59938fc2d0c6Smrg    cygwin*)
59948fc2d0c6Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
59958fc2d0c6Smrg      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
59968fc2d0c6Smrgm4_if([$1], [],[
59978fc2d0c6Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
59988fc2d0c6Smrg      ;;
59998fc2d0c6Smrg    mingw* | cegcc*)
60008fc2d0c6Smrg      # MinGW DLLs use traditional 'lib' prefix
60018fc2d0c6Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
60028fc2d0c6Smrg      ;;
60038fc2d0c6Smrg    pw32*)
60048fc2d0c6Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
60058fc2d0c6Smrg      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
60068fc2d0c6Smrg      ;;
60078fc2d0c6Smrg    esac
60088fc2d0c6Smrg    dynamic_linker='Win32 ld.exe'
60098fc2d0c6Smrg    ;;
601054b44505Smrg
60118fc2d0c6Smrg  *,cl* | *,icl*)
60128fc2d0c6Smrg    # Native MSVC or ICC
60138fc2d0c6Smrg    libname_spec='$name'
60148fc2d0c6Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
60158fc2d0c6Smrg    library_names_spec='$libname.dll.lib'
60164a041c5bSmacallan
60178fc2d0c6Smrg    case $build_os in
60188fc2d0c6Smrg    mingw*)
60198fc2d0c6Smrg      sys_lib_search_path_spec=
60208fc2d0c6Smrg      lt_save_ifs=$IFS
60218fc2d0c6Smrg      IFS=';'
60228fc2d0c6Smrg      for lt_path in $LIB
60238fc2d0c6Smrg      do
60248fc2d0c6Smrg        IFS=$lt_save_ifs
60258fc2d0c6Smrg        # Let DOS variable expansion print the short 8.3 style file name.
60268fc2d0c6Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
60278fc2d0c6Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
60288fc2d0c6Smrg      done
60298fc2d0c6Smrg      IFS=$lt_save_ifs
60308fc2d0c6Smrg      # Convert to MSYS style.
60318fc2d0c6Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
60328fc2d0c6Smrg      ;;
60338fc2d0c6Smrg    cygwin*)
60348fc2d0c6Smrg      # Convert to unix form, then to dos form, then back to unix form
60358fc2d0c6Smrg      # but this time dos style (no spaces!) so that the unix form looks
60368fc2d0c6Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
60378fc2d0c6Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
60388fc2d0c6Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
60398fc2d0c6Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
60408fc2d0c6Smrg      ;;
60418fc2d0c6Smrg    *)
60428fc2d0c6Smrg      sys_lib_search_path_spec=$LIB
60438fc2d0c6Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
60448fc2d0c6Smrg        # It is most probably a Windows format PATH.
60458fc2d0c6Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
60468fc2d0c6Smrg      else
60478fc2d0c6Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
60488fc2d0c6Smrg      fi
60498fc2d0c6Smrg      # FIXME: find the short name or the path components, as spaces are
60508fc2d0c6Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
60518fc2d0c6Smrg      ;;
60528fc2d0c6Smrg    esac
605354b44505Smrg
60548fc2d0c6Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
60558fc2d0c6Smrg    postinstall_cmds='base_file=`basename \$file`~
60568fc2d0c6Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
60578fc2d0c6Smrg      dldir=$destdir/`dirname \$dlpath`~
60588fc2d0c6Smrg      test -d \$dldir || mkdir -p \$dldir~
60598fc2d0c6Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
60608fc2d0c6Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
60618fc2d0c6Smrg      dlpath=$dir/\$dldll~
60628fc2d0c6Smrg       $RM \$dlpath'
60638fc2d0c6Smrg    shlibpath_overrides_runpath=yes
60648fc2d0c6Smrg    dynamic_linker='Win32 link.exe'
60658fc2d0c6Smrg    ;;
60664a041c5bSmacallan
60678fc2d0c6Smrg  *)
60688fc2d0c6Smrg    # Assume MSVC and ICC wrapper
60698fc2d0c6Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
60708fc2d0c6Smrg    dynamic_linker='Win32 ld.exe'
60718fc2d0c6Smrg    ;;
60728fc2d0c6Smrg  esac
60738fc2d0c6Smrg  # FIXME: first we should search . and the directory the executable is in
60748fc2d0c6Smrg  shlibpath_var=PATH
60758fc2d0c6Smrg  ;;
60764a041c5bSmacallan
60778fc2d0c6Smrgdarwin* | rhapsody*)
60788fc2d0c6Smrg  dynamic_linker="$host_os dyld"
60798fc2d0c6Smrg  version_type=darwin
60808fc2d0c6Smrg  need_lib_prefix=no
60818fc2d0c6Smrg  need_version=no
60828fc2d0c6Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
60838fc2d0c6Smrg  soname_spec='$libname$release$major$shared_ext'
60848fc2d0c6Smrg  shlibpath_overrides_runpath=yes
60858fc2d0c6Smrg  shlibpath_var=DYLD_LIBRARY_PATH
60868fc2d0c6Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
60878fc2d0c6Smrgm4_if([$1], [],[
60888fc2d0c6Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
60898fc2d0c6Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
60908fc2d0c6Smrg  ;;
60914a041c5bSmacallan
60928fc2d0c6Smrgdgux*)
60938fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
60948fc2d0c6Smrg  need_lib_prefix=no
60958fc2d0c6Smrg  need_version=no
60968fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
60978fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
60988fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
60998fc2d0c6Smrg  ;;
610054b44505Smrg
61018fc2d0c6Smrgfreebsd* | dragonfly* | midnightbsd*)
61028fc2d0c6Smrg  # DragonFly does not have aout.  When/if they implement a new
61038fc2d0c6Smrg  # versioning mechanism, adjust this.
61048fc2d0c6Smrg  if test -x /usr/bin/objformat; then
61058fc2d0c6Smrg    objformat=`/usr/bin/objformat`
61068fc2d0c6Smrg  else
61078fc2d0c6Smrg    case $host_os in
61088fc2d0c6Smrg    freebsd[[23]].*) objformat=aout ;;
61098fc2d0c6Smrg    *) objformat=elf ;;
61108fc2d0c6Smrg    esac
61118fc2d0c6Smrg  fi
61128fc2d0c6Smrg  version_type=freebsd-$objformat
61138fc2d0c6Smrg  case $version_type in
61148fc2d0c6Smrg    freebsd-elf*)
61158fc2d0c6Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
61168fc2d0c6Smrg      soname_spec='$libname$release$shared_ext$major'
61178fc2d0c6Smrg      need_version=no
61188fc2d0c6Smrg      need_lib_prefix=no
61198fc2d0c6Smrg      ;;
61208fc2d0c6Smrg    freebsd-*)
61218fc2d0c6Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
61228fc2d0c6Smrg      need_version=yes
61238fc2d0c6Smrg      ;;
61248fc2d0c6Smrg  esac
61258fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
61268fc2d0c6Smrg  case $host_os in
61278fc2d0c6Smrg  freebsd2.*)
61288fc2d0c6Smrg    shlibpath_overrides_runpath=yes
61298fc2d0c6Smrg    ;;
61308fc2d0c6Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
61318fc2d0c6Smrg    shlibpath_overrides_runpath=yes
61328fc2d0c6Smrg    hardcode_into_libs=yes
61338fc2d0c6Smrg    ;;
61348fc2d0c6Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
61358fc2d0c6Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
61368fc2d0c6Smrg    shlibpath_overrides_runpath=no
61378fc2d0c6Smrg    hardcode_into_libs=yes
61388fc2d0c6Smrg    ;;
61398fc2d0c6Smrg  *) # from 4.6 on, and DragonFly
61408fc2d0c6Smrg    shlibpath_overrides_runpath=yes
61418fc2d0c6Smrg    hardcode_into_libs=yes
61428fc2d0c6Smrg    ;;
61438fc2d0c6Smrg  esac
61448fc2d0c6Smrg  ;;
614554b44505Smrg
61468fc2d0c6Smrghaiku*)
61478fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
61488fc2d0c6Smrg  need_lib_prefix=no
61498fc2d0c6Smrg  need_version=no
61508fc2d0c6Smrg  dynamic_linker="$host_os runtime_loader"
61518fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
61528fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
61538fc2d0c6Smrg  shlibpath_var=LIBRARY_PATH
61548fc2d0c6Smrg  shlibpath_overrides_runpath=no
61558fc2d0c6Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
61568fc2d0c6Smrg  hardcode_into_libs=yes
61578fc2d0c6Smrg  ;;
615854b44505Smrg
61598fc2d0c6Smrghpux9* | hpux10* | hpux11*)
61608fc2d0c6Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
61618fc2d0c6Smrg  # link against other versions.
61628fc2d0c6Smrg  version_type=sunos
61638fc2d0c6Smrg  need_lib_prefix=no
61648fc2d0c6Smrg  need_version=no
61658fc2d0c6Smrg  case $host_cpu in
61668fc2d0c6Smrg  ia64*)
61678fc2d0c6Smrg    shrext_cmds='.so'
61688fc2d0c6Smrg    hardcode_into_libs=yes
61698fc2d0c6Smrg    dynamic_linker="$host_os dld.so"
61708fc2d0c6Smrg    shlibpath_var=LD_LIBRARY_PATH
61718fc2d0c6Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
61728fc2d0c6Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
61738fc2d0c6Smrg    soname_spec='$libname$release$shared_ext$major'
61748fc2d0c6Smrg    if test 32 = "$HPUX_IA64_MODE"; then
61758fc2d0c6Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
61768fc2d0c6Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
61778fc2d0c6Smrg    else
61788fc2d0c6Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
61798fc2d0c6Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
61808fc2d0c6Smrg    fi
61818fc2d0c6Smrg    ;;
61828fc2d0c6Smrg  hppa*64*)
61838fc2d0c6Smrg    shrext_cmds='.sl'
61848fc2d0c6Smrg    hardcode_into_libs=yes
61858fc2d0c6Smrg    dynamic_linker="$host_os dld.sl"
61868fc2d0c6Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
61878fc2d0c6Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
61888fc2d0c6Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
61898fc2d0c6Smrg    soname_spec='$libname$release$shared_ext$major'
61908fc2d0c6Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
61918fc2d0c6Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
61928fc2d0c6Smrg    ;;
61938fc2d0c6Smrg  *)
61948fc2d0c6Smrg    shrext_cmds='.sl'
61958fc2d0c6Smrg    dynamic_linker="$host_os dld.sl"
61968fc2d0c6Smrg    shlibpath_var=SHLIB_PATH
61978fc2d0c6Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
61988fc2d0c6Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
61998fc2d0c6Smrg    soname_spec='$libname$release$shared_ext$major'
62008fc2d0c6Smrg    ;;
62018fc2d0c6Smrg  esac
62028fc2d0c6Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
62038fc2d0c6Smrg  postinstall_cmds='chmod 555 $lib'
62048fc2d0c6Smrg  # or fails outright, so override atomically:
62058fc2d0c6Smrg  install_override_mode=555
62068fc2d0c6Smrg  ;;
62074a041c5bSmacallan
62088fc2d0c6Smrginterix[[3-9]]*)
62098fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
62108fc2d0c6Smrg  need_lib_prefix=no
62118fc2d0c6Smrg  need_version=no
62128fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
62138fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
62148fc2d0c6Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
62158fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
62168fc2d0c6Smrg  shlibpath_overrides_runpath=no
62178fc2d0c6Smrg  hardcode_into_libs=yes
62188fc2d0c6Smrg  ;;
62194a041c5bSmacallan
62208fc2d0c6Smrgirix5* | irix6* | nonstopux*)
62218fc2d0c6Smrg  case $host_os in
62228fc2d0c6Smrg    nonstopux*) version_type=nonstopux ;;
62238fc2d0c6Smrg    *)
62248fc2d0c6Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
62258fc2d0c6Smrg		version_type=linux # correct to gnu/linux during the next big refactor
62268fc2d0c6Smrg	else
62278fc2d0c6Smrg		version_type=irix
62288fc2d0c6Smrg	fi ;;
62298fc2d0c6Smrg  esac
62308fc2d0c6Smrg  need_lib_prefix=no
62318fc2d0c6Smrg  need_version=no
62328fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
62338fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
62348fc2d0c6Smrg  case $host_os in
62358fc2d0c6Smrg  irix5* | nonstopux*)
62368fc2d0c6Smrg    libsuff= shlibsuff=
62378fc2d0c6Smrg    ;;
62388fc2d0c6Smrg  *)
62398fc2d0c6Smrg    case $LD in # libtool.m4 will add one of these switches to LD
62408fc2d0c6Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
62418fc2d0c6Smrg      libsuff= shlibsuff= libmagic=32-bit;;
62428fc2d0c6Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
62438fc2d0c6Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
62448fc2d0c6Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
62458fc2d0c6Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
62468fc2d0c6Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
62478fc2d0c6Smrg    esac
62488fc2d0c6Smrg    ;;
62498fc2d0c6Smrg  esac
62508fc2d0c6Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
62518fc2d0c6Smrg  shlibpath_overrides_runpath=no
62528fc2d0c6Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
62538fc2d0c6Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
62548fc2d0c6Smrg  hardcode_into_libs=yes
62558fc2d0c6Smrg  ;;
62564a041c5bSmacallan
62578fc2d0c6Smrg# No shared lib support for Linux oldld, aout, or coff.
62588fc2d0c6Smrglinux*oldld* | linux*aout* | linux*coff*)
62598fc2d0c6Smrg  dynamic_linker=no
62608fc2d0c6Smrg  ;;
62614a041c5bSmacallan
62628fc2d0c6Smrglinux*android*)
62638fc2d0c6Smrg  version_type=none # Android doesn't support versioned libraries.
62648fc2d0c6Smrg  need_lib_prefix=no
62658fc2d0c6Smrg  need_version=no
62668fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext'
62678fc2d0c6Smrg  soname_spec='$libname$release$shared_ext'
62688fc2d0c6Smrg  finish_cmds=
62698fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
62708fc2d0c6Smrg  shlibpath_overrides_runpath=yes
62714a041c5bSmacallan
62728fc2d0c6Smrg  # This implies no fast_install, which is unacceptable.
62738fc2d0c6Smrg  # Some rework will be needed to allow for fast_install
62748fc2d0c6Smrg  # before this can be enabled.
62758fc2d0c6Smrg  hardcode_into_libs=yes
62764a041c5bSmacallan
62778fc2d0c6Smrg  dynamic_linker='Android linker'
62788fc2d0c6Smrg  # Don't embed -rpath directories since the linker doesn't support them.
62798fc2d0c6Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
62808fc2d0c6Smrg  ;;
62814a041c5bSmacallan
62828fc2d0c6Smrg# This must be glibc/ELF.
62838fc2d0c6Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
62848fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
62858fc2d0c6Smrg  need_lib_prefix=no
62868fc2d0c6Smrg  need_version=no
62878fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
62888fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
62898fc2d0c6Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
62908fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
62918fc2d0c6Smrg  shlibpath_overrides_runpath=no
629254b44505Smrg
62938fc2d0c6Smrg  # Some binutils ld are patched to set DT_RUNPATH
62948fc2d0c6Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
62958fc2d0c6Smrg    [lt_cv_shlibpath_overrides_runpath=no
62968fc2d0c6Smrg    save_LDFLAGS=$LDFLAGS
62978fc2d0c6Smrg    save_libdir=$libdir
62988fc2d0c6Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
62998fc2d0c6Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
63008fc2d0c6Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
63018fc2d0c6Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
63028fc2d0c6Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
63038fc2d0c6Smrg    LDFLAGS=$save_LDFLAGS
63048fc2d0c6Smrg    libdir=$save_libdir
63058fc2d0c6Smrg    ])
63068fc2d0c6Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
630754b44505Smrg
63088fc2d0c6Smrg  # This implies no fast_install, which is unacceptable.
63098fc2d0c6Smrg  # Some rework will be needed to allow for fast_install
63108fc2d0c6Smrg  # before this can be enabled.
63118fc2d0c6Smrg  hardcode_into_libs=yes
631254b44505Smrg
63138fc2d0c6Smrg  # Ideally, we could use ldconfig to report *all* directores which are
63148fc2d0c6Smrg  # searched for libraries, however this is still not possible.  Aside from not
63158fc2d0c6Smrg  # being certain /sbin/ldconfig is available, command
63168fc2d0c6Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
63178fc2d0c6Smrg  # even though it is searched at run-time.  Try to do the best guess by
63188fc2d0c6Smrg  # appending ld.so.conf contents (and includes) to the search path.
63198fc2d0c6Smrg  if test -f /etc/ld.so.conf; then
63208fc2d0c6Smrg    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' ' '`
63218fc2d0c6Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
63228fc2d0c6Smrg  fi
632354b44505Smrg
63248fc2d0c6Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
63258fc2d0c6Smrg  # powerpc, because MkLinux only supported shared libraries with the
63268fc2d0c6Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
63278fc2d0c6Smrg  # most powerpc-linux boxes support dynamic linking these days and
63288fc2d0c6Smrg  # people can always --disable-shared, the test was removed, and we
63298fc2d0c6Smrg  # assume the GNU/Linux dynamic linker is in use.
63308fc2d0c6Smrg  dynamic_linker='GNU/Linux ld.so'
63318fc2d0c6Smrg  ;;
63324a041c5bSmacallan
63338fc2d0c6Smrgnetbsd*)
63348fc2d0c6Smrg  version_type=sunos
63358fc2d0c6Smrg  need_lib_prefix=no
63368fc2d0c6Smrg  need_version=no
63378fc2d0c6Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
63388fc2d0c6Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
63398fc2d0c6Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
63408fc2d0c6Smrg    dynamic_linker='NetBSD (a.out) ld.so'
63418fc2d0c6Smrg  else
63428fc2d0c6Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
63438fc2d0c6Smrg    soname_spec='$libname$release$shared_ext$major'
63448fc2d0c6Smrg    dynamic_linker='NetBSD ld.elf_so'
63458fc2d0c6Smrg  fi
63468fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
63478fc2d0c6Smrg  shlibpath_overrides_runpath=yes
63488fc2d0c6Smrg  hardcode_into_libs=yes
63498fc2d0c6Smrg  ;;
63504a041c5bSmacallan
63518fc2d0c6Smrgnewsos6)
63528fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
63538fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
63548fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
63558fc2d0c6Smrg  shlibpath_overrides_runpath=yes
63568fc2d0c6Smrg  ;;
63574a041c5bSmacallan
63588fc2d0c6Smrg*nto* | *qnx*)
63598fc2d0c6Smrg  version_type=qnx
63608fc2d0c6Smrg  need_lib_prefix=no
63618fc2d0c6Smrg  need_version=no
63628fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
63638fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
63648fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
63658fc2d0c6Smrg  shlibpath_overrides_runpath=no
63668fc2d0c6Smrg  hardcode_into_libs=yes
63678fc2d0c6Smrg  dynamic_linker='ldqnx.so'
63688fc2d0c6Smrg  ;;
63694a041c5bSmacallan
63708fc2d0c6Smrgopenbsd* | bitrig*)
63718fc2d0c6Smrg  version_type=sunos
63728fc2d0c6Smrg  sys_lib_dlsearch_path_spec=/usr/lib
63738fc2d0c6Smrg  need_lib_prefix=no
63748fc2d0c6Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
63758fc2d0c6Smrg    need_version=no
63768fc2d0c6Smrg  else
63778fc2d0c6Smrg    need_version=yes
63788fc2d0c6Smrg  fi
63798fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
63808fc2d0c6Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
63818fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
63828fc2d0c6Smrg  shlibpath_overrides_runpath=yes
63838fc2d0c6Smrg  ;;
63840a392d7eSmrg
63858fc2d0c6Smrgos2*)
63868fc2d0c6Smrg  libname_spec='$name'
63878fc2d0c6Smrg  version_type=windows
63888fc2d0c6Smrg  shrext_cmds=.dll
63898fc2d0c6Smrg  need_version=no
63908fc2d0c6Smrg  need_lib_prefix=no
63918fc2d0c6Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
63928fc2d0c6Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
63938fc2d0c6Smrg    v=$($ECHO $release$versuffix | tr -d .-);
63948fc2d0c6Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
63958fc2d0c6Smrg    $ECHO $n$v`$shared_ext'
63968fc2d0c6Smrg  library_names_spec='${libname}_dll.$libext'
63978fc2d0c6Smrg  dynamic_linker='OS/2 ld.exe'
63988fc2d0c6Smrg  shlibpath_var=BEGINLIBPATH
63998fc2d0c6Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
64008fc2d0c6Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
64018fc2d0c6Smrg  postinstall_cmds='base_file=`basename \$file`~
64028fc2d0c6Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
64038fc2d0c6Smrg    dldir=$destdir/`dirname \$dlpath`~
64048fc2d0c6Smrg    test -d \$dldir || mkdir -p \$dldir~
64058fc2d0c6Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
64068fc2d0c6Smrg    chmod a+x \$dldir/$dlname~
64078fc2d0c6Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
64088fc2d0c6Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
64098fc2d0c6Smrg    fi'
64108fc2d0c6Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
64118fc2d0c6Smrg    dlpath=$dir/\$dldll~
64128fc2d0c6Smrg    $RM \$dlpath'
64138fc2d0c6Smrg  ;;
64144a041c5bSmacallan
64158fc2d0c6Smrgosf3* | osf4* | osf5*)
64168fc2d0c6Smrg  version_type=osf
64178fc2d0c6Smrg  need_lib_prefix=no
64188fc2d0c6Smrg  need_version=no
64198fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
64208fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
64218fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
64228fc2d0c6Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
64238fc2d0c6Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
64248fc2d0c6Smrg  ;;
64254a041c5bSmacallan
64268fc2d0c6Smrgrdos*)
64278fc2d0c6Smrg  dynamic_linker=no
64288fc2d0c6Smrg  ;;
64294a041c5bSmacallan
64308fc2d0c6Smrgsolaris*)
64318fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
64328fc2d0c6Smrg  need_lib_prefix=no
64338fc2d0c6Smrg  need_version=no
64348fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
64358fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
64368fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
64378fc2d0c6Smrg  shlibpath_overrides_runpath=yes
64388fc2d0c6Smrg  hardcode_into_libs=yes
64398fc2d0c6Smrg  # ldd complains unless libraries are executable
64408fc2d0c6Smrg  postinstall_cmds='chmod +x $lib'
64418fc2d0c6Smrg  ;;
64424a041c5bSmacallan
64438fc2d0c6Smrgsunos4*)
64448fc2d0c6Smrg  version_type=sunos
64458fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
64468fc2d0c6Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
64478fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
64488fc2d0c6Smrg  shlibpath_overrides_runpath=yes
64498fc2d0c6Smrg  if test yes = "$with_gnu_ld"; then
64508fc2d0c6Smrg    need_lib_prefix=no
64518fc2d0c6Smrg  fi
64528fc2d0c6Smrg  need_version=yes
64538fc2d0c6Smrg  ;;
64544a041c5bSmacallan
64558fc2d0c6Smrgsysv4 | sysv4.3*)
64568fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
64578fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
64588fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
64598fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
64608fc2d0c6Smrg  case $host_vendor in
64618fc2d0c6Smrg    sni)
64628fc2d0c6Smrg      shlibpath_overrides_runpath=no
64638fc2d0c6Smrg      need_lib_prefix=no
64648fc2d0c6Smrg      runpath_var=LD_RUN_PATH
64658fc2d0c6Smrg      ;;
64668fc2d0c6Smrg    siemens)
64678fc2d0c6Smrg      need_lib_prefix=no
64688fc2d0c6Smrg      ;;
64698fc2d0c6Smrg    motorola)
64708fc2d0c6Smrg      need_lib_prefix=no
64718fc2d0c6Smrg      need_version=no
64728fc2d0c6Smrg      shlibpath_overrides_runpath=no
64738fc2d0c6Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
64748fc2d0c6Smrg      ;;
64758fc2d0c6Smrg  esac
64768fc2d0c6Smrg  ;;
64774a041c5bSmacallan
64788fc2d0c6Smrgsysv4*MP*)
64798fc2d0c6Smrg  if test -d /usr/nec; then
64808fc2d0c6Smrg    version_type=linux # correct to gnu/linux during the next big refactor
64818fc2d0c6Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
64828fc2d0c6Smrg    soname_spec='$libname$shared_ext.$major'
64838fc2d0c6Smrg    shlibpath_var=LD_LIBRARY_PATH
64848fc2d0c6Smrg  fi
64858fc2d0c6Smrg  ;;
64864a041c5bSmacallan
64878fc2d0c6Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
64888fc2d0c6Smrg  version_type=sco
64898fc2d0c6Smrg  need_lib_prefix=no
64908fc2d0c6Smrg  need_version=no
64918fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
64928fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
64938fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
64948fc2d0c6Smrg  shlibpath_overrides_runpath=yes
64958fc2d0c6Smrg  hardcode_into_libs=yes
64968fc2d0c6Smrg  if test yes = "$with_gnu_ld"; then
64978fc2d0c6Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
64988fc2d0c6Smrg  else
64998fc2d0c6Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
65008fc2d0c6Smrg    case $host_os in
65018fc2d0c6Smrg      sco3.2v5*)
65028fc2d0c6Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
65038fc2d0c6Smrg	;;
650454b44505Smrg    esac
65058fc2d0c6Smrg  fi
65068fc2d0c6Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
65078fc2d0c6Smrg  ;;
65084a041c5bSmacallan
65098fc2d0c6Smrgtpf*)
65108fc2d0c6Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
65118fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
65128fc2d0c6Smrg  need_lib_prefix=no
65138fc2d0c6Smrg  need_version=no
65148fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
65158fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
65168fc2d0c6Smrg  shlibpath_overrides_runpath=no
65178fc2d0c6Smrg  hardcode_into_libs=yes
65188fc2d0c6Smrg  ;;
65194a041c5bSmacallan
65208fc2d0c6Smrguts4*)
65218fc2d0c6Smrg  version_type=linux # correct to gnu/linux during the next big refactor
65228fc2d0c6Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
65238fc2d0c6Smrg  soname_spec='$libname$release$shared_ext$major'
65248fc2d0c6Smrg  shlibpath_var=LD_LIBRARY_PATH
65258fc2d0c6Smrg  ;;
65264a041c5bSmacallan
65278fc2d0c6Smrg*)
65288fc2d0c6Smrg  dynamic_linker=no
652954b44505Smrg  ;;
653054b44505Smrgesac
65318fc2d0c6SmrgAC_MSG_RESULT([$dynamic_linker])
65328fc2d0c6Smrgtest no = "$dynamic_linker" && can_build_shared=no
65334a041c5bSmacallan
65348fc2d0c6Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
65358fc2d0c6Smrgif test yes = "$GCC"; then
65368fc2d0c6Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
653754b44505Smrgfi
653854b44505Smrg
65398fc2d0c6Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
65408fc2d0c6Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
654154b44505Smrgfi
65424a041c5bSmacallan
65438fc2d0c6Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
65448fc2d0c6Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
65458fc2d0c6Smrgfi
65464a041c5bSmacallan
65478fc2d0c6Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
65488fc2d0c6Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
65494a041c5bSmacallan
65508fc2d0c6Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
65518fc2d0c6Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
655254b44505Smrg
65538fc2d0c6Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
65548fc2d0c6Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
65554a041c5bSmacallan
65568fc2d0c6Smrg_LT_DECL([], [variables_saved_for_relink], [1],
65578fc2d0c6Smrg    [Variables whose values should be saved in libtool wrapper scripts and
65588fc2d0c6Smrg    restored at link time])
65598fc2d0c6Smrg_LT_DECL([], [need_lib_prefix], [0],
65608fc2d0c6Smrg    [Do we need the "lib" prefix for modules?])
65618fc2d0c6Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
65628fc2d0c6Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
65638fc2d0c6Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
65648fc2d0c6Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
65658fc2d0c6Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
65668fc2d0c6Smrg    [Is shlibpath searched before the hard-coded library search path?])
65678fc2d0c6Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
65688fc2d0c6Smrg_LT_DECL([], [library_names_spec], [1],
65698fc2d0c6Smrg    [[List of archive names.  First name is the real one, the rest are links.
65708fc2d0c6Smrg    The last name is the one that the linker finds with -lNAME]])
65718fc2d0c6Smrg_LT_DECL([], [soname_spec], [1],
65728fc2d0c6Smrg    [[The coded name of the library, if different from the real name]])
65738fc2d0c6Smrg_LT_DECL([], [install_override_mode], [1],
65748fc2d0c6Smrg    [Permission mode override for installation of shared libraries])
65758fc2d0c6Smrg_LT_DECL([], [postinstall_cmds], [2],
65768fc2d0c6Smrg    [Command to use after installation of a shared archive])
65778fc2d0c6Smrg_LT_DECL([], [postuninstall_cmds], [2],
65788fc2d0c6Smrg    [Command to use after uninstallation of a shared archive])
65798fc2d0c6Smrg_LT_DECL([], [finish_cmds], [2],
65808fc2d0c6Smrg    [Commands used to finish a libtool library installation in a directory])
65818fc2d0c6Smrg_LT_DECL([], [finish_eval], [1],
65828fc2d0c6Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
65838fc2d0c6Smrg    not shown]])
65848fc2d0c6Smrg_LT_DECL([], [hardcode_into_libs], [0],
65858fc2d0c6Smrg    [Whether we should hardcode library paths into libraries])
65868fc2d0c6Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
65878fc2d0c6Smrg    [Compile-time system search path for libraries])
65888fc2d0c6Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
65898fc2d0c6Smrg    [Detected run-time system search path for libraries])
65908fc2d0c6Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
65918fc2d0c6Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
65928fc2d0c6Smrg])# _LT_SYS_DYNAMIC_LINKER
65934a041c5bSmacallan
659454b44505Smrg
65958fc2d0c6Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
65968fc2d0c6Smrg# --------------------------
65978fc2d0c6Smrg# find a file program that can recognize shared library
65988fc2d0c6SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
65998fc2d0c6Smrg[m4_require([_LT_DECL_EGREP])dnl
66008fc2d0c6SmrgAC_MSG_CHECKING([for $1])
66018fc2d0c6SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
66028fc2d0c6Smrg[case $MAGIC_CMD in
66038fc2d0c6Smrg[[\\/*] |  ?:[\\/]*])
66048fc2d0c6Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
66058fc2d0c6Smrg  ;;
66068fc2d0c6Smrg*)
66078fc2d0c6Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
66088fc2d0c6Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
66098fc2d0c6Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
66108fc2d0c6Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
66118fc2d0c6Smrgdnl not every word.  This closes a longstanding sh security hole.
66128fc2d0c6Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
66138fc2d0c6Smrg  for ac_dir in $ac_dummy; do
66148fc2d0c6Smrg    IFS=$lt_save_ifs
66158fc2d0c6Smrg    test -z "$ac_dir" && ac_dir=.
66168fc2d0c6Smrg    if test -f "$ac_dir/$1"; then
66178fc2d0c6Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
66188fc2d0c6Smrg      if test -n "$file_magic_test_file"; then
66198fc2d0c6Smrg	case $deplibs_check_method in
66208fc2d0c6Smrg	"file_magic "*)
66218fc2d0c6Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
66228fc2d0c6Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
66238fc2d0c6Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
66248fc2d0c6Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
66258fc2d0c6Smrg	    :
66268fc2d0c6Smrg	  else
66278fc2d0c6Smrg	    cat <<_LT_EOF 1>&2
662854b44505Smrg
66298fc2d0c6Smrg*** Warning: the command libtool uses to detect shared libraries,
66308fc2d0c6Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
66318fc2d0c6Smrg*** The result is that libtool may fail to recognize shared libraries
66328fc2d0c6Smrg*** as such.  This will affect the creation of libtool libraries that
66338fc2d0c6Smrg*** depend on shared libraries, but programs linked with such libtool
66348fc2d0c6Smrg*** libraries will work regardless of this problem.  Nevertheless, you
66358fc2d0c6Smrg*** may want to report the problem to your system manager and/or to
66368fc2d0c6Smrg*** bug-libtool@gnu.org
66374a041c5bSmacallan
66388fc2d0c6Smrg_LT_EOF
66398fc2d0c6Smrg	  fi ;;
66408fc2d0c6Smrg	esac
66418fc2d0c6Smrg      fi
66428fc2d0c6Smrg      break
66438fc2d0c6Smrg    fi
66448fc2d0c6Smrg  done
66458fc2d0c6Smrg  IFS=$lt_save_ifs
66468fc2d0c6Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
66478fc2d0c6Smrg  ;;
66488fc2d0c6Smrgesac])
66498fc2d0c6SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
66508fc2d0c6Smrgif test -n "$MAGIC_CMD"; then
66518fc2d0c6Smrg  AC_MSG_RESULT($MAGIC_CMD)
66528fc2d0c6Smrgelse
66538fc2d0c6Smrg  AC_MSG_RESULT(no)
66548fc2d0c6Smrgfi
66558fc2d0c6Smrg_LT_DECL([], [MAGIC_CMD], [0],
66568fc2d0c6Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
66578fc2d0c6Smrg])# _LT_PATH_TOOL_PREFIX
66584a041c5bSmacallan
66598fc2d0c6Smrg# Old name:
66608fc2d0c6SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
66618fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
66628fc2d0c6Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
666354b44505Smrg
666454b44505Smrg
66658fc2d0c6Smrg# _LT_PATH_MAGIC
66668fc2d0c6Smrg# --------------
66678fc2d0c6Smrg# find a file program that can recognize a shared library
66688fc2d0c6Smrgm4_defun([_LT_PATH_MAGIC],
66698fc2d0c6Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
66708fc2d0c6Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
66718fc2d0c6Smrg  if test -n "$ac_tool_prefix"; then
66728fc2d0c6Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
66738fc2d0c6Smrg  else
66748fc2d0c6Smrg    MAGIC_CMD=:
66758fc2d0c6Smrg  fi
66768fc2d0c6Smrgfi
66778fc2d0c6Smrg])# _LT_PATH_MAGIC
667854b44505Smrg
667954b44505Smrg
66808fc2d0c6Smrg# LT_PATH_LD
66818fc2d0c6Smrg# ----------
66828fc2d0c6Smrg# find the pathname to the GNU or non-GNU linker
66838fc2d0c6SmrgAC_DEFUN([LT_PATH_LD],
66848fc2d0c6Smrg[AC_REQUIRE([AC_PROG_CC])dnl
66858fc2d0c6SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
66868fc2d0c6SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
66878fc2d0c6Smrgm4_require([_LT_DECL_SED])dnl
66888fc2d0c6Smrgm4_require([_LT_DECL_EGREP])dnl
66898fc2d0c6Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
669054b44505Smrg
66918fc2d0c6SmrgAC_ARG_WITH([gnu-ld],
66928fc2d0c6Smrg    [AS_HELP_STRING([--with-gnu-ld],
66938fc2d0c6Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
66948fc2d0c6Smrg    [test no = "$withval" || with_gnu_ld=yes],
66958fc2d0c6Smrg    [with_gnu_ld=no])dnl
66964a041c5bSmacallan
66978fc2d0c6Smrgac_prog=ld
66988fc2d0c6Smrgif test yes = "$GCC"; then
66998fc2d0c6Smrg  # Check if gcc -print-prog-name=ld gives a path.
67008fc2d0c6Smrg  AC_MSG_CHECKING([for ld used by $CC])
67018fc2d0c6Smrg  case $host in
67028fc2d0c6Smrg  *-*-mingw*)
67038fc2d0c6Smrg    # gcc leaves a trailing carriage return, which upsets mingw
67048fc2d0c6Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
67058fc2d0c6Smrg  *)
67068fc2d0c6Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
67078fc2d0c6Smrg  esac
67088fc2d0c6Smrg  case $ac_prog in
67098fc2d0c6Smrg    # Accept absolute paths.
67108fc2d0c6Smrg    [[\\/]]* | ?:[[\\/]]*)
67118fc2d0c6Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
67128fc2d0c6Smrg      # Canonicalize the pathname of ld
67138fc2d0c6Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
67148fc2d0c6Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
67158fc2d0c6Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
67168fc2d0c6Smrg      done
67178fc2d0c6Smrg      test -z "$LD" && LD=$ac_prog
67188fc2d0c6Smrg      ;;
67198fc2d0c6Smrg  "")
67208fc2d0c6Smrg    # If it fails, then pretend we aren't using GCC.
67218fc2d0c6Smrg    ac_prog=ld
67228fc2d0c6Smrg    ;;
67238fc2d0c6Smrg  *)
67248fc2d0c6Smrg    # If it is relative, then search for the first ld in PATH.
67258fc2d0c6Smrg    with_gnu_ld=unknown
67268fc2d0c6Smrg    ;;
67278fc2d0c6Smrg  esac
67288fc2d0c6Smrgelif test yes = "$with_gnu_ld"; then
67298fc2d0c6Smrg  AC_MSG_CHECKING([for GNU ld])
67308fc2d0c6Smrgelse
67318fc2d0c6Smrg  AC_MSG_CHECKING([for non-GNU ld])
67328fc2d0c6Smrgfi
67338fc2d0c6SmrgAC_CACHE_VAL(lt_cv_path_LD,
67348fc2d0c6Smrg[if test -z "$LD"; then
67358fc2d0c6Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
67368fc2d0c6Smrg  for ac_dir in $PATH; do
67378fc2d0c6Smrg    IFS=$lt_save_ifs
67388fc2d0c6Smrg    test -z "$ac_dir" && ac_dir=.
67398fc2d0c6Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
67408fc2d0c6Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
67418fc2d0c6Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
67428fc2d0c6Smrg      # but apparently some variants of GNU ld only accept -v.
67438fc2d0c6Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
67448fc2d0c6Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
67458fc2d0c6Smrg      *GNU* | *'with BFD'*)
67468fc2d0c6Smrg	test no != "$with_gnu_ld" && break
67478fc2d0c6Smrg	;;
67488fc2d0c6Smrg      *)
67498fc2d0c6Smrg	test yes != "$with_gnu_ld" && break
67508fc2d0c6Smrg	;;
67518fc2d0c6Smrg      esac
67528fc2d0c6Smrg    fi
67538fc2d0c6Smrg  done
67548fc2d0c6Smrg  IFS=$lt_save_ifs
67558fc2d0c6Smrgelse
67568fc2d0c6Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
67578fc2d0c6Smrgfi])
67588fc2d0c6SmrgLD=$lt_cv_path_LD
67598fc2d0c6Smrgif test -n "$LD"; then
67608fc2d0c6Smrg  AC_MSG_RESULT($LD)
67618fc2d0c6Smrgelse
67628fc2d0c6Smrg  AC_MSG_RESULT(no)
67638fc2d0c6Smrgfi
67648fc2d0c6Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
67658fc2d0c6Smrg_LT_PATH_LD_GNU
67668fc2d0c6SmrgAC_SUBST([LD])
67674a041c5bSmacallan
67688fc2d0c6Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
67698fc2d0c6Smrg])# LT_PATH_LD
67704a041c5bSmacallan
67718fc2d0c6Smrg# Old names:
67728fc2d0c6SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
67738fc2d0c6SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
67748fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
67758fc2d0c6Smrgdnl AC_DEFUN([AM_PROG_LD], [])
67768fc2d0c6Smrgdnl AC_DEFUN([AC_PROG_LD], [])
677754b44505Smrg
67784a041c5bSmacallan
67798fc2d0c6Smrg# _LT_PATH_LD_GNU
67808fc2d0c6Smrg#- --------------
67818fc2d0c6Smrgm4_defun([_LT_PATH_LD_GNU],
67828fc2d0c6Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
67838fc2d0c6Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
67848fc2d0c6Smrgcase `$LD -v 2>&1 </dev/null` in
67858fc2d0c6Smrg*GNU* | *'with BFD'*)
67868fc2d0c6Smrg  lt_cv_prog_gnu_ld=yes
67878fc2d0c6Smrg  ;;
67888fc2d0c6Smrg*)
67898fc2d0c6Smrg  lt_cv_prog_gnu_ld=no
67908fc2d0c6Smrg  ;;
67918fc2d0c6Smrgesac])
67928fc2d0c6Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
67938fc2d0c6Smrg])# _LT_PATH_LD_GNU
679454b44505Smrg
679554b44505Smrg
67968fc2d0c6Smrg# _LT_CMD_RELOAD
67978fc2d0c6Smrg# --------------
67988fc2d0c6Smrg# find reload flag for linker
67998fc2d0c6Smrg#   -- PORTME Some linkers may need a different reload flag.
68008fc2d0c6Smrgm4_defun([_LT_CMD_RELOAD],
68018fc2d0c6Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
68028fc2d0c6Smrg  lt_cv_ld_reload_flag,
68038fc2d0c6Smrg  [lt_cv_ld_reload_flag='-r'])
68048fc2d0c6Smrgreload_flag=$lt_cv_ld_reload_flag
68058fc2d0c6Smrgcase $reload_flag in
68068fc2d0c6Smrg"" | " "*) ;;
68078fc2d0c6Smrg*) reload_flag=" $reload_flag" ;;
68088fc2d0c6Smrgesac
68098fc2d0c6Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
68108fc2d0c6Smrgcase $host_os in
68118fc2d0c6Smrg  cygwin* | mingw* | pw32* | cegcc*)
68128fc2d0c6Smrg    if test yes != "$GCC"; then
68138fc2d0c6Smrg      reload_cmds=false
68148fc2d0c6Smrg    fi
68158fc2d0c6Smrg    ;;
68168fc2d0c6Smrg  darwin*)
68178fc2d0c6Smrg    if test yes = "$GCC"; then
68188fc2d0c6Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
68198fc2d0c6Smrg    else
68208fc2d0c6Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
68218fc2d0c6Smrg    fi
68228fc2d0c6Smrg    ;;
68238fc2d0c6Smrgesac
68248fc2d0c6Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
68258fc2d0c6Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
68268fc2d0c6Smrg])# _LT_CMD_RELOAD
682754b44505Smrg
68284a041c5bSmacallan
68298fc2d0c6Smrg# _LT_PATH_DD
68308fc2d0c6Smrg# -----------
68318fc2d0c6Smrg# find a working dd
68328fc2d0c6Smrgm4_defun([_LT_PATH_DD],
68338fc2d0c6Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
68348fc2d0c6Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
68358fc2d0c6Smrgcat conftest.i conftest.i >conftest2.i
68368fc2d0c6Smrg: ${lt_DD:=$DD}
68378fc2d0c6SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
68388fc2d0c6Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
68398fc2d0c6Smrg  cmp -s conftest.i conftest.out \
68408fc2d0c6Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
68418fc2d0c6Smrgfi])
68428fc2d0c6Smrgrm -f conftest.i conftest2.i conftest.out])
68438fc2d0c6Smrg])# _LT_PATH_DD
68444a041c5bSmacallan
68454a041c5bSmacallan
68468fc2d0c6Smrg# _LT_CMD_TRUNCATE
68478fc2d0c6Smrg# ----------------
68488fc2d0c6Smrg# find command to truncate a binary pipe
68498fc2d0c6Smrgm4_defun([_LT_CMD_TRUNCATE],
68508fc2d0c6Smrg[m4_require([_LT_PATH_DD])
68518fc2d0c6SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
68528fc2d0c6Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
68538fc2d0c6Smrgcat conftest.i conftest.i >conftest2.i
68548fc2d0c6Smrglt_cv_truncate_bin=
68558fc2d0c6Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
68568fc2d0c6Smrg  cmp -s conftest.i conftest.out \
68578fc2d0c6Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
68588fc2d0c6Smrgfi
68598fc2d0c6Smrgrm -f conftest.i conftest2.i conftest.out
68608fc2d0c6Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
68618fc2d0c6Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
68628fc2d0c6Smrg  [Command to truncate a binary pipe])
68638fc2d0c6Smrg])# _LT_CMD_TRUNCATE
68644a041c5bSmacallan
68654a041c5bSmacallan
68668fc2d0c6Smrg# _LT_CHECK_MAGIC_METHOD
68678fc2d0c6Smrg# ----------------------
68688fc2d0c6Smrg# how to check for library dependencies
68698fc2d0c6Smrg#  -- PORTME fill in with the dynamic library characteristics
68708fc2d0c6Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
68718fc2d0c6Smrg[m4_require([_LT_DECL_EGREP])
68728fc2d0c6Smrgm4_require([_LT_DECL_OBJDUMP])
68738fc2d0c6SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
68748fc2d0c6Smrglt_cv_deplibs_check_method,
68758fc2d0c6Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
68768fc2d0c6Smrglt_cv_file_magic_test_file=
68778fc2d0c6Smrglt_cv_deplibs_check_method='unknown'
68788fc2d0c6Smrg# Need to set the preceding variable on all platforms that support
68798fc2d0c6Smrg# interlibrary dependencies.
68808fc2d0c6Smrg# 'none' -- dependencies not supported.
68818fc2d0c6Smrg# 'unknown' -- same as none, but documents that we really don't know.
68828fc2d0c6Smrg# 'pass_all' -- all dependencies passed with no checks.
68838fc2d0c6Smrg# 'test_compile' -- check by making test program.
68848fc2d0c6Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
68858fc2d0c6Smrg# that responds to the $file_magic_cmd with a given extended regex.
68868fc2d0c6Smrg# If you have 'file' or equivalent on your system and you're not sure
68878fc2d0c6Smrg# whether 'pass_all' will *always* work, you probably want this one.
68884a041c5bSmacallan
68898fc2d0c6Smrgcase $host_os in
68908fc2d0c6Smrgaix[[4-9]]*)
68918fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
68928fc2d0c6Smrg  ;;
68934a041c5bSmacallan
68948fc2d0c6Smrgbeos*)
68958fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
68968fc2d0c6Smrg  ;;
68978fc2d0c6Smrg
68988fc2d0c6Smrgbsdi[[45]]*)
68998fc2d0c6Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
69008fc2d0c6Smrg  lt_cv_file_magic_cmd='$FILECMD -L'
69018fc2d0c6Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
69028fc2d0c6Smrg  ;;
69038fc2d0c6Smrg
69048fc2d0c6Smrgcygwin*)
69058fc2d0c6Smrg  # func_win32_libid is a shell function defined in ltmain.sh
69068fc2d0c6Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
69078fc2d0c6Smrg  lt_cv_file_magic_cmd='func_win32_libid'
69088fc2d0c6Smrg  ;;
69098fc2d0c6Smrg
69108fc2d0c6Smrgmingw* | pw32*)
69118fc2d0c6Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
69128fc2d0c6Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
69138fc2d0c6Smrg  # unless we find 'file', for example because we are cross-compiling.
69148fc2d0c6Smrg  if ( file / ) >/dev/null 2>&1; then
69158fc2d0c6Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
69168fc2d0c6Smrg    lt_cv_file_magic_cmd='func_win32_libid'
69178fc2d0c6Smrg  else
69188fc2d0c6Smrg    # Keep this pattern in sync with the one in func_win32_libid.
69198fc2d0c6Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
69208fc2d0c6Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
69218fc2d0c6Smrg  fi
69228fc2d0c6Smrg  ;;
69238fc2d0c6Smrg
69248fc2d0c6Smrgcegcc*)
69258fc2d0c6Smrg  # use the weaker test based on 'objdump'. See mingw*.
69268fc2d0c6Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
69278fc2d0c6Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
69288fc2d0c6Smrg  ;;
69298fc2d0c6Smrg
69308fc2d0c6Smrgdarwin* | rhapsody*)
69318fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
69328fc2d0c6Smrg  ;;
69338fc2d0c6Smrg
69348fc2d0c6Smrgfreebsd* | dragonfly* | midnightbsd*)
69358fc2d0c6Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
69368fc2d0c6Smrg    case $host_cpu in
69378fc2d0c6Smrg    i*86 )
69388fc2d0c6Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
69398fc2d0c6Smrg      # Let's accept both of them until this is cleared up.
69408fc2d0c6Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
69418fc2d0c6Smrg      lt_cv_file_magic_cmd=$FILECMD
69428fc2d0c6Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
69438fc2d0c6Smrg      ;;
69448fc2d0c6Smrg    esac
69458fc2d0c6Smrg  else
69468fc2d0c6Smrg    lt_cv_deplibs_check_method=pass_all
69478fc2d0c6Smrg  fi
69488fc2d0c6Smrg  ;;
69498fc2d0c6Smrg
69508fc2d0c6Smrghaiku*)
69518fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
69528fc2d0c6Smrg  ;;
69538fc2d0c6Smrg
69548fc2d0c6Smrghpux10.20* | hpux11*)
69558fc2d0c6Smrg  lt_cv_file_magic_cmd=$FILECMD
69568fc2d0c6Smrg  case $host_cpu in
69578fc2d0c6Smrg  ia64*)
69588fc2d0c6Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
69598fc2d0c6Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
69608fc2d0c6Smrg    ;;
69618fc2d0c6Smrg  hppa*64*)
69628fc2d0c6Smrg    [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]']
69638fc2d0c6Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
69648fc2d0c6Smrg    ;;
69658fc2d0c6Smrg  *)
69668fc2d0c6Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
69678fc2d0c6Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
69688fc2d0c6Smrg    ;;
69698fc2d0c6Smrg  esac
69708fc2d0c6Smrg  ;;
69718fc2d0c6Smrg
69728fc2d0c6Smrginterix[[3-9]]*)
69738fc2d0c6Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
69748fc2d0c6Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
69758fc2d0c6Smrg  ;;
69768fc2d0c6Smrg
69778fc2d0c6Smrgirix5* | irix6* | nonstopux*)
69788fc2d0c6Smrg  case $LD in
69798fc2d0c6Smrg  *-32|*"-32 ") libmagic=32-bit;;
69808fc2d0c6Smrg  *-n32|*"-n32 ") libmagic=N32;;
69818fc2d0c6Smrg  *-64|*"-64 ") libmagic=64-bit;;
69828fc2d0c6Smrg  *) libmagic=never-match;;
69838fc2d0c6Smrg  esac
69848fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
69858fc2d0c6Smrg  ;;
69868fc2d0c6Smrg
69878fc2d0c6Smrg# This must be glibc/ELF.
69888fc2d0c6Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
69898fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
69908fc2d0c6Smrg  ;;
69918fc2d0c6Smrg
69928fc2d0c6Smrgnetbsd*)
69938fc2d0c6Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
69948fc2d0c6Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
69958fc2d0c6Smrg  else
69968fc2d0c6Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
69978fc2d0c6Smrg  fi
69988fc2d0c6Smrg  ;;
69998fc2d0c6Smrg
70008fc2d0c6Smrgnewos6*)
70018fc2d0c6Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
70028fc2d0c6Smrg  lt_cv_file_magic_cmd=$FILECMD
70038fc2d0c6Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
70048fc2d0c6Smrg  ;;
70058fc2d0c6Smrg
70068fc2d0c6Smrg*nto* | *qnx*)
70078fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
70088fc2d0c6Smrg  ;;
70098fc2d0c6Smrg
70108fc2d0c6Smrgopenbsd* | bitrig*)
70118fc2d0c6Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
70128fc2d0c6Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
70138fc2d0c6Smrg  else
70148fc2d0c6Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
70158fc2d0c6Smrg  fi
70168fc2d0c6Smrg  ;;
70178fc2d0c6Smrg
70188fc2d0c6Smrgosf3* | osf4* | osf5*)
70198fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
70208fc2d0c6Smrg  ;;
70218fc2d0c6Smrg
70228fc2d0c6Smrgrdos*)
70238fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
70248fc2d0c6Smrg  ;;
70258fc2d0c6Smrg
70268fc2d0c6Smrgsolaris*)
70278fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
70288fc2d0c6Smrg  ;;
70298fc2d0c6Smrg
70308fc2d0c6Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
70318fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
70328fc2d0c6Smrg  ;;
70338fc2d0c6Smrg
70348fc2d0c6Smrgsysv4 | sysv4.3*)
70358fc2d0c6Smrg  case $host_vendor in
70368fc2d0c6Smrg  motorola)
70378fc2d0c6Smrg    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]]'
70388fc2d0c6Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
70398fc2d0c6Smrg    ;;
70408fc2d0c6Smrg  ncr)
70418fc2d0c6Smrg    lt_cv_deplibs_check_method=pass_all
70428fc2d0c6Smrg    ;;
70438fc2d0c6Smrg  sequent)
70448fc2d0c6Smrg    lt_cv_file_magic_cmd='/bin/file'
70458fc2d0c6Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
70468fc2d0c6Smrg    ;;
70478fc2d0c6Smrg  sni)
70488fc2d0c6Smrg    lt_cv_file_magic_cmd='/bin/file'
70498fc2d0c6Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
70508fc2d0c6Smrg    lt_cv_file_magic_test_file=/lib/libc.so
70518fc2d0c6Smrg    ;;
70528fc2d0c6Smrg  siemens)
70538fc2d0c6Smrg    lt_cv_deplibs_check_method=pass_all
70548fc2d0c6Smrg    ;;
70558fc2d0c6Smrg  pc)
70568fc2d0c6Smrg    lt_cv_deplibs_check_method=pass_all
70578fc2d0c6Smrg    ;;
70588fc2d0c6Smrg  esac
70598fc2d0c6Smrg  ;;
70608fc2d0c6Smrg
70618fc2d0c6Smrgtpf*)
70628fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
70638fc2d0c6Smrg  ;;
70648fc2d0c6Smrgos2*)
70658fc2d0c6Smrg  lt_cv_deplibs_check_method=pass_all
70668fc2d0c6Smrg  ;;
70678fc2d0c6Smrgesac
70688fc2d0c6Smrg])
70698fc2d0c6Smrg
70708fc2d0c6Smrgfile_magic_glob=
70718fc2d0c6Smrgwant_nocaseglob=no
70728fc2d0c6Smrgif test "$build" = "$host"; then
70738fc2d0c6Smrg  case $host_os in
70748fc2d0c6Smrg  mingw* | pw32*)
70758fc2d0c6Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
70768fc2d0c6Smrg      want_nocaseglob=yes
70778fc2d0c6Smrg    else
70788fc2d0c6Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
70798fc2d0c6Smrg    fi
70808fc2d0c6Smrg    ;;
70818fc2d0c6Smrg  esac
70828fc2d0c6Smrgfi
70838fc2d0c6Smrg
70848fc2d0c6Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
70858fc2d0c6Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
70868fc2d0c6Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
70878fc2d0c6Smrg
70888fc2d0c6Smrg_LT_DECL([], [deplibs_check_method], [1],
70898fc2d0c6Smrg    [Method to check whether dependent libraries are shared objects])
70908fc2d0c6Smrg_LT_DECL([], [file_magic_cmd], [1],
70918fc2d0c6Smrg    [Command to use when deplibs_check_method = "file_magic"])
70928fc2d0c6Smrg_LT_DECL([], [file_magic_glob], [1],
70938fc2d0c6Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
70948fc2d0c6Smrg_LT_DECL([], [want_nocaseglob], [1],
70958fc2d0c6Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
70968fc2d0c6Smrg])# _LT_CHECK_MAGIC_METHOD
70978fc2d0c6Smrg
70988fc2d0c6Smrg
70998fc2d0c6Smrg# LT_PATH_NM
71008fc2d0c6Smrg# ----------
71018fc2d0c6Smrg# find the pathname to a BSD- or MS-compatible name lister
71028fc2d0c6SmrgAC_DEFUN([LT_PATH_NM],
71038fc2d0c6Smrg[AC_REQUIRE([AC_PROG_CC])dnl
71048fc2d0c6SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
71058fc2d0c6Smrg[if test -n "$NM"; then
71068fc2d0c6Smrg  # Let the user override the test.
71078fc2d0c6Smrg  lt_cv_path_NM=$NM
71088fc2d0c6Smrgelse
71098fc2d0c6Smrg  lt_nm_to_check=${ac_tool_prefix}nm
71108fc2d0c6Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
71118fc2d0c6Smrg    lt_nm_to_check="$lt_nm_to_check nm"
71128fc2d0c6Smrg  fi
71138fc2d0c6Smrg  for lt_tmp_nm in $lt_nm_to_check; do
71148fc2d0c6Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
71158fc2d0c6Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
71168fc2d0c6Smrg      IFS=$lt_save_ifs
71178fc2d0c6Smrg      test -z "$ac_dir" && ac_dir=.
71188fc2d0c6Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
71198fc2d0c6Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
71208fc2d0c6Smrg	# Check to see if the nm accepts a BSD-compat flag.
71218fc2d0c6Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
71228fc2d0c6Smrg	#   nm: unknown option "B" ignored
71238fc2d0c6Smrg	# Tru64's nm complains that /dev/null is an invalid object file
71248fc2d0c6Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
71258fc2d0c6Smrg	case $build_os in
71268fc2d0c6Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
71278fc2d0c6Smrg	*) lt_bad_file=/dev/null ;;
71288fc2d0c6Smrg	esac
71298fc2d0c6Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
71308fc2d0c6Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
71318fc2d0c6Smrg	  lt_cv_path_NM="$tmp_nm -B"
71328fc2d0c6Smrg	  break 2
71338fc2d0c6Smrg	  ;;
71348fc2d0c6Smrg	*)
71358fc2d0c6Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
71368fc2d0c6Smrg	  */dev/null*)
71378fc2d0c6Smrg	    lt_cv_path_NM="$tmp_nm -p"
71388fc2d0c6Smrg	    break 2
71398fc2d0c6Smrg	    ;;
71408fc2d0c6Smrg	  *)
71418fc2d0c6Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
71428fc2d0c6Smrg	    continue # so that we can try to find one that supports BSD flags
71438fc2d0c6Smrg	    ;;
71448fc2d0c6Smrg	  esac
71458fc2d0c6Smrg	  ;;
71468fc2d0c6Smrg	esac
71478fc2d0c6Smrg      fi
71488fc2d0c6Smrg    done
71498fc2d0c6Smrg    IFS=$lt_save_ifs
71508fc2d0c6Smrg  done
71518fc2d0c6Smrg  : ${lt_cv_path_NM=no}
71528fc2d0c6Smrgfi])
71538fc2d0c6Smrgif test no != "$lt_cv_path_NM"; then
71548fc2d0c6Smrg  NM=$lt_cv_path_NM
71558fc2d0c6Smrgelse
71568fc2d0c6Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
71578fc2d0c6Smrg  if test -n "$DUMPBIN"; then :
71588fc2d0c6Smrg    # Let the user override the test.
71598fc2d0c6Smrg  else
71608fc2d0c6Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
71618fc2d0c6Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
71628fc2d0c6Smrg    *COFF*)
71638fc2d0c6Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
71648fc2d0c6Smrg      ;;
71658fc2d0c6Smrg    *)
71668fc2d0c6Smrg      DUMPBIN=:
71678fc2d0c6Smrg      ;;
71688fc2d0c6Smrg    esac
71698fc2d0c6Smrg  fi
71708fc2d0c6Smrg  AC_SUBST([DUMPBIN])
71718fc2d0c6Smrg  if test : != "$DUMPBIN"; then
71728fc2d0c6Smrg    NM=$DUMPBIN
71738fc2d0c6Smrg  fi
71748fc2d0c6Smrgfi
71758fc2d0c6Smrgtest -z "$NM" && NM=nm
71768fc2d0c6SmrgAC_SUBST([NM])
71778fc2d0c6Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
71788fc2d0c6Smrg
71798fc2d0c6SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
71808fc2d0c6Smrg  [lt_cv_nm_interface="BSD nm"
71818fc2d0c6Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
71828fc2d0c6Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
71838fc2d0c6Smrg  (eval "$ac_compile" 2>conftest.err)
71848fc2d0c6Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
71858fc2d0c6Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
71868fc2d0c6Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
71878fc2d0c6Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
71888fc2d0c6Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
71898fc2d0c6Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
71908fc2d0c6Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
71918fc2d0c6Smrg    lt_cv_nm_interface="MS dumpbin"
71928fc2d0c6Smrg  fi
71938fc2d0c6Smrg  rm -f conftest*])
71948fc2d0c6Smrg])# LT_PATH_NM
71958fc2d0c6Smrg
71968fc2d0c6Smrg# Old names:
71978fc2d0c6SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
71988fc2d0c6SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
71998fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
72008fc2d0c6Smrgdnl AC_DEFUN([AM_PROG_NM], [])
72018fc2d0c6Smrgdnl AC_DEFUN([AC_PROG_NM], [])
72028fc2d0c6Smrg
72038fc2d0c6Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
72048fc2d0c6Smrg# --------------------------------
72058fc2d0c6Smrg# how to determine the name of the shared library
72068fc2d0c6Smrg# associated with a specific link library.
72078fc2d0c6Smrg#  -- PORTME fill in with the dynamic library characteristics
72088fc2d0c6Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
72098fc2d0c6Smrg[m4_require([_LT_DECL_EGREP])
72108fc2d0c6Smrgm4_require([_LT_DECL_OBJDUMP])
72118fc2d0c6Smrgm4_require([_LT_DECL_DLLTOOL])
72128fc2d0c6SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
72138fc2d0c6Smrglt_cv_sharedlib_from_linklib_cmd,
72148fc2d0c6Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
72158fc2d0c6Smrg
72168fc2d0c6Smrgcase $host_os in
72178fc2d0c6Smrgcygwin* | mingw* | pw32* | cegcc*)
72188fc2d0c6Smrg  # two different shell functions defined in ltmain.sh;
72198fc2d0c6Smrg  # decide which one to use based on capabilities of $DLLTOOL
72208fc2d0c6Smrg  case `$DLLTOOL --help 2>&1` in
72218fc2d0c6Smrg  *--identify-strict*)
72228fc2d0c6Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
72238fc2d0c6Smrg    ;;
72248fc2d0c6Smrg  *)
72258fc2d0c6Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
72268fc2d0c6Smrg    ;;
72278fc2d0c6Smrg  esac
72288fc2d0c6Smrg  ;;
72298fc2d0c6Smrg*)
72308fc2d0c6Smrg  # fallback: assume linklib IS sharedlib
72318fc2d0c6Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
72328fc2d0c6Smrg  ;;
72338fc2d0c6Smrgesac
72348fc2d0c6Smrg])
72358fc2d0c6Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
72368fc2d0c6Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
72378fc2d0c6Smrg
72388fc2d0c6Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
72398fc2d0c6Smrg    [Command to associate shared and link libraries])
72408fc2d0c6Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
72418fc2d0c6Smrg
72428fc2d0c6Smrg
72438fc2d0c6Smrg# _LT_PATH_MANIFEST_TOOL
72448fc2d0c6Smrg# ----------------------
72458fc2d0c6Smrg# locate the manifest tool
72468fc2d0c6Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
72478fc2d0c6Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
72488fc2d0c6Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
72498fc2d0c6SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
72508fc2d0c6Smrg  [lt_cv_path_mainfest_tool=no
72518fc2d0c6Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
72528fc2d0c6Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
72538fc2d0c6Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
72548fc2d0c6Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
72558fc2d0c6Smrg    lt_cv_path_mainfest_tool=yes
72568fc2d0c6Smrg  fi
72578fc2d0c6Smrg  rm -f conftest*])
72588fc2d0c6Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
72598fc2d0c6Smrg  MANIFEST_TOOL=:
72608fc2d0c6Smrgfi
72618fc2d0c6Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
72628fc2d0c6Smrg])# _LT_PATH_MANIFEST_TOOL
72638fc2d0c6Smrg
72648fc2d0c6Smrg
72658fc2d0c6Smrg# _LT_DLL_DEF_P([FILE])
72668fc2d0c6Smrg# ---------------------
72678fc2d0c6Smrg# True iff FILE is a Windows DLL '.def' file.
72688fc2d0c6Smrg# Keep in sync with func_dll_def_p in the libtool script
72698fc2d0c6SmrgAC_DEFUN([_LT_DLL_DEF_P],
72708fc2d0c6Smrg[dnl
72718fc2d0c6Smrg  test DEF = "`$SED -n dnl
72728fc2d0c6Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
72738fc2d0c6Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
72748fc2d0c6Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
72758fc2d0c6Smrg    -e q dnl                          Only consider the first "real" line
72768fc2d0c6Smrg    $1`" dnl
72778fc2d0c6Smrg])# _LT_DLL_DEF_P
72788fc2d0c6Smrg
72798fc2d0c6Smrg
72808fc2d0c6Smrg# LT_LIB_M
72818fc2d0c6Smrg# --------
72828fc2d0c6Smrg# check for math library
72838fc2d0c6SmrgAC_DEFUN([LT_LIB_M],
72848fc2d0c6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
72858fc2d0c6SmrgLIBM=
72868fc2d0c6Smrgcase $host in
72878fc2d0c6Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
72888fc2d0c6Smrg  # These system don't have libm, or don't need it
72898fc2d0c6Smrg  ;;
72908fc2d0c6Smrg*-ncr-sysv4.3*)
72918fc2d0c6Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
72928fc2d0c6Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
72938fc2d0c6Smrg  ;;
72948fc2d0c6Smrg*)
72958fc2d0c6Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
72968fc2d0c6Smrg  ;;
72978fc2d0c6Smrgesac
72988fc2d0c6SmrgAC_SUBST([LIBM])
72998fc2d0c6Smrg])# LT_LIB_M
73008fc2d0c6Smrg
73018fc2d0c6Smrg# Old name:
73028fc2d0c6SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
73038fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
73048fc2d0c6Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
73058fc2d0c6Smrg
73068fc2d0c6Smrg
73078fc2d0c6Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
73088fc2d0c6Smrg# -------------------------------
73098fc2d0c6Smrgm4_defun([_LT_COMPILER_NO_RTTI],
73108fc2d0c6Smrg[m4_require([_LT_TAG_COMPILER])dnl
73118fc2d0c6Smrg
73128fc2d0c6Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
73138fc2d0c6Smrg
73148fc2d0c6Smrgif test yes = "$GCC"; then
73158fc2d0c6Smrg  case $cc_basename in
73168fc2d0c6Smrg  nvcc*)
73178fc2d0c6Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
73188fc2d0c6Smrg  *)
73198fc2d0c6Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
73208fc2d0c6Smrg  esac
73218fc2d0c6Smrg
73228fc2d0c6Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
73238fc2d0c6Smrg    lt_cv_prog_compiler_rtti_exceptions,
73248fc2d0c6Smrg    [-fno-rtti -fno-exceptions], [],
73258fc2d0c6Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
73268fc2d0c6Smrgfi
73278fc2d0c6Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
73288fc2d0c6Smrg	[Compiler flag to turn off builtin functions])
73298fc2d0c6Smrg])# _LT_COMPILER_NO_RTTI
73308fc2d0c6Smrg
73318fc2d0c6Smrg
73328fc2d0c6Smrg# _LT_CMD_GLOBAL_SYMBOLS
73338fc2d0c6Smrg# ----------------------
73348fc2d0c6Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
73358fc2d0c6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
73368fc2d0c6SmrgAC_REQUIRE([AC_PROG_CC])dnl
73378fc2d0c6SmrgAC_REQUIRE([AC_PROG_AWK])dnl
73388fc2d0c6SmrgAC_REQUIRE([LT_PATH_NM])dnl
73398fc2d0c6SmrgAC_REQUIRE([LT_PATH_LD])dnl
73408fc2d0c6Smrgm4_require([_LT_DECL_SED])dnl
73418fc2d0c6Smrgm4_require([_LT_DECL_EGREP])dnl
73428fc2d0c6Smrgm4_require([_LT_TAG_COMPILER])dnl
73438fc2d0c6Smrg
73448fc2d0c6Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
73458fc2d0c6SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
73468fc2d0c6SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
73478fc2d0c6Smrg[
73488fc2d0c6Smrg# These are sane defaults that work on at least a few old systems.
73498fc2d0c6Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
73508fc2d0c6Smrg
73518fc2d0c6Smrg# Character class describing NM global symbol codes.
73528fc2d0c6Smrgsymcode='[[BCDEGRST]]'
73538fc2d0c6Smrg
73548fc2d0c6Smrg# Regexp to match symbols that can be accessed directly from C.
73558fc2d0c6Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
73568fc2d0c6Smrg
73578fc2d0c6Smrg# Define system-specific variables.
73588fc2d0c6Smrgcase $host_os in
73598fc2d0c6Smrgaix*)
73608fc2d0c6Smrg  symcode='[[BCDT]]'
73618fc2d0c6Smrg  ;;
73628fc2d0c6Smrgcygwin* | mingw* | pw32* | cegcc*)
73638fc2d0c6Smrg  symcode='[[ABCDGISTW]]'
73648fc2d0c6Smrg  ;;
73658fc2d0c6Smrghpux*)
73668fc2d0c6Smrg  if test ia64 = "$host_cpu"; then
73678fc2d0c6Smrg    symcode='[[ABCDEGRST]]'
73688fc2d0c6Smrg  fi
73698fc2d0c6Smrg  ;;
73708fc2d0c6Smrgirix* | nonstopux*)
73718fc2d0c6Smrg  symcode='[[BCDEGRST]]'
73728fc2d0c6Smrg  ;;
73738fc2d0c6Smrgosf*)
73748fc2d0c6Smrg  symcode='[[BCDEGQRST]]'
73758fc2d0c6Smrg  ;;
73768fc2d0c6Smrgsolaris*)
73778fc2d0c6Smrg  symcode='[[BDRT]]'
73788fc2d0c6Smrg  ;;
73798fc2d0c6Smrgsco3.2v5*)
73808fc2d0c6Smrg  symcode='[[DT]]'
73818fc2d0c6Smrg  ;;
73828fc2d0c6Smrgsysv4.2uw2*)
73838fc2d0c6Smrg  symcode='[[DT]]'
73848fc2d0c6Smrg  ;;
73858fc2d0c6Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
73868fc2d0c6Smrg  symcode='[[ABDT]]'
73878fc2d0c6Smrg  ;;
73888fc2d0c6Smrgsysv4)
73898fc2d0c6Smrg  symcode='[[DFNSTU]]'
73908fc2d0c6Smrg  ;;
73918fc2d0c6Smrgesac
73928fc2d0c6Smrg
73938fc2d0c6Smrg# If we're using GNU nm, then use its standard symbol codes.
73948fc2d0c6Smrgcase `$NM -V 2>&1` in
73958fc2d0c6Smrg*GNU* | *'with BFD'*)
73968fc2d0c6Smrg  symcode='[[ABCDGIRSTW]]' ;;
73978fc2d0c6Smrgesac
73988fc2d0c6Smrg
73998fc2d0c6Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
74008fc2d0c6Smrg  # Gets list of data symbols to import.
74018fc2d0c6Smrg  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
74028fc2d0c6Smrg  # Adjust the below global symbol transforms to fixup imported variables.
74038fc2d0c6Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
74048fc2d0c6Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
74058fc2d0c6Smrg  lt_c_name_lib_hook="\
74068fc2d0c6Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
74078fc2d0c6Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
74088fc2d0c6Smrgelse
74098fc2d0c6Smrg  # Disable hooks by default.
74108fc2d0c6Smrg  lt_cv_sys_global_symbol_to_import=
74118fc2d0c6Smrg  lt_cdecl_hook=
74128fc2d0c6Smrg  lt_c_name_hook=
74138fc2d0c6Smrg  lt_c_name_lib_hook=
74148fc2d0c6Smrgfi
74158fc2d0c6Smrg
74168fc2d0c6Smrg# Transform an extracted symbol line into a proper C declaration.
74178fc2d0c6Smrg# Some systems (esp. on ia64) link data and code symbols differently,
74188fc2d0c6Smrg# so use this general approach.
74198fc2d0c6Smrglt_cv_sys_global_symbol_to_cdecl="$SED -n"\
74208fc2d0c6Smrg$lt_cdecl_hook\
74218fc2d0c6Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
74228fc2d0c6Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
74238fc2d0c6Smrg
74248fc2d0c6Smrg# Transform an extracted symbol line into symbol name and symbol address
74258fc2d0c6Smrglt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
74268fc2d0c6Smrg$lt_c_name_hook\
74278fc2d0c6Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
74288fc2d0c6Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
74298fc2d0c6Smrg
74308fc2d0c6Smrg# Transform an extracted symbol line into symbol name with lib prefix and
74318fc2d0c6Smrg# symbol address.
74328fc2d0c6Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
74338fc2d0c6Smrg$lt_c_name_lib_hook\
74348fc2d0c6Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
74358fc2d0c6Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
74368fc2d0c6Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
74378fc2d0c6Smrg
74388fc2d0c6Smrg# Handle CRLF in mingw tool chain
74398fc2d0c6Smrgopt_cr=
74408fc2d0c6Smrgcase $build_os in
74418fc2d0c6Smrgmingw*)
74428fc2d0c6Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
74438fc2d0c6Smrg  ;;
74448fc2d0c6Smrgesac
74458fc2d0c6Smrg
74468fc2d0c6Smrg# Try without a prefix underscore, then with it.
74478fc2d0c6Smrgfor ac_symprfx in "" "_"; do
74488fc2d0c6Smrg
74498fc2d0c6Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
74508fc2d0c6Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
74518fc2d0c6Smrg
74528fc2d0c6Smrg  # Write the raw and C identifiers.
74538fc2d0c6Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
74548fc2d0c6Smrg    # Fake it for dumpbin and say T for any non-static function,
74558fc2d0c6Smrg    # D for any global variable and I for any imported variable.
74568fc2d0c6Smrg    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
74578fc2d0c6Smrg    # which start with @ or ?.
74588fc2d0c6Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
74598fc2d0c6Smrg"     {last_section=section; section=\$ 3};"\
74608fc2d0c6Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
74618fc2d0c6Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
74628fc2d0c6Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
74638fc2d0c6Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
74648fc2d0c6Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
74658fc2d0c6Smrg"     \$ 0!~/External *\|/{next};"\
74668fc2d0c6Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
74678fc2d0c6Smrg"     {if(hide[section]) next};"\
74688fc2d0c6Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
74698fc2d0c6Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
74708fc2d0c6Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
74718fc2d0c6Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
74728fc2d0c6Smrg"     ' prfx=^$ac_symprfx]"
74738fc2d0c6Smrg  else
74748fc2d0c6Smrg    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
74758fc2d0c6Smrg  fi
74768fc2d0c6Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
74778fc2d0c6Smrg
74788fc2d0c6Smrg  # Check to see that the pipe works correctly.
74798fc2d0c6Smrg  pipe_works=no
74808fc2d0c6Smrg
74818fc2d0c6Smrg  rm -f conftest*
74828fc2d0c6Smrg  cat > conftest.$ac_ext <<_LT_EOF
74838fc2d0c6Smrg#ifdef __cplusplus
74848fc2d0c6Smrgextern "C" {
74858fc2d0c6Smrg#endif
74868fc2d0c6Smrgchar nm_test_var;
74878fc2d0c6Smrgvoid nm_test_func(void);
74888fc2d0c6Smrgvoid nm_test_func(void){}
74898fc2d0c6Smrg#ifdef __cplusplus
74908fc2d0c6Smrg}
74918fc2d0c6Smrg#endif
74928fc2d0c6Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
74938fc2d0c6Smrg_LT_EOF
74948fc2d0c6Smrg
74958fc2d0c6Smrg  if AC_TRY_EVAL(ac_compile); then
74968fc2d0c6Smrg    # Now try to grab the symbols.
74978fc2d0c6Smrg    nlist=conftest.nm
74988fc2d0c6Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
74998fc2d0c6Smrg      # Try sorting and uniquifying the output.
75008fc2d0c6Smrg      if sort "$nlist" | uniq > "$nlist"T; then
75018fc2d0c6Smrg	mv -f "$nlist"T "$nlist"
75028fc2d0c6Smrg      else
75038fc2d0c6Smrg	rm -f "$nlist"T
75048fc2d0c6Smrg      fi
75058fc2d0c6Smrg
75068fc2d0c6Smrg      # Make sure that we snagged all the symbols we need.
75078fc2d0c6Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
75088fc2d0c6Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
75098fc2d0c6Smrg	  cat <<_LT_EOF > conftest.$ac_ext
75108fc2d0c6Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
75118fc2d0c6Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
75128fc2d0c6Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
75138fc2d0c6Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
75148fc2d0c6Smrg# define LT@&t@_DLSYM_CONST
75158fc2d0c6Smrg#elif defined __osf__
75168fc2d0c6Smrg/* This system does not cope well with relocations in const data.  */
75178fc2d0c6Smrg# define LT@&t@_DLSYM_CONST
75188fc2d0c6Smrg#else
75198fc2d0c6Smrg# define LT@&t@_DLSYM_CONST const
75208fc2d0c6Smrg#endif
75218fc2d0c6Smrg
75228fc2d0c6Smrg#ifdef __cplusplus
75238fc2d0c6Smrgextern "C" {
75248fc2d0c6Smrg#endif
75258fc2d0c6Smrg
75268fc2d0c6Smrg_LT_EOF
75278fc2d0c6Smrg	  # Now generate the symbol file.
75288fc2d0c6Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
75298fc2d0c6Smrg
75308fc2d0c6Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
75318fc2d0c6Smrg
75328fc2d0c6Smrg/* The mapping between symbol names and symbols.  */
75338fc2d0c6SmrgLT@&t@_DLSYM_CONST struct {
75348fc2d0c6Smrg  const char *name;
75358fc2d0c6Smrg  void       *address;
75368fc2d0c6Smrg}
75378fc2d0c6Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
75388fc2d0c6Smrg{
75398fc2d0c6Smrg  { "@PROGRAM@", (void *) 0 },
75408fc2d0c6Smrg_LT_EOF
75418fc2d0c6Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
75428fc2d0c6Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
75438fc2d0c6Smrg  {0, (void *) 0}
75448fc2d0c6Smrg};
75458fc2d0c6Smrg
75468fc2d0c6Smrg/* This works around a problem in FreeBSD linker */
75478fc2d0c6Smrg#ifdef FREEBSD_WORKAROUND
75488fc2d0c6Smrgstatic const void *lt_preloaded_setup() {
75498fc2d0c6Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
75508fc2d0c6Smrg}
75518fc2d0c6Smrg#endif
75528fc2d0c6Smrg
75538fc2d0c6Smrg#ifdef __cplusplus
75548fc2d0c6Smrg}
75558fc2d0c6Smrg#endif
75568fc2d0c6Smrg_LT_EOF
75578fc2d0c6Smrg	  # Now try linking the two files.
75588fc2d0c6Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
75598fc2d0c6Smrg	  lt_globsym_save_LIBS=$LIBS
75608fc2d0c6Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
75618fc2d0c6Smrg	  LIBS=conftstm.$ac_objext
75628fc2d0c6Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
75638fc2d0c6Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
75648fc2d0c6Smrg	    pipe_works=yes
75658fc2d0c6Smrg	  fi
75668fc2d0c6Smrg	  LIBS=$lt_globsym_save_LIBS
75678fc2d0c6Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
75688fc2d0c6Smrg	else
75698fc2d0c6Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
75708fc2d0c6Smrg	fi
75718fc2d0c6Smrg      else
75728fc2d0c6Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
75738fc2d0c6Smrg      fi
75748fc2d0c6Smrg    else
75758fc2d0c6Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
75768fc2d0c6Smrg    fi
75778fc2d0c6Smrg  else
75788fc2d0c6Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
75798fc2d0c6Smrg    cat conftest.$ac_ext >&5
75808fc2d0c6Smrg  fi
75818fc2d0c6Smrg  rm -rf conftest* conftst*
75828fc2d0c6Smrg
75838fc2d0c6Smrg  # Do not use the global_symbol_pipe unless it works.
75848fc2d0c6Smrg  if test yes = "$pipe_works"; then
75858fc2d0c6Smrg    break
75868fc2d0c6Smrg  else
75878fc2d0c6Smrg    lt_cv_sys_global_symbol_pipe=
75888fc2d0c6Smrg  fi
75898fc2d0c6Smrgdone
75908fc2d0c6Smrg])
75918fc2d0c6Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
75928fc2d0c6Smrg  lt_cv_sys_global_symbol_to_cdecl=
75938fc2d0c6Smrgfi
75948fc2d0c6Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
75958fc2d0c6Smrg  AC_MSG_RESULT(failed)
75968fc2d0c6Smrgelse
75978fc2d0c6Smrg  AC_MSG_RESULT(ok)
75988fc2d0c6Smrgfi
75998fc2d0c6Smrg
76008fc2d0c6Smrg# Response file support.
76018fc2d0c6Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
76028fc2d0c6Smrg  nm_file_list_spec='@'
76038fc2d0c6Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
76048fc2d0c6Smrg  nm_file_list_spec='@'
76058fc2d0c6Smrgfi
76068fc2d0c6Smrg
76078fc2d0c6Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
76088fc2d0c6Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
76098fc2d0c6Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
76108fc2d0c6Smrg    [Transform the output of nm in a proper C declaration])
76118fc2d0c6Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
76128fc2d0c6Smrg    [Transform the output of nm into a list of symbols to manually relocate])
76138fc2d0c6Smrg_LT_DECL([global_symbol_to_c_name_address],
76148fc2d0c6Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
76158fc2d0c6Smrg    [Transform the output of nm in a C name address pair])
76168fc2d0c6Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
76178fc2d0c6Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
76188fc2d0c6Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
76198fc2d0c6Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
76208fc2d0c6Smrg    [The name lister interface])
76218fc2d0c6Smrg_LT_DECL([], [nm_file_list_spec], [1],
76228fc2d0c6Smrg    [Specify filename containing input files for $NM])
76238fc2d0c6Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
76248fc2d0c6Smrg
76258fc2d0c6Smrg
76268fc2d0c6Smrg# _LT_COMPILER_PIC([TAGNAME])
76278fc2d0c6Smrg# ---------------------------
76288fc2d0c6Smrgm4_defun([_LT_COMPILER_PIC],
76298fc2d0c6Smrg[m4_require([_LT_TAG_COMPILER])dnl
76308fc2d0c6Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
76318fc2d0c6Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
76328fc2d0c6Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
76338fc2d0c6Smrg
76348fc2d0c6Smrgm4_if([$1], [CXX], [
76358fc2d0c6Smrg  # C++ specific cases for pic, static, wl, etc.
76368fc2d0c6Smrg  if test yes = "$GXX"; then
76378fc2d0c6Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
76388fc2d0c6Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
76398fc2d0c6Smrg
76408fc2d0c6Smrg    case $host_os in
76418fc2d0c6Smrg    aix*)
76428fc2d0c6Smrg      # All AIX code is PIC.
76438fc2d0c6Smrg      if test ia64 = "$host_cpu"; then
76448fc2d0c6Smrg	# AIX 5 now supports IA64 processor
76458fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
76468fc2d0c6Smrg      fi
76478fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
76488fc2d0c6Smrg      ;;
76498fc2d0c6Smrg
76508fc2d0c6Smrg    amigaos*)
76518fc2d0c6Smrg      case $host_cpu in
76528fc2d0c6Smrg      powerpc)
76538fc2d0c6Smrg            # see comment about AmigaOS4 .so support
76548fc2d0c6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
76558fc2d0c6Smrg        ;;
76568fc2d0c6Smrg      m68k)
76578fc2d0c6Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
76588fc2d0c6Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
76598fc2d0c6Smrg            # like '-m68040'.
76608fc2d0c6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
76618fc2d0c6Smrg        ;;
76628fc2d0c6Smrg      esac
76638fc2d0c6Smrg      ;;
76648fc2d0c6Smrg
76658fc2d0c6Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
76668fc2d0c6Smrg      # PIC is the default for these OSes.
76678fc2d0c6Smrg      ;;
76688fc2d0c6Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
76698fc2d0c6Smrg      # This hack is so that the source file can tell whether it is being
76708fc2d0c6Smrg      # built for inclusion in a dll (and should export symbols for example).
76718fc2d0c6Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
76728fc2d0c6Smrg      # (--disable-auto-import) libraries
76738fc2d0c6Smrg      m4_if([$1], [GCJ], [],
76748fc2d0c6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
76758fc2d0c6Smrg      case $host_os in
76768fc2d0c6Smrg      os2*)
76778fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
76788fc2d0c6Smrg	;;
76798fc2d0c6Smrg      esac
76808fc2d0c6Smrg      ;;
76818fc2d0c6Smrg    darwin* | rhapsody*)
76828fc2d0c6Smrg      # PIC is the default on this platform
76838fc2d0c6Smrg      # Common symbols not allowed in MH_DYLIB files
76848fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
76858fc2d0c6Smrg      ;;
76868fc2d0c6Smrg    *djgpp*)
76878fc2d0c6Smrg      # DJGPP does not support shared libraries at all
76888fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
76898fc2d0c6Smrg      ;;
76908fc2d0c6Smrg    haiku*)
76918fc2d0c6Smrg      # PIC is the default for Haiku.
76928fc2d0c6Smrg      # The "-static" flag exists, but is broken.
76938fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
76948fc2d0c6Smrg      ;;
76958fc2d0c6Smrg    interix[[3-9]]*)
76968fc2d0c6Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
76978fc2d0c6Smrg      # Instead, we relocate shared libraries at runtime.
76988fc2d0c6Smrg      ;;
76998fc2d0c6Smrg    sysv4*MP*)
77008fc2d0c6Smrg      if test -d /usr/nec; then
77018fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
77028fc2d0c6Smrg      fi
77038fc2d0c6Smrg      ;;
77048fc2d0c6Smrg    hpux*)
77058fc2d0c6Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
77068fc2d0c6Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
77078fc2d0c6Smrg      # sets the default TLS model and affects inlining.
77088fc2d0c6Smrg      case $host_cpu in
77098fc2d0c6Smrg      hppa*64*)
77108fc2d0c6Smrg	;;
77118fc2d0c6Smrg      *)
77128fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
77138fc2d0c6Smrg	;;
77148fc2d0c6Smrg      esac
77158fc2d0c6Smrg      ;;
77168fc2d0c6Smrg    *qnx* | *nto*)
77178fc2d0c6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
77188fc2d0c6Smrg      # it will coredump.
77198fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
77208fc2d0c6Smrg      ;;
77218fc2d0c6Smrg    *)
77228fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
77238fc2d0c6Smrg      ;;
77248fc2d0c6Smrg    esac
77258fc2d0c6Smrg  else
77268fc2d0c6Smrg    case $host_os in
77278fc2d0c6Smrg      aix[[4-9]]*)
77288fc2d0c6Smrg	# All AIX code is PIC.
77298fc2d0c6Smrg	if test ia64 = "$host_cpu"; then
77308fc2d0c6Smrg	  # AIX 5 now supports IA64 processor
77318fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
77328fc2d0c6Smrg	else
77338fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
77348fc2d0c6Smrg	fi
77358fc2d0c6Smrg	;;
77368fc2d0c6Smrg      chorus*)
77378fc2d0c6Smrg	case $cc_basename in
77388fc2d0c6Smrg	cxch68*)
77398fc2d0c6Smrg	  # Green Hills C++ Compiler
77408fc2d0c6Smrg	  # _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"
77418fc2d0c6Smrg	  ;;
77428fc2d0c6Smrg	esac
77438fc2d0c6Smrg	;;
77448fc2d0c6Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
77458fc2d0c6Smrg	# This hack is so that the source file can tell whether it is being
77468fc2d0c6Smrg	# built for inclusion in a dll (and should export symbols for example).
77478fc2d0c6Smrg	m4_if([$1], [GCJ], [],
77488fc2d0c6Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
77498fc2d0c6Smrg	;;
77508fc2d0c6Smrg      dgux*)
77518fc2d0c6Smrg	case $cc_basename in
77528fc2d0c6Smrg	  ec++*)
77538fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
77548fc2d0c6Smrg	    ;;
77558fc2d0c6Smrg	  ghcx*)
77568fc2d0c6Smrg	    # Green Hills C++ Compiler
77578fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
77588fc2d0c6Smrg	    ;;
77598fc2d0c6Smrg	  *)
77608fc2d0c6Smrg	    ;;
77618fc2d0c6Smrg	esac
77628fc2d0c6Smrg	;;
77638fc2d0c6Smrg      freebsd* | dragonfly* | midnightbsd*)
77648fc2d0c6Smrg	# FreeBSD uses GNU C++
77658fc2d0c6Smrg	;;
77668fc2d0c6Smrg      hpux9* | hpux10* | hpux11*)
77678fc2d0c6Smrg	case $cc_basename in
77688fc2d0c6Smrg	  CC*)
77698fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
77708fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
77718fc2d0c6Smrg	    if test ia64 != "$host_cpu"; then
77728fc2d0c6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
77738fc2d0c6Smrg	    fi
77748fc2d0c6Smrg	    ;;
77758fc2d0c6Smrg	  aCC*)
77768fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
77778fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
77788fc2d0c6Smrg	    case $host_cpu in
77798fc2d0c6Smrg	    hppa*64*|ia64*)
77808fc2d0c6Smrg	      # +Z the default
77818fc2d0c6Smrg	      ;;
77828fc2d0c6Smrg	    *)
77838fc2d0c6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
77848fc2d0c6Smrg	      ;;
77858fc2d0c6Smrg	    esac
77868fc2d0c6Smrg	    ;;
77878fc2d0c6Smrg	  *)
77888fc2d0c6Smrg	    ;;
77898fc2d0c6Smrg	esac
77908fc2d0c6Smrg	;;
77918fc2d0c6Smrg      interix*)
77928fc2d0c6Smrg	# This is c89, which is MS Visual C++ (no shared libs)
77938fc2d0c6Smrg	# Anyone wants to do a port?
77948fc2d0c6Smrg	;;
77958fc2d0c6Smrg      irix5* | irix6* | nonstopux*)
77968fc2d0c6Smrg	case $cc_basename in
77978fc2d0c6Smrg	  CC*)
77988fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
77998fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
78008fc2d0c6Smrg	    # CC pic flag -KPIC is the default.
78018fc2d0c6Smrg	    ;;
78028fc2d0c6Smrg	  *)
78038fc2d0c6Smrg	    ;;
78048fc2d0c6Smrg	esac
78058fc2d0c6Smrg	;;
78068fc2d0c6Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
78078fc2d0c6Smrg	case $cc_basename in
78088fc2d0c6Smrg	  KCC*)
78098fc2d0c6Smrg	    # KAI C++ Compiler
78108fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
78118fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
78128fc2d0c6Smrg	    ;;
78138fc2d0c6Smrg	  ecpc* )
78148fc2d0c6Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
78158fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
78168fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
78178fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
78188fc2d0c6Smrg	    ;;
78198fc2d0c6Smrg	  icpc* )
78208fc2d0c6Smrg	    # Intel C++, used to be incompatible with GCC.
78218fc2d0c6Smrg	    # ICC 10 doesn't accept -KPIC any more.
78228fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
78238fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
78248fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
78258fc2d0c6Smrg	    ;;
78268fc2d0c6Smrg	  pgCC* | pgcpp*)
78278fc2d0c6Smrg	    # Portland Group C++ compiler
78288fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
78298fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
78308fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
78318fc2d0c6Smrg	    ;;
78328fc2d0c6Smrg	  cxx*)
78338fc2d0c6Smrg	    # Compaq C++
78348fc2d0c6Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
78358fc2d0c6Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
78368fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
78378fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
78388fc2d0c6Smrg	    ;;
78398fc2d0c6Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
78408fc2d0c6Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
78418fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
78428fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
78438fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
78448fc2d0c6Smrg	    ;;
78458fc2d0c6Smrg	  *)
78468fc2d0c6Smrg	    case `$CC -V 2>&1 | $SED 5q` in
78478fc2d0c6Smrg	    *Sun\ C*)
78488fc2d0c6Smrg	      # Sun C++ 5.9
78498fc2d0c6Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
78508fc2d0c6Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
78518fc2d0c6Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
78528fc2d0c6Smrg	      ;;
78538fc2d0c6Smrg	    esac
78548fc2d0c6Smrg	    ;;
78558fc2d0c6Smrg	esac
78568fc2d0c6Smrg	;;
78578fc2d0c6Smrg      lynxos*)
78588fc2d0c6Smrg	;;
78598fc2d0c6Smrg      m88k*)
78608fc2d0c6Smrg	;;
78618fc2d0c6Smrg      mvs*)
78628fc2d0c6Smrg	case $cc_basename in
78638fc2d0c6Smrg	  cxx*)
78648fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
78658fc2d0c6Smrg	    ;;
78668fc2d0c6Smrg	  *)
78678fc2d0c6Smrg	    ;;
78688fc2d0c6Smrg	esac
78698fc2d0c6Smrg	;;
78708fc2d0c6Smrg      netbsd*)
78718fc2d0c6Smrg	;;
78728fc2d0c6Smrg      *qnx* | *nto*)
78738fc2d0c6Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
78748fc2d0c6Smrg        # it will coredump.
78758fc2d0c6Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
78768fc2d0c6Smrg        ;;
78778fc2d0c6Smrg      osf3* | osf4* | osf5*)
78788fc2d0c6Smrg	case $cc_basename in
78798fc2d0c6Smrg	  KCC*)
78808fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
78818fc2d0c6Smrg	    ;;
78828fc2d0c6Smrg	  RCC*)
78838fc2d0c6Smrg	    # Rational C++ 2.4.1
78848fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
78858fc2d0c6Smrg	    ;;
78868fc2d0c6Smrg	  cxx*)
78878fc2d0c6Smrg	    # Digital/Compaq C++
78888fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
78898fc2d0c6Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
78908fc2d0c6Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
78918fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
78928fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
78938fc2d0c6Smrg	    ;;
78948fc2d0c6Smrg	  *)
78958fc2d0c6Smrg	    ;;
78968fc2d0c6Smrg	esac
78978fc2d0c6Smrg	;;
78988fc2d0c6Smrg      psos*)
78998fc2d0c6Smrg	;;
79008fc2d0c6Smrg      solaris*)
79018fc2d0c6Smrg	case $cc_basename in
79028fc2d0c6Smrg	  CC* | sunCC*)
79038fc2d0c6Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
79048fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
79058fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
79068fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
79078fc2d0c6Smrg	    ;;
79088fc2d0c6Smrg	  gcx*)
79098fc2d0c6Smrg	    # Green Hills C++ Compiler
79108fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
79118fc2d0c6Smrg	    ;;
79128fc2d0c6Smrg	  *)
79138fc2d0c6Smrg	    ;;
79148fc2d0c6Smrg	esac
79158fc2d0c6Smrg	;;
79168fc2d0c6Smrg      sunos4*)
79178fc2d0c6Smrg	case $cc_basename in
79188fc2d0c6Smrg	  CC*)
79198fc2d0c6Smrg	    # Sun C++ 4.x
79208fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
79218fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
79228fc2d0c6Smrg	    ;;
79238fc2d0c6Smrg	  lcc*)
79248fc2d0c6Smrg	    # Lucid
79258fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
79268fc2d0c6Smrg	    ;;
79278fc2d0c6Smrg	  *)
79288fc2d0c6Smrg	    ;;
79298fc2d0c6Smrg	esac
79308fc2d0c6Smrg	;;
79318fc2d0c6Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
79328fc2d0c6Smrg	case $cc_basename in
79338fc2d0c6Smrg	  CC*)
79348fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
79358fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
79368fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
79378fc2d0c6Smrg	    ;;
79388fc2d0c6Smrg	esac
79398fc2d0c6Smrg	;;
79408fc2d0c6Smrg      tandem*)
79418fc2d0c6Smrg	case $cc_basename in
79428fc2d0c6Smrg	  NCC*)
79438fc2d0c6Smrg	    # NonStop-UX NCC 3.20
79448fc2d0c6Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
79458fc2d0c6Smrg	    ;;
79468fc2d0c6Smrg	  *)
79478fc2d0c6Smrg	    ;;
79488fc2d0c6Smrg	esac
79498fc2d0c6Smrg	;;
79508fc2d0c6Smrg      vxworks*)
79518fc2d0c6Smrg	;;
79528fc2d0c6Smrg      *)
79538fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
79548fc2d0c6Smrg	;;
79558fc2d0c6Smrg    esac
79568fc2d0c6Smrg  fi
79578fc2d0c6Smrg],
79588fc2d0c6Smrg[
79598fc2d0c6Smrg  if test yes = "$GCC"; then
79608fc2d0c6Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
79618fc2d0c6Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
79624a041c5bSmacallan
796354b44505Smrg    case $host_os in
79648fc2d0c6Smrg      aix*)
79658fc2d0c6Smrg      # All AIX code is PIC.
79668fc2d0c6Smrg      if test ia64 = "$host_cpu"; then
79678fc2d0c6Smrg	# AIX 5 now supports IA64 processor
79688fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
79698fc2d0c6Smrg      fi
79708fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
79718fc2d0c6Smrg      ;;
79728fc2d0c6Smrg
79738fc2d0c6Smrg    amigaos*)
79748fc2d0c6Smrg      case $host_cpu in
79758fc2d0c6Smrg      powerpc)
79768fc2d0c6Smrg            # see comment about AmigaOS4 .so support
79778fc2d0c6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
797854b44505Smrg        ;;
79798fc2d0c6Smrg      m68k)
79808fc2d0c6Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
79818fc2d0c6Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
79828fc2d0c6Smrg            # like '-m68040'.
79838fc2d0c6Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
798454b44505Smrg        ;;
79858fc2d0c6Smrg      esac
79868fc2d0c6Smrg      ;;
79874a041c5bSmacallan
79888fc2d0c6Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
79898fc2d0c6Smrg      # PIC is the default for these OSes.
79908fc2d0c6Smrg      ;;
79914a041c5bSmacallan
79928fc2d0c6Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
79938fc2d0c6Smrg      # This hack is so that the source file can tell whether it is being
79948fc2d0c6Smrg      # built for inclusion in a dll (and should export symbols for example).
79958fc2d0c6Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
79968fc2d0c6Smrg      # (--disable-auto-import) libraries
79978fc2d0c6Smrg      m4_if([$1], [GCJ], [],
79988fc2d0c6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
79998fc2d0c6Smrg      case $host_os in
80008fc2d0c6Smrg      os2*)
80018fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
80028fc2d0c6Smrg	;;
80038fc2d0c6Smrg      esac
80048fc2d0c6Smrg      ;;
80050a392d7eSmrg
80068fc2d0c6Smrg    darwin* | rhapsody*)
80078fc2d0c6Smrg      # PIC is the default on this platform
80088fc2d0c6Smrg      # Common symbols not allowed in MH_DYLIB files
80098fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
80108fc2d0c6Smrg      ;;
80110a392d7eSmrg
80128fc2d0c6Smrg    haiku*)
80138fc2d0c6Smrg      # PIC is the default for Haiku.
80148fc2d0c6Smrg      # The "-static" flag exists, but is broken.
80158fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
80168fc2d0c6Smrg      ;;
80170a392d7eSmrg
80188fc2d0c6Smrg    hpux*)
80198fc2d0c6Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
80208fc2d0c6Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
80218fc2d0c6Smrg      # sets the default TLS model and affects inlining.
80228fc2d0c6Smrg      case $host_cpu in
80238fc2d0c6Smrg      hppa*64*)
80248fc2d0c6Smrg	# +Z the default
80258fc2d0c6Smrg	;;
80268fc2d0c6Smrg      *)
80278fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
80288fc2d0c6Smrg	;;
80298fc2d0c6Smrg      esac
80308fc2d0c6Smrg      ;;
80310a392d7eSmrg
80328fc2d0c6Smrg    interix[[3-9]]*)
80338fc2d0c6Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
80348fc2d0c6Smrg      # Instead, we relocate shared libraries at runtime.
80358fc2d0c6Smrg      ;;
80360a392d7eSmrg
80378fc2d0c6Smrg    msdosdjgpp*)
80388fc2d0c6Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
80398fc2d0c6Smrg      # on systems that don't support them.
80408fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
80418fc2d0c6Smrg      enable_shared=no
80428fc2d0c6Smrg      ;;
80430a392d7eSmrg
80448fc2d0c6Smrg    *nto* | *qnx*)
80458fc2d0c6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
80468fc2d0c6Smrg      # it will coredump.
80478fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
80488fc2d0c6Smrg      ;;
80490a392d7eSmrg
80508fc2d0c6Smrg    sysv4*MP*)
80518fc2d0c6Smrg      if test -d /usr/nec; then
80528fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
80538fc2d0c6Smrg      fi
80548fc2d0c6Smrg      ;;
80550a392d7eSmrg
80568fc2d0c6Smrg    *)
80578fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
80588fc2d0c6Smrg      ;;
80598fc2d0c6Smrg    esac
80600a392d7eSmrg
80618fc2d0c6Smrg    case $cc_basename in
80628fc2d0c6Smrg    nvcc*) # Cuda Compiler Driver 2.2
80638fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
80648fc2d0c6Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
80658fc2d0c6Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
80668fc2d0c6Smrg      fi
80678fc2d0c6Smrg      ;;
80688fc2d0c6Smrg    esac
80698fc2d0c6Smrg  else
80708fc2d0c6Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
80718fc2d0c6Smrg    case $host_os in
80728fc2d0c6Smrg    aix*)
80738fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
80748fc2d0c6Smrg      if test ia64 = "$host_cpu"; then
80758fc2d0c6Smrg	# AIX 5 now supports IA64 processor
80768fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
80778fc2d0c6Smrg      else
80788fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
80798fc2d0c6Smrg      fi
80808fc2d0c6Smrg      ;;
80810a392d7eSmrg
80828fc2d0c6Smrg    darwin* | rhapsody*)
80838fc2d0c6Smrg      # PIC is the default on this platform
80848fc2d0c6Smrg      # Common symbols not allowed in MH_DYLIB files
80858fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
80868fc2d0c6Smrg      case $cc_basename in
80878fc2d0c6Smrg      nagfor*)
80888fc2d0c6Smrg        # NAG Fortran compiler
80898fc2d0c6Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
80908fc2d0c6Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
80918fc2d0c6Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
80928fc2d0c6Smrg        ;;
80938fc2d0c6Smrg      esac
80948fc2d0c6Smrg      ;;
80950a392d7eSmrg
80968fc2d0c6Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
80978fc2d0c6Smrg      # This hack is so that the source file can tell whether it is being
80988fc2d0c6Smrg      # built for inclusion in a dll (and should export symbols for example).
80998fc2d0c6Smrg      m4_if([$1], [GCJ], [],
81008fc2d0c6Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
81018fc2d0c6Smrg      case $host_os in
81028fc2d0c6Smrg      os2*)
81038fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
81048fc2d0c6Smrg	;;
81058fc2d0c6Smrg      esac
81068fc2d0c6Smrg      ;;
81070a392d7eSmrg
81088fc2d0c6Smrg    hpux9* | hpux10* | hpux11*)
81098fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81108fc2d0c6Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
81118fc2d0c6Smrg      # not for PA HP-UX.
81128fc2d0c6Smrg      case $host_cpu in
81138fc2d0c6Smrg      hppa*64*|ia64*)
81148fc2d0c6Smrg	# +Z the default
81158fc2d0c6Smrg	;;
81168fc2d0c6Smrg      *)
81178fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
81188fc2d0c6Smrg	;;
81198fc2d0c6Smrg      esac
81208fc2d0c6Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
81218fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
81228fc2d0c6Smrg      ;;
81230a392d7eSmrg
81248fc2d0c6Smrg    irix5* | irix6* | nonstopux*)
81258fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81268fc2d0c6Smrg      # PIC (with -KPIC) is the default.
81278fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
81288fc2d0c6Smrg      ;;
81290a392d7eSmrg
81308fc2d0c6Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
81318fc2d0c6Smrg      case $cc_basename in
81328fc2d0c6Smrg      # old Intel for x86_64, which still supported -KPIC.
81338fc2d0c6Smrg      ecc*)
81348fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81358fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
81368fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
81378fc2d0c6Smrg        ;;
81388fc2d0c6Smrg      # icc used to be incompatible with GCC.
81398fc2d0c6Smrg      # ICC 10 doesn't accept -KPIC any more.
81408fc2d0c6Smrg      icc* | ifort*)
81418fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81428fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
81438fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
81448fc2d0c6Smrg        ;;
81458fc2d0c6Smrg      # Lahey Fortran 8.1.
81468fc2d0c6Smrg      lf95*)
81478fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81488fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
81498fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
81508fc2d0c6Smrg	;;
81518fc2d0c6Smrg      nagfor*)
81528fc2d0c6Smrg	# NAG Fortran compiler
81538fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
81548fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
81558fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
81568fc2d0c6Smrg	;;
81578fc2d0c6Smrg      tcc*)
81588fc2d0c6Smrg	# Fabrice Bellard et al's Tiny C Compiler
81598fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81608fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
81618fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
81628fc2d0c6Smrg	;;
81638fc2d0c6Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
81648fc2d0c6Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
81658fc2d0c6Smrg	# which looks to be a dead project)
81668fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81678fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
81688fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
81698fc2d0c6Smrg        ;;
81708fc2d0c6Smrg      ccc*)
81718fc2d0c6Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81728fc2d0c6Smrg        # All Alpha code is PIC.
81738fc2d0c6Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
81748fc2d0c6Smrg        ;;
81758fc2d0c6Smrg      xl* | bgxl* | bgf* | mpixl*)
81768fc2d0c6Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
81778fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81788fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
81798fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
81808fc2d0c6Smrg	;;
81818fc2d0c6Smrg      *)
81828fc2d0c6Smrg	case `$CC -V 2>&1 | $SED 5q` in
81838fc2d0c6Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
81848fc2d0c6Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
81858fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
81868fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
81878fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
81888fc2d0c6Smrg	  ;;
81898fc2d0c6Smrg	*Sun\ F* | *Sun*Fortran*)
81908fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
81918fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
81928fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
81938fc2d0c6Smrg	  ;;
81948fc2d0c6Smrg	*Sun\ C*)
81958fc2d0c6Smrg	  # Sun C 5.9
81968fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
81978fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
81988fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
81998fc2d0c6Smrg	  ;;
82008fc2d0c6Smrg        *Intel*\ [[CF]]*Compiler*)
82018fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
82028fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
82038fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
82048fc2d0c6Smrg	  ;;
82058fc2d0c6Smrg	*Portland\ Group*)
82068fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
82078fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
82088fc2d0c6Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
82098fc2d0c6Smrg	  ;;
82108fc2d0c6Smrg	esac
82118fc2d0c6Smrg	;;
82128fc2d0c6Smrg      esac
82138fc2d0c6Smrg      ;;
82140a392d7eSmrg
82158fc2d0c6Smrg    newsos6)
82168fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
82178fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
82188fc2d0c6Smrg      ;;
82194a041c5bSmacallan
82208fc2d0c6Smrg    *nto* | *qnx*)
82218fc2d0c6Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
82228fc2d0c6Smrg      # it will coredump.
82238fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
82248fc2d0c6Smrg      ;;
82254a041c5bSmacallan
82268fc2d0c6Smrg    osf3* | osf4* | osf5*)
82278fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
82288fc2d0c6Smrg      # All OSF/1 code is PIC.
82298fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
82308fc2d0c6Smrg      ;;
82314a041c5bSmacallan
82328fc2d0c6Smrg    rdos*)
82338fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
82348fc2d0c6Smrg      ;;
82354a041c5bSmacallan
82368fc2d0c6Smrg    solaris*)
82378fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
82388fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
82398fc2d0c6Smrg      case $cc_basename in
82408fc2d0c6Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
82418fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
82428fc2d0c6Smrg      *)
82438fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
82448fc2d0c6Smrg      esac
82458fc2d0c6Smrg      ;;
82464a041c5bSmacallan
82478fc2d0c6Smrg    sunos4*)
82488fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
82498fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
82508fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
82518fc2d0c6Smrg      ;;
82524a041c5bSmacallan
82538fc2d0c6Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
82548fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
82558fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
82568fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
82578fc2d0c6Smrg      ;;
825854b44505Smrg
82598fc2d0c6Smrg    sysv4*MP*)
82608fc2d0c6Smrg      if test -d /usr/nec; then
82618fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
82628fc2d0c6Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
82638fc2d0c6Smrg      fi
82648fc2d0c6Smrg      ;;
82654a041c5bSmacallan
82668fc2d0c6Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
82678fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
82688fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
82698fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
82708fc2d0c6Smrg      ;;
827154b44505Smrg
82728fc2d0c6Smrg    unicos*)
82738fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
82748fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
82758fc2d0c6Smrg      ;;
82764a041c5bSmacallan
82778fc2d0c6Smrg    uts4*)
82788fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
82798fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
82808fc2d0c6Smrg      ;;
82814a041c5bSmacallan
82828fc2d0c6Smrg    *)
82838fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
82848fc2d0c6Smrg      ;;
82858fc2d0c6Smrg    esac
82868fc2d0c6Smrg  fi
828754b44505Smrg])
82888fc2d0c6Smrgcase $host_os in
82898fc2d0c6Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
82908fc2d0c6Smrg  *djgpp*)
82918fc2d0c6Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
82928fc2d0c6Smrg    ;;
82938fc2d0c6Smrg  *)
82948fc2d0c6Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
82958fc2d0c6Smrg    ;;
82968fc2d0c6Smrgesac
82974a041c5bSmacallan
82988fc2d0c6SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
82998fc2d0c6Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
83008fc2d0c6Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
83018fc2d0c6Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
83024a041c5bSmacallan
83038fc2d0c6Smrg#
83048fc2d0c6Smrg# Check to make sure the PIC flag actually works.
83058fc2d0c6Smrg#
83068fc2d0c6Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
83078fc2d0c6Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
83088fc2d0c6Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
83098fc2d0c6Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
83108fc2d0c6Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
83118fc2d0c6Smrg     "" | " "*) ;;
83128fc2d0c6Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
83138fc2d0c6Smrg     esac],
83148fc2d0c6Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
83158fc2d0c6Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
83168fc2d0c6Smrgfi
83178fc2d0c6Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
83188fc2d0c6Smrg	[Additional compiler flags for building library objects])
83190a392d7eSmrg
83208fc2d0c6Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
83218fc2d0c6Smrg	[How to pass a linker flag through the compiler])
83228fc2d0c6Smrg#
83238fc2d0c6Smrg# Check to make sure the static flag actually works.
83248fc2d0c6Smrg#
83258fc2d0c6Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
83268fc2d0c6Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
83278fc2d0c6Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
83288fc2d0c6Smrg  $lt_tmp_static_flag,
83298fc2d0c6Smrg  [],
83308fc2d0c6Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
83318fc2d0c6Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
83328fc2d0c6Smrg	[Compiler flag to prevent dynamic linking])
83338fc2d0c6Smrg])# _LT_COMPILER_PIC
83340a392d7eSmrg
83354a041c5bSmacallan
83368fc2d0c6Smrg# _LT_LINKER_SHLIBS([TAGNAME])
83378fc2d0c6Smrg# ----------------------------
83388fc2d0c6Smrg# See if the linker supports building shared libraries.
83398fc2d0c6Smrgm4_defun([_LT_LINKER_SHLIBS],
83408fc2d0c6Smrg[AC_REQUIRE([LT_PATH_LD])dnl
83418fc2d0c6SmrgAC_REQUIRE([LT_PATH_NM])dnl
83428fc2d0c6Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
83438fc2d0c6Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
83448fc2d0c6Smrgm4_require([_LT_DECL_EGREP])dnl
83458fc2d0c6Smrgm4_require([_LT_DECL_SED])dnl
83468fc2d0c6Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
83478fc2d0c6Smrgm4_require([_LT_TAG_COMPILER])dnl
83488fc2d0c6SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
83498fc2d0c6Smrgm4_if([$1], [CXX], [
83508fc2d0c6Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
83518fc2d0c6Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
83528fc2d0c6Smrg  case $host_os in
83538fc2d0c6Smrg  aix[[4-9]]*)
83548fc2d0c6Smrg    # If we're using GNU nm, then we don't want the "-C" option.
83558fc2d0c6Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
83568fc2d0c6Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
83578fc2d0c6Smrg    # weak defined symbols like other global defined symbols, whereas
83588fc2d0c6Smrg    # GNU nm marks them as "W".
83598fc2d0c6Smrg    # While the 'weak' keyword is ignored in the Export File, we need
83608fc2d0c6Smrg    # it in the Import File for the 'aix-soname' feature, so we have
83618fc2d0c6Smrg    # to replace the "-B" option with "-P" for AIX nm.
83628fc2d0c6Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
83638fc2d0c6Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
83648fc2d0c6Smrg    else
83658fc2d0c6Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
83668fc2d0c6Smrg    fi
83678fc2d0c6Smrg    ;;
83688fc2d0c6Smrg  pw32*)
83698fc2d0c6Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
83708fc2d0c6Smrg    ;;
83718fc2d0c6Smrg  cygwin* | mingw* | cegcc*)
83728fc2d0c6Smrg    case $cc_basename in
83738fc2d0c6Smrg    cl* | icl*)
83748fc2d0c6Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
83758fc2d0c6Smrg      ;;
83768fc2d0c6Smrg    *)
83778fc2d0c6Smrg      _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'
83788fc2d0c6Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
83798fc2d0c6Smrg      ;;
83808fc2d0c6Smrg    esac
83818fc2d0c6Smrg    ;;
83828fc2d0c6Smrg  *)
83838fc2d0c6Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
83848fc2d0c6Smrg    ;;
83858fc2d0c6Smrg  esac
83868fc2d0c6Smrg], [
83878fc2d0c6Smrg  runpath_var=
83888fc2d0c6Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
83898fc2d0c6Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
83908fc2d0c6Smrg  _LT_TAGVAR(archive_cmds, $1)=
83918fc2d0c6Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
83928fc2d0c6Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
83938fc2d0c6Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
83948fc2d0c6Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
83958fc2d0c6Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
83968fc2d0c6Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
83978fc2d0c6Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
83988fc2d0c6Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
83998fc2d0c6Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
84008fc2d0c6Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
84018fc2d0c6Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
84028fc2d0c6Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
84038fc2d0c6Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
84048fc2d0c6Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
84058fc2d0c6Smrg  _LT_TAGVAR(module_cmds, $1)=
84068fc2d0c6Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
84078fc2d0c6Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
84088fc2d0c6Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
84098fc2d0c6Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
84108fc2d0c6Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
84118fc2d0c6Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
84128fc2d0c6Smrg  # included in the symbol list
84138fc2d0c6Smrg  _LT_TAGVAR(include_expsyms, $1)=
84148fc2d0c6Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
84158fc2d0c6Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
84168fc2d0c6Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
84178fc2d0c6Smrg  # as well as any symbol that contains 'd'.
84188fc2d0c6Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
84198fc2d0c6Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
84208fc2d0c6Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
84218fc2d0c6Smrg  # the symbol is explicitly referenced.  Since portable code cannot
84228fc2d0c6Smrg  # rely on this symbol name, it's probably fine to never include it in
84238fc2d0c6Smrg  # preloaded symbol tables.
84248fc2d0c6Smrg  # Exclude shared library initialization/finalization symbols.
84258fc2d0c6Smrgdnl Note also adjust exclude_expsyms for C++ above.
84268fc2d0c6Smrg  extract_expsyms_cmds=
842754b44505Smrg
84288fc2d0c6Smrg  case $host_os in
84298fc2d0c6Smrg  cygwin* | mingw* | pw32* | cegcc*)
84308fc2d0c6Smrg    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
84318fc2d0c6Smrg    # When not using gcc, we currently assume that we are using
84328fc2d0c6Smrg    # Microsoft Visual C++ or Intel C++ Compiler.
84338fc2d0c6Smrg    if test yes != "$GCC"; then
84348fc2d0c6Smrg      with_gnu_ld=no
84358fc2d0c6Smrg    fi
84368fc2d0c6Smrg    ;;
84378fc2d0c6Smrg  interix*)
84388fc2d0c6Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
84398fc2d0c6Smrg    with_gnu_ld=yes
84408fc2d0c6Smrg    ;;
84418fc2d0c6Smrg  openbsd* | bitrig*)
84428fc2d0c6Smrg    with_gnu_ld=no
84438fc2d0c6Smrg    ;;
84448fc2d0c6Smrg  esac
844554b44505Smrg
84468fc2d0c6Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
84474a041c5bSmacallan
84488fc2d0c6Smrg  # On some targets, GNU ld is compatible enough with the native linker
84498fc2d0c6Smrg  # that we're better off using the native interface for both.
84508fc2d0c6Smrg  lt_use_gnu_ld_interface=no
84518fc2d0c6Smrg  if test yes = "$with_gnu_ld"; then
84528fc2d0c6Smrg    case $host_os in
84538fc2d0c6Smrg      aix*)
84548fc2d0c6Smrg	# The AIX port of GNU ld has always aspired to compatibility
84558fc2d0c6Smrg	# with the native linker.  However, as the warning in the GNU ld
84568fc2d0c6Smrg	# block says, versions before 2.19.5* couldn't really create working
84578fc2d0c6Smrg	# shared libraries, regardless of the interface used.
84588fc2d0c6Smrg	case `$LD -v 2>&1` in
84598fc2d0c6Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
84608fc2d0c6Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
84618fc2d0c6Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
84628fc2d0c6Smrg	  *)
84638fc2d0c6Smrg	    lt_use_gnu_ld_interface=yes
84648fc2d0c6Smrg	    ;;
84658fc2d0c6Smrg	esac
84668fc2d0c6Smrg	;;
84678fc2d0c6Smrg      *)
84688fc2d0c6Smrg	lt_use_gnu_ld_interface=yes
84698fc2d0c6Smrg	;;
84708fc2d0c6Smrg    esac
84718fc2d0c6Smrg  fi
84724a041c5bSmacallan
84738fc2d0c6Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
84748fc2d0c6Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
84758fc2d0c6Smrg    wlarc='$wl'
84764a041c5bSmacallan
84778fc2d0c6Smrg    # Set some defaults for GNU ld with shared library support. These
84788fc2d0c6Smrg    # are reset later if shared libraries are not supported. Putting them
84798fc2d0c6Smrg    # here allows them to be overridden if necessary.
84808fc2d0c6Smrg    runpath_var=LD_RUN_PATH
84818fc2d0c6Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
84828fc2d0c6Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
84838fc2d0c6Smrg    # ancient GNU ld didn't support --whole-archive et. al.
84848fc2d0c6Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
84858fc2d0c6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
84868fc2d0c6Smrg    else
84878fc2d0c6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
84888fc2d0c6Smrg    fi
84898fc2d0c6Smrg    supports_anon_versioning=no
84908fc2d0c6Smrg    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
84918fc2d0c6Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
84928fc2d0c6Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
84938fc2d0c6Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
84948fc2d0c6Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
84958fc2d0c6Smrg      *\ 2.11.*) ;; # other 2.11 versions
84968fc2d0c6Smrg      *) supports_anon_versioning=yes ;;
84978fc2d0c6Smrg    esac
84984a041c5bSmacallan
84998fc2d0c6Smrg    # See if GNU ld supports shared libraries.
85008fc2d0c6Smrg    case $host_os in
85018fc2d0c6Smrg    aix[[3-9]]*)
85028fc2d0c6Smrg      # On AIX/PPC, the GNU linker is very broken
85038fc2d0c6Smrg      if test ia64 != "$host_cpu"; then
85048fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
85058fc2d0c6Smrg	cat <<_LT_EOF 1>&2
85064a041c5bSmacallan
85078fc2d0c6Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
85088fc2d0c6Smrg*** to be unable to reliably create shared libraries on AIX.
85098fc2d0c6Smrg*** Therefore, libtool is disabling shared libraries support.  If you
85108fc2d0c6Smrg*** really care for shared libraries, you may want to install binutils
85118fc2d0c6Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
85128fc2d0c6Smrg*** You will then need to restart the configuration process.
851354b44505Smrg
85148fc2d0c6Smrg_LT_EOF
85154a041c5bSmacallan      fi
85168fc2d0c6Smrg      ;;
851754b44505Smrg
85188fc2d0c6Smrg    amigaos*)
85198fc2d0c6Smrg      case $host_cpu in
85208fc2d0c6Smrg      powerpc)
85218fc2d0c6Smrg            # see comment about AmigaOS4 .so support
85228fc2d0c6Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
85238fc2d0c6Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
85248fc2d0c6Smrg        ;;
85258fc2d0c6Smrg      m68k)
85268fc2d0c6Smrg            _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)'
85278fc2d0c6Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
85288fc2d0c6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
85298fc2d0c6Smrg        ;;
85308fc2d0c6Smrg      esac
85318fc2d0c6Smrg      ;;
853254b44505Smrg
85338fc2d0c6Smrg    beos*)
85348fc2d0c6Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
85358fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
85368fc2d0c6Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
85378fc2d0c6Smrg	# support --undefined.  This deserves some investigation.  FIXME
85388fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
85398fc2d0c6Smrg      else
85408fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
85418fc2d0c6Smrg      fi
85428fc2d0c6Smrg      ;;
854354b44505Smrg
85448fc2d0c6Smrg    cygwin* | mingw* | pw32* | cegcc*)
85458fc2d0c6Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
85468fc2d0c6Smrg      # as there is no search path for DLLs.
85478fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
85488fc2d0c6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
85498fc2d0c6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
85508fc2d0c6Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
85518fc2d0c6Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
85528fc2d0c6Smrg      _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'
85538fc2d0c6Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
855454b44505Smrg
85558fc2d0c6Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
85568fc2d0c6Smrg        _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'
85578fc2d0c6Smrg	# If the export-symbols file already is a .def file, use it as
85588fc2d0c6Smrg	# is; otherwise, prepend EXPORTS...
85598fc2d0c6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
85608fc2d0c6Smrg          cp $export_symbols $output_objdir/$soname.def;
85618fc2d0c6Smrg        else
85628fc2d0c6Smrg          echo EXPORTS > $output_objdir/$soname.def;
85638fc2d0c6Smrg          cat $export_symbols >> $output_objdir/$soname.def;
85648fc2d0c6Smrg        fi~
85658fc2d0c6Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
85668fc2d0c6Smrg      else
85678fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
85688fc2d0c6Smrg      fi
85698fc2d0c6Smrg      ;;
857054b44505Smrg
85718fc2d0c6Smrg    haiku*)
85728fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
85738fc2d0c6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
85748fc2d0c6Smrg      ;;
857554b44505Smrg
85768fc2d0c6Smrg    os2*)
85778fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
85788fc2d0c6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
85798fc2d0c6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
85808fc2d0c6Smrg      shrext_cmds=.dll
85818fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
85828fc2d0c6Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
85838fc2d0c6Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
85848fc2d0c6Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
85858fc2d0c6Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
85868fc2d0c6Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
85878fc2d0c6Smrg	emximp -o $lib $output_objdir/$libname.def'
85888fc2d0c6Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
85898fc2d0c6Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
85908fc2d0c6Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
85918fc2d0c6Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
85928fc2d0c6Smrg	prefix_cmds="$SED"~
85938fc2d0c6Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
85948fc2d0c6Smrg	  prefix_cmds="$prefix_cmds -e 1d";
85958fc2d0c6Smrg	fi~
85968fc2d0c6Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
85978fc2d0c6Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
85988fc2d0c6Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
85998fc2d0c6Smrg	emximp -o $lib $output_objdir/$libname.def'
86008fc2d0c6Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
86018fc2d0c6Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
86028fc2d0c6Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
86038fc2d0c6Smrg      ;;
86048fc2d0c6Smrg
86058fc2d0c6Smrg    interix[[3-9]]*)
86068fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
86078fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
86088fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
86098fc2d0c6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
86108fc2d0c6Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
86118fc2d0c6Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
86128fc2d0c6Smrg      # default) and relocated if they conflict, which is a slow very memory
86138fc2d0c6Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
86148fc2d0c6Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
86158fc2d0c6Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
86168fc2d0c6Smrg      _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'
86178fc2d0c6Smrg      _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'
86188fc2d0c6Smrg      ;;
861954b44505Smrg
86208fc2d0c6Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
86218fc2d0c6Smrg      tmp_diet=no
86228fc2d0c6Smrg      if test linux-dietlibc = "$host_os"; then
86238fc2d0c6Smrg	case $cc_basename in
86248fc2d0c6Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
86258fc2d0c6Smrg	esac
86268fc2d0c6Smrg      fi
86278fc2d0c6Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
86288fc2d0c6Smrg	 && test no = "$tmp_diet"
86298fc2d0c6Smrg      then
86308fc2d0c6Smrg	tmp_addflag=' $pic_flag'
86318fc2d0c6Smrg	tmp_sharedflag='-shared'
86328fc2d0c6Smrg	case $cc_basename,$host_cpu in
86338fc2d0c6Smrg        pgcc*)				# Portland Group C compiler
86348fc2d0c6Smrg	  _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'
86358fc2d0c6Smrg	  tmp_addflag=' $pic_flag'
86368fc2d0c6Smrg	  ;;
86378fc2d0c6Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
86388fc2d0c6Smrg					# Portland Group f77 and f90 compilers
86398fc2d0c6Smrg	  _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'
86408fc2d0c6Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
86418fc2d0c6Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
86428fc2d0c6Smrg	  tmp_addflag=' -i_dynamic' ;;
86438fc2d0c6Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
86448fc2d0c6Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
86458fc2d0c6Smrg	ifc* | ifort*)			# Intel Fortran compiler
86468fc2d0c6Smrg	  tmp_addflag=' -nofor_main' ;;
86478fc2d0c6Smrg	lf95*)				# Lahey Fortran 8.1
86488fc2d0c6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
86498fc2d0c6Smrg	  tmp_sharedflag='--shared' ;;
86508fc2d0c6Smrg        nagfor*)                        # NAGFOR 5.3
86518fc2d0c6Smrg          tmp_sharedflag='-Wl,-shared' ;;
86528fc2d0c6Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
86538fc2d0c6Smrg	  tmp_sharedflag='-qmkshrobj'
86548fc2d0c6Smrg	  tmp_addflag= ;;
86558fc2d0c6Smrg	nvcc*)	# Cuda Compiler Driver 2.2
86568fc2d0c6Smrg	  _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'
86578fc2d0c6Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
86588fc2d0c6Smrg	  ;;
86598fc2d0c6Smrg	esac
86608fc2d0c6Smrg	case `$CC -V 2>&1 | $SED 5q` in
86618fc2d0c6Smrg	*Sun\ C*)			# Sun C 5.9
86628fc2d0c6Smrg	  _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'
86638fc2d0c6Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
86648fc2d0c6Smrg	  tmp_sharedflag='-G' ;;
86658fc2d0c6Smrg	*Sun\ F*)			# Sun Fortran 8.3
86668fc2d0c6Smrg	  tmp_sharedflag='-G' ;;
86678fc2d0c6Smrg	esac
86688fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
866954b44505Smrg
86708fc2d0c6Smrg        if test yes = "$supports_anon_versioning"; then
86718fc2d0c6Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
86728fc2d0c6Smrg            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
86738fc2d0c6Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
86748fc2d0c6Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
86758fc2d0c6Smrg        fi
867654b44505Smrg
86778fc2d0c6Smrg	case $cc_basename in
86788fc2d0c6Smrg	tcc*)
86798fc2d0c6Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
86808fc2d0c6Smrg	  ;;
86818fc2d0c6Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
86828fc2d0c6Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
86838fc2d0c6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
86848fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
86858fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
86868fc2d0c6Smrg	  if test yes = "$supports_anon_versioning"; then
86878fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
86888fc2d0c6Smrg              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
86898fc2d0c6Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
86908fc2d0c6Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
86918fc2d0c6Smrg	  fi
86928fc2d0c6Smrg	  ;;
86938fc2d0c6Smrg	esac
86948fc2d0c6Smrg      else
86958fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
86968fc2d0c6Smrg      fi
86978fc2d0c6Smrg      ;;
869854b44505Smrg
86998fc2d0c6Smrg    netbsd*)
87008fc2d0c6Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
87018fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
87028fc2d0c6Smrg	wlarc=
87038fc2d0c6Smrg      else
87048fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
87058fc2d0c6Smrg	_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'
87068fc2d0c6Smrg      fi
87078fc2d0c6Smrg      ;;
870854b44505Smrg
87098fc2d0c6Smrg    solaris*)
87108fc2d0c6Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
87118fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
87128fc2d0c6Smrg	cat <<_LT_EOF 1>&2
871354b44505Smrg
87148fc2d0c6Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
87158fc2d0c6Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
87168fc2d0c6Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
87178fc2d0c6Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
87188fc2d0c6Smrg*** your PATH or compiler configuration so that the native linker is
87198fc2d0c6Smrg*** used, and then restart.
872054b44505Smrg
87218fc2d0c6Smrg_LT_EOF
87228fc2d0c6Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
87238fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
87248fc2d0c6Smrg	_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'
87258fc2d0c6Smrg      else
87268fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
87278fc2d0c6Smrg      fi
87288fc2d0c6Smrg      ;;
872954b44505Smrg
87308fc2d0c6Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
87318fc2d0c6Smrg      case `$LD -v 2>&1` in
87328fc2d0c6Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
87338fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
87348fc2d0c6Smrg	cat <<_LT_EOF 1>&2
873554b44505Smrg
87368fc2d0c6Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
87378fc2d0c6Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
87388fc2d0c6Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
87398fc2d0c6Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
87408fc2d0c6Smrg*** your PATH or compiler configuration so that the native linker is
87418fc2d0c6Smrg*** used, and then restart.
874254b44505Smrg
87438fc2d0c6Smrg_LT_EOF
87448fc2d0c6Smrg	;;
87458fc2d0c6Smrg	*)
87468fc2d0c6Smrg	  # For security reasons, it is highly recommended that you always
87478fc2d0c6Smrg	  # use absolute paths for naming shared libraries, and exclude the
87488fc2d0c6Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
87498fc2d0c6Smrg	  # requires that you compile everything twice, which is a pain.
87508fc2d0c6Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
87518fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
87528fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
87538fc2d0c6Smrg	    _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'
87548fc2d0c6Smrg	  else
87558fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
87568fc2d0c6Smrg	  fi
87578fc2d0c6Smrg	;;
87588fc2d0c6Smrg      esac
87598fc2d0c6Smrg      ;;
87608fc2d0c6Smrg
87618fc2d0c6Smrg    sunos4*)
87628fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
87638fc2d0c6Smrg      wlarc=
87648fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
87658fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
87668fc2d0c6Smrg      ;;
876754b44505Smrg
87688fc2d0c6Smrg    *)
87698fc2d0c6Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
87708fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
87718fc2d0c6Smrg	_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'
87728fc2d0c6Smrg      else
87738fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
87748fc2d0c6Smrg      fi
87758fc2d0c6Smrg      ;;
87768fc2d0c6Smrg    esac
877754b44505Smrg
87788fc2d0c6Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
87798fc2d0c6Smrg      runpath_var=
87808fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
87818fc2d0c6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
87828fc2d0c6Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
87838fc2d0c6Smrg    fi
87848fc2d0c6Smrg  else
87858fc2d0c6Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
87868fc2d0c6Smrg    case $host_os in
87878fc2d0c6Smrg    aix3*)
87888fc2d0c6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
87898fc2d0c6Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
87908fc2d0c6Smrg      _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'
87918fc2d0c6Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
87928fc2d0c6Smrg      # are no directories specified by -L.
87938fc2d0c6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
87948fc2d0c6Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
87958fc2d0c6Smrg	# Neither direct hardcoding nor static linking is supported with a
87968fc2d0c6Smrg	# broken collect2.
87978fc2d0c6Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
87988fc2d0c6Smrg      fi
87998fc2d0c6Smrg      ;;
880054b44505Smrg
88018fc2d0c6Smrg    aix[[4-9]]*)
88028fc2d0c6Smrg      if test ia64 = "$host_cpu"; then
88038fc2d0c6Smrg	# On IA64, the linker does run time linking by default, so we don't
88048fc2d0c6Smrg	# have to do anything special.
88058fc2d0c6Smrg	aix_use_runtimelinking=no
88068fc2d0c6Smrg	exp_sym_flag='-Bexport'
88078fc2d0c6Smrg	no_entry_flag=
88088fc2d0c6Smrg      else
88098fc2d0c6Smrg	# If we're using GNU nm, then we don't want the "-C" option.
88108fc2d0c6Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
88118fc2d0c6Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
88128fc2d0c6Smrg	# weak defined symbols like other global defined symbols, whereas
88138fc2d0c6Smrg	# GNU nm marks them as "W".
88148fc2d0c6Smrg	# While the 'weak' keyword is ignored in the Export File, we need
88158fc2d0c6Smrg	# it in the Import File for the 'aix-soname' feature, so we have
88168fc2d0c6Smrg	# to replace the "-B" option with "-P" for AIX nm.
88178fc2d0c6Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
88188fc2d0c6Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
88198fc2d0c6Smrg	else
88208fc2d0c6Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
88218fc2d0c6Smrg	fi
88228fc2d0c6Smrg	aix_use_runtimelinking=no
882354b44505Smrg
88248fc2d0c6Smrg	# Test if we are trying to use run time linking or normal
88258fc2d0c6Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
88268fc2d0c6Smrg	# have runtime linking enabled, and use it for executables.
88278fc2d0c6Smrg	# For shared libraries, we enable/disable runtime linking
88288fc2d0c6Smrg	# depending on the kind of the shared library created -
88298fc2d0c6Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
88308fc2d0c6Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
88318fc2d0c6Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
88328fc2d0c6Smrg	#            lib.a           static archive
88338fc2d0c6Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
88348fc2d0c6Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
88358fc2d0c6Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
88368fc2d0c6Smrg	#            lib.a(lib.so.V) shared, rtl:no
88378fc2d0c6Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
88388fc2d0c6Smrg	#            lib.a           static archive
88398fc2d0c6Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
88408fc2d0c6Smrg	  for ld_flag in $LDFLAGS; do
88418fc2d0c6Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
88428fc2d0c6Smrg	    aix_use_runtimelinking=yes
88438fc2d0c6Smrg	    break
88448fc2d0c6Smrg	  fi
88458fc2d0c6Smrg	  done
88468fc2d0c6Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
88478fc2d0c6Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
88488fc2d0c6Smrg	    # so we don't have lib.a shared libs to link our executables.
88498fc2d0c6Smrg	    # We have to force runtime linking in this case.
88508fc2d0c6Smrg	    aix_use_runtimelinking=yes
88518fc2d0c6Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
88528fc2d0c6Smrg	  fi
88538fc2d0c6Smrg	  ;;
88548fc2d0c6Smrg	esac
885554b44505Smrg
88568fc2d0c6Smrg	exp_sym_flag='-bexport'
88578fc2d0c6Smrg	no_entry_flag='-bnoentry'
88588fc2d0c6Smrg      fi
885954b44505Smrg
88608fc2d0c6Smrg      # When large executables or shared objects are built, AIX ld can
88618fc2d0c6Smrg      # have problems creating the table of contents.  If linking a library
88628fc2d0c6Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
88638fc2d0c6Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
88648fc2d0c6Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
886554b44505Smrg
88668fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)=''
88678fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
88688fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
88698fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
88708fc2d0c6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
88718fc2d0c6Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
88728fc2d0c6Smrg      case $with_aix_soname,$aix_use_runtimelinking in
88738fc2d0c6Smrg      aix,*) ;; # traditional, no import file
88748fc2d0c6Smrg      svr4,* | *,yes) # use import file
88758fc2d0c6Smrg	# The Import File defines what to hardcode.
88768fc2d0c6Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
88778fc2d0c6Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
88788fc2d0c6Smrg	;;
88798fc2d0c6Smrg      esac
888054b44505Smrg
88818fc2d0c6Smrg      if test yes = "$GCC"; then
88828fc2d0c6Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
88838fc2d0c6Smrg	# We only want to do this on AIX 4.2 and lower, the check
88848fc2d0c6Smrg	# below for broken collect2 doesn't work under 4.3+
88858fc2d0c6Smrg	  collect2name=`$CC -print-prog-name=collect2`
88868fc2d0c6Smrg	  if test -f "$collect2name" &&
88878fc2d0c6Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
88888fc2d0c6Smrg	  then
88898fc2d0c6Smrg	  # We have reworked collect2
88908fc2d0c6Smrg	  :
88918fc2d0c6Smrg	  else
88928fc2d0c6Smrg	  # We have old collect2
88938fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
88948fc2d0c6Smrg	  # It fails to find uninstalled libraries when the uninstalled
88958fc2d0c6Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
88968fc2d0c6Smrg	  # to unsupported forces relinking
88978fc2d0c6Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
88988fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
88998fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
89008fc2d0c6Smrg	  fi
89018fc2d0c6Smrg	  ;;
89028fc2d0c6Smrg	esac
89038fc2d0c6Smrg	shared_flag='-shared'
89048fc2d0c6Smrg	if test yes = "$aix_use_runtimelinking"; then
89058fc2d0c6Smrg	  shared_flag="$shared_flag "'$wl-G'
89068fc2d0c6Smrg	fi
89078fc2d0c6Smrg	# Need to ensure runtime linking is disabled for the traditional
89088fc2d0c6Smrg	# shared library, or the linker may eventually find shared libraries
89098fc2d0c6Smrg	# /with/ Import File - we do not want to mix them.
89108fc2d0c6Smrg	shared_flag_aix='-shared'
89118fc2d0c6Smrg	shared_flag_svr4='-shared $wl-G'
89128fc2d0c6Smrg      else
89138fc2d0c6Smrg	# not using gcc
89148fc2d0c6Smrg	if test ia64 = "$host_cpu"; then
89158fc2d0c6Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
89168fc2d0c6Smrg	# chokes on -Wl,-G. The following line is correct:
89178fc2d0c6Smrg	  shared_flag='-G'
89188fc2d0c6Smrg	else
89198fc2d0c6Smrg	  if test yes = "$aix_use_runtimelinking"; then
89208fc2d0c6Smrg	    shared_flag='$wl-G'
89218fc2d0c6Smrg	  else
89228fc2d0c6Smrg	    shared_flag='$wl-bM:SRE'
89238fc2d0c6Smrg	  fi
89248fc2d0c6Smrg	  shared_flag_aix='$wl-bM:SRE'
89258fc2d0c6Smrg	  shared_flag_svr4='$wl-G'
89268fc2d0c6Smrg	fi
89278fc2d0c6Smrg      fi
892854b44505Smrg
89298fc2d0c6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
89308fc2d0c6Smrg      # It seems that -bexpall does not export symbols beginning with
89318fc2d0c6Smrg      # underscore (_), so it is better to generate a list of symbols to export.
89328fc2d0c6Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
89338fc2d0c6Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
89348fc2d0c6Smrg	# Warning - without using the other runtime loading flags (-brtl),
89358fc2d0c6Smrg	# -berok will link without error, but may produce a broken library.
89368fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
89378fc2d0c6Smrg        # Determine the default libpath from the value encoded in an
89388fc2d0c6Smrg        # empty executable.
89398fc2d0c6Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
89408fc2d0c6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
89418fc2d0c6Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
89428fc2d0c6Smrg      else
89438fc2d0c6Smrg	if test ia64 = "$host_cpu"; then
89448fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
89458fc2d0c6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
89468fc2d0c6Smrg	  _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"
89478fc2d0c6Smrg	else
89488fc2d0c6Smrg	 # Determine the default libpath from the value encoded in an
89498fc2d0c6Smrg	 # empty executable.
89508fc2d0c6Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
89518fc2d0c6Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
89528fc2d0c6Smrg	  # Warning - without using the other run time loading flags,
89538fc2d0c6Smrg	  # -berok will link without error, but may produce a broken library.
89548fc2d0c6Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
89558fc2d0c6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
89568fc2d0c6Smrg	  if test yes = "$with_gnu_ld"; then
89578fc2d0c6Smrg	    # We only use this code for GNU lds that support --whole-archive.
89588fc2d0c6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
89598fc2d0c6Smrg	  else
89608fc2d0c6Smrg	    # Exported symbols can be pulled into shared objects from archives
89618fc2d0c6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
89628fc2d0c6Smrg	  fi
89638fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
89648fc2d0c6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
89658fc2d0c6Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
89668fc2d0c6Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
89678fc2d0c6Smrg	  if test svr4 != "$with_aix_soname"; then
89688fc2d0c6Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
89698fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
89708fc2d0c6Smrg	  fi
89718fc2d0c6Smrg	  if test aix != "$with_aix_soname"; then
89728fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
89738fc2d0c6Smrg	  else
89748fc2d0c6Smrg	    # used by -dlpreopen to get the symbols
89758fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
89768fc2d0c6Smrg	  fi
89778fc2d0c6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
89788fc2d0c6Smrg	fi
89798fc2d0c6Smrg      fi
89808fc2d0c6Smrg      ;;
898154b44505Smrg
89828fc2d0c6Smrg    amigaos*)
89838fc2d0c6Smrg      case $host_cpu in
89848fc2d0c6Smrg      powerpc)
89858fc2d0c6Smrg            # see comment about AmigaOS4 .so support
89868fc2d0c6Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
89878fc2d0c6Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
89888fc2d0c6Smrg        ;;
89898fc2d0c6Smrg      m68k)
89908fc2d0c6Smrg            _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)'
89918fc2d0c6Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
89928fc2d0c6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
89938fc2d0c6Smrg        ;;
89948fc2d0c6Smrg      esac
89958fc2d0c6Smrg      ;;
899654b44505Smrg
89978fc2d0c6Smrg    bsdi[[45]]*)
89988fc2d0c6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
89998fc2d0c6Smrg      ;;
900054b44505Smrg
90018fc2d0c6Smrg    cygwin* | mingw* | pw32* | cegcc*)
90028fc2d0c6Smrg      # When not using gcc, we currently assume that we are using
90038fc2d0c6Smrg      # Microsoft Visual C++ or Intel C++ Compiler.
90048fc2d0c6Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
90058fc2d0c6Smrg      # no search path for DLLs.
90068fc2d0c6Smrg      case $cc_basename in
90078fc2d0c6Smrg      cl* | icl*)
90088fc2d0c6Smrg	# Native MSVC or ICC
90098fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
90108fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
90118fc2d0c6Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
90128fc2d0c6Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
90138fc2d0c6Smrg	# Tell ltmain to make .lib files, not .a files.
90148fc2d0c6Smrg	libext=lib
90158fc2d0c6Smrg	# Tell ltmain to make .dll files, not .so files.
90168fc2d0c6Smrg	shrext_cmds=.dll
90178fc2d0c6Smrg	# FIXME: Setting linknames here is a bad hack.
90188fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
90198fc2d0c6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
90208fc2d0c6Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
90218fc2d0c6Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
90228fc2d0c6Smrg          else
90238fc2d0c6Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
90248fc2d0c6Smrg          fi~
90258fc2d0c6Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
90268fc2d0c6Smrg          linknames='
90278fc2d0c6Smrg	# The linker will not automatically build a static lib if we build a DLL.
90288fc2d0c6Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
90298fc2d0c6Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
90308fc2d0c6Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
90318fc2d0c6Smrg	_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'
90328fc2d0c6Smrg	# Don't use ranlib
90338fc2d0c6Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
90348fc2d0c6Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
90358fc2d0c6Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
90368fc2d0c6Smrg          case $lt_outputfile in
90378fc2d0c6Smrg            *.exe|*.EXE) ;;
90388fc2d0c6Smrg            *)
90398fc2d0c6Smrg              lt_outputfile=$lt_outputfile.exe
90408fc2d0c6Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
90418fc2d0c6Smrg              ;;
90428fc2d0c6Smrg          esac~
90438fc2d0c6Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
90448fc2d0c6Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
90458fc2d0c6Smrg            $RM "$lt_outputfile.manifest";
90468fc2d0c6Smrg          fi'
90478fc2d0c6Smrg	;;
90488fc2d0c6Smrg      *)
90498fc2d0c6Smrg	# Assume MSVC and ICC wrapper
90508fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
90518fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
90528fc2d0c6Smrg	# Tell ltmain to make .lib files, not .a files.
90538fc2d0c6Smrg	libext=lib
90548fc2d0c6Smrg	# Tell ltmain to make .dll files, not .so files.
90558fc2d0c6Smrg	shrext_cmds=.dll
90568fc2d0c6Smrg	# FIXME: Setting linknames here is a bad hack.
90578fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
90588fc2d0c6Smrg	# The linker will automatically build a .lib file if we build a DLL.
90598fc2d0c6Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
90608fc2d0c6Smrg	# FIXME: Should let the user specify the lib program.
90618fc2d0c6Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
90628fc2d0c6Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
90638fc2d0c6Smrg	;;
90648fc2d0c6Smrg      esac
90658fc2d0c6Smrg      ;;
906654b44505Smrg
90678fc2d0c6Smrg    darwin* | rhapsody*)
90688fc2d0c6Smrg      _LT_DARWIN_LINKER_FEATURES($1)
90698fc2d0c6Smrg      ;;
907054b44505Smrg
90718fc2d0c6Smrg    dgux*)
90728fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
90738fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
90748fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
90758fc2d0c6Smrg      ;;
907654b44505Smrg
90778fc2d0c6Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
90788fc2d0c6Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
90798fc2d0c6Smrg    # does not break anything, and helps significantly (at the cost of a little
90808fc2d0c6Smrg    # extra space).
90818fc2d0c6Smrg    freebsd2.2*)
90828fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
90838fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
90848fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
90858fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
90868fc2d0c6Smrg      ;;
908754b44505Smrg
90888fc2d0c6Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
90898fc2d0c6Smrg    freebsd2.*)
90908fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
90918fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
90928fc2d0c6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
90938fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
90948fc2d0c6Smrg      ;;
909554b44505Smrg
90968fc2d0c6Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
90978fc2d0c6Smrg    freebsd* | dragonfly* | midnightbsd*)
90988fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
90998fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
91008fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
91018fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
91028fc2d0c6Smrg      ;;
910354b44505Smrg
91048fc2d0c6Smrg    hpux9*)
91058fc2d0c6Smrg      if test yes = "$GCC"; then
91068fc2d0c6Smrg	_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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
91078fc2d0c6Smrg      else
91088fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
91098fc2d0c6Smrg      fi
91108fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
91118fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
91128fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
911354b44505Smrg
91148fc2d0c6Smrg      # hardcode_minus_L: Not really in the search PATH,
91158fc2d0c6Smrg      # but as the default location of the library.
91168fc2d0c6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
91178fc2d0c6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
91188fc2d0c6Smrg      ;;
911954b44505Smrg
91208fc2d0c6Smrg    hpux10*)
91218fc2d0c6Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
91228fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
91238fc2d0c6Smrg      else
91248fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
91258fc2d0c6Smrg      fi
91268fc2d0c6Smrg      if test no = "$with_gnu_ld"; then
91278fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
91288fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
91298fc2d0c6Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
91308fc2d0c6Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
91318fc2d0c6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
91328fc2d0c6Smrg	# hardcode_minus_L: Not really in the search PATH,
91338fc2d0c6Smrg	# but as the default location of the library.
91348fc2d0c6Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
91358fc2d0c6Smrg      fi
91368fc2d0c6Smrg      ;;
913754b44505Smrg
91388fc2d0c6Smrg    hpux11*)
91398fc2d0c6Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
91408fc2d0c6Smrg	case $host_cpu in
91418fc2d0c6Smrg	hppa*64*)
91428fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
91438fc2d0c6Smrg	  ;;
91448fc2d0c6Smrg	ia64*)
91458fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
91468fc2d0c6Smrg	  ;;
91478fc2d0c6Smrg	*)
91488fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
91498fc2d0c6Smrg	  ;;
91508fc2d0c6Smrg	esac
91518fc2d0c6Smrg      else
91528fc2d0c6Smrg	case $host_cpu in
91538fc2d0c6Smrg	hppa*64*)
91548fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
91558fc2d0c6Smrg	  ;;
91568fc2d0c6Smrg	ia64*)
91578fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
91588fc2d0c6Smrg	  ;;
91598fc2d0c6Smrg	*)
91608fc2d0c6Smrg	m4_if($1, [], [
91618fc2d0c6Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
91628fc2d0c6Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
91638fc2d0c6Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
91648fc2d0c6Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
91658fc2d0c6Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
91668fc2d0c6Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
91678fc2d0c6Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
91688fc2d0c6Smrg	  ;;
91698fc2d0c6Smrg	esac
91708fc2d0c6Smrg      fi
91718fc2d0c6Smrg      if test no = "$with_gnu_ld"; then
91728fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
91738fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
917454b44505Smrg
91758fc2d0c6Smrg	case $host_cpu in
91768fc2d0c6Smrg	hppa*64*|ia64*)
91778fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
91788fc2d0c6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
91798fc2d0c6Smrg	  ;;
91808fc2d0c6Smrg	*)
91818fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
91828fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
91838fc2d0c6Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
918454b44505Smrg
91858fc2d0c6Smrg	  # hardcode_minus_L: Not really in the search PATH,
91868fc2d0c6Smrg	  # but as the default location of the library.
91878fc2d0c6Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
91888fc2d0c6Smrg	  ;;
91898fc2d0c6Smrg	esac
91908fc2d0c6Smrg      fi
91918fc2d0c6Smrg      ;;
919254b44505Smrg
91938fc2d0c6Smrg    irix5* | irix6* | nonstopux*)
91948fc2d0c6Smrg      if test yes = "$GCC"; then
91958fc2d0c6Smrg	_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'
91968fc2d0c6Smrg	# Try to use the -exported_symbol ld option, if it does not
91978fc2d0c6Smrg	# work, assume that -exports_file does not work either and
91988fc2d0c6Smrg	# implicitly export all symbols.
91998fc2d0c6Smrg	# This should be the same for all languages, so no per-tag cache variable.
92008fc2d0c6Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
92018fc2d0c6Smrg	  [lt_cv_irix_exported_symbol],
92028fc2d0c6Smrg	  [save_LDFLAGS=$LDFLAGS
92038fc2d0c6Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
92048fc2d0c6Smrg	   AC_LINK_IFELSE(
92058fc2d0c6Smrg	     [AC_LANG_SOURCE(
92068fc2d0c6Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
92078fc2d0c6Smrg			      [C++], [[int foo (void) { return 0; }]],
92088fc2d0c6Smrg			      [Fortran 77], [[
92098fc2d0c6Smrg      subroutine foo
92108fc2d0c6Smrg      end]],
92118fc2d0c6Smrg			      [Fortran], [[
92128fc2d0c6Smrg      subroutine foo
92138fc2d0c6Smrg      end]])])],
92148fc2d0c6Smrg	      [lt_cv_irix_exported_symbol=yes],
92158fc2d0c6Smrg	      [lt_cv_irix_exported_symbol=no])
92168fc2d0c6Smrg           LDFLAGS=$save_LDFLAGS])
92178fc2d0c6Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
92188fc2d0c6Smrg          _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'
921954b44505Smrg	fi
92208fc2d0c6Smrg      else
92218fc2d0c6Smrg	_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'
92228fc2d0c6Smrg	_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'
92238fc2d0c6Smrg      fi
92248fc2d0c6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
92258fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
92268fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
92278fc2d0c6Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
92288fc2d0c6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
922954b44505Smrg      ;;
923054b44505Smrg
92318fc2d0c6Smrg    linux*)
92328fc2d0c6Smrg      case $cc_basename in
92338fc2d0c6Smrg      tcc*)
92348fc2d0c6Smrg	# Fabrice Bellard et al's Tiny C Compiler
92358fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
92368fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
92378fc2d0c6Smrg	;;
92388fc2d0c6Smrg      esac
92398fc2d0c6Smrg      ;;
924054b44505Smrg
92418fc2d0c6Smrg    netbsd*)
92428fc2d0c6Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
92438fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
92448fc2d0c6Smrg      else
92458fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
92468fc2d0c6Smrg      fi
92478fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
92488fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
92498fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
92508fc2d0c6Smrg      ;;
925154b44505Smrg
92528fc2d0c6Smrg    newsos6)
92538fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
92548fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
92558fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
92568fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
92578fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
925854b44505Smrg      ;;
925954b44505Smrg
92608fc2d0c6Smrg    *nto* | *qnx*)
92618fc2d0c6Smrg      ;;
926254b44505Smrg
92638fc2d0c6Smrg    openbsd* | bitrig*)
92648fc2d0c6Smrg      if test -f /usr/libexec/ld.so; then
92658fc2d0c6Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
92668fc2d0c6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
92678fc2d0c6Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
92688fc2d0c6Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
92698fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
92708fc2d0c6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
92718fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
92728fc2d0c6Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
92738fc2d0c6Smrg	else
92748fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
92758fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
92768fc2d0c6Smrg	fi
92778fc2d0c6Smrg      else
92788fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
92798fc2d0c6Smrg      fi
92808fc2d0c6Smrg      ;;
928154b44505Smrg
92828fc2d0c6Smrg    os2*)
92838fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
92848fc2d0c6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
92858fc2d0c6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
92868fc2d0c6Smrg      shrext_cmds=.dll
92878fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
92888fc2d0c6Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
92898fc2d0c6Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
92908fc2d0c6Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
92918fc2d0c6Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
92928fc2d0c6Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
92938fc2d0c6Smrg	emximp -o $lib $output_objdir/$libname.def'
92948fc2d0c6Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
92958fc2d0c6Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
92968fc2d0c6Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
92978fc2d0c6Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
92988fc2d0c6Smrg	prefix_cmds="$SED"~
92998fc2d0c6Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
93008fc2d0c6Smrg	  prefix_cmds="$prefix_cmds -e 1d";
93018fc2d0c6Smrg	fi~
93028fc2d0c6Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
93038fc2d0c6Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
93048fc2d0c6Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
93058fc2d0c6Smrg	emximp -o $lib $output_objdir/$libname.def'
93068fc2d0c6Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
93078fc2d0c6Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
93088fc2d0c6Smrg      _LT_TAGVAR(file_list_spec, $1)='@'
93098fc2d0c6Smrg      ;;
931054b44505Smrg
93118fc2d0c6Smrg    osf3*)
93128fc2d0c6Smrg      if test yes = "$GCC"; then
93138fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
93148fc2d0c6Smrg	_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'
93158fc2d0c6Smrg      else
93168fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
93178fc2d0c6Smrg	_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'
93188fc2d0c6Smrg      fi
93198fc2d0c6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
93208fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
93218fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
93228fc2d0c6Smrg      ;;
932354b44505Smrg
93248fc2d0c6Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
93258fc2d0c6Smrg      if test yes = "$GCC"; then
93268fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
93278fc2d0c6Smrg	_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'
93288fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
93298fc2d0c6Smrg      else
93308fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
93318fc2d0c6Smrg	_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'
93328fc2d0c6Smrg	_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~
93338fc2d0c6Smrg          $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'
933454b44505Smrg
93358fc2d0c6Smrg	# Both c and cxx compiler support -rpath directly
93368fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
93378fc2d0c6Smrg      fi
93388fc2d0c6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
93398fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
93408fc2d0c6Smrg      ;;
934154b44505Smrg
93428fc2d0c6Smrg    solaris*)
93438fc2d0c6Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
93448fc2d0c6Smrg      if test yes = "$GCC"; then
93458fc2d0c6Smrg	wlarc='$wl'
93468fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
93478fc2d0c6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
93488fc2d0c6Smrg          $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'
93498fc2d0c6Smrg      else
93508fc2d0c6Smrg	case `$CC -V 2>&1` in
93518fc2d0c6Smrg	*"Compilers 5.0"*)
93528fc2d0c6Smrg	  wlarc=''
93538fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
93548fc2d0c6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
93558fc2d0c6Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
93568fc2d0c6Smrg	  ;;
93578fc2d0c6Smrg	*)
93588fc2d0c6Smrg	  wlarc='$wl'
93598fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
93608fc2d0c6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
93618fc2d0c6Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
93628fc2d0c6Smrg	  ;;
93638fc2d0c6Smrg	esac
93648fc2d0c6Smrg      fi
93658fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
93668fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
93678fc2d0c6Smrg      case $host_os in
93688fc2d0c6Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
93698fc2d0c6Smrg      *)
93708fc2d0c6Smrg	# The compiler driver will combine and reorder linker options,
93718fc2d0c6Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
93728fc2d0c6Smrg	# but is careful enough not to reorder.
93738fc2d0c6Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
93748fc2d0c6Smrg	if test yes = "$GCC"; then
93758fc2d0c6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
93768fc2d0c6Smrg	else
93778fc2d0c6Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
93788fc2d0c6Smrg	fi
93798fc2d0c6Smrg	;;
93808fc2d0c6Smrg      esac
93818fc2d0c6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
93828fc2d0c6Smrg      ;;
938354b44505Smrg
93848fc2d0c6Smrg    sunos4*)
93858fc2d0c6Smrg      if test sequent = "$host_vendor"; then
93868fc2d0c6Smrg	# Use $CC to link under sequent, because it throws in some extra .o
93878fc2d0c6Smrg	# files that make .init and .fini sections work.
93888fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
93898fc2d0c6Smrg      else
93908fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
93918fc2d0c6Smrg      fi
93928fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
93938fc2d0c6Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
93948fc2d0c6Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
93958fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
93968fc2d0c6Smrg      ;;
939754b44505Smrg
93988fc2d0c6Smrg    sysv4)
93998fc2d0c6Smrg      case $host_vendor in
94008fc2d0c6Smrg	sni)
94018fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
94028fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
94038fc2d0c6Smrg	;;
94048fc2d0c6Smrg	siemens)
94058fc2d0c6Smrg	  ## LD is ld it makes a PLAMLIB
94068fc2d0c6Smrg	  ## CC just makes a GrossModule.
94078fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
94088fc2d0c6Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
94098fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
94108fc2d0c6Smrg        ;;
94118fc2d0c6Smrg	motorola)
94128fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
94138fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
94148fc2d0c6Smrg	;;
94158fc2d0c6Smrg      esac
94168fc2d0c6Smrg      runpath_var='LD_RUN_PATH'
94178fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
941854b44505Smrg      ;;
941954b44505Smrg
94208fc2d0c6Smrg    sysv4.3*)
94218fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
94228fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
94238fc2d0c6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
94248fc2d0c6Smrg      ;;
942554b44505Smrg
94268fc2d0c6Smrg    sysv4*MP*)
94278fc2d0c6Smrg      if test -d /usr/nec; then
94288fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
94298fc2d0c6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
94308fc2d0c6Smrg	runpath_var=LD_RUN_PATH
94318fc2d0c6Smrg	hardcode_runpath_var=yes
94328fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
94338fc2d0c6Smrg      fi
94348fc2d0c6Smrg      ;;
943554b44505Smrg
94368fc2d0c6Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
94378fc2d0c6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
94388fc2d0c6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
94398fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
94408fc2d0c6Smrg      runpath_var='LD_RUN_PATH'
944154b44505Smrg
94428fc2d0c6Smrg      if test yes = "$GCC"; then
94438fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
94448fc2d0c6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
94458fc2d0c6Smrg      else
94468fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
94478fc2d0c6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
94488fc2d0c6Smrg      fi
94498fc2d0c6Smrg      ;;
945054b44505Smrg
94518fc2d0c6Smrg    sysv5* | sco3.2v5* | sco5v6*)
94528fc2d0c6Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
94538fc2d0c6Smrg      # link with -lc, and that would cause any symbols used from libc to
94548fc2d0c6Smrg      # always be unresolved, which means just about no library would
94558fc2d0c6Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
94568fc2d0c6Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
94578fc2d0c6Smrg      # as -z defs.
94588fc2d0c6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
94598fc2d0c6Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
94608fc2d0c6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
94618fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
94628fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
94638fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
94648fc2d0c6Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
94658fc2d0c6Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
94668fc2d0c6Smrg      runpath_var='LD_RUN_PATH'
946754b44505Smrg
94688fc2d0c6Smrg      if test yes = "$GCC"; then
94698fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
94708fc2d0c6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
94718fc2d0c6Smrg      else
94728fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
94738fc2d0c6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
94748fc2d0c6Smrg      fi
94758fc2d0c6Smrg      ;;
947654b44505Smrg
94778fc2d0c6Smrg    uts4*)
94788fc2d0c6Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
94798fc2d0c6Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
94808fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
94810a392d7eSmrg      ;;
94828fc2d0c6Smrg
94830a392d7eSmrg    *)
94848fc2d0c6Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
94850a392d7eSmrg      ;;
94860a392d7eSmrg    esac
94878fc2d0c6Smrg
94888fc2d0c6Smrg    if test sni = "$host_vendor"; then
94898fc2d0c6Smrg      case $host in
94908fc2d0c6Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
94918fc2d0c6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
94928fc2d0c6Smrg	;;
94938fc2d0c6Smrg      esac
94940a392d7eSmrg    fi
94950a392d7eSmrg  fi
94968fc2d0c6Smrg])
94978fc2d0c6SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
94988fc2d0c6Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
94990a392d7eSmrg
95008fc2d0c6Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
95010a392d7eSmrg
95028fc2d0c6Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
95038fc2d0c6Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
95048fc2d0c6Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
95058fc2d0c6Smrg    [The commands to extract the exported symbol list from a shared archive])
95068fc2d0c6Smrg
95078fc2d0c6Smrg#
95088fc2d0c6Smrg# Do we need to explicitly link libc?
95098fc2d0c6Smrg#
95108fc2d0c6Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
95118fc2d0c6Smrgx|xyes)
95128fc2d0c6Smrg  # Assume -lc should be added
95138fc2d0c6Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
95140a392d7eSmrg
95158fc2d0c6Smrg  if test yes,yes = "$GCC,$enable_shared"; then
95168fc2d0c6Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
95178fc2d0c6Smrg    *'~'*)
95188fc2d0c6Smrg      # FIXME: we may have to deal with multi-command sequences.
95198fc2d0c6Smrg      ;;
95208fc2d0c6Smrg    '$CC '*)
95218fc2d0c6Smrg      # Test whether the compiler implicitly links with -lc since on some
95228fc2d0c6Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
95238fc2d0c6Smrg      # to ld, don't add -lc before -lgcc.
95248fc2d0c6Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
95258fc2d0c6Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
95268fc2d0c6Smrg	[$RM conftest*
95278fc2d0c6Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
95280a392d7eSmrg
95298fc2d0c6Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
95308fc2d0c6Smrg	  soname=conftest
95318fc2d0c6Smrg	  lib=conftest
95328fc2d0c6Smrg	  libobjs=conftest.$ac_objext
95338fc2d0c6Smrg	  deplibs=
95348fc2d0c6Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
95358fc2d0c6Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
95368fc2d0c6Smrg	  compiler_flags=-v
95378fc2d0c6Smrg	  linker_flags=-v
95388fc2d0c6Smrg	  verstring=
95398fc2d0c6Smrg	  output_objdir=.
95408fc2d0c6Smrg	  libname=conftest
95418fc2d0c6Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
95428fc2d0c6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
95438fc2d0c6Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
95448fc2d0c6Smrg	  then
95458fc2d0c6Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
95468fc2d0c6Smrg	  else
95478fc2d0c6Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
95488fc2d0c6Smrg	  fi
95498fc2d0c6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
95508fc2d0c6Smrg	else
95518fc2d0c6Smrg	  cat conftest.err 1>&5
95520a392d7eSmrg	fi
95538fc2d0c6Smrg	$RM conftest*
95548fc2d0c6Smrg	])
95558fc2d0c6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
95560a392d7eSmrg      ;;
95578fc2d0c6Smrg    esac
95588fc2d0c6Smrg  fi
95598fc2d0c6Smrg  ;;
95608fc2d0c6Smrgesac
956154b44505Smrg
95628fc2d0c6Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
95638fc2d0c6Smrg    [Whether or not to add -lc for building shared libraries])
95648fc2d0c6Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
95658fc2d0c6Smrg    [enable_shared_with_static_runtimes], [0],
95668fc2d0c6Smrg    [Whether or not to disallow shared libs when runtime libs are static])
95678fc2d0c6Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
95688fc2d0c6Smrg    [Compiler flag to allow reflexive dlopens])
95698fc2d0c6Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
95708fc2d0c6Smrg    [Compiler flag to generate shared objects directly from archives])
95718fc2d0c6Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
95728fc2d0c6Smrg    [Whether the compiler copes with passing no objects directly])
95738fc2d0c6Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
95748fc2d0c6Smrg    [Create an old-style archive from a shared archive])
95758fc2d0c6Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
95768fc2d0c6Smrg    [Create a temporary old-style archive to link instead of a shared archive])
95778fc2d0c6Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
95788fc2d0c6Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
95798fc2d0c6Smrg_LT_TAGDECL([], [module_cmds], [2],
95808fc2d0c6Smrg    [Commands used to build a loadable module if different from building
95818fc2d0c6Smrg    a shared archive.])
95828fc2d0c6Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
95838fc2d0c6Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
95848fc2d0c6Smrg    [Whether we are building with GNU ld or not])
95858fc2d0c6Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
95868fc2d0c6Smrg    [Flag that allows shared libraries with undefined symbols to be built])
95878fc2d0c6Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
95888fc2d0c6Smrg    [Flag that enforces no undefined symbols])
95898fc2d0c6Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
95908fc2d0c6Smrg    [Flag to hardcode $libdir into a binary during linking.
95918fc2d0c6Smrg    This must work even if $libdir does not exist])
95928fc2d0c6Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
95938fc2d0c6Smrg    [Whether we need a single "-rpath" flag with a separated argument])
95948fc2d0c6Smrg_LT_TAGDECL([], [hardcode_direct], [0],
95958fc2d0c6Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
95968fc2d0c6Smrg    DIR into the resulting binary])
95978fc2d0c6Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
95988fc2d0c6Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
95998fc2d0c6Smrg    DIR into the resulting binary and the resulting library dependency is
96008fc2d0c6Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
96018fc2d0c6Smrg    library is relocated])
96028fc2d0c6Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
96038fc2d0c6Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
96048fc2d0c6Smrg    into the resulting binary])
96058fc2d0c6Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
96068fc2d0c6Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
96078fc2d0c6Smrg    into the resulting binary])
96088fc2d0c6Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
96098fc2d0c6Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
96108fc2d0c6Smrg    into the library and all subsequent libraries and executables linked
96118fc2d0c6Smrg    against it])
96128fc2d0c6Smrg_LT_TAGDECL([], [inherit_rpath], [0],
96138fc2d0c6Smrg    [Set to yes if linker adds runtime paths of dependent libraries
96148fc2d0c6Smrg    to runtime path list])
96158fc2d0c6Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
96168fc2d0c6Smrg    [Whether libtool must link a program against all its dependency libraries])
96178fc2d0c6Smrg_LT_TAGDECL([], [always_export_symbols], [0],
96188fc2d0c6Smrg    [Set to "yes" if exported symbols are required])
96198fc2d0c6Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
96208fc2d0c6Smrg    [The commands to list exported symbols])
96218fc2d0c6Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
96228fc2d0c6Smrg    [Symbols that should not be listed in the preloaded symbols])
96238fc2d0c6Smrg_LT_TAGDECL([], [include_expsyms], [1],
96248fc2d0c6Smrg    [Symbols that must always be exported])
96258fc2d0c6Smrg_LT_TAGDECL([], [prelink_cmds], [2],
96268fc2d0c6Smrg    [Commands necessary for linking programs (against libraries) with templates])
96278fc2d0c6Smrg_LT_TAGDECL([], [postlink_cmds], [2],
96288fc2d0c6Smrg    [Commands necessary for finishing linking programs])
96298fc2d0c6Smrg_LT_TAGDECL([], [file_list_spec], [1],
96308fc2d0c6Smrg    [Specify filename containing input files])
96318fc2d0c6Smrgdnl FIXME: Not yet implemented
96328fc2d0c6Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
96338fc2d0c6Smrgdnl    [Compiler flag to generate thread safe objects])
96348fc2d0c6Smrg])# _LT_LINKER_SHLIBS
963554b44505Smrg
963654b44505Smrg
96378fc2d0c6Smrg# _LT_LANG_C_CONFIG([TAG])
96388fc2d0c6Smrg# ------------------------
96398fc2d0c6Smrg# Ensure that the configuration variables for a C compiler are suitably
96408fc2d0c6Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
96418fc2d0c6Smrg# the compiler configuration to 'libtool'.
96428fc2d0c6Smrgm4_defun([_LT_LANG_C_CONFIG],
96438fc2d0c6Smrg[m4_require([_LT_DECL_EGREP])dnl
96448fc2d0c6Smrglt_save_CC=$CC
96458fc2d0c6SmrgAC_LANG_PUSH(C)
964654b44505Smrg
96478fc2d0c6Smrg# Source file extension for C test sources.
96488fc2d0c6Smrgac_ext=c
964954b44505Smrg
96508fc2d0c6Smrg# Object file extension for compiled C test sources.
96518fc2d0c6Smrgobjext=o
96528fc2d0c6Smrg_LT_TAGVAR(objext, $1)=$objext
965354b44505Smrg
96548fc2d0c6Smrg# Code to be used in simple compile tests
96558fc2d0c6Smrglt_simple_compile_test_code="int some_variable = 0;"
965654b44505Smrg
96578fc2d0c6Smrg# Code to be used in simple link tests
96588fc2d0c6Smrglt_simple_link_test_code='int main(){return(0);}'
965954b44505Smrg
96608fc2d0c6Smrg_LT_TAG_COMPILER
96618fc2d0c6Smrg# Save the default compiler, since it gets overwritten when the other
96628fc2d0c6Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
96638fc2d0c6Smrgcompiler_DEFAULT=$CC
966454b44505Smrg
96658fc2d0c6Smrg# save warnings/boilerplate of simple test code
96668fc2d0c6Smrg_LT_COMPILER_BOILERPLATE
96678fc2d0c6Smrg_LT_LINKER_BOILERPLATE
966854b44505Smrg
96698fc2d0c6Smrgif test -n "$compiler"; then
96708fc2d0c6Smrg  _LT_COMPILER_NO_RTTI($1)
96718fc2d0c6Smrg  _LT_COMPILER_PIC($1)
96728fc2d0c6Smrg  _LT_COMPILER_C_O($1)
96738fc2d0c6Smrg  _LT_COMPILER_FILE_LOCKS($1)
96748fc2d0c6Smrg  _LT_LINKER_SHLIBS($1)
96758fc2d0c6Smrg  _LT_SYS_DYNAMIC_LINKER($1)
96768fc2d0c6Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
96778fc2d0c6Smrg  LT_SYS_DLOPEN_SELF
96788fc2d0c6Smrg  _LT_CMD_STRIPLIB
967954b44505Smrg
96808fc2d0c6Smrg  # Report what library types will actually be built
96818fc2d0c6Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
96828fc2d0c6Smrg  AC_MSG_RESULT([$can_build_shared])
968354b44505Smrg
96848fc2d0c6Smrg  AC_MSG_CHECKING([whether to build shared libraries])
96858fc2d0c6Smrg  test no = "$can_build_shared" && enable_shared=no
968654b44505Smrg
96878fc2d0c6Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
96888fc2d0c6Smrg  # are all built from PIC.
96898fc2d0c6Smrg  case $host_os in
96908fc2d0c6Smrg  aix3*)
96918fc2d0c6Smrg    test yes = "$enable_shared" && enable_static=no
96928fc2d0c6Smrg    if test -n "$RANLIB"; then
96938fc2d0c6Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
96948fc2d0c6Smrg      postinstall_cmds='$RANLIB $lib'
96958fc2d0c6Smrg    fi
96968fc2d0c6Smrg    ;;
969754b44505Smrg
96988fc2d0c6Smrg  aix[[4-9]]*)
96998fc2d0c6Smrg    if test ia64 != "$host_cpu"; then
97008fc2d0c6Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
97018fc2d0c6Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
97028fc2d0c6Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
97038fc2d0c6Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
97048fc2d0c6Smrg      esac
97058fc2d0c6Smrg    fi
97068fc2d0c6Smrg    ;;
97078fc2d0c6Smrg  esac
97088fc2d0c6Smrg  AC_MSG_RESULT([$enable_shared])
970954b44505Smrg
97108fc2d0c6Smrg  AC_MSG_CHECKING([whether to build static libraries])
97118fc2d0c6Smrg  # Make sure either enable_shared or enable_static is yes.
97128fc2d0c6Smrg  test yes = "$enable_shared" || enable_static=yes
97138fc2d0c6Smrg  AC_MSG_RESULT([$enable_static])
971454b44505Smrg
97158fc2d0c6Smrg  _LT_CONFIG($1)
97168fc2d0c6Smrgfi
97178fc2d0c6SmrgAC_LANG_POP
97188fc2d0c6SmrgCC=$lt_save_CC
97198fc2d0c6Smrg])# _LT_LANG_C_CONFIG
972054b44505Smrg
972154b44505Smrg
97228fc2d0c6Smrg# _LT_LANG_CXX_CONFIG([TAG])
97238fc2d0c6Smrg# --------------------------
97248fc2d0c6Smrg# Ensure that the configuration variables for a C++ compiler are suitably
97258fc2d0c6Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
97268fc2d0c6Smrg# the compiler configuration to 'libtool'.
97278fc2d0c6Smrgm4_defun([_LT_LANG_CXX_CONFIG],
97288fc2d0c6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
97298fc2d0c6Smrgm4_require([_LT_DECL_EGREP])dnl
97308fc2d0c6Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
97318fc2d0c6Smrgif test -n "$CXX" && ( test no != "$CXX" &&
97328fc2d0c6Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
97338fc2d0c6Smrg    (test g++ != "$CXX"))); then
97348fc2d0c6Smrg  AC_PROG_CXXCPP
97358fc2d0c6Smrgelse
97368fc2d0c6Smrg  _lt_caught_CXX_error=yes
97378fc2d0c6Smrgfi
973854b44505Smrg
97398fc2d0c6SmrgAC_LANG_PUSH(C++)
97408fc2d0c6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
97418fc2d0c6Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
97428fc2d0c6Smrg_LT_TAGVAR(always_export_symbols, $1)=no
97438fc2d0c6Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
97448fc2d0c6Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
97458fc2d0c6Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
97468fc2d0c6Smrg_LT_TAGVAR(hardcode_direct, $1)=no
97478fc2d0c6Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
97488fc2d0c6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
97498fc2d0c6Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
97508fc2d0c6Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
97518fc2d0c6Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
97528fc2d0c6Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
97538fc2d0c6Smrg_LT_TAGVAR(inherit_rpath, $1)=no
97548fc2d0c6Smrg_LT_TAGVAR(module_cmds, $1)=
97558fc2d0c6Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
97568fc2d0c6Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
97578fc2d0c6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
97588fc2d0c6Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
97598fc2d0c6Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
97608fc2d0c6Smrg_LT_TAGVAR(no_undefined_flag, $1)=
97618fc2d0c6Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
97628fc2d0c6Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
976354b44505Smrg
97648fc2d0c6Smrg# Source file extension for C++ test sources.
97658fc2d0c6Smrgac_ext=cpp
976654b44505Smrg
97678fc2d0c6Smrg# Object file extension for compiled C++ test sources.
97688fc2d0c6Smrgobjext=o
97698fc2d0c6Smrg_LT_TAGVAR(objext, $1)=$objext
977054b44505Smrg
97718fc2d0c6Smrg# No sense in running all these tests if we already determined that
97728fc2d0c6Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
97738fc2d0c6Smrg# are currently assumed to apply to all compilers on this platform,
97748fc2d0c6Smrg# and will be corrupted by setting them based on a non-working compiler.
97758fc2d0c6Smrgif test yes != "$_lt_caught_CXX_error"; then
97768fc2d0c6Smrg  # Code to be used in simple compile tests
97778fc2d0c6Smrg  lt_simple_compile_test_code="int some_variable = 0;"
977854b44505Smrg
97798fc2d0c6Smrg  # Code to be used in simple link tests
97808fc2d0c6Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
978154b44505Smrg
97828fc2d0c6Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
97838fc2d0c6Smrg  _LT_TAG_COMPILER
978454b44505Smrg
97858fc2d0c6Smrg  # save warnings/boilerplate of simple test code
97868fc2d0c6Smrg  _LT_COMPILER_BOILERPLATE
97878fc2d0c6Smrg  _LT_LINKER_BOILERPLATE
978854b44505Smrg
97898fc2d0c6Smrg  # Allow CC to be a program name with arguments.
97908fc2d0c6Smrg  lt_save_CC=$CC
97918fc2d0c6Smrg  lt_save_CFLAGS=$CFLAGS
97928fc2d0c6Smrg  lt_save_LD=$LD
97938fc2d0c6Smrg  lt_save_GCC=$GCC
97948fc2d0c6Smrg  GCC=$GXX
97958fc2d0c6Smrg  lt_save_with_gnu_ld=$with_gnu_ld
97968fc2d0c6Smrg  lt_save_path_LD=$lt_cv_path_LD
97978fc2d0c6Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
97988fc2d0c6Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
97998fc2d0c6Smrg  else
98008fc2d0c6Smrg    $as_unset lt_cv_prog_gnu_ld
98018fc2d0c6Smrg  fi
98028fc2d0c6Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
98038fc2d0c6Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
98048fc2d0c6Smrg  else
98058fc2d0c6Smrg    $as_unset lt_cv_path_LD
98068fc2d0c6Smrg  fi
98078fc2d0c6Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
98088fc2d0c6Smrg  CC=${CXX-"c++"}
98098fc2d0c6Smrg  CFLAGS=$CXXFLAGS
98108fc2d0c6Smrg  compiler=$CC
98118fc2d0c6Smrg  _LT_TAGVAR(compiler, $1)=$CC
98128fc2d0c6Smrg  _LT_CC_BASENAME([$compiler])
981354b44505Smrg
98148fc2d0c6Smrg  if test -n "$compiler"; then
98158fc2d0c6Smrg    # We don't want -fno-exception when compiling C++ code, so set the
98168fc2d0c6Smrg    # no_builtin_flag separately
98178fc2d0c6Smrg    if test yes = "$GXX"; then
98188fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
98198fc2d0c6Smrg    else
98208fc2d0c6Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
98218fc2d0c6Smrg    fi
982254b44505Smrg
98238fc2d0c6Smrg    if test yes = "$GXX"; then
98248fc2d0c6Smrg      # Set up default GNU C++ configuration
982554b44505Smrg
98268fc2d0c6Smrg      LT_PATH_LD
982754b44505Smrg
98288fc2d0c6Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
98298fc2d0c6Smrg      # archiving commands below assume that GNU ld is being used.
98308fc2d0c6Smrg      if test yes = "$with_gnu_ld"; then
98318fc2d0c6Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
98328fc2d0c6Smrg        _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'
983354b44505Smrg
98348fc2d0c6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
98358fc2d0c6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
98364a041c5bSmacallan
98378fc2d0c6Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
98388fc2d0c6Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
98398fc2d0c6Smrg        #     investigate it a little bit more. (MM)
98408fc2d0c6Smrg        wlarc='$wl'
984154b44505Smrg
98428fc2d0c6Smrg        # ancient GNU ld didn't support --whole-archive et. al.
98438fc2d0c6Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
98448fc2d0c6Smrg	  $GREP 'no-whole-archive' > /dev/null; then
98458fc2d0c6Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
98468fc2d0c6Smrg        else
98478fc2d0c6Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
98488fc2d0c6Smrg        fi
98498fc2d0c6Smrg      else
98508fc2d0c6Smrg        with_gnu_ld=no
98518fc2d0c6Smrg        wlarc=
985254b44505Smrg
98538fc2d0c6Smrg        # A generic and very simple default shared library creation
98548fc2d0c6Smrg        # command for GNU C++ for the case where it uses the native
98558fc2d0c6Smrg        # linker, instead of GNU ld.  If possible, this setting should
98568fc2d0c6Smrg        # overridden to take advantage of the native linker features on
98578fc2d0c6Smrg        # the platform it is being used on.
98588fc2d0c6Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
98598fc2d0c6Smrg      fi
986054b44505Smrg
98618fc2d0c6Smrg      # Commands to make compiler produce verbose output that lists
98628fc2d0c6Smrg      # what "hidden" libraries, object files and flags are used when
98638fc2d0c6Smrg      # linking a shared library.
98648fc2d0c6Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
986554b44505Smrg
98668fc2d0c6Smrg    else
98678fc2d0c6Smrg      GXX=no
98688fc2d0c6Smrg      with_gnu_ld=no
98698fc2d0c6Smrg      wlarc=
98708fc2d0c6Smrg    fi
987154b44505Smrg
98728fc2d0c6Smrg    # PORTME: fill in a description of your system's C++ link characteristics
98738fc2d0c6Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
98748fc2d0c6Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
98758fc2d0c6Smrg    case $host_os in
98768fc2d0c6Smrg      aix3*)
98778fc2d0c6Smrg        # FIXME: insert proper C++ library support
98788fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
98798fc2d0c6Smrg        ;;
98808fc2d0c6Smrg      aix[[4-9]]*)
98818fc2d0c6Smrg        if test ia64 = "$host_cpu"; then
98828fc2d0c6Smrg          # On IA64, the linker does run time linking by default, so we don't
98838fc2d0c6Smrg          # have to do anything special.
98848fc2d0c6Smrg          aix_use_runtimelinking=no
98858fc2d0c6Smrg          exp_sym_flag='-Bexport'
98868fc2d0c6Smrg          no_entry_flag=
98878fc2d0c6Smrg        else
98888fc2d0c6Smrg          aix_use_runtimelinking=no
98894a041c5bSmacallan
98908fc2d0c6Smrg          # Test if we are trying to use run time linking or normal
98918fc2d0c6Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
98928fc2d0c6Smrg          # have runtime linking enabled, and use it for executables.
98938fc2d0c6Smrg          # For shared libraries, we enable/disable runtime linking
98948fc2d0c6Smrg          # depending on the kind of the shared library created -
98958fc2d0c6Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
98968fc2d0c6Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
98978fc2d0c6Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
98988fc2d0c6Smrg          #            lib.a           static archive
98998fc2d0c6Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
99008fc2d0c6Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
99018fc2d0c6Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
99028fc2d0c6Smrg          #            lib.a(lib.so.V) shared, rtl:no
99038fc2d0c6Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
99048fc2d0c6Smrg          #            lib.a           static archive
99058fc2d0c6Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
99068fc2d0c6Smrg	    for ld_flag in $LDFLAGS; do
99078fc2d0c6Smrg	      case $ld_flag in
99088fc2d0c6Smrg	      *-brtl*)
99098fc2d0c6Smrg	        aix_use_runtimelinking=yes
99108fc2d0c6Smrg	        break
99118fc2d0c6Smrg	        ;;
99128fc2d0c6Smrg	      esac
99138fc2d0c6Smrg	    done
99148fc2d0c6Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
99158fc2d0c6Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
99168fc2d0c6Smrg	      # so we don't have lib.a shared libs to link our executables.
99178fc2d0c6Smrg	      # We have to force runtime linking in this case.
99188fc2d0c6Smrg	      aix_use_runtimelinking=yes
99198fc2d0c6Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
99208fc2d0c6Smrg	    fi
99218fc2d0c6Smrg	    ;;
99228fc2d0c6Smrg          esac
992354b44505Smrg
99248fc2d0c6Smrg          exp_sym_flag='-bexport'
99258fc2d0c6Smrg          no_entry_flag='-bnoentry'
99268fc2d0c6Smrg        fi
99274a041c5bSmacallan
99288fc2d0c6Smrg        # When large executables or shared objects are built, AIX ld can
99298fc2d0c6Smrg        # have problems creating the table of contents.  If linking a library
99308fc2d0c6Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
99318fc2d0c6Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
99328fc2d0c6Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
99334a041c5bSmacallan
99348fc2d0c6Smrg        _LT_TAGVAR(archive_cmds, $1)=''
99358fc2d0c6Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
99368fc2d0c6Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
99378fc2d0c6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
99388fc2d0c6Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
99398fc2d0c6Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
99408fc2d0c6Smrg        case $with_aix_soname,$aix_use_runtimelinking in
99418fc2d0c6Smrg        aix,*) ;;	# no import file
99428fc2d0c6Smrg        svr4,* | *,yes) # use import file
99438fc2d0c6Smrg          # The Import File defines what to hardcode.
99448fc2d0c6Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
99458fc2d0c6Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
99468fc2d0c6Smrg          ;;
99478fc2d0c6Smrg        esac
99484a041c5bSmacallan
99498fc2d0c6Smrg        if test yes = "$GXX"; then
99508fc2d0c6Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
99518fc2d0c6Smrg          # We only want to do this on AIX 4.2 and lower, the check
99528fc2d0c6Smrg          # below for broken collect2 doesn't work under 4.3+
99538fc2d0c6Smrg	  collect2name=`$CC -print-prog-name=collect2`
99548fc2d0c6Smrg	  if test -f "$collect2name" &&
99558fc2d0c6Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
99568fc2d0c6Smrg	  then
99578fc2d0c6Smrg	    # We have reworked collect2
99588fc2d0c6Smrg	    :
99598fc2d0c6Smrg	  else
99608fc2d0c6Smrg	    # We have old collect2
99618fc2d0c6Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
99628fc2d0c6Smrg	    # It fails to find uninstalled libraries when the uninstalled
99638fc2d0c6Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
99648fc2d0c6Smrg	    # to unsupported forces relinking
99658fc2d0c6Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
99668fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
99678fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
99688fc2d0c6Smrg	  fi
99698fc2d0c6Smrg          esac
99708fc2d0c6Smrg          shared_flag='-shared'
99718fc2d0c6Smrg	  if test yes = "$aix_use_runtimelinking"; then
99728fc2d0c6Smrg	    shared_flag=$shared_flag' $wl-G'
99738fc2d0c6Smrg	  fi
99748fc2d0c6Smrg	  # Need to ensure runtime linking is disabled for the traditional
99758fc2d0c6Smrg	  # shared library, or the linker may eventually find shared libraries
99768fc2d0c6Smrg	  # /with/ Import File - we do not want to mix them.
99778fc2d0c6Smrg	  shared_flag_aix='-shared'
99788fc2d0c6Smrg	  shared_flag_svr4='-shared $wl-G'
99798fc2d0c6Smrg        else
99808fc2d0c6Smrg          # not using gcc
99818fc2d0c6Smrg          if test ia64 = "$host_cpu"; then
99828fc2d0c6Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
99838fc2d0c6Smrg	  # chokes on -Wl,-G. The following line is correct:
99848fc2d0c6Smrg	  shared_flag='-G'
99858fc2d0c6Smrg          else
99868fc2d0c6Smrg	    if test yes = "$aix_use_runtimelinking"; then
99878fc2d0c6Smrg	      shared_flag='$wl-G'
99888fc2d0c6Smrg	    else
99898fc2d0c6Smrg	      shared_flag='$wl-bM:SRE'
99908fc2d0c6Smrg	    fi
99918fc2d0c6Smrg	    shared_flag_aix='$wl-bM:SRE'
99928fc2d0c6Smrg	    shared_flag_svr4='$wl-G'
99938fc2d0c6Smrg          fi
99948fc2d0c6Smrg        fi
99954a041c5bSmacallan
99968fc2d0c6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
99978fc2d0c6Smrg        # It seems that -bexpall does not export symbols beginning with
99988fc2d0c6Smrg        # underscore (_), so it is better to generate a list of symbols to
99998fc2d0c6Smrg	# export.
100008fc2d0c6Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
100018fc2d0c6Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
100028fc2d0c6Smrg          # Warning - without using the other runtime loading flags (-brtl),
100038fc2d0c6Smrg          # -berok will link without error, but may produce a broken library.
100048fc2d0c6Smrg          # The "-G" linker flag allows undefined symbols.
100058fc2d0c6Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
100068fc2d0c6Smrg          # Determine the default libpath from the value encoded in an empty
100078fc2d0c6Smrg          # executable.
100088fc2d0c6Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
100098fc2d0c6Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
100104a041c5bSmacallan
100118fc2d0c6Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
100128fc2d0c6Smrg        else
100138fc2d0c6Smrg          if test ia64 = "$host_cpu"; then
100148fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
100158fc2d0c6Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
100168fc2d0c6Smrg	    _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"
100178fc2d0c6Smrg          else
100188fc2d0c6Smrg	    # Determine the default libpath from the value encoded in an
100198fc2d0c6Smrg	    # empty executable.
100208fc2d0c6Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
100218fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
100228fc2d0c6Smrg	    # Warning - without using the other run time loading flags,
100238fc2d0c6Smrg	    # -berok will link without error, but may produce a broken library.
100248fc2d0c6Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
100258fc2d0c6Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
100268fc2d0c6Smrg	    if test yes = "$with_gnu_ld"; then
100278fc2d0c6Smrg	      # We only use this code for GNU lds that support --whole-archive.
100288fc2d0c6Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
100298fc2d0c6Smrg	    else
100308fc2d0c6Smrg	      # Exported symbols can be pulled into shared objects from archives
100318fc2d0c6Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
100328fc2d0c6Smrg	    fi
100338fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
100348fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
100358fc2d0c6Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
100368fc2d0c6Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
100378fc2d0c6Smrg	    if test svr4 != "$with_aix_soname"; then
100388fc2d0c6Smrg	      # This is similar to how AIX traditionally builds its shared
100398fc2d0c6Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
100408fc2d0c6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
100418fc2d0c6Smrg	    fi
100428fc2d0c6Smrg	    if test aix != "$with_aix_soname"; then
100438fc2d0c6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
100448fc2d0c6Smrg	    else
100458fc2d0c6Smrg	      # used by -dlpreopen to get the symbols
100468fc2d0c6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
100478fc2d0c6Smrg	    fi
100488fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
100498fc2d0c6Smrg          fi
100508fc2d0c6Smrg        fi
100518fc2d0c6Smrg        ;;
100524a041c5bSmacallan
100538fc2d0c6Smrg      beos*)
100548fc2d0c6Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
100558fc2d0c6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
100568fc2d0c6Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
100578fc2d0c6Smrg	  # support --undefined.  This deserves some investigation.  FIXME
100588fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
100598fc2d0c6Smrg	else
100608fc2d0c6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
100618fc2d0c6Smrg	fi
100628fc2d0c6Smrg	;;
100634a041c5bSmacallan
100648fc2d0c6Smrg      chorus*)
100658fc2d0c6Smrg        case $cc_basename in
100668fc2d0c6Smrg          *)
100678fc2d0c6Smrg	  # FIXME: insert proper C++ library support
100688fc2d0c6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
100698fc2d0c6Smrg	  ;;
100708fc2d0c6Smrg        esac
100718fc2d0c6Smrg        ;;
100724a041c5bSmacallan
100738fc2d0c6Smrg      cygwin* | mingw* | pw32* | cegcc*)
100748fc2d0c6Smrg	case $GXX,$cc_basename in
100758fc2d0c6Smrg	,cl* | no,cl* | ,icl* | no,icl*)
100768fc2d0c6Smrg	  # Native MSVC or ICC
100778fc2d0c6Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
100788fc2d0c6Smrg	  # no search path for DLLs.
100798fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
100808fc2d0c6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
100818fc2d0c6Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
100828fc2d0c6Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
100838fc2d0c6Smrg	  # Tell ltmain to make .lib files, not .a files.
100848fc2d0c6Smrg	  libext=lib
100858fc2d0c6Smrg	  # Tell ltmain to make .dll files, not .so files.
100868fc2d0c6Smrg	  shrext_cmds=.dll
100878fc2d0c6Smrg	  # FIXME: Setting linknames here is a bad hack.
100888fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
100898fc2d0c6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
100908fc2d0c6Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
100918fc2d0c6Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
100928fc2d0c6Smrg            else
100938fc2d0c6Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
100948fc2d0c6Smrg            fi~
100958fc2d0c6Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
100968fc2d0c6Smrg            linknames='
100978fc2d0c6Smrg	  # The linker will not automatically build a static lib if we build a DLL.
100988fc2d0c6Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
100998fc2d0c6Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
101008fc2d0c6Smrg	  # Don't use ranlib
101018fc2d0c6Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
101028fc2d0c6Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
101038fc2d0c6Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
101048fc2d0c6Smrg            case $lt_outputfile in
101058fc2d0c6Smrg              *.exe|*.EXE) ;;
101068fc2d0c6Smrg              *)
101078fc2d0c6Smrg                lt_outputfile=$lt_outputfile.exe
101088fc2d0c6Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
101098fc2d0c6Smrg                ;;
101108fc2d0c6Smrg            esac~
101118fc2d0c6Smrg            func_to_tool_file "$lt_outputfile"~
101128fc2d0c6Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
101138fc2d0c6Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
101148fc2d0c6Smrg              $RM "$lt_outputfile.manifest";
101158fc2d0c6Smrg            fi'
101168fc2d0c6Smrg	  ;;
101178fc2d0c6Smrg	*)
101188fc2d0c6Smrg	  # g++
101198fc2d0c6Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
101208fc2d0c6Smrg	  # as there is no search path for DLLs.
101218fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
101228fc2d0c6Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
101238fc2d0c6Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
101248fc2d0c6Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
101258fc2d0c6Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
101264a041c5bSmacallan
101278fc2d0c6Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
101288fc2d0c6Smrg	    _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'
101298fc2d0c6Smrg	    # If the export-symbols file already is a .def file, use it as
101308fc2d0c6Smrg	    # is; otherwise, prepend EXPORTS...
101318fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
101328fc2d0c6Smrg              cp $export_symbols $output_objdir/$soname.def;
101338fc2d0c6Smrg            else
101348fc2d0c6Smrg              echo EXPORTS > $output_objdir/$soname.def;
101358fc2d0c6Smrg              cat $export_symbols >> $output_objdir/$soname.def;
101368fc2d0c6Smrg            fi~
101378fc2d0c6Smrg            $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'
101388fc2d0c6Smrg	  else
101398fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
101408fc2d0c6Smrg	  fi
101418fc2d0c6Smrg	  ;;
101428fc2d0c6Smrg	esac
101438fc2d0c6Smrg	;;
101448fc2d0c6Smrg      darwin* | rhapsody*)
101458fc2d0c6Smrg        _LT_DARWIN_LINKER_FEATURES($1)
101468fc2d0c6Smrg	;;
101474a041c5bSmacallan
101488fc2d0c6Smrg      os2*)
101498fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
101508fc2d0c6Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
101518fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
101528fc2d0c6Smrg	shrext_cmds=.dll
101538fc2d0c6Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
101548fc2d0c6Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
101558fc2d0c6Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
101568fc2d0c6Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
101578fc2d0c6Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
101588fc2d0c6Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
101598fc2d0c6Smrg	  emximp -o $lib $output_objdir/$libname.def'
101608fc2d0c6Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
101618fc2d0c6Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
101628fc2d0c6Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
101638fc2d0c6Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
101648fc2d0c6Smrg	  prefix_cmds="$SED"~
101658fc2d0c6Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
101668fc2d0c6Smrg	    prefix_cmds="$prefix_cmds -e 1d";
101678fc2d0c6Smrg	  fi~
101688fc2d0c6Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
101698fc2d0c6Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
101708fc2d0c6Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
101718fc2d0c6Smrg	  emximp -o $lib $output_objdir/$libname.def'
101728fc2d0c6Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
101738fc2d0c6Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
101748fc2d0c6Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
101758fc2d0c6Smrg	;;
101764a041c5bSmacallan
101778fc2d0c6Smrg      dgux*)
101788fc2d0c6Smrg        case $cc_basename in
101798fc2d0c6Smrg          ec++*)
101808fc2d0c6Smrg	    # FIXME: insert proper C++ library support
101818fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
101828fc2d0c6Smrg	    ;;
101838fc2d0c6Smrg          ghcx*)
101848fc2d0c6Smrg	    # Green Hills C++ Compiler
101858fc2d0c6Smrg	    # FIXME: insert proper C++ library support
101868fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
101878fc2d0c6Smrg	    ;;
101888fc2d0c6Smrg          *)
101898fc2d0c6Smrg	    # FIXME: insert proper C++ library support
101908fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
101918fc2d0c6Smrg	    ;;
101928fc2d0c6Smrg        esac
101938fc2d0c6Smrg        ;;
101944a041c5bSmacallan
101958fc2d0c6Smrg      freebsd2.*)
101968fc2d0c6Smrg        # C++ shared libraries reported to be fairly broken before
101978fc2d0c6Smrg	# switch to ELF
101988fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
101998fc2d0c6Smrg        ;;
102004a041c5bSmacallan
102018fc2d0c6Smrg      freebsd-elf*)
102028fc2d0c6Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
102038fc2d0c6Smrg        ;;
102044a041c5bSmacallan
102058fc2d0c6Smrg      freebsd* | dragonfly* | midnightbsd*)
102068fc2d0c6Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
102078fc2d0c6Smrg        # conventions
102088fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
102098fc2d0c6Smrg        ;;
102104a041c5bSmacallan
102118fc2d0c6Smrg      haiku*)
102128fc2d0c6Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
102138fc2d0c6Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
102148fc2d0c6Smrg        ;;
102154a041c5bSmacallan
102168fc2d0c6Smrg      hpux9*)
102178fc2d0c6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
102188fc2d0c6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
102198fc2d0c6Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
102208fc2d0c6Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
102218fc2d0c6Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
102228fc2d0c6Smrg				             # but as the default
102238fc2d0c6Smrg				             # location of the library.
1022454b44505Smrg
102258fc2d0c6Smrg        case $cc_basename in
102268fc2d0c6Smrg          CC*)
102278fc2d0c6Smrg            # FIXME: insert proper C++ library support
102288fc2d0c6Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
102298fc2d0c6Smrg            ;;
102308fc2d0c6Smrg          aCC*)
102318fc2d0c6Smrg            _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
102328fc2d0c6Smrg            # Commands to make compiler produce verbose output that lists
102338fc2d0c6Smrg            # what "hidden" libraries, object files and flags are used when
102348fc2d0c6Smrg            # linking a shared library.
102358fc2d0c6Smrg            #
102368fc2d0c6Smrg            # There doesn't appear to be a way to prevent this compiler from
102378fc2d0c6Smrg            # explicitly linking system object files so we need to strip them
102388fc2d0c6Smrg            # from the output so that they don't get included in the library
102398fc2d0c6Smrg            # dependencies.
102408fc2d0c6Smrg            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"'
102418fc2d0c6Smrg            ;;
102428fc2d0c6Smrg          *)
102438fc2d0c6Smrg            if test yes = "$GXX"; then
102448fc2d0c6Smrg              _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
102458fc2d0c6Smrg            else
102468fc2d0c6Smrg              # FIXME: insert proper C++ library support
102478fc2d0c6Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
102488fc2d0c6Smrg            fi
102498fc2d0c6Smrg            ;;
102508fc2d0c6Smrg        esac
102518fc2d0c6Smrg        ;;
1025254b44505Smrg
102538fc2d0c6Smrg      hpux10*|hpux11*)
102548fc2d0c6Smrg        if test no = "$with_gnu_ld"; then
102558fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
102568fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
1025754b44505Smrg
102588fc2d0c6Smrg          case $host_cpu in
102598fc2d0c6Smrg            hppa*64*|ia64*)
102608fc2d0c6Smrg              ;;
102618fc2d0c6Smrg            *)
102628fc2d0c6Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
102638fc2d0c6Smrg              ;;
102648fc2d0c6Smrg          esac
102658fc2d0c6Smrg        fi
102668fc2d0c6Smrg        case $host_cpu in
102678fc2d0c6Smrg          hppa*64*|ia64*)
102688fc2d0c6Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
102698fc2d0c6Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
102708fc2d0c6Smrg            ;;
102718fc2d0c6Smrg          *)
102728fc2d0c6Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
102738fc2d0c6Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
102748fc2d0c6Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
102758fc2d0c6Smrg					         # but as the default
102768fc2d0c6Smrg					         # location of the library.
102778fc2d0c6Smrg            ;;
102788fc2d0c6Smrg        esac
1027954b44505Smrg
102808fc2d0c6Smrg        case $cc_basename in
102818fc2d0c6Smrg          CC*)
102828fc2d0c6Smrg	    # FIXME: insert proper C++ library support
102838fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
102848fc2d0c6Smrg	    ;;
102858fc2d0c6Smrg          aCC*)
102868fc2d0c6Smrg	    case $host_cpu in
102878fc2d0c6Smrg	      hppa*64*)
102888fc2d0c6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
102898fc2d0c6Smrg	        ;;
102908fc2d0c6Smrg	      ia64*)
102918fc2d0c6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
102928fc2d0c6Smrg	        ;;
102938fc2d0c6Smrg	      *)
102948fc2d0c6Smrg	        _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'
102958fc2d0c6Smrg	        ;;
102968fc2d0c6Smrg	    esac
102978fc2d0c6Smrg	    # Commands to make compiler produce verbose output that lists
102988fc2d0c6Smrg	    # what "hidden" libraries, object files and flags are used when
102998fc2d0c6Smrg	    # linking a shared library.
103008fc2d0c6Smrg	    #
103018fc2d0c6Smrg	    # There doesn't appear to be a way to prevent this compiler from
103028fc2d0c6Smrg	    # explicitly linking system object files so we need to strip them
103038fc2d0c6Smrg	    # from the output so that they don't get included in the library
103048fc2d0c6Smrg	    # dependencies.
103058fc2d0c6Smrg	    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"'
103068fc2d0c6Smrg	    ;;
103078fc2d0c6Smrg          *)
103088fc2d0c6Smrg	    if test yes = "$GXX"; then
103098fc2d0c6Smrg	      if test no = "$with_gnu_ld"; then
103108fc2d0c6Smrg	        case $host_cpu in
103118fc2d0c6Smrg	          hppa*64*)
103128fc2d0c6Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
103138fc2d0c6Smrg	            ;;
103148fc2d0c6Smrg	          ia64*)
103158fc2d0c6Smrg	            _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'
103168fc2d0c6Smrg	            ;;
103178fc2d0c6Smrg	          *)
103188fc2d0c6Smrg	            _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'
103198fc2d0c6Smrg	            ;;
103208fc2d0c6Smrg	        esac
103218fc2d0c6Smrg	      fi
103228fc2d0c6Smrg	    else
103238fc2d0c6Smrg	      # FIXME: insert proper C++ library support
103248fc2d0c6Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
103258fc2d0c6Smrg	    fi
103268fc2d0c6Smrg	    ;;
103278fc2d0c6Smrg        esac
103288fc2d0c6Smrg        ;;
103290a392d7eSmrg
103308fc2d0c6Smrg      interix[[3-9]]*)
103318fc2d0c6Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
103328fc2d0c6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
103338fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
103348fc2d0c6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
103358fc2d0c6Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
103368fc2d0c6Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
103378fc2d0c6Smrg	# default) and relocated if they conflict, which is a slow very memory
103388fc2d0c6Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
103398fc2d0c6Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
103408fc2d0c6Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
103418fc2d0c6Smrg	_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'
103428fc2d0c6Smrg	_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'
103438fc2d0c6Smrg	;;
103448fc2d0c6Smrg      irix5* | irix6*)
103458fc2d0c6Smrg        case $cc_basename in
103468fc2d0c6Smrg          CC*)
103478fc2d0c6Smrg	    # SGI C++
103488fc2d0c6Smrg	    _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'
103490a392d7eSmrg
103508fc2d0c6Smrg	    # Archives containing C++ object files must be created using
103518fc2d0c6Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
103528fc2d0c6Smrg	    # necessary to make sure instantiated templates are included
103538fc2d0c6Smrg	    # in the archive.
103548fc2d0c6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
103558fc2d0c6Smrg	    ;;
103568fc2d0c6Smrg          *)
103578fc2d0c6Smrg	    if test yes = "$GXX"; then
103588fc2d0c6Smrg	      if test no = "$with_gnu_ld"; then
103598fc2d0c6Smrg	        _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'
103608fc2d0c6Smrg	      else
103618fc2d0c6Smrg	        _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'
103628fc2d0c6Smrg	      fi
103638fc2d0c6Smrg	    fi
103648fc2d0c6Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
103658fc2d0c6Smrg	    ;;
103668fc2d0c6Smrg        esac
103678fc2d0c6Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
103688fc2d0c6Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
103698fc2d0c6Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
103708fc2d0c6Smrg        ;;
103710a392d7eSmrg
103728fc2d0c6Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
103738fc2d0c6Smrg        case $cc_basename in
103748fc2d0c6Smrg          KCC*)
103758fc2d0c6Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
103760a392d7eSmrg
103778fc2d0c6Smrg	    # KCC will only create a shared library if the output file
103788fc2d0c6Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
103798fc2d0c6Smrg	    # to its proper name (with version) after linking.
103808fc2d0c6Smrg	    _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'
103818fc2d0c6Smrg	    _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'
103828fc2d0c6Smrg	    # Commands to make compiler produce verbose output that lists
103838fc2d0c6Smrg	    # what "hidden" libraries, object files and flags are used when
103848fc2d0c6Smrg	    # linking a shared library.
103858fc2d0c6Smrg	    #
103868fc2d0c6Smrg	    # There doesn't appear to be a way to prevent this compiler from
103878fc2d0c6Smrg	    # explicitly linking system object files so we need to strip them
103888fc2d0c6Smrg	    # from the output so that they don't get included in the library
103898fc2d0c6Smrg	    # dependencies.
103908fc2d0c6Smrg	    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"'
103914a041c5bSmacallan
103928fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
103938fc2d0c6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
103944a041c5bSmacallan
103958fc2d0c6Smrg	    # Archives containing C++ object files must be created using
103968fc2d0c6Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
103978fc2d0c6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
103988fc2d0c6Smrg	    ;;
103998fc2d0c6Smrg	  icpc* | ecpc* )
104008fc2d0c6Smrg	    # Intel C++
104018fc2d0c6Smrg	    with_gnu_ld=yes
104028fc2d0c6Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
104038fc2d0c6Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
104048fc2d0c6Smrg	    # earlier do not add the objects themselves.
104058fc2d0c6Smrg	    case `$CC -V 2>&1` in
104068fc2d0c6Smrg	      *"Version 7."*)
104078fc2d0c6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
104088fc2d0c6Smrg		_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'
104098fc2d0c6Smrg		;;
104108fc2d0c6Smrg	      *)  # Version 8.0 or newer
104118fc2d0c6Smrg	        tmp_idyn=
104128fc2d0c6Smrg	        case $host_cpu in
104138fc2d0c6Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
104148fc2d0c6Smrg		esac
104158fc2d0c6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
104168fc2d0c6Smrg		_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'
104178fc2d0c6Smrg		;;
104188fc2d0c6Smrg	    esac
104198fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
104208fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
104218fc2d0c6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
104228fc2d0c6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
104238fc2d0c6Smrg	    ;;
104248fc2d0c6Smrg          pgCC* | pgcpp*)
104258fc2d0c6Smrg            # Portland Group C++ compiler
104268fc2d0c6Smrg	    case `$CC -V` in
104278fc2d0c6Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
104288fc2d0c6Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
104298fc2d0c6Smrg               rm -rf $tpldir~
104308fc2d0c6Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
104318fc2d0c6Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
104328fc2d0c6Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
104338fc2d0c6Smrg                rm -rf $tpldir~
104348fc2d0c6Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
104358fc2d0c6Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
104368fc2d0c6Smrg                $RANLIB $oldlib'
104378fc2d0c6Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
104388fc2d0c6Smrg                rm -rf $tpldir~
104398fc2d0c6Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
104408fc2d0c6Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
104418fc2d0c6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
104428fc2d0c6Smrg                rm -rf $tpldir~
104438fc2d0c6Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
104448fc2d0c6Smrg                $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'
104458fc2d0c6Smrg	      ;;
104468fc2d0c6Smrg	    *) # Version 6 and above use weak symbols
104478fc2d0c6Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
104488fc2d0c6Smrg	      _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'
104498fc2d0c6Smrg	      ;;
104508fc2d0c6Smrg	    esac
104514a041c5bSmacallan
104528fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
104538fc2d0c6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
104548fc2d0c6Smrg	    _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'
104558fc2d0c6Smrg            ;;
104568fc2d0c6Smrg	  cxx*)
104578fc2d0c6Smrg	    # Compaq C++
104588fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
104598fc2d0c6Smrg	    _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'
104604a041c5bSmacallan
104618fc2d0c6Smrg	    runpath_var=LD_RUN_PATH
104628fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
104638fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
104644a041c5bSmacallan
104658fc2d0c6Smrg	    # Commands to make compiler produce verbose output that lists
104668fc2d0c6Smrg	    # what "hidden" libraries, object files and flags are used when
104678fc2d0c6Smrg	    # linking a shared library.
104688fc2d0c6Smrg	    #
104698fc2d0c6Smrg	    # There doesn't appear to be a way to prevent this compiler from
104708fc2d0c6Smrg	    # explicitly linking system object files so we need to strip them
104718fc2d0c6Smrg	    # from the output so that they don't get included in the library
104728fc2d0c6Smrg	    # dependencies.
104738fc2d0c6Smrg	    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'
104748fc2d0c6Smrg	    ;;
104758fc2d0c6Smrg	  xl* | mpixl* | bgxl*)
104768fc2d0c6Smrg	    # IBM XL 8.0 on PPC, with GNU ld
104778fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
104788fc2d0c6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
104798fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
104808fc2d0c6Smrg	    if test yes = "$supports_anon_versioning"; then
104818fc2d0c6Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
104828fc2d0c6Smrg                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
104838fc2d0c6Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
104848fc2d0c6Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
104858fc2d0c6Smrg	    fi
104868fc2d0c6Smrg	    ;;
104878fc2d0c6Smrg	  *)
104888fc2d0c6Smrg	    case `$CC -V 2>&1 | $SED 5q` in
104898fc2d0c6Smrg	    *Sun\ C*)
104908fc2d0c6Smrg	      # Sun C++ 5.9
104918fc2d0c6Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
104928fc2d0c6Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
104938fc2d0c6Smrg	      _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'
104948fc2d0c6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
104958fc2d0c6Smrg	      _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'
104968fc2d0c6Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
104974a041c5bSmacallan
104988fc2d0c6Smrg	      # Not sure whether something based on
104998fc2d0c6Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
105008fc2d0c6Smrg	      # would be better.
105018fc2d0c6Smrg	      output_verbose_link_cmd='func_echo_all'
105024a041c5bSmacallan
105038fc2d0c6Smrg	      # Archives containing C++ object files must be created using
105048fc2d0c6Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
105058fc2d0c6Smrg	      # necessary to make sure instantiated templates are included
105068fc2d0c6Smrg	      # in the archive.
105078fc2d0c6Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
105088fc2d0c6Smrg	      ;;
105098fc2d0c6Smrg	    esac
105108fc2d0c6Smrg	    ;;
105118fc2d0c6Smrg	esac
105128fc2d0c6Smrg	;;
105134a041c5bSmacallan
105148fc2d0c6Smrg      lynxos*)
105158fc2d0c6Smrg        # FIXME: insert proper C++ library support
105168fc2d0c6Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
105178fc2d0c6Smrg	;;
105184a041c5bSmacallan
105198fc2d0c6Smrg      m88k*)
105208fc2d0c6Smrg        # FIXME: insert proper C++ library support
105218fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
105228fc2d0c6Smrg	;;
105234a041c5bSmacallan
105248fc2d0c6Smrg      mvs*)
105258fc2d0c6Smrg        case $cc_basename in
105268fc2d0c6Smrg          cxx*)
105278fc2d0c6Smrg	    # FIXME: insert proper C++ library support
105288fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
105298fc2d0c6Smrg	    ;;
105308fc2d0c6Smrg	  *)
105318fc2d0c6Smrg	    # FIXME: insert proper C++ library support
105328fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
105338fc2d0c6Smrg	    ;;
105348fc2d0c6Smrg	esac
105358fc2d0c6Smrg	;;
105364a041c5bSmacallan
105378fc2d0c6Smrg      netbsd*)
105388fc2d0c6Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
105398fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
105408fc2d0c6Smrg	  wlarc=
105418fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
105428fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
105438fc2d0c6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
105448fc2d0c6Smrg	fi
105458fc2d0c6Smrg	# Workaround some broken pre-1.5 toolchains
105468fc2d0c6Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
105478fc2d0c6Smrg	;;
105484a041c5bSmacallan
105498fc2d0c6Smrg      *nto* | *qnx*)
105508fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
105518fc2d0c6Smrg	;;
105524a041c5bSmacallan
105538fc2d0c6Smrg      openbsd* | bitrig*)
105548fc2d0c6Smrg	if test -f /usr/libexec/ld.so; then
105558fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
105568fc2d0c6Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
105578fc2d0c6Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
105588fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
105598fc2d0c6Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
105608fc2d0c6Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
105618fc2d0c6Smrg	    _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'
105628fc2d0c6Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
105638fc2d0c6Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
105648fc2d0c6Smrg	  fi
105658fc2d0c6Smrg	  output_verbose_link_cmd=func_echo_all
105668fc2d0c6Smrg	else
105678fc2d0c6Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
105688fc2d0c6Smrg	fi
105698fc2d0c6Smrg	;;
105704a041c5bSmacallan
105718fc2d0c6Smrg      osf3* | osf4* | osf5*)
105728fc2d0c6Smrg        case $cc_basename in
105738fc2d0c6Smrg          KCC*)
105748fc2d0c6Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
1057554b44505Smrg
105768fc2d0c6Smrg	    # KCC will only create a shared library if the output file
105778fc2d0c6Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
105788fc2d0c6Smrg	    # to its proper name (with version) after linking.
105798fc2d0c6Smrg	    _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'
1058054b44505Smrg
105818fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
105828fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
105834a041c5bSmacallan
105848fc2d0c6Smrg	    # Archives containing C++ object files must be created using
105858fc2d0c6Smrg	    # the KAI C++ compiler.
105868fc2d0c6Smrg	    case $host in
105878fc2d0c6Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
105888fc2d0c6Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
105898fc2d0c6Smrg	    esac
105908fc2d0c6Smrg	    ;;
105918fc2d0c6Smrg          RCC*)
105928fc2d0c6Smrg	    # Rational C++ 2.4.1
105938fc2d0c6Smrg	    # FIXME: insert proper C++ library support
105948fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
105958fc2d0c6Smrg	    ;;
105968fc2d0c6Smrg          cxx*)
105978fc2d0c6Smrg	    case $host in
105988fc2d0c6Smrg	      osf3*)
105998fc2d0c6Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
106008fc2d0c6Smrg	        _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'
106018fc2d0c6Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
106028fc2d0c6Smrg		;;
106038fc2d0c6Smrg	      *)
106048fc2d0c6Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
106058fc2d0c6Smrg	        _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'
106068fc2d0c6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
106078fc2d0c6Smrg                  echo "-hidden">> $lib.exp~
106088fc2d0c6Smrg                  $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~
106098fc2d0c6Smrg                  $RM $lib.exp'
106108fc2d0c6Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
106118fc2d0c6Smrg		;;
106128fc2d0c6Smrg	    esac
1061354b44505Smrg
106148fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
1061554b44505Smrg
106168fc2d0c6Smrg	    # Commands to make compiler produce verbose output that lists
106178fc2d0c6Smrg	    # what "hidden" libraries, object files and flags are used when
106188fc2d0c6Smrg	    # linking a shared library.
106198fc2d0c6Smrg	    #
106208fc2d0c6Smrg	    # There doesn't appear to be a way to prevent this compiler from
106218fc2d0c6Smrg	    # explicitly linking system object files so we need to strip them
106228fc2d0c6Smrg	    # from the output so that they don't get included in the library
106238fc2d0c6Smrg	    # dependencies.
106248fc2d0c6Smrg	    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"'
106258fc2d0c6Smrg	    ;;
106268fc2d0c6Smrg	  *)
106278fc2d0c6Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
106288fc2d0c6Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
106298fc2d0c6Smrg	      case $host in
106308fc2d0c6Smrg	        osf3*)
106318fc2d0c6Smrg	          _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'
106328fc2d0c6Smrg		  ;;
106338fc2d0c6Smrg	        *)
106348fc2d0c6Smrg	          _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'
106358fc2d0c6Smrg		  ;;
106368fc2d0c6Smrg	      esac
1063754b44505Smrg
106388fc2d0c6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
106398fc2d0c6Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
106408fc2d0c6Smrg
106418fc2d0c6Smrg	      # Commands to make compiler produce verbose output that lists
106428fc2d0c6Smrg	      # what "hidden" libraries, object files and flags are used when
106438fc2d0c6Smrg	      # linking a shared library.
106448fc2d0c6Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
106458fc2d0c6Smrg
106468fc2d0c6Smrg	    else
106478fc2d0c6Smrg	      # FIXME: insert proper C++ library support
106488fc2d0c6Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
106498fc2d0c6Smrg	    fi
106508fc2d0c6Smrg	    ;;
106518fc2d0c6Smrg        esac
106528fc2d0c6Smrg        ;;
106534a041c5bSmacallan
106548fc2d0c6Smrg      psos*)
106558fc2d0c6Smrg        # FIXME: insert proper C++ library support
106568fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
106578fc2d0c6Smrg        ;;
106584a041c5bSmacallan
106598fc2d0c6Smrg      sunos4*)
106608fc2d0c6Smrg        case $cc_basename in
106618fc2d0c6Smrg          CC*)
106628fc2d0c6Smrg	    # Sun C++ 4.x
106638fc2d0c6Smrg	    # FIXME: insert proper C++ library support
106648fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
106658fc2d0c6Smrg	    ;;
106668fc2d0c6Smrg          lcc*)
106678fc2d0c6Smrg	    # Lucid
106688fc2d0c6Smrg	    # FIXME: insert proper C++ library support
106698fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
106708fc2d0c6Smrg	    ;;
106718fc2d0c6Smrg          *)
106728fc2d0c6Smrg	    # FIXME: insert proper C++ library support
106738fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
106748fc2d0c6Smrg	    ;;
106758fc2d0c6Smrg        esac
106768fc2d0c6Smrg        ;;
106774a041c5bSmacallan
106788fc2d0c6Smrg      solaris*)
106798fc2d0c6Smrg        case $cc_basename in
106808fc2d0c6Smrg          CC* | sunCC*)
106818fc2d0c6Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
106828fc2d0c6Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
106838fc2d0c6Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
106848fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
106858fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
106868fc2d0c6Smrg              $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'
106874a041c5bSmacallan
106888fc2d0c6Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
106898fc2d0c6Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
106908fc2d0c6Smrg	    case $host_os in
106918fc2d0c6Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
106928fc2d0c6Smrg	      *)
106938fc2d0c6Smrg		# The compiler driver will combine and reorder linker options,
106948fc2d0c6Smrg		# but understands '-z linker_flag'.
106958fc2d0c6Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
106968fc2d0c6Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
106978fc2d0c6Smrg	        ;;
106988fc2d0c6Smrg	    esac
106998fc2d0c6Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
107004a041c5bSmacallan
107018fc2d0c6Smrg	    output_verbose_link_cmd='func_echo_all'
107024a041c5bSmacallan
107038fc2d0c6Smrg	    # Archives containing C++ object files must be created using
107048fc2d0c6Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
107058fc2d0c6Smrg	    # necessary to make sure instantiated templates are included
107068fc2d0c6Smrg	    # in the archive.
107078fc2d0c6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
107088fc2d0c6Smrg	    ;;
107098fc2d0c6Smrg          gcx*)
107108fc2d0c6Smrg	    # Green Hills C++ Compiler
107118fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
107124a041c5bSmacallan
107138fc2d0c6Smrg	    # The C++ compiler must be used to create the archive.
107148fc2d0c6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
107158fc2d0c6Smrg	    ;;
107168fc2d0c6Smrg          *)
107178fc2d0c6Smrg	    # GNU C++ compiler with Solaris linker
107188fc2d0c6Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
107198fc2d0c6Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
107208fc2d0c6Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
107218fc2d0c6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
107228fc2d0c6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
107238fc2d0c6Smrg                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
107244a041c5bSmacallan
107258fc2d0c6Smrg	        # Commands to make compiler produce verbose output that lists
107268fc2d0c6Smrg	        # what "hidden" libraries, object files and flags are used when
107278fc2d0c6Smrg	        # linking a shared library.
107288fc2d0c6Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
107298fc2d0c6Smrg	      else
107308fc2d0c6Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
107318fc2d0c6Smrg	        # platform.
107328fc2d0c6Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
107338fc2d0c6Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
107348fc2d0c6Smrg                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
107354a041c5bSmacallan
107368fc2d0c6Smrg	        # Commands to make compiler produce verbose output that lists
107378fc2d0c6Smrg	        # what "hidden" libraries, object files and flags are used when
107388fc2d0c6Smrg	        # linking a shared library.
107398fc2d0c6Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
107408fc2d0c6Smrg	      fi
107414a041c5bSmacallan
107428fc2d0c6Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
107438fc2d0c6Smrg	      case $host_os in
107448fc2d0c6Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
107458fc2d0c6Smrg		*)
107468fc2d0c6Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
107478fc2d0c6Smrg		  ;;
107488fc2d0c6Smrg	      esac
107498fc2d0c6Smrg	    fi
107508fc2d0c6Smrg	    ;;
107518fc2d0c6Smrg        esac
107528fc2d0c6Smrg        ;;
107534a041c5bSmacallan
107548fc2d0c6Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
107558fc2d0c6Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
107568fc2d0c6Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
107578fc2d0c6Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
107588fc2d0c6Smrg      runpath_var='LD_RUN_PATH'
107594a041c5bSmacallan
107608fc2d0c6Smrg      case $cc_basename in
107618fc2d0c6Smrg        CC*)
107628fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
107638fc2d0c6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
107648fc2d0c6Smrg	  ;;
107658fc2d0c6Smrg	*)
107668fc2d0c6Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
107678fc2d0c6Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
107688fc2d0c6Smrg	  ;;
107698fc2d0c6Smrg      esac
107708fc2d0c6Smrg      ;;
1077154b44505Smrg
107728fc2d0c6Smrg      sysv5* | sco3.2v5* | sco5v6*)
107738fc2d0c6Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
107748fc2d0c6Smrg	# link with -lc, and that would cause any symbols used from libc to
107758fc2d0c6Smrg	# always be unresolved, which means just about no library would
107768fc2d0c6Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
107778fc2d0c6Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
107788fc2d0c6Smrg	# as -z defs.
107798fc2d0c6Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
107808fc2d0c6Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
107818fc2d0c6Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
107828fc2d0c6Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
107838fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
107848fc2d0c6Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
107858fc2d0c6Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
107868fc2d0c6Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
107878fc2d0c6Smrg	runpath_var='LD_RUN_PATH'
107884a041c5bSmacallan
107898fc2d0c6Smrg	case $cc_basename in
107908fc2d0c6Smrg          CC*)
107918fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
107928fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
107938fc2d0c6Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
107948fc2d0c6Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
107958fc2d0c6Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
107968fc2d0c6Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
107978fc2d0c6Smrg	    ;;
107988fc2d0c6Smrg	  *)
107998fc2d0c6Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
108008fc2d0c6Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
108018fc2d0c6Smrg	    ;;
108028fc2d0c6Smrg	esac
108038fc2d0c6Smrg      ;;
108044a041c5bSmacallan
108058fc2d0c6Smrg      tandem*)
108068fc2d0c6Smrg        case $cc_basename in
108078fc2d0c6Smrg          NCC*)
108088fc2d0c6Smrg	    # NonStop-UX NCC 3.20
108098fc2d0c6Smrg	    # FIXME: insert proper C++ library support
108108fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
108118fc2d0c6Smrg	    ;;
108128fc2d0c6Smrg          *)
108138fc2d0c6Smrg	    # FIXME: insert proper C++ library support
108148fc2d0c6Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
108158fc2d0c6Smrg	    ;;
108168fc2d0c6Smrg        esac
108178fc2d0c6Smrg        ;;
108184a041c5bSmacallan
108198fc2d0c6Smrg      vxworks*)
108208fc2d0c6Smrg        # FIXME: insert proper C++ library support
108218fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
108228fc2d0c6Smrg        ;;
108234a041c5bSmacallan
108248fc2d0c6Smrg      *)
108258fc2d0c6Smrg        # FIXME: insert proper C++ library support
108268fc2d0c6Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
108278fc2d0c6Smrg        ;;
108288fc2d0c6Smrg    esac
108294a041c5bSmacallan
108308fc2d0c6Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
108318fc2d0c6Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
108324a041c5bSmacallan
108338fc2d0c6Smrg    _LT_TAGVAR(GCC, $1)=$GXX
108348fc2d0c6Smrg    _LT_TAGVAR(LD, $1)=$LD
108354a041c5bSmacallan
108368fc2d0c6Smrg    ## CAVEAT EMPTOR:
108378fc2d0c6Smrg    ## There is no encapsulation within the following macros, do not change
108388fc2d0c6Smrg    ## the running order or otherwise move them around unless you know exactly
108398fc2d0c6Smrg    ## what you are doing...
108408fc2d0c6Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
108418fc2d0c6Smrg    _LT_COMPILER_PIC($1)
108428fc2d0c6Smrg    _LT_COMPILER_C_O($1)
108438fc2d0c6Smrg    _LT_COMPILER_FILE_LOCKS($1)
108448fc2d0c6Smrg    _LT_LINKER_SHLIBS($1)
108458fc2d0c6Smrg    _LT_SYS_DYNAMIC_LINKER($1)
108468fc2d0c6Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
108474a041c5bSmacallan
108488fc2d0c6Smrg    _LT_CONFIG($1)
108498fc2d0c6Smrg  fi # test -n "$compiler"
1085054b44505Smrg
108518fc2d0c6Smrg  CC=$lt_save_CC
108528fc2d0c6Smrg  CFLAGS=$lt_save_CFLAGS
108538fc2d0c6Smrg  LDCXX=$LD
108548fc2d0c6Smrg  LD=$lt_save_LD
108558fc2d0c6Smrg  GCC=$lt_save_GCC
108568fc2d0c6Smrg  with_gnu_ld=$lt_save_with_gnu_ld
108578fc2d0c6Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
108588fc2d0c6Smrg  lt_cv_path_LD=$lt_save_path_LD
108598fc2d0c6Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
108608fc2d0c6Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
108618fc2d0c6Smrgfi # test yes != "$_lt_caught_CXX_error"
1086254b44505Smrg
108638fc2d0c6SmrgAC_LANG_POP
108648fc2d0c6Smrg])# _LT_LANG_CXX_CONFIG
1086554b44505Smrg
1086654b44505Smrg
108678fc2d0c6Smrg# _LT_FUNC_STRIPNAME_CNF
108688fc2d0c6Smrg# ----------------------
108698fc2d0c6Smrg# func_stripname_cnf prefix suffix name
108708fc2d0c6Smrg# strip PREFIX and SUFFIX off of NAME.
108718fc2d0c6Smrg# PREFIX and SUFFIX must not contain globbing or regex special
108728fc2d0c6Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
108738fc2d0c6Smrg# dot (in which case that matches only a dot).
1087454b44505Smrg#
108758fc2d0c6Smrg# This function is identical to the (non-XSI) version of func_stripname,
108768fc2d0c6Smrg# except this one can be used by m4 code that may be executed by configure,
108778fc2d0c6Smrg# rather than the libtool script.
108788fc2d0c6Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
108798fc2d0c6SmrgAC_REQUIRE([_LT_DECL_SED])
108808fc2d0c6SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
108818fc2d0c6Smrgfunc_stripname_cnf ()
108828fc2d0c6Smrg{
108838fc2d0c6Smrg  case @S|@2 in
108848fc2d0c6Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
108858fc2d0c6Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
108868fc2d0c6Smrg  esac
108878fc2d0c6Smrg} # func_stripname_cnf
108888fc2d0c6Smrg])# _LT_FUNC_STRIPNAME_CNF
1088954b44505Smrg
1089054b44505Smrg
108918fc2d0c6Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
108928fc2d0c6Smrg# ---------------------------------
108938fc2d0c6Smrg# Figure out "hidden" library dependencies from verbose
108948fc2d0c6Smrg# compiler output when linking a shared library.
108958fc2d0c6Smrg# Parse the compiler output and extract the necessary
108968fc2d0c6Smrg# objects, libraries and library flags.
108978fc2d0c6Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
108988fc2d0c6Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
108998fc2d0c6SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
109008fc2d0c6Smrg# Dependencies to place before and after the object being linked:
109018fc2d0c6Smrg_LT_TAGVAR(predep_objects, $1)=
109028fc2d0c6Smrg_LT_TAGVAR(postdep_objects, $1)=
109038fc2d0c6Smrg_LT_TAGVAR(predeps, $1)=
109048fc2d0c6Smrg_LT_TAGVAR(postdeps, $1)=
109058fc2d0c6Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
1090654b44505Smrg
109078fc2d0c6Smrgdnl we can't use the lt_simple_compile_test_code here,
109088fc2d0c6Smrgdnl because it contains code intended for an executable,
109098fc2d0c6Smrgdnl not a library.  It's possible we should let each
109108fc2d0c6Smrgdnl tag define a new lt_????_link_test_code variable,
109118fc2d0c6Smrgdnl but it's only used here...
109128fc2d0c6Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
109138fc2d0c6Smrgint a;
109148fc2d0c6Smrgvoid foo (void) { a = 0; }
109158fc2d0c6Smrg_LT_EOF
109168fc2d0c6Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
109178fc2d0c6Smrgclass Foo
109188fc2d0c6Smrg{
109198fc2d0c6Smrgpublic:
109208fc2d0c6Smrg  Foo (void) { a = 0; }
109218fc2d0c6Smrgprivate:
109228fc2d0c6Smrg  int a;
109238fc2d0c6Smrg};
109248fc2d0c6Smrg_LT_EOF
109258fc2d0c6Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
109268fc2d0c6Smrg      subroutine foo
109278fc2d0c6Smrg      implicit none
109288fc2d0c6Smrg      integer*4 a
109298fc2d0c6Smrg      a=0
109308fc2d0c6Smrg      return
109318fc2d0c6Smrg      end
109328fc2d0c6Smrg_LT_EOF
109338fc2d0c6Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
109348fc2d0c6Smrg      subroutine foo
109358fc2d0c6Smrg      implicit none
109368fc2d0c6Smrg      integer a
109378fc2d0c6Smrg      a=0
109388fc2d0c6Smrg      return
109398fc2d0c6Smrg      end
109408fc2d0c6Smrg_LT_EOF
109418fc2d0c6Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
109428fc2d0c6Smrgpublic class foo {
109438fc2d0c6Smrg  private int a;
109448fc2d0c6Smrg  public void bar (void) {
109458fc2d0c6Smrg    a = 0;
109468fc2d0c6Smrg  }
109478fc2d0c6Smrg};
109488fc2d0c6Smrg_LT_EOF
109498fc2d0c6Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
109508fc2d0c6Smrgpackage foo
109518fc2d0c6Smrgfunc foo() {
109528fc2d0c6Smrg}
109538fc2d0c6Smrg_LT_EOF
109548fc2d0c6Smrg])
1095554b44505Smrg
109568fc2d0c6Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
109578fc2d0c6Smrgcase "$CC $CFLAGS " in #(
109588fc2d0c6Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
109598fc2d0c6Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
109608fc2d0c6Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
109618fc2d0c6Smrgesac
1096254b44505Smrg
109638fc2d0c6Smrgdnl Parse the compiler output and extract the necessary
109648fc2d0c6Smrgdnl objects, libraries and library flags.
109658fc2d0c6Smrgif AC_TRY_EVAL(ac_compile); then
109668fc2d0c6Smrg  # Parse the compiler output and extract the necessary
109678fc2d0c6Smrg  # objects, libraries and library flags.
1096854b44505Smrg
109698fc2d0c6Smrg  # Sentinel used to keep track of whether or not we are before
109708fc2d0c6Smrg  # the conftest object file.
109718fc2d0c6Smrg  pre_test_object_deps_done=no
1097254b44505Smrg
109738fc2d0c6Smrg  for p in `eval "$output_verbose_link_cmd"`; do
109748fc2d0c6Smrg    case $prev$p in
1097554b44505Smrg
109768fc2d0c6Smrg    -L* | -R* | -l*)
109778fc2d0c6Smrg       # Some compilers place space between "-{L,R}" and the path.
109788fc2d0c6Smrg       # Remove the space.
109798fc2d0c6Smrg       if test x-L = "$p" ||
109808fc2d0c6Smrg          test x-R = "$p"; then
109818fc2d0c6Smrg	 prev=$p
109828fc2d0c6Smrg	 continue
109838fc2d0c6Smrg       fi
1098454b44505Smrg
109858fc2d0c6Smrg       # Expand the sysroot to ease extracting the directories later.
109868fc2d0c6Smrg       if test -z "$prev"; then
109878fc2d0c6Smrg         case $p in
109888fc2d0c6Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
109898fc2d0c6Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
109908fc2d0c6Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
109918fc2d0c6Smrg         esac
109928fc2d0c6Smrg       fi
109938fc2d0c6Smrg       case $p in
109948fc2d0c6Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
109958fc2d0c6Smrg       esac
109968fc2d0c6Smrg       if test no = "$pre_test_object_deps_done"; then
109978fc2d0c6Smrg	 case $prev in
109988fc2d0c6Smrg	 -L | -R)
109998fc2d0c6Smrg	   # Internal compiler library paths should come after those
110008fc2d0c6Smrg	   # provided the user.  The postdeps already come after the
110018fc2d0c6Smrg	   # user supplied libs so there is no need to process them.
110028fc2d0c6Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
110038fc2d0c6Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
110048fc2d0c6Smrg	   else
110058fc2d0c6Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
110068fc2d0c6Smrg	   fi
110078fc2d0c6Smrg	   ;;
110088fc2d0c6Smrg	 # The "-l" case would never come before the object being
110098fc2d0c6Smrg	 # linked, so don't bother handling this case.
110108fc2d0c6Smrg	 esac
110118fc2d0c6Smrg       else
110128fc2d0c6Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
110138fc2d0c6Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
110148fc2d0c6Smrg	 else
110158fc2d0c6Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
110168fc2d0c6Smrg	 fi
110178fc2d0c6Smrg       fi
110188fc2d0c6Smrg       prev=
110198fc2d0c6Smrg       ;;
110200a392d7eSmrg
110218fc2d0c6Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
110228fc2d0c6Smrg    *.$objext)
110238fc2d0c6Smrg       # This assumes that the test object file only shows up
110248fc2d0c6Smrg       # once in the compiler output.
110258fc2d0c6Smrg       if test "$p" = "conftest.$objext"; then
110268fc2d0c6Smrg	 pre_test_object_deps_done=yes
110278fc2d0c6Smrg	 continue
110288fc2d0c6Smrg       fi
110298fc2d0c6Smrg
110308fc2d0c6Smrg       if test no = "$pre_test_object_deps_done"; then
110318fc2d0c6Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
110328fc2d0c6Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
110338fc2d0c6Smrg	 else
110348fc2d0c6Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
110358fc2d0c6Smrg	 fi
110368fc2d0c6Smrg       else
110378fc2d0c6Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
110388fc2d0c6Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
110398fc2d0c6Smrg	 else
110408fc2d0c6Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
110418fc2d0c6Smrg	 fi
110428fc2d0c6Smrg       fi
110438fc2d0c6Smrg       ;;
110440a392d7eSmrg
110458fc2d0c6Smrg    *) ;; # Ignore the rest.
1104654b44505Smrg
110478fc2d0c6Smrg    esac
110488fc2d0c6Smrg  done
1104954b44505Smrg
110508fc2d0c6Smrg  # Clean up.
110518fc2d0c6Smrg  rm -f a.out a.exe
1105254b44505Smrgelse
110538fc2d0c6Smrg  echo "libtool.m4: error: problem compiling $1 test program"
1105454b44505Smrgfi
1105554b44505Smrg
110568fc2d0c6Smrg$RM -f confest.$objext
110578fc2d0c6SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
1105854b44505Smrg
110598fc2d0c6Smrg# PORTME: override above test on systems where it is broken
110608fc2d0c6Smrgm4_if([$1], [CXX],
110618fc2d0c6Smrg[case $host_os in
110628fc2d0c6Smrginterix[[3-9]]*)
110638fc2d0c6Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
110648fc2d0c6Smrg  # hack all around it, let's just trust "g++" to DTRT.
110658fc2d0c6Smrg  _LT_TAGVAR(predep_objects,$1)=
110668fc2d0c6Smrg  _LT_TAGVAR(postdep_objects,$1)=
110678fc2d0c6Smrg  _LT_TAGVAR(postdeps,$1)=
110688fc2d0c6Smrg  ;;
110698fc2d0c6Smrgesac
110708fc2d0c6Smrg])
1107154b44505Smrg
110728fc2d0c6Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
110738fc2d0c6Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
110748fc2d0c6Smrgesac
110758fc2d0c6Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
110768fc2d0c6Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
110778fc2d0c6Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
110788fc2d0c6Smrgfi
110798fc2d0c6Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
110808fc2d0c6Smrg    [The directories searched by this compiler when creating a shared library])
110818fc2d0c6Smrg_LT_TAGDECL([], [predep_objects], [1],
110828fc2d0c6Smrg    [Dependencies to place before and after the objects being linked to
110838fc2d0c6Smrg    create a shared library])
110848fc2d0c6Smrg_LT_TAGDECL([], [postdep_objects], [1])
110858fc2d0c6Smrg_LT_TAGDECL([], [predeps], [1])
110868fc2d0c6Smrg_LT_TAGDECL([], [postdeps], [1])
110878fc2d0c6Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
110888fc2d0c6Smrg    [The library search path used internally by the compiler when linking
110898fc2d0c6Smrg    a shared library])
110908fc2d0c6Smrg])# _LT_SYS_HIDDEN_LIBDEPS
1109154b44505Smrg
1109254b44505Smrg
110938fc2d0c6Smrg# _LT_LANG_F77_CONFIG([TAG])
110948fc2d0c6Smrg# --------------------------
110958fc2d0c6Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
110968fc2d0c6Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
110978fc2d0c6Smrg# to write the compiler configuration to 'libtool'.
110988fc2d0c6Smrgm4_defun([_LT_LANG_F77_CONFIG],
110998fc2d0c6Smrg[AC_LANG_PUSH(Fortran 77)
111008fc2d0c6Smrgif test -z "$F77" || test no = "$F77"; then
111018fc2d0c6Smrg  _lt_disable_F77=yes
1110254b44505Smrgfi
1110354b44505Smrg
111048fc2d0c6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
111058fc2d0c6Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
111068fc2d0c6Smrg_LT_TAGVAR(always_export_symbols, $1)=no
111078fc2d0c6Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
111088fc2d0c6Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
111098fc2d0c6Smrg_LT_TAGVAR(hardcode_direct, $1)=no
111108fc2d0c6Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
111118fc2d0c6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
111128fc2d0c6Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
111138fc2d0c6Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
111148fc2d0c6Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
111158fc2d0c6Smrg_LT_TAGVAR(inherit_rpath, $1)=no
111168fc2d0c6Smrg_LT_TAGVAR(module_cmds, $1)=
111178fc2d0c6Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
111188fc2d0c6Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
111198fc2d0c6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
111208fc2d0c6Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
111218fc2d0c6Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
111228fc2d0c6Smrg_LT_TAGVAR(no_undefined_flag, $1)=
111238fc2d0c6Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
111248fc2d0c6Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
111250a392d7eSmrg
111268fc2d0c6Smrg# Source file extension for f77 test sources.
111278fc2d0c6Smrgac_ext=f
111280a392d7eSmrg
111298fc2d0c6Smrg# Object file extension for compiled f77 test sources.
111308fc2d0c6Smrgobjext=o
111318fc2d0c6Smrg_LT_TAGVAR(objext, $1)=$objext
1113254b44505Smrg
111338fc2d0c6Smrg# No sense in running all these tests if we already determined that
111348fc2d0c6Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
111358fc2d0c6Smrg# are currently assumed to apply to all compilers on this platform,
111368fc2d0c6Smrg# and will be corrupted by setting them based on a non-working compiler.
111378fc2d0c6Smrgif test yes != "$_lt_disable_F77"; then
111388fc2d0c6Smrg  # Code to be used in simple compile tests
111398fc2d0c6Smrg  lt_simple_compile_test_code="\
111408fc2d0c6Smrg      subroutine t
111418fc2d0c6Smrg      return
111428fc2d0c6Smrg      end
111438fc2d0c6Smrg"
1114454b44505Smrg
111458fc2d0c6Smrg  # Code to be used in simple link tests
111468fc2d0c6Smrg  lt_simple_link_test_code="\
111478fc2d0c6Smrg      program t
111488fc2d0c6Smrg      end
111498fc2d0c6Smrg"
1115054b44505Smrg
111518fc2d0c6Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
111528fc2d0c6Smrg  _LT_TAG_COMPILER
1115354b44505Smrg
111548fc2d0c6Smrg  # save warnings/boilerplate of simple test code
111558fc2d0c6Smrg  _LT_COMPILER_BOILERPLATE
111568fc2d0c6Smrg  _LT_LINKER_BOILERPLATE
1115754b44505Smrg
111588fc2d0c6Smrg  # Allow CC to be a program name with arguments.
111598fc2d0c6Smrg  lt_save_CC=$CC
111608fc2d0c6Smrg  lt_save_GCC=$GCC
111618fc2d0c6Smrg  lt_save_CFLAGS=$CFLAGS
111628fc2d0c6Smrg  CC=${F77-"f77"}
111638fc2d0c6Smrg  CFLAGS=$FFLAGS
111648fc2d0c6Smrg  compiler=$CC
111658fc2d0c6Smrg  _LT_TAGVAR(compiler, $1)=$CC
111668fc2d0c6Smrg  _LT_CC_BASENAME([$compiler])
111678fc2d0c6Smrg  GCC=$G77
111688fc2d0c6Smrg  if test -n "$compiler"; then
111698fc2d0c6Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
111708fc2d0c6Smrg    AC_MSG_RESULT([$can_build_shared])
111718fc2d0c6Smrg
111728fc2d0c6Smrg    AC_MSG_CHECKING([whether to build shared libraries])
111738fc2d0c6Smrg    test no = "$can_build_shared" && enable_shared=no
111748fc2d0c6Smrg
111758fc2d0c6Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
111768fc2d0c6Smrg    # are all built from PIC.
111778fc2d0c6Smrg    case $host_os in
111788fc2d0c6Smrg      aix3*)
111798fc2d0c6Smrg        test yes = "$enable_shared" && enable_static=no
111808fc2d0c6Smrg        if test -n "$RANLIB"; then
111818fc2d0c6Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
111828fc2d0c6Smrg          postinstall_cmds='$RANLIB $lib'
111838fc2d0c6Smrg        fi
111848fc2d0c6Smrg        ;;
111858fc2d0c6Smrg      aix[[4-9]]*)
111868fc2d0c6Smrg	if test ia64 != "$host_cpu"; then
111878fc2d0c6Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
111888fc2d0c6Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
111898fc2d0c6Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
111908fc2d0c6Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
111918fc2d0c6Smrg	  esac
111928fc2d0c6Smrg	fi
111938fc2d0c6Smrg        ;;
111948fc2d0c6Smrg    esac
111958fc2d0c6Smrg    AC_MSG_RESULT([$enable_shared])
1119654b44505Smrg
111978fc2d0c6Smrg    AC_MSG_CHECKING([whether to build static libraries])
111988fc2d0c6Smrg    # Make sure either enable_shared or enable_static is yes.
111998fc2d0c6Smrg    test yes = "$enable_shared" || enable_static=yes
112008fc2d0c6Smrg    AC_MSG_RESULT([$enable_static])
1120154b44505Smrg
112028fc2d0c6Smrg    _LT_TAGVAR(GCC, $1)=$G77
112038fc2d0c6Smrg    _LT_TAGVAR(LD, $1)=$LD
1120454b44505Smrg
112058fc2d0c6Smrg    ## CAVEAT EMPTOR:
112068fc2d0c6Smrg    ## There is no encapsulation within the following macros, do not change
112078fc2d0c6Smrg    ## the running order or otherwise move them around unless you know exactly
112088fc2d0c6Smrg    ## what you are doing...
112098fc2d0c6Smrg    _LT_COMPILER_PIC($1)
112108fc2d0c6Smrg    _LT_COMPILER_C_O($1)
112118fc2d0c6Smrg    _LT_COMPILER_FILE_LOCKS($1)
112128fc2d0c6Smrg    _LT_LINKER_SHLIBS($1)
112138fc2d0c6Smrg    _LT_SYS_DYNAMIC_LINKER($1)
112148fc2d0c6Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
1121554b44505Smrg
112168fc2d0c6Smrg    _LT_CONFIG($1)
112178fc2d0c6Smrg  fi # test -n "$compiler"
1121854b44505Smrg
112198fc2d0c6Smrg  GCC=$lt_save_GCC
112208fc2d0c6Smrg  CC=$lt_save_CC
112218fc2d0c6Smrg  CFLAGS=$lt_save_CFLAGS
112228fc2d0c6Smrgfi # test yes != "$_lt_disable_F77"
1122354b44505Smrg
112248fc2d0c6SmrgAC_LANG_POP
112258fc2d0c6Smrg])# _LT_LANG_F77_CONFIG
1122654b44505Smrg
1122754b44505Smrg
112288fc2d0c6Smrg# _LT_LANG_FC_CONFIG([TAG])
112298fc2d0c6Smrg# -------------------------
112308fc2d0c6Smrg# Ensure that the configuration variables for a Fortran compiler are
112318fc2d0c6Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
112328fc2d0c6Smrg# to write the compiler configuration to 'libtool'.
112338fc2d0c6Smrgm4_defun([_LT_LANG_FC_CONFIG],
112348fc2d0c6Smrg[AC_LANG_PUSH(Fortran)
1123554b44505Smrg
112368fc2d0c6Smrgif test -z "$FC" || test no = "$FC"; then
112378fc2d0c6Smrg  _lt_disable_FC=yes
1123854b44505Smrgfi
1123954b44505Smrg
112408fc2d0c6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
112418fc2d0c6Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
112428fc2d0c6Smrg_LT_TAGVAR(always_export_symbols, $1)=no
112438fc2d0c6Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
112448fc2d0c6Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
112458fc2d0c6Smrg_LT_TAGVAR(hardcode_direct, $1)=no
112468fc2d0c6Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
112478fc2d0c6Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
112488fc2d0c6Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
112498fc2d0c6Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
112508fc2d0c6Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
112518fc2d0c6Smrg_LT_TAGVAR(inherit_rpath, $1)=no
112528fc2d0c6Smrg_LT_TAGVAR(module_cmds, $1)=
112538fc2d0c6Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
112548fc2d0c6Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
112558fc2d0c6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
112568fc2d0c6Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
112578fc2d0c6Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
112588fc2d0c6Smrg_LT_TAGVAR(no_undefined_flag, $1)=
112598fc2d0c6Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
112608fc2d0c6Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
112618fc2d0c6Smrg
112628fc2d0c6Smrg# Source file extension for fc test sources.
112638fc2d0c6Smrgac_ext=${ac_fc_srcext-f}
112648fc2d0c6Smrg
112658fc2d0c6Smrg# Object file extension for compiled fc test sources.
112668fc2d0c6Smrgobjext=o
112678fc2d0c6Smrg_LT_TAGVAR(objext, $1)=$objext
112688fc2d0c6Smrg
112698fc2d0c6Smrg# No sense in running all these tests if we already determined that
112708fc2d0c6Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
112718fc2d0c6Smrg# are currently assumed to apply to all compilers on this platform,
112728fc2d0c6Smrg# and will be corrupted by setting them based on a non-working compiler.
112738fc2d0c6Smrgif test yes != "$_lt_disable_FC"; then
112748fc2d0c6Smrg  # Code to be used in simple compile tests
112758fc2d0c6Smrg  lt_simple_compile_test_code="\
112768fc2d0c6Smrg      subroutine t
112778fc2d0c6Smrg      return
112788fc2d0c6Smrg      end
112798fc2d0c6Smrg"
1128054b44505Smrg
112818fc2d0c6Smrg  # Code to be used in simple link tests
112828fc2d0c6Smrg  lt_simple_link_test_code="\
112838fc2d0c6Smrg      program t
112848fc2d0c6Smrg      end
112858fc2d0c6Smrg"
1128654b44505Smrg
112878fc2d0c6Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
112888fc2d0c6Smrg  _LT_TAG_COMPILER
1128954b44505Smrg
112908fc2d0c6Smrg  # save warnings/boilerplate of simple test code
112918fc2d0c6Smrg  _LT_COMPILER_BOILERPLATE
112928fc2d0c6Smrg  _LT_LINKER_BOILERPLATE
1129354b44505Smrg
112948fc2d0c6Smrg  # Allow CC to be a program name with arguments.
112958fc2d0c6Smrg  lt_save_CC=$CC
112968fc2d0c6Smrg  lt_save_GCC=$GCC
112978fc2d0c6Smrg  lt_save_CFLAGS=$CFLAGS
112988fc2d0c6Smrg  CC=${FC-"f95"}
112998fc2d0c6Smrg  CFLAGS=$FCFLAGS
113008fc2d0c6Smrg  compiler=$CC
113018fc2d0c6Smrg  GCC=$ac_cv_fc_compiler_gnu
1130254b44505Smrg
113038fc2d0c6Smrg  _LT_TAGVAR(compiler, $1)=$CC
113048fc2d0c6Smrg  _LT_CC_BASENAME([$compiler])
113054a041c5bSmacallan
113068fc2d0c6Smrg  if test -n "$compiler"; then
113078fc2d0c6Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
113088fc2d0c6Smrg    AC_MSG_RESULT([$can_build_shared])
113094a041c5bSmacallan
113108fc2d0c6Smrg    AC_MSG_CHECKING([whether to build shared libraries])
113118fc2d0c6Smrg    test no = "$can_build_shared" && enable_shared=no
113124a041c5bSmacallan
113138fc2d0c6Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
113148fc2d0c6Smrg    # are all built from PIC.
113158fc2d0c6Smrg    case $host_os in
113168fc2d0c6Smrg      aix3*)
113178fc2d0c6Smrg        test yes = "$enable_shared" && enable_static=no
113188fc2d0c6Smrg        if test -n "$RANLIB"; then
113198fc2d0c6Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
113208fc2d0c6Smrg          postinstall_cmds='$RANLIB $lib'
113218fc2d0c6Smrg        fi
113228fc2d0c6Smrg        ;;
113238fc2d0c6Smrg      aix[[4-9]]*)
113248fc2d0c6Smrg	if test ia64 != "$host_cpu"; then
113258fc2d0c6Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
113268fc2d0c6Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
113278fc2d0c6Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
113288fc2d0c6Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
113298fc2d0c6Smrg	  esac
113308fc2d0c6Smrg	fi
113318fc2d0c6Smrg        ;;
113328fc2d0c6Smrg    esac
113338fc2d0c6Smrg    AC_MSG_RESULT([$enable_shared])
113344a041c5bSmacallan
113358fc2d0c6Smrg    AC_MSG_CHECKING([whether to build static libraries])
113368fc2d0c6Smrg    # Make sure either enable_shared or enable_static is yes.
113378fc2d0c6Smrg    test yes = "$enable_shared" || enable_static=yes
113388fc2d0c6Smrg    AC_MSG_RESULT([$enable_static])
113394a041c5bSmacallan
113408fc2d0c6Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
113418fc2d0c6Smrg    _LT_TAGVAR(LD, $1)=$LD
1134254b44505Smrg
113438fc2d0c6Smrg    ## CAVEAT EMPTOR:
113448fc2d0c6Smrg    ## There is no encapsulation within the following macros, do not change
113458fc2d0c6Smrg    ## the running order or otherwise move them around unless you know exactly
113468fc2d0c6Smrg    ## what you are doing...
113478fc2d0c6Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
113488fc2d0c6Smrg    _LT_COMPILER_PIC($1)
113498fc2d0c6Smrg    _LT_COMPILER_C_O($1)
113508fc2d0c6Smrg    _LT_COMPILER_FILE_LOCKS($1)
113518fc2d0c6Smrg    _LT_LINKER_SHLIBS($1)
113528fc2d0c6Smrg    _LT_SYS_DYNAMIC_LINKER($1)
113538fc2d0c6Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
1135454b44505Smrg
113558fc2d0c6Smrg    _LT_CONFIG($1)
113568fc2d0c6Smrg  fi # test -n "$compiler"
1135754b44505Smrg
113588fc2d0c6Smrg  GCC=$lt_save_GCC
113598fc2d0c6Smrg  CC=$lt_save_CC
113608fc2d0c6Smrg  CFLAGS=$lt_save_CFLAGS
113618fc2d0c6Smrgfi # test yes != "$_lt_disable_FC"
113624a041c5bSmacallan
113638fc2d0c6SmrgAC_LANG_POP
113648fc2d0c6Smrg])# _LT_LANG_FC_CONFIG
113654a041c5bSmacallan
113664a041c5bSmacallan
113678fc2d0c6Smrg# _LT_LANG_GCJ_CONFIG([TAG])
113684a041c5bSmacallan# --------------------------
113698fc2d0c6Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
113708fc2d0c6Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
113718fc2d0c6Smrg# to write the compiler configuration to 'libtool'.
113728fc2d0c6Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
113738fc2d0c6Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
113748fc2d0c6SmrgAC_LANG_SAVE
113754a041c5bSmacallan
113768fc2d0c6Smrg# Source file extension for Java test sources.
113778fc2d0c6Smrgac_ext=java
1137854b44505Smrg
113798fc2d0c6Smrg# Object file extension for compiled Java test sources.
113808fc2d0c6Smrgobjext=o
113818fc2d0c6Smrg_LT_TAGVAR(objext, $1)=$objext
1138254b44505Smrg
113838fc2d0c6Smrg# Code to be used in simple compile tests
113848fc2d0c6Smrglt_simple_compile_test_code="class foo {}"
113854a041c5bSmacallan
113868fc2d0c6Smrg# Code to be used in simple link tests
113878fc2d0c6Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
113884a041c5bSmacallan
113898fc2d0c6Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
113908fc2d0c6Smrg_LT_TAG_COMPILER
113914a041c5bSmacallan
113928fc2d0c6Smrg# save warnings/boilerplate of simple test code
113938fc2d0c6Smrg_LT_COMPILER_BOILERPLATE
113948fc2d0c6Smrg_LT_LINKER_BOILERPLATE
1139554b44505Smrg
113968fc2d0c6Smrg# Allow CC to be a program name with arguments.
113978fc2d0c6Smrglt_save_CC=$CC
113988fc2d0c6Smrglt_save_CFLAGS=$CFLAGS
113998fc2d0c6Smrglt_save_GCC=$GCC
114008fc2d0c6SmrgGCC=yes
114018fc2d0c6SmrgCC=${GCJ-"gcj"}
114028fc2d0c6SmrgCFLAGS=$GCJFLAGS
114038fc2d0c6Smrgcompiler=$CC
114048fc2d0c6Smrg_LT_TAGVAR(compiler, $1)=$CC
114058fc2d0c6Smrg_LT_TAGVAR(LD, $1)=$LD
114068fc2d0c6Smrg_LT_CC_BASENAME([$compiler])
1140754b44505Smrg
114088fc2d0c6Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
114098fc2d0c6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
114104a041c5bSmacallan
114118fc2d0c6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
114128fc2d0c6Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
114138fc2d0c6Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
1141454b44505Smrg
114158fc2d0c6Smrgif test -n "$compiler"; then
114168fc2d0c6Smrg  _LT_COMPILER_NO_RTTI($1)
114178fc2d0c6Smrg  _LT_COMPILER_PIC($1)
114188fc2d0c6Smrg  _LT_COMPILER_C_O($1)
114198fc2d0c6Smrg  _LT_COMPILER_FILE_LOCKS($1)
114208fc2d0c6Smrg  _LT_LINKER_SHLIBS($1)
114218fc2d0c6Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
1142254b44505Smrg
114238fc2d0c6Smrg  _LT_CONFIG($1)
1142454b44505Smrgfi
1142554b44505Smrg
114268fc2d0c6SmrgAC_LANG_RESTORE
1142754b44505Smrg
114288fc2d0c6SmrgGCC=$lt_save_GCC
114298fc2d0c6SmrgCC=$lt_save_CC
114308fc2d0c6SmrgCFLAGS=$lt_save_CFLAGS
114318fc2d0c6Smrg])# _LT_LANG_GCJ_CONFIG
1143254b44505Smrg
1143354b44505Smrg
114348fc2d0c6Smrg# _LT_LANG_GO_CONFIG([TAG])
114358fc2d0c6Smrg# --------------------------
114368fc2d0c6Smrg# Ensure that the configuration variables for the GNU Go compiler
114378fc2d0c6Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
114388fc2d0c6Smrg# to write the compiler configuration to 'libtool'.
114398fc2d0c6Smrgm4_defun([_LT_LANG_GO_CONFIG],
114408fc2d0c6Smrg[AC_REQUIRE([LT_PROG_GO])dnl
114418fc2d0c6SmrgAC_LANG_SAVE
1144254b44505Smrg
114438fc2d0c6Smrg# Source file extension for Go test sources.
114448fc2d0c6Smrgac_ext=go
1144554b44505Smrg
114468fc2d0c6Smrg# Object file extension for compiled Go test sources.
114478fc2d0c6Smrgobjext=o
114488fc2d0c6Smrg_LT_TAGVAR(objext, $1)=$objext
1144954b44505Smrg
114508fc2d0c6Smrg# Code to be used in simple compile tests
114518fc2d0c6Smrglt_simple_compile_test_code="package main; func main() { }"
1145254b44505Smrg
114538fc2d0c6Smrg# Code to be used in simple link tests
114548fc2d0c6Smrglt_simple_link_test_code='package main; func main() { }'
1145554b44505Smrg
114568fc2d0c6Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
114578fc2d0c6Smrg_LT_TAG_COMPILER
1145854b44505Smrg
114598fc2d0c6Smrg# save warnings/boilerplate of simple test code
114608fc2d0c6Smrg_LT_COMPILER_BOILERPLATE
114618fc2d0c6Smrg_LT_LINKER_BOILERPLATE
1146254b44505Smrg
114638fc2d0c6Smrg# Allow CC to be a program name with arguments.
114648fc2d0c6Smrglt_save_CC=$CC
114658fc2d0c6Smrglt_save_CFLAGS=$CFLAGS
114668fc2d0c6Smrglt_save_GCC=$GCC
114678fc2d0c6SmrgGCC=yes
114688fc2d0c6SmrgCC=${GOC-"gccgo"}
114698fc2d0c6SmrgCFLAGS=$GOFLAGS
114708fc2d0c6Smrgcompiler=$CC
114718fc2d0c6Smrg_LT_TAGVAR(compiler, $1)=$CC
114728fc2d0c6Smrg_LT_TAGVAR(LD, $1)=$LD
114738fc2d0c6Smrg_LT_CC_BASENAME([$compiler])
1147454b44505Smrg
114758fc2d0c6Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
114768fc2d0c6Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
1147754b44505Smrg
114788fc2d0c6Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
114798fc2d0c6Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
114808fc2d0c6Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
1148154b44505Smrg
114828fc2d0c6Smrgif test -n "$compiler"; then
114838fc2d0c6Smrg  _LT_COMPILER_NO_RTTI($1)
114848fc2d0c6Smrg  _LT_COMPILER_PIC($1)
114858fc2d0c6Smrg  _LT_COMPILER_C_O($1)
114868fc2d0c6Smrg  _LT_COMPILER_FILE_LOCKS($1)
114878fc2d0c6Smrg  _LT_LINKER_SHLIBS($1)
114888fc2d0c6Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
114898fc2d0c6Smrg
114908fc2d0c6Smrg  _LT_CONFIG($1)
1149154b44505Smrgfi
1149254b44505Smrg
114938fc2d0c6SmrgAC_LANG_RESTORE
1149454b44505Smrg
114958fc2d0c6SmrgGCC=$lt_save_GCC
114968fc2d0c6SmrgCC=$lt_save_CC
114978fc2d0c6SmrgCFLAGS=$lt_save_CFLAGS
114988fc2d0c6Smrg])# _LT_LANG_GO_CONFIG
1149954b44505Smrg
1150054b44505Smrg
115018fc2d0c6Smrg# _LT_LANG_RC_CONFIG([TAG])
115028fc2d0c6Smrg# -------------------------
115038fc2d0c6Smrg# Ensure that the configuration variables for the Windows resource compiler
115048fc2d0c6Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
115058fc2d0c6Smrg# to write the compiler configuration to 'libtool'.
115068fc2d0c6Smrgm4_defun([_LT_LANG_RC_CONFIG],
115078fc2d0c6Smrg[AC_REQUIRE([LT_PROG_RC])dnl
115088fc2d0c6SmrgAC_LANG_SAVE
1150954b44505Smrg
115108fc2d0c6Smrg# Source file extension for RC test sources.
115118fc2d0c6Smrgac_ext=rc
1151254b44505Smrg
115138fc2d0c6Smrg# Object file extension for compiled RC test sources.
115148fc2d0c6Smrgobjext=o
115158fc2d0c6Smrg_LT_TAGVAR(objext, $1)=$objext
1151654b44505Smrg
115178fc2d0c6Smrg# Code to be used in simple compile tests
115188fc2d0c6Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
1151954b44505Smrg
115208fc2d0c6Smrg# Code to be used in simple link tests
115218fc2d0c6Smrglt_simple_link_test_code=$lt_simple_compile_test_code
115224a041c5bSmacallan
115238fc2d0c6Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
115248fc2d0c6Smrg_LT_TAG_COMPILER
1152554b44505Smrg
115268fc2d0c6Smrg# save warnings/boilerplate of simple test code
115278fc2d0c6Smrg_LT_COMPILER_BOILERPLATE
115288fc2d0c6Smrg_LT_LINKER_BOILERPLATE
115294a041c5bSmacallan
115308fc2d0c6Smrg# Allow CC to be a program name with arguments.
115318fc2d0c6Smrglt_save_CC=$CC
115328fc2d0c6Smrglt_save_CFLAGS=$CFLAGS
115338fc2d0c6Smrglt_save_GCC=$GCC
115348fc2d0c6SmrgGCC=
115358fc2d0c6SmrgCC=${RC-"windres"}
115368fc2d0c6SmrgCFLAGS=
115378fc2d0c6Smrgcompiler=$CC
115388fc2d0c6Smrg_LT_TAGVAR(compiler, $1)=$CC
115398fc2d0c6Smrg_LT_CC_BASENAME([$compiler])
115408fc2d0c6Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
115410a392d7eSmrg
115428fc2d0c6Smrgif test -n "$compiler"; then
115438fc2d0c6Smrg  :
115448fc2d0c6Smrg  _LT_CONFIG($1)
115458fc2d0c6Smrgfi
115464a041c5bSmacallan
115478fc2d0c6SmrgGCC=$lt_save_GCC
115488fc2d0c6SmrgAC_LANG_RESTORE
115498fc2d0c6SmrgCC=$lt_save_CC
115508fc2d0c6SmrgCFLAGS=$lt_save_CFLAGS
115518fc2d0c6Smrg])# _LT_LANG_RC_CONFIG
115528fc2d0c6Smrg
115538fc2d0c6Smrg
115548fc2d0c6Smrg# LT_PROG_GCJ
115558fc2d0c6Smrg# -----------
115568fc2d0c6SmrgAC_DEFUN([LT_PROG_GCJ],
115578fc2d0c6Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
115588fc2d0c6Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
115598fc2d0c6Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
115608fc2d0c6Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
115618fc2d0c6Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
115628fc2d0c6Smrg])
1156354b44505Smrg
115648fc2d0c6Smrg# Old name:
115658fc2d0c6SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
115668fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
115678fc2d0c6Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
1156854b44505Smrg
1156954b44505Smrg
115708fc2d0c6Smrg# LT_PROG_GO
115718fc2d0c6Smrg# ----------
115728fc2d0c6SmrgAC_DEFUN([LT_PROG_GO],
115738fc2d0c6Smrg[AC_CHECK_TOOL(GOC, gccgo,)
1157454b44505Smrg])
1157554b44505Smrg
115764a041c5bSmacallan
115778fc2d0c6Smrg# LT_PROG_RC
115788fc2d0c6Smrg# ----------
115798fc2d0c6SmrgAC_DEFUN([LT_PROG_RC],
115808fc2d0c6Smrg[AC_CHECK_TOOL(RC, windres,)
115814a041c5bSmacallan])
115824a041c5bSmacallan
115838fc2d0c6Smrg# Old name:
115848fc2d0c6SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
115858fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
115868fc2d0c6Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
115874a041c5bSmacallan
115884a041c5bSmacallan
115898fc2d0c6Smrg# _LT_DECL_EGREP
115908fc2d0c6Smrg# --------------
115918fc2d0c6Smrg# If we don't have a new enough Autoconf to choose the best grep
115928fc2d0c6Smrg# available, choose the one first in the user's PATH.
115938fc2d0c6Smrgm4_defun([_LT_DECL_EGREP],
115948fc2d0c6Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
115958fc2d0c6SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
115968fc2d0c6Smrgtest -z "$GREP" && GREP=grep
115978fc2d0c6Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
115988fc2d0c6Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
115998fc2d0c6Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
116008fc2d0c6Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
116018fc2d0c6SmrgAC_SUBST([GREP])
116028fc2d0c6Smrg])
116034a041c5bSmacallan
116044a041c5bSmacallan
116058fc2d0c6Smrg# _LT_DECL_OBJDUMP
116068fc2d0c6Smrg# --------------
116078fc2d0c6Smrg# If we don't have a new enough Autoconf to choose the best objdump
116088fc2d0c6Smrg# available, choose the one first in the user's PATH.
116098fc2d0c6Smrgm4_defun([_LT_DECL_OBJDUMP],
116108fc2d0c6Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
116118fc2d0c6Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
116128fc2d0c6Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
116138fc2d0c6SmrgAC_SUBST([OBJDUMP])
116148fc2d0c6Smrg])
116154a041c5bSmacallan
116168fc2d0c6Smrg# _LT_DECL_DLLTOOL
116178fc2d0c6Smrg# ----------------
116188fc2d0c6Smrg# Ensure DLLTOOL variable is set.
116198fc2d0c6Smrgm4_defun([_LT_DECL_DLLTOOL],
116208fc2d0c6Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
116218fc2d0c6Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
116228fc2d0c6Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
116238fc2d0c6SmrgAC_SUBST([DLLTOOL])
116244a041c5bSmacallan])
116254a041c5bSmacallan
116268fc2d0c6Smrg# _LT_DECL_FILECMD
116278fc2d0c6Smrg# ----------------
116288fc2d0c6Smrg# Check for a file(cmd) program that can be used to detect file type and magic
116298fc2d0c6Smrgm4_defun([_LT_DECL_FILECMD],
116308fc2d0c6Smrg[AC_CHECK_TOOL([FILECMD], [file], [:])
116318fc2d0c6Smrg_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
116328fc2d0c6Smrg])# _LD_DECL_FILECMD
116334a041c5bSmacallan
116348fc2d0c6Smrg# _LT_DECL_SED
116358fc2d0c6Smrg# ------------
116368fc2d0c6Smrg# Check for a fully-functional sed program, that truncates
116378fc2d0c6Smrg# as few characters as possible.  Prefer GNU sed if found.
116388fc2d0c6Smrgm4_defun([_LT_DECL_SED],
116398fc2d0c6Smrg[AC_PROG_SED
116408fc2d0c6Smrgtest -z "$SED" && SED=sed
116418fc2d0c6SmrgXsed="$SED -e 1s/^X//"
116428fc2d0c6Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
116438fc2d0c6Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
116448fc2d0c6Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
116458fc2d0c6Smrg])# _LT_DECL_SED
116464a041c5bSmacallan
116478fc2d0c6Smrgm4_ifndef([AC_PROG_SED], [
116488fc2d0c6Smrg# NOTE: This macro has been submitted for inclusion into   #
116498fc2d0c6Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
116508fc2d0c6Smrg#  a released version of Autoconf we should remove this    #
116518fc2d0c6Smrg#  macro and use it instead.                               #
116528fc2d0c6Smrg
116538fc2d0c6Smrgm4_defun([AC_PROG_SED],
116548fc2d0c6Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
116558fc2d0c6SmrgAC_CACHE_VAL(lt_cv_path_SED,
116568fc2d0c6Smrg[# Loop through the user's path and test for sed and gsed.
116578fc2d0c6Smrg# Then use that list of sed's as ones to test for truncation.
116588fc2d0c6Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
116598fc2d0c6Smrgfor as_dir in $PATH
116608fc2d0c6Smrgdo
116618fc2d0c6Smrg  IFS=$as_save_IFS
116628fc2d0c6Smrg  test -z "$as_dir" && as_dir=.
116638fc2d0c6Smrg  for lt_ac_prog in sed gsed; do
116648fc2d0c6Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
116658fc2d0c6Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
116668fc2d0c6Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
116678fc2d0c6Smrg      fi
116688fc2d0c6Smrg    done
116698fc2d0c6Smrg  done
116708fc2d0c6Smrgdone
116718fc2d0c6SmrgIFS=$as_save_IFS
116728fc2d0c6Smrglt_ac_max=0
116738fc2d0c6Smrglt_ac_count=0
116748fc2d0c6Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
116758fc2d0c6Smrg# along with /bin/sed that truncates output.
116768fc2d0c6Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
116778fc2d0c6Smrg  test ! -f "$lt_ac_sed" && continue
116788fc2d0c6Smrg  cat /dev/null > conftest.in
116798fc2d0c6Smrg  lt_ac_count=0
116808fc2d0c6Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
116818fc2d0c6Smrg  # Check for GNU sed and select it if it is found.
116828fc2d0c6Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
116838fc2d0c6Smrg    lt_cv_path_SED=$lt_ac_sed
116848fc2d0c6Smrg    break
116858fc2d0c6Smrg  fi
116868fc2d0c6Smrg  while true; do
116878fc2d0c6Smrg    cat conftest.in conftest.in >conftest.tmp
116888fc2d0c6Smrg    mv conftest.tmp conftest.in
116898fc2d0c6Smrg    cp conftest.in conftest.nl
116908fc2d0c6Smrg    echo >>conftest.nl
116918fc2d0c6Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
116928fc2d0c6Smrg    cmp -s conftest.out conftest.nl || break
116938fc2d0c6Smrg    # 10000 chars as input seems more than enough
116948fc2d0c6Smrg    test 10 -lt "$lt_ac_count" && break
116958fc2d0c6Smrg    lt_ac_count=`expr $lt_ac_count + 1`
116968fc2d0c6Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
116978fc2d0c6Smrg      lt_ac_max=$lt_ac_count
116988fc2d0c6Smrg      lt_cv_path_SED=$lt_ac_sed
116998fc2d0c6Smrg    fi
117008fc2d0c6Smrg  done
117018fc2d0c6Smrgdone
117028fc2d0c6Smrg])
117038fc2d0c6SmrgSED=$lt_cv_path_SED
117048fc2d0c6SmrgAC_SUBST([SED])
117058fc2d0c6SmrgAC_MSG_RESULT([$SED])
117068fc2d0c6Smrg])#AC_PROG_SED
117078fc2d0c6Smrg])#m4_ifndef
117088fc2d0c6Smrg
117098fc2d0c6Smrg# Old name:
117108fc2d0c6SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
117118fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
117128fc2d0c6Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
117138fc2d0c6Smrg
117148fc2d0c6Smrg
117158fc2d0c6Smrg# _LT_CHECK_SHELL_FEATURES
117168fc2d0c6Smrg# ------------------------
117178fc2d0c6Smrg# Find out whether the shell is Bourne or XSI compatible,
117188fc2d0c6Smrg# or has some other useful features.
117198fc2d0c6Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
117208fc2d0c6Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
117218fc2d0c6Smrg  lt_unset=unset
117224a041c5bSmacallanelse
117238fc2d0c6Smrg  lt_unset=false
117244a041c5bSmacallanfi
117258fc2d0c6Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
117264a041c5bSmacallan
117278fc2d0c6Smrg# test EBCDIC or ASCII
117288fc2d0c6Smrgcase `echo X|tr X '\101'` in
117298fc2d0c6Smrg A) # ASCII based system
117308fc2d0c6Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
117318fc2d0c6Smrg  lt_SP2NL='tr \040 \012'
117328fc2d0c6Smrg  lt_NL2SP='tr \015\012 \040\040'
117338fc2d0c6Smrg  ;;
117348fc2d0c6Smrg *) # EBCDIC based system
117358fc2d0c6Smrg  lt_SP2NL='tr \100 \n'
117368fc2d0c6Smrg  lt_NL2SP='tr \r\n \100\100'
117378fc2d0c6Smrg  ;;
117388fc2d0c6Smrgesac
117398fc2d0c6Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
117408fc2d0c6Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
117418fc2d0c6Smrg])# _LT_CHECK_SHELL_FEATURES
117424a041c5bSmacallan
117434a041c5bSmacallan
117448fc2d0c6Smrg# _LT_PATH_CONVERSION_FUNCTIONS
117458fc2d0c6Smrg# -----------------------------
117468fc2d0c6Smrg# Determine what file name conversion functions should be used by
117478fc2d0c6Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
117488fc2d0c6Smrg# for certain cross-compile configurations and native mingw.
117498fc2d0c6Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
117508fc2d0c6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
117518fc2d0c6SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
117528fc2d0c6SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
117538fc2d0c6SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
117548fc2d0c6Smrg[case $host in
117558fc2d0c6Smrg  *-*-mingw* )
117568fc2d0c6Smrg    case $build in
117578fc2d0c6Smrg      *-*-mingw* ) # actually msys
117588fc2d0c6Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
117598fc2d0c6Smrg        ;;
117608fc2d0c6Smrg      *-*-cygwin* )
117618fc2d0c6Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
117628fc2d0c6Smrg        ;;
117638fc2d0c6Smrg      * ) # otherwise, assume *nix
117648fc2d0c6Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
117658fc2d0c6Smrg        ;;
117668fc2d0c6Smrg    esac
117678fc2d0c6Smrg    ;;
117688fc2d0c6Smrg  *-*-cygwin* )
117698fc2d0c6Smrg    case $build in
117708fc2d0c6Smrg      *-*-mingw* ) # actually msys
117718fc2d0c6Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
117728fc2d0c6Smrg        ;;
117738fc2d0c6Smrg      *-*-cygwin* )
117748fc2d0c6Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
117758fc2d0c6Smrg        ;;
117768fc2d0c6Smrg      * ) # otherwise, assume *nix
117778fc2d0c6Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
117788fc2d0c6Smrg        ;;
117798fc2d0c6Smrg    esac
117808fc2d0c6Smrg    ;;
117818fc2d0c6Smrg  * ) # unhandled hosts (and "normal" native builds)
117828fc2d0c6Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
117838fc2d0c6Smrg    ;;
117848fc2d0c6Smrgesac
117858fc2d0c6Smrg])
117868fc2d0c6Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
117878fc2d0c6SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
117888fc2d0c6Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
117898fc2d0c6Smrg         [0], [convert $build file names to $host format])dnl
117904a041c5bSmacallan
117918fc2d0c6SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
117928fc2d0c6SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
117938fc2d0c6Smrg[#assume ordinary cross tools, or native build.
117948fc2d0c6Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
117958fc2d0c6Smrgcase $host in
117968fc2d0c6Smrg  *-*-mingw* )
117978fc2d0c6Smrg    case $build in
117988fc2d0c6Smrg      *-*-mingw* ) # actually msys
117998fc2d0c6Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
118008fc2d0c6Smrg        ;;
118018fc2d0c6Smrg    esac
118028fc2d0c6Smrg    ;;
118038fc2d0c6Smrgesac
118048fc2d0c6Smrg])
118058fc2d0c6Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
118068fc2d0c6SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
118078fc2d0c6Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
118088fc2d0c6Smrg         [0], [convert $build files to toolchain format])dnl
118098fc2d0c6Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
118104a041c5bSmacallan
118118fc2d0c6Smrg# Helper functions for option handling.                    -*- Autoconf -*-
118124a041c5bSmacallan#
118138fc2d0c6Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
118148fc2d0c6Smrg#   Software Foundation, Inc.
118158fc2d0c6Smrg#   Written by Gary V. Vaughan, 2004
118168fc2d0c6Smrg#
118178fc2d0c6Smrg# This file is free software; the Free Software Foundation gives
118188fc2d0c6Smrg# unlimited permission to copy and/or distribute it, with or without
118198fc2d0c6Smrg# modifications, as long as this notice is preserved.
118204a041c5bSmacallan
118218fc2d0c6Smrg# serial 8 ltoptions.m4
118224a041c5bSmacallan
118238fc2d0c6Smrg# This is to help aclocal find these macros, as it can't see m4_define.
118248fc2d0c6SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
1182554b44505Smrg
118264a041c5bSmacallan
118278fc2d0c6Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
118288fc2d0c6Smrg# ------------------------------------------
118298fc2d0c6Smrgm4_define([_LT_MANGLE_OPTION],
118308fc2d0c6Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
118314a041c5bSmacallan
118328fc2d0c6Smrg
118338fc2d0c6Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
118348fc2d0c6Smrg# ---------------------------------------
118358fc2d0c6Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
118368fc2d0c6Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
118378fc2d0c6Smrg# saved as a flag.
118388fc2d0c6Smrgm4_define([_LT_SET_OPTION],
118398fc2d0c6Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
118408fc2d0c6Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
118418fc2d0c6Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
118428fc2d0c6Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
118434a041c5bSmacallan])
118444a041c5bSmacallan
118454a041c5bSmacallan
118468fc2d0c6Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
118478fc2d0c6Smrg# ------------------------------------------------------------
118488fc2d0c6Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
118498fc2d0c6Smrgm4_define([_LT_IF_OPTION],
118508fc2d0c6Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
118514a041c5bSmacallan
118524a041c5bSmacallan
118538fc2d0c6Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
118548fc2d0c6Smrg# -------------------------------------------------------
118558fc2d0c6Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
118568fc2d0c6Smrg# are set.
118578fc2d0c6Smrgm4_define([_LT_UNLESS_OPTIONS],
118588fc2d0c6Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
118598fc2d0c6Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
118608fc2d0c6Smrg		      [m4_define([$0_found])])])[]dnl
118618fc2d0c6Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
118628fc2d0c6Smrg])[]dnl
118634a041c5bSmacallan])
118644a041c5bSmacallan
118654a041c5bSmacallan
118668fc2d0c6Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
118678fc2d0c6Smrg# ----------------------------------------
118688fc2d0c6Smrg# OPTION-LIST is a space-separated list of Libtool options associated
118698fc2d0c6Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
118708fc2d0c6Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
118718fc2d0c6Smrg# the unknown option and exit.
118728fc2d0c6Smrgm4_defun([_LT_SET_OPTIONS],
118738fc2d0c6Smrg[# Set options
118748fc2d0c6Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
118758fc2d0c6Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
118764a041c5bSmacallan
118778fc2d0c6Smrgm4_if([$1],[LT_INIT],[
118788fc2d0c6Smrg  dnl
118798fc2d0c6Smrg  dnl Simply set some default values (i.e off) if boolean options were not
118808fc2d0c6Smrg  dnl specified:
118818fc2d0c6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
118828fc2d0c6Smrg  ])
118838fc2d0c6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
118848fc2d0c6Smrg  ])
118858fc2d0c6Smrg  dnl
118868fc2d0c6Smrg  dnl If no reference was made to various pairs of opposing options, then
118878fc2d0c6Smrg  dnl we run the default mode handler for the pair.  For example, if neither
118888fc2d0c6Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
118898fc2d0c6Smrg  dnl archives by default:
118908fc2d0c6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
118918fc2d0c6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
118928fc2d0c6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
118938fc2d0c6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
118948fc2d0c6Smrg		   [_LT_ENABLE_FAST_INSTALL])
118958fc2d0c6Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
118968fc2d0c6Smrg		   [_LT_WITH_AIX_SONAME([aix])])
118978fc2d0c6Smrg  ])
118988fc2d0c6Smrg])# _LT_SET_OPTIONS
118994a041c5bSmacallan
119004a041c5bSmacallan
119014a041c5bSmacallan
119028fc2d0c6Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
119038fc2d0c6Smrg# -----------------------------------------
119048fc2d0c6Smrgm4_define([_LT_MANGLE_DEFUN],
119058fc2d0c6Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
119064a041c5bSmacallan
119074a041c5bSmacallan
119088fc2d0c6Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
119098fc2d0c6Smrg# -----------------------------------------------
119108fc2d0c6Smrgm4_define([LT_OPTION_DEFINE],
119118fc2d0c6Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
119128fc2d0c6Smrg])# LT_OPTION_DEFINE
119134a041c5bSmacallan
119144a041c5bSmacallan
119158fc2d0c6Smrg# dlopen
119168fc2d0c6Smrg# ------
119178fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
119180a392d7eSmrg])
119190a392d7eSmrg
119208fc2d0c6SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
119218fc2d0c6Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
119228fc2d0c6SmrgAC_DIAGNOSE([obsolete],
119238fc2d0c6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
119248fc2d0c6Smrgput the 'dlopen' option into LT_INIT's first parameter.])
119258fc2d0c6Smrg])
119264a041c5bSmacallan
119278fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
119288fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
119294a041c5bSmacallan
119304a041c5bSmacallan
119318fc2d0c6Smrg# win32-dll
119328fc2d0c6Smrg# ---------
119338fc2d0c6Smrg# Declare package support for building win32 dll's.
119348fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
119358fc2d0c6Smrg[enable_win32_dll=yes
119364a041c5bSmacallan
119378fc2d0c6Smrgcase $host in
119388fc2d0c6Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
119398fc2d0c6Smrg  AC_CHECK_TOOL(AS, as, false)
119408fc2d0c6Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
119418fc2d0c6Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
119428fc2d0c6Smrg  ;;
119438fc2d0c6Smrgesac
119448fc2d0c6Smrg
119458fc2d0c6Smrgtest -z "$AS" && AS=as
119468fc2d0c6Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
119478fc2d0c6Smrg
119488fc2d0c6Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
119498fc2d0c6Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
119508fc2d0c6Smrg
119518fc2d0c6Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
119528fc2d0c6Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
119538fc2d0c6Smrg])# win32-dll
119548fc2d0c6Smrg
119558fc2d0c6SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
119568fc2d0c6Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
119578fc2d0c6Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
119588fc2d0c6SmrgAC_DIAGNOSE([obsolete],
119598fc2d0c6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
119608fc2d0c6Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
119614a041c5bSmacallan])
119620a392d7eSmrg
119638fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
119648fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
119650a392d7eSmrg
119660a392d7eSmrg
119678fc2d0c6Smrg# _LT_ENABLE_SHARED([DEFAULT])
119688fc2d0c6Smrg# ----------------------------
119698fc2d0c6Smrg# implement the --enable-shared flag, and supports the 'shared' and
119708fc2d0c6Smrg# 'disable-shared' LT_INIT options.
119718fc2d0c6Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
119728fc2d0c6Smrgm4_define([_LT_ENABLE_SHARED],
119738fc2d0c6Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
119748fc2d0c6SmrgAC_ARG_ENABLE([shared],
119758fc2d0c6Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
119768fc2d0c6Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
119778fc2d0c6Smrg    [p=${PACKAGE-default}
119788fc2d0c6Smrg    case $enableval in
119798fc2d0c6Smrg    yes) enable_shared=yes ;;
119808fc2d0c6Smrg    no) enable_shared=no ;;
119818fc2d0c6Smrg    *)
119828fc2d0c6Smrg      enable_shared=no
119838fc2d0c6Smrg      # Look at the argument we got.  We use all the common list separators.
119848fc2d0c6Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
119858fc2d0c6Smrg      for pkg in $enableval; do
119868fc2d0c6Smrg	IFS=$lt_save_ifs
119878fc2d0c6Smrg	if test "X$pkg" = "X$p"; then
119888fc2d0c6Smrg	  enable_shared=yes
119898fc2d0c6Smrg	fi
119908fc2d0c6Smrg      done
119918fc2d0c6Smrg      IFS=$lt_save_ifs
119928fc2d0c6Smrg      ;;
119938fc2d0c6Smrg    esac],
119948fc2d0c6Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
119950a392d7eSmrg
119968fc2d0c6Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
119978fc2d0c6Smrg	[Whether or not to build shared libraries])
119988fc2d0c6Smrg])# _LT_ENABLE_SHARED
119990a392d7eSmrg
120008fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
120018fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
120020a392d7eSmrg
120038fc2d0c6Smrg# Old names:
120048fc2d0c6SmrgAC_DEFUN([AC_ENABLE_SHARED],
120058fc2d0c6Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
120068fc2d0c6Smrg])
120070a392d7eSmrg
120088fc2d0c6SmrgAC_DEFUN([AC_DISABLE_SHARED],
120098fc2d0c6Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
120104a041c5bSmacallan])
120114a041c5bSmacallan
120128fc2d0c6SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
120138fc2d0c6SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
1201454b44505Smrg
120158fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
120168fc2d0c6Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
120178fc2d0c6Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
120184a041c5bSmacallan
120194a041c5bSmacallan
120204a041c5bSmacallan
120218fc2d0c6Smrg# _LT_ENABLE_STATIC([DEFAULT])
120228fc2d0c6Smrg# ----------------------------
120238fc2d0c6Smrg# implement the --enable-static flag, and support the 'static' and
120248fc2d0c6Smrg# 'disable-static' LT_INIT options.
120258fc2d0c6Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
120268fc2d0c6Smrgm4_define([_LT_ENABLE_STATIC],
120278fc2d0c6Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
120288fc2d0c6SmrgAC_ARG_ENABLE([static],
120298fc2d0c6Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
120308fc2d0c6Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
120318fc2d0c6Smrg    [p=${PACKAGE-default}
120328fc2d0c6Smrg    case $enableval in
120338fc2d0c6Smrg    yes) enable_static=yes ;;
120348fc2d0c6Smrg    no) enable_static=no ;;
120358fc2d0c6Smrg    *)
120368fc2d0c6Smrg     enable_static=no
120378fc2d0c6Smrg      # Look at the argument we got.  We use all the common list separators.
120388fc2d0c6Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
120398fc2d0c6Smrg      for pkg in $enableval; do
120408fc2d0c6Smrg	IFS=$lt_save_ifs
120418fc2d0c6Smrg	if test "X$pkg" = "X$p"; then
120428fc2d0c6Smrg	  enable_static=yes
120438fc2d0c6Smrg	fi
120448fc2d0c6Smrg      done
120458fc2d0c6Smrg      IFS=$lt_save_ifs
120468fc2d0c6Smrg      ;;
120478fc2d0c6Smrg    esac],
120488fc2d0c6Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
120494a041c5bSmacallan
120508fc2d0c6Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
120518fc2d0c6Smrg	[Whether or not to build static libraries])
120528fc2d0c6Smrg])# _LT_ENABLE_STATIC
120534a041c5bSmacallan
120548fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
120558fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
120564a041c5bSmacallan
120578fc2d0c6Smrg# Old names:
120588fc2d0c6SmrgAC_DEFUN([AC_ENABLE_STATIC],
120598fc2d0c6Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
120608fc2d0c6Smrg])
120614a041c5bSmacallan
120628fc2d0c6SmrgAC_DEFUN([AC_DISABLE_STATIC],
120638fc2d0c6Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
120648fc2d0c6Smrg])
120654a041c5bSmacallan
120668fc2d0c6SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
120678fc2d0c6SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
120688fc2d0c6Smrg
120698fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
120708fc2d0c6Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
120718fc2d0c6Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
120728fc2d0c6Smrg
120738fc2d0c6Smrg
120748fc2d0c6Smrg
120758fc2d0c6Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
1207654b44505Smrg# ----------------------------------
120778fc2d0c6Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
120788fc2d0c6Smrg# and 'disable-fast-install' LT_INIT options.
120798fc2d0c6Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
120808fc2d0c6Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
120818fc2d0c6Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
120828fc2d0c6SmrgAC_ARG_ENABLE([fast-install],
120838fc2d0c6Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
120848fc2d0c6Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
120858fc2d0c6Smrg    [p=${PACKAGE-default}
120868fc2d0c6Smrg    case $enableval in
120878fc2d0c6Smrg    yes) enable_fast_install=yes ;;
120888fc2d0c6Smrg    no) enable_fast_install=no ;;
120898fc2d0c6Smrg    *)
120908fc2d0c6Smrg      enable_fast_install=no
120918fc2d0c6Smrg      # Look at the argument we got.  We use all the common list separators.
120928fc2d0c6Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
120938fc2d0c6Smrg      for pkg in $enableval; do
120948fc2d0c6Smrg	IFS=$lt_save_ifs
120958fc2d0c6Smrg	if test "X$pkg" = "X$p"; then
120968fc2d0c6Smrg	  enable_fast_install=yes
120978fc2d0c6Smrg	fi
120988fc2d0c6Smrg      done
120998fc2d0c6Smrg      IFS=$lt_save_ifs
121008fc2d0c6Smrg      ;;
121018fc2d0c6Smrg    esac],
121028fc2d0c6Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
121034a041c5bSmacallan
121048fc2d0c6Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
121058fc2d0c6Smrg	 [Whether or not to optimize for fast installation])dnl
121068fc2d0c6Smrg])# _LT_ENABLE_FAST_INSTALL
121074a041c5bSmacallan
121088fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
121098fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
121104a041c5bSmacallan
121118fc2d0c6Smrg# Old names:
121128fc2d0c6SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
121138fc2d0c6Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
121148fc2d0c6SmrgAC_DIAGNOSE([obsolete],
121158fc2d0c6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
121168fc2d0c6Smrgthe 'fast-install' option into LT_INIT's first parameter.])
121174a041c5bSmacallan])
121184a041c5bSmacallan
121198fc2d0c6SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
121208fc2d0c6Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
121218fc2d0c6SmrgAC_DIAGNOSE([obsolete],
121228fc2d0c6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
121238fc2d0c6Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
121248fc2d0c6Smrg])
121254a041c5bSmacallan
121268fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
121278fc2d0c6Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
121288fc2d0c6Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
121294a041c5bSmacallan
121304a041c5bSmacallan
121318fc2d0c6Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
121328fc2d0c6Smrg# ----------------------------------
121338fc2d0c6Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
121348fc2d0c6Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
121358fc2d0c6Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
121368fc2d0c6Smrgm4_define([_LT_WITH_AIX_SONAME],
121378fc2d0c6Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
121388fc2d0c6Smrgshared_archive_member_spec=
121398fc2d0c6Smrgcase $host,$enable_shared in
121408fc2d0c6Smrgpower*-*-aix[[5-9]]*,yes)
121418fc2d0c6Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
121428fc2d0c6Smrg  AC_ARG_WITH([aix-soname],
121438fc2d0c6Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
121448fc2d0c6Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
121458fc2d0c6Smrg    [case $withval in
121468fc2d0c6Smrg    aix|svr4|both)
121478fc2d0c6Smrg      ;;
121488fc2d0c6Smrg    *)
121498fc2d0c6Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
121508fc2d0c6Smrg      ;;
121518fc2d0c6Smrg    esac
121528fc2d0c6Smrg    lt_cv_with_aix_soname=$with_aix_soname],
121538fc2d0c6Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
121548fc2d0c6Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
121558fc2d0c6Smrg    with_aix_soname=$lt_cv_with_aix_soname])
121568fc2d0c6Smrg  AC_MSG_RESULT([$with_aix_soname])
121578fc2d0c6Smrg  if test aix != "$with_aix_soname"; then
121588fc2d0c6Smrg    # For the AIX way of multilib, we name the shared archive member
121598fc2d0c6Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
121608fc2d0c6Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
121618fc2d0c6Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
121628fc2d0c6Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
121638fc2d0c6Smrg    if test 64 = "${OBJECT_MODE-32}"; then
121648fc2d0c6Smrg      shared_archive_member_spec=shr_64
121658fc2d0c6Smrg    else
121668fc2d0c6Smrg      shared_archive_member_spec=shr
121678fc2d0c6Smrg    fi
121688fc2d0c6Smrg  fi
121698fc2d0c6Smrg  ;;
121708fc2d0c6Smrg*)
121718fc2d0c6Smrg  with_aix_soname=aix
121728fc2d0c6Smrg  ;;
121738fc2d0c6Smrgesac
121744a041c5bSmacallan
121758fc2d0c6Smrg_LT_DECL([], [shared_archive_member_spec], [0],
121768fc2d0c6Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
121778fc2d0c6Smrg])# _LT_WITH_AIX_SONAME
121784a041c5bSmacallan
121798fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
121808fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
121818fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
121824a041c5bSmacallan
121834a041c5bSmacallan
121848fc2d0c6Smrg# _LT_WITH_PIC([MODE])
1218554b44505Smrg# --------------------
121868fc2d0c6Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
121878fc2d0c6Smrg# LT_INIT options.
121888fc2d0c6Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
121898fc2d0c6Smrgm4_define([_LT_WITH_PIC],
121908fc2d0c6Smrg[AC_ARG_WITH([pic],
121918fc2d0c6Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
121928fc2d0c6Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
121938fc2d0c6Smrg    [lt_p=${PACKAGE-default}
121948fc2d0c6Smrg    case $withval in
121958fc2d0c6Smrg    yes|no) pic_mode=$withval ;;
121968fc2d0c6Smrg    *)
121978fc2d0c6Smrg      pic_mode=default
121988fc2d0c6Smrg      # Look at the argument we got.  We use all the common list separators.
121998fc2d0c6Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
122008fc2d0c6Smrg      for lt_pkg in $withval; do
122018fc2d0c6Smrg	IFS=$lt_save_ifs
122028fc2d0c6Smrg	if test "X$lt_pkg" = "X$lt_p"; then
122038fc2d0c6Smrg	  pic_mode=yes
122048fc2d0c6Smrg	fi
122058fc2d0c6Smrg      done
122068fc2d0c6Smrg      IFS=$lt_save_ifs
122078fc2d0c6Smrg      ;;
122088fc2d0c6Smrg    esac],
122098fc2d0c6Smrg    [pic_mode=m4_default([$1], [default])])
122104a041c5bSmacallan
122118fc2d0c6Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
122128fc2d0c6Smrg])# _LT_WITH_PIC
122134a041c5bSmacallan
122148fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
122158fc2d0c6SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
122164a041c5bSmacallan
122178fc2d0c6Smrg# Old name:
122188fc2d0c6SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
122198fc2d0c6Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
122208fc2d0c6SmrgAC_DIAGNOSE([obsolete],
122218fc2d0c6Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
122228fc2d0c6Smrgput the 'pic-only' option into LT_INIT's first parameter.])
122238fc2d0c6Smrg])
122240a392d7eSmrg
122258fc2d0c6Smrgdnl aclocal-1.4 backwards compatibility:
122268fc2d0c6Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
122270a392d7eSmrg
122280a392d7eSmrg
122298fc2d0c6Smrgm4_define([_LTDL_MODE], [])
122308fc2d0c6SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
122318fc2d0c6Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
122328fc2d0c6SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
122338fc2d0c6Smrg		 [m4_define([_LTDL_MODE], [recursive])])
122348fc2d0c6SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
122358fc2d0c6Smrg		 [m4_define([_LTDL_MODE], [subproject])])
122368fc2d0c6Smrg
122378fc2d0c6Smrgm4_define([_LTDL_TYPE], [])
122388fc2d0c6SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
122398fc2d0c6Smrg		 [m4_define([_LTDL_TYPE], [installable])])
122408fc2d0c6SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
122418fc2d0c6Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
122428fc2d0c6Smrg
122438fc2d0c6Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
122440a392d7eSmrg#
122458fc2d0c6Smrg# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
122468fc2d0c6Smrg# Foundation, Inc.
122478fc2d0c6Smrg# Written by Gary V. Vaughan, 2004
122488fc2d0c6Smrg#
122498fc2d0c6Smrg# This file is free software; the Free Software Foundation gives
122508fc2d0c6Smrg# unlimited permission to copy and/or distribute it, with or without
122518fc2d0c6Smrg# modifications, as long as this notice is preserved.
122520a392d7eSmrg
122538fc2d0c6Smrg# serial 6 ltsugar.m4
122540a392d7eSmrg
122558fc2d0c6Smrg# This is to help aclocal find these macros, as it can't see m4_define.
122568fc2d0c6SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
122574a041c5bSmacallan
122584a041c5bSmacallan
122598fc2d0c6Smrg# lt_join(SEP, ARG1, [ARG2...])
122608fc2d0c6Smrg# -----------------------------
122618fc2d0c6Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
122628fc2d0c6Smrg# associated separator.
122638fc2d0c6Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
122648fc2d0c6Smrg# versions in m4sugar had bugs.
122658fc2d0c6Smrgm4_define([lt_join],
122668fc2d0c6Smrg[m4_if([$#], [1], [],
122678fc2d0c6Smrg       [$#], [2], [[$2]],
122688fc2d0c6Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
122698fc2d0c6Smrgm4_define([_lt_join],
122708fc2d0c6Smrg[m4_if([$#$2], [2], [],
122718fc2d0c6Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
1227254b44505Smrg
1227354b44505Smrg
122748fc2d0c6Smrg# lt_car(LIST)
122758fc2d0c6Smrg# lt_cdr(LIST)
122768fc2d0c6Smrg# ------------
122778fc2d0c6Smrg# Manipulate m4 lists.
122788fc2d0c6Smrg# These macros are necessary as long as will still need to support
122798fc2d0c6Smrg# Autoconf-2.59, which quotes differently.
122808fc2d0c6Smrgm4_define([lt_car], [[$1]])
122818fc2d0c6Smrgm4_define([lt_cdr],
122828fc2d0c6Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
122838fc2d0c6Smrg       [$#], 1, [],
122848fc2d0c6Smrg       [m4_dquote(m4_shift($@))])])
122858fc2d0c6Smrgm4_define([lt_unquote], $1)
122868fc2d0c6Smrg
1228754b44505Smrg
122888fc2d0c6Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
122898fc2d0c6Smrg# ------------------------------------------
122908fc2d0c6Smrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
122918fc2d0c6Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
122928fc2d0c6Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
122938fc2d0c6Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
122948fc2d0c6Smrg# than defined and empty).
1229554b44505Smrg#
122968fc2d0c6Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
122978fc2d0c6Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
122988fc2d0c6Smrgm4_define([lt_append],
122998fc2d0c6Smrg[m4_define([$1],
123008fc2d0c6Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
1230154b44505Smrg
123024a041c5bSmacallan
123034a041c5bSmacallan
123048fc2d0c6Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
123058fc2d0c6Smrg# ----------------------------------------------------------
123068fc2d0c6Smrg# Produce a SEP delimited list of all paired combinations of elements of
123078fc2d0c6Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
123088fc2d0c6Smrg# has the form PREFIXmINFIXSUFFIXn.
123098fc2d0c6Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
123108fc2d0c6Smrgm4_define([lt_combine],
123118fc2d0c6Smrg[m4_if(m4_eval([$# > 3]), [1],
123128fc2d0c6Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
123138fc2d0c6Smrg[[m4_foreach([_Lt_prefix], [$2],
123148fc2d0c6Smrg	     [m4_foreach([_Lt_suffix],
123158fc2d0c6Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
123168fc2d0c6Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
123178fc2d0c6Smrg
123188fc2d0c6Smrg
123198fc2d0c6Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
123208fc2d0c6Smrg# -----------------------------------------------------------------------
123218fc2d0c6Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
123228fc2d0c6Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
123238fc2d0c6Smrgm4_define([lt_if_append_uniq],
123248fc2d0c6Smrg[m4_ifdef([$1],
123258fc2d0c6Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
123268fc2d0c6Smrg		 [lt_append([$1], [$2], [$3])$4],
123278fc2d0c6Smrg		 [$5])],
123288fc2d0c6Smrg	  [lt_append([$1], [$2], [$3])$4])])
123298fc2d0c6Smrg
123308fc2d0c6Smrg
123318fc2d0c6Smrg# lt_dict_add(DICT, KEY, VALUE)
123328fc2d0c6Smrg# -----------------------------
123338fc2d0c6Smrgm4_define([lt_dict_add],
123348fc2d0c6Smrg[m4_define([$1($2)], [$3])])
123354a041c5bSmacallan
123364a041c5bSmacallan
123378fc2d0c6Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
123388fc2d0c6Smrg# --------------------------------------------
123398fc2d0c6Smrgm4_define([lt_dict_add_subkey],
123408fc2d0c6Smrg[m4_define([$1($2:$3)], [$4])])
123414a041c5bSmacallan
1234254b44505Smrg
123438fc2d0c6Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
123448fc2d0c6Smrg# ----------------------------------
123458fc2d0c6Smrgm4_define([lt_dict_fetch],
123468fc2d0c6Smrg[m4_ifval([$3],
123478fc2d0c6Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
123488fc2d0c6Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
123494a041c5bSmacallan
123504a041c5bSmacallan
123518fc2d0c6Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
123528fc2d0c6Smrg# -----------------------------------------------------------------
123538fc2d0c6Smrgm4_define([lt_if_dict_fetch],
123548fc2d0c6Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
123558fc2d0c6Smrg	[$5],
123568fc2d0c6Smrg    [$6])])
123570a392d7eSmrg
123584a041c5bSmacallan
123598fc2d0c6Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
123608fc2d0c6Smrg# --------------------------------------------------------------
123618fc2d0c6Smrgm4_define([lt_dict_filter],
123628fc2d0c6Smrg[m4_if([$5], [], [],
123638fc2d0c6Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
123648fc2d0c6Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
123658fc2d0c6Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
123668fc2d0c6Smrg])
123670a392d7eSmrg
123688fc2d0c6Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
123698fc2d0c6Smrg#
123708fc2d0c6Smrg#   Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
123718fc2d0c6Smrg#   Inc.
123728fc2d0c6Smrg#   Written by Scott James Remnant, 2004
123738fc2d0c6Smrg#
123748fc2d0c6Smrg# This file is free software; the Free Software Foundation gives
123758fc2d0c6Smrg# unlimited permission to copy and/or distribute it, with or without
123768fc2d0c6Smrg# modifications, as long as this notice is preserved.
123770a392d7eSmrg
123788fc2d0c6Smrg# @configure_input@
123794a041c5bSmacallan
123808fc2d0c6Smrg# serial 4245 ltversion.m4
123818fc2d0c6Smrg# This file is part of GNU Libtool
123820a392d7eSmrg
123838fc2d0c6Smrgm4_define([LT_PACKAGE_VERSION], [2.4.7])
123848fc2d0c6Smrgm4_define([LT_PACKAGE_REVISION], [2.4.7])
123850a392d7eSmrg
123868fc2d0c6SmrgAC_DEFUN([LTVERSION_VERSION],
123878fc2d0c6Smrg[macro_version='2.4.7'
123888fc2d0c6Smrgmacro_revision='2.4.7'
123898fc2d0c6Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
123908fc2d0c6Smrg_LT_DECL(, macro_revision, 0)
123918fc2d0c6Smrg])
123920a392d7eSmrg
123938fc2d0c6Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
123948fc2d0c6Smrg#
123958fc2d0c6Smrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
123968fc2d0c6Smrg#   Software Foundation, Inc.
123978fc2d0c6Smrg#   Written by Scott James Remnant, 2004.
123988fc2d0c6Smrg#
123998fc2d0c6Smrg# This file is free software; the Free Software Foundation gives
124008fc2d0c6Smrg# unlimited permission to copy and/or distribute it, with or without
124018fc2d0c6Smrg# modifications, as long as this notice is preserved.
124020a392d7eSmrg
124038fc2d0c6Smrg# serial 5 lt~obsolete.m4
124040a392d7eSmrg
124058fc2d0c6Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
124068fc2d0c6Smrg#
124078fc2d0c6Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
124088fc2d0c6Smrg# which have later been changed to m4_define as they aren't part of the
124098fc2d0c6Smrg# exported API, or moved to Autoconf or Automake where they belong.
124108fc2d0c6Smrg#
124118fc2d0c6Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
124128fc2d0c6Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
124138fc2d0c6Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
124148fc2d0c6Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
124158fc2d0c6Smrg# and doesn't know about Autoconf macros at all.)
124168fc2d0c6Smrg#
124178fc2d0c6Smrg# So we provide this file, which has a silly filename so it's always
124188fc2d0c6Smrg# included after everything else.  This provides aclocal with the
124198fc2d0c6Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
124208fc2d0c6Smrg# because those macros already exist, or will be overwritten later.
124218fc2d0c6Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
124228fc2d0c6Smrg#
124238fc2d0c6Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
124248fc2d0c6Smrg# Yes, that means every name once taken will need to remain here until
124258fc2d0c6Smrg# we give up compatibility with versions before 1.7, at which point
124268fc2d0c6Smrg# we need to keep only those names which we still refer to.
124274a041c5bSmacallan
124288fc2d0c6Smrg# This is to help aclocal find these macros, as it can't see m4_define.
124298fc2d0c6SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
124300a392d7eSmrg
124318fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
124328fc2d0c6Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
124338fc2d0c6Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
124348fc2d0c6Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
124358fc2d0c6Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
124368fc2d0c6Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
124378fc2d0c6Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
124388fc2d0c6Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
124398fc2d0c6Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
124408fc2d0c6Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
124418fc2d0c6Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
124428fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
124438fc2d0c6Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
124448fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
124458fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
124468fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
124478fc2d0c6Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
124488fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
124498fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
124508fc2d0c6Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
124518fc2d0c6Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
124528fc2d0c6Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
124538fc2d0c6Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
124548fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
124558fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
124568fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
124578fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
124588fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
124598fc2d0c6Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
124608fc2d0c6Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
124618fc2d0c6Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
124628fc2d0c6Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
124638fc2d0c6Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
124648fc2d0c6Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
124658fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
124668fc2d0c6Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
124678fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
124688fc2d0c6Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
124698fc2d0c6Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
124708fc2d0c6Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
124718fc2d0c6Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
124728fc2d0c6Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
124738fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
124748fc2d0c6Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
124758fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
124768fc2d0c6Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
124778fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
124788fc2d0c6Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
124798fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
124808fc2d0c6Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
124818fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
124828fc2d0c6Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
124838fc2d0c6Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
124848fc2d0c6Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
124858fc2d0c6Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
124868fc2d0c6Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
124878fc2d0c6Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
124888fc2d0c6Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
124898fc2d0c6Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
124908fc2d0c6Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
124918fc2d0c6Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
124924a041c5bSmacallan
12493