aclocal.m4 revision 52b01e16
152b01e16Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
24b0ead49Smrg
34b0ead49Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
452b01e16Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
54b0ead49Smrg# This file is free software; the Free Software Foundation
64b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
74b0ead49Smrg# with or without modifications, as long as this notice is preserved.
84b0ead49Smrg
94b0ead49Smrg# This program is distributed in the hope that it will be useful,
104b0ead49Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
114b0ead49Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
124b0ead49Smrg# PARTICULAR PURPOSE.
134b0ead49Smrg
1452b01e16Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1552b01e16Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1652b01e16Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1752b01e16Smrg[m4_warning([this file was generated for autoconf 2.63.
1852b01e16SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1952b01e16SmrgIf you have problems, you may need to regenerate the build system entirely.
2052b01e16SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
214b0ead49Smrg
2252b01e16Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2352b01e16Smrg#
2452b01e16Smrg# This file is free software; the Free Software Foundation
2552b01e16Smrg# gives unlimited permission to copy and/or distribute it,
2652b01e16Smrg# with or without modifications, as long as this notice is preserved.
274b0ead49Smrg
2852b01e16Smrg# AM_AUTOMAKE_VERSION(VERSION)
2952b01e16Smrg# ----------------------------
3052b01e16Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3152b01e16Smrg# generated from the m4 files accompanying Automake X.Y.
3252b01e16Smrg# (This private macro should not be called outside this file.)
3352b01e16SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3452b01e16Smrg[am__api_version='1.11'
3552b01e16Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3652b01e16Smrgdnl require some minimum version.  Point them to the right macro.
3752b01e16Smrgm4_if([$1], [1.11], [],
3852b01e16Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3952b01e16Smrg])
404b0ead49Smrg
4152b01e16Smrg# _AM_AUTOCONF_VERSION(VERSION)
4252b01e16Smrg# -----------------------------
4352b01e16Smrg# aclocal traces this macro to find the Autoconf version.
4452b01e16Smrg# This is a private macro too.  Using m4_define simplifies
4552b01e16Smrg# the logic in aclocal, which can simply ignore this definition.
4652b01e16Smrgm4_define([_AM_AUTOCONF_VERSION], [])
474b0ead49Smrg
4852b01e16Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4952b01e16Smrg# -------------------------------
5052b01e16Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5152b01e16Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5252b01e16SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5352b01e16Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
5452b01e16Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5552b01e16Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5652b01e16Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
574b0ead49Smrg
5852b01e16Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
594b0ead49Smrg
6052b01e16Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6152b01e16Smrg#
6252b01e16Smrg# This file is free software; the Free Software Foundation
6352b01e16Smrg# gives unlimited permission to copy and/or distribute it,
6452b01e16Smrg# with or without modifications, as long as this notice is preserved.
654b0ead49Smrg
6652b01e16Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6752b01e16Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6852b01e16Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6952b01e16Smrg#
7052b01e16Smrg# Of course, Automake must honor this variable whenever it calls a
7152b01e16Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7252b01e16Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7352b01e16Smrg# depending on how configure is run.  This is pretty annoying, since
7452b01e16Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7552b01e16Smrg# source directory, any form will work fine, but in subdirectories a
7652b01e16Smrg# relative path needs to be adjusted first.
7752b01e16Smrg#
7852b01e16Smrg# $ac_aux_dir/missing
7952b01e16Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8052b01e16Smrg# $top_srcdir/$ac_aux_dir/missing
8152b01e16Smrg#    fails if $ac_aux_dir is absolute,
8252b01e16Smrg#    fails when called from a subdirectory in a VPATH build with
8352b01e16Smrg#          a relative $ac_aux_dir
8452b01e16Smrg#
8552b01e16Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8652b01e16Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8752b01e16Smrg# harmless because $srcdir is `.', but things will broke when you
8852b01e16Smrg# start a VPATH build or use an absolute $srcdir.
8952b01e16Smrg#
9052b01e16Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9152b01e16Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9252b01e16Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9352b01e16Smrg# and then we would define $MISSING as
9452b01e16Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9552b01e16Smrg# This will work as long as MISSING is not called from configure, because
9652b01e16Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9752b01e16Smrg# However there are other variables, like CC, which are often used in
9852b01e16Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9952b01e16Smrg#
10052b01e16Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10152b01e16Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10252b01e16Smrg# configured tree to be moved without reconfiguration.
1034b0ead49Smrg
10452b01e16SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10552b01e16Smrg[dnl Rely on autoconf to set up CDPATH properly.
10652b01e16SmrgAC_PREREQ([2.50])dnl
10752b01e16Smrg# expand $ac_aux_dir to an absolute path
10852b01e16Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
10952b01e16Smrg])
1104b0ead49Smrg
11152b01e16Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1124b0ead49Smrg
11352b01e16Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11452b01e16Smrg# Free Software Foundation, Inc.
11552b01e16Smrg#
11652b01e16Smrg# This file is free software; the Free Software Foundation
11752b01e16Smrg# gives unlimited permission to copy and/or distribute it,
11852b01e16Smrg# with or without modifications, as long as this notice is preserved.
1194b0ead49Smrg
12052b01e16Smrg# serial 9
1214b0ead49Smrg
12252b01e16Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12352b01e16Smrg# -------------------------------------
12452b01e16Smrg# Define a conditional.
12552b01e16SmrgAC_DEFUN([AM_CONDITIONAL],
12652b01e16Smrg[AC_PREREQ(2.52)dnl
12752b01e16Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12852b01e16Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12952b01e16SmrgAC_SUBST([$1_TRUE])dnl
13052b01e16SmrgAC_SUBST([$1_FALSE])dnl
13152b01e16Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13252b01e16Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13352b01e16Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13452b01e16Smrgif $2; then
13552b01e16Smrg  $1_TRUE=
13652b01e16Smrg  $1_FALSE='#'
13752b01e16Smrgelse
13852b01e16Smrg  $1_TRUE='#'
13952b01e16Smrg  $1_FALSE=
14052b01e16Smrgfi
14152b01e16SmrgAC_CONFIG_COMMANDS_PRE(
14252b01e16Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14352b01e16Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14452b01e16SmrgUsually this means the macro was only invoked conditionally.]])
14552b01e16Smrgfi])])
1464b0ead49Smrg
14752b01e16Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14852b01e16Smrg# Free Software Foundation, Inc.
14952b01e16Smrg#
15052b01e16Smrg# This file is free software; the Free Software Foundation
15152b01e16Smrg# gives unlimited permission to copy and/or distribute it,
15252b01e16Smrg# with or without modifications, as long as this notice is preserved.
1534b0ead49Smrg
15452b01e16Smrg# serial 10
1554b0ead49Smrg
15652b01e16Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15752b01e16Smrg# written in clear, in which case automake, when reading aclocal.m4,
15852b01e16Smrg# will think it sees a *use*, and therefore will trigger all it's
15952b01e16Smrg# C support machinery.  Also note that it means that autoscan, seeing
16052b01e16Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1614b0ead49Smrg
1624b0ead49Smrg
16352b01e16Smrg# _AM_DEPENDENCIES(NAME)
16452b01e16Smrg# ----------------------
16552b01e16Smrg# See how the compiler implements dependency checking.
16652b01e16Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16752b01e16Smrg# We try a few techniques and use that to set a single cache variable.
16852b01e16Smrg#
16952b01e16Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
17052b01e16Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
17152b01e16Smrg# dependency, and given that the user is not expected to run this macro,
17252b01e16Smrg# just rely on AC_PROG_CC.
17352b01e16SmrgAC_DEFUN([_AM_DEPENDENCIES],
17452b01e16Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17552b01e16SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17652b01e16SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17752b01e16SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1784b0ead49Smrg
17952b01e16Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18052b01e16Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18152b01e16Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
18252b01e16Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
18352b01e16Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18452b01e16Smrg                   [depcc="$$1"   am_compiler_list=])
1854b0ead49Smrg
18652b01e16SmrgAC_CACHE_CHECK([dependency style of $depcc],
18752b01e16Smrg               [am_cv_$1_dependencies_compiler_type],
18852b01e16Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18952b01e16Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
19052b01e16Smrg  # making bogus files that we don't know about and never remove.  For
19152b01e16Smrg  # instance it was reported that on HP-UX the gcc test will end up
19252b01e16Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
19352b01e16Smrg  # in D'.
19452b01e16Smrg  mkdir conftest.dir
19552b01e16Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19652b01e16Smrg  # using a relative directory.
19752b01e16Smrg  cp "$am_depcomp" conftest.dir
19852b01e16Smrg  cd conftest.dir
19952b01e16Smrg  # We will build objects and dependencies in a subdirectory because
20052b01e16Smrg  # it helps to detect inapplicable dependency modes.  For instance
20152b01e16Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20252b01e16Smrg  # side effect of compilation, but ICC will put the dependencies in
20352b01e16Smrg  # the current directory while Tru64 will put them in the object
20452b01e16Smrg  # directory.
20552b01e16Smrg  mkdir sub
2064b0ead49Smrg
20752b01e16Smrg  am_cv_$1_dependencies_compiler_type=none
20852b01e16Smrg  if test "$am_compiler_list" = ""; then
20952b01e16Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
21052b01e16Smrg  fi
21152b01e16Smrg  am__universal=false
21252b01e16Smrg  m4_case([$1], [CC],
21352b01e16Smrg    [case " $depcc " in #(
21452b01e16Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21552b01e16Smrg     esac],
21652b01e16Smrg    [CXX],
21752b01e16Smrg    [case " $depcc " in #(
21852b01e16Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21952b01e16Smrg     esac])
2204b0ead49Smrg
22152b01e16Smrg  for depmode in $am_compiler_list; do
22252b01e16Smrg    # Setup a source with many dependencies, because some compilers
22352b01e16Smrg    # like to wrap large dependency lists on column 80 (with \), and
22452b01e16Smrg    # we should not choose a depcomp mode which is confused by this.
22552b01e16Smrg    #
22652b01e16Smrg    # We need to recreate these files for each test, as the compiler may
22752b01e16Smrg    # overwrite some of them when testing with obscure command lines.
22852b01e16Smrg    # This happens at least with the AIX C compiler.
22952b01e16Smrg    : > sub/conftest.c
23052b01e16Smrg    for i in 1 2 3 4 5 6; do
23152b01e16Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23252b01e16Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23352b01e16Smrg      # Solaris 8's {/usr,}/bin/sh.
23452b01e16Smrg      touch sub/conftst$i.h
23552b01e16Smrg    done
23652b01e16Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2374b0ead49Smrg
23852b01e16Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23952b01e16Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24052b01e16Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24152b01e16Smrg    # versions had trouble with output in subdirs
24252b01e16Smrg    am__obj=sub/conftest.${OBJEXT-o}
24352b01e16Smrg    am__minus_obj="-o $am__obj"
24452b01e16Smrg    case $depmode in
24552b01e16Smrg    gcc)
24652b01e16Smrg      # This depmode causes a compiler race in universal mode.
24752b01e16Smrg      test "$am__universal" = false || continue
24852b01e16Smrg      ;;
24952b01e16Smrg    nosideeffect)
25052b01e16Smrg      # after this tag, mechanisms are not by side-effect, so they'll
25152b01e16Smrg      # only be used when explicitly requested
25252b01e16Smrg      if test "x$enable_dependency_tracking" = xyes; then
25352b01e16Smrg	continue
25452b01e16Smrg      else
25552b01e16Smrg	break
25652b01e16Smrg      fi
25752b01e16Smrg      ;;
25852b01e16Smrg    msvisualcpp | msvcmsys)
25952b01e16Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
26052b01e16Smrg      # not run yet.  These depmodes are late enough in the game, and
26152b01e16Smrg      # so weak that their functioning should not be impacted.
26252b01e16Smrg      am__obj=conftest.${OBJEXT-o}
26352b01e16Smrg      am__minus_obj=
26452b01e16Smrg      ;;
26552b01e16Smrg    none) break ;;
26652b01e16Smrg    esac
26752b01e16Smrg    if depmode=$depmode \
26852b01e16Smrg       source=sub/conftest.c object=$am__obj \
26952b01e16Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27052b01e16Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27152b01e16Smrg         >/dev/null 2>conftest.err &&
27252b01e16Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27352b01e16Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27452b01e16Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27552b01e16Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27652b01e16Smrg      # icc doesn't choke on unknown options, it will just issue warnings
27752b01e16Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
27852b01e16Smrg      # that says an option was ignored or not supported.
27952b01e16Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28052b01e16Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28152b01e16Smrg      # The diagnosis changed in icc 8.0:
28252b01e16Smrg      #   icc: Command line remark: option '-MP' not supported
28352b01e16Smrg      if (grep 'ignoring option' conftest.err ||
28452b01e16Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28552b01e16Smrg        am_cv_$1_dependencies_compiler_type=$depmode
28652b01e16Smrg        break
28752b01e16Smrg      fi
28852b01e16Smrg    fi
28952b01e16Smrg  done
2904b0ead49Smrg
29152b01e16Smrg  cd ..
29252b01e16Smrg  rm -rf conftest.dir
29352b01e16Smrgelse
29452b01e16Smrg  am_cv_$1_dependencies_compiler_type=none
2954b0ead49Smrgfi
29652b01e16Smrg])
29752b01e16SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29852b01e16SmrgAM_CONDITIONAL([am__fastdep$1], [
29952b01e16Smrg  test "x$enable_dependency_tracking" != xno \
30052b01e16Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
30152b01e16Smrg])
3024b0ead49Smrg
3034b0ead49Smrg
30452b01e16Smrg# AM_SET_DEPDIR
30552b01e16Smrg# -------------
30652b01e16Smrg# Choose a directory name for dependency files.
30752b01e16Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
30852b01e16SmrgAC_DEFUN([AM_SET_DEPDIR],
30952b01e16Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
31052b01e16SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
31152b01e16Smrg])
3124b0ead49Smrg
3134b0ead49Smrg
31452b01e16Smrg# AM_DEP_TRACK
31552b01e16Smrg# ------------
31652b01e16SmrgAC_DEFUN([AM_DEP_TRACK],
31752b01e16Smrg[AC_ARG_ENABLE(dependency-tracking,
31852b01e16Smrg[  --disable-dependency-tracking  speeds up one-time build
31952b01e16Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
32052b01e16Smrgif test "x$enable_dependency_tracking" != xno; then
32152b01e16Smrg  am_depcomp="$ac_aux_dir/depcomp"
32252b01e16Smrg  AMDEPBACKSLASH='\'
32352b01e16Smrgfi
32452b01e16SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32552b01e16SmrgAC_SUBST([AMDEPBACKSLASH])dnl
32652b01e16Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32752b01e16Smrg])
3284b0ead49Smrg
32952b01e16Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3304b0ead49Smrg
33152b01e16Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33252b01e16Smrg# Free Software Foundation, Inc.
33352b01e16Smrg#
33452b01e16Smrg# This file is free software; the Free Software Foundation
33552b01e16Smrg# gives unlimited permission to copy and/or distribute it,
33652b01e16Smrg# with or without modifications, as long as this notice is preserved.
3374b0ead49Smrg
33852b01e16Smrg#serial 5
3394b0ead49Smrg
34052b01e16Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34152b01e16Smrg# ------------------------------
34252b01e16SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34352b01e16Smrg[{
34452b01e16Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34552b01e16Smrg  # are listed without --file.  Let's play safe and only enable the eval
34652b01e16Smrg  # if we detect the quoting.
34752b01e16Smrg  case $CONFIG_FILES in
34852b01e16Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
34952b01e16Smrg  *)   set x $CONFIG_FILES ;;
35052b01e16Smrg  esac
35152b01e16Smrg  shift
35252b01e16Smrg  for mf
35352b01e16Smrg  do
35452b01e16Smrg    # Strip MF so we end up with the name of the file.
35552b01e16Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35652b01e16Smrg    # Check whether this is an Automake generated Makefile or not.
35752b01e16Smrg    # We used to match only the files named `Makefile.in', but
35852b01e16Smrg    # some people rename them; so instead we look at the file content.
35952b01e16Smrg    # Grep'ing the first line is not enough: some people post-process
36052b01e16Smrg    # each Makefile.in and add a new line on top of each file to say so.
36152b01e16Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36252b01e16Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36352b01e16Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36452b01e16Smrg      dirpart=`AS_DIRNAME("$mf")`
36552b01e16Smrg    else
36652b01e16Smrg      continue
36752b01e16Smrg    fi
36852b01e16Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
36952b01e16Smrg    # from the Makefile without running `make'.
37052b01e16Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37152b01e16Smrg    test -z "$DEPDIR" && continue
37252b01e16Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37352b01e16Smrg    test -z "am__include" && continue
37452b01e16Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37552b01e16Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
37652b01e16Smrg    U=`sed -n 's/^U = //p' < "$mf"`
37752b01e16Smrg    # Find all dependency output files, they are included files with
37852b01e16Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37952b01e16Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38052b01e16Smrg    # expansion.
38152b01e16Smrg    for file in `sed -n "
38252b01e16Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38352b01e16Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38452b01e16Smrg      # Make sure the directory exists.
38552b01e16Smrg      test -f "$dirpart/$file" && continue
38652b01e16Smrg      fdir=`AS_DIRNAME(["$file"])`
38752b01e16Smrg      AS_MKDIR_P([$dirpart/$fdir])
38852b01e16Smrg      # echo "creating $dirpart/$file"
38952b01e16Smrg      echo '# dummy' > "$dirpart/$file"
39052b01e16Smrg    done
39152b01e16Smrg  done
39252b01e16Smrg}
39352b01e16Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3944b0ead49Smrg
3954b0ead49Smrg
39652b01e16Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39752b01e16Smrg# -----------------------------
39852b01e16Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
39952b01e16Smrg#
40052b01e16Smrg# This code is only required when automatic dependency tracking
40152b01e16Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
40252b01e16Smrg# need in order to bootstrap the dependency handling code.
40352b01e16SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40452b01e16Smrg[AC_CONFIG_COMMANDS([depfiles],
40552b01e16Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40652b01e16Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4074b0ead49Smrg])
4084b0ead49Smrg
40952b01e16Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
41052b01e16Smrg# Free Software Foundation, Inc.
41152b01e16Smrg#
41252b01e16Smrg# This file is free software; the Free Software Foundation
41352b01e16Smrg# gives unlimited permission to copy and/or distribute it,
41452b01e16Smrg# with or without modifications, as long as this notice is preserved.
4154b0ead49Smrg
41652b01e16Smrg# serial 8
4174b0ead49Smrg
41852b01e16Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
41952b01e16SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
4204b0ead49Smrg
42152b01e16Smrg# Do all the work for Automake.                             -*- Autoconf -*-
4224b0ead49Smrg
42352b01e16Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
42452b01e16Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
42552b01e16Smrg#
42652b01e16Smrg# This file is free software; the Free Software Foundation
42752b01e16Smrg# gives unlimited permission to copy and/or distribute it,
42852b01e16Smrg# with or without modifications, as long as this notice is preserved.
4294b0ead49Smrg
43052b01e16Smrg# serial 16
4314b0ead49Smrg
43252b01e16Smrg# This macro actually does too much.  Some checks are only needed if
43352b01e16Smrg# your package does certain things.  But this isn't really a big deal.
4344b0ead49Smrg
43552b01e16Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
43652b01e16Smrg# AM_INIT_AUTOMAKE([OPTIONS])
43752b01e16Smrg# -----------------------------------------------
43852b01e16Smrg# The call with PACKAGE and VERSION arguments is the old style
43952b01e16Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
44052b01e16Smrg# and VERSION should now be passed to AC_INIT and removed from
44152b01e16Smrg# the call to AM_INIT_AUTOMAKE.
44252b01e16Smrg# We support both call styles for the transition.  After
44352b01e16Smrg# the next Automake release, Autoconf can make the AC_INIT
44452b01e16Smrg# arguments mandatory, and then we can depend on a new Autoconf
44552b01e16Smrg# release and drop the old call support.
44652b01e16SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
44752b01e16Smrg[AC_PREREQ([2.62])dnl
44852b01e16Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
44952b01e16Smrgdnl the ones we care about.
45052b01e16Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45152b01e16SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
45252b01e16SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
45352b01e16Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
45452b01e16Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
45552b01e16Smrg  # is not polluted with repeated "-I."
45652b01e16Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
45752b01e16Smrg  # test to see if srcdir already configured
45852b01e16Smrg  if test -f $srcdir/config.status; then
45952b01e16Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
46052b01e16Smrg  fi
46152b01e16Smrgfi
4624b0ead49Smrg
46352b01e16Smrg# test whether we have cygpath
46452b01e16Smrgif test -z "$CYGPATH_W"; then
46552b01e16Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
46652b01e16Smrg    CYGPATH_W='cygpath -w'
46752b01e16Smrg  else
46852b01e16Smrg    CYGPATH_W=echo
46952b01e16Smrg  fi
47052b01e16Smrgfi
47152b01e16SmrgAC_SUBST([CYGPATH_W])
4724b0ead49Smrg
47352b01e16Smrg# Define the identity of the package.
47452b01e16Smrgdnl Distinguish between old-style and new-style calls.
47552b01e16Smrgm4_ifval([$2],
47652b01e16Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
47752b01e16Smrg AC_SUBST([PACKAGE], [$1])dnl
47852b01e16Smrg AC_SUBST([VERSION], [$2])],
47952b01e16Smrg[_AM_SET_OPTIONS([$1])dnl
48052b01e16Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
48152b01e16Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
48252b01e16Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
48352b01e16Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
48452b01e16Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4854b0ead49Smrg
48652b01e16Smrg_AM_IF_OPTION([no-define],,
48752b01e16Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
48852b01e16Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4894b0ead49Smrg
49052b01e16Smrg# Some tools Automake needs.
49152b01e16SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
49252b01e16SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
49352b01e16SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
49452b01e16SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
49552b01e16SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
49652b01e16SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
49752b01e16SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
49852b01e16SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
49952b01e16SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
50052b01e16SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
50152b01e16Smrg# We need awk for the "check" target.  The system "awk" is bad on
50252b01e16Smrg# some platforms.
50352b01e16SmrgAC_REQUIRE([AC_PROG_AWK])dnl
50452b01e16SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50552b01e16SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50652b01e16Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
50752b01e16Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
50852b01e16Smrg			     [_AM_PROG_TAR([v7])])])
50952b01e16Smrg_AM_IF_OPTION([no-dependencies],,
51052b01e16Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
51152b01e16Smrg		  [_AM_DEPENDENCIES(CC)],
51252b01e16Smrg		  [define([AC_PROG_CC],
51352b01e16Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
51452b01e16SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
51552b01e16Smrg		  [_AM_DEPENDENCIES(CXX)],
51652b01e16Smrg		  [define([AC_PROG_CXX],
51752b01e16Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
51852b01e16SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
51952b01e16Smrg		  [_AM_DEPENDENCIES(OBJC)],
52052b01e16Smrg		  [define([AC_PROG_OBJC],
52152b01e16Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
52252b01e16Smrg])
52352b01e16Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
52452b01e16Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
52552b01e16Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
52652b01e16Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
52752b01e16SmrgAC_CONFIG_COMMANDS_PRE(dnl
52852b01e16Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
52952b01e16Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
53052b01e16Smrg])
5314b0ead49Smrg
53252b01e16Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
53352b01e16Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
53452b01e16Smrgdnl mangled by Autoconf and run in a shell conditional statement.
53552b01e16Smrgm4_define([_AC_COMPILER_EXEEXT],
53652b01e16Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5374b0ead49Smrg
5384b0ead49Smrg
53952b01e16Smrg# When config.status generates a header, we must update the stamp-h file.
54052b01e16Smrg# This file resides in the same directory as the config header
54152b01e16Smrg# that is generated.  The stamp files are numbered to have different names.
5424b0ead49Smrg
54352b01e16Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
54452b01e16Smrg# loop where config.status creates the headers, so we can generate
54552b01e16Smrg# our stamp files there.
54652b01e16SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
54752b01e16Smrg[# Compute $1's index in $config_headers.
54852b01e16Smrg_am_arg=$1
54952b01e16Smrg_am_stamp_count=1
55052b01e16Smrgfor _am_header in $config_headers :; do
55152b01e16Smrg  case $_am_header in
55252b01e16Smrg    $_am_arg | $_am_arg:* )
55352b01e16Smrg      break ;;
55452b01e16Smrg    * )
55552b01e16Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
55652b01e16Smrg  esac
55752b01e16Smrgdone
55852b01e16Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5594b0ead49Smrg
56052b01e16Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
56152b01e16Smrg#
56252b01e16Smrg# This file is free software; the Free Software Foundation
56352b01e16Smrg# gives unlimited permission to copy and/or distribute it,
56452b01e16Smrg# with or without modifications, as long as this notice is preserved.
5654b0ead49Smrg
56652b01e16Smrg# AM_PROG_INSTALL_SH
56752b01e16Smrg# ------------------
56852b01e16Smrg# Define $install_sh.
56952b01e16SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
57052b01e16Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
57152b01e16Smrgif test x"${install_sh}" != xset; then
57252b01e16Smrg  case $am_aux_dir in
57352b01e16Smrg  *\ * | *\	*)
57452b01e16Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
57552b01e16Smrg  *)
57652b01e16Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
57752b01e16Smrg  esac
57852b01e16Smrgfi
57952b01e16SmrgAC_SUBST(install_sh)])
5804b0ead49Smrg
58152b01e16Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
58252b01e16Smrg#
58352b01e16Smrg# This file is free software; the Free Software Foundation
58452b01e16Smrg# gives unlimited permission to copy and/or distribute it,
58552b01e16Smrg# with or without modifications, as long as this notice is preserved.
5864b0ead49Smrg
58752b01e16Smrg# serial 2
5884b0ead49Smrg
58952b01e16Smrg# Check whether the underlying file-system supports filenames
59052b01e16Smrg# with a leading dot.  For instance MS-DOS doesn't.
59152b01e16SmrgAC_DEFUN([AM_SET_LEADING_DOT],
59252b01e16Smrg[rm -rf .tst 2>/dev/null
59352b01e16Smrgmkdir .tst 2>/dev/null
59452b01e16Smrgif test -d .tst; then
59552b01e16Smrg  am__leading_dot=.
59652b01e16Smrgelse
59752b01e16Smrg  am__leading_dot=_
5984b0ead49Smrgfi
59952b01e16Smrgrmdir .tst 2>/dev/null
60052b01e16SmrgAC_SUBST([am__leading_dot])])
6014b0ead49Smrg
60252b01e16Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
60352b01e16Smrg# From Jim Meyering
6044b0ead49Smrg
60552b01e16Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
60652b01e16Smrg# Free Software Foundation, Inc.
60752b01e16Smrg#
60852b01e16Smrg# This file is free software; the Free Software Foundation
60952b01e16Smrg# gives unlimited permission to copy and/or distribute it,
61052b01e16Smrg# with or without modifications, as long as this notice is preserved.
6114b0ead49Smrg
61252b01e16Smrg# serial 5
6134b0ead49Smrg
61452b01e16Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
61552b01e16Smrg# ----------------------------------
61652b01e16Smrg# Control maintainer-specific portions of Makefiles.
61752b01e16Smrg# Default is to disable them, unless `enable' is passed literally.
61852b01e16Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
61952b01e16Smrg# can override the default with the --enable/--disable switch.
62052b01e16SmrgAC_DEFUN([AM_MAINTAINER_MODE],
62152b01e16Smrg[m4_case(m4_default([$1], [disable]),
62252b01e16Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
62352b01e16Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
62452b01e16Smrg       [m4_define([am_maintainer_other], [enable])
62552b01e16Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
62652b01e16SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
62752b01e16Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
62852b01e16Smrg  AC_ARG_ENABLE([maintainer-mode],
62952b01e16Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
63052b01e16Smrg			  (and sometimes confusing) to the casual installer],
63152b01e16Smrg      [USE_MAINTAINER_MODE=$enableval],
63252b01e16Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
63352b01e16Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
63452b01e16Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
63552b01e16Smrg  MAINT=$MAINTAINER_MODE_TRUE
63652b01e16Smrg  AC_SUBST([MAINT])dnl
63752b01e16Smrg]
63852b01e16Smrg)
6394b0ead49Smrg
64052b01e16SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6414b0ead49Smrg
64252b01e16Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
64352b01e16Smrg
64452b01e16Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
64552b01e16Smrg#
64652b01e16Smrg# This file is free software; the Free Software Foundation
64752b01e16Smrg# gives unlimited permission to copy and/or distribute it,
64852b01e16Smrg# with or without modifications, as long as this notice is preserved.
64952b01e16Smrg
65052b01e16Smrg# serial 4
65152b01e16Smrg
65252b01e16Smrg# AM_MAKE_INCLUDE()
65352b01e16Smrg# -----------------
65452b01e16Smrg# Check to see how make treats includes.
65552b01e16SmrgAC_DEFUN([AM_MAKE_INCLUDE],
65652b01e16Smrg[am_make=${MAKE-make}
65752b01e16Smrgcat > confinc << 'END'
65852b01e16Smrgam__doit:
65952b01e16Smrg	@echo this is the am__doit target
66052b01e16Smrg.PHONY: am__doit
66152b01e16SmrgEND
66252b01e16Smrg# If we don't find an include directive, just comment out the code.
66352b01e16SmrgAC_MSG_CHECKING([for style of include used by $am_make])
66452b01e16Smrgam__include="#"
66552b01e16Smrgam__quote=
66652b01e16Smrg_am_result=none
66752b01e16Smrg# First try GNU make style include.
66852b01e16Smrgecho "include confinc" > confmf
66952b01e16Smrg# Ignore all kinds of additional output from `make'.
67052b01e16Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
67152b01e16Smrg*the\ am__doit\ target*)
67252b01e16Smrg  am__include=include
67352b01e16Smrg  am__quote=
67452b01e16Smrg  _am_result=GNU
6754b0ead49Smrg  ;;
6764b0ead49Smrgesac
67752b01e16Smrg# Now try BSD make style include.
67852b01e16Smrgif test "$am__include" = "#"; then
67952b01e16Smrg   echo '.include "confinc"' > confmf
68052b01e16Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
68152b01e16Smrg   *the\ am__doit\ target*)
68252b01e16Smrg     am__include=.include
68352b01e16Smrg     am__quote="\""
68452b01e16Smrg     _am_result=BSD
68552b01e16Smrg     ;;
68652b01e16Smrg   esac
68752b01e16Smrgfi
68852b01e16SmrgAC_SUBST([am__include])
68952b01e16SmrgAC_SUBST([am__quote])
69052b01e16SmrgAC_MSG_RESULT([$_am_result])
69152b01e16Smrgrm -f confinc confmf
69252b01e16Smrg])
6934b0ead49Smrg
69452b01e16Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6954b0ead49Smrg
69652b01e16Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
69752b01e16Smrg# Free Software Foundation, Inc.
69852b01e16Smrg#
69952b01e16Smrg# This file is free software; the Free Software Foundation
70052b01e16Smrg# gives unlimited permission to copy and/or distribute it,
70152b01e16Smrg# with or without modifications, as long as this notice is preserved.
7024b0ead49Smrg
70352b01e16Smrg# serial 6
7044b0ead49Smrg
70552b01e16Smrg# AM_MISSING_PROG(NAME, PROGRAM)
70652b01e16Smrg# ------------------------------
70752b01e16SmrgAC_DEFUN([AM_MISSING_PROG],
70852b01e16Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
70952b01e16Smrg$1=${$1-"${am_missing_run}$2"}
71052b01e16SmrgAC_SUBST($1)])
7114b0ead49Smrg
71252b01e16Smrg
71352b01e16Smrg# AM_MISSING_HAS_RUN
71452b01e16Smrg# ------------------
71552b01e16Smrg# Define MISSING if not defined so far and test if it supports --run.
71652b01e16Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
71752b01e16SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71852b01e16Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
71952b01e16SmrgAC_REQUIRE_AUX_FILE([missing])dnl
72052b01e16Smrgif test x"${MISSING+set}" != xset; then
72152b01e16Smrg  case $am_aux_dir in
72252b01e16Smrg  *\ * | *\	*)
72352b01e16Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
72452b01e16Smrg  *)
72552b01e16Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
72652b01e16Smrg  esac
72752b01e16Smrgfi
72852b01e16Smrg# Use eval to expand $SHELL
72952b01e16Smrgif eval "$MISSING --run true"; then
73052b01e16Smrg  am_missing_run="$MISSING --run "
7314b0ead49Smrgelse
73252b01e16Smrg  am_missing_run=
73352b01e16Smrg  AC_MSG_WARN([`missing' script is too old or missing])
7344b0ead49Smrgfi
73552b01e16Smrg])
7364b0ead49Smrg
73752b01e16Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
73852b01e16Smrg#
73952b01e16Smrg# This file is free software; the Free Software Foundation
74052b01e16Smrg# gives unlimited permission to copy and/or distribute it,
74152b01e16Smrg# with or without modifications, as long as this notice is preserved.
7424b0ead49Smrg
74352b01e16Smrg# AM_PROG_MKDIR_P
74452b01e16Smrg# ---------------
74552b01e16Smrg# Check for `mkdir -p'.
74652b01e16SmrgAC_DEFUN([AM_PROG_MKDIR_P],
74752b01e16Smrg[AC_PREREQ([2.60])dnl
74852b01e16SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
74952b01e16Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
75052b01e16Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
75152b01e16Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
75252b01e16Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
75352b01e16Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
75452b01e16Smrgdnl adjustment using top_builddir (which is defined more often than
75552b01e16Smrgdnl MKDIR_P).
75652b01e16SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
75752b01e16Smrgcase $mkdir_p in
75852b01e16Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
75952b01e16Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
76052b01e16Smrgesac
7614b0ead49Smrg])
7624b0ead49Smrg
76352b01e16Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7644b0ead49Smrg
76552b01e16Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
76652b01e16Smrg#
76752b01e16Smrg# This file is free software; the Free Software Foundation
76852b01e16Smrg# gives unlimited permission to copy and/or distribute it,
76952b01e16Smrg# with or without modifications, as long as this notice is preserved.
7704b0ead49Smrg
77152b01e16Smrg# serial 4
7724b0ead49Smrg
77352b01e16Smrg# _AM_MANGLE_OPTION(NAME)
77452b01e16Smrg# -----------------------
77552b01e16SmrgAC_DEFUN([_AM_MANGLE_OPTION],
77652b01e16Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7774b0ead49Smrg
77852b01e16Smrg# _AM_SET_OPTION(NAME)
77952b01e16Smrg# ------------------------------
78052b01e16Smrg# Set option NAME.  Presently that only means defining a flag for this option.
78152b01e16SmrgAC_DEFUN([_AM_SET_OPTION],
78252b01e16Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7834b0ead49Smrg
78452b01e16Smrg# _AM_SET_OPTIONS(OPTIONS)
78552b01e16Smrg# ----------------------------------
78652b01e16Smrg# OPTIONS is a space-separated list of Automake options.
78752b01e16SmrgAC_DEFUN([_AM_SET_OPTIONS],
78852b01e16Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7894b0ead49Smrg
79052b01e16Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
79152b01e16Smrg# -------------------------------------------
79252b01e16Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
79352b01e16SmrgAC_DEFUN([_AM_IF_OPTION],
79452b01e16Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7954b0ead49Smrg
79652b01e16Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7974b0ead49Smrg
79852b01e16Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
79952b01e16Smrg# Free Software Foundation, Inc.
80052b01e16Smrg#
80152b01e16Smrg# This file is free software; the Free Software Foundation
80252b01e16Smrg# gives unlimited permission to copy and/or distribute it,
80352b01e16Smrg# with or without modifications, as long as this notice is preserved.
8044b0ead49Smrg
80552b01e16Smrg# serial 5
8064b0ead49Smrg
80752b01e16Smrg# AM_SANITY_CHECK
80852b01e16Smrg# ---------------
80952b01e16SmrgAC_DEFUN([AM_SANITY_CHECK],
81052b01e16Smrg[AC_MSG_CHECKING([whether build environment is sane])
81152b01e16Smrg# Just in case
81252b01e16Smrgsleep 1
81352b01e16Smrgecho timestamp > conftest.file
81452b01e16Smrg# Reject unsafe characters in $srcdir or the absolute working directory
81552b01e16Smrg# name.  Accept space and tab only in the latter.
81652b01e16Smrgam_lf='
81752b01e16Smrg'
81852b01e16Smrgcase `pwd` in
81952b01e16Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
82052b01e16Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
82152b01e16Smrgesac
82252b01e16Smrgcase $srcdir in
82352b01e16Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
82452b01e16Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
82552b01e16Smrgesac
8264b0ead49Smrg
82752b01e16Smrg# Do `set' in a subshell so we don't clobber the current shell's
82852b01e16Smrg# arguments.  Must try -L first in case configure is actually a
82952b01e16Smrg# symlink; some systems play weird games with the mod time of symlinks
83052b01e16Smrg# (eg FreeBSD returns the mod time of the symlink's containing
83152b01e16Smrg# directory).
83252b01e16Smrgif (
83352b01e16Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
83452b01e16Smrg   if test "$[*]" = "X"; then
83552b01e16Smrg      # -L didn't work.
83652b01e16Smrg      set X `ls -t "$srcdir/configure" conftest.file`
83752b01e16Smrg   fi
83852b01e16Smrg   rm -f conftest.file
83952b01e16Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
84052b01e16Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8414b0ead49Smrg
84252b01e16Smrg      # If neither matched, then we have a broken ls.  This can happen
84352b01e16Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
84452b01e16Smrg      # broken ls alias from the environment.  This has actually
84552b01e16Smrg      # happened.  Such a system could not be considered "sane".
84652b01e16Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
84752b01e16Smrgalias in your environment])
84852b01e16Smrg   fi
8494b0ead49Smrg
85052b01e16Smrg   test "$[2]" = conftest.file
85152b01e16Smrg   )
85252b01e16Smrgthen
85352b01e16Smrg   # Ok.
85452b01e16Smrg   :
8554b0ead49Smrgelse
85652b01e16Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
85752b01e16SmrgCheck your system clock])
85852b01e16Smrgfi
85952b01e16SmrgAC_MSG_RESULT(yes)])
8604b0ead49Smrg
86152b01e16Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
86252b01e16Smrg#
86352b01e16Smrg# This file is free software; the Free Software Foundation
86452b01e16Smrg# gives unlimited permission to copy and/or distribute it,
86552b01e16Smrg# with or without modifications, as long as this notice is preserved.
8664b0ead49Smrg
86752b01e16Smrg# serial 1
8684b0ead49Smrg
86952b01e16Smrg# AM_SILENT_RULES([DEFAULT])
87052b01e16Smrg# --------------------------
87152b01e16Smrg# Enable less verbose build rules; with the default set to DEFAULT
87252b01e16Smrg# (`yes' being less verbose, `no' or empty being verbose).
87352b01e16SmrgAC_DEFUN([AM_SILENT_RULES],
87452b01e16Smrg[AC_ARG_ENABLE([silent-rules],
87552b01e16Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
87652b01e16Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
87752b01e16Smrgcase $enable_silent_rules in
87852b01e16Smrgyes) AM_DEFAULT_VERBOSITY=0;;
87952b01e16Smrgno)  AM_DEFAULT_VERBOSITY=1;;
88052b01e16Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
88152b01e16Smrgesac
88252b01e16SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
88352b01e16SmrgAM_BACKSLASH='\'
88452b01e16SmrgAC_SUBST([AM_BACKSLASH])dnl
88552b01e16Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
88652b01e16Smrg])
8874b0ead49Smrg
88852b01e16Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
88952b01e16Smrg#
89052b01e16Smrg# This file is free software; the Free Software Foundation
89152b01e16Smrg# gives unlimited permission to copy and/or distribute it,
89252b01e16Smrg# with or without modifications, as long as this notice is preserved.
8934b0ead49Smrg
89452b01e16Smrg# AM_PROG_INSTALL_STRIP
89552b01e16Smrg# ---------------------
89652b01e16Smrg# One issue with vendor `install' (even GNU) is that you can't
89752b01e16Smrg# specify the program used to strip binaries.  This is especially
89852b01e16Smrg# annoying in cross-compiling environments, where the build's strip
89952b01e16Smrg# is unlikely to handle the host's binaries.
90052b01e16Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
90152b01e16Smrg# always use install-sh in `make install-strip', and initialize
90252b01e16Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
90352b01e16SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
90452b01e16Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
90552b01e16Smrg# Installed binaries are usually stripped using `strip' when the user
90652b01e16Smrg# run `make install-strip'.  However `strip' might not be the right
90752b01e16Smrg# tool to use in cross-compilation environments, therefore Automake
90852b01e16Smrg# will honor the `STRIP' environment variable to overrule this program.
90952b01e16Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
91052b01e16Smrgif test "$cross_compiling" != no; then
91152b01e16Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
9124b0ead49Smrgfi
91352b01e16SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
91452b01e16SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9154b0ead49Smrg
91652b01e16Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
91752b01e16Smrg#
91852b01e16Smrg# This file is free software; the Free Software Foundation
91952b01e16Smrg# gives unlimited permission to copy and/or distribute it,
92052b01e16Smrg# with or without modifications, as long as this notice is preserved.
9214b0ead49Smrg
92252b01e16Smrg# serial 2
9234b0ead49Smrg
92452b01e16Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
92552b01e16Smrg# ---------------------------
92652b01e16Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
92752b01e16Smrg# This macro is traced by Automake.
92852b01e16SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9294b0ead49Smrg
93052b01e16Smrg# AM_SUBST_NOTMAKE(VARIABLE)
93152b01e16Smrg# ---------------------------
93252b01e16Smrg# Public sister of _AM_SUBST_NOTMAKE.
93352b01e16SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9344b0ead49Smrg
93552b01e16Smrg# Check how to create a tarball.                            -*- Autoconf -*-
9364b0ead49Smrg
93752b01e16Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
93852b01e16Smrg#
93952b01e16Smrg# This file is free software; the Free Software Foundation
94052b01e16Smrg# gives unlimited permission to copy and/or distribute it,
94152b01e16Smrg# with or without modifications, as long as this notice is preserved.
9424b0ead49Smrg
94352b01e16Smrg# serial 2
94452b01e16Smrg
94552b01e16Smrg# _AM_PROG_TAR(FORMAT)
94652b01e16Smrg# --------------------
94752b01e16Smrg# Check how to create a tarball in format FORMAT.
94852b01e16Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
94952b01e16Smrg#
95052b01e16Smrg# Substitute a variable $(am__tar) that is a command
95152b01e16Smrg# writing to stdout a FORMAT-tarball containing the directory
95252b01e16Smrg# $tardir.
95352b01e16Smrg#     tardir=directory && $(am__tar) > result.tar
95452b01e16Smrg#
95552b01e16Smrg# Substitute a variable $(am__untar) that extract such
95652b01e16Smrg# a tarball read from stdin.
95752b01e16Smrg#     $(am__untar) < result.tar
95852b01e16SmrgAC_DEFUN([_AM_PROG_TAR],
95952b01e16Smrg[# Always define AMTAR for backward compatibility.
96052b01e16SmrgAM_MISSING_PROG([AMTAR], [tar])
96152b01e16Smrgm4_if([$1], [v7],
96252b01e16Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
96352b01e16Smrg     [m4_case([$1], [ustar],, [pax],,
96452b01e16Smrg              [m4_fatal([Unknown tar format])])
96552b01e16SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
96652b01e16Smrg# Loop over all known methods to create a tar archive until one works.
96752b01e16Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
96852b01e16Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
96952b01e16Smrg# Do not fold the above two line into one, because Tru64 sh and
97052b01e16Smrg# Solaris sh will not grok spaces in the rhs of `-'.
97152b01e16Smrgfor _am_tool in $_am_tools
97252b01e16Smrgdo
97352b01e16Smrg  case $_am_tool in
97452b01e16Smrg  gnutar)
97552b01e16Smrg    for _am_tar in tar gnutar gtar;
97652b01e16Smrg    do
97752b01e16Smrg      AM_RUN_LOG([$_am_tar --version]) && break
97852b01e16Smrg    done
97952b01e16Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
98052b01e16Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
98152b01e16Smrg    am__untar="$_am_tar -xf -"
98252b01e16Smrg    ;;
98352b01e16Smrg  plaintar)
98452b01e16Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
98552b01e16Smrg    # ustar tarball either.
98652b01e16Smrg    (tar --version) >/dev/null 2>&1 && continue
98752b01e16Smrg    am__tar='tar chf - "$$tardir"'
98852b01e16Smrg    am__tar_='tar chf - "$tardir"'
98952b01e16Smrg    am__untar='tar xf -'
99052b01e16Smrg    ;;
99152b01e16Smrg  pax)
99252b01e16Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
99352b01e16Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
99452b01e16Smrg    am__untar='pax -r'
99552b01e16Smrg    ;;
99652b01e16Smrg  cpio)
99752b01e16Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
99852b01e16Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
99952b01e16Smrg    am__untar='cpio -i -H $1 -d'
100052b01e16Smrg    ;;
100152b01e16Smrg  none)
100252b01e16Smrg    am__tar=false
100352b01e16Smrg    am__tar_=false
100452b01e16Smrg    am__untar=false
10054b0ead49Smrg    ;;
10064b0ead49Smrg  esac
10074b0ead49Smrg
100852b01e16Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
100952b01e16Smrg  # and am__untar set.
101052b01e16Smrg  test -n "${am_cv_prog_tar_$1}" && break
10114b0ead49Smrg
101252b01e16Smrg  # tar/untar a dummy directory, and stop if the command works
101352b01e16Smrg  rm -rf conftest.dir
101452b01e16Smrg  mkdir conftest.dir
101552b01e16Smrg  echo GrepMe > conftest.dir/file
101652b01e16Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
101752b01e16Smrg  rm -rf conftest.dir
101852b01e16Smrg  if test -s conftest.tar; then
101952b01e16Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
102052b01e16Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
102152b01e16Smrg  fi
102252b01e16Smrgdone
102352b01e16Smrgrm -rf conftest.dir
10244b0ead49Smrg
102552b01e16SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
102652b01e16SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
102752b01e16SmrgAC_SUBST([am__tar])
102852b01e16SmrgAC_SUBST([am__untar])
102952b01e16Smrg]) # _AM_PROG_TAR
10304b0ead49Smrg
103152b01e16Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
103252b01e16Smrgdnl
103352b01e16Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
103452b01e16Smrgdnl 
103552b01e16Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
103652b01e16Smrgdnl copy of this software and associated documentation files (the
103752b01e16Smrgdnl "Software"), to deal in the Software without restriction, including
103852b01e16Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
103952b01e16Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
104052b01e16Smrgdnl to whom the Software is furnished to do so, provided that the above
104152b01e16Smrgdnl copyright notice(s) and this permission notice appear in all copies of
104252b01e16Smrgdnl the Software and that both the above copyright notice(s) and this
104352b01e16Smrgdnl permission notice appear in supporting documentation.
104452b01e16Smrgdnl
104552b01e16Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
104652b01e16Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
104752b01e16Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
104852b01e16Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
104952b01e16Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
105052b01e16Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
105152b01e16Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
105252b01e16Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
105352b01e16Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
105452b01e16Smrgdnl
105552b01e16Smrgdnl Except as contained in this notice, the name of a copyright holder
105652b01e16Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
105752b01e16Smrgdnl or other dealings in this Software without prior written authorization
105852b01e16Smrgdnl of the copyright holder.
10594b0ead49Smrg
106052b01e16Smrg# XORG_MACROS_VERSION(required-version)
106152b01e16Smrg# -------------------------------------
106252b01e16Smrg# Minimum version: 1.1.0
106352b01e16Smrg#
106452b01e16Smrg# If you're using a macro added in Version 1.1 or newer, include this in
106552b01e16Smrg# your configure.ac with the minimum required version, such as:
106652b01e16Smrg# XORG_MACROS_VERSION(1.1)
106752b01e16Smrg#
106852b01e16Smrg# To ensure that this macro is defined, also add:
106952b01e16Smrg# m4_ifndef([XORG_MACROS_VERSION],
107052b01e16Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
107152b01e16Smrg#
107252b01e16Smrg#
107352b01e16Smrg# See the "minimum version" comment for each macro you use to see what 
107452b01e16Smrg# version you require.
107552b01e16Smrgm4_defun([XORG_MACROS_VERSION],[
107652b01e16Smrgm4_define([vers_have], [1.3.0])
107752b01e16Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
107852b01e16Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
107952b01e16Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
108052b01e16Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
108152b01e16Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
108252b01e16Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
108352b01e16Smrgm4_undefine([vers_have])
108452b01e16Smrgm4_undefine([maj_have])
108552b01e16Smrgm4_undefine([maj_needed])
108652b01e16Smrg]) # XORG_MACROS_VERSION
10874b0ead49Smrg
108852b01e16Smrg# XORG_PROG_RAWCPP()
108952b01e16Smrg# ------------------
109052b01e16Smrg# Minimum version: 1.0.0
109152b01e16Smrg#
109252b01e16Smrg# Find cpp program and necessary flags for use in pre-processing text files
109352b01e16Smrg# such as man pages and config files
109452b01e16SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
109552b01e16SmrgAC_REQUIRE([AC_PROG_CPP])
109652b01e16SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
109752b01e16Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10984b0ead49Smrg
109952b01e16Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
110052b01e16Smrg# which is not the best choice for supporting other OS'es, but covers most
110152b01e16Smrg# of the ones we need for now.
110252b01e16SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
110352b01e16SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
110452b01e16Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
110552b01e16Smrg	AC_MSG_RESULT([no])
110652b01e16Smrgelse
110752b01e16Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
110852b01e16Smrg		RAWCPPFLAGS=-undef
110952b01e16Smrg		AC_MSG_RESULT([yes])
111052b01e16Smrg	# under Cygwin unix is still defined even with -undef
111152b01e16Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
111252b01e16Smrg		RAWCPPFLAGS="-undef -ansi"
111352b01e16Smrg		AC_MSG_RESULT([yes, with -ansi])
111452b01e16Smrg	else
111552b01e16Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
111652b01e16Smrg	fi
111752b01e16Smrgfi
111852b01e16Smrgrm -f conftest.$ac_ext
11194b0ead49Smrg
112052b01e16SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
112152b01e16SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
112252b01e16Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
112352b01e16Smrg	AC_MSG_RESULT([no])
112452b01e16Smrgelse
112552b01e16Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
112652b01e16Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
112752b01e16Smrg		AC_MSG_RESULT([yes])
112852b01e16Smrg	else
112952b01e16Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
113052b01e16Smrg	fi
11314b0ead49Smrgfi
113252b01e16Smrgrm -f conftest.$ac_ext
113352b01e16SmrgAC_SUBST(RAWCPPFLAGS)
113452b01e16Smrg]) # XORG_PROG_RAWCPP
11354b0ead49Smrg
113652b01e16Smrg# XORG_MANPAGE_SECTIONS()
113752b01e16Smrg# -----------------------
113852b01e16Smrg# Minimum version: 1.0.0
113952b01e16Smrg#
114052b01e16Smrg# Determine which sections man pages go in for the different man page types
114152b01e16Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
114252b01e16Smrg# Not sure if there's any better way than just hardcoding by OS name.
114352b01e16Smrg# Override default settings by setting environment variables
11444b0ead49Smrg
114552b01e16SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
114652b01e16SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11474b0ead49Smrg
114852b01e16Smrgif test x$APP_MAN_SUFFIX = x    ; then
114952b01e16Smrg    APP_MAN_SUFFIX=1
115052b01e16Smrgfi
115152b01e16Smrgif test x$APP_MAN_DIR = x    ; then
115252b01e16Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
115352b01e16Smrgfi
11544b0ead49Smrg
115552b01e16Smrgif test x$LIB_MAN_SUFFIX = x    ; then
115652b01e16Smrg    LIB_MAN_SUFFIX=3
115752b01e16Smrgfi
115852b01e16Smrgif test x$LIB_MAN_DIR = x    ; then
115952b01e16Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
116052b01e16Smrgfi
11614b0ead49Smrg
116252b01e16Smrgif test x$FILE_MAN_SUFFIX = x    ; then
116352b01e16Smrg    case $host_os in
116452b01e16Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
116552b01e16Smrg	*)		FILE_MAN_SUFFIX=5  ;;
116652b01e16Smrg    esac
116752b01e16Smrgfi
116852b01e16Smrgif test x$FILE_MAN_DIR = x    ; then
116952b01e16Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
117052b01e16Smrgfi
11714b0ead49Smrg
117252b01e16Smrgif test x$MISC_MAN_SUFFIX = x    ; then
117352b01e16Smrg    case $host_os in
117452b01e16Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
117552b01e16Smrg	*)		MISC_MAN_SUFFIX=7  ;;
117652b01e16Smrg    esac
117752b01e16Smrgfi
117852b01e16Smrgif test x$MISC_MAN_DIR = x    ; then
117952b01e16Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11804b0ead49Smrgfi
11814b0ead49Smrg
118252b01e16Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
118352b01e16Smrg    case $host_os in
118452b01e16Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
118552b01e16Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
118652b01e16Smrg    esac
118752b01e16Smrgfi
118852b01e16Smrgif test x$DRIVER_MAN_DIR = x    ; then
118952b01e16Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
119052b01e16Smrgfi
11914b0ead49Smrg
119252b01e16Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
119352b01e16Smrg    case $host_os in
119452b01e16Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
119552b01e16Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
119652b01e16Smrg    esac
119752b01e16Smrgfi
119852b01e16Smrgif test x$ADMIN_MAN_DIR = x    ; then
119952b01e16Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
12004b0ead49Smrgfi
12014b0ead49Smrg
12024b0ead49Smrg
120352b01e16SmrgAC_SUBST([APP_MAN_SUFFIX])
120452b01e16SmrgAC_SUBST([LIB_MAN_SUFFIX])
120552b01e16SmrgAC_SUBST([FILE_MAN_SUFFIX])
120652b01e16SmrgAC_SUBST([MISC_MAN_SUFFIX])
120752b01e16SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
120852b01e16SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
120952b01e16SmrgAC_SUBST([APP_MAN_DIR])
121052b01e16SmrgAC_SUBST([LIB_MAN_DIR])
121152b01e16SmrgAC_SUBST([FILE_MAN_DIR])
121252b01e16SmrgAC_SUBST([MISC_MAN_DIR])
121352b01e16SmrgAC_SUBST([DRIVER_MAN_DIR])
121452b01e16SmrgAC_SUBST([ADMIN_MAN_DIR])
121552b01e16Smrg]) # XORG_MANPAGE_SECTIONS
12164b0ead49Smrg
121752b01e16Smrg# XORG_CHECK_LINUXDOC
121852b01e16Smrg# -------------------
121952b01e16Smrg# Minimum version: 1.0.0
122052b01e16Smrg#
122152b01e16Smrg# Defines the variable MAKE_TEXT if the necessary tools and
122252b01e16Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
122352b01e16Smrg# Whether or not the necessary tools and files are found can be checked
122452b01e16Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
122552b01e16SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
122652b01e16Smrgif test x$XORG_SGML_PATH = x ; then
122752b01e16Smrg    XORG_SGML_PATH=$prefix/share/sgml
122852b01e16Smrgfi
122952b01e16SmrgHAVE_DEFS_ENT=
123052b01e16Smrg
123152b01e16Smrgif test x"$cross_compiling" = x"yes" ; then
123252b01e16Smrg  HAVE_DEFS_ENT=no
12334b0ead49Smrgelse
123452b01e16Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12354b0ead49Smrgfi
12364b0ead49Smrg
123752b01e16SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
123852b01e16SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
12394b0ead49Smrg
124052b01e16SmrgAC_MSG_CHECKING([Whether to build documentation])
12414b0ead49Smrg
124252b01e16Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
124352b01e16Smrg   BUILDDOC=yes
12444b0ead49Smrgelse
124552b01e16Smrg   BUILDDOC=no
12464b0ead49Smrgfi
12474b0ead49Smrg
124852b01e16SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12494b0ead49Smrg
125052b01e16SmrgAC_MSG_RESULT([$BUILDDOC])
125152b01e16Smrg
125252b01e16SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
125352b01e16Smrg
125452b01e16Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
125552b01e16Smrg   BUILDPDFDOC=yes
12564b0ead49Smrgelse
125752b01e16Smrg   BUILDPDFDOC=no
12584b0ead49Smrgfi
12594b0ead49Smrg
126052b01e16SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
12614b0ead49Smrg
126252b01e16SmrgAC_MSG_RESULT([$BUILDPDFDOC])
12634b0ead49Smrg
126452b01e16SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
126552b01e16SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
126652b01e16SmrgMAKE_PDF="$PS2PDF"
126752b01e16SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
12684b0ead49Smrg
126952b01e16SmrgAC_SUBST(MAKE_TEXT)
127052b01e16SmrgAC_SUBST(MAKE_PS)
127152b01e16SmrgAC_SUBST(MAKE_PDF)
127252b01e16SmrgAC_SUBST(MAKE_HTML)
127352b01e16Smrg]) # XORG_CHECK_LINUXDOC
12744b0ead49Smrg
127552b01e16Smrg# XORG_CHECK_DOCBOOK
127652b01e16Smrg# -------------------
127752b01e16Smrg# Minimum version: 1.0.0
127852b01e16Smrg#
127952b01e16Smrg# Checks for the ability to build output formats from SGML DocBook source.
128052b01e16Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
128152b01e16Smrg# indicates whether the necessary tools and files are found and, if set,
128252b01e16Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
128352b01e16SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
128452b01e16Smrgif test x$XORG_SGML_PATH = x ; then
128552b01e16Smrg    XORG_SGML_PATH=$prefix/share/sgml
128652b01e16Smrgfi
128752b01e16SmrgHAVE_DEFS_ENT=
128852b01e16SmrgBUILDTXTDOC=no
128952b01e16SmrgBUILDPDFDOC=no
129052b01e16SmrgBUILDPSDOC=no
129152b01e16SmrgBUILDHTMLDOC=no
12924b0ead49Smrg
129352b01e16SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12944b0ead49Smrg
129552b01e16SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
129652b01e16SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
129752b01e16SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
129852b01e16SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
12994b0ead49Smrg
130052b01e16SmrgAC_MSG_CHECKING([Whether to build text documentation])
130152b01e16Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
130252b01e16Smrg   test x$BUILD_TXTDOC != xno; then
130352b01e16Smrg	BUILDTXTDOC=yes
130452b01e16Smrgfi
130552b01e16SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
130652b01e16SmrgAC_MSG_RESULT([$BUILDTXTDOC])
13074b0ead49Smrg
130852b01e16SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
130952b01e16Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
131052b01e16Smrg   test x$BUILD_PDFDOC != xno; then
131152b01e16Smrg	BUILDPDFDOC=yes
131252b01e16Smrgfi
131352b01e16SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
131452b01e16SmrgAC_MSG_RESULT([$BUILDPDFDOC])
13154b0ead49Smrg
131652b01e16SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
131752b01e16Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
131852b01e16Smrg   test x$BUILD_PSDOC != xno; then
131952b01e16Smrg	BUILDPSDOC=yes
132052b01e16Smrgfi
132152b01e16SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
132252b01e16SmrgAC_MSG_RESULT([$BUILDPSDOC])
13234b0ead49Smrg
132452b01e16SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
132552b01e16Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
132652b01e16Smrg   test x$BUILD_HTMLDOC != xno; then
132752b01e16Smrg	BUILDHTMLDOC=yes
132852b01e16Smrgfi
132952b01e16SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
133052b01e16SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13314b0ead49Smrg
133252b01e16SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
133352b01e16SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
133452b01e16SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
133552b01e16SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13364b0ead49Smrg
133752b01e16SmrgAC_SUBST(MAKE_TEXT)
133852b01e16SmrgAC_SUBST(MAKE_PS)
133952b01e16SmrgAC_SUBST(MAKE_PDF)
134052b01e16SmrgAC_SUBST(MAKE_HTML)
134152b01e16Smrg]) # XORG_CHECK_DOCBOOK
13424b0ead49Smrg
134352b01e16Smrg# XORG_CHECK_MALLOC_ZERO
134452b01e16Smrg# ----------------------
134552b01e16Smrg# Minimum version: 1.0.0
134652b01e16Smrg#
134752b01e16Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
134852b01e16Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
134952b01e16Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
135052b01e16SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
135152b01e16SmrgAC_ARG_ENABLE(malloc0returnsnull,
135252b01e16Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
135352b01e16Smrg		       [malloc(0) returns NULL (default: auto)]),
135452b01e16Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
135552b01e16Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
13564b0ead49Smrg
135752b01e16SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
135852b01e16Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
135952b01e16Smrg	AC_RUN_IFELSE([
136052b01e16Smrgchar *malloc();
136152b01e16Smrgchar *realloc();
136252b01e16Smrgchar *calloc();
136352b01e16Smrgmain() {
136452b01e16Smrg    char *m0, *r0, *c0, *p;
136552b01e16Smrg    m0 = malloc(0);
136652b01e16Smrg    p = malloc(10);
136752b01e16Smrg    r0 = realloc(p,0);
136852b01e16Smrg    c0 = calloc(0);
136952b01e16Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
137052b01e16Smrg}],
137152b01e16Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
137252b01e16Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
137352b01e16Smrgfi
137452b01e16SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
13754b0ead49Smrg
137652b01e16Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
137752b01e16Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
137852b01e16Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
137952b01e16Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
138052b01e16Smrgelse
138152b01e16Smrg	MALLOC_ZERO_CFLAGS=""
138252b01e16Smrg	XMALLOC_ZERO_CFLAGS=""
138352b01e16Smrg	XTMALLOC_ZERO_CFLAGS=""
138452b01e16Smrgfi
13854b0ead49Smrg
138652b01e16SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
138752b01e16SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
138852b01e16SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
138952b01e16Smrg]) # XORG_CHECK_MALLOC_ZERO
13904b0ead49Smrg
139152b01e16Smrg# XORG_WITH_LINT()
139252b01e16Smrg# ----------------
139352b01e16Smrg# Minimum version: 1.1.0
139452b01e16Smrg#
139552b01e16Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
139652b01e16Smrg# is specified.   (Use --with-lint=sparse for sparse.)
139752b01e16Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
139852b01e16Smrg# Sets $LINT_FLAGS to flags to pass to source checker
139952b01e16Smrg# Sets LINT automake conditional if enabled (default: disabled)
140052b01e16Smrg#
140152b01e16SmrgAC_DEFUN([XORG_WITH_LINT],[
140252b01e16Smrg
140352b01e16Smrg# Allow checking code with lint, sparse, etc.
140452b01e16SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
140552b01e16Smrg		[Use a lint-style source code checker (default: disabled)])],
140652b01e16Smrg		[use_lint=$withval], [use_lint=no])
140752b01e16Smrgif test "x$use_lint" = "xyes" ; then
140852b01e16Smrg	LINT="lint"
140952b01e16Smrgelse
141052b01e16Smrg	LINT="$use_lint"
141152b01e16Smrgfi
141252b01e16Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
141352b01e16Smrg    case $LINT in
141452b01e16Smrg	lint|*/lint)
141552b01e16Smrg	    case $host_os in
141652b01e16Smrg		solaris*)
141752b01e16Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
141852b01e16Smrg			;;
141952b01e16Smrg	    esac
142052b01e16Smrg	    ;;
14214b0ead49Smrg    esac
142252b01e16Smrgfi
14234b0ead49Smrg
142452b01e16SmrgAC_SUBST(LINT)
142552b01e16SmrgAC_SUBST(LINT_FLAGS)
142652b01e16SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
14274b0ead49Smrg
142852b01e16Smrg]) # XORG_WITH_LINT
14294b0ead49Smrg
143052b01e16Smrg# XORG_LINT_LIBRARY(LIBNAME)
143152b01e16Smrg# --------------------------
143252b01e16Smrg# Minimum version: 1.1.0
143352b01e16Smrg#
143452b01e16Smrg# Sets up flags for building lint libraries for checking programs that call
143552b01e16Smrg# functions in the library.
143652b01e16Smrg# Disabled by default, enable with --enable-lint-library
143752b01e16Smrg# Sets: 
143852b01e16Smrg#	@LINTLIB@		- name of lint library file to make
143952b01e16Smrg#	MAKE_LINT_LIB		- automake conditional
144052b01e16Smrg#
14414b0ead49Smrg
144252b01e16SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
144352b01e16SmrgAC_REQUIRE([XORG_WITH_LINT])
144452b01e16Smrg# Build lint "library" for more indepth checks of programs calling this library
144552b01e16SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
144652b01e16Smrg	[Create lint library (default: disabled)])],
144752b01e16Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
144852b01e16Smrgif test "x$make_lint_lib" != "xno" ; then
144952b01e16Smrg	if test "x$LINT" = "xno" ; then
145052b01e16Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
145152b01e16Smrg	fi
145252b01e16Smrg	if test "x$make_lint_lib" = "xyes" ; then
145352b01e16Smrg		LINTLIB=llib-l$1.ln
145452b01e16Smrg	else
145552b01e16Smrg		LINTLIB=$make_lint_lib
145652b01e16Smrg	fi
145752b01e16Smrgfi
145852b01e16SmrgAC_SUBST(LINTLIB)
145952b01e16SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
14604b0ead49Smrg
146152b01e16Smrg]) # XORG_LINT_LIBRARY
14624b0ead49Smrg
146352b01e16Smrg# XORG_CWARNFLAGS
146452b01e16Smrg# ---------------
146552b01e16Smrg# Minimum version: 1.2.0
146652b01e16Smrg#
146752b01e16Smrg# Defines CWARNFLAGS to enable C compiler warnings.
146852b01e16Smrg#
146952b01e16SmrgAC_DEFUN([XORG_CWARNFLAGS], [
147052b01e16SmrgAC_REQUIRE([AC_PROG_CC])
147152b01e16Smrgif  test "x$GCC" = xyes ; then
147252b01e16Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
147352b01e16Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
147452b01e16Smrg-Wbad-function-cast"
147552b01e16Smrg    case `$CC -dumpversion` in
147652b01e16Smrg    3.4.* | 4.*)
147752b01e16Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
147852b01e16Smrg	;;
147952b01e16Smrg    esac
148052b01e16Smrgelse
148152b01e16Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
148252b01e16Smrg    if test "x$SUNCC" = "xyes"; then
148352b01e16Smrg	CWARNFLAGS="-v"
148452b01e16Smrg    fi
148552b01e16Smrgfi
148652b01e16SmrgAC_SUBST(CWARNFLAGS)
148752b01e16Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
148852b01e16Smrg]) # XORG_CWARNFLAGS
14894b0ead49Smrg
149052b01e16Smrg# XORG_STRICT_OPTION
149152b01e16Smrg# -----------------------
149252b01e16Smrg# Minimum version: 1.3.0
149352b01e16Smrg#
149452b01e16Smrg# Add configure option to enable strict compilation
149552b01e16SmrgAC_DEFUN([XORG_STRICT_OPTION], [
149652b01e16SmrgAC_REQUIRE([AC_PROG_CC])
149752b01e16SmrgAC_REQUIRE([AC_PROG_CC_C99])
149852b01e16SmrgAC_REQUIRE([XORG_CWARNFLAGS])
149952b01e16Smrg
150052b01e16SmrgAC_ARG_ENABLE(strict-compilation,
150152b01e16Smrg			  AS_HELP_STRING([--enable-strict-compilation],
150252b01e16Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
150352b01e16Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
150452b01e16Smrgif test "x$STRICT_COMPILE" = "xyes"; then
150552b01e16Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
150652b01e16Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
150752b01e16Smrg	if test "x$GCC" = xyes ; then
150852b01e16Smrg		STRICT_CFLAGS="-pedantic -Werror"
150952b01e16Smrg	elif test "x$SUNCC" = "xyes"; then
151052b01e16Smrg		STRICT_CFLAGS="-errwarn"
151152b01e16Smrg    elif test "x$INTELCC" = "xyes"; then
151252b01e16Smrg		STRICT_CFLAGS="-Werror"
151352b01e16Smrg	fi
151452b01e16Smrgfi
151552b01e16SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
151652b01e16SmrgAC_SUBST([CWARNFLAGS])
151752b01e16Smrg]) # XORG_STRICT_OPTION
15184b0ead49Smrg
151952b01e16Smrg# XORG_DEFAULT_OPTIONS
152052b01e16Smrg# --------------------
152152b01e16Smrg# Minimum version: 1.3.0
152252b01e16Smrg#
152352b01e16Smrg# Defines default options for X.Org modules.
152452b01e16Smrg#
152552b01e16SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
152652b01e16SmrgXORG_CWARNFLAGS
152752b01e16SmrgXORG_STRICT_OPTION
152852b01e16SmrgXORG_RELEASE_VERSION
152952b01e16SmrgXORG_CHANGELOG
153052b01e16SmrgXORG_MANPAGE_SECTIONS
153152b01e16Smrg]) # XORG_DEFAULT_OPTIONS
153252b01e16Smrgdnl Copyright 2005 Red Hat, Inc
153352b01e16Smrgdnl
153452b01e16Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
153552b01e16Smrgdnl documentation for any purpose is hereby granted without fee, provided that
153652b01e16Smrgdnl the above copyright notice appear in all copies and that both that
153752b01e16Smrgdnl copyright notice and this permission notice appear in supporting
153852b01e16Smrgdnl documentation.
153952b01e16Smrgdnl
154052b01e16Smrgdnl The above copyright notice and this permission notice shall be included
154152b01e16Smrgdnl in all copies or substantial portions of the Software.
154252b01e16Smrgdnl
154352b01e16Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
154452b01e16Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
154552b01e16Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
154652b01e16Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
154752b01e16Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
154852b01e16Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
154952b01e16Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
155052b01e16Smrgdnl
155152b01e16Smrgdnl Except as contained in this notice, the name of the copyright holders shall
155252b01e16Smrgdnl not be used in advertising or otherwise to promote the sale, use or
155352b01e16Smrgdnl other dealings in this Software without prior written authorization
155452b01e16Smrgdnl from the copyright holders.
155552b01e16Smrgdnl
15564b0ead49Smrg
155752b01e16Smrg# XORG_RELEASE_VERSION
155852b01e16Smrg# --------------------
155952b01e16Smrg# Adds --with/without-release-string and changes the PACKAGE and
156052b01e16Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
156152b01e16Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
156252b01e16Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
156352b01e16Smrg 
156452b01e16SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
156552b01e16Smrg	AC_ARG_WITH(release-version,
156652b01e16Smrg			AS_HELP_STRING([--with-release-version=STRING],
156752b01e16Smrg				[Use release version string in package name]),
156852b01e16Smrg			[RELEASE_VERSION="$withval"],
156952b01e16Smrg			[RELEASE_VERSION=""])
157052b01e16Smrg	if test "x$RELEASE_VERSION" != "x"; then
157152b01e16Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
157252b01e16Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
157352b01e16Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
157452b01e16Smrg	fi
157552b01e16Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
157652b01e16Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
157752b01e16Smrg		[Major version of this package])
157852b01e16Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
157952b01e16Smrg	if test "x$PVM" = "x"; then
158052b01e16Smrg		PVM="0"
158152b01e16Smrg	fi
158252b01e16Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
158352b01e16Smrg		[$PVM],
158452b01e16Smrg		[Minor version of this package])
158552b01e16Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
158652b01e16Smrg	if test "x$PVP" = "x"; then
158752b01e16Smrg		PVP="0"
158852b01e16Smrg	fi
158952b01e16Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
159052b01e16Smrg		[$PVP],
159152b01e16Smrg		[Patch version of this package])
159252b01e16Smrg])
15934b0ead49Smrg
159452b01e16Smrg# XORG_CHANGELOG()
159552b01e16Smrg# ----------------
159652b01e16Smrg# Minimum version: 1.2.0
159752b01e16Smrg#
159852b01e16Smrg# Defines the variable CHANGELOG_CMD as the command to generate
159952b01e16Smrg# ChangeLog from git.
160052b01e16Smrg#
160152b01e16Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
160252b01e16Smrg#
160352b01e16SmrgAC_DEFUN([XORG_CHANGELOG], [
160452b01e16SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
160552b01e16Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
160652b01e16Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
160752b01e16SmrgAC_SUBST([CHANGELOG_CMD])
160852b01e16SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
160952b01e16Smrg]) # XORG_CHANGELOG
16104b0ead49Smrg
161152b01e16Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
16124b0ead49Smrg
161352b01e16Smrg# serial 52 AC_PROG_LIBTOOL
16144b0ead49Smrg
16154b0ead49Smrg
161652b01e16Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
161752b01e16Smrg# -----------------------------------------------------------
161852b01e16Smrg# If this macro is not defined by Autoconf, define it here.
161952b01e16Smrgm4_ifdef([AC_PROVIDE_IFELSE],
162052b01e16Smrg         [],
162152b01e16Smrg         [m4_define([AC_PROVIDE_IFELSE],
162252b01e16Smrg	         [m4_ifdef([AC_PROVIDE_$1],
162352b01e16Smrg		           [$2], [$3])])])
16244b0ead49Smrg
16254b0ead49Smrg
162652b01e16Smrg# AC_PROG_LIBTOOL
162752b01e16Smrg# ---------------
162852b01e16SmrgAC_DEFUN([AC_PROG_LIBTOOL],
162952b01e16Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
163052b01e16Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
163152b01e16Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
163252b01e16Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
163352b01e16Smrg    [AC_LIBTOOL_CXX],
163452b01e16Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
163552b01e16Smrg  ])])
163652b01e16Smrgdnl And a similar setup for Fortran 77 support
163752b01e16Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
163852b01e16Smrg    [AC_LIBTOOL_F77],
163952b01e16Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
164052b01e16Smrg])])
16414b0ead49Smrg
164252b01e16Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
164352b01e16Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
164452b01e16Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
164552b01e16Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
164652b01e16Smrg    [AC_LIBTOOL_GCJ],
164752b01e16Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
164852b01e16Smrg      [AC_LIBTOOL_GCJ],
164952b01e16Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
165052b01e16Smrg	[AC_LIBTOOL_GCJ],
165152b01e16Smrg      [ifdef([AC_PROG_GCJ],
165252b01e16Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
165352b01e16Smrg       ifdef([A][M_PROG_GCJ],
165452b01e16Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
165552b01e16Smrg       ifdef([LT_AC_PROG_GCJ],
165652b01e16Smrg	     [define([LT_AC_PROG_GCJ],
165752b01e16Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
165852b01e16Smrg])])# AC_PROG_LIBTOOL
16594b0ead49Smrg
16604b0ead49Smrg
166152b01e16Smrg# _AC_PROG_LIBTOOL
16624b0ead49Smrg# ----------------
166352b01e16SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
166452b01e16Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
166552b01e16SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
166652b01e16SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
166752b01e16SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
16684b0ead49Smrg
166952b01e16Smrg# This can be used to rebuild libtool when needed
167052b01e16SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
16714b0ead49Smrg
167252b01e16Smrg# Always use our own libtool.
167352b01e16SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
167452b01e16SmrgAC_SUBST(LIBTOOL)dnl
16754b0ead49Smrg
167652b01e16Smrg# Prevent multiple expansion
167752b01e16Smrgdefine([AC_PROG_LIBTOOL], [])
167852b01e16Smrg])# _AC_PROG_LIBTOOL
16794b0ead49Smrg
16804b0ead49Smrg
168152b01e16Smrg# AC_LIBTOOL_SETUP
168252b01e16Smrg# ----------------
168352b01e16SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
168452b01e16Smrg[AC_PREREQ(2.50)dnl
168552b01e16SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
168652b01e16SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
168752b01e16SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
168852b01e16SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
168952b01e16SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
169052b01e16SmrgAC_REQUIRE([AC_PROG_CC])dnl
169152b01e16SmrgAC_REQUIRE([AC_PROG_LD])dnl
169252b01e16SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
169352b01e16SmrgAC_REQUIRE([AC_PROG_NM])dnl
16944b0ead49Smrg
169552b01e16SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
169652b01e16SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
169752b01e16Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
169852b01e16SmrgAC_REQUIRE([AC_OBJEXT])dnl
169952b01e16SmrgAC_REQUIRE([AC_EXEEXT])dnl
170052b01e16Smrgdnl
170152b01e16SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
170252b01e16SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
170352b01e16SmrgAC_LIBTOOL_OBJDIR
17044b0ead49Smrg
170552b01e16SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
170652b01e16Smrg_LT_AC_PROG_ECHO_BACKSLASH
17074b0ead49Smrg
170852b01e16Smrgcase $host_os in
170952b01e16Smrgaix3*)
171052b01e16Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
171152b01e16Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
171252b01e16Smrg  # vanish in a puff of smoke.
171352b01e16Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
171452b01e16Smrg    COLLECT_NAMES=
171552b01e16Smrg    export COLLECT_NAMES
171652b01e16Smrg  fi
171752b01e16Smrg  ;;
171852b01e16Smrgesac
17194b0ead49Smrg
172052b01e16Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
172152b01e16Smrg# metacharacters that are still active within double-quoted strings.
172252b01e16SmrgXsed='sed -e 1s/^X//'
172352b01e16Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
17244b0ead49Smrg
172552b01e16Smrg# Same as above, but do not quote variable references.
172652b01e16Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
17274b0ead49Smrg
172852b01e16Smrg# Sed substitution to delay expansion of an escaped shell variable in a
172952b01e16Smrg# double_quote_subst'ed string.
173052b01e16Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
17314b0ead49Smrg
173252b01e16Smrg# Sed substitution to avoid accidental globbing in evaled expressions
173352b01e16Smrgno_glob_subst='s/\*/\\\*/g'
17344b0ead49Smrg
173552b01e16Smrg# Constants:
173652b01e16Smrgrm="rm -f"
17374b0ead49Smrg
173852b01e16Smrg# Global variables:
173952b01e16Smrgdefault_ofile=libtool
174052b01e16Smrgcan_build_shared=yes
17414b0ead49Smrg
174252b01e16Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
174352b01e16Smrg# which needs '.lib').
174452b01e16Smrglibext=a
174552b01e16Smrgltmain="$ac_aux_dir/ltmain.sh"
174652b01e16Smrgofile="$default_ofile"
174752b01e16Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
17484b0ead49Smrg
174952b01e16SmrgAC_CHECK_TOOL(AR, ar, false)
175052b01e16SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
175152b01e16SmrgAC_CHECK_TOOL(STRIP, strip, :)
17524b0ead49Smrg
175352b01e16Smrgold_CC="$CC"
175452b01e16Smrgold_CFLAGS="$CFLAGS"
17554b0ead49Smrg
175652b01e16Smrg# Set sane defaults for various variables
175752b01e16Smrgtest -z "$AR" && AR=ar
175852b01e16Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
175952b01e16Smrgtest -z "$AS" && AS=as
176052b01e16Smrgtest -z "$CC" && CC=cc
176152b01e16Smrgtest -z "$LTCC" && LTCC=$CC
176252b01e16Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
176352b01e16Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
176452b01e16Smrgtest -z "$LD" && LD=ld
176552b01e16Smrgtest -z "$LN_S" && LN_S="ln -s"
176652b01e16Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
176752b01e16Smrgtest -z "$NM" && NM=nm
176852b01e16Smrgtest -z "$SED" && SED=sed
176952b01e16Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
177052b01e16Smrgtest -z "$RANLIB" && RANLIB=:
177152b01e16Smrgtest -z "$STRIP" && STRIP=:
177252b01e16Smrgtest -z "$ac_objext" && ac_objext=o
17734b0ead49Smrg
177452b01e16Smrg# Determine commands to create old-style static archives.
177552b01e16Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
177652b01e16Smrgold_postinstall_cmds='chmod 644 $oldlib'
177752b01e16Smrgold_postuninstall_cmds=
17784b0ead49Smrg
177952b01e16Smrgif test -n "$RANLIB"; then
178052b01e16Smrg  case $host_os in
178152b01e16Smrg  openbsd*)
178252b01e16Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
178352b01e16Smrg    ;;
178452b01e16Smrg  *)
178552b01e16Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
178652b01e16Smrg    ;;
178752b01e16Smrg  esac
178852b01e16Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
178952b01e16Smrgfi
17904b0ead49Smrg
179152b01e16Smrg_LT_CC_BASENAME([$compiler])
17924b0ead49Smrg
179352b01e16Smrg# Only perform the check for file, if the check method requires it
179452b01e16Smrgcase $deplibs_check_method in
179552b01e16Smrgfile_magic*)
179652b01e16Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
179752b01e16Smrg    AC_PATH_MAGIC
179852b01e16Smrg  fi
179952b01e16Smrg  ;;
180052b01e16Smrgesac
18014b0ead49Smrg
180252b01e16Smrg_LT_REQUIRED_DARWIN_CHECKS
18034b0ead49Smrg
180452b01e16SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
180552b01e16SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
180652b01e16Smrgenable_win32_dll=yes, enable_win32_dll=no)
18074b0ead49Smrg
180852b01e16SmrgAC_ARG_ENABLE([libtool-lock],
180952b01e16Smrg    [AC_HELP_STRING([--disable-libtool-lock],
181052b01e16Smrg	[avoid locking (might break parallel builds)])])
181152b01e16Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
18124b0ead49Smrg
181352b01e16SmrgAC_ARG_WITH([pic],
181452b01e16Smrg    [AC_HELP_STRING([--with-pic],
181552b01e16Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
181652b01e16Smrg    [pic_mode="$withval"],
181752b01e16Smrg    [pic_mode=default])
181852b01e16Smrgtest -z "$pic_mode" && pic_mode=default
18194b0ead49Smrg
182052b01e16Smrg# Use C for the default configuration in the libtool script
182152b01e16Smrgtagname=
182252b01e16SmrgAC_LIBTOOL_LANG_C_CONFIG
182352b01e16Smrg_LT_AC_TAGCONFIG
182452b01e16Smrg])# AC_LIBTOOL_SETUP
18254b0ead49Smrg
18264b0ead49Smrg
182752b01e16Smrg# _LT_AC_SYS_COMPILER
182852b01e16Smrg# -------------------
182952b01e16SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
183052b01e16Smrg[AC_REQUIRE([AC_PROG_CC])dnl
18314b0ead49Smrg
183252b01e16Smrg# If no C compiler was specified, use CC.
183352b01e16SmrgLTCC=${LTCC-"$CC"}
18344b0ead49Smrg
183552b01e16Smrg# If no C compiler flags were specified, use CFLAGS.
183652b01e16SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
18374b0ead49Smrg
183852b01e16Smrg# Allow CC to be a program name with arguments.
183952b01e16Smrgcompiler=$CC
184052b01e16Smrg])# _LT_AC_SYS_COMPILER
18414b0ead49Smrg
18424b0ead49Smrg
184352b01e16Smrg# _LT_CC_BASENAME(CC)
18444b0ead49Smrg# -------------------
184552b01e16Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
184652b01e16SmrgAC_DEFUN([_LT_CC_BASENAME],
184752b01e16Smrg[for cc_temp in $1""; do
184852b01e16Smrg  case $cc_temp in
184952b01e16Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
185052b01e16Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
185152b01e16Smrg    \-*) ;;
185252b01e16Smrg    *) break;;
185352b01e16Smrg  esac
185452b01e16Smrgdone
185552b01e16Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
185652b01e16Smrg])
18574b0ead49Smrg
18584b0ead49Smrg
185952b01e16Smrg# _LT_COMPILER_BOILERPLATE
186052b01e16Smrg# ------------------------
186152b01e16Smrg# Check for compiler boilerplate output or warnings with
186252b01e16Smrg# the simple compiler test code.
186352b01e16SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
186452b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
186552b01e16Smrgac_outfile=conftest.$ac_objext
186652b01e16Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
186752b01e16Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
186852b01e16Smrg_lt_compiler_boilerplate=`cat conftest.err`
186952b01e16Smrg$rm conftest*
187052b01e16Smrg])# _LT_COMPILER_BOILERPLATE
18714b0ead49Smrg
18724b0ead49Smrg
187352b01e16Smrg# _LT_LINKER_BOILERPLATE
187452b01e16Smrg# ----------------------
187552b01e16Smrg# Check for linker boilerplate output or warnings with
187652b01e16Smrg# the simple link test code.
187752b01e16SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
187852b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
187952b01e16Smrgac_outfile=conftest.$ac_objext
188052b01e16Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
188152b01e16Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
188252b01e16Smrg_lt_linker_boilerplate=`cat conftest.err`
188352b01e16Smrg$rm -r conftest*
188452b01e16Smrg])# _LT_LINKER_BOILERPLATE
18854b0ead49Smrg
188652b01e16Smrg# _LT_REQUIRED_DARWIN_CHECKS
188752b01e16Smrg# --------------------------
188852b01e16Smrg# Check for some things on darwin
188952b01e16SmrgAC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
189052b01e16Smrg  case $host_os in
189152b01e16Smrg    rhapsody* | darwin*)
189252b01e16Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
189352b01e16Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
189452b01e16Smrg
189552b01e16Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
189652b01e16Smrg      [lt_cv_apple_cc_single_mod=no
189752b01e16Smrg      if test -z "${LT_MULTI_MODULE}"; then
189852b01e16Smrg   # By default we will add the -single_module flag. You can override
189952b01e16Smrg   # by either setting the environment variable LT_MULTI_MODULE
190052b01e16Smrg   # non-empty at configure time, or by adding -multi_module to the
190152b01e16Smrg   # link flags.
190252b01e16Smrg   echo "int foo(void){return 1;}" > conftest.c
190352b01e16Smrg   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
190452b01e16Smrg     -dynamiclib ${wl}-single_module conftest.c
190552b01e16Smrg   if test -f libconftest.dylib; then
190652b01e16Smrg     lt_cv_apple_cc_single_mod=yes
190752b01e16Smrg     rm -rf libconftest.dylib*
190852b01e16Smrg   fi
190952b01e16Smrg   rm conftest.c
191052b01e16Smrg      fi])
191152b01e16Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
191252b01e16Smrg      [lt_cv_ld_exported_symbols_list],
191352b01e16Smrg      [lt_cv_ld_exported_symbols_list=no
191452b01e16Smrg      save_LDFLAGS=$LDFLAGS
191552b01e16Smrg      echo "_main" > conftest.sym
191652b01e16Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
191752b01e16Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
191852b01e16Smrg   [lt_cv_ld_exported_symbols_list=yes],
191952b01e16Smrg   [lt_cv_ld_exported_symbols_list=no])
192052b01e16Smrg   LDFLAGS="$save_LDFLAGS"
192152b01e16Smrg    ])
192252b01e16Smrg    case $host_os in
192352b01e16Smrg    rhapsody* | darwin1.[[0123]])
192452b01e16Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
192552b01e16Smrg    darwin1.*)
192652b01e16Smrg     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
192752b01e16Smrg    darwin*)
192852b01e16Smrg      # if running on 10.5 or later, the deployment target defaults
192952b01e16Smrg      # to the OS version, if on x86, and 10.4, the deployment
193052b01e16Smrg      # target defaults to 10.4. Don't you love it?
193152b01e16Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
193252b01e16Smrg   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
193352b01e16Smrg     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
193452b01e16Smrg   10.[[012]]*)
193552b01e16Smrg     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
193652b01e16Smrg   10.*)
193752b01e16Smrg     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
193852b01e16Smrg      esac
19394b0ead49Smrg    ;;
19404b0ead49Smrg  esac
194152b01e16Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
194252b01e16Smrg      _lt_dar_single_mod='$single_module'
19434b0ead49Smrg    fi
194452b01e16Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
194552b01e16Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
19464b0ead49Smrg    else
194752b01e16Smrg      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
194852b01e16Smrg    fi
194952b01e16Smrg    if test "$DSYMUTIL" != ":"; then
195052b01e16Smrg      _lt_dsymutil="~$DSYMUTIL \$lib || :"
195152b01e16Smrg    else
195252b01e16Smrg      _lt_dsymutil=
19534b0ead49Smrg    fi
19544b0ead49Smrg    ;;
195552b01e16Smrg  esac
195652b01e16Smrg])
19574b0ead49Smrg
195852b01e16Smrg# _LT_AC_SYS_LIBPATH_AIX
195952b01e16Smrg# ----------------------
196052b01e16Smrg# Links a minimal program and checks the executable
196152b01e16Smrg# for the system default hardcoded library path. In most cases,
196252b01e16Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
196352b01e16Smrg# the location of the communication and MPI libs are included too.
196452b01e16Smrg# If we don't find anything, use the default library path according
196552b01e16Smrg# to the aix ld manual.
196652b01e16SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
196752b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
196852b01e16SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
196952b01e16Smrglt_aix_libpath_sed='
197052b01e16Smrg    /Import File Strings/,/^$/ {
197152b01e16Smrg	/^0/ {
197252b01e16Smrg	    s/^0  *\(.*\)$/\1/
197352b01e16Smrg	    p
197452b01e16Smrg	}
197552b01e16Smrg    }'
197652b01e16Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
197752b01e16Smrg# Check for a 64-bit object if we didn't find anything.
197852b01e16Smrgif test -z "$aix_libpath"; then
197952b01e16Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
198052b01e16Smrgfi],[])
198152b01e16Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
198252b01e16Smrg])# _LT_AC_SYS_LIBPATH_AIX
19834b0ead49Smrg
19844b0ead49Smrg
198552b01e16Smrg# _LT_AC_SHELL_INIT(ARG)
198652b01e16Smrg# ----------------------
198752b01e16SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
198852b01e16Smrg[ifdef([AC_DIVERSION_NOTICE],
198952b01e16Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
199052b01e16Smrg	 [AC_DIVERT_PUSH(NOTICE)])
199152b01e16Smrg$1
199252b01e16SmrgAC_DIVERT_POP
199352b01e16Smrg])# _LT_AC_SHELL_INIT
19944b0ead49Smrg
19954b0ead49Smrg
199652b01e16Smrg# _LT_AC_PROG_ECHO_BACKSLASH
199752b01e16Smrg# --------------------------
199852b01e16Smrg# Add some code to the start of the generated configure script which
199952b01e16Smrg# will find an echo command which doesn't interpret backslashes.
200052b01e16SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
200152b01e16Smrg[_LT_AC_SHELL_INIT([
200252b01e16Smrg# Check that we are running under the correct shell.
200352b01e16SmrgSHELL=${CONFIG_SHELL-/bin/sh}
20044b0ead49Smrg
200552b01e16Smrgcase X$ECHO in
200652b01e16SmrgX*--fallback-echo)
200752b01e16Smrg  # Remove one level of quotation (which was required for Make).
200852b01e16Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
20094b0ead49Smrg  ;;
201052b01e16Smrgesac
20114b0ead49Smrg
201252b01e16Smrgecho=${ECHO-echo}
201352b01e16Smrgif test "X[$]1" = X--no-reexec; then
201452b01e16Smrg  # Discard the --no-reexec flag, and continue.
201552b01e16Smrg  shift
201652b01e16Smrgelif test "X[$]1" = X--fallback-echo; then
201752b01e16Smrg  # Avoid inline document here, it may be left over
201852b01e16Smrg  :
201952b01e16Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
202052b01e16Smrg  # Yippee, $echo works!
202152b01e16Smrg  :
202252b01e16Smrgelse
202352b01e16Smrg  # Restart under the correct shell.
202452b01e16Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
202552b01e16Smrgfi
20264b0ead49Smrg
202752b01e16Smrgif test "X[$]1" = X--fallback-echo; then
202852b01e16Smrg  # used as fallback echo
202952b01e16Smrg  shift
203052b01e16Smrg  cat <<EOF
203152b01e16Smrg[$]*
203252b01e16SmrgEOF
203352b01e16Smrg  exit 0
203452b01e16Smrgfi
20354b0ead49Smrg
203652b01e16Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
203752b01e16Smrg# if CDPATH is set.
203852b01e16Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
20394b0ead49Smrg
204052b01e16Smrgif test -z "$ECHO"; then
204152b01e16Smrgif test "X${echo_test_string+set}" != Xset; then
204252b01e16Smrg# find a string as large as possible, as long as the shell can cope with it
204352b01e16Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
204452b01e16Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
204552b01e16Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
204652b01e16Smrg       echo_test_string=`eval $cmd` &&
204752b01e16Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
204852b01e16Smrg    then
204952b01e16Smrg      break
205052b01e16Smrg    fi
205152b01e16Smrg  done
205252b01e16Smrgfi
20534b0ead49Smrg
205452b01e16Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
205552b01e16Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
205652b01e16Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
205752b01e16Smrg  :
205852b01e16Smrgelse
205952b01e16Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
206052b01e16Smrg  # backslashes.  This makes it impossible to quote backslashes using
206152b01e16Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
206252b01e16Smrg  #
206352b01e16Smrg  # So, first we look for a working echo in the user's PATH.
20644b0ead49Smrg
206552b01e16Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
206652b01e16Smrg  for dir in $PATH /usr/ucb; do
206752b01e16Smrg    IFS="$lt_save_ifs"
206852b01e16Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
206952b01e16Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
207052b01e16Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
207152b01e16Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
207252b01e16Smrg      echo="$dir/echo"
207352b01e16Smrg      break
207452b01e16Smrg    fi
207552b01e16Smrg  done
207652b01e16Smrg  IFS="$lt_save_ifs"
20774b0ead49Smrg
207852b01e16Smrg  if test "X$echo" = Xecho; then
207952b01e16Smrg    # We didn't find a better echo, so look for alternatives.
208052b01e16Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
208152b01e16Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
208252b01e16Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
208352b01e16Smrg      # This shell has a builtin print -r that does the trick.
208452b01e16Smrg      echo='print -r'
208552b01e16Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
208652b01e16Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
208752b01e16Smrg      # If we have ksh, try running configure again with it.
208852b01e16Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
208952b01e16Smrg      export ORIGINAL_CONFIG_SHELL
209052b01e16Smrg      CONFIG_SHELL=/bin/ksh
209152b01e16Smrg      export CONFIG_SHELL
209252b01e16Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
209352b01e16Smrg    else
209452b01e16Smrg      # Try using printf.
209552b01e16Smrg      echo='printf %s\n'
209652b01e16Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
209752b01e16Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
209852b01e16Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
209952b01e16Smrg	# Cool, printf works
210052b01e16Smrg	:
210152b01e16Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
210252b01e16Smrg	   test "X$echo_testing_string" = 'X\t' &&
210352b01e16Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
210452b01e16Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
210552b01e16Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
210652b01e16Smrg	export CONFIG_SHELL
210752b01e16Smrg	SHELL="$CONFIG_SHELL"
210852b01e16Smrg	export SHELL
210952b01e16Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
211052b01e16Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
211152b01e16Smrg	   test "X$echo_testing_string" = 'X\t' &&
211252b01e16Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
211352b01e16Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
211452b01e16Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
211552b01e16Smrg      else
211652b01e16Smrg	# maybe with a smaller string...
211752b01e16Smrg	prev=:
21184b0ead49Smrg
211952b01e16Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
212052b01e16Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
212152b01e16Smrg	  then
212252b01e16Smrg	    break
212352b01e16Smrg	  fi
212452b01e16Smrg	  prev="$cmd"
212552b01e16Smrg	done
21264b0ead49Smrg
212752b01e16Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
212852b01e16Smrg	  echo_test_string=`eval $prev`
212952b01e16Smrg	  export echo_test_string
213052b01e16Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
213152b01e16Smrg	else
213252b01e16Smrg	  # Oops.  We lost completely, so just stick with echo.
213352b01e16Smrg	  echo=echo
213452b01e16Smrg	fi
213552b01e16Smrg      fi
213652b01e16Smrg    fi
21374b0ead49Smrg  fi
213852b01e16Smrgfi
213952b01e16Smrgfi
21404b0ead49Smrg
214152b01e16Smrg# Copy echo and quote the copy suitably for passing to libtool from
214252b01e16Smrg# the Makefile, instead of quoting the original, which is used later.
214352b01e16SmrgECHO=$echo
214452b01e16Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
214552b01e16Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
214652b01e16Smrgfi
21474b0ead49Smrg
214852b01e16SmrgAC_SUBST(ECHO)
214952b01e16Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
21504b0ead49Smrg
21514b0ead49Smrg
215252b01e16Smrg# _LT_AC_LOCK
215352b01e16Smrg# -----------
215452b01e16SmrgAC_DEFUN([_LT_AC_LOCK],
215552b01e16Smrg[AC_ARG_ENABLE([libtool-lock],
215652b01e16Smrg    [AC_HELP_STRING([--disable-libtool-lock],
215752b01e16Smrg	[avoid locking (might break parallel builds)])])
215852b01e16Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
21594b0ead49Smrg
216052b01e16Smrg# Some flags need to be propagated to the compiler or linker for good
216152b01e16Smrg# libtool support.
216252b01e16Smrgcase $host in
216352b01e16Smrgia64-*-hpux*)
216452b01e16Smrg  # Find out which ABI we are using.
216552b01e16Smrg  echo 'int i;' > conftest.$ac_ext
216652b01e16Smrg  if AC_TRY_EVAL(ac_compile); then
216752b01e16Smrg    case `/usr/bin/file conftest.$ac_objext` in
216852b01e16Smrg    *ELF-32*)
216952b01e16Smrg      HPUX_IA64_MODE="32"
217052b01e16Smrg      ;;
217152b01e16Smrg    *ELF-64*)
217252b01e16Smrg      HPUX_IA64_MODE="64"
217352b01e16Smrg      ;;
217452b01e16Smrg    esac
217552b01e16Smrg  fi
217652b01e16Smrg  rm -rf conftest*
21774b0ead49Smrg  ;;
217852b01e16Smrg*-*-irix6*)
217952b01e16Smrg  # Find out which ABI we are using.
218052b01e16Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
218152b01e16Smrg  if AC_TRY_EVAL(ac_compile); then
218252b01e16Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
218352b01e16Smrg    case `/usr/bin/file conftest.$ac_objext` in
218452b01e16Smrg    *32-bit*)
218552b01e16Smrg      LD="${LD-ld} -melf32bsmip"
218652b01e16Smrg      ;;
218752b01e16Smrg    *N32*)
218852b01e16Smrg      LD="${LD-ld} -melf32bmipn32"
218952b01e16Smrg      ;;
219052b01e16Smrg    *64-bit*)
219152b01e16Smrg      LD="${LD-ld} -melf64bmip"
219252b01e16Smrg      ;;
219352b01e16Smrg    esac
219452b01e16Smrg   else
219552b01e16Smrg    case `/usr/bin/file conftest.$ac_objext` in
219652b01e16Smrg    *32-bit*)
219752b01e16Smrg      LD="${LD-ld} -32"
219852b01e16Smrg      ;;
219952b01e16Smrg    *N32*)
220052b01e16Smrg      LD="${LD-ld} -n32"
220152b01e16Smrg      ;;
220252b01e16Smrg    *64-bit*)
220352b01e16Smrg      LD="${LD-ld} -64"
220452b01e16Smrg      ;;
220552b01e16Smrg    esac
220652b01e16Smrg   fi
220752b01e16Smrg  fi
220852b01e16Smrg  rm -rf conftest*
22094b0ead49Smrg  ;;
22104b0ead49Smrg
221152b01e16Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
221252b01e16Smrgs390*-*linux*|sparc*-*linux*)
221352b01e16Smrg  # Find out which ABI we are using.
221452b01e16Smrg  echo 'int i;' > conftest.$ac_ext
221552b01e16Smrg  if AC_TRY_EVAL(ac_compile); then
221652b01e16Smrg    case `/usr/bin/file conftest.o` in
221752b01e16Smrg    *32-bit*)
221852b01e16Smrg      case $host in
221952b01e16Smrg        x86_64-*kfreebsd*-gnu)
222052b01e16Smrg          LD="${LD-ld} -m elf_i386_fbsd"
222152b01e16Smrg          ;;
222252b01e16Smrg        x86_64-*linux*)
222352b01e16Smrg          LD="${LD-ld} -m elf_i386"
222452b01e16Smrg          ;;
222552b01e16Smrg        ppc64-*linux*|powerpc64-*linux*)
222652b01e16Smrg          LD="${LD-ld} -m elf32ppclinux"
222752b01e16Smrg          ;;
222852b01e16Smrg        s390x-*linux*)
222952b01e16Smrg          LD="${LD-ld} -m elf_s390"
223052b01e16Smrg          ;;
223152b01e16Smrg        sparc64-*linux*)
223252b01e16Smrg          LD="${LD-ld} -m elf32_sparc"
223352b01e16Smrg          ;;
223452b01e16Smrg      esac
223552b01e16Smrg      ;;
223652b01e16Smrg    *64-bit*)
223752b01e16Smrg      case $host in
223852b01e16Smrg        x86_64-*kfreebsd*-gnu)
223952b01e16Smrg          LD="${LD-ld} -m elf_x86_64_fbsd"
224052b01e16Smrg          ;;
224152b01e16Smrg        x86_64-*linux*)
224252b01e16Smrg          LD="${LD-ld} -m elf_x86_64"
224352b01e16Smrg          ;;
224452b01e16Smrg        ppc*-*linux*|powerpc*-*linux*)
224552b01e16Smrg          LD="${LD-ld} -m elf64ppc"
224652b01e16Smrg          ;;
224752b01e16Smrg        s390*-*linux*)
224852b01e16Smrg          LD="${LD-ld} -m elf64_s390"
224952b01e16Smrg          ;;
225052b01e16Smrg        sparc*-*linux*)
225152b01e16Smrg          LD="${LD-ld} -m elf64_sparc"
225252b01e16Smrg          ;;
225352b01e16Smrg      esac
225452b01e16Smrg      ;;
225552b01e16Smrg    esac
225652b01e16Smrg  fi
225752b01e16Smrg  rm -rf conftest*
22584b0ead49Smrg  ;;
22594b0ead49Smrg
226052b01e16Smrg*-*-sco3.2v5*)
226152b01e16Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
226252b01e16Smrg  SAVE_CFLAGS="$CFLAGS"
226352b01e16Smrg  CFLAGS="$CFLAGS -belf"
226452b01e16Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
226552b01e16Smrg    [AC_LANG_PUSH(C)
226652b01e16Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
226752b01e16Smrg     AC_LANG_POP])
226852b01e16Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
226952b01e16Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
227052b01e16Smrg    CFLAGS="$SAVE_CFLAGS"
22714b0ead49Smrg  fi
22724b0ead49Smrg  ;;
227352b01e16Smrgsparc*-*solaris*)
227452b01e16Smrg  # Find out which ABI we are using.
227552b01e16Smrg  echo 'int i;' > conftest.$ac_ext
227652b01e16Smrg  if AC_TRY_EVAL(ac_compile); then
227752b01e16Smrg    case `/usr/bin/file conftest.o` in
227852b01e16Smrg    *64-bit*)
227952b01e16Smrg      case $lt_cv_prog_gnu_ld in
228052b01e16Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
228152b01e16Smrg      *)
228252b01e16Smrg        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
228352b01e16Smrg	  LD="${LD-ld} -64"
228452b01e16Smrg	fi
228552b01e16Smrg	;;
228652b01e16Smrg      esac
228752b01e16Smrg      ;;
228852b01e16Smrg    esac
228952b01e16Smrg  fi
229052b01e16Smrg  rm -rf conftest*
22914b0ead49Smrg  ;;
229252b01e16Smrg
229352b01e16SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
229452b01e16Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
229552b01e16Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
229652b01e16Smrg  AC_CHECK_TOOL(AS, as, false)
229752b01e16Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
22984b0ead49Smrg  ;;
229952b01e16Smrg  ])
23004b0ead49Smrgesac
23014b0ead49Smrg
230252b01e16Smrgneed_locks="$enable_libtool_lock"
23034b0ead49Smrg
230452b01e16Smrg])# _LT_AC_LOCK
23054b0ead49Smrg
23064b0ead49Smrg
230752b01e16Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
230852b01e16Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
230952b01e16Smrg# ----------------------------------------------------------------
231052b01e16Smrg# Check whether the given compiler option works
231152b01e16SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
231252b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])
231352b01e16SmrgAC_CACHE_CHECK([$1], [$2],
231452b01e16Smrg  [$2=no
231552b01e16Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
231652b01e16Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
231752b01e16Smrg   lt_compiler_flag="$3"
231852b01e16Smrg   # Insert the option either (1) after the last *FLAGS variable, or
231952b01e16Smrg   # (2) before a word containing "conftest.", or (3) at the end.
232052b01e16Smrg   # Note that $ac_compile itself does not contain backslashes and begins
232152b01e16Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
232252b01e16Smrg   # The option is referenced via a variable to avoid confusing sed.
232352b01e16Smrg   lt_compile=`echo "$ac_compile" | $SED \
232452b01e16Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
232552b01e16Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
232652b01e16Smrg   -e 's:$: $lt_compiler_flag:'`
232752b01e16Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
232852b01e16Smrg   (eval "$lt_compile" 2>conftest.err)
232952b01e16Smrg   ac_status=$?
233052b01e16Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
233152b01e16Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
233252b01e16Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
233352b01e16Smrg     # The compiler can only warn and ignore the option if not recognized
233452b01e16Smrg     # So say no if there are warnings other than the usual output.
233552b01e16Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
233652b01e16Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
233752b01e16Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
233852b01e16Smrg       $2=yes
233952b01e16Smrg     fi
234052b01e16Smrg   fi
234152b01e16Smrg   $rm conftest*
234252b01e16Smrg])
23434b0ead49Smrg
234452b01e16Smrgif test x"[$]$2" = xyes; then
234552b01e16Smrg    ifelse([$5], , :, [$5])
234652b01e16Smrgelse
234752b01e16Smrg    ifelse([$6], , :, [$6])
23484b0ead49Smrgfi
234952b01e16Smrg])# AC_LIBTOOL_COMPILER_OPTION
23504b0ead49Smrg
23514b0ead49Smrg
235252b01e16Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
235352b01e16Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
235452b01e16Smrg# ------------------------------------------------------------
235552b01e16Smrg# Check whether the given compiler option works
235652b01e16SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
235752b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
235852b01e16SmrgAC_CACHE_CHECK([$1], [$2],
235952b01e16Smrg  [$2=no
236052b01e16Smrg   save_LDFLAGS="$LDFLAGS"
236152b01e16Smrg   LDFLAGS="$LDFLAGS $3"
236252b01e16Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
236352b01e16Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
236452b01e16Smrg     # The linker can only warn and ignore the option if not recognized
236552b01e16Smrg     # So say no if there are warnings
236652b01e16Smrg     if test -s conftest.err; then
236752b01e16Smrg       # Append any errors to the config.log.
236852b01e16Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
236952b01e16Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
237052b01e16Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
237152b01e16Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
237252b01e16Smrg         $2=yes
237352b01e16Smrg       fi
237452b01e16Smrg     else
237552b01e16Smrg       $2=yes
237652b01e16Smrg     fi
237752b01e16Smrg   fi
237852b01e16Smrg   $rm -r conftest*
237952b01e16Smrg   LDFLAGS="$save_LDFLAGS"
238052b01e16Smrg])
23814b0ead49Smrg
238252b01e16Smrgif test x"[$]$2" = xyes; then
238352b01e16Smrg    ifelse([$4], , :, [$4])
238452b01e16Smrgelse
238552b01e16Smrg    ifelse([$5], , :, [$5])
238652b01e16Smrgfi
238752b01e16Smrg])# AC_LIBTOOL_LINKER_OPTION
23884b0ead49Smrg
23894b0ead49Smrg
239052b01e16Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
239152b01e16Smrg# --------------------------
239252b01e16SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
239352b01e16Smrg[# find the maximum length of command line arguments
239452b01e16SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
239552b01e16SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
239652b01e16Smrg  i=0
239752b01e16Smrg  teststring="ABCD"
23984b0ead49Smrg
239952b01e16Smrg  case $build_os in
240052b01e16Smrg  msdosdjgpp*)
240152b01e16Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
240252b01e16Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
240352b01e16Smrg    # during glob expansion).  Even if it were fixed, the result of this
240452b01e16Smrg    # check would be larger than it should be.
240552b01e16Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
240652b01e16Smrg    ;;
24074b0ead49Smrg
240852b01e16Smrg  gnu*)
240952b01e16Smrg    # Under GNU Hurd, this test is not required because there is
241052b01e16Smrg    # no limit to the length of command line arguments.
241152b01e16Smrg    # Libtool will interpret -1 as no limit whatsoever
241252b01e16Smrg    lt_cv_sys_max_cmd_len=-1;
241352b01e16Smrg    ;;
24144b0ead49Smrg
241552b01e16Smrg  cygwin* | mingw*)
241652b01e16Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
241752b01e16Smrg    # about 5 minutes as the teststring grows exponentially.
241852b01e16Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
241952b01e16Smrg    # you end up with a "frozen" computer, even though with patience
242052b01e16Smrg    # the test eventually succeeds (with a max line length of 256k).
242152b01e16Smrg    # Instead, let's just punt: use the minimum linelength reported by
242252b01e16Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
242352b01e16Smrg    lt_cv_sys_max_cmd_len=8192;
242452b01e16Smrg    ;;
24254b0ead49Smrg
242652b01e16Smrg  amigaos*)
242752b01e16Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
242852b01e16Smrg    # So we just punt and use a minimum line length of 8192.
242952b01e16Smrg    lt_cv_sys_max_cmd_len=8192;
243052b01e16Smrg    ;;
24314b0ead49Smrg
243252b01e16Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
243352b01e16Smrg    # This has been around since 386BSD, at least.  Likely further.
243452b01e16Smrg    if test -x /sbin/sysctl; then
243552b01e16Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
243652b01e16Smrg    elif test -x /usr/sbin/sysctl; then
243752b01e16Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
243852b01e16Smrg    else
243952b01e16Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
244052b01e16Smrg    fi
244152b01e16Smrg    # And add a safety zone
244252b01e16Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
244352b01e16Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
244452b01e16Smrg    ;;
24454b0ead49Smrg
244652b01e16Smrg  interix*)
244752b01e16Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
244852b01e16Smrg    lt_cv_sys_max_cmd_len=196608
244952b01e16Smrg    ;;
24504b0ead49Smrg
245152b01e16Smrg  osf*)
245252b01e16Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
245352b01e16Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
245452b01e16Smrg    # nice to cause kernel panics so lets avoid the loop below.
245552b01e16Smrg    # First set a reasonable default.
245652b01e16Smrg    lt_cv_sys_max_cmd_len=16384
245752b01e16Smrg    #
245852b01e16Smrg    if test -x /sbin/sysconfig; then
245952b01e16Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
246052b01e16Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
246152b01e16Smrg      esac
246252b01e16Smrg    fi
246352b01e16Smrg    ;;
246452b01e16Smrg  sco3.2v5*)
246552b01e16Smrg    lt_cv_sys_max_cmd_len=102400
246652b01e16Smrg    ;;
246752b01e16Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
246852b01e16Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
246952b01e16Smrg    if test -n "$kargmax"; then
247052b01e16Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
247152b01e16Smrg    else
247252b01e16Smrg      lt_cv_sys_max_cmd_len=32768
247352b01e16Smrg    fi
247452b01e16Smrg    ;;
247552b01e16Smrg  *)
247652b01e16Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
247752b01e16Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
247852b01e16Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
247952b01e16Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
248052b01e16Smrg    else
248152b01e16Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
248252b01e16Smrg      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
248352b01e16Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
248452b01e16Smrg	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
248552b01e16Smrg	      lt_cv_sys_max_cmd_len=$new_result &&
248652b01e16Smrg	      test $i != 17 # 1/2 MB should be enough
248752b01e16Smrg      do
248852b01e16Smrg        i=`expr $i + 1`
248952b01e16Smrg        teststring=$teststring$teststring
249052b01e16Smrg      done
249152b01e16Smrg      teststring=
249252b01e16Smrg      # Add a significant safety factor because C++ compilers can tack on massive
249352b01e16Smrg      # amounts of additional arguments before passing them to the linker.
249452b01e16Smrg      # It appears as though 1/2 is a usable value.
249552b01e16Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
249652b01e16Smrg    fi
249752b01e16Smrg    ;;
249852b01e16Smrg  esac
249952b01e16Smrg])
250052b01e16Smrgif test -n $lt_cv_sys_max_cmd_len ; then
250152b01e16Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
250252b01e16Smrgelse
250352b01e16Smrg  AC_MSG_RESULT(none)
250452b01e16Smrgfi
250552b01e16Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
25064b0ead49Smrg
25074b0ead49Smrg
250852b01e16Smrg# _LT_AC_CHECK_DLFCN
250952b01e16Smrg# ------------------
251052b01e16SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
251152b01e16Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
251252b01e16Smrg])# _LT_AC_CHECK_DLFCN
25134b0ead49Smrg
25144b0ead49Smrg
251552b01e16Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
251652b01e16Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
251752b01e16Smrg# ---------------------------------------------------------------------
251852b01e16SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
251952b01e16Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
252052b01e16Smrgif test "$cross_compiling" = yes; then :
252152b01e16Smrg  [$4]
252252b01e16Smrgelse
252352b01e16Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
252452b01e16Smrg  lt_status=$lt_dlunknown
252552b01e16Smrg  cat > conftest.$ac_ext <<EOF
252652b01e16Smrg[#line __oline__ "configure"
252752b01e16Smrg#include "confdefs.h"
25284b0ead49Smrg
252952b01e16Smrg#if HAVE_DLFCN_H
253052b01e16Smrg#include <dlfcn.h>
253152b01e16Smrg#endif
25324b0ead49Smrg
253352b01e16Smrg#include <stdio.h>
25344b0ead49Smrg
253552b01e16Smrg#ifdef RTLD_GLOBAL
253652b01e16Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
253752b01e16Smrg#else
253852b01e16Smrg#  ifdef DL_GLOBAL
253952b01e16Smrg#    define LT_DLGLOBAL		DL_GLOBAL
254052b01e16Smrg#  else
254152b01e16Smrg#    define LT_DLGLOBAL		0
254252b01e16Smrg#  endif
254352b01e16Smrg#endif
25444b0ead49Smrg
254552b01e16Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
254652b01e16Smrg   find out it does not work in some platform. */
254752b01e16Smrg#ifndef LT_DLLAZY_OR_NOW
254852b01e16Smrg#  ifdef RTLD_LAZY
254952b01e16Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
255052b01e16Smrg#  else
255152b01e16Smrg#    ifdef DL_LAZY
255252b01e16Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
255352b01e16Smrg#    else
255452b01e16Smrg#      ifdef RTLD_NOW
255552b01e16Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
255652b01e16Smrg#      else
255752b01e16Smrg#        ifdef DL_NOW
255852b01e16Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
255952b01e16Smrg#        else
256052b01e16Smrg#          define LT_DLLAZY_OR_NOW	0
256152b01e16Smrg#        endif
256252b01e16Smrg#      endif
256352b01e16Smrg#    endif
256452b01e16Smrg#  endif
256552b01e16Smrg#endif
25664b0ead49Smrg
256752b01e16Smrg#ifdef __cplusplus
256852b01e16Smrgextern "C" void exit (int);
256952b01e16Smrg#endif
25704b0ead49Smrg
257152b01e16Smrgvoid fnord() { int i=42;}
257252b01e16Smrgint main ()
257352b01e16Smrg{
257452b01e16Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
257552b01e16Smrg  int status = $lt_dlunknown;
257652b01e16Smrg
257752b01e16Smrg  if (self)
257852b01e16Smrg    {
257952b01e16Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
258052b01e16Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
258152b01e16Smrg      /* dlclose (self); */
258252b01e16Smrg    }
258352b01e16Smrg  else
258452b01e16Smrg    puts (dlerror ());
258552b01e16Smrg
258652b01e16Smrg    exit (status);
258752b01e16Smrg}]
258852b01e16SmrgEOF
258952b01e16Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
259052b01e16Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
259152b01e16Smrg    lt_status=$?
259252b01e16Smrg    case x$lt_status in
259352b01e16Smrg      x$lt_dlno_uscore) $1 ;;
259452b01e16Smrg      x$lt_dlneed_uscore) $2 ;;
259552b01e16Smrg      x$lt_dlunknown|x*) $3 ;;
259652b01e16Smrg    esac
259752b01e16Smrg  else :
259852b01e16Smrg    # compilation failed
259952b01e16Smrg    $3
26004b0ead49Smrg  fi
260152b01e16Smrgfi
260252b01e16Smrgrm -fr conftest*
260352b01e16Smrg])# _LT_AC_TRY_DLOPEN_SELF
260452b01e16Smrg
260552b01e16Smrg
260652b01e16Smrg# AC_LIBTOOL_DLOPEN_SELF
260752b01e16Smrg# ----------------------
260852b01e16SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
260952b01e16Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
261052b01e16Smrgif test "x$enable_dlopen" != xyes; then
261152b01e16Smrg  enable_dlopen=unknown
261252b01e16Smrg  enable_dlopen_self=unknown
261352b01e16Smrg  enable_dlopen_self_static=unknown
261452b01e16Smrgelse
261552b01e16Smrg  lt_cv_dlopen=no
261652b01e16Smrg  lt_cv_dlopen_libs=
261752b01e16Smrg
261852b01e16Smrg  case $host_os in
261952b01e16Smrg  beos*)
262052b01e16Smrg    lt_cv_dlopen="load_add_on"
262152b01e16Smrg    lt_cv_dlopen_libs=
262252b01e16Smrg    lt_cv_dlopen_self=yes
26234b0ead49Smrg    ;;
26244b0ead49Smrg
262552b01e16Smrg  mingw* | pw32*)
262652b01e16Smrg    lt_cv_dlopen="LoadLibrary"
262752b01e16Smrg    lt_cv_dlopen_libs=
262852b01e16Smrg   ;;
26294b0ead49Smrg
263052b01e16Smrg  cygwin*)
263152b01e16Smrg    lt_cv_dlopen="dlopen"
263252b01e16Smrg    lt_cv_dlopen_libs=
263352b01e16Smrg   ;;
26344b0ead49Smrg
263552b01e16Smrg  darwin*)
263652b01e16Smrg  # if libdl is installed we need to link against it
263752b01e16Smrg    AC_CHECK_LIB([dl], [dlopen],
263852b01e16Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
263952b01e16Smrg    lt_cv_dlopen="dyld"
264052b01e16Smrg    lt_cv_dlopen_libs=
264152b01e16Smrg    lt_cv_dlopen_self=yes
264252b01e16Smrg    ])
264352b01e16Smrg   ;;
26444b0ead49Smrg
264552b01e16Smrg  *)
264652b01e16Smrg    AC_CHECK_FUNC([shl_load],
264752b01e16Smrg	  [lt_cv_dlopen="shl_load"],
264852b01e16Smrg      [AC_CHECK_LIB([dld], [shl_load],
264952b01e16Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
265052b01e16Smrg	[AC_CHECK_FUNC([dlopen],
265152b01e16Smrg	      [lt_cv_dlopen="dlopen"],
265252b01e16Smrg	  [AC_CHECK_LIB([dl], [dlopen],
265352b01e16Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
265452b01e16Smrg	    [AC_CHECK_LIB([svld], [dlopen],
265552b01e16Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
265652b01e16Smrg	      [AC_CHECK_LIB([dld], [dld_link],
265752b01e16Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
265852b01e16Smrg	      ])
265952b01e16Smrg	    ])
266052b01e16Smrg	  ])
266152b01e16Smrg	])
266252b01e16Smrg      ])
266352b01e16Smrg    ;;
266452b01e16Smrg  esac
26654b0ead49Smrg
266652b01e16Smrg  if test "x$lt_cv_dlopen" != xno; then
266752b01e16Smrg    enable_dlopen=yes
266852b01e16Smrg  else
266952b01e16Smrg    enable_dlopen=no
267052b01e16Smrg  fi
26714b0ead49Smrg
267252b01e16Smrg  case $lt_cv_dlopen in
267352b01e16Smrg  dlopen)
267452b01e16Smrg    save_CPPFLAGS="$CPPFLAGS"
267552b01e16Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
26764b0ead49Smrg
267752b01e16Smrg    save_LDFLAGS="$LDFLAGS"
267852b01e16Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
26794b0ead49Smrg
268052b01e16Smrg    save_LIBS="$LIBS"
268152b01e16Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
26824b0ead49Smrg
268352b01e16Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
268452b01e16Smrg	  lt_cv_dlopen_self, [dnl
268552b01e16Smrg	  _LT_AC_TRY_DLOPEN_SELF(
268652b01e16Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
268752b01e16Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
268852b01e16Smrg    ])
26894b0ead49Smrg
269052b01e16Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
269152b01e16Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
269252b01e16Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
269352b01e16Smrg    	  lt_cv_dlopen_self_static, [dnl
269452b01e16Smrg	  _LT_AC_TRY_DLOPEN_SELF(
269552b01e16Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
269652b01e16Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
269752b01e16Smrg      ])
269852b01e16Smrg    fi
26994b0ead49Smrg
270052b01e16Smrg    CPPFLAGS="$save_CPPFLAGS"
270152b01e16Smrg    LDFLAGS="$save_LDFLAGS"
270252b01e16Smrg    LIBS="$save_LIBS"
270352b01e16Smrg    ;;
270452b01e16Smrg  esac
27054b0ead49Smrg
270652b01e16Smrg  case $lt_cv_dlopen_self in
270752b01e16Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
270852b01e16Smrg  *) enable_dlopen_self=unknown ;;
270952b01e16Smrg  esac
27104b0ead49Smrg
271152b01e16Smrg  case $lt_cv_dlopen_self_static in
271252b01e16Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
271352b01e16Smrg  *) enable_dlopen_self_static=unknown ;;
271452b01e16Smrg  esac
271552b01e16Smrgfi
271652b01e16Smrg])# AC_LIBTOOL_DLOPEN_SELF
27174b0ead49Smrg
271852b01e16Smrg
271952b01e16Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
272052b01e16Smrg# ---------------------------------
272152b01e16Smrg# Check to see if options -c and -o are simultaneously supported by compiler
272252b01e16SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
272352b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
272452b01e16SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
272552b01e16SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
272652b01e16Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
272752b01e16Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
272852b01e16Smrg   $rm -r conftest 2>/dev/null
272952b01e16Smrg   mkdir conftest
273052b01e16Smrg   cd conftest
273152b01e16Smrg   mkdir out
273252b01e16Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
273352b01e16Smrg
273452b01e16Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
273552b01e16Smrg   # Insert the option either (1) after the last *FLAGS variable, or
273652b01e16Smrg   # (2) before a word containing "conftest.", or (3) at the end.
273752b01e16Smrg   # Note that $ac_compile itself does not contain backslashes and begins
273852b01e16Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
273952b01e16Smrg   lt_compile=`echo "$ac_compile" | $SED \
274052b01e16Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
274152b01e16Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
274252b01e16Smrg   -e 's:$: $lt_compiler_flag:'`
274352b01e16Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
274452b01e16Smrg   (eval "$lt_compile" 2>out/conftest.err)
274552b01e16Smrg   ac_status=$?
274652b01e16Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
274752b01e16Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
274852b01e16Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
274952b01e16Smrg   then
275052b01e16Smrg     # The compiler can only warn and ignore the option if not recognized
275152b01e16Smrg     # So say no if there are warnings
275252b01e16Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
275352b01e16Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
275452b01e16Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
275552b01e16Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
275652b01e16Smrg     fi
275752b01e16Smrg   fi
275852b01e16Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
275952b01e16Smrg   $rm conftest*
276052b01e16Smrg   # SGI C++ compiler will create directory out/ii_files/ for
276152b01e16Smrg   # template instantiation
276252b01e16Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
276352b01e16Smrg   $rm out/* && rmdir out
276452b01e16Smrg   cd ..
276552b01e16Smrg   rmdir conftest
276652b01e16Smrg   $rm conftest*
276752b01e16Smrg])
276852b01e16Smrg])# AC_LIBTOOL_PROG_CC_C_O
276952b01e16Smrg
277052b01e16Smrg
277152b01e16Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
277252b01e16Smrg# -----------------------------------------
277352b01e16Smrg# Check to see if we can do hard links to lock some files if needed
277452b01e16SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
277552b01e16Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
277652b01e16Smrg
277752b01e16Smrghard_links="nottested"
277852b01e16Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
277952b01e16Smrg  # do not overwrite the value of need_locks provided by the user
278052b01e16Smrg  AC_MSG_CHECKING([if we can lock with hard links])
278152b01e16Smrg  hard_links=yes
278252b01e16Smrg  $rm conftest*
278352b01e16Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
278452b01e16Smrg  touch conftest.a
278552b01e16Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
278652b01e16Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
278752b01e16Smrg  AC_MSG_RESULT([$hard_links])
278852b01e16Smrg  if test "$hard_links" = no; then
278952b01e16Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
279052b01e16Smrg    need_locks=warn
279152b01e16Smrg  fi
27924b0ead49Smrgelse
279352b01e16Smrg  need_locks=no
27944b0ead49Smrgfi
279552b01e16Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
279652b01e16Smrg
279752b01e16Smrg
279852b01e16Smrg# AC_LIBTOOL_OBJDIR
279952b01e16Smrg# -----------------
280052b01e16SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
280152b01e16Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
280252b01e16Smrg[rm -f .libs 2>/dev/null
280352b01e16Smrgmkdir .libs 2>/dev/null
280452b01e16Smrgif test -d .libs; then
280552b01e16Smrg  lt_cv_objdir=.libs
28064b0ead49Smrgelse
280752b01e16Smrg  # MS-DOS does not allow filenames that begin with a dot.
280852b01e16Smrg  lt_cv_objdir=_libs
28094b0ead49Smrgfi
281052b01e16Smrgrmdir .libs 2>/dev/null])
281152b01e16Smrgobjdir=$lt_cv_objdir
281252b01e16Smrg])# AC_LIBTOOL_OBJDIR
28134b0ead49Smrg
281452b01e16Smrg
281552b01e16Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
281652b01e16Smrg# ----------------------------------------------
281752b01e16Smrg# Check hardcoding attributes.
281852b01e16SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
281952b01e16Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
282052b01e16Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
282152b01e16Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
282252b01e16Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
282352b01e16Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
282452b01e16Smrg
282552b01e16Smrg  # We can hardcode non-existant directories.
282652b01e16Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
282752b01e16Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
282852b01e16Smrg     # have to relink, otherwise we might link with an installed library
282952b01e16Smrg     # when we should be linking with a yet-to-be-installed one
283052b01e16Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
283152b01e16Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
283252b01e16Smrg    # Linking always hardcodes the temporary library directory.
283352b01e16Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
283452b01e16Smrg  else
283552b01e16Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
283652b01e16Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
283752b01e16Smrg  fi
28384b0ead49Smrgelse
283952b01e16Smrg  # We cannot hardcode anything, or else we can only hardcode existing
284052b01e16Smrg  # directories.
284152b01e16Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
28424b0ead49Smrgfi
284352b01e16SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
28444b0ead49Smrg
284552b01e16Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
284652b01e16Smrg  # Fast installation is not supported
284752b01e16Smrg  enable_fast_install=no
284852b01e16Smrgelif test "$shlibpath_overrides_runpath" = yes ||
284952b01e16Smrg     test "$enable_shared" = no; then
285052b01e16Smrg  # Fast installation is not necessary
285152b01e16Smrg  enable_fast_install=needless
285252b01e16Smrgfi
285352b01e16Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
28544b0ead49Smrg
28554b0ead49Smrg
285652b01e16Smrg# AC_LIBTOOL_SYS_LIB_STRIP
285752b01e16Smrg# ------------------------
285852b01e16SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
285952b01e16Smrg[striplib=
286052b01e16Smrgold_striplib=
286152b01e16SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
286252b01e16Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
286352b01e16Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
286452b01e16Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
286552b01e16Smrg  AC_MSG_RESULT([yes])
286652b01e16Smrgelse
286752b01e16Smrg# FIXME - insert some real tests, host_os isn't really good enough
286852b01e16Smrg  case $host_os in
286952b01e16Smrg   darwin*)
287052b01e16Smrg       if test -n "$STRIP" ; then
287152b01e16Smrg         striplib="$STRIP -x"
287252b01e16Smrg         old_striplib="$STRIP -S"
287352b01e16Smrg         AC_MSG_RESULT([yes])
287452b01e16Smrg       else
287552b01e16Smrg  AC_MSG_RESULT([no])
287652b01e16Smrgfi
287752b01e16Smrg       ;;
287852b01e16Smrg   *)
287952b01e16Smrg  AC_MSG_RESULT([no])
288052b01e16Smrg    ;;
288152b01e16Smrg  esac
288252b01e16Smrgfi
288352b01e16Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
28844b0ead49Smrg
28854b0ead49Smrg
288652b01e16Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
288752b01e16Smrg# -----------------------------
288852b01e16Smrg# PORTME Fill in your ld.so characteristics
288952b01e16SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
289052b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
289152b01e16SmrgAC_MSG_CHECKING([dynamic linker characteristics])
289252b01e16Smrglibrary_names_spec=
289352b01e16Smrglibname_spec='lib$name'
289452b01e16Smrgsoname_spec=
289552b01e16Smrgshrext_cmds=".so"
289652b01e16Smrgpostinstall_cmds=
289752b01e16Smrgpostuninstall_cmds=
289852b01e16Smrgfinish_cmds=
289952b01e16Smrgfinish_eval=
290052b01e16Smrgshlibpath_var=
290152b01e16Smrgshlibpath_overrides_runpath=unknown
290252b01e16Smrgversion_type=none
290352b01e16Smrgdynamic_linker="$host_os ld.so"
290452b01e16Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
290552b01e16Smrgm4_if($1,[],[
290652b01e16Smrgif test "$GCC" = yes; then
290752b01e16Smrg  case $host_os in
290852b01e16Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
290952b01e16Smrg    *) lt_awk_arg="/^libraries:/" ;;
291052b01e16Smrg  esac
291152b01e16Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
291252b01e16Smrg  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
291352b01e16Smrg    # if the path contains ";" then we assume it to be the separator
291452b01e16Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
291552b01e16Smrg    # assumed that no part of a normal pathname contains ";" but that should
291652b01e16Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
291752b01e16Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
291852b01e16Smrg  else
291952b01e16Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
292052b01e16Smrg  fi
292152b01e16Smrg  # Ok, now we have the path, separated by spaces, we can step through it
292252b01e16Smrg  # and add multilib dir if necessary.
292352b01e16Smrg  lt_tmp_lt_search_path_spec=
292452b01e16Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
292552b01e16Smrg  for lt_sys_path in $lt_search_path_spec; do
292652b01e16Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
292752b01e16Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
29284b0ead49Smrg    else
292952b01e16Smrg      test -d "$lt_sys_path" && \
293052b01e16Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
29314b0ead49Smrg    fi
293252b01e16Smrg  done
293352b01e16Smrg  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
293452b01e16SmrgBEGIN {RS=" "; FS="/|\n";} {
293552b01e16Smrg  lt_foo="";
293652b01e16Smrg  lt_count=0;
293752b01e16Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
293852b01e16Smrg    if ($lt_i != "" && $lt_i != ".") {
293952b01e16Smrg      if ($lt_i == "..") {
294052b01e16Smrg        lt_count++;
294152b01e16Smrg      } else {
294252b01e16Smrg        if (lt_count == 0) {
294352b01e16Smrg          lt_foo="/" $lt_i lt_foo;
294452b01e16Smrg        } else {
294552b01e16Smrg          lt_count--;
294652b01e16Smrg        }
294752b01e16Smrg      }
294852b01e16Smrg    }
294952b01e16Smrg  }
295052b01e16Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
295152b01e16Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
295252b01e16Smrg}'`
295352b01e16Smrg  sys_lib_search_path_spec=`echo $lt_search_path_spec`
295452b01e16Smrgelse
295552b01e16Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
295652b01e16Smrgfi])
295752b01e16Smrgneed_lib_prefix=unknown
295852b01e16Smrghardcode_into_libs=no
29594b0ead49Smrg
296052b01e16Smrg# when you set need_version to no, make sure it does not cause -set_version
296152b01e16Smrg# flags to be left without arguments
296252b01e16Smrgneed_version=unknown
29634b0ead49Smrg
296452b01e16Smrgcase $host_os in
296552b01e16Smrgaix3*)
296652b01e16Smrg  version_type=linux
296752b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
296852b01e16Smrg  shlibpath_var=LIBPATH
29694b0ead49Smrg
297052b01e16Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
297152b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
297252b01e16Smrg  ;;
29734b0ead49Smrg
297452b01e16Smrgaix[[4-9]]*)
297552b01e16Smrg  version_type=linux
297652b01e16Smrg  need_lib_prefix=no
297752b01e16Smrg  need_version=no
297852b01e16Smrg  hardcode_into_libs=yes
297952b01e16Smrg  if test "$host_cpu" = ia64; then
298052b01e16Smrg    # AIX 5 supports IA64
298152b01e16Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
298252b01e16Smrg    shlibpath_var=LD_LIBRARY_PATH
298352b01e16Smrg  else
298452b01e16Smrg    # With GCC up to 2.95.x, collect2 would create an import file
298552b01e16Smrg    # for dependence libraries.  The import file would start with
298652b01e16Smrg    # the line `#! .'.  This would cause the generated library to
298752b01e16Smrg    # depend on `.', always an invalid library.  This was fixed in
298852b01e16Smrg    # development snapshots of GCC prior to 3.0.
298952b01e16Smrg    case $host_os in
299052b01e16Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
299152b01e16Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
299252b01e16Smrg	   echo ' yes '
299352b01e16Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
299452b01e16Smrg	:
299552b01e16Smrg      else
299652b01e16Smrg	can_build_shared=no
299752b01e16Smrg      fi
299852b01e16Smrg      ;;
299952b01e16Smrg    esac
300052b01e16Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
300152b01e16Smrg    # soname into executable. Probably we can add versioning support to
300252b01e16Smrg    # collect2, so additional links can be useful in future.
300352b01e16Smrg    if test "$aix_use_runtimelinking" = yes; then
300452b01e16Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
300552b01e16Smrg      # instead of lib<name>.a to let people know that these are not
300652b01e16Smrg      # typical AIX shared libraries.
300752b01e16Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
30084b0ead49Smrg    else
300952b01e16Smrg      # We preserve .a as extension for shared libraries through AIX4.2
301052b01e16Smrg      # and later when we are not doing run time linking.
301152b01e16Smrg      library_names_spec='${libname}${release}.a $libname.a'
301252b01e16Smrg      soname_spec='${libname}${release}${shared_ext}$major'
30134b0ead49Smrg    fi
301452b01e16Smrg    shlibpath_var=LIBPATH
301552b01e16Smrg  fi
301652b01e16Smrg  ;;
30174b0ead49Smrg
301852b01e16Smrgamigaos*)
301952b01e16Smrg  library_names_spec='$libname.ixlibrary $libname.a'
302052b01e16Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
302152b01e16Smrg  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
302252b01e16Smrg  ;;
30234b0ead49Smrg
302452b01e16Smrgbeos*)
302552b01e16Smrg  library_names_spec='${libname}${shared_ext}'
302652b01e16Smrg  dynamic_linker="$host_os ld.so"
302752b01e16Smrg  shlibpath_var=LIBRARY_PATH
302852b01e16Smrg  ;;
30294b0ead49Smrg
303052b01e16Smrgbsdi[[45]]*)
303152b01e16Smrg  version_type=linux
303252b01e16Smrg  need_version=no
303352b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
303452b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
303552b01e16Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
303652b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
303752b01e16Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
303852b01e16Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
303952b01e16Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
304052b01e16Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
304152b01e16Smrg  # libtool to hard-code these into programs
304252b01e16Smrg  ;;
30434b0ead49Smrg
304452b01e16Smrgcygwin* | mingw* | pw32*)
304552b01e16Smrg  version_type=windows
304652b01e16Smrg  shrext_cmds=".dll"
304752b01e16Smrg  need_version=no
304852b01e16Smrg  need_lib_prefix=no
30494b0ead49Smrg
305052b01e16Smrg  case $GCC,$host_os in
305152b01e16Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
305252b01e16Smrg    library_names_spec='$libname.dll.a'
305352b01e16Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
305452b01e16Smrg    postinstall_cmds='base_file=`basename \${file}`~
305552b01e16Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
305652b01e16Smrg      dldir=$destdir/`dirname \$dlpath`~
305752b01e16Smrg      test -d \$dldir || mkdir -p \$dldir~
305852b01e16Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
305952b01e16Smrg      chmod a+x \$dldir/$dlname'
306052b01e16Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
306152b01e16Smrg      dlpath=$dir/\$dldll~
306252b01e16Smrg       $rm \$dlpath'
306352b01e16Smrg    shlibpath_overrides_runpath=yes
306452b01e16Smrg
306552b01e16Smrg    case $host_os in
306652b01e16Smrg    cygwin*)
306752b01e16Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
306852b01e16Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
306952b01e16Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
307052b01e16Smrg      ;;
307152b01e16Smrg    mingw*)
307252b01e16Smrg      # MinGW DLLs use traditional 'lib' prefix
307352b01e16Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
307452b01e16Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
307552b01e16Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
307652b01e16Smrg        # It is most probably a Windows format PATH printed by
307752b01e16Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
307852b01e16Smrg        # path with ; separators, and with drive letters. We can handle the
307952b01e16Smrg        # drive letters (cygwin fileutils understands them), so leave them,
308052b01e16Smrg        # especially as we might pass files found there to a mingw objdump,
308152b01e16Smrg        # which wouldn't understand a cygwinified path. Ahh.
308252b01e16Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
30834b0ead49Smrg      else
308452b01e16Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
30854b0ead49Smrg      fi
308652b01e16Smrg      ;;
308752b01e16Smrg    pw32*)
308852b01e16Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
308952b01e16Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
309052b01e16Smrg      ;;
309152b01e16Smrg    esac
30924b0ead49Smrg    ;;
30934b0ead49Smrg
309452b01e16Smrg  *)
309552b01e16Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
30964b0ead49Smrg    ;;
309752b01e16Smrg  esac
309852b01e16Smrg  dynamic_linker='Win32 ld.exe'
309952b01e16Smrg  # FIXME: first we should search . and the directory the executable is in
310052b01e16Smrg  shlibpath_var=PATH
310152b01e16Smrg  ;;
31024b0ead49Smrg
310352b01e16Smrgdarwin* | rhapsody*)
310452b01e16Smrg  dynamic_linker="$host_os dyld"
310552b01e16Smrg  version_type=darwin
310652b01e16Smrg  need_lib_prefix=no
310752b01e16Smrg  need_version=no
310852b01e16Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
310952b01e16Smrg  soname_spec='${libname}${release}${major}$shared_ext'
311052b01e16Smrg  shlibpath_overrides_runpath=yes
311152b01e16Smrg  shlibpath_var=DYLD_LIBRARY_PATH
311252b01e16Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
311352b01e16Smrg  m4_if([$1], [],[
311452b01e16Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
311552b01e16Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
311652b01e16Smrg  ;;
31174b0ead49Smrg
311852b01e16Smrgdgux*)
311952b01e16Smrg  version_type=linux
312052b01e16Smrg  need_lib_prefix=no
312152b01e16Smrg  need_version=no
312252b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
312352b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
312452b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
31254b0ead49Smrg  ;;
31264b0ead49Smrg
312752b01e16Smrgfreebsd1*)
312852b01e16Smrg  dynamic_linker=no
312952b01e16Smrg  ;;
31304b0ead49Smrg
313152b01e16Smrgfreebsd* | dragonfly*)
313252b01e16Smrg  # DragonFly does not have aout.  When/if they implement a new
313352b01e16Smrg  # versioning mechanism, adjust this.
313452b01e16Smrg  if test -x /usr/bin/objformat; then
313552b01e16Smrg    objformat=`/usr/bin/objformat`
313652b01e16Smrg  else
313752b01e16Smrg    case $host_os in
313852b01e16Smrg    freebsd[[123]]*) objformat=aout ;;
313952b01e16Smrg    *) objformat=elf ;;
31404b0ead49Smrg    esac
314152b01e16Smrg  fi
314252b01e16Smrg  version_type=freebsd-$objformat
314352b01e16Smrg  case $version_type in
314452b01e16Smrg    freebsd-elf*)
314552b01e16Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
314652b01e16Smrg      need_version=no
314752b01e16Smrg      need_lib_prefix=no
314852b01e16Smrg      ;;
314952b01e16Smrg    freebsd-*)
315052b01e16Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
315152b01e16Smrg      need_version=yes
315252b01e16Smrg      ;;
315352b01e16Smrg  esac
315452b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
315552b01e16Smrg  case $host_os in
315652b01e16Smrg  freebsd2*)
315752b01e16Smrg    shlibpath_overrides_runpath=yes
31584b0ead49Smrg    ;;
315952b01e16Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
316052b01e16Smrg    shlibpath_overrides_runpath=yes
316152b01e16Smrg    hardcode_into_libs=yes
31624b0ead49Smrg    ;;
316352b01e16Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
316452b01e16Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
316552b01e16Smrg    shlibpath_overrides_runpath=no
316652b01e16Smrg    hardcode_into_libs=yes
31674b0ead49Smrg    ;;
316852b01e16Smrg  *) # from 4.6 on, and DragonFly
316952b01e16Smrg    shlibpath_overrides_runpath=yes
317052b01e16Smrg    hardcode_into_libs=yes
31714b0ead49Smrg    ;;
317252b01e16Smrg  esac
317352b01e16Smrg  ;;
317452b01e16Smrg
317552b01e16Smrggnu*)
317652b01e16Smrg  version_type=linux
317752b01e16Smrg  need_lib_prefix=no
317852b01e16Smrg  need_version=no
317952b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
318052b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
318152b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
318252b01e16Smrg  hardcode_into_libs=yes
318352b01e16Smrg  ;;
318452b01e16Smrg
318552b01e16Smrghpux9* | hpux10* | hpux11*)
318652b01e16Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
318752b01e16Smrg  # link against other versions.
318852b01e16Smrg  version_type=sunos
318952b01e16Smrg  need_lib_prefix=no
319052b01e16Smrg  need_version=no
319152b01e16Smrg  case $host_cpu in
319252b01e16Smrg  ia64*)
319352b01e16Smrg    shrext_cmds='.so'
319452b01e16Smrg    hardcode_into_libs=yes
319552b01e16Smrg    dynamic_linker="$host_os dld.so"
319652b01e16Smrg    shlibpath_var=LD_LIBRARY_PATH
319752b01e16Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
319852b01e16Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
319952b01e16Smrg    soname_spec='${libname}${release}${shared_ext}$major'
320052b01e16Smrg    if test "X$HPUX_IA64_MODE" = X32; then
320152b01e16Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
320252b01e16Smrg    else
320352b01e16Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
320452b01e16Smrg    fi
320552b01e16Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
32064b0ead49Smrg    ;;
320752b01e16Smrg   hppa*64*)
320852b01e16Smrg     shrext_cmds='.sl'
320952b01e16Smrg     hardcode_into_libs=yes
321052b01e16Smrg     dynamic_linker="$host_os dld.sl"
321152b01e16Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
321252b01e16Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
321352b01e16Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
321452b01e16Smrg     soname_spec='${libname}${release}${shared_ext}$major'
321552b01e16Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
321652b01e16Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
321752b01e16Smrg     ;;
321852b01e16Smrg   *)
321952b01e16Smrg    shrext_cmds='.sl'
322052b01e16Smrg    dynamic_linker="$host_os dld.sl"
322152b01e16Smrg    shlibpath_var=SHLIB_PATH
322252b01e16Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
322352b01e16Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
322452b01e16Smrg    soname_spec='${libname}${release}${shared_ext}$major'
322552b01e16Smrg    ;;
322652b01e16Smrg  esac
322752b01e16Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
322852b01e16Smrg  postinstall_cmds='chmod 555 $lib'
322952b01e16Smrg  ;;
32304b0ead49Smrg
323152b01e16Smrginterix[[3-9]]*)
323252b01e16Smrg  version_type=linux
323352b01e16Smrg  need_lib_prefix=no
323452b01e16Smrg  need_version=no
323552b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
323652b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
323752b01e16Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
323852b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
323952b01e16Smrg  shlibpath_overrides_runpath=no
324052b01e16Smrg  hardcode_into_libs=yes
324152b01e16Smrg  ;;
324252b01e16Smrg
324352b01e16Smrgirix5* | irix6* | nonstopux*)
324452b01e16Smrg  case $host_os in
324552b01e16Smrg    nonstopux*) version_type=nonstopux ;;
32464b0ead49Smrg    *)
324752b01e16Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
324852b01e16Smrg		version_type=linux
324952b01e16Smrg	else
325052b01e16Smrg		version_type=irix
325152b01e16Smrg	fi ;;
325252b01e16Smrg  esac
325352b01e16Smrg  need_lib_prefix=no
325452b01e16Smrg  need_version=no
325552b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
325652b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
325752b01e16Smrg  case $host_os in
325852b01e16Smrg  irix5* | nonstopux*)
325952b01e16Smrg    libsuff= shlibsuff=
326052b01e16Smrg    ;;
326152b01e16Smrg  *)
326252b01e16Smrg    case $LD in # libtool.m4 will add one of these switches to LD
326352b01e16Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
326452b01e16Smrg      libsuff= shlibsuff= libmagic=32-bit;;
326552b01e16Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
326652b01e16Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
326752b01e16Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
326852b01e16Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
326952b01e16Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
32704b0ead49Smrg    esac
32714b0ead49Smrg    ;;
327252b01e16Smrg  esac
327352b01e16Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
327452b01e16Smrg  shlibpath_overrides_runpath=no
327552b01e16Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
327652b01e16Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
327752b01e16Smrg  hardcode_into_libs=yes
327852b01e16Smrg  ;;
32794b0ead49Smrg
328052b01e16Smrg# No shared lib support for Linux oldld, aout, or coff.
328152b01e16Smrglinux*oldld* | linux*aout* | linux*coff*)
328252b01e16Smrg  dynamic_linker=no
328352b01e16Smrg  ;;
32844b0ead49Smrg
328552b01e16Smrg# This must be Linux ELF.
328652b01e16Smrglinux* | k*bsd*-gnu)
328752b01e16Smrg  version_type=linux
328852b01e16Smrg  need_lib_prefix=no
328952b01e16Smrg  need_version=no
329052b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
329152b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
329252b01e16Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
329352b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
329452b01e16Smrg  shlibpath_overrides_runpath=no
329552b01e16Smrg  # This implies no fast_install, which is unacceptable.
329652b01e16Smrg  # Some rework will be needed to allow for fast_install
329752b01e16Smrg  # before this can be enabled.
329852b01e16Smrg  hardcode_into_libs=yes
32994b0ead49Smrg
330052b01e16Smrg  # Append ld.so.conf contents to the search path
330152b01e16Smrg  if test -f /etc/ld.so.conf; then
330252b01e16Smrg    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;/^$/d' | tr '\n' ' '`
330352b01e16Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
330452b01e16Smrg  fi
33054b0ead49Smrg
330652b01e16Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
330752b01e16Smrg  # powerpc, because MkLinux only supported shared libraries with the
330852b01e16Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
330952b01e16Smrg  # most powerpc-linux boxes support dynamic linking these days and
331052b01e16Smrg  # people can always --disable-shared, the test was removed, and we
331152b01e16Smrg  # assume the GNU/Linux dynamic linker is in use.
331252b01e16Smrg  dynamic_linker='GNU/Linux ld.so'
331352b01e16Smrg  ;;
33144b0ead49Smrg
331552b01e16Smrgnetbsd*)
331652b01e16Smrg  version_type=sunos
331752b01e16Smrg  need_lib_prefix=no
331852b01e16Smrg  need_version=no
331952b01e16Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
332052b01e16Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
332152b01e16Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
332252b01e16Smrg    dynamic_linker='NetBSD (a.out) ld.so'
332352b01e16Smrg  else
332452b01e16Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
332552b01e16Smrg    soname_spec='${libname}${release}${shared_ext}$major'
332652b01e16Smrg    dynamic_linker='NetBSD ld.elf_so'
332752b01e16Smrg  fi
332852b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
332952b01e16Smrg  shlibpath_overrides_runpath=yes
333052b01e16Smrg  hardcode_into_libs=yes
333152b01e16Smrg  ;;
33324b0ead49Smrg
333352b01e16Smrgnewsos6)
333452b01e16Smrg  version_type=linux
333552b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
333652b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
333752b01e16Smrg  shlibpath_overrides_runpath=yes
333852b01e16Smrg  ;;
333952b01e16Smrg
334052b01e16Smrgnto-qnx*)
334152b01e16Smrg  version_type=linux
334252b01e16Smrg  need_lib_prefix=no
334352b01e16Smrg  need_version=no
334452b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
334552b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
334652b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
334752b01e16Smrg  shlibpath_overrides_runpath=yes
334852b01e16Smrg  ;;
334952b01e16Smrg
335052b01e16Smrgopenbsd*)
335152b01e16Smrg  version_type=sunos
335252b01e16Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
335352b01e16Smrg  need_lib_prefix=no
335452b01e16Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
335552b01e16Smrg  case $host_os in
335652b01e16Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
335752b01e16Smrg    *)                         need_version=no  ;;
335852b01e16Smrg  esac
335952b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
336052b01e16Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
336152b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
336252b01e16Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
336352b01e16Smrg    case $host_os in
336452b01e16Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
336552b01e16Smrg	shlibpath_overrides_runpath=no
33664b0ead49Smrg	;;
336752b01e16Smrg      *)
336852b01e16Smrg	shlibpath_overrides_runpath=yes
33694b0ead49Smrg	;;
337052b01e16Smrg      esac
337152b01e16Smrg  else
337252b01e16Smrg    shlibpath_overrides_runpath=yes
337352b01e16Smrg  fi
337452b01e16Smrg  ;;
33754b0ead49Smrg
337652b01e16Smrgos2*)
337752b01e16Smrg  libname_spec='$name'
337852b01e16Smrg  shrext_cmds=".dll"
337952b01e16Smrg  need_lib_prefix=no
338052b01e16Smrg  library_names_spec='$libname${shared_ext} $libname.a'
338152b01e16Smrg  dynamic_linker='OS/2 ld.exe'
338252b01e16Smrg  shlibpath_var=LIBPATH
338352b01e16Smrg  ;;
33844b0ead49Smrg
338552b01e16Smrgosf3* | osf4* | osf5*)
338652b01e16Smrg  version_type=osf
338752b01e16Smrg  need_lib_prefix=no
338852b01e16Smrg  need_version=no
338952b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
339052b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
339152b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
339252b01e16Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
339352b01e16Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
339452b01e16Smrg  ;;
33954b0ead49Smrg
339652b01e16Smrgrdos*)
339752b01e16Smrg  dynamic_linker=no
339852b01e16Smrg  ;;
33994b0ead49Smrg
340052b01e16Smrgsolaris*)
340152b01e16Smrg  version_type=linux
340252b01e16Smrg  need_lib_prefix=no
340352b01e16Smrg  need_version=no
340452b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
340552b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
340652b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
340752b01e16Smrg  shlibpath_overrides_runpath=yes
340852b01e16Smrg  hardcode_into_libs=yes
340952b01e16Smrg  # ldd complains unless libraries are executable
341052b01e16Smrg  postinstall_cmds='chmod +x $lib'
341152b01e16Smrg  ;;
34124b0ead49Smrg
341352b01e16Smrgsunos4*)
341452b01e16Smrg  version_type=sunos
341552b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
341652b01e16Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
341752b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
341852b01e16Smrg  shlibpath_overrides_runpath=yes
341952b01e16Smrg  if test "$with_gnu_ld" = yes; then
342052b01e16Smrg    need_lib_prefix=no
342152b01e16Smrg  fi
342252b01e16Smrg  need_version=yes
342352b01e16Smrg  ;;
34244b0ead49Smrg
342552b01e16Smrgsysv4 | sysv4.3*)
342652b01e16Smrg  version_type=linux
342752b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
342852b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
342952b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
343052b01e16Smrg  case $host_vendor in
343152b01e16Smrg    sni)
343252b01e16Smrg      shlibpath_overrides_runpath=no
343352b01e16Smrg      need_lib_prefix=no
343452b01e16Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
343552b01e16Smrg      runpath_var=LD_RUN_PATH
343652b01e16Smrg      ;;
343752b01e16Smrg    siemens)
343852b01e16Smrg      need_lib_prefix=no
343952b01e16Smrg      ;;
344052b01e16Smrg    motorola)
344152b01e16Smrg      need_lib_prefix=no
344252b01e16Smrg      need_version=no
344352b01e16Smrg      shlibpath_overrides_runpath=no
344452b01e16Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
344552b01e16Smrg      ;;
344652b01e16Smrg  esac
344752b01e16Smrg  ;;
34484b0ead49Smrg
344952b01e16Smrgsysv4*MP*)
345052b01e16Smrg  if test -d /usr/nec ;then
345152b01e16Smrg    version_type=linux
345252b01e16Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
345352b01e16Smrg    soname_spec='$libname${shared_ext}.$major'
345452b01e16Smrg    shlibpath_var=LD_LIBRARY_PATH
345552b01e16Smrg  fi
345652b01e16Smrg  ;;
345752b01e16Smrg
345852b01e16Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
345952b01e16Smrg  version_type=freebsd-elf
346052b01e16Smrg  need_lib_prefix=no
346152b01e16Smrg  need_version=no
346252b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
346352b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
346452b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
346552b01e16Smrg  hardcode_into_libs=yes
346652b01e16Smrg  if test "$with_gnu_ld" = yes; then
346752b01e16Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
346852b01e16Smrg    shlibpath_overrides_runpath=no
346952b01e16Smrg  else
347052b01e16Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
347152b01e16Smrg    shlibpath_overrides_runpath=yes
347252b01e16Smrg    case $host_os in
347352b01e16Smrg      sco3.2v5*)
347452b01e16Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
34754b0ead49Smrg	;;
347652b01e16Smrg    esac
347752b01e16Smrg  fi
347852b01e16Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
347952b01e16Smrg  ;;
34804b0ead49Smrg
348152b01e16Smrguts4*)
348252b01e16Smrg  version_type=linux
348352b01e16Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
348452b01e16Smrg  soname_spec='${libname}${release}${shared_ext}$major'
348552b01e16Smrg  shlibpath_var=LD_LIBRARY_PATH
348652b01e16Smrg  ;;
34874b0ead49Smrg
348852b01e16Smrg*)
348952b01e16Smrg  dynamic_linker=no
349052b01e16Smrg  ;;
349152b01e16Smrgesac
349252b01e16SmrgAC_MSG_RESULT([$dynamic_linker])
349352b01e16Smrgtest "$dynamic_linker" = no && can_build_shared=no
34944b0ead49Smrg
349552b01e16SmrgAC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
349652b01e16Smrg[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
349752b01e16Smrgsys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
349852b01e16SmrgAC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
349952b01e16Smrg[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
350052b01e16Smrgsys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
35014b0ead49Smrg
350252b01e16Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
350352b01e16Smrgif test "$GCC" = yes; then
350452b01e16Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
350552b01e16Smrgfi
350652b01e16Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
35074b0ead49Smrg
35084b0ead49Smrg
350952b01e16Smrg# _LT_AC_TAGCONFIG
351052b01e16Smrg# ----------------
351152b01e16SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
351252b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
351352b01e16SmrgAC_ARG_WITH([tags],
351452b01e16Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
351552b01e16Smrg        [include additional configurations @<:@automatic@:>@])],
351652b01e16Smrg    [tagnames="$withval"])
35174b0ead49Smrg
351852b01e16Smrgif test -f "$ltmain" && test -n "$tagnames"; then
351952b01e16Smrg  if test ! -f "${ofile}"; then
352052b01e16Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
352152b01e16Smrg  fi
35224b0ead49Smrg
352352b01e16Smrg  if test -z "$LTCC"; then
352452b01e16Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
352552b01e16Smrg    if test -z "$LTCC"; then
352652b01e16Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
352752b01e16Smrg    else
352852b01e16Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
352952b01e16Smrg    fi
353052b01e16Smrg  fi
353152b01e16Smrg  if test -z "$LTCFLAGS"; then
353252b01e16Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
353352b01e16Smrg  fi
35344b0ead49Smrg
353552b01e16Smrg  # Extract list of available tagged configurations in $ofile.
353652b01e16Smrg  # Note that this assumes the entire list is on one line.
353752b01e16Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
35384b0ead49Smrg
353952b01e16Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
354052b01e16Smrg  for tagname in $tagnames; do
354152b01e16Smrg    IFS="$lt_save_ifs"
354252b01e16Smrg    # Check whether tagname contains only valid characters
354352b01e16Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
354452b01e16Smrg    "") ;;
354552b01e16Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
35464b0ead49Smrg	;;
354752b01e16Smrg    esac
35484b0ead49Smrg
354952b01e16Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
355052b01e16Smrg    then
355152b01e16Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
355252b01e16Smrg    fi
35534b0ead49Smrg
355452b01e16Smrg    # Update the list of available tags.
355552b01e16Smrg    if test -n "$tagname"; then
355652b01e16Smrg      echo appending configuration tag \"$tagname\" to $ofile
35574b0ead49Smrg
355852b01e16Smrg      case $tagname in
355952b01e16Smrg      CXX)
356052b01e16Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
356152b01e16Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
356252b01e16Smrg	    (test "X$CXX" != "Xg++"))) ; then
356352b01e16Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
35644b0ead49Smrg	else
356552b01e16Smrg	  tagname=""
35664b0ead49Smrg	fi
35674b0ead49Smrg	;;
356852b01e16Smrg
356952b01e16Smrg      F77)
357052b01e16Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
357152b01e16Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
357252b01e16Smrg	else
357352b01e16Smrg	  tagname=""
357452b01e16Smrg	fi
35754b0ead49Smrg	;;
357652b01e16Smrg
357752b01e16Smrg      GCJ)
357852b01e16Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
357952b01e16Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
358052b01e16Smrg	else
358152b01e16Smrg	  tagname=""
358252b01e16Smrg	fi
35834b0ead49Smrg	;;
358452b01e16Smrg
358552b01e16Smrg      RC)
358652b01e16Smrg	AC_LIBTOOL_LANG_RC_CONFIG
358752b01e16Smrg	;;
358852b01e16Smrg
35894b0ead49Smrg      *)
359052b01e16Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
35914b0ead49Smrg	;;
359252b01e16Smrg      esac
35934b0ead49Smrg
359452b01e16Smrg      # Append the new tag name to the list of available tags.
359552b01e16Smrg      if test -n "$tagname" ; then
359652b01e16Smrg      available_tags="$available_tags $tagname"
359752b01e16Smrg    fi
359852b01e16Smrg    fi
359952b01e16Smrg  done
360052b01e16Smrg  IFS="$lt_save_ifs"
36014b0ead49Smrg
360252b01e16Smrg  # Now substitute the updated list of available tags.
360352b01e16Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
360452b01e16Smrg    mv "${ofile}T" "$ofile"
360552b01e16Smrg    chmod +x "$ofile"
360652b01e16Smrg  else
360752b01e16Smrg    rm -f "${ofile}T"
360852b01e16Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
360952b01e16Smrg  fi
361052b01e16Smrgfi
361152b01e16Smrg])# _LT_AC_TAGCONFIG
36124b0ead49Smrg
36134b0ead49Smrg
361452b01e16Smrg# AC_LIBTOOL_DLOPEN
361552b01e16Smrg# -----------------
361652b01e16Smrg# enable checks for dlopen support
361752b01e16SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
361852b01e16Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
361952b01e16Smrg])# AC_LIBTOOL_DLOPEN
36204b0ead49Smrg
36214b0ead49Smrg
362252b01e16Smrg# AC_LIBTOOL_WIN32_DLL
362352b01e16Smrg# --------------------
362452b01e16Smrg# declare package support for building win32 DLLs
362552b01e16SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
362652b01e16Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
362752b01e16Smrg])# AC_LIBTOOL_WIN32_DLL
36284b0ead49Smrg
362952b01e16Smrg
363052b01e16Smrg# AC_ENABLE_SHARED([DEFAULT])
363152b01e16Smrg# ---------------------------
363252b01e16Smrg# implement the --enable-shared flag
363352b01e16Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
363452b01e16SmrgAC_DEFUN([AC_ENABLE_SHARED],
363552b01e16Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
363652b01e16SmrgAC_ARG_ENABLE([shared],
363752b01e16Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
363852b01e16Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
363952b01e16Smrg    [p=${PACKAGE-default}
364052b01e16Smrg    case $enableval in
364152b01e16Smrg    yes) enable_shared=yes ;;
364252b01e16Smrg    no) enable_shared=no ;;
364352b01e16Smrg    *)
364452b01e16Smrg      enable_shared=no
364552b01e16Smrg      # Look at the argument we got.  We use all the common list separators.
364652b01e16Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
364752b01e16Smrg      for pkg in $enableval; do
364852b01e16Smrg	IFS="$lt_save_ifs"
364952b01e16Smrg	if test "X$pkg" = "X$p"; then
365052b01e16Smrg	  enable_shared=yes
36514b0ead49Smrg	fi
365252b01e16Smrg      done
365352b01e16Smrg      IFS="$lt_save_ifs"
365452b01e16Smrg      ;;
365552b01e16Smrg    esac],
365652b01e16Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
365752b01e16Smrg])# AC_ENABLE_SHARED
36584b0ead49Smrg
36594b0ead49Smrg
366052b01e16Smrg# AC_DISABLE_SHARED
366152b01e16Smrg# -----------------
366252b01e16Smrg# set the default shared flag to --disable-shared
366352b01e16SmrgAC_DEFUN([AC_DISABLE_SHARED],
366452b01e16Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
366552b01e16SmrgAC_ENABLE_SHARED(no)
366652b01e16Smrg])# AC_DISABLE_SHARED
36674b0ead49Smrg
36684b0ead49Smrg
366952b01e16Smrg# AC_ENABLE_STATIC([DEFAULT])
367052b01e16Smrg# ---------------------------
367152b01e16Smrg# implement the --enable-static flag
367252b01e16Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
367352b01e16SmrgAC_DEFUN([AC_ENABLE_STATIC],
367452b01e16Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
367552b01e16SmrgAC_ARG_ENABLE([static],
367652b01e16Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
367752b01e16Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
367852b01e16Smrg    [p=${PACKAGE-default}
367952b01e16Smrg    case $enableval in
368052b01e16Smrg    yes) enable_static=yes ;;
368152b01e16Smrg    no) enable_static=no ;;
368252b01e16Smrg    *)
368352b01e16Smrg     enable_static=no
368452b01e16Smrg      # Look at the argument we got.  We use all the common list separators.
368552b01e16Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
368652b01e16Smrg      for pkg in $enableval; do
368752b01e16Smrg	IFS="$lt_save_ifs"
368852b01e16Smrg	if test "X$pkg" = "X$p"; then
368952b01e16Smrg	  enable_static=yes
369052b01e16Smrg	fi
369152b01e16Smrg      done
369252b01e16Smrg      IFS="$lt_save_ifs"
369352b01e16Smrg      ;;
369452b01e16Smrg    esac],
369552b01e16Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
369652b01e16Smrg])# AC_ENABLE_STATIC
36974b0ead49Smrg
36984b0ead49Smrg
369952b01e16Smrg# AC_DISABLE_STATIC
370052b01e16Smrg# -----------------
370152b01e16Smrg# set the default static flag to --disable-static
370252b01e16SmrgAC_DEFUN([AC_DISABLE_STATIC],
370352b01e16Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
370452b01e16SmrgAC_ENABLE_STATIC(no)
370552b01e16Smrg])# AC_DISABLE_STATIC
37064b0ead49Smrg
37074b0ead49Smrg
370852b01e16Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
370952b01e16Smrg# ---------------------------------
371052b01e16Smrg# implement the --enable-fast-install flag
371152b01e16Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
371252b01e16SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
371352b01e16Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
371452b01e16SmrgAC_ARG_ENABLE([fast-install],
371552b01e16Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
371652b01e16Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
371752b01e16Smrg    [p=${PACKAGE-default}
371852b01e16Smrg    case $enableval in
371952b01e16Smrg    yes) enable_fast_install=yes ;;
372052b01e16Smrg    no) enable_fast_install=no ;;
372152b01e16Smrg    *)
372252b01e16Smrg      enable_fast_install=no
372352b01e16Smrg      # Look at the argument we got.  We use all the common list separators.
372452b01e16Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
372552b01e16Smrg      for pkg in $enableval; do
372652b01e16Smrg	IFS="$lt_save_ifs"
372752b01e16Smrg	if test "X$pkg" = "X$p"; then
372852b01e16Smrg	  enable_fast_install=yes
372952b01e16Smrg	fi
373052b01e16Smrg      done
373152b01e16Smrg      IFS="$lt_save_ifs"
373252b01e16Smrg      ;;
373352b01e16Smrg    esac],
373452b01e16Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
373552b01e16Smrg])# AC_ENABLE_FAST_INSTALL
37364b0ead49Smrg
37374b0ead49Smrg
373852b01e16Smrg# AC_DISABLE_FAST_INSTALL
373952b01e16Smrg# -----------------------
374052b01e16Smrg# set the default to --disable-fast-install
374152b01e16SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
374252b01e16Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
374352b01e16SmrgAC_ENABLE_FAST_INSTALL(no)
374452b01e16Smrg])# AC_DISABLE_FAST_INSTALL
37454b0ead49Smrg
37464b0ead49Smrg
374752b01e16Smrg# AC_LIBTOOL_PICMODE([MODE])
374852b01e16Smrg# --------------------------
374952b01e16Smrg# implement the --with-pic flag
375052b01e16Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
375152b01e16SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
375252b01e16Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
375352b01e16Smrgpic_mode=ifelse($#,1,$1,default)
375452b01e16Smrg])# AC_LIBTOOL_PICMODE
37554b0ead49Smrg
37564b0ead49Smrg
375752b01e16Smrg# AC_PROG_EGREP
375852b01e16Smrg# -------------
375952b01e16Smrg# This is predefined starting with Autoconf 2.54, so this conditional
376052b01e16Smrg# definition can be removed once we require Autoconf 2.54 or later.
376152b01e16Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
376252b01e16Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
376352b01e16Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
376452b01e16Smrg    then ac_cv_prog_egrep='grep -E'
376552b01e16Smrg    else ac_cv_prog_egrep='egrep'
376652b01e16Smrg    fi])
376752b01e16Smrg EGREP=$ac_cv_prog_egrep
376852b01e16Smrg AC_SUBST([EGREP])
376952b01e16Smrg])])
37704b0ead49Smrg
37714b0ead49Smrg
377252b01e16Smrg# AC_PATH_TOOL_PREFIX
377352b01e16Smrg# -------------------
377452b01e16Smrg# find a file program which can recognize shared library
377552b01e16SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
377652b01e16Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
377752b01e16SmrgAC_MSG_CHECKING([for $1])
377852b01e16SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
377952b01e16Smrg[case $MAGIC_CMD in
378052b01e16Smrg[[\\/*] |  ?:[\\/]*])
378152b01e16Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
378252b01e16Smrg  ;;
378352b01e16Smrg*)
378452b01e16Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
378552b01e16Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
378652b01e16Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
378752b01e16Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
378852b01e16Smrgdnl not every word.  This closes a longstanding sh security hole.
378952b01e16Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
379052b01e16Smrg  for ac_dir in $ac_dummy; do
379152b01e16Smrg    IFS="$lt_save_ifs"
379252b01e16Smrg    test -z "$ac_dir" && ac_dir=.
379352b01e16Smrg    if test -f $ac_dir/$1; then
379452b01e16Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
379552b01e16Smrg      if test -n "$file_magic_test_file"; then
379652b01e16Smrg	case $deplibs_check_method in
379752b01e16Smrg	"file_magic "*)
379852b01e16Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
379952b01e16Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
380052b01e16Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
380152b01e16Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
380252b01e16Smrg	    :
380352b01e16Smrg	  else
380452b01e16Smrg	    cat <<EOF 1>&2
38054b0ead49Smrg
380652b01e16Smrg*** Warning: the command libtool uses to detect shared libraries,
380752b01e16Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
380852b01e16Smrg*** The result is that libtool may fail to recognize shared libraries
380952b01e16Smrg*** as such.  This will affect the creation of libtool libraries that
381052b01e16Smrg*** depend on shared libraries, but programs linked with such libtool
381152b01e16Smrg*** libraries will work regardless of this problem.  Nevertheless, you
381252b01e16Smrg*** may want to report the problem to your system manager and/or to
381352b01e16Smrg*** bug-libtool@gnu.org
381452b01e16Smrg
381552b01e16SmrgEOF
381652b01e16Smrg	  fi ;;
381752b01e16Smrg	esac
381852b01e16Smrg      fi
381952b01e16Smrg      break
382052b01e16Smrg    fi
382152b01e16Smrg  done
382252b01e16Smrg  IFS="$lt_save_ifs"
382352b01e16Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
382452b01e16Smrg  ;;
382552b01e16Smrgesac])
382652b01e16SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
382752b01e16Smrgif test -n "$MAGIC_CMD"; then
382852b01e16Smrg  AC_MSG_RESULT($MAGIC_CMD)
38294b0ead49Smrgelse
383052b01e16Smrg  AC_MSG_RESULT(no)
38314b0ead49Smrgfi
383252b01e16Smrg])# AC_PATH_TOOL_PREFIX
38334b0ead49Smrg
38344b0ead49Smrg
383552b01e16Smrg# AC_PATH_MAGIC
383652b01e16Smrg# -------------
383752b01e16Smrg# find a file program which can recognize a shared library
383852b01e16SmrgAC_DEFUN([AC_PATH_MAGIC],
383952b01e16Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
384052b01e16Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
384152b01e16Smrg  if test -n "$ac_tool_prefix"; then
384252b01e16Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
384352b01e16Smrg  else
384452b01e16Smrg    MAGIC_CMD=:
384552b01e16Smrg  fi
384652b01e16Smrgfi
384752b01e16Smrg])# AC_PATH_MAGIC
38484b0ead49Smrg
384952b01e16Smrg
385052b01e16Smrg# AC_PROG_LD
385152b01e16Smrg# ----------
385252b01e16Smrg# find the pathname to the GNU or non-GNU linker
385352b01e16SmrgAC_DEFUN([AC_PROG_LD],
385452b01e16Smrg[AC_ARG_WITH([gnu-ld],
385552b01e16Smrg    [AC_HELP_STRING([--with-gnu-ld],
385652b01e16Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
385752b01e16Smrg    [test "$withval" = no || with_gnu_ld=yes],
385852b01e16Smrg    [with_gnu_ld=no])
385952b01e16SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
386052b01e16SmrgAC_REQUIRE([AC_PROG_CC])dnl
386152b01e16SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
386252b01e16SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
386352b01e16Smrgac_prog=ld
386452b01e16Smrgif test "$GCC" = yes; then
386552b01e16Smrg  # Check if gcc -print-prog-name=ld gives a path.
386652b01e16Smrg  AC_MSG_CHECKING([for ld used by $CC])
386752b01e16Smrg  case $host in
386852b01e16Smrg  *-*-mingw*)
386952b01e16Smrg    # gcc leaves a trailing carriage return which upsets mingw
387052b01e16Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
387152b01e16Smrg  *)
387252b01e16Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
387352b01e16Smrg  esac
387452b01e16Smrg  case $ac_prog in
387552b01e16Smrg    # Accept absolute paths.
387652b01e16Smrg    [[\\/]]* | ?:[[\\/]]*)
387752b01e16Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
387852b01e16Smrg      # Canonicalize the pathname of ld
387952b01e16Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
388052b01e16Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
388152b01e16Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
388252b01e16Smrg      done
388352b01e16Smrg      test -z "$LD" && LD="$ac_prog"
388452b01e16Smrg      ;;
388552b01e16Smrg  "")
388652b01e16Smrg    # If it fails, then pretend we aren't using GCC.
388752b01e16Smrg    ac_prog=ld
388852b01e16Smrg    ;;
388952b01e16Smrg  *)
389052b01e16Smrg    # If it is relative, then search for the first ld in PATH.
389152b01e16Smrg    with_gnu_ld=unknown
38924b0ead49Smrg    ;;
38934b0ead49Smrg  esac
389452b01e16Smrgelif test "$with_gnu_ld" = yes; then
389552b01e16Smrg  AC_MSG_CHECKING([for GNU ld])
389652b01e16Smrgelse
389752b01e16Smrg  AC_MSG_CHECKING([for non-GNU ld])
389852b01e16Smrgfi
389952b01e16SmrgAC_CACHE_VAL(lt_cv_path_LD,
390052b01e16Smrg[if test -z "$LD"; then
390152b01e16Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
390252b01e16Smrg  for ac_dir in $PATH; do
390352b01e16Smrg    IFS="$lt_save_ifs"
390452b01e16Smrg    test -z "$ac_dir" && ac_dir=.
390552b01e16Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
390652b01e16Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
390752b01e16Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
390852b01e16Smrg      # but apparently some variants of GNU ld only accept -v.
390952b01e16Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
391052b01e16Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
391152b01e16Smrg      *GNU* | *'with BFD'*)
391252b01e16Smrg	test "$with_gnu_ld" != no && break
391352b01e16Smrg	;;
391452b01e16Smrg      *)
391552b01e16Smrg	test "$with_gnu_ld" != yes && break
391652b01e16Smrg	;;
391752b01e16Smrg      esac
391852b01e16Smrg    fi
391952b01e16Smrg  done
392052b01e16Smrg  IFS="$lt_save_ifs"
392152b01e16Smrgelse
392252b01e16Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
392352b01e16Smrgfi])
392452b01e16SmrgLD="$lt_cv_path_LD"
392552b01e16Smrgif test -n "$LD"; then
392652b01e16Smrg  AC_MSG_RESULT($LD)
392752b01e16Smrgelse
392852b01e16Smrg  AC_MSG_RESULT(no)
392952b01e16Smrgfi
393052b01e16Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
393152b01e16SmrgAC_PROG_LD_GNU
393252b01e16Smrg])# AC_PROG_LD
393352b01e16Smrg
393452b01e16Smrg
393552b01e16Smrg# AC_PROG_LD_GNU
393652b01e16Smrg# --------------
393752b01e16SmrgAC_DEFUN([AC_PROG_LD_GNU],
393852b01e16Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
393952b01e16SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
394052b01e16Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
394152b01e16Smrgcase `$LD -v 2>&1 </dev/null` in
394252b01e16Smrg*GNU* | *'with BFD'*)
394352b01e16Smrg  lt_cv_prog_gnu_ld=yes
39444b0ead49Smrg  ;;
394552b01e16Smrg*)
394652b01e16Smrg  lt_cv_prog_gnu_ld=no
394752b01e16Smrg  ;;
394852b01e16Smrgesac])
394952b01e16Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
395052b01e16Smrg])# AC_PROG_LD_GNU
39514b0ead49Smrg
395252b01e16Smrg
395352b01e16Smrg# AC_PROG_LD_RELOAD_FLAG
395452b01e16Smrg# ----------------------
395552b01e16Smrg# find reload flag for linker
395652b01e16Smrg#   -- PORTME Some linkers may need a different reload flag.
395752b01e16SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
395852b01e16Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
395952b01e16Smrg  lt_cv_ld_reload_flag,
396052b01e16Smrg  [lt_cv_ld_reload_flag='-r'])
396152b01e16Smrgreload_flag=$lt_cv_ld_reload_flag
396252b01e16Smrgcase $reload_flag in
396352b01e16Smrg"" | " "*) ;;
396452b01e16Smrg*) reload_flag=" $reload_flag" ;;
39654b0ead49Smrgesac
396652b01e16Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
396752b01e16Smrgcase $host_os in
396852b01e16Smrg  darwin*)
396952b01e16Smrg    if test "$GCC" = yes; then
397052b01e16Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
397152b01e16Smrg    else
397252b01e16Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
397352b01e16Smrg    fi
397452b01e16Smrg    ;;
397552b01e16Smrgesac
397652b01e16Smrg])# AC_PROG_LD_RELOAD_FLAG
39774b0ead49Smrg
39784b0ead49Smrg
397952b01e16Smrg# AC_DEPLIBS_CHECK_METHOD
398052b01e16Smrg# -----------------------
398152b01e16Smrg# how to check for library dependencies
398252b01e16Smrg#  -- PORTME fill in with the dynamic library characteristics
398352b01e16SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
398452b01e16Smrg[AC_CACHE_CHECK([how to recognize dependent libraries],
398552b01e16Smrglt_cv_deplibs_check_method,
398652b01e16Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
398752b01e16Smrglt_cv_file_magic_test_file=
398852b01e16Smrglt_cv_deplibs_check_method='unknown'
398952b01e16Smrg# Need to set the preceding variable on all platforms that support
399052b01e16Smrg# interlibrary dependencies.
399152b01e16Smrg# 'none' -- dependencies not supported.
399252b01e16Smrg# `unknown' -- same as none, but documents that we really don't know.
399352b01e16Smrg# 'pass_all' -- all dependencies passed with no checks.
399452b01e16Smrg# 'test_compile' -- check by making test program.
399552b01e16Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
399652b01e16Smrg# which responds to the $file_magic_cmd with a given extended regex.
399752b01e16Smrg# If you have `file' or equivalent on your system and you're not sure
399852b01e16Smrg# whether `pass_all' will *always* work, you probably want this one.
39994b0ead49Smrg
400052b01e16Smrgcase $host_os in
400152b01e16Smrgaix[[4-9]]*)
400252b01e16Smrg  lt_cv_deplibs_check_method=pass_all
400352b01e16Smrg  ;;
40044b0ead49Smrg
400552b01e16Smrgbeos*)
400652b01e16Smrg  lt_cv_deplibs_check_method=pass_all
400752b01e16Smrg  ;;
40084b0ead49Smrg
400952b01e16Smrgbsdi[[45]]*)
401052b01e16Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
401152b01e16Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
401252b01e16Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
401352b01e16Smrg  ;;
40144b0ead49Smrg
401552b01e16Smrgcygwin*)
401652b01e16Smrg  # func_win32_libid is a shell function defined in ltmain.sh
401752b01e16Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
401852b01e16Smrg  lt_cv_file_magic_cmd='func_win32_libid'
40194b0ead49Smrg  ;;
402052b01e16Smrg
402152b01e16Smrgmingw* | pw32*)
402252b01e16Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
402352b01e16Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
402452b01e16Smrg  # unless we find 'file', for example because we are cross-compiling.
402552b01e16Smrg  if ( file / ) >/dev/null 2>&1; then
402652b01e16Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
402752b01e16Smrg    lt_cv_file_magic_cmd='func_win32_libid'
402852b01e16Smrg  else
402952b01e16Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
403052b01e16Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
40314b0ead49Smrg  fi
40324b0ead49Smrg  ;;
40334b0ead49Smrg
403452b01e16Smrgdarwin* | rhapsody*)
403552b01e16Smrg  lt_cv_deplibs_check_method=pass_all
403652b01e16Smrg  ;;
40374b0ead49Smrg
403852b01e16Smrgfreebsd* | dragonfly*)
403952b01e16Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
404052b01e16Smrg    case $host_cpu in
404152b01e16Smrg    i*86 )
404252b01e16Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
404352b01e16Smrg      # Let's accept both of them until this is cleared up.
404452b01e16Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
404552b01e16Smrg      lt_cv_file_magic_cmd=/usr/bin/file
404652b01e16Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
404752b01e16Smrg      ;;
404852b01e16Smrg    esac
404952b01e16Smrg  else
405052b01e16Smrg    lt_cv_deplibs_check_method=pass_all
405152b01e16Smrg  fi
405252b01e16Smrg  ;;
40534b0ead49Smrg
405452b01e16Smrggnu*)
405552b01e16Smrg  lt_cv_deplibs_check_method=pass_all
405652b01e16Smrg  ;;
40574b0ead49Smrg
405852b01e16Smrghpux10.20* | hpux11*)
405952b01e16Smrg  lt_cv_file_magic_cmd=/usr/bin/file
406052b01e16Smrg  case $host_cpu in
406152b01e16Smrg  ia64*)
406252b01e16Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
406352b01e16Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
406452b01e16Smrg    ;;
406552b01e16Smrg  hppa*64*)
406652b01e16Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
406752b01e16Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
406852b01e16Smrg    ;;
406952b01e16Smrg  *)
407052b01e16Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
407152b01e16Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
407252b01e16Smrg    ;;
407352b01e16Smrg  esac
407452b01e16Smrg  ;;
40754b0ead49Smrg
407652b01e16Smrginterix[[3-9]]*)
407752b01e16Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
407852b01e16Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
407952b01e16Smrg  ;;
40804b0ead49Smrg
408152b01e16Smrgirix5* | irix6* | nonstopux*)
408252b01e16Smrg  case $LD in
408352b01e16Smrg  *-32|*"-32 ") libmagic=32-bit;;
408452b01e16Smrg  *-n32|*"-n32 ") libmagic=N32;;
408552b01e16Smrg  *-64|*"-64 ") libmagic=64-bit;;
408652b01e16Smrg  *) libmagic=never-match;;
408752b01e16Smrg  esac
408852b01e16Smrg  lt_cv_deplibs_check_method=pass_all
408952b01e16Smrg  ;;
40904b0ead49Smrg
409152b01e16Smrg# This must be Linux ELF.
409252b01e16Smrglinux* | k*bsd*-gnu)
409352b01e16Smrg  lt_cv_deplibs_check_method=pass_all
409452b01e16Smrg  ;;
40954b0ead49Smrg
409652b01e16Smrgnetbsd*)
409752b01e16Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
409852b01e16Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
409952b01e16Smrg  else
410052b01e16Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
410152b01e16Smrg  fi
410252b01e16Smrg  ;;
41034b0ead49Smrg
410452b01e16Smrgnewos6*)
410552b01e16Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
410652b01e16Smrg  lt_cv_file_magic_cmd=/usr/bin/file
410752b01e16Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
410852b01e16Smrg  ;;
41094b0ead49Smrg
411052b01e16Smrgnto-qnx*)
411152b01e16Smrg  lt_cv_deplibs_check_method=unknown
411252b01e16Smrg  ;;
41134b0ead49Smrg
411452b01e16Smrgopenbsd*)
411552b01e16Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
411652b01e16Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
411752b01e16Smrg  else
411852b01e16Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
411952b01e16Smrg  fi
412052b01e16Smrg  ;;
41214b0ead49Smrg
412252b01e16Smrgosf3* | osf4* | osf5*)
412352b01e16Smrg  lt_cv_deplibs_check_method=pass_all
412452b01e16Smrg  ;;
41254b0ead49Smrg
412652b01e16Smrgrdos*)
412752b01e16Smrg  lt_cv_deplibs_check_method=pass_all
412852b01e16Smrg  ;;
41294b0ead49Smrg
413052b01e16Smrgsolaris*)
413152b01e16Smrg  lt_cv_deplibs_check_method=pass_all
413252b01e16Smrg  ;;
41334b0ead49Smrg
413452b01e16Smrgsysv4 | sysv4.3*)
413552b01e16Smrg  case $host_vendor in
413652b01e16Smrg  motorola)
413752b01e16Smrg    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]]'
413852b01e16Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
413952b01e16Smrg    ;;
414052b01e16Smrg  ncr)
414152b01e16Smrg    lt_cv_deplibs_check_method=pass_all
414252b01e16Smrg    ;;
414352b01e16Smrg  sequent)
414452b01e16Smrg    lt_cv_file_magic_cmd='/bin/file'
414552b01e16Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
414652b01e16Smrg    ;;
414752b01e16Smrg  sni)
414852b01e16Smrg    lt_cv_file_magic_cmd='/bin/file'
414952b01e16Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
415052b01e16Smrg    lt_cv_file_magic_test_file=/lib/libc.so
415152b01e16Smrg    ;;
415252b01e16Smrg  siemens)
415352b01e16Smrg    lt_cv_deplibs_check_method=pass_all
415452b01e16Smrg    ;;
415552b01e16Smrg  pc)
415652b01e16Smrg    lt_cv_deplibs_check_method=pass_all
415752b01e16Smrg    ;;
415852b01e16Smrg  esac
415952b01e16Smrg  ;;
41604b0ead49Smrg
416152b01e16Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
416252b01e16Smrg  lt_cv_deplibs_check_method=pass_all
416352b01e16Smrg  ;;
416452b01e16Smrgesac
416552b01e16Smrg])
416652b01e16Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
416752b01e16Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
416852b01e16Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
416952b01e16Smrg])# AC_DEPLIBS_CHECK_METHOD
41704b0ead49Smrg
41714b0ead49Smrg
417252b01e16Smrg# AC_PROG_NM
417352b01e16Smrg# ----------
417452b01e16Smrg# find the pathname to a BSD-compatible name lister
417552b01e16SmrgAC_DEFUN([AC_PROG_NM],
417652b01e16Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
417752b01e16Smrg[if test -n "$NM"; then
417852b01e16Smrg  # Let the user override the test.
417952b01e16Smrg  lt_cv_path_NM="$NM"
418052b01e16Smrgelse
418152b01e16Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
418252b01e16Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
418352b01e16Smrg    lt_nm_to_check="$lt_nm_to_check nm"
418452b01e16Smrg  fi
418552b01e16Smrg  for lt_tmp_nm in $lt_nm_to_check; do
418652b01e16Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
418752b01e16Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
418852b01e16Smrg      IFS="$lt_save_ifs"
418952b01e16Smrg      test -z "$ac_dir" && ac_dir=.
419052b01e16Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
419152b01e16Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
419252b01e16Smrg	# Check to see if the nm accepts a BSD-compat flag.
419352b01e16Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
419452b01e16Smrg	#   nm: unknown option "B" ignored
419552b01e16Smrg	# Tru64's nm complains that /dev/null is an invalid object file
419652b01e16Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
419752b01e16Smrg	*/dev/null* | *'Invalid file or object type'*)
419852b01e16Smrg	  lt_cv_path_NM="$tmp_nm -B"
419952b01e16Smrg	  break
420052b01e16Smrg	  ;;
420152b01e16Smrg	*)
420252b01e16Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
420352b01e16Smrg	  */dev/null*)
420452b01e16Smrg	    lt_cv_path_NM="$tmp_nm -p"
420552b01e16Smrg	    break
420652b01e16Smrg	    ;;
420752b01e16Smrg	  *)
420852b01e16Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
420952b01e16Smrg	    continue # so that we can try to find one that supports BSD flags
421052b01e16Smrg	    ;;
421152b01e16Smrg	  esac
421252b01e16Smrg	  ;;
421352b01e16Smrg	esac
421452b01e16Smrg      fi
421552b01e16Smrg    done
421652b01e16Smrg    IFS="$lt_save_ifs"
421752b01e16Smrg  done
421852b01e16Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
421952b01e16Smrgfi])
422052b01e16SmrgNM="$lt_cv_path_NM"
422152b01e16Smrg])# AC_PROG_NM
42224b0ead49Smrg
422352b01e16Smrg
422452b01e16Smrg# AC_CHECK_LIBM
422552b01e16Smrg# -------------
422652b01e16Smrg# check for math library
422752b01e16SmrgAC_DEFUN([AC_CHECK_LIBM],
422852b01e16Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
422952b01e16SmrgLIBM=
423052b01e16Smrgcase $host in
423152b01e16Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
423252b01e16Smrg  # These system don't have libm, or don't need it
423352b01e16Smrg  ;;
423452b01e16Smrg*-ncr-sysv4.3*)
423552b01e16Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
423652b01e16Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
423752b01e16Smrg  ;;
423852b01e16Smrg*)
423952b01e16Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
424052b01e16Smrg  ;;
424152b01e16Smrgesac
424252b01e16Smrg])# AC_CHECK_LIBM
42434b0ead49Smrg
42444b0ead49Smrg
424552b01e16Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
424652b01e16Smrg# -----------------------------------
424752b01e16Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
424852b01e16Smrg# LTDLINCL to the include flags for the libltdl header and adds
424952b01e16Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
425052b01e16Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
425152b01e16Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
425252b01e16Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
425352b01e16Smrg# (note the single quotes!).  If your package is not flat and you're not
425452b01e16Smrg# using automake, define top_builddir and top_srcdir appropriately in
425552b01e16Smrg# the Makefiles.
425652b01e16SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
425752b01e16Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
425852b01e16Smrg  case $enable_ltdl_convenience in
425952b01e16Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
426052b01e16Smrg  "") enable_ltdl_convenience=yes
426152b01e16Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
426252b01e16Smrg  esac
426352b01e16Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
426452b01e16Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
426552b01e16Smrg  # For backwards non-gettext consistent compatibility...
426652b01e16Smrg  INCLTDL="$LTDLINCL"
426752b01e16Smrg])# AC_LIBLTDL_CONVENIENCE
426852b01e16Smrg
426952b01e16Smrg
427052b01e16Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
427152b01e16Smrg# -----------------------------------
427252b01e16Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
427352b01e16Smrg# LTDLINCL to the include flags for the libltdl header and adds
427452b01e16Smrg# --enable-ltdl-install to the configure arguments.  Note that
427552b01e16Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
427652b01e16Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
427752b01e16Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
427852b01e16Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
427952b01e16Smrg# flat and you're not using automake, define top_builddir and top_srcdir
428052b01e16Smrg# appropriately in the Makefiles.
428152b01e16Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
428252b01e16SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
428352b01e16Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
428452b01e16Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
428552b01e16Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
428652b01e16Smrg  [if test x"$enable_ltdl_install" = xno; then
428752b01e16Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
428852b01e16Smrg   else
428952b01e16Smrg     enable_ltdl_install=yes
429052b01e16Smrg   fi
429152b01e16Smrg  ])
429252b01e16Smrg  if test x"$enable_ltdl_install" = x"yes"; then
429352b01e16Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
429452b01e16Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
429552b01e16Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
429652b01e16Smrg  else
429752b01e16Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
429852b01e16Smrg    LIBLTDL="-lltdl"
429952b01e16Smrg    LTDLINCL=
430052b01e16Smrg  fi
430152b01e16Smrg  # For backwards non-gettext consistent compatibility...
430252b01e16Smrg  INCLTDL="$LTDLINCL"
430352b01e16Smrg])# AC_LIBLTDL_INSTALLABLE
430452b01e16Smrg
430552b01e16Smrg
430652b01e16Smrg# AC_LIBTOOL_CXX
430752b01e16Smrg# --------------
430852b01e16Smrg# enable support for C++ libraries
430952b01e16SmrgAC_DEFUN([AC_LIBTOOL_CXX],
431052b01e16Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
431152b01e16Smrg])# AC_LIBTOOL_CXX
431252b01e16Smrg
431352b01e16Smrg
431452b01e16Smrg# _LT_AC_LANG_CXX
431552b01e16Smrg# ---------------
431652b01e16SmrgAC_DEFUN([_LT_AC_LANG_CXX],
431752b01e16Smrg[AC_REQUIRE([AC_PROG_CXX])
431852b01e16SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
431952b01e16Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
432052b01e16Smrg])# _LT_AC_LANG_CXX
432152b01e16Smrg
432252b01e16Smrg# _LT_AC_PROG_CXXCPP
432352b01e16Smrg# ------------------
432452b01e16SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
432552b01e16Smrg[
432652b01e16SmrgAC_REQUIRE([AC_PROG_CXX])
432752b01e16Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
432852b01e16Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
432952b01e16Smrg    (test "X$CXX" != "Xg++"))) ; then
433052b01e16Smrg  AC_PROG_CXXCPP
433152b01e16Smrgfi
433252b01e16Smrg])# _LT_AC_PROG_CXXCPP
433352b01e16Smrg
433452b01e16Smrg# AC_LIBTOOL_F77
433552b01e16Smrg# --------------
433652b01e16Smrg# enable support for Fortran 77 libraries
433752b01e16SmrgAC_DEFUN([AC_LIBTOOL_F77],
433852b01e16Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
433952b01e16Smrg])# AC_LIBTOOL_F77
434052b01e16Smrg
434152b01e16Smrg
434252b01e16Smrg# _LT_AC_LANG_F77
434352b01e16Smrg# ---------------
434452b01e16SmrgAC_DEFUN([_LT_AC_LANG_F77],
434552b01e16Smrg[AC_REQUIRE([AC_PROG_F77])
434652b01e16Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
434752b01e16Smrg])# _LT_AC_LANG_F77
434852b01e16Smrg
434952b01e16Smrg
435052b01e16Smrg# AC_LIBTOOL_GCJ
435152b01e16Smrg# --------------
435252b01e16Smrg# enable support for GCJ libraries
435352b01e16SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
435452b01e16Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
435552b01e16Smrg])# AC_LIBTOOL_GCJ
435652b01e16Smrg
435752b01e16Smrg
435852b01e16Smrg# _LT_AC_LANG_GCJ
435952b01e16Smrg# ---------------
436052b01e16SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
436152b01e16Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
436252b01e16Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
436352b01e16Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
436452b01e16Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
436552b01e16Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
436652b01e16Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
436752b01e16Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
436852b01e16Smrg])# _LT_AC_LANG_GCJ
436952b01e16Smrg
437052b01e16Smrg
437152b01e16Smrg# AC_LIBTOOL_RC
437252b01e16Smrg# -------------
437352b01e16Smrg# enable support for Windows resource files
437452b01e16SmrgAC_DEFUN([AC_LIBTOOL_RC],
437552b01e16Smrg[AC_REQUIRE([LT_AC_PROG_RC])
437652b01e16Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
437752b01e16Smrg])# AC_LIBTOOL_RC
437852b01e16Smrg
437952b01e16Smrg
438052b01e16Smrg# AC_LIBTOOL_LANG_C_CONFIG
438152b01e16Smrg# ------------------------
438252b01e16Smrg# Ensure that the configuration vars for the C compiler are
43834b0ead49Smrg# suitably defined.  Those variables are subsequently used by
43844b0ead49Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
438552b01e16SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
438652b01e16SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
438752b01e16Smrg[lt_save_CC="$CC"
438852b01e16SmrgAC_LANG_PUSH(C)
43894b0ead49Smrg
439052b01e16Smrg# Source file extension for C test sources.
439152b01e16Smrgac_ext=c
43924b0ead49Smrg
439352b01e16Smrg# Object file extension for compiled C test sources.
43944b0ead49Smrgobjext=o
43954b0ead49Smrg_LT_AC_TAGVAR(objext, $1)=$objext
43964b0ead49Smrg
43974b0ead49Smrg# Code to be used in simple compile tests
439852b01e16Smrglt_simple_compile_test_code="int some_variable = 0;"
43994b0ead49Smrg
44004b0ead49Smrg# Code to be used in simple link tests
440152b01e16Smrglt_simple_link_test_code='int main(){return(0);}'
44024b0ead49Smrg
44034b0ead49Smrg_LT_AC_SYS_COMPILER
44044b0ead49Smrg
44054b0ead49Smrg# save warnings/boilerplate of simple test code
44064b0ead49Smrg_LT_COMPILER_BOILERPLATE
44074b0ead49Smrg_LT_LINKER_BOILERPLATE
44084b0ead49Smrg
440952b01e16SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
441052b01e16SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
441152b01e16SmrgAC_LIBTOOL_PROG_CC_C_O($1)
441252b01e16SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
441352b01e16SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
441452b01e16SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
441552b01e16SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
441652b01e16SmrgAC_LIBTOOL_SYS_LIB_STRIP
441752b01e16SmrgAC_LIBTOOL_DLOPEN_SELF
44184b0ead49Smrg
441952b01e16Smrg# Report which library types will actually be built
442052b01e16SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
442152b01e16SmrgAC_MSG_RESULT([$can_build_shared])
44224b0ead49Smrg
442352b01e16SmrgAC_MSG_CHECKING([whether to build shared libraries])
442452b01e16Smrgtest "$can_build_shared" = "no" && enable_shared=no
44254b0ead49Smrg
442652b01e16Smrg# On AIX, shared libraries and static libraries use the same namespace, and
442752b01e16Smrg# are all built from PIC.
442852b01e16Smrgcase $host_os in
442952b01e16Smrgaix3*)
443052b01e16Smrg  test "$enable_shared" = yes && enable_static=no
443152b01e16Smrg  if test -n "$RANLIB"; then
443252b01e16Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
443352b01e16Smrg    postinstall_cmds='$RANLIB $lib'
44344b0ead49Smrg  fi
443552b01e16Smrg  ;;
44364b0ead49Smrg
443752b01e16Smrgaix[[4-9]]*)
443852b01e16Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
443952b01e16Smrg    test "$enable_shared" = yes && enable_static=no
444052b01e16Smrg  fi
44414b0ead49Smrg    ;;
444252b01e16Smrgesac
444352b01e16SmrgAC_MSG_RESULT([$enable_shared])
44444b0ead49Smrg
444552b01e16SmrgAC_MSG_CHECKING([whether to build static libraries])
444652b01e16Smrg# Make sure either enable_shared or enable_static is yes.
444752b01e16Smrgtest "$enable_shared" = yes || enable_static=yes
444852b01e16SmrgAC_MSG_RESULT([$enable_static])
44494b0ead49Smrg
445052b01e16SmrgAC_LIBTOOL_CONFIG($1)
44514b0ead49Smrg
445252b01e16SmrgAC_LANG_POP
445352b01e16SmrgCC="$lt_save_CC"
445452b01e16Smrg])# AC_LIBTOOL_LANG_C_CONFIG
44554b0ead49Smrg
44564b0ead49Smrg
445752b01e16Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
445852b01e16Smrg# --------------------------
445952b01e16Smrg# Ensure that the configuration vars for the C compiler are
446052b01e16Smrg# suitably defined.  Those variables are subsequently used by
446152b01e16Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
446252b01e16SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
446352b01e16SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
446452b01e16Smrg[AC_LANG_PUSH(C++)
446552b01e16SmrgAC_REQUIRE([AC_PROG_CXX])
446652b01e16SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
44674b0ead49Smrg
446852b01e16Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
446952b01e16Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
447052b01e16Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
447152b01e16Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
447252b01e16Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
447352b01e16Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
447452b01e16Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
447552b01e16Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
447652b01e16Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
447752b01e16Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
447852b01e16Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
447952b01e16Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
448052b01e16Smrg_LT_AC_TAGVAR(module_cmds, $1)=
448152b01e16Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
448252b01e16Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
448352b01e16Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
448452b01e16Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
448552b01e16Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
448652b01e16Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
44874b0ead49Smrg
448852b01e16Smrg# Dependencies to place before and after the object being linked:
448952b01e16Smrg_LT_AC_TAGVAR(predep_objects, $1)=
449052b01e16Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
449152b01e16Smrg_LT_AC_TAGVAR(predeps, $1)=
449252b01e16Smrg_LT_AC_TAGVAR(postdeps, $1)=
449352b01e16Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
449452b01e16Smrg_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
44954b0ead49Smrg
449652b01e16Smrg# Source file extension for C++ test sources.
449752b01e16Smrgac_ext=cpp
44984b0ead49Smrg
449952b01e16Smrg# Object file extension for compiled C++ test sources.
450052b01e16Smrgobjext=o
450152b01e16Smrg_LT_AC_TAGVAR(objext, $1)=$objext
45024b0ead49Smrg
450352b01e16Smrg# Code to be used in simple compile tests
450452b01e16Smrglt_simple_compile_test_code="int some_variable = 0;"
45054b0ead49Smrg
450652b01e16Smrg# Code to be used in simple link tests
450752b01e16Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
45084b0ead49Smrg
450952b01e16Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
451052b01e16Smrg_LT_AC_SYS_COMPILER
45114b0ead49Smrg
451252b01e16Smrg# save warnings/boilerplate of simple test code
451352b01e16Smrg_LT_COMPILER_BOILERPLATE
451452b01e16Smrg_LT_LINKER_BOILERPLATE
45154b0ead49Smrg
451652b01e16Smrg# Allow CC to be a program name with arguments.
451752b01e16Smrglt_save_CC=$CC
451852b01e16Smrglt_save_LD=$LD
451952b01e16Smrglt_save_GCC=$GCC
452052b01e16SmrgGCC=$GXX
452152b01e16Smrglt_save_with_gnu_ld=$with_gnu_ld
452252b01e16Smrglt_save_path_LD=$lt_cv_path_LD
452352b01e16Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
452452b01e16Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
452552b01e16Smrgelse
452652b01e16Smrg  $as_unset lt_cv_prog_gnu_ld
452752b01e16Smrgfi
452852b01e16Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
452952b01e16Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
453052b01e16Smrgelse
453152b01e16Smrg  $as_unset lt_cv_path_LD
453252b01e16Smrgfi
453352b01e16Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
453452b01e16SmrgCC=${CXX-"c++"}
453552b01e16Smrgcompiler=$CC
453652b01e16Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
453752b01e16Smrg_LT_CC_BASENAME([$compiler])
45384b0ead49Smrg
453952b01e16Smrg# We don't want -fno-exception wen compiling C++ code, so set the
454052b01e16Smrg# no_builtin_flag separately
454152b01e16Smrgif test "$GXX" = yes; then
454252b01e16Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
454352b01e16Smrgelse
454452b01e16Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
454552b01e16Smrgfi
45464b0ead49Smrg
454752b01e16Smrgif test "$GXX" = yes; then
454852b01e16Smrg  # Set up default GNU C++ configuration
45494b0ead49Smrg
455052b01e16Smrg  AC_PROG_LD
45514b0ead49Smrg
455252b01e16Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
455352b01e16Smrg  # archiving commands below assume that GNU ld is being used.
455452b01e16Smrg  if test "$with_gnu_ld" = yes; then
455552b01e16Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
455652b01e16Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
45574b0ead49Smrg
455852b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
455952b01e16Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
45604b0ead49Smrg
456152b01e16Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
456252b01e16Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
456352b01e16Smrg    #     investigate it a little bit more. (MM)
456452b01e16Smrg    wlarc='${wl}'
45654b0ead49Smrg
456652b01e16Smrg    # ancient GNU ld didn't support --whole-archive et. al.
456752b01e16Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
456852b01e16Smrg	grep 'no-whole-archive' > /dev/null; then
456952b01e16Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
457052b01e16Smrg    else
457152b01e16Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
457252b01e16Smrg    fi
457352b01e16Smrg  else
457452b01e16Smrg    with_gnu_ld=no
457552b01e16Smrg    wlarc=
45764b0ead49Smrg
457752b01e16Smrg    # A generic and very simple default shared library creation
457852b01e16Smrg    # command for GNU C++ for the case where it uses the native
457952b01e16Smrg    # linker, instead of GNU ld.  If possible, this setting should
458052b01e16Smrg    # overridden to take advantage of the native linker features on
458152b01e16Smrg    # the platform it is being used on.
458252b01e16Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
458352b01e16Smrg  fi
45844b0ead49Smrg
458552b01e16Smrg  # Commands to make compiler produce verbose output that lists
458652b01e16Smrg  # what "hidden" libraries, object files and flags are used when
458752b01e16Smrg  # linking a shared library.
458852b01e16Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
45894b0ead49Smrg
459052b01e16Smrgelse
459152b01e16Smrg  GXX=no
459252b01e16Smrg  with_gnu_ld=no
459352b01e16Smrg  wlarc=
459452b01e16Smrgfi
45954b0ead49Smrg
459652b01e16Smrg# PORTME: fill in a description of your system's C++ link characteristics
459752b01e16SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
459852b01e16Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
459952b01e16Smrgcase $host_os in
460052b01e16Smrg  aix3*)
460152b01e16Smrg    # FIXME: insert proper C++ library support
460252b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
460352b01e16Smrg    ;;
460452b01e16Smrg  aix[[4-9]]*)
460552b01e16Smrg    if test "$host_cpu" = ia64; then
460652b01e16Smrg      # On IA64, the linker does run time linking by default, so we don't
460752b01e16Smrg      # have to do anything special.
460852b01e16Smrg      aix_use_runtimelinking=no
460952b01e16Smrg      exp_sym_flag='-Bexport'
461052b01e16Smrg      no_entry_flag=""
461152b01e16Smrg    else
461252b01e16Smrg      aix_use_runtimelinking=no
46134b0ead49Smrg
461452b01e16Smrg      # Test if we are trying to use run time linking or normal
461552b01e16Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
461652b01e16Smrg      # need to do runtime linking.
461752b01e16Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
461852b01e16Smrg	for ld_flag in $LDFLAGS; do
461952b01e16Smrg	  case $ld_flag in
462052b01e16Smrg	  *-brtl*)
462152b01e16Smrg	    aix_use_runtimelinking=yes
462252b01e16Smrg	    break
462352b01e16Smrg	    ;;
462452b01e16Smrg	  esac
462552b01e16Smrg	done
462652b01e16Smrg	;;
462752b01e16Smrg      esac
46284b0ead49Smrg
462952b01e16Smrg      exp_sym_flag='-bexport'
463052b01e16Smrg      no_entry_flag='-bnoentry'
463152b01e16Smrg    fi
46324b0ead49Smrg
463352b01e16Smrg    # When large executables or shared objects are built, AIX ld can
463452b01e16Smrg    # have problems creating the table of contents.  If linking a library
463552b01e16Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
463652b01e16Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
463752b01e16Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
46384b0ead49Smrg
463952b01e16Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
464052b01e16Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
464152b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
464252b01e16Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
46434b0ead49Smrg
464452b01e16Smrg    if test "$GXX" = yes; then
464552b01e16Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
464652b01e16Smrg      # We only want to do this on AIX 4.2 and lower, the check
464752b01e16Smrg      # below for broken collect2 doesn't work under 4.3+
464852b01e16Smrg	collect2name=`${CC} -print-prog-name=collect2`
464952b01e16Smrg	if test -f "$collect2name" && \
465052b01e16Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
465152b01e16Smrg	then
465252b01e16Smrg	  # We have reworked collect2
465352b01e16Smrg	  :
465452b01e16Smrg	else
465552b01e16Smrg	  # We have old collect2
465652b01e16Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
465752b01e16Smrg	  # It fails to find uninstalled libraries when the uninstalled
465852b01e16Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
465952b01e16Smrg	  # to unsupported forces relinking
466052b01e16Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
466152b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
466252b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
466352b01e16Smrg	fi
466452b01e16Smrg	;;
466552b01e16Smrg      esac
466652b01e16Smrg      shared_flag='-shared'
466752b01e16Smrg      if test "$aix_use_runtimelinking" = yes; then
466852b01e16Smrg	shared_flag="$shared_flag "'${wl}-G'
466952b01e16Smrg      fi
467052b01e16Smrg    else
467152b01e16Smrg      # not using gcc
467252b01e16Smrg      if test "$host_cpu" = ia64; then
467352b01e16Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
467452b01e16Smrg	# chokes on -Wl,-G. The following line is correct:
467552b01e16Smrg	shared_flag='-G'
467652b01e16Smrg      else
467752b01e16Smrg	if test "$aix_use_runtimelinking" = yes; then
467852b01e16Smrg	  shared_flag='${wl}-G'
467952b01e16Smrg	else
468052b01e16Smrg	  shared_flag='${wl}-bM:SRE'
468152b01e16Smrg	fi
468252b01e16Smrg      fi
468352b01e16Smrg    fi
46844b0ead49Smrg
468552b01e16Smrg    # It seems that -bexpall does not export symbols beginning with
468652b01e16Smrg    # underscore (_), so it is better to generate a list of symbols to export.
468752b01e16Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
468852b01e16Smrg    if test "$aix_use_runtimelinking" = yes; then
468952b01e16Smrg      # Warning - without using the other runtime loading flags (-brtl),
469052b01e16Smrg      # -berok will link without error, but may produce a broken library.
469152b01e16Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
469252b01e16Smrg      # Determine the default libpath from the value encoded in an empty executable.
469352b01e16Smrg      _LT_AC_SYS_LIBPATH_AIX
469452b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
46954b0ead49Smrg
469652b01e16Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
469752b01e16Smrg     else
469852b01e16Smrg      if test "$host_cpu" = ia64; then
469952b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
470052b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
470152b01e16Smrg	_LT_AC_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"
470252b01e16Smrg      else
470352b01e16Smrg	# Determine the default libpath from the value encoded in an empty executable.
470452b01e16Smrg	_LT_AC_SYS_LIBPATH_AIX
470552b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
470652b01e16Smrg	# Warning - without using the other run time loading flags,
470752b01e16Smrg	# -berok will link without error, but may produce a broken library.
470852b01e16Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
470952b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
471052b01e16Smrg	# Exported symbols can be pulled into shared objects from archives
471152b01e16Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
471252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
471352b01e16Smrg	# This is similar to how AIX traditionally builds its shared libraries.
471452b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
471552b01e16Smrg      fi
471652b01e16Smrg    fi
471752b01e16Smrg    ;;
47184b0ead49Smrg
471952b01e16Smrg  beos*)
472052b01e16Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
472152b01e16Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
472252b01e16Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
472352b01e16Smrg      # support --undefined.  This deserves some investigation.  FIXME
472452b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
472552b01e16Smrg    else
472652b01e16Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
472752b01e16Smrg    fi
472852b01e16Smrg    ;;
47294b0ead49Smrg
473052b01e16Smrg  chorus*)
473152b01e16Smrg    case $cc_basename in
473252b01e16Smrg      *)
473352b01e16Smrg	# FIXME: insert proper C++ library support
473452b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
473552b01e16Smrg	;;
473652b01e16Smrg    esac
473752b01e16Smrg    ;;
47384b0ead49Smrg
473952b01e16Smrg  cygwin* | mingw* | pw32*)
474052b01e16Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
474152b01e16Smrg    # as there is no search path for DLLs.
474252b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
474352b01e16Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
474452b01e16Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
474552b01e16Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47464b0ead49Smrg
474752b01e16Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
474852b01e16Smrg      _LT_AC_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'
474952b01e16Smrg      # If the export-symbols file already is a .def file (1st line
475052b01e16Smrg      # is EXPORTS), use it as is; otherwise, prepend...
475152b01e16Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
475252b01e16Smrg	cp $export_symbols $output_objdir/$soname.def;
475352b01e16Smrg      else
475452b01e16Smrg	echo EXPORTS > $output_objdir/$soname.def;
475552b01e16Smrg	cat $export_symbols >> $output_objdir/$soname.def;
475652b01e16Smrg      fi~
475752b01e16Smrg      $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'
475852b01e16Smrg    else
475952b01e16Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
476052b01e16Smrg    fi
476152b01e16Smrg  ;;
476252b01e16Smrg      darwin* | rhapsody*)
476352b01e16Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
476452b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
476552b01e16Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
476652b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
476752b01e16Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
476852b01e16Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
476952b01e16Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
477052b01e16Smrg      if test "$GXX" = yes ; then
477152b01e16Smrg      output_verbose_link_cmd='echo'
477252b01e16Smrg      _LT_AC_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}"
477352b01e16Smrg      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
477452b01e16Smrg      _LT_AC_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}"
477552b01e16Smrg      _LT_AC_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}"
477652b01e16Smrg      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
477752b01e16Smrg        _LT_AC_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}"
477852b01e16Smrg        _LT_AC_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}"
477952b01e16Smrg      fi
478052b01e16Smrg      else
478152b01e16Smrg      case $cc_basename in
478252b01e16Smrg        xlc*)
478352b01e16Smrg         output_verbose_link_cmd='echo'
478452b01e16Smrg          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
478552b01e16Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
478652b01e16Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
478752b01e16Smrg          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
478852b01e16Smrg          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
478952b01e16Smrg          ;;
479052b01e16Smrg       *)
479152b01e16Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
479252b01e16Smrg          ;;
479352b01e16Smrg      esac
479452b01e16Smrg      fi
479552b01e16Smrg        ;;
47964b0ead49Smrg
479752b01e16Smrg  dgux*)
479852b01e16Smrg    case $cc_basename in
479952b01e16Smrg      ec++*)
480052b01e16Smrg	# FIXME: insert proper C++ library support
480152b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
480252b01e16Smrg	;;
480352b01e16Smrg      ghcx*)
480452b01e16Smrg	# Green Hills C++ Compiler
480552b01e16Smrg	# FIXME: insert proper C++ library support
480652b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
480752b01e16Smrg	;;
480852b01e16Smrg      *)
480952b01e16Smrg	# FIXME: insert proper C++ library support
481052b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
481152b01e16Smrg	;;
481252b01e16Smrg    esac
481352b01e16Smrg    ;;
481452b01e16Smrg  freebsd[[12]]*)
481552b01e16Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
481652b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
481752b01e16Smrg    ;;
481852b01e16Smrg  freebsd-elf*)
481952b01e16Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
482052b01e16Smrg    ;;
482152b01e16Smrg  freebsd* | dragonfly*)
482252b01e16Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
482352b01e16Smrg    # conventions
482452b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
482552b01e16Smrg    ;;
482652b01e16Smrg  gnu*)
482752b01e16Smrg    ;;
482852b01e16Smrg  hpux9*)
482952b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
483052b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
483152b01e16Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
483252b01e16Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
483352b01e16Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
483452b01e16Smrg				# but as the default
483552b01e16Smrg				# location of the library.
48364b0ead49Smrg
483752b01e16Smrg    case $cc_basename in
483852b01e16Smrg    CC*)
483952b01e16Smrg      # FIXME: insert proper C++ library support
484052b01e16Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
484152b01e16Smrg      ;;
484252b01e16Smrg    aCC*)
484352b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
484452b01e16Smrg      # Commands to make compiler produce verbose output that lists
484552b01e16Smrg      # what "hidden" libraries, object files and flags are used when
484652b01e16Smrg      # linking a shared library.
484752b01e16Smrg      #
484852b01e16Smrg      # There doesn't appear to be a way to prevent this compiler from
484952b01e16Smrg      # explicitly linking system object files so we need to strip them
485052b01e16Smrg      # from the output so that they don't get included in the library
485152b01e16Smrg      # dependencies.
485252b01e16Smrg      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; echo $list'
485352b01e16Smrg      ;;
485452b01e16Smrg    *)
485552b01e16Smrg      if test "$GXX" = yes; then
485652b01e16Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
485752b01e16Smrg      else
485852b01e16Smrg        # FIXME: insert proper C++ library support
485952b01e16Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
486052b01e16Smrg      fi
486152b01e16Smrg      ;;
486252b01e16Smrg    esac
486352b01e16Smrg    ;;
486452b01e16Smrg  hpux10*|hpux11*)
486552b01e16Smrg    if test $with_gnu_ld = no; then
486652b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
486752b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
48684b0ead49Smrg
486952b01e16Smrg      case $host_cpu in
487052b01e16Smrg      hppa*64*|ia64*) ;;
487152b01e16Smrg      *)
487252b01e16Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
487352b01e16Smrg        ;;
487452b01e16Smrg      esac
487552b01e16Smrg    fi
487652b01e16Smrg    case $host_cpu in
487752b01e16Smrg    hppa*64*|ia64*)
487852b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
487952b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
488052b01e16Smrg      ;;
488152b01e16Smrg    *)
488252b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
488352b01e16Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
488452b01e16Smrg					      # but as the default
488552b01e16Smrg					      # location of the library.
488652b01e16Smrg      ;;
488752b01e16Smrg    esac
48884b0ead49Smrg
488952b01e16Smrg    case $cc_basename in
489052b01e16Smrg      CC*)
489152b01e16Smrg	# FIXME: insert proper C++ library support
489252b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
489352b01e16Smrg	;;
489452b01e16Smrg      aCC*)
489552b01e16Smrg	case $host_cpu in
489652b01e16Smrg	hppa*64*)
489752b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
489852b01e16Smrg	  ;;
489952b01e16Smrg	ia64*)
490052b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
490152b01e16Smrg	  ;;
490252b01e16Smrg	*)
490352b01e16Smrg	  _LT_AC_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'
490452b01e16Smrg	  ;;
490552b01e16Smrg	esac
490652b01e16Smrg	# Commands to make compiler produce verbose output that lists
490752b01e16Smrg	# what "hidden" libraries, object files and flags are used when
490852b01e16Smrg	# linking a shared library.
490952b01e16Smrg	#
491052b01e16Smrg	# There doesn't appear to be a way to prevent this compiler from
491152b01e16Smrg	# explicitly linking system object files so we need to strip them
491252b01e16Smrg	# from the output so that they don't get included in the library
491352b01e16Smrg	# dependencies.
491452b01e16Smrg	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; echo $list'
491552b01e16Smrg	;;
491652b01e16Smrg      *)
491752b01e16Smrg	if test "$GXX" = yes; then
491852b01e16Smrg	  if test $with_gnu_ld = no; then
491952b01e16Smrg	    case $host_cpu in
492052b01e16Smrg	    hppa*64*)
492152b01e16Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
492252b01e16Smrg	      ;;
492352b01e16Smrg	    ia64*)
492452b01e16Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
492552b01e16Smrg	      ;;
492652b01e16Smrg	    *)
492752b01e16Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
492852b01e16Smrg	      ;;
492952b01e16Smrg	    esac
493052b01e16Smrg	  fi
493152b01e16Smrg	else
493252b01e16Smrg	  # FIXME: insert proper C++ library support
493352b01e16Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
493452b01e16Smrg	fi
493552b01e16Smrg	;;
493652b01e16Smrg    esac
493752b01e16Smrg    ;;
493852b01e16Smrg  interix[[3-9]]*)
493952b01e16Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
494052b01e16Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
494152b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
494252b01e16Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
494352b01e16Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
494452b01e16Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
494552b01e16Smrg    # default) and relocated if they conflict, which is a slow very memory
494652b01e16Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
494752b01e16Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
494852b01e16Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
494952b01e16Smrg    _LT_AC_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'
495052b01e16Smrg    _LT_AC_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'
495152b01e16Smrg    ;;
495252b01e16Smrg  irix5* | irix6*)
495352b01e16Smrg    case $cc_basename in
495452b01e16Smrg      CC*)
495552b01e16Smrg	# SGI C++
495652b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
49574b0ead49Smrg
495852b01e16Smrg	# Archives containing C++ object files must be created using
495952b01e16Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
496052b01e16Smrg	# necessary to make sure instantiated templates are included
496152b01e16Smrg	# in the archive.
496252b01e16Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
496352b01e16Smrg	;;
496452b01e16Smrg      *)
496552b01e16Smrg	if test "$GXX" = yes; then
496652b01e16Smrg	  if test "$with_gnu_ld" = no; then
496752b01e16Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
496852b01e16Smrg	  else
496952b01e16Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
497052b01e16Smrg	  fi
497152b01e16Smrg	fi
497252b01e16Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
497352b01e16Smrg	;;
497452b01e16Smrg    esac
497552b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
497652b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
497752b01e16Smrg    ;;
497852b01e16Smrg  linux* | k*bsd*-gnu)
497952b01e16Smrg    case $cc_basename in
498052b01e16Smrg      KCC*)
498152b01e16Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
49824b0ead49Smrg
498352b01e16Smrg	# KCC will only create a shared library if the output file
498452b01e16Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
498552b01e16Smrg	# to its proper name (with version) after linking.
498652b01e16Smrg	_LT_AC_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'
498752b01e16Smrg	_LT_AC_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'
498852b01e16Smrg	# Commands to make compiler produce verbose output that lists
498952b01e16Smrg	# what "hidden" libraries, object files and flags are used when
499052b01e16Smrg	# linking a shared library.
499152b01e16Smrg	#
499252b01e16Smrg	# There doesn't appear to be a way to prevent this compiler from
499352b01e16Smrg	# explicitly linking system object files so we need to strip them
499452b01e16Smrg	# from the output so that they don't get included in the library
499552b01e16Smrg	# dependencies.
499652b01e16Smrg	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; echo $list'
49974b0ead49Smrg
499852b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
499952b01e16Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
50004b0ead49Smrg
500152b01e16Smrg	# Archives containing C++ object files must be created using
500252b01e16Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
500352b01e16Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
500452b01e16Smrg	;;
500552b01e16Smrg      icpc*)
500652b01e16Smrg	# Intel C++
500752b01e16Smrg	with_gnu_ld=yes
500852b01e16Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
500952b01e16Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
501052b01e16Smrg	# earlier do not add the objects themselves.
501152b01e16Smrg	case `$CC -V 2>&1` in
501252b01e16Smrg	*"Version 7."*)
501352b01e16Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
501452b01e16Smrg  	  _LT_AC_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'
501552b01e16Smrg	  ;;
501652b01e16Smrg	*)  # Version 8.0 or newer
501752b01e16Smrg	  tmp_idyn=
501852b01e16Smrg	  case $host_cpu in
501952b01e16Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
502052b01e16Smrg	  esac
502152b01e16Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
502252b01e16Smrg	  _LT_AC_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'
502352b01e16Smrg	  ;;
502452b01e16Smrg	esac
502552b01e16Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
502652b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
502752b01e16Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
502852b01e16Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
502952b01e16Smrg	;;
503052b01e16Smrg      pgCC* | pgcpp*)
503152b01e16Smrg        # Portland Group C++ compiler
503252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
503352b01e16Smrg  	_LT_AC_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'
50344b0ead49Smrg
503552b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
503652b01e16Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
503752b01e16Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
503852b01e16Smrg        ;;
503952b01e16Smrg      cxx*)
504052b01e16Smrg	# Compaq C++
504152b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
504252b01e16Smrg	_LT_AC_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'
50434b0ead49Smrg
504452b01e16Smrg	runpath_var=LD_RUN_PATH
504552b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
504652b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
50474b0ead49Smrg
504852b01e16Smrg	# Commands to make compiler produce verbose output that lists
504952b01e16Smrg	# what "hidden" libraries, object files and flags are used when
505052b01e16Smrg	# linking a shared library.
505152b01e16Smrg	#
505252b01e16Smrg	# There doesn't appear to be a way to prevent this compiler from
505352b01e16Smrg	# explicitly linking system object files so we need to strip them
505452b01e16Smrg	# from the output so that they don't get included in the library
505552b01e16Smrg	# dependencies.
505652b01e16Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $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; echo $list'
505752b01e16Smrg	;;
505852b01e16Smrg      *)
505952b01e16Smrg	case `$CC -V 2>&1 | sed 5q` in
506052b01e16Smrg	*Sun\ C*)
506152b01e16Smrg	  # Sun C++ 5.9
506252b01e16Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
506352b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
506452b01e16Smrg	  _LT_AC_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'
506552b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
506652b01e16Smrg	  _LT_AC_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; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
506752b01e16Smrg
506852b01e16Smrg	  # Not sure whether something based on
506952b01e16Smrg	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
507052b01e16Smrg	  # would be better.
507152b01e16Smrg	  output_verbose_link_cmd='echo'
507252b01e16Smrg
507352b01e16Smrg	  # Archives containing C++ object files must be created using
507452b01e16Smrg	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
507552b01e16Smrg	  # necessary to make sure instantiated templates are included
507652b01e16Smrg	  # in the archive.
507752b01e16Smrg	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
507852b01e16Smrg	  ;;
507952b01e16Smrg	esac
508052b01e16Smrg	;;
508152b01e16Smrg    esac
508252b01e16Smrg    ;;
508352b01e16Smrg  lynxos*)
508452b01e16Smrg    # FIXME: insert proper C++ library support
508552b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
508652b01e16Smrg    ;;
508752b01e16Smrg  m88k*)
508852b01e16Smrg    # FIXME: insert proper C++ library support
508952b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
509052b01e16Smrg    ;;
509152b01e16Smrg  mvs*)
509252b01e16Smrg    case $cc_basename in
509352b01e16Smrg      cxx*)
509452b01e16Smrg	# FIXME: insert proper C++ library support
509552b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
509652b01e16Smrg	;;
509752b01e16Smrg      *)
509852b01e16Smrg	# FIXME: insert proper C++ library support
509952b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
510052b01e16Smrg	;;
510152b01e16Smrg    esac
510252b01e16Smrg    ;;
510352b01e16Smrg  netbsd*)
510452b01e16Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
510552b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
510652b01e16Smrg      wlarc=
510752b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
510852b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
510952b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
511052b01e16Smrg    fi
511152b01e16Smrg    # Workaround some broken pre-1.5 toolchains
511252b01e16Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
511352b01e16Smrg    ;;
511452b01e16Smrg  openbsd2*)
511552b01e16Smrg    # C++ shared libraries are fairly broken
511652b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
511752b01e16Smrg    ;;
511852b01e16Smrg  openbsd*)
511952b01e16Smrg    if test -f /usr/libexec/ld.so; then
512052b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
512152b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
512252b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
512352b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
512452b01e16Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
512552b01e16Smrg	_LT_AC_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'
512652b01e16Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
512752b01e16Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
512852b01e16Smrg      fi
512952b01e16Smrg      output_verbose_link_cmd='echo'
513052b01e16Smrg    else
513152b01e16Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
513252b01e16Smrg    fi
513352b01e16Smrg    ;;
513452b01e16Smrg  osf3*)
513552b01e16Smrg    case $cc_basename in
513652b01e16Smrg      KCC*)
513752b01e16Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
51384b0ead49Smrg
513952b01e16Smrg	# KCC will only create a shared library if the output file
514052b01e16Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
514152b01e16Smrg	# to its proper name (with version) after linking.
514252b01e16Smrg	_LT_AC_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'
51434b0ead49Smrg
514452b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
514552b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
51464b0ead49Smrg
514752b01e16Smrg	# Archives containing C++ object files must be created using
514852b01e16Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
514952b01e16Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
51504b0ead49Smrg
515152b01e16Smrg	;;
515252b01e16Smrg      RCC*)
515352b01e16Smrg	# Rational C++ 2.4.1
515452b01e16Smrg	# FIXME: insert proper C++ library support
515552b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
515652b01e16Smrg	;;
515752b01e16Smrg      cxx*)
515852b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
515952b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
51604b0ead49Smrg
516152b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
516252b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
51634b0ead49Smrg
516452b01e16Smrg	# Commands to make compiler produce verbose output that lists
516552b01e16Smrg	# what "hidden" libraries, object files and flags are used when
516652b01e16Smrg	# linking a shared library.
516752b01e16Smrg	#
516852b01e16Smrg	# There doesn't appear to be a way to prevent this compiler from
516952b01e16Smrg	# explicitly linking system object files so we need to strip them
517052b01e16Smrg	# from the output so that they don't get included in the library
517152b01e16Smrg	# dependencies.
517252b01e16Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $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; echo $list'
517352b01e16Smrg	;;
517452b01e16Smrg      *)
517552b01e16Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
517652b01e16Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
517752b01e16Smrg	  _LT_AC_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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
51784b0ead49Smrg
517952b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
518052b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
51814b0ead49Smrg
518252b01e16Smrg	  # Commands to make compiler produce verbose output that lists
518352b01e16Smrg	  # what "hidden" libraries, object files and flags are used when
518452b01e16Smrg	  # linking a shared library.
518552b01e16Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
51864b0ead49Smrg
518752b01e16Smrg	else
518852b01e16Smrg	  # FIXME: insert proper C++ library support
518952b01e16Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
519052b01e16Smrg	fi
519152b01e16Smrg	;;
519252b01e16Smrg    esac
519352b01e16Smrg    ;;
519452b01e16Smrg  osf4* | osf5*)
519552b01e16Smrg    case $cc_basename in
519652b01e16Smrg      KCC*)
519752b01e16Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
51984b0ead49Smrg
519952b01e16Smrg	# KCC will only create a shared library if the output file
520052b01e16Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
520152b01e16Smrg	# to its proper name (with version) after linking.
520252b01e16Smrg	_LT_AC_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'
52034b0ead49Smrg
520452b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
520552b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
52064b0ead49Smrg
520752b01e16Smrg	# Archives containing C++ object files must be created using
520852b01e16Smrg	# the KAI C++ compiler.
520952b01e16Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
521052b01e16Smrg	;;
521152b01e16Smrg      RCC*)
521252b01e16Smrg	# Rational C++ 2.4.1
521352b01e16Smrg	# FIXME: insert proper C++ library support
521452b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
521552b01e16Smrg	;;
521652b01e16Smrg      cxx*)
521752b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
521852b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
521952b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
522052b01e16Smrg	  echo "-hidden">> $lib.exp~
522152b01e16Smrg	  $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~
522252b01e16Smrg	  $rm $lib.exp'
52234b0ead49Smrg
522452b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
522552b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
52264b0ead49Smrg
522752b01e16Smrg	# Commands to make compiler produce verbose output that lists
522852b01e16Smrg	# what "hidden" libraries, object files and flags are used when
522952b01e16Smrg	# linking a shared library.
523052b01e16Smrg	#
523152b01e16Smrg	# There doesn't appear to be a way to prevent this compiler from
523252b01e16Smrg	# explicitly linking system object files so we need to strip them
523352b01e16Smrg	# from the output so that they don't get included in the library
523452b01e16Smrg	# dependencies.
523552b01e16Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $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; echo $list'
523652b01e16Smrg	;;
523752b01e16Smrg      *)
523852b01e16Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
523952b01e16Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
524052b01e16Smrg	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
52414b0ead49Smrg
524252b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
524352b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
52444b0ead49Smrg
524552b01e16Smrg	  # Commands to make compiler produce verbose output that lists
524652b01e16Smrg	  # what "hidden" libraries, object files and flags are used when
524752b01e16Smrg	  # linking a shared library.
524852b01e16Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
52494b0ead49Smrg
525052b01e16Smrg	else
525152b01e16Smrg	  # FIXME: insert proper C++ library support
525252b01e16Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
525352b01e16Smrg	fi
525452b01e16Smrg	;;
525552b01e16Smrg    esac
525652b01e16Smrg    ;;
525752b01e16Smrg  psos*)
525852b01e16Smrg    # FIXME: insert proper C++ library support
525952b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
526052b01e16Smrg    ;;
526152b01e16Smrg  sunos4*)
526252b01e16Smrg    case $cc_basename in
526352b01e16Smrg      CC*)
526452b01e16Smrg	# Sun C++ 4.x
526552b01e16Smrg	# FIXME: insert proper C++ library support
526652b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
526752b01e16Smrg	;;
526852b01e16Smrg      lcc*)
526952b01e16Smrg	# Lucid
527052b01e16Smrg	# FIXME: insert proper C++ library support
527152b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
527252b01e16Smrg	;;
527352b01e16Smrg      *)
527452b01e16Smrg	# FIXME: insert proper C++ library support
527552b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
527652b01e16Smrg	;;
527752b01e16Smrg    esac
527852b01e16Smrg    ;;
527952b01e16Smrg  solaris*)
528052b01e16Smrg    case $cc_basename in
528152b01e16Smrg      CC*)
528252b01e16Smrg	# Sun C++ 4.2, 5.x and Centerline C++
528352b01e16Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
528452b01e16Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
528552b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
528652b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
528752b01e16Smrg	$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'
52884b0ead49Smrg
528952b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
529052b01e16Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
529152b01e16Smrg	case $host_os in
529252b01e16Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
529352b01e16Smrg	  *)
529452b01e16Smrg	    # The compiler driver will combine and reorder linker options,
529552b01e16Smrg	    # but understands `-z linker_flag'.
529652b01e16Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
529752b01e16Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
529852b01e16Smrg	    ;;
529952b01e16Smrg	esac
530052b01e16Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
53014b0ead49Smrg
530252b01e16Smrg	output_verbose_link_cmd='echo'
53034b0ead49Smrg
530452b01e16Smrg	# Archives containing C++ object files must be created using
530552b01e16Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
530652b01e16Smrg	# necessary to make sure instantiated templates are included
530752b01e16Smrg	# in the archive.
530852b01e16Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
530952b01e16Smrg	;;
531052b01e16Smrg      gcx*)
531152b01e16Smrg	# Green Hills C++ Compiler
531252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
53134b0ead49Smrg
531452b01e16Smrg	# The C++ compiler must be used to create the archive.
531552b01e16Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
531652b01e16Smrg	;;
531752b01e16Smrg      *)
531852b01e16Smrg	# GNU C++ compiler with Solaris linker
531952b01e16Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
532052b01e16Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
532152b01e16Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
532252b01e16Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
532352b01e16Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
532452b01e16Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
53254b0ead49Smrg
532652b01e16Smrg	    # Commands to make compiler produce verbose output that lists
532752b01e16Smrg	    # what "hidden" libraries, object files and flags are used when
532852b01e16Smrg	    # linking a shared library.
532952b01e16Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
533052b01e16Smrg	  else
533152b01e16Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
533252b01e16Smrg	    # platform.
533352b01e16Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
533452b01e16Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
533552b01e16Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
53364b0ead49Smrg
533752b01e16Smrg	    # Commands to make compiler produce verbose output that lists
533852b01e16Smrg	    # what "hidden" libraries, object files and flags are used when
533952b01e16Smrg	    # linking a shared library.
534052b01e16Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
534152b01e16Smrg	  fi
53424b0ead49Smrg
534352b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
534452b01e16Smrg	  case $host_os in
534552b01e16Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
534652b01e16Smrg	  *)
534752b01e16Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
534852b01e16Smrg	    ;;
534952b01e16Smrg	  esac
535052b01e16Smrg	fi
535152b01e16Smrg	;;
535252b01e16Smrg    esac
535352b01e16Smrg    ;;
535452b01e16Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
535552b01e16Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
535652b01e16Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
535752b01e16Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
535852b01e16Smrg    runpath_var='LD_RUN_PATH'
53594b0ead49Smrg
536052b01e16Smrg    case $cc_basename in
536152b01e16Smrg      CC*)
536252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
536352b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
536452b01e16Smrg	;;
536552b01e16Smrg      *)
536652b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
536752b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
536852b01e16Smrg	;;
536952b01e16Smrg    esac
537052b01e16Smrg    ;;
537152b01e16Smrg  sysv5* | sco3.2v5* | sco5v6*)
537252b01e16Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
537352b01e16Smrg    # link with -lc, and that would cause any symbols used from libc to
537452b01e16Smrg    # always be unresolved, which means just about no library would
537552b01e16Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
537652b01e16Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
537752b01e16Smrg    # as -z defs.
537852b01e16Smrg    # For security reasons, it is highly recommended that you always
537952b01e16Smrg    # use absolute paths for naming shared libraries, and exclude the
538052b01e16Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
538152b01e16Smrg    # requires that you compile everything twice, which is a pain.
538252b01e16Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
538352b01e16Smrg    # non-empty value in the environment.  Most likely only useful for
538452b01e16Smrg    # creating official distributions of packages.
538552b01e16Smrg    # This is a hack until libtool officially supports absolute path
538652b01e16Smrg    # names for shared libraries.
538752b01e16Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
538852b01e16Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
538952b01e16Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
539052b01e16Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
539152b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
539252b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
539352b01e16Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
539452b01e16Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
539552b01e16Smrg    runpath_var='LD_RUN_PATH'
53964b0ead49Smrg
539752b01e16Smrg    case $cc_basename in
539852b01e16Smrg      CC*)
539952b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
540052b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
540152b01e16Smrg	;;
540252b01e16Smrg      *)
540352b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
540452b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
540552b01e16Smrg	;;
540652b01e16Smrg    esac
540752b01e16Smrg    ;;
540852b01e16Smrg  tandem*)
540952b01e16Smrg    case $cc_basename in
541052b01e16Smrg      NCC*)
541152b01e16Smrg	# NonStop-UX NCC 3.20
541252b01e16Smrg	# FIXME: insert proper C++ library support
541352b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
541452b01e16Smrg	;;
541552b01e16Smrg      *)
541652b01e16Smrg	# FIXME: insert proper C++ library support
541752b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
541852b01e16Smrg	;;
541952b01e16Smrg    esac
542052b01e16Smrg    ;;
542152b01e16Smrg  vxworks*)
542252b01e16Smrg    # FIXME: insert proper C++ library support
542352b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
542452b01e16Smrg    ;;
542552b01e16Smrg  *)
542652b01e16Smrg    # FIXME: insert proper C++ library support
542752b01e16Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
542852b01e16Smrg    ;;
542952b01e16Smrgesac
543052b01e16SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
543152b01e16Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
54324b0ead49Smrg
543352b01e16Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
543452b01e16Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
54354b0ead49Smrg
543652b01e16SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
543752b01e16SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
543852b01e16SmrgAC_LIBTOOL_PROG_CC_C_O($1)
543952b01e16SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
544052b01e16SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
544152b01e16SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
544252b01e16SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
54434b0ead49Smrg
544452b01e16SmrgAC_LIBTOOL_CONFIG($1)
54454b0ead49Smrg
544652b01e16SmrgAC_LANG_POP
544752b01e16SmrgCC=$lt_save_CC
544852b01e16SmrgLDCXX=$LD
544952b01e16SmrgLD=$lt_save_LD
545052b01e16SmrgGCC=$lt_save_GCC
545152b01e16Smrgwith_gnu_ldcxx=$with_gnu_ld
545252b01e16Smrgwith_gnu_ld=$lt_save_with_gnu_ld
545352b01e16Smrglt_cv_path_LDCXX=$lt_cv_path_LD
545452b01e16Smrglt_cv_path_LD=$lt_save_path_LD
545552b01e16Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
545652b01e16Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
545752b01e16Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
54584b0ead49Smrg
545952b01e16Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
546052b01e16Smrg# ------------------------------------
546152b01e16Smrg# Figure out "hidden" library dependencies from verbose
546252b01e16Smrg# compiler output when linking a shared library.
546352b01e16Smrg# Parse the compiler output and extract the necessary
546452b01e16Smrg# objects, libraries and library flags.
546552b01e16SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
546652b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
546752b01e16Smrgdnl we can't use the lt_simple_compile_test_code here,
546852b01e16Smrgdnl because it contains code intended for an executable,
546952b01e16Smrgdnl not a library.  It's possible we should let each
547052b01e16Smrgdnl tag define a new lt_????_link_test_code variable,
547152b01e16Smrgdnl but it's only used here...
547252b01e16Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
547352b01e16Smrgint a;
547452b01e16Smrgvoid foo (void) { a = 0; }
547552b01e16SmrgEOF
547652b01e16Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
547752b01e16Smrgclass Foo
547852b01e16Smrg{
547952b01e16Smrgpublic:
548052b01e16Smrg  Foo (void) { a = 0; }
548152b01e16Smrgprivate:
548252b01e16Smrg  int a;
548352b01e16Smrg};
548452b01e16SmrgEOF
548552b01e16Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
548652b01e16Smrg      subroutine foo
548752b01e16Smrg      implicit none
548852b01e16Smrg      integer*4 a
548952b01e16Smrg      a=0
549052b01e16Smrg      return
549152b01e16Smrg      end
549252b01e16SmrgEOF
549352b01e16Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
549452b01e16Smrgpublic class foo {
549552b01e16Smrg  private int a;
549652b01e16Smrg  public void bar (void) {
549752b01e16Smrg    a = 0;
549852b01e16Smrg  }
549952b01e16Smrg};
550052b01e16SmrgEOF
550152b01e16Smrg])
550252b01e16Smrgdnl Parse the compiler output and extract the necessary
550352b01e16Smrgdnl objects, libraries and library flags.
550452b01e16Smrgif AC_TRY_EVAL(ac_compile); then
550552b01e16Smrg  # Parse the compiler output and extract the necessary
550652b01e16Smrg  # objects, libraries and library flags.
55074b0ead49Smrg
550852b01e16Smrg  # Sentinel used to keep track of whether or not we are before
550952b01e16Smrg  # the conftest object file.
551052b01e16Smrg  pre_test_object_deps_done=no
55114b0ead49Smrg
551252b01e16Smrg  # The `*' in the case matches for architectures that use `case' in
551352b01e16Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
551452b01e16Smrg  # eval without this substitution.
551552b01e16Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
55164b0ead49Smrg
551752b01e16Smrg  for p in `eval $output_verbose_link_cmd`; do
551852b01e16Smrg    case $p in
55194b0ead49Smrg
552052b01e16Smrg    -L* | -R* | -l*)
552152b01e16Smrg       # Some compilers place space between "-{L,R}" and the path.
552252b01e16Smrg       # Remove the space.
552352b01e16Smrg       if test $p = "-L" \
552452b01e16Smrg	  || test $p = "-R"; then
552552b01e16Smrg	 prev=$p
552652b01e16Smrg	 continue
552752b01e16Smrg       else
552852b01e16Smrg	 prev=
552952b01e16Smrg       fi
55304b0ead49Smrg
553152b01e16Smrg       if test "$pre_test_object_deps_done" = no; then
553252b01e16Smrg	 case $p in
553352b01e16Smrg	 -L* | -R*)
553452b01e16Smrg	   # Internal compiler library paths should come after those
553552b01e16Smrg	   # provided the user.  The postdeps already come after the
553652b01e16Smrg	   # user supplied libs so there is no need to process them.
553752b01e16Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
553852b01e16Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
553952b01e16Smrg	   else
554052b01e16Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
554152b01e16Smrg	   fi
554252b01e16Smrg	   ;;
554352b01e16Smrg	 # The "-l" case would never come before the object being
554452b01e16Smrg	 # linked, so don't bother handling this case.
554552b01e16Smrg	 esac
554652b01e16Smrg       else
554752b01e16Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
554852b01e16Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
554952b01e16Smrg	 else
555052b01e16Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
555152b01e16Smrg	 fi
555252b01e16Smrg       fi
555352b01e16Smrg       ;;
55544b0ead49Smrg
555552b01e16Smrg    *.$objext)
555652b01e16Smrg       # This assumes that the test object file only shows up
555752b01e16Smrg       # once in the compiler output.
555852b01e16Smrg       if test "$p" = "conftest.$objext"; then
555952b01e16Smrg	 pre_test_object_deps_done=yes
556052b01e16Smrg	 continue
556152b01e16Smrg       fi
55624b0ead49Smrg
556352b01e16Smrg       if test "$pre_test_object_deps_done" = no; then
556452b01e16Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
556552b01e16Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
556652b01e16Smrg	 else
556752b01e16Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
556852b01e16Smrg	 fi
556952b01e16Smrg       else
557052b01e16Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
557152b01e16Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
557252b01e16Smrg	 else
557352b01e16Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
557452b01e16Smrg	 fi
557552b01e16Smrg       fi
557652b01e16Smrg       ;;
55774b0ead49Smrg
557852b01e16Smrg    *) ;; # Ignore the rest.
55794b0ead49Smrg
558052b01e16Smrg    esac
558152b01e16Smrg  done
55824b0ead49Smrg
558352b01e16Smrg  # Clean up.
558452b01e16Smrg  rm -f a.out a.exe
558552b01e16Smrgelse
558652b01e16Smrg  echo "libtool.m4: error: problem compiling $1 test program"
558752b01e16Smrgfi
55884b0ead49Smrg
558952b01e16Smrg$rm -f confest.$objext
55904b0ead49Smrg
559152b01e16Smrg_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
559252b01e16Smrgif test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
559352b01e16Smrg  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
559452b01e16Smrgfi
55954b0ead49Smrg
559652b01e16Smrg# PORTME: override above test on systems where it is broken
559752b01e16Smrgifelse([$1],[CXX],
559852b01e16Smrg[case $host_os in
559952b01e16Smrginterix[[3-9]]*)
560052b01e16Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
560152b01e16Smrg  # hack all around it, let's just trust "g++" to DTRT.
560252b01e16Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
560352b01e16Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
560452b01e16Smrg  _LT_AC_TAGVAR(postdeps,$1)=
560552b01e16Smrg  ;;
56064b0ead49Smrg
560752b01e16Smrglinux*)
560852b01e16Smrg  case `$CC -V 2>&1 | sed 5q` in
560952b01e16Smrg  *Sun\ C*)
561052b01e16Smrg    # Sun C++ 5.9
561152b01e16Smrg    #
561252b01e16Smrg    # The more standards-conforming stlport4 library is
561352b01e16Smrg    # incompatible with the Cstd library. Avoid specifying
561452b01e16Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
561552b01e16Smrg    # -library=stlport4 depends on it.
561652b01e16Smrg    case " $CXX $CXXFLAGS " in
561752b01e16Smrg    *" -library=stlport4 "*)
561852b01e16Smrg      solaris_use_stlport4=yes
561952b01e16Smrg      ;;
562052b01e16Smrg    esac
562152b01e16Smrg    if test "$solaris_use_stlport4" != yes; then
562252b01e16Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
562352b01e16Smrg    fi
562452b01e16Smrg    ;;
562552b01e16Smrg  esac
562652b01e16Smrg  ;;
56274b0ead49Smrg
562852b01e16Smrgsolaris*)
562952b01e16Smrg  case $cc_basename in
563052b01e16Smrg  CC*)
563152b01e16Smrg    # The more standards-conforming stlport4 library is
563252b01e16Smrg    # incompatible with the Cstd library. Avoid specifying
563352b01e16Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
563452b01e16Smrg    # -library=stlport4 depends on it.
563552b01e16Smrg    case " $CXX $CXXFLAGS " in
563652b01e16Smrg    *" -library=stlport4 "*)
563752b01e16Smrg      solaris_use_stlport4=yes
563852b01e16Smrg      ;;
563952b01e16Smrg    esac
56404b0ead49Smrg
564152b01e16Smrg    # Adding this requires a known-good setup of shared libraries for
564252b01e16Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
564352b01e16Smrg    # archive will be linked into the output, leading to subtle bugs.
564452b01e16Smrg    if test "$solaris_use_stlport4" != yes; then
564552b01e16Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
564652b01e16Smrg    fi
564752b01e16Smrg    ;;
564852b01e16Smrg  esac
564952b01e16Smrg  ;;
565052b01e16Smrgesac
565152b01e16Smrg])
565252b01e16Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
565352b01e16Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
565452b01e16Smrgesac
565552b01e16Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
56564b0ead49Smrg
565752b01e16Smrg# AC_LIBTOOL_LANG_F77_CONFIG
565852b01e16Smrg# --------------------------
565952b01e16Smrg# Ensure that the configuration vars for the C compiler are
566052b01e16Smrg# suitably defined.  Those variables are subsequently used by
566152b01e16Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
566252b01e16SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
566352b01e16SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
566452b01e16Smrg[AC_REQUIRE([AC_PROG_F77])
566552b01e16SmrgAC_LANG_PUSH(Fortran 77)
56664b0ead49Smrg
566752b01e16Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
566852b01e16Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
566952b01e16Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
567052b01e16Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
567152b01e16Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
567252b01e16Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
567352b01e16Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
567452b01e16Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
567552b01e16Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
567652b01e16Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
567752b01e16Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
567852b01e16Smrg_LT_AC_TAGVAR(module_cmds, $1)=
567952b01e16Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
568052b01e16Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
568152b01e16Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
568252b01e16Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
568352b01e16Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
568452b01e16Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
56854b0ead49Smrg
568652b01e16Smrg# Source file extension for f77 test sources.
568752b01e16Smrgac_ext=f
56884b0ead49Smrg
568952b01e16Smrg# Object file extension for compiled f77 test sources.
569052b01e16Smrgobjext=o
569152b01e16Smrg_LT_AC_TAGVAR(objext, $1)=$objext
56924b0ead49Smrg
569352b01e16Smrg# Code to be used in simple compile tests
569452b01e16Smrglt_simple_compile_test_code="\
569552b01e16Smrg      subroutine t
569652b01e16Smrg      return
569752b01e16Smrg      end
569852b01e16Smrg"
56994b0ead49Smrg
570052b01e16Smrg# Code to be used in simple link tests
570152b01e16Smrglt_simple_link_test_code="\
570252b01e16Smrg      program t
570352b01e16Smrg      end
570452b01e16Smrg"
57054b0ead49Smrg
570652b01e16Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
570752b01e16Smrg_LT_AC_SYS_COMPILER
57084b0ead49Smrg
570952b01e16Smrg# save warnings/boilerplate of simple test code
571052b01e16Smrg_LT_COMPILER_BOILERPLATE
571152b01e16Smrg_LT_LINKER_BOILERPLATE
57124b0ead49Smrg
571352b01e16Smrg# Allow CC to be a program name with arguments.
571452b01e16Smrglt_save_CC="$CC"
571552b01e16SmrgCC=${F77-"f77"}
571652b01e16Smrgcompiler=$CC
571752b01e16Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
571852b01e16Smrg_LT_CC_BASENAME([$compiler])
571952b01e16Smrg
572052b01e16SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
572152b01e16SmrgAC_MSG_RESULT([$can_build_shared])
572252b01e16Smrg
572352b01e16SmrgAC_MSG_CHECKING([whether to build shared libraries])
572452b01e16Smrgtest "$can_build_shared" = "no" && enable_shared=no
572552b01e16Smrg
572652b01e16Smrg# On AIX, shared libraries and static libraries use the same namespace, and
572752b01e16Smrg# are all built from PIC.
572852b01e16Smrgcase $host_os in
572952b01e16Smrgaix3*)
573052b01e16Smrg  test "$enable_shared" = yes && enable_static=no
573152b01e16Smrg  if test -n "$RANLIB"; then
573252b01e16Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
573352b01e16Smrg    postinstall_cmds='$RANLIB $lib'
57344b0ead49Smrg  fi
573552b01e16Smrg  ;;
573652b01e16Smrgaix[[4-9]]*)
573752b01e16Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
573852b01e16Smrg    test "$enable_shared" = yes && enable_static=no
573952b01e16Smrg  fi
574052b01e16Smrg  ;;
574152b01e16Smrgesac
574252b01e16SmrgAC_MSG_RESULT([$enable_shared])
57434b0ead49Smrg
574452b01e16SmrgAC_MSG_CHECKING([whether to build static libraries])
574552b01e16Smrg# Make sure either enable_shared or enable_static is yes.
574652b01e16Smrgtest "$enable_shared" = yes || enable_static=yes
574752b01e16SmrgAC_MSG_RESULT([$enable_static])
57484b0ead49Smrg
574952b01e16Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
575052b01e16Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
57514b0ead49Smrg
575252b01e16SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
575352b01e16SmrgAC_LIBTOOL_PROG_CC_C_O($1)
575452b01e16SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
575552b01e16SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
575652b01e16SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
575752b01e16SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
57584b0ead49Smrg
575952b01e16SmrgAC_LIBTOOL_CONFIG($1)
57604b0ead49Smrg
576152b01e16SmrgAC_LANG_POP
576252b01e16SmrgCC="$lt_save_CC"
576352b01e16Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
57644b0ead49Smrg
57654b0ead49Smrg
576652b01e16Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
576752b01e16Smrg# --------------------------
576852b01e16Smrg# Ensure that the configuration vars for the C compiler are
576952b01e16Smrg# suitably defined.  Those variables are subsequently used by
577052b01e16Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
577152b01e16SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
577252b01e16SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
577352b01e16Smrg[AC_LANG_SAVE
57744b0ead49Smrg
577552b01e16Smrg# Source file extension for Java test sources.
577652b01e16Smrgac_ext=java
57774b0ead49Smrg
577852b01e16Smrg# Object file extension for compiled Java test sources.
577952b01e16Smrgobjext=o
578052b01e16Smrg_LT_AC_TAGVAR(objext, $1)=$objext
57814b0ead49Smrg
578252b01e16Smrg# Code to be used in simple compile tests
578352b01e16Smrglt_simple_compile_test_code="class foo {}"
57844b0ead49Smrg
578552b01e16Smrg# Code to be used in simple link tests
578652b01e16Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
57874b0ead49Smrg
578852b01e16Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
578952b01e16Smrg_LT_AC_SYS_COMPILER
57904b0ead49Smrg
579152b01e16Smrg# save warnings/boilerplate of simple test code
579252b01e16Smrg_LT_COMPILER_BOILERPLATE
579352b01e16Smrg_LT_LINKER_BOILERPLATE
57944b0ead49Smrg
579552b01e16Smrg# Allow CC to be a program name with arguments.
579652b01e16Smrglt_save_CC="$CC"
579752b01e16SmrgCC=${GCJ-"gcj"}
579852b01e16Smrgcompiler=$CC
579952b01e16Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
580052b01e16Smrg_LT_CC_BASENAME([$compiler])
58014b0ead49Smrg
580252b01e16Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
580352b01e16Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
58044b0ead49Smrg
580552b01e16Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
58064b0ead49Smrg
580752b01e16SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
580852b01e16SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
580952b01e16SmrgAC_LIBTOOL_PROG_CC_C_O($1)
581052b01e16SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
581152b01e16SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
581252b01e16SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
581352b01e16SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
58144b0ead49Smrg
581552b01e16SmrgAC_LIBTOOL_CONFIG($1)
58164b0ead49Smrg
581752b01e16SmrgAC_LANG_RESTORE
581852b01e16SmrgCC="$lt_save_CC"
581952b01e16Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
58204b0ead49Smrg
58214b0ead49Smrg
582252b01e16Smrg# AC_LIBTOOL_LANG_RC_CONFIG
582352b01e16Smrg# -------------------------
582452b01e16Smrg# Ensure that the configuration vars for the Windows resource compiler are
582552b01e16Smrg# suitably defined.  Those variables are subsequently used by
582652b01e16Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
582752b01e16SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
582852b01e16SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
582952b01e16Smrg[AC_LANG_SAVE
58304b0ead49Smrg
583152b01e16Smrg# Source file extension for RC test sources.
583252b01e16Smrgac_ext=rc
58334b0ead49Smrg
583452b01e16Smrg# Object file extension for compiled RC test sources.
583552b01e16Smrgobjext=o
583652b01e16Smrg_LT_AC_TAGVAR(objext, $1)=$objext
58374b0ead49Smrg
583852b01e16Smrg# Code to be used in simple compile tests
583952b01e16Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
58404b0ead49Smrg
584152b01e16Smrg# Code to be used in simple link tests
584252b01e16Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
58434b0ead49Smrg
584452b01e16Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
584552b01e16Smrg_LT_AC_SYS_COMPILER
58464b0ead49Smrg
584752b01e16Smrg# save warnings/boilerplate of simple test code
584852b01e16Smrg_LT_COMPILER_BOILERPLATE
584952b01e16Smrg_LT_LINKER_BOILERPLATE
58504b0ead49Smrg
585152b01e16Smrg# Allow CC to be a program name with arguments.
585252b01e16Smrglt_save_CC="$CC"
585352b01e16SmrgCC=${RC-"windres"}
585452b01e16Smrgcompiler=$CC
585552b01e16Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
585652b01e16Smrg_LT_CC_BASENAME([$compiler])
585752b01e16Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
58584b0ead49Smrg
585952b01e16SmrgAC_LIBTOOL_CONFIG($1)
58604b0ead49Smrg
586152b01e16SmrgAC_LANG_RESTORE
586252b01e16SmrgCC="$lt_save_CC"
586352b01e16Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
586452b01e16Smrg
586552b01e16Smrg
586652b01e16Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
586752b01e16Smrg# ----------------------------
586852b01e16Smrg# If TAGNAME is not passed, then create an initial libtool script
586952b01e16Smrg# with a default configuration from the untagged config vars.  Otherwise
587052b01e16Smrg# add code to config.status for appending the configuration named by
587152b01e16Smrg# TAGNAME from the matching tagged config vars.
587252b01e16SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
587352b01e16Smrg[# The else clause should only fire when bootstrapping the
587452b01e16Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
587552b01e16Smrg# with your package, and you will get complaints that there are
587652b01e16Smrg# no rules to generate ltmain.sh.
587752b01e16Smrgif test -f "$ltmain"; then
587852b01e16Smrg  # See if we are running on zsh, and set the options which allow our commands through
587952b01e16Smrg  # without removal of \ escapes.
588052b01e16Smrg  if test -n "${ZSH_VERSION+set}" ; then
588152b01e16Smrg    setopt NO_GLOB_SUBST
588252b01e16Smrg  fi
588352b01e16Smrg  # Now quote all the things that may contain metacharacters while being
588452b01e16Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
588552b01e16Smrg  # variables and quote the copies for generation of the libtool script.
588652b01e16Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
588752b01e16Smrg    SED SHELL STRIP \
588852b01e16Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
588952b01e16Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
589052b01e16Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
589152b01e16Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
589252b01e16Smrg    lt_cv_sys_global_symbol_to_c_name_address \
589352b01e16Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
589452b01e16Smrg    old_postinstall_cmds old_postuninstall_cmds \
589552b01e16Smrg    _LT_AC_TAGVAR(compiler, $1) \
589652b01e16Smrg    _LT_AC_TAGVAR(CC, $1) \
589752b01e16Smrg    _LT_AC_TAGVAR(LD, $1) \
589852b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
589952b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
590052b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
590152b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
590252b01e16Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
590352b01e16Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
590452b01e16Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
590552b01e16Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
590652b01e16Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
590752b01e16Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
590852b01e16Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
590952b01e16Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
591052b01e16Smrg    _LT_AC_TAGVAR(predeps, $1) \
591152b01e16Smrg    _LT_AC_TAGVAR(postdeps, $1) \
591252b01e16Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
591352b01e16Smrg    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
591452b01e16Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
591552b01e16Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
591652b01e16Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
591752b01e16Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
591852b01e16Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
591952b01e16Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
592052b01e16Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
592152b01e16Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
592252b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
592352b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
592452b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
592552b01e16Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
592652b01e16Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
592752b01e16Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
592852b01e16Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
592952b01e16Smrg    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
593052b01e16Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
593152b01e16Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
593252b01e16Smrg
593352b01e16Smrg    case $var in
593452b01e16Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
593552b01e16Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
593652b01e16Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
593752b01e16Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
593852b01e16Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
593952b01e16Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
594052b01e16Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
594152b01e16Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
594252b01e16Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
594352b01e16Smrg    postinstall_cmds | postuninstall_cmds | \
594452b01e16Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
594552b01e16Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
594652b01e16Smrg      # Double-quote double-evaled strings.
594752b01e16Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
59484b0ead49Smrg      ;;
59494b0ead49Smrg    *)
595052b01e16Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
59514b0ead49Smrg      ;;
59524b0ead49Smrg    esac
595352b01e16Smrg  done
59544b0ead49Smrg
595552b01e16Smrg  case $lt_echo in
595652b01e16Smrg  *'\[$]0 --fallback-echo"')
595752b01e16Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
595852b01e16Smrg    ;;
595952b01e16Smrg  esac
59604b0ead49Smrg
596152b01e16Smrgifelse([$1], [],
596252b01e16Smrg  [cfgfile="${ofile}T"
596352b01e16Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
596452b01e16Smrg  $rm -f "$cfgfile"
596552b01e16Smrg  AC_MSG_NOTICE([creating $ofile])],
596652b01e16Smrg  [cfgfile="$ofile"])
59674b0ead49Smrg
596852b01e16Smrg  cat <<__EOF__ >> "$cfgfile"
596952b01e16Smrgifelse([$1], [],
597052b01e16Smrg[#! $SHELL
59714b0ead49Smrg
597252b01e16Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
597352b01e16Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
597452b01e16Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
597552b01e16Smrg#
597652b01e16Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
597752b01e16Smrg# Free Software Foundation, Inc.
597852b01e16Smrg#
597952b01e16Smrg# This file is part of GNU Libtool:
598052b01e16Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
598152b01e16Smrg#
598252b01e16Smrg# This program is free software; you can redistribute it and/or modify
598352b01e16Smrg# it under the terms of the GNU General Public License as published by
598452b01e16Smrg# the Free Software Foundation; either version 2 of the License, or
598552b01e16Smrg# (at your option) any later version.
598652b01e16Smrg#
598752b01e16Smrg# This program is distributed in the hope that it will be useful, but
598852b01e16Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
598952b01e16Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
599052b01e16Smrg# General Public License for more details.
599152b01e16Smrg#
599252b01e16Smrg# You should have received a copy of the GNU General Public License
599352b01e16Smrg# along with this program; if not, write to the Free Software
599452b01e16Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
599552b01e16Smrg#
599652b01e16Smrg# As a special exception to the GNU General Public License, if you
599752b01e16Smrg# distribute this file as part of a program that contains a
599852b01e16Smrg# configuration script generated by Autoconf, you may include it under
599952b01e16Smrg# the same distribution terms that you use for the rest of that program.
60004b0ead49Smrg
600152b01e16Smrg# A sed program that does not truncate output.
600252b01e16SmrgSED=$lt_SED
60034b0ead49Smrg
600452b01e16Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
600552b01e16SmrgXsed="$SED -e 1s/^X//"
60064b0ead49Smrg
600752b01e16Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
600852b01e16Smrg# if CDPATH is set.
600952b01e16Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
60104b0ead49Smrg
601152b01e16Smrg# The names of the tagged configurations supported by this script.
601252b01e16Smrgavailable_tags=
60134b0ead49Smrg
601452b01e16Smrg# ### BEGIN LIBTOOL CONFIG],
601552b01e16Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
60164b0ead49Smrg
601752b01e16Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
60184b0ead49Smrg
601952b01e16Smrg# Shell to use when invoking shell scripts.
602052b01e16SmrgSHELL=$lt_SHELL
60214b0ead49Smrg
602252b01e16Smrg# Whether or not to build shared libraries.
602352b01e16Smrgbuild_libtool_libs=$enable_shared
60244b0ead49Smrg
602552b01e16Smrg# Whether or not to build static libraries.
602652b01e16Smrgbuild_old_libs=$enable_static
60274b0ead49Smrg
602852b01e16Smrg# Whether or not to add -lc for building shared libraries.
602952b01e16Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
60304b0ead49Smrg
603152b01e16Smrg# Whether or not to disallow shared libs when runtime libs are static
603252b01e16Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
60334b0ead49Smrg
603452b01e16Smrg# Whether or not to optimize for fast installation.
603552b01e16Smrgfast_install=$enable_fast_install
60364b0ead49Smrg
603752b01e16Smrg# The host system.
603852b01e16Smrghost_alias=$host_alias
603952b01e16Smrghost=$host
604052b01e16Smrghost_os=$host_os
60414b0ead49Smrg
604252b01e16Smrg# The build system.
604352b01e16Smrgbuild_alias=$build_alias
604452b01e16Smrgbuild=$build
604552b01e16Smrgbuild_os=$build_os
60464b0ead49Smrg
604752b01e16Smrg# An echo program that does not interpret backslashes.
604852b01e16Smrgecho=$lt_echo
60494b0ead49Smrg
605052b01e16Smrg# The archiver.
605152b01e16SmrgAR=$lt_AR
605252b01e16SmrgAR_FLAGS=$lt_AR_FLAGS
60534b0ead49Smrg
605452b01e16Smrg# A C compiler.
605552b01e16SmrgLTCC=$lt_LTCC
60564b0ead49Smrg
605752b01e16Smrg# LTCC compiler flags.
605852b01e16SmrgLTCFLAGS=$lt_LTCFLAGS
60594b0ead49Smrg
606052b01e16Smrg# A language-specific compiler.
606152b01e16SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
60624b0ead49Smrg
606352b01e16Smrg# Is the compiler the GNU C compiler?
606452b01e16Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
60654b0ead49Smrg
606652b01e16Smrg# An ERE matcher.
606752b01e16SmrgEGREP=$lt_EGREP
60684b0ead49Smrg
606952b01e16Smrg# The linker used to build libraries.
607052b01e16SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
60714b0ead49Smrg
607252b01e16Smrg# Whether we need hard or soft links.
607352b01e16SmrgLN_S=$lt_LN_S
60744b0ead49Smrg
607552b01e16Smrg# A BSD-compatible nm program.
607652b01e16SmrgNM=$lt_NM
60774b0ead49Smrg
607852b01e16Smrg# A symbol stripping program
607952b01e16SmrgSTRIP=$lt_STRIP
60804b0ead49Smrg
608152b01e16Smrg# Used to examine libraries when file_magic_cmd begins "file"
608252b01e16SmrgMAGIC_CMD=$MAGIC_CMD
60834b0ead49Smrg
608452b01e16Smrg# Used on cygwin: DLL creation program.
608552b01e16SmrgDLLTOOL="$DLLTOOL"
60864b0ead49Smrg
608752b01e16Smrg# Used on cygwin: object dumper.
608852b01e16SmrgOBJDUMP="$OBJDUMP"
60894b0ead49Smrg
609052b01e16Smrg# Used on cygwin: assembler.
609152b01e16SmrgAS="$AS"
60924b0ead49Smrg
609352b01e16Smrg# The name of the directory that contains temporary libtool files.
609452b01e16Smrgobjdir=$objdir
60954b0ead49Smrg
609652b01e16Smrg# How to create reloadable object files.
609752b01e16Smrgreload_flag=$lt_reload_flag
609852b01e16Smrgreload_cmds=$lt_reload_cmds
60994b0ead49Smrg
610052b01e16Smrg# How to pass a linker flag through the compiler.
610152b01e16Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
61024b0ead49Smrg
610352b01e16Smrg# Object file suffix (normally "o").
610452b01e16Smrgobjext="$ac_objext"
61054b0ead49Smrg
610652b01e16Smrg# Old archive suffix (normally "a").
610752b01e16Smrglibext="$libext"
61084b0ead49Smrg
610952b01e16Smrg# Shared library suffix (normally ".so").
611052b01e16Smrgshrext_cmds='$shrext_cmds'
61114b0ead49Smrg
611252b01e16Smrg# Executable file suffix (normally "").
611352b01e16Smrgexeext="$exeext"
61144b0ead49Smrg
611552b01e16Smrg# Additional compiler flags for building library objects.
611652b01e16Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
611752b01e16Smrgpic_mode=$pic_mode
61184b0ead49Smrg
611952b01e16Smrg# What is the maximum length of a command?
612052b01e16Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
61214b0ead49Smrg
612252b01e16Smrg# Does compiler simultaneously support -c and -o options?
612352b01e16Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
61244b0ead49Smrg
612552b01e16Smrg# Must we lock files when doing compilation?
612652b01e16Smrgneed_locks=$lt_need_locks
61274b0ead49Smrg
612852b01e16Smrg# Do we need the lib prefix for modules?
612952b01e16Smrgneed_lib_prefix=$need_lib_prefix
61304b0ead49Smrg
613152b01e16Smrg# Do we need a version for libraries?
613252b01e16Smrgneed_version=$need_version
61334b0ead49Smrg
613452b01e16Smrg# Whether dlopen is supported.
613552b01e16Smrgdlopen_support=$enable_dlopen
61364b0ead49Smrg
613752b01e16Smrg# Whether dlopen of programs is supported.
613852b01e16Smrgdlopen_self=$enable_dlopen_self
61394b0ead49Smrg
614052b01e16Smrg# Whether dlopen of statically linked programs is supported.
614152b01e16Smrgdlopen_self_static=$enable_dlopen_self_static
61424b0ead49Smrg
614352b01e16Smrg# Compiler flag to prevent dynamic linking.
614452b01e16Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
61454b0ead49Smrg
614652b01e16Smrg# Compiler flag to turn off builtin functions.
614752b01e16Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
61484b0ead49Smrg
614952b01e16Smrg# Compiler flag to allow reflexive dlopens.
615052b01e16Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
61514b0ead49Smrg
615252b01e16Smrg# Compiler flag to generate shared objects directly from archives.
615352b01e16Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
61544b0ead49Smrg
615552b01e16Smrg# Compiler flag to generate thread-safe objects.
615652b01e16Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
61574b0ead49Smrg
615852b01e16Smrg# Library versioning type.
615952b01e16Smrgversion_type=$version_type
61604b0ead49Smrg
616152b01e16Smrg# Format of library name prefix.
616252b01e16Smrglibname_spec=$lt_libname_spec
61634b0ead49Smrg
616452b01e16Smrg# List of archive names.  First name is the real one, the rest are links.
616552b01e16Smrg# The last name is the one that the linker finds with -lNAME.
616652b01e16Smrglibrary_names_spec=$lt_library_names_spec
61674b0ead49Smrg
616852b01e16Smrg# The coded name of the library, if different from the real name.
616952b01e16Smrgsoname_spec=$lt_soname_spec
61704b0ead49Smrg
617152b01e16Smrg# Commands used to build and install an old-style archive.
617252b01e16SmrgRANLIB=$lt_RANLIB
617352b01e16Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
617452b01e16Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
617552b01e16Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
61764b0ead49Smrg
617752b01e16Smrg# Create an old-style archive from a shared archive.
617852b01e16Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
61794b0ead49Smrg
618052b01e16Smrg# Create a temporary old-style archive to link instead of a shared archive.
618152b01e16Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
61824b0ead49Smrg
618352b01e16Smrg# Commands used to build and install a shared archive.
618452b01e16Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
618552b01e16Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
618652b01e16Smrgpostinstall_cmds=$lt_postinstall_cmds
618752b01e16Smrgpostuninstall_cmds=$lt_postuninstall_cmds
61884b0ead49Smrg
618952b01e16Smrg# Commands used to build a loadable module (assumed same as above if empty)
619052b01e16Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
619152b01e16Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
61924b0ead49Smrg
619352b01e16Smrg# Commands to strip libraries.
619452b01e16Smrgold_striplib=$lt_old_striplib
619552b01e16Smrgstriplib=$lt_striplib
61964b0ead49Smrg
619752b01e16Smrg# Dependencies to place before the objects being linked to create a
619852b01e16Smrg# shared library.
619952b01e16Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
62004b0ead49Smrg
620152b01e16Smrg# Dependencies to place after the objects being linked to create a
620252b01e16Smrg# shared library.
620352b01e16Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
62044b0ead49Smrg
620552b01e16Smrg# Dependencies to place before the objects being linked to create a
620652b01e16Smrg# shared library.
620752b01e16Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
62084b0ead49Smrg
620952b01e16Smrg# Dependencies to place after the objects being linked to create a
621052b01e16Smrg# shared library.
621152b01e16Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
62124b0ead49Smrg
621352b01e16Smrg# The directories searched by this compiler when creating a shared
621452b01e16Smrg# library
621552b01e16Smrgcompiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
62164b0ead49Smrg
621752b01e16Smrg# The library search path used internally by the compiler when linking
621852b01e16Smrg# a shared library.
621952b01e16Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
62204b0ead49Smrg
622152b01e16Smrg# Method to check whether dependent libraries are shared objects.
622252b01e16Smrgdeplibs_check_method=$lt_deplibs_check_method
62234b0ead49Smrg
622452b01e16Smrg# Command to use when deplibs_check_method == file_magic.
622552b01e16Smrgfile_magic_cmd=$lt_file_magic_cmd
62264b0ead49Smrg
622752b01e16Smrg# Flag that allows shared libraries with undefined symbols to be built.
622852b01e16Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
62294b0ead49Smrg
623052b01e16Smrg# Flag that forces no undefined symbols.
623152b01e16Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
62324b0ead49Smrg
623352b01e16Smrg# Commands used to finish a libtool library installation in a directory.
623452b01e16Smrgfinish_cmds=$lt_finish_cmds
62354b0ead49Smrg
623652b01e16Smrg# Same as above, but a single script fragment to be evaled but not shown.
623752b01e16Smrgfinish_eval=$lt_finish_eval
62384b0ead49Smrg
623952b01e16Smrg# Take the output of nm and produce a listing of raw symbols and C names.
624052b01e16Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
62414b0ead49Smrg
624252b01e16Smrg# Transform the output of nm in a proper C declaration
624352b01e16Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
62444b0ead49Smrg
624552b01e16Smrg# Transform the output of nm in a C name address pair
624652b01e16Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
62474b0ead49Smrg
624852b01e16Smrg# This is the shared library runtime path variable.
624952b01e16Smrgrunpath_var=$runpath_var
62504b0ead49Smrg
625152b01e16Smrg# This is the shared library path variable.
625252b01e16Smrgshlibpath_var=$shlibpath_var
62534b0ead49Smrg
625452b01e16Smrg# Is shlibpath searched before the hard-coded library search path?
625552b01e16Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
62564b0ead49Smrg
625752b01e16Smrg# How to hardcode a shared library path into an executable.
625852b01e16Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
62594b0ead49Smrg
626052b01e16Smrg# Whether we should hardcode library paths into libraries.
626152b01e16Smrghardcode_into_libs=$hardcode_into_libs
62624b0ead49Smrg
626352b01e16Smrg# Flag to hardcode \$libdir into a binary during linking.
626452b01e16Smrg# This must work even if \$libdir does not exist.
626552b01e16Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
62664b0ead49Smrg
626752b01e16Smrg# If ld is used when linking, flag to hardcode \$libdir into
626852b01e16Smrg# a binary during linking. This must work even if \$libdir does
626952b01e16Smrg# not exist.
627052b01e16Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
62714b0ead49Smrg
627252b01e16Smrg# Whether we need a single -rpath flag with a separated argument.
627352b01e16Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
62744b0ead49Smrg
627552b01e16Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
627652b01e16Smrg# resulting binary.
627752b01e16Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
62784b0ead49Smrg
627952b01e16Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
628052b01e16Smrg# resulting binary.
628152b01e16Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
62824b0ead49Smrg
628352b01e16Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
628452b01e16Smrg# the resulting binary.
628552b01e16Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
62864b0ead49Smrg
628752b01e16Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
628852b01e16Smrg# and all subsequent libraries and executables linked against it.
628952b01e16Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
62904b0ead49Smrg
629152b01e16Smrg# Variables whose values should be saved in libtool wrapper scripts and
629252b01e16Smrg# restored at relink time.
629352b01e16Smrgvariables_saved_for_relink="$variables_saved_for_relink"
62944b0ead49Smrg
629552b01e16Smrg# Whether libtool must link a program against all its dependency libraries.
629652b01e16Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
62974b0ead49Smrg
629852b01e16Smrg# Compile-time system search path for libraries
629952b01e16Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
63004b0ead49Smrg
630152b01e16Smrg# Run-time system search path for libraries
630252b01e16Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
63034b0ead49Smrg
630452b01e16Smrg# Fix the shell variable \$srcfile for the compiler.
630552b01e16Smrgfix_srcfile_path=$lt_fix_srcfile_path
63064b0ead49Smrg
630752b01e16Smrg# Set to yes if exported symbols are required.
630852b01e16Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
63094b0ead49Smrg
631052b01e16Smrg# The commands to list exported symbols.
631152b01e16Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
63124b0ead49Smrg
631352b01e16Smrg# The commands to extract the exported symbol list from a shared archive.
631452b01e16Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
63154b0ead49Smrg
631652b01e16Smrg# Symbols that should not be listed in the preloaded symbols.
631752b01e16Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
63184b0ead49Smrg
631952b01e16Smrg# Symbols that must always be exported.
632052b01e16Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
63214b0ead49Smrg
632252b01e16Smrgifelse([$1],[],
632352b01e16Smrg[# ### END LIBTOOL CONFIG],
632452b01e16Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
63254b0ead49Smrg
632652b01e16Smrg__EOF__
63274b0ead49Smrg
632852b01e16Smrgifelse([$1],[], [
632952b01e16Smrg  case $host_os in
633052b01e16Smrg  aix3*)
633152b01e16Smrg    cat <<\EOF >> "$cfgfile"
63324b0ead49Smrg
633352b01e16Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
633452b01e16Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
633552b01e16Smrg# vanish in a puff of smoke.
633652b01e16Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
633752b01e16Smrg  COLLECT_NAMES=
633852b01e16Smrg  export COLLECT_NAMES
633952b01e16Smrgfi
634052b01e16SmrgEOF
634152b01e16Smrg    ;;
634252b01e16Smrg  esac
63434b0ead49Smrg
634452b01e16Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
634552b01e16Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
634652b01e16Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
634752b01e16Smrg  # is reportedly fixed, but why not run on old versions too?
634852b01e16Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
63494b0ead49Smrg
635052b01e16Smrg  mv -f "$cfgfile" "$ofile" || \
635152b01e16Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
635252b01e16Smrg  chmod +x "$ofile"
63534b0ead49Smrg])
635452b01e16Smrgelse
635552b01e16Smrg  # If there is no Makefile yet, we rely on a make rule to execute
635652b01e16Smrg  # `config.status --recheck' to rerun these tests and create the
635752b01e16Smrg  # libtool script then.
635852b01e16Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
635952b01e16Smrg  if test -f "$ltmain_in"; then
636052b01e16Smrg    test -f Makefile && make "$ltmain"
636152b01e16Smrg  fi
636252b01e16Smrgfi
636352b01e16Smrg])# AC_LIBTOOL_CONFIG
63644b0ead49Smrg
63654b0ead49Smrg
636652b01e16Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
636752b01e16Smrg# -------------------------------------------
636852b01e16SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
636952b01e16Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
63704b0ead49Smrg
637152b01e16Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
63724b0ead49Smrg
637352b01e16Smrgif test "$GCC" = yes; then
637452b01e16Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
63754b0ead49Smrg
637652b01e16Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
637752b01e16Smrg    lt_cv_prog_compiler_rtti_exceptions,
637852b01e16Smrg    [-fno-rtti -fno-exceptions], [],
637952b01e16Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
638052b01e16Smrgfi
638152b01e16Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
63824b0ead49Smrg
63834b0ead49Smrg
638452b01e16Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
638552b01e16Smrg# ---------------------------------
638652b01e16SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
638752b01e16Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
638852b01e16SmrgAC_REQUIRE([LT_AC_PROG_SED])
638952b01e16SmrgAC_REQUIRE([AC_PROG_NM])
639052b01e16SmrgAC_REQUIRE([AC_OBJEXT])
639152b01e16Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
639252b01e16SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
639352b01e16SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
639452b01e16Smrg[
639552b01e16Smrg# These are sane defaults that work on at least a few old systems.
639652b01e16Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
63974b0ead49Smrg
639852b01e16Smrg# Character class describing NM global symbol codes.
639952b01e16Smrgsymcode='[[BCDEGRST]]'
64004b0ead49Smrg
640152b01e16Smrg# Regexp to match symbols that can be accessed directly from C.
640252b01e16Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
64034b0ead49Smrg
640452b01e16Smrg# Transform an extracted symbol line into a proper C declaration
640552b01e16Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
64064b0ead49Smrg
640752b01e16Smrg# Transform an extracted symbol line into symbol name and symbol address
640852b01e16Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
64094b0ead49Smrg
641052b01e16Smrg# Define system-specific variables.
641152b01e16Smrgcase $host_os in
641252b01e16Smrgaix*)
641352b01e16Smrg  symcode='[[BCDT]]'
641452b01e16Smrg  ;;
641552b01e16Smrgcygwin* | mingw* | pw32*)
641652b01e16Smrg  symcode='[[ABCDGISTW]]'
641752b01e16Smrg  ;;
641852b01e16Smrghpux*) # Its linker distinguishes data from code symbols
641952b01e16Smrg  if test "$host_cpu" = ia64; then
642052b01e16Smrg    symcode='[[ABCDEGRST]]'
642152b01e16Smrg  fi
642252b01e16Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
642352b01e16Smrg  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
642452b01e16Smrg  ;;
642552b01e16Smrglinux* | k*bsd*-gnu)
642652b01e16Smrg  if test "$host_cpu" = ia64; then
642752b01e16Smrg    symcode='[[ABCDGIRSTW]]'
642852b01e16Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
642952b01e16Smrg    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
643052b01e16Smrg  fi
643152b01e16Smrg  ;;
643252b01e16Smrgirix* | nonstopux*)
643352b01e16Smrg  symcode='[[BCDEGRST]]'
643452b01e16Smrg  ;;
643552b01e16Smrgosf*)
643652b01e16Smrg  symcode='[[BCDEGQRST]]'
643752b01e16Smrg  ;;
643852b01e16Smrgsolaris*)
643952b01e16Smrg  symcode='[[BDRT]]'
644052b01e16Smrg  ;;
644152b01e16Smrgsco3.2v5*)
644252b01e16Smrg  symcode='[[DT]]'
644352b01e16Smrg  ;;
644452b01e16Smrgsysv4.2uw2*)
644552b01e16Smrg  symcode='[[DT]]'
644652b01e16Smrg  ;;
644752b01e16Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
644852b01e16Smrg  symcode='[[ABDT]]'
644952b01e16Smrg  ;;
645052b01e16Smrgsysv4)
645152b01e16Smrg  symcode='[[DFNSTU]]'
645252b01e16Smrg  ;;
645352b01e16Smrgesac
64544b0ead49Smrg
645552b01e16Smrg# Handle CRLF in mingw tool chain
645652b01e16Smrgopt_cr=
645752b01e16Smrgcase $build_os in
645852b01e16Smrgmingw*)
645952b01e16Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
646052b01e16Smrg  ;;
646152b01e16Smrgesac
64624b0ead49Smrg
646352b01e16Smrg# If we're using GNU nm, then use its standard symbol codes.
646452b01e16Smrgcase `$NM -V 2>&1` in
646552b01e16Smrg*GNU* | *'with BFD'*)
646652b01e16Smrg  symcode='[[ABCDGIRSTW]]' ;;
646752b01e16Smrgesac
64684b0ead49Smrg
646952b01e16Smrg# Try without a prefix undercore, then with it.
647052b01e16Smrgfor ac_symprfx in "" "_"; do
64714b0ead49Smrg
647252b01e16Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
647352b01e16Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
64744b0ead49Smrg
647552b01e16Smrg  # Write the raw and C identifiers.
647652b01e16Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
64774b0ead49Smrg
647852b01e16Smrg  # Check to see that the pipe works correctly.
647952b01e16Smrg  pipe_works=no
64804b0ead49Smrg
648152b01e16Smrg  rm -f conftest*
648252b01e16Smrg  cat > conftest.$ac_ext <<EOF
648352b01e16Smrg#ifdef __cplusplus
648452b01e16Smrgextern "C" {
648552b01e16Smrg#endif
648652b01e16Smrgchar nm_test_var;
648752b01e16Smrgvoid nm_test_func(){}
648852b01e16Smrg#ifdef __cplusplus
648952b01e16Smrg}
649052b01e16Smrg#endif
649152b01e16Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
649252b01e16SmrgEOF
64934b0ead49Smrg
649452b01e16Smrg  if AC_TRY_EVAL(ac_compile); then
649552b01e16Smrg    # Now try to grab the symbols.
649652b01e16Smrg    nlist=conftest.nm
649752b01e16Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
649852b01e16Smrg      # Try sorting and uniquifying the output.
649952b01e16Smrg      if sort "$nlist" | uniq > "$nlist"T; then
650052b01e16Smrg	mv -f "$nlist"T "$nlist"
650152b01e16Smrg      else
650252b01e16Smrg	rm -f "$nlist"T
650352b01e16Smrg      fi
65044b0ead49Smrg
650552b01e16Smrg      # Make sure that we snagged all the symbols we need.
650652b01e16Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
650752b01e16Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
650852b01e16Smrg	  cat <<EOF > conftest.$ac_ext
650952b01e16Smrg#ifdef __cplusplus
651052b01e16Smrgextern "C" {
651152b01e16Smrg#endif
65124b0ead49Smrg
651352b01e16SmrgEOF
651452b01e16Smrg	  # Now generate the symbol file.
651552b01e16Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
65164b0ead49Smrg
651752b01e16Smrg	  cat <<EOF >> conftest.$ac_ext
651852b01e16Smrg#if defined (__STDC__) && __STDC__
651952b01e16Smrg# define lt_ptr_t void *
652052b01e16Smrg#else
652152b01e16Smrg# define lt_ptr_t char *
652252b01e16Smrg# define const
652352b01e16Smrg#endif
65244b0ead49Smrg
652552b01e16Smrg/* The mapping between symbol names and symbols. */
652652b01e16Smrgconst struct {
652752b01e16Smrg  const char *name;
652852b01e16Smrg  lt_ptr_t address;
652952b01e16Smrg}
653052b01e16Smrglt_preloaded_symbols[[]] =
653152b01e16Smrg{
653252b01e16SmrgEOF
653352b01e16Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
653452b01e16Smrg	  cat <<\EOF >> conftest.$ac_ext
653552b01e16Smrg  {0, (lt_ptr_t) 0}
653652b01e16Smrg};
653752b01e16Smrg
653852b01e16Smrg#ifdef __cplusplus
653952b01e16Smrg}
654052b01e16Smrg#endif
654152b01e16SmrgEOF
654252b01e16Smrg	  # Now try linking the two files.
654352b01e16Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
654452b01e16Smrg	  lt_save_LIBS="$LIBS"
654552b01e16Smrg	  lt_save_CFLAGS="$CFLAGS"
654652b01e16Smrg	  LIBS="conftstm.$ac_objext"
654752b01e16Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
654852b01e16Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
654952b01e16Smrg	    pipe_works=yes
655052b01e16Smrg	  fi
655152b01e16Smrg	  LIBS="$lt_save_LIBS"
655252b01e16Smrg	  CFLAGS="$lt_save_CFLAGS"
655352b01e16Smrg	else
655452b01e16Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
655552b01e16Smrg	fi
655652b01e16Smrg      else
655752b01e16Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
655852b01e16Smrg      fi
655952b01e16Smrg    else
656052b01e16Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
656152b01e16Smrg    fi
656252b01e16Smrg  else
656352b01e16Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
656452b01e16Smrg    cat conftest.$ac_ext >&5
656552b01e16Smrg  fi
656652b01e16Smrg  rm -rf conftest* conftst*
656752b01e16Smrg
656852b01e16Smrg  # Do not use the global_symbol_pipe unless it works.
656952b01e16Smrg  if test "$pipe_works" = yes; then
657052b01e16Smrg    break
657152b01e16Smrg  else
657252b01e16Smrg    lt_cv_sys_global_symbol_pipe=
657352b01e16Smrg  fi
657452b01e16Smrgdone
657552b01e16Smrg])
657652b01e16Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
657752b01e16Smrg  lt_cv_sys_global_symbol_to_cdecl=
657852b01e16Smrgfi
657952b01e16Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
658052b01e16Smrg  AC_MSG_RESULT(failed)
658152b01e16Smrgelse
658252b01e16Smrg  AC_MSG_RESULT(ok)
658352b01e16Smrgfi
658452b01e16Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
658552b01e16Smrg
658652b01e16Smrg
658752b01e16Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
658852b01e16Smrg# ---------------------------------------
658952b01e16SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
659052b01e16Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
659152b01e16Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
659252b01e16Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
659352b01e16Smrg
659452b01e16SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
659552b01e16Smrg ifelse([$1],[CXX],[
659652b01e16Smrg  # C++ specific cases for pic, static, wl, etc.
659752b01e16Smrg  if test "$GXX" = yes; then
659852b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
659952b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
660052b01e16Smrg
660152b01e16Smrg    case $host_os in
660252b01e16Smrg    aix*)
660352b01e16Smrg      # All AIX code is PIC.
660452b01e16Smrg      if test "$host_cpu" = ia64; then
660552b01e16Smrg	# AIX 5 now supports IA64 processor
660652b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
660752b01e16Smrg      fi
660852b01e16Smrg      ;;
660952b01e16Smrg    amigaos*)
661052b01e16Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
661152b01e16Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
661252b01e16Smrg      # like `-m68040'.
661352b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
661452b01e16Smrg      ;;
661552b01e16Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
661652b01e16Smrg      # PIC is the default for these OSes.
661752b01e16Smrg      ;;
661852b01e16Smrg    mingw* | cygwin* | os2* | pw32*)
661952b01e16Smrg      # This hack is so that the source file can tell whether it is being
662052b01e16Smrg      # built for inclusion in a dll (and should export symbols for example).
662152b01e16Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
662252b01e16Smrg      # (--disable-auto-import) libraries
662352b01e16Smrg      m4_if([$1], [GCJ], [],
662452b01e16Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
662552b01e16Smrg      ;;
662652b01e16Smrg    darwin* | rhapsody*)
662752b01e16Smrg      # PIC is the default on this platform
662852b01e16Smrg      # Common symbols not allowed in MH_DYLIB files
662952b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
663052b01e16Smrg      ;;
663152b01e16Smrg    *djgpp*)
663252b01e16Smrg      # DJGPP does not support shared libraries at all
663352b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
663452b01e16Smrg      ;;
663552b01e16Smrg    interix[[3-9]]*)
663652b01e16Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
663752b01e16Smrg      # Instead, we relocate shared libraries at runtime.
663852b01e16Smrg      ;;
663952b01e16Smrg    sysv4*MP*)
664052b01e16Smrg      if test -d /usr/nec; then
664152b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
664252b01e16Smrg      fi
664352b01e16Smrg      ;;
664452b01e16Smrg    hpux*)
664552b01e16Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
664652b01e16Smrg      # not for PA HP-UX.
664752b01e16Smrg      case $host_cpu in
664852b01e16Smrg      hppa*64*|ia64*)
664952b01e16Smrg	;;
665052b01e16Smrg      *)
665152b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
665252b01e16Smrg	;;
665352b01e16Smrg      esac
665452b01e16Smrg      ;;
665552b01e16Smrg    *)
665652b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
665752b01e16Smrg      ;;
665852b01e16Smrg    esac
665952b01e16Smrg  else
666052b01e16Smrg    case $host_os in
666152b01e16Smrg      aix[[4-9]]*)
666252b01e16Smrg	# All AIX code is PIC.
666352b01e16Smrg	if test "$host_cpu" = ia64; then
666452b01e16Smrg	  # AIX 5 now supports IA64 processor
666552b01e16Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
666652b01e16Smrg	else
666752b01e16Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
666852b01e16Smrg	fi
666952b01e16Smrg	;;
667052b01e16Smrg      chorus*)
667152b01e16Smrg	case $cc_basename in
667252b01e16Smrg	cxch68*)
667352b01e16Smrg	  # Green Hills C++ Compiler
667452b01e16Smrg	  # _LT_AC_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"
667552b01e16Smrg	  ;;
667652b01e16Smrg	esac
667752b01e16Smrg	;;
667852b01e16Smrg       darwin*)
667952b01e16Smrg         # PIC is the default on this platform
668052b01e16Smrg         # Common symbols not allowed in MH_DYLIB files
668152b01e16Smrg         case $cc_basename in
668252b01e16Smrg           xlc*)
668352b01e16Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
668452b01e16Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
668552b01e16Smrg           ;;
668652b01e16Smrg         esac
668752b01e16Smrg       ;;
668852b01e16Smrg      dgux*)
668952b01e16Smrg	case $cc_basename in
669052b01e16Smrg	  ec++*)
669152b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
669252b01e16Smrg	    ;;
669352b01e16Smrg	  ghcx*)
669452b01e16Smrg	    # Green Hills C++ Compiler
669552b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
669652b01e16Smrg	    ;;
669752b01e16Smrg	  *)
669852b01e16Smrg	    ;;
669952b01e16Smrg	esac
670052b01e16Smrg	;;
670152b01e16Smrg      freebsd* | dragonfly*)
670252b01e16Smrg	# FreeBSD uses GNU C++
670352b01e16Smrg	;;
670452b01e16Smrg      hpux9* | hpux10* | hpux11*)
670552b01e16Smrg	case $cc_basename in
670652b01e16Smrg	  CC*)
670752b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
670852b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
670952b01e16Smrg	    if test "$host_cpu" != ia64; then
671052b01e16Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
671152b01e16Smrg	    fi
671252b01e16Smrg	    ;;
671352b01e16Smrg	  aCC*)
671452b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
671552b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
671652b01e16Smrg	    case $host_cpu in
671752b01e16Smrg	    hppa*64*|ia64*)
671852b01e16Smrg	      # +Z the default
671952b01e16Smrg	      ;;
672052b01e16Smrg	    *)
672152b01e16Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
672252b01e16Smrg	      ;;
672352b01e16Smrg	    esac
672452b01e16Smrg	    ;;
672552b01e16Smrg	  *)
672652b01e16Smrg	    ;;
672752b01e16Smrg	esac
672852b01e16Smrg	;;
672952b01e16Smrg      interix*)
673052b01e16Smrg	# This is c89, which is MS Visual C++ (no shared libs)
673152b01e16Smrg	# Anyone wants to do a port?
673252b01e16Smrg	;;
673352b01e16Smrg      irix5* | irix6* | nonstopux*)
673452b01e16Smrg	case $cc_basename in
673552b01e16Smrg	  CC*)
673652b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
673752b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
673852b01e16Smrg	    # CC pic flag -KPIC is the default.
673952b01e16Smrg	    ;;
674052b01e16Smrg	  *)
674152b01e16Smrg	    ;;
674252b01e16Smrg	esac
674352b01e16Smrg	;;
674452b01e16Smrg      linux* | k*bsd*-gnu)
674552b01e16Smrg	case $cc_basename in
674652b01e16Smrg	  KCC*)
674752b01e16Smrg	    # KAI C++ Compiler
674852b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
674952b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
675052b01e16Smrg	    ;;
675152b01e16Smrg	  icpc* | ecpc*)
675252b01e16Smrg	    # Intel C++
675352b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
675452b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
675552b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
675652b01e16Smrg	    ;;
675752b01e16Smrg	  pgCC* | pgcpp*)
675852b01e16Smrg	    # Portland Group C++ compiler.
675952b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
676052b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
676152b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
676252b01e16Smrg	    ;;
676352b01e16Smrg	  cxx*)
676452b01e16Smrg	    # Compaq C++
676552b01e16Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
676652b01e16Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
676752b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
676852b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
676952b01e16Smrg	    ;;
677052b01e16Smrg	  *)
677152b01e16Smrg	    case `$CC -V 2>&1 | sed 5q` in
677252b01e16Smrg	    *Sun\ C*)
677352b01e16Smrg	      # Sun C++ 5.9
677452b01e16Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
677552b01e16Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
677652b01e16Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
677752b01e16Smrg	      ;;
677852b01e16Smrg	    esac
677952b01e16Smrg	    ;;
678052b01e16Smrg	esac
678152b01e16Smrg	;;
678252b01e16Smrg      lynxos*)
678352b01e16Smrg	;;
678452b01e16Smrg      m88k*)
678552b01e16Smrg	;;
678652b01e16Smrg      mvs*)
678752b01e16Smrg	case $cc_basename in
678852b01e16Smrg	  cxx*)
678952b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
679052b01e16Smrg	    ;;
679152b01e16Smrg	  *)
679252b01e16Smrg	    ;;
679352b01e16Smrg	esac
679452b01e16Smrg	;;
679552b01e16Smrg      netbsd*)
679652b01e16Smrg	;;
679752b01e16Smrg      osf3* | osf4* | osf5*)
679852b01e16Smrg	case $cc_basename in
679952b01e16Smrg	  KCC*)
680052b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
680152b01e16Smrg	    ;;
680252b01e16Smrg	  RCC*)
680352b01e16Smrg	    # Rational C++ 2.4.1
680452b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
680552b01e16Smrg	    ;;
680652b01e16Smrg	  cxx*)
680752b01e16Smrg	    # Digital/Compaq C++
680852b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
680952b01e16Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
681052b01e16Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
681152b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
681252b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
681352b01e16Smrg	    ;;
681452b01e16Smrg	  *)
681552b01e16Smrg	    ;;
681652b01e16Smrg	esac
681752b01e16Smrg	;;
681852b01e16Smrg      psos*)
681952b01e16Smrg	;;
682052b01e16Smrg      solaris*)
682152b01e16Smrg	case $cc_basename in
682252b01e16Smrg	  CC*)
682352b01e16Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
682452b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
682552b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
682652b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
682752b01e16Smrg	    ;;
682852b01e16Smrg	  gcx*)
682952b01e16Smrg	    # Green Hills C++ Compiler
683052b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
683152b01e16Smrg	    ;;
683252b01e16Smrg	  *)
683352b01e16Smrg	    ;;
683452b01e16Smrg	esac
683552b01e16Smrg	;;
683652b01e16Smrg      sunos4*)
683752b01e16Smrg	case $cc_basename in
683852b01e16Smrg	  CC*)
683952b01e16Smrg	    # Sun C++ 4.x
684052b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
684152b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
684252b01e16Smrg	    ;;
684352b01e16Smrg	  lcc*)
684452b01e16Smrg	    # Lucid
684552b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
684652b01e16Smrg	    ;;
684752b01e16Smrg	  *)
684852b01e16Smrg	    ;;
684952b01e16Smrg	esac
685052b01e16Smrg	;;
685152b01e16Smrg      tandem*)
685252b01e16Smrg	case $cc_basename in
685352b01e16Smrg	  NCC*)
685452b01e16Smrg	    # NonStop-UX NCC 3.20
685552b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
685652b01e16Smrg	    ;;
685752b01e16Smrg	  *)
685852b01e16Smrg	    ;;
685952b01e16Smrg	esac
686052b01e16Smrg	;;
686152b01e16Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
686252b01e16Smrg	case $cc_basename in
686352b01e16Smrg	  CC*)
686452b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
686552b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
686652b01e16Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
686752b01e16Smrg	    ;;
686852b01e16Smrg	esac
686952b01e16Smrg	;;
687052b01e16Smrg      vxworks*)
687152b01e16Smrg	;;
687252b01e16Smrg      *)
687352b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
687452b01e16Smrg	;;
687552b01e16Smrg    esac
687652b01e16Smrg  fi
687752b01e16Smrg],
687852b01e16Smrg[
687952b01e16Smrg  if test "$GCC" = yes; then
688052b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
688152b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
68824b0ead49Smrg
688352b01e16Smrg    case $host_os in
688452b01e16Smrg      aix*)
688552b01e16Smrg      # All AIX code is PIC.
688652b01e16Smrg      if test "$host_cpu" = ia64; then
688752b01e16Smrg	# AIX 5 now supports IA64 processor
688852b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
688952b01e16Smrg      fi
689052b01e16Smrg      ;;
68914b0ead49Smrg
689252b01e16Smrg    amigaos*)
689352b01e16Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
689452b01e16Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
689552b01e16Smrg      # like `-m68040'.
689652b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
689752b01e16Smrg      ;;
68984b0ead49Smrg
689952b01e16Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
690052b01e16Smrg      # PIC is the default for these OSes.
690152b01e16Smrg      ;;
690252b01e16Smrg
690352b01e16Smrg    mingw* | cygwin* | pw32* | os2*)
690452b01e16Smrg      # This hack is so that the source file can tell whether it is being
690552b01e16Smrg      # built for inclusion in a dll (and should export symbols for example).
690652b01e16Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
690752b01e16Smrg      # (--disable-auto-import) libraries
690852b01e16Smrg      m4_if([$1], [GCJ], [],
690952b01e16Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
691052b01e16Smrg      ;;
69114b0ead49Smrg
691252b01e16Smrg    darwin* | rhapsody*)
691352b01e16Smrg      # PIC is the default on this platform
691452b01e16Smrg      # Common symbols not allowed in MH_DYLIB files
691552b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
691652b01e16Smrg      ;;
69174b0ead49Smrg
691852b01e16Smrg    interix[[3-9]]*)
691952b01e16Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
692052b01e16Smrg      # Instead, we relocate shared libraries at runtime.
692152b01e16Smrg      ;;
69224b0ead49Smrg
692352b01e16Smrg    msdosdjgpp*)
692452b01e16Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
692552b01e16Smrg      # on systems that don't support them.
692652b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
692752b01e16Smrg      enable_shared=no
692852b01e16Smrg      ;;
69294b0ead49Smrg
693052b01e16Smrg    sysv4*MP*)
693152b01e16Smrg      if test -d /usr/nec; then
693252b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
693352b01e16Smrg      fi
693452b01e16Smrg      ;;
69354b0ead49Smrg
693652b01e16Smrg    hpux*)
693752b01e16Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
693852b01e16Smrg      # not for PA HP-UX.
693952b01e16Smrg      case $host_cpu in
694052b01e16Smrg      hppa*64*|ia64*)
694152b01e16Smrg	# +Z the default
694252b01e16Smrg	;;
694352b01e16Smrg      *)
694452b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
694552b01e16Smrg	;;
694652b01e16Smrg      esac
694752b01e16Smrg      ;;
69484b0ead49Smrg
694952b01e16Smrg    *)
695052b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
695152b01e16Smrg      ;;
695252b01e16Smrg    esac
695352b01e16Smrg  else
695452b01e16Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
695552b01e16Smrg    case $host_os in
695652b01e16Smrg    aix*)
695752b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
695852b01e16Smrg      if test "$host_cpu" = ia64; then
695952b01e16Smrg	# AIX 5 now supports IA64 processor
696052b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
696152b01e16Smrg      else
696252b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
696352b01e16Smrg      fi
696452b01e16Smrg      ;;
696552b01e16Smrg      darwin*)
696652b01e16Smrg        # PIC is the default on this platform
696752b01e16Smrg        # Common symbols not allowed in MH_DYLIB files
696852b01e16Smrg       case $cc_basename in
696952b01e16Smrg         xlc*)
697052b01e16Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
697152b01e16Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
697252b01e16Smrg         ;;
697352b01e16Smrg       esac
697452b01e16Smrg       ;;
69754b0ead49Smrg
697652b01e16Smrg    mingw* | cygwin* | pw32* | os2*)
697752b01e16Smrg      # This hack is so that the source file can tell whether it is being
697852b01e16Smrg      # built for inclusion in a dll (and should export symbols for example).
697952b01e16Smrg      m4_if([$1], [GCJ], [],
698052b01e16Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
698152b01e16Smrg      ;;
69824b0ead49Smrg
698352b01e16Smrg    hpux9* | hpux10* | hpux11*)
698452b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
698552b01e16Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
698652b01e16Smrg      # not for PA HP-UX.
698752b01e16Smrg      case $host_cpu in
698852b01e16Smrg      hppa*64*|ia64*)
698952b01e16Smrg	# +Z the default
699052b01e16Smrg	;;
699152b01e16Smrg      *)
699252b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
699352b01e16Smrg	;;
699452b01e16Smrg      esac
699552b01e16Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
699652b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
699752b01e16Smrg      ;;
69984b0ead49Smrg
699952b01e16Smrg    irix5* | irix6* | nonstopux*)
700052b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
700152b01e16Smrg      # PIC (with -KPIC) is the default.
700252b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
700352b01e16Smrg      ;;
70044b0ead49Smrg
700552b01e16Smrg    newsos6)
700652b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
700752b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
700852b01e16Smrg      ;;
70094b0ead49Smrg
701052b01e16Smrg    linux* | k*bsd*-gnu)
701152b01e16Smrg      case $cc_basename in
701252b01e16Smrg      icc* | ecc*)
701352b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
701452b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
701552b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
701652b01e16Smrg        ;;
701752b01e16Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
701852b01e16Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
701952b01e16Smrg	# which looks to be a dead project)
702052b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
702152b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
702252b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
702352b01e16Smrg        ;;
702452b01e16Smrg      ccc*)
702552b01e16Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
702652b01e16Smrg        # All Alpha code is PIC.
702752b01e16Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
702852b01e16Smrg        ;;
702952b01e16Smrg      *)
703052b01e16Smrg        case `$CC -V 2>&1 | sed 5q` in
703152b01e16Smrg	*Sun\ C*)
703252b01e16Smrg	  # Sun C 5.9
703352b01e16Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
703452b01e16Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
703552b01e16Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
703652b01e16Smrg	  ;;
703752b01e16Smrg	*Sun\ F*)
703852b01e16Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
703952b01e16Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
704052b01e16Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
704152b01e16Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
704252b01e16Smrg	  ;;
704352b01e16Smrg	esac
704452b01e16Smrg	;;
704552b01e16Smrg      esac
704652b01e16Smrg      ;;
70474b0ead49Smrg
704852b01e16Smrg    osf3* | osf4* | osf5*)
704952b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
705052b01e16Smrg      # All OSF/1 code is PIC.
705152b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
70524b0ead49Smrg      ;;
70534b0ead49Smrg
705452b01e16Smrg    rdos*)
705552b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
705652b01e16Smrg      ;;
70574b0ead49Smrg
705852b01e16Smrg    solaris*)
705952b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
706052b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
706152b01e16Smrg      case $cc_basename in
706252b01e16Smrg      f77* | f90* | f95*)
706352b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
706452b01e16Smrg      *)
706552b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
706652b01e16Smrg      esac
706752b01e16Smrg      ;;
70684b0ead49Smrg
706952b01e16Smrg    sunos4*)
707052b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
707152b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
707252b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
707352b01e16Smrg      ;;
70744b0ead49Smrg
707552b01e16Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
707652b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
707752b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
707852b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
707952b01e16Smrg      ;;
70804b0ead49Smrg
708152b01e16Smrg    sysv4*MP*)
708252b01e16Smrg      if test -d /usr/nec ;then
708352b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
708452b01e16Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
708552b01e16Smrg      fi
708652b01e16Smrg      ;;
70874b0ead49Smrg
708852b01e16Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
708952b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
709052b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
709152b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
709252b01e16Smrg      ;;
70934b0ead49Smrg
709452b01e16Smrg    unicos*)
709552b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
709652b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
709752b01e16Smrg      ;;
70984b0ead49Smrg
709952b01e16Smrg    uts4*)
710052b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
710152b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
710252b01e16Smrg      ;;
71034b0ead49Smrg
710452b01e16Smrg    *)
710552b01e16Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
710652b01e16Smrg      ;;
710752b01e16Smrg    esac
71084b0ead49Smrg  fi
71094b0ead49Smrg])
711052b01e16SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
71114b0ead49Smrg
71124b0ead49Smrg#
711352b01e16Smrg# Check to make sure the PIC flag actually works.
711452b01e16Smrg#
711552b01e16Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
711652b01e16Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
711752b01e16Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
711852b01e16Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
711952b01e16Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
712052b01e16Smrg     "" | " "*) ;;
712152b01e16Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
712252b01e16Smrg     esac],
712352b01e16Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
712452b01e16Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
712552b01e16Smrgfi
712652b01e16Smrgcase $host_os in
712752b01e16Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
712852b01e16Smrg  *djgpp*)
712952b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
713052b01e16Smrg    ;;
713152b01e16Smrg  *)
713252b01e16Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
713352b01e16Smrg    ;;
713452b01e16Smrgesac
71354b0ead49Smrg
71364b0ead49Smrg#
713752b01e16Smrg# Check to make sure the static flag actually works.
713852b01e16Smrg#
713952b01e16Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
714052b01e16SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
714152b01e16Smrg  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
714252b01e16Smrg  $lt_tmp_static_flag,
714352b01e16Smrg  [],
714452b01e16Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
714552b01e16Smrg])
71464b0ead49Smrg
71474b0ead49Smrg
714852b01e16Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
714952b01e16Smrg# ------------------------------------
715052b01e16Smrg# See if the linker supports building shared libraries.
715152b01e16SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
715252b01e16Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
715352b01e16SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
715452b01e16Smrgifelse([$1],[CXX],[
715552b01e16Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
715652b01e16Smrg  case $host_os in
715752b01e16Smrg  aix[[4-9]]*)
715852b01e16Smrg    # If we're using GNU nm, then we don't want the "-C" option.
715952b01e16Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
716052b01e16Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
716152b01e16Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
716252b01e16Smrg    else
716352b01e16Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
716452b01e16Smrg    fi
716552b01e16Smrg    ;;
716652b01e16Smrg  pw32*)
716752b01e16Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
716852b01e16Smrg  ;;
716952b01e16Smrg  cygwin* | mingw*)
717052b01e16Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
717152b01e16Smrg  ;;
717252b01e16Smrg  *)
717352b01e16Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
717452b01e16Smrg  ;;
717552b01e16Smrg  esac
717652b01e16Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
717752b01e16Smrg],[
717852b01e16Smrg  runpath_var=
717952b01e16Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
718052b01e16Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
718152b01e16Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
718252b01e16Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
718352b01e16Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
718452b01e16Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
718552b01e16Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
718652b01e16Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
718752b01e16Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
718852b01e16Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
718952b01e16Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
719052b01e16Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
719152b01e16Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
719252b01e16Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
719352b01e16Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
719452b01e16Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
719552b01e16Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
719652b01e16Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
719752b01e16Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
719852b01e16Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
719952b01e16Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
720052b01e16Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
720152b01e16Smrg  # included in the symbol list
720252b01e16Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
720352b01e16Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
720452b01e16Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
720552b01e16Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
720652b01e16Smrg  # as well as any symbol that contains `d'.
720752b01e16Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
720852b01e16Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
720952b01e16Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
721052b01e16Smrg  # the symbol is explicitly referenced.  Since portable code cannot
721152b01e16Smrg  # rely on this symbol name, it's probably fine to never include it in
721252b01e16Smrg  # preloaded symbol tables.
721352b01e16Smrg  # Exclude shared library initialization/finalization symbols.
721452b01e16Smrgdnl Note also adjust exclude_expsyms for C++ above.
721552b01e16Smrg  extract_expsyms_cmds=
721652b01e16Smrg  # Just being paranoid about ensuring that cc_basename is set.
721752b01e16Smrg  _LT_CC_BASENAME([$compiler])
721852b01e16Smrg  case $host_os in
721952b01e16Smrg  cygwin* | mingw* | pw32*)
722052b01e16Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
722152b01e16Smrg    # When not using gcc, we currently assume that we are using
722252b01e16Smrg    # Microsoft Visual C++.
722352b01e16Smrg    if test "$GCC" != yes; then
722452b01e16Smrg      with_gnu_ld=no
722552b01e16Smrg    fi
722652b01e16Smrg    ;;
722752b01e16Smrg  interix*)
722852b01e16Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
722952b01e16Smrg    with_gnu_ld=yes
723052b01e16Smrg    ;;
723152b01e16Smrg  openbsd*)
723252b01e16Smrg    with_gnu_ld=no
723352b01e16Smrg    ;;
723452b01e16Smrg  esac
723552b01e16Smrg
723652b01e16Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
723752b01e16Smrg  if test "$with_gnu_ld" = yes; then
723852b01e16Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
723952b01e16Smrg    wlarc='${wl}'
72404b0ead49Smrg
724152b01e16Smrg    # Set some defaults for GNU ld with shared library support. These
724252b01e16Smrg    # are reset later if shared libraries are not supported. Putting them
724352b01e16Smrg    # here allows them to be overridden if necessary.
724452b01e16Smrg    runpath_var=LD_RUN_PATH
724552b01e16Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
724652b01e16Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
724752b01e16Smrg    # ancient GNU ld didn't support --whole-archive et. al.
724852b01e16Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
724952b01e16Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
725052b01e16Smrg      else
725152b01e16Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
725252b01e16Smrg    fi
725352b01e16Smrg    supports_anon_versioning=no
725452b01e16Smrg    case `$LD -v 2>/dev/null` in
725552b01e16Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
725652b01e16Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
725752b01e16Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
725852b01e16Smrg      *\ 2.11.*) ;; # other 2.11 versions
725952b01e16Smrg      *) supports_anon_versioning=yes ;;
726052b01e16Smrg    esac
72614b0ead49Smrg
726252b01e16Smrg    # See if GNU ld supports shared libraries.
726352b01e16Smrg    case $host_os in
726452b01e16Smrg    aix[[3-9]]*)
726552b01e16Smrg      # On AIX/PPC, the GNU linker is very broken
726652b01e16Smrg      if test "$host_cpu" != ia64; then
726752b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
726852b01e16Smrg	cat <<EOF 1>&2
72694b0ead49Smrg
727052b01e16Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
727152b01e16Smrg*** to be unable to reliably create shared libraries on AIX.
727252b01e16Smrg*** Therefore, libtool is disabling shared libraries support.  If you
727352b01e16Smrg*** really care for shared libraries, you may want to modify your PATH
727452b01e16Smrg*** so that a non-GNU linker is found, and then restart.
72754b0ead49Smrg
727652b01e16SmrgEOF
727752b01e16Smrg      fi
727852b01e16Smrg      ;;
72794b0ead49Smrg
728052b01e16Smrg    amigaos*)
728152b01e16Smrg      _LT_AC_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)'
728252b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
728352b01e16Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
72844b0ead49Smrg
728552b01e16Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
728652b01e16Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
728752b01e16Smrg      # to version 4, is to share data among multiple programs linked
728852b01e16Smrg      # with the same dynamic library.  Since this doesn't match the
728952b01e16Smrg      # behavior of shared libraries on other platforms, we can't use
729052b01e16Smrg      # them.
729152b01e16Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
729252b01e16Smrg      ;;
72934b0ead49Smrg
729452b01e16Smrg    beos*)
729552b01e16Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
729652b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
729752b01e16Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
729852b01e16Smrg	# support --undefined.  This deserves some investigation.  FIXME
729952b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
730052b01e16Smrg      else
730152b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
730252b01e16Smrg      fi
730352b01e16Smrg      ;;
73044b0ead49Smrg
730552b01e16Smrg    cygwin* | mingw* | pw32*)
730652b01e16Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
730752b01e16Smrg      # as there is no search path for DLLs.
730852b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
730952b01e16Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
731052b01e16Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
731152b01e16Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
731252b01e16Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
73134b0ead49Smrg
731452b01e16Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
731552b01e16Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
731652b01e16Smrg	# If the export-symbols file already is a .def file (1st line
731752b01e16Smrg	# is EXPORTS), use it as is; otherwise, prepend...
731852b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
731952b01e16Smrg	  cp $export_symbols $output_objdir/$soname.def;
732052b01e16Smrg	else
732152b01e16Smrg	  echo EXPORTS > $output_objdir/$soname.def;
732252b01e16Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
732352b01e16Smrg	fi~
732452b01e16Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
732552b01e16Smrg      else
732652b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
732752b01e16Smrg      fi
732852b01e16Smrg      ;;
73294b0ead49Smrg
733052b01e16Smrg    interix[[3-9]]*)
733152b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
733252b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
733352b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
733452b01e16Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
733552b01e16Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
733652b01e16Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
733752b01e16Smrg      # default) and relocated if they conflict, which is a slow very memory
733852b01e16Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
733952b01e16Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
734052b01e16Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
734152b01e16Smrg      _LT_AC_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'
734252b01e16Smrg      _LT_AC_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'
734352b01e16Smrg      ;;
73444b0ead49Smrg
734552b01e16Smrg    gnu* | linux* | k*bsd*-gnu)
734652b01e16Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
734752b01e16Smrg	tmp_addflag=
734852b01e16Smrg	case $cc_basename,$host_cpu in
734952b01e16Smrg	pgcc*)				# Portland Group C compiler
735052b01e16Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
735152b01e16Smrg	  tmp_addflag=' $pic_flag'
735252b01e16Smrg	  ;;
735352b01e16Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
735452b01e16Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
735552b01e16Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
735652b01e16Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
735752b01e16Smrg	  tmp_addflag=' -i_dynamic' ;;
735852b01e16Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
735952b01e16Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
736052b01e16Smrg	ifc* | ifort*)			# Intel Fortran compiler
736152b01e16Smrg	  tmp_addflag=' -nofor_main' ;;
736252b01e16Smrg	esac
736352b01e16Smrg	case `$CC -V 2>&1 | sed 5q` in
736452b01e16Smrg	*Sun\ C*)			# Sun C 5.9
736552b01e16Smrg	  _LT_AC_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; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
736652b01e16Smrg	  tmp_sharedflag='-G' ;;
736752b01e16Smrg	*Sun\ F*)			# Sun Fortran 8.3
736852b01e16Smrg	  tmp_sharedflag='-G' ;;
736952b01e16Smrg	*)
737052b01e16Smrg	  tmp_sharedflag='-shared' ;;
737152b01e16Smrg	esac
737252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
73734b0ead49Smrg
737452b01e16Smrg	if test $supports_anon_versioning = yes; then
737552b01e16Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
737652b01e16Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
737752b01e16Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
737852b01e16Smrg	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
737952b01e16Smrg	fi
738052b01e16Smrg      else
738152b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
738252b01e16Smrg      fi
738352b01e16Smrg      ;;
73844b0ead49Smrg
738552b01e16Smrg    netbsd*)
738652b01e16Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
738752b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
738852b01e16Smrg	wlarc=
738952b01e16Smrg      else
739052b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
739152b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
739252b01e16Smrg      fi
739352b01e16Smrg      ;;
73944b0ead49Smrg
739552b01e16Smrg    solaris*)
739652b01e16Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
739752b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
739852b01e16Smrg	cat <<EOF 1>&2
73994b0ead49Smrg
740052b01e16Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
740152b01e16Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
740252b01e16Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
740352b01e16Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
740452b01e16Smrg*** your PATH or compiler configuration so that the native linker is
740552b01e16Smrg*** used, and then restart.
74064b0ead49Smrg
740752b01e16SmrgEOF
740852b01e16Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
740952b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
741052b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
741152b01e16Smrg      else
741252b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
741352b01e16Smrg      fi
741452b01e16Smrg      ;;
74154b0ead49Smrg
741652b01e16Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
741752b01e16Smrg      case `$LD -v 2>&1` in
741852b01e16Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
741952b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
742052b01e16Smrg	cat <<_LT_EOF 1>&2
74214b0ead49Smrg
742252b01e16Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
742352b01e16Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
742452b01e16Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
742552b01e16Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
742652b01e16Smrg*** your PATH or compiler configuration so that the native linker is
742752b01e16Smrg*** used, and then restart.
74284b0ead49Smrg
742952b01e16Smrg_LT_EOF
743052b01e16Smrg	;;
743152b01e16Smrg	*)
743252b01e16Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
743352b01e16Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
743452b01e16Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
743552b01e16Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
743652b01e16Smrg	  else
743752b01e16Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
743852b01e16Smrg	  fi
743952b01e16Smrg	;;
744052b01e16Smrg      esac
744152b01e16Smrg      ;;
74424b0ead49Smrg
744352b01e16Smrg    sunos4*)
744452b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
744552b01e16Smrg      wlarc=
744652b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
744752b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
744852b01e16Smrg      ;;
74494b0ead49Smrg
745052b01e16Smrg    *)
745152b01e16Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
745252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
745352b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
745452b01e16Smrg      else
745552b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
745652b01e16Smrg      fi
745752b01e16Smrg      ;;
745852b01e16Smrg    esac
74594b0ead49Smrg
746052b01e16Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
746152b01e16Smrg      runpath_var=
746252b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
746352b01e16Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
746452b01e16Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
746552b01e16Smrg    fi
746652b01e16Smrg  else
746752b01e16Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
746852b01e16Smrg    case $host_os in
746952b01e16Smrg    aix3*)
747052b01e16Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
747152b01e16Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
747252b01e16Smrg      _LT_AC_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'
747352b01e16Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
747452b01e16Smrg      # are no directories specified by -L.
747552b01e16Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
747652b01e16Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
747752b01e16Smrg	# Neither direct hardcoding nor static linking is supported with a
747852b01e16Smrg	# broken collect2.
747952b01e16Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
748052b01e16Smrg      fi
748152b01e16Smrg      ;;
74824b0ead49Smrg
748352b01e16Smrg    aix[[4-9]]*)
748452b01e16Smrg      if test "$host_cpu" = ia64; then
748552b01e16Smrg	# On IA64, the linker does run time linking by default, so we don't
748652b01e16Smrg	# have to do anything special.
748752b01e16Smrg	aix_use_runtimelinking=no
748852b01e16Smrg	exp_sym_flag='-Bexport'
748952b01e16Smrg	no_entry_flag=""
749052b01e16Smrg      else
749152b01e16Smrg	# If we're using GNU nm, then we don't want the "-C" option.
749252b01e16Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
749352b01e16Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
749452b01e16Smrg	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
749552b01e16Smrg	else
749652b01e16Smrg	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
749752b01e16Smrg	fi
749852b01e16Smrg	aix_use_runtimelinking=no
74994b0ead49Smrg
750052b01e16Smrg	# Test if we are trying to use run time linking or normal
750152b01e16Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
750252b01e16Smrg	# need to do runtime linking.
750352b01e16Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
750452b01e16Smrg	  for ld_flag in $LDFLAGS; do
750552b01e16Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
750652b01e16Smrg  	    aix_use_runtimelinking=yes
750752b01e16Smrg  	    break
750852b01e16Smrg  	  fi
750952b01e16Smrg	  done
751052b01e16Smrg	  ;;
751152b01e16Smrg	esac
75124b0ead49Smrg
751352b01e16Smrg	exp_sym_flag='-bexport'
751452b01e16Smrg	no_entry_flag='-bnoentry'
751552b01e16Smrg      fi
75164b0ead49Smrg
751752b01e16Smrg      # When large executables or shared objects are built, AIX ld can
751852b01e16Smrg      # have problems creating the table of contents.  If linking a library
751952b01e16Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
752052b01e16Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
752152b01e16Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
75224b0ead49Smrg
752352b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
752452b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
752552b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
752652b01e16Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
75274b0ead49Smrg
752852b01e16Smrg      if test "$GCC" = yes; then
752952b01e16Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
753052b01e16Smrg	# We only want to do this on AIX 4.2 and lower, the check
753152b01e16Smrg	# below for broken collect2 doesn't work under 4.3+
753252b01e16Smrg	  collect2name=`${CC} -print-prog-name=collect2`
753352b01e16Smrg	  if test -f "$collect2name" && \
753452b01e16Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
753552b01e16Smrg	  then
753652b01e16Smrg  	  # We have reworked collect2
753752b01e16Smrg  	  :
753852b01e16Smrg	  else
753952b01e16Smrg  	  # We have old collect2
754052b01e16Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
754152b01e16Smrg  	  # It fails to find uninstalled libraries when the uninstalled
754252b01e16Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
754352b01e16Smrg  	  # to unsupported forces relinking
754452b01e16Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
754552b01e16Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
754652b01e16Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
754752b01e16Smrg	  fi
754852b01e16Smrg	  ;;
754952b01e16Smrg	esac
755052b01e16Smrg	shared_flag='-shared'
755152b01e16Smrg	if test "$aix_use_runtimelinking" = yes; then
755252b01e16Smrg	  shared_flag="$shared_flag "'${wl}-G'
755352b01e16Smrg	fi
755452b01e16Smrg      else
755552b01e16Smrg	# not using gcc
755652b01e16Smrg	if test "$host_cpu" = ia64; then
755752b01e16Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
755852b01e16Smrg  	# chokes on -Wl,-G. The following line is correct:
755952b01e16Smrg	  shared_flag='-G'
756052b01e16Smrg	else
756152b01e16Smrg	  if test "$aix_use_runtimelinking" = yes; then
756252b01e16Smrg	    shared_flag='${wl}-G'
756352b01e16Smrg	  else
756452b01e16Smrg	    shared_flag='${wl}-bM:SRE'
756552b01e16Smrg	  fi
756652b01e16Smrg	fi
756752b01e16Smrg      fi
75684b0ead49Smrg
756952b01e16Smrg      # It seems that -bexpall does not export symbols beginning with
757052b01e16Smrg      # underscore (_), so it is better to generate a list of symbols to export.
757152b01e16Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
757252b01e16Smrg      if test "$aix_use_runtimelinking" = yes; then
757352b01e16Smrg	# Warning - without using the other runtime loading flags (-brtl),
757452b01e16Smrg	# -berok will link without error, but may produce a broken library.
757552b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
757652b01e16Smrg       # Determine the default libpath from the value encoded in an empty executable.
757752b01e16Smrg       _LT_AC_SYS_LIBPATH_AIX
757852b01e16Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
757952b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
758052b01e16Smrg       else
758152b01e16Smrg	if test "$host_cpu" = ia64; then
758252b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
758352b01e16Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
758452b01e16Smrg	  _LT_AC_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"
758552b01e16Smrg	else
758652b01e16Smrg	 # Determine the default libpath from the value encoded in an empty executable.
758752b01e16Smrg	 _LT_AC_SYS_LIBPATH_AIX
758852b01e16Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
758952b01e16Smrg	  # Warning - without using the other run time loading flags,
759052b01e16Smrg	  # -berok will link without error, but may produce a broken library.
759152b01e16Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
759252b01e16Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
759352b01e16Smrg	  # Exported symbols can be pulled into shared objects from archives
759452b01e16Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
759552b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
759652b01e16Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
759752b01e16Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
759852b01e16Smrg	fi
759952b01e16Smrg      fi
760052b01e16Smrg      ;;
76014b0ead49Smrg
760252b01e16Smrg    amigaos*)
760352b01e16Smrg      _LT_AC_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)'
760452b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
760552b01e16Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
760652b01e16Smrg      # see comment about different semantics on the GNU ld section
760752b01e16Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
760852b01e16Smrg      ;;
76094b0ead49Smrg
761052b01e16Smrg    bsdi[[45]]*)
761152b01e16Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
761252b01e16Smrg      ;;
76134b0ead49Smrg
761452b01e16Smrg    cygwin* | mingw* | pw32*)
761552b01e16Smrg      # When not using gcc, we currently assume that we are using
761652b01e16Smrg      # Microsoft Visual C++.
761752b01e16Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
761852b01e16Smrg      # no search path for DLLs.
761952b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
762052b01e16Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
762152b01e16Smrg      # Tell ltmain to make .lib files, not .a files.
762252b01e16Smrg      libext=lib
762352b01e16Smrg      # Tell ltmain to make .dll files, not .so files.
762452b01e16Smrg      shrext_cmds=".dll"
762552b01e16Smrg      # FIXME: Setting linknames here is a bad hack.
762652b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
762752b01e16Smrg      # The linker will automatically build a .lib file if we build a DLL.
762852b01e16Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
762952b01e16Smrg      # FIXME: Should let the user specify the lib program.
763052b01e16Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
763152b01e16Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
763252b01e16Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
763352b01e16Smrg      ;;
76344b0ead49Smrg
763552b01e16Smrg    darwin* | rhapsody*)
763652b01e16Smrg      case $host_os in
763752b01e16Smrg        rhapsody* | darwin1.[[012]])
763852b01e16Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
763952b01e16Smrg         ;;
764052b01e16Smrg       *) # Darwin 1.3 on
764152b01e16Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
764252b01e16Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
764352b01e16Smrg         else
764452b01e16Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
764552b01e16Smrg             10.[[012]])
764652b01e16Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
764752b01e16Smrg               ;;
764852b01e16Smrg             10.*)
764952b01e16Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
765052b01e16Smrg               ;;
765152b01e16Smrg           esac
765252b01e16Smrg         fi
765352b01e16Smrg         ;;
765452b01e16Smrg      esac
765552b01e16Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
765652b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
765752b01e16Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
765852b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
765952b01e16Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
766052b01e16Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
766152b01e16Smrg    if test "$GCC" = yes ; then
766252b01e16Smrg    	output_verbose_link_cmd='echo'
766352b01e16Smrg        _LT_AC_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}"
766452b01e16Smrg        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
766552b01e16Smrg        _LT_AC_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}"
766652b01e16Smrg        _LT_AC_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}"
766752b01e16Smrg    else
766852b01e16Smrg      case $cc_basename in
766952b01e16Smrg        xlc*)
767052b01e16Smrg         output_verbose_link_cmd='echo'
767152b01e16Smrg         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
767252b01e16Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
767352b01e16Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
767452b01e16Smrg         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
767552b01e16Smrg          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
767652b01e16Smrg          ;;
767752b01e16Smrg       *)
767852b01e16Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
767952b01e16Smrg          ;;
768052b01e16Smrg      esac
768152b01e16Smrg    fi
768252b01e16Smrg      ;;
76834b0ead49Smrg
768452b01e16Smrg    dgux*)
768552b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
768652b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
768752b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
768852b01e16Smrg      ;;
76894b0ead49Smrg
769052b01e16Smrg    freebsd1*)
769152b01e16Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
769252b01e16Smrg      ;;
76934b0ead49Smrg
769452b01e16Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
769552b01e16Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
769652b01e16Smrg    # does not break anything, and helps significantly (at the cost of a little
769752b01e16Smrg    # extra space).
769852b01e16Smrg    freebsd2.2*)
769952b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
770052b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
770152b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
770252b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
770352b01e16Smrg      ;;
77044b0ead49Smrg
770552b01e16Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
770652b01e16Smrg    freebsd2*)
770752b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
770852b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
770952b01e16Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
771052b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
771152b01e16Smrg      ;;
77124b0ead49Smrg
771352b01e16Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
771452b01e16Smrg    freebsd* | dragonfly*)
771552b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
771652b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
771752b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
771852b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
771952b01e16Smrg      ;;
77204b0ead49Smrg
772152b01e16Smrg    hpux9*)
772252b01e16Smrg      if test "$GCC" = yes; then
772352b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
772452b01e16Smrg      else
772552b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
772652b01e16Smrg      fi
772752b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
772852b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
772952b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
77304b0ead49Smrg
773152b01e16Smrg      # hardcode_minus_L: Not really in the search PATH,
773252b01e16Smrg      # but as the default location of the library.
773352b01e16Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
773452b01e16Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
773552b01e16Smrg      ;;
77364b0ead49Smrg
773752b01e16Smrg    hpux10*)
773852b01e16Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
773952b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
774052b01e16Smrg      else
774152b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
774252b01e16Smrg      fi
774352b01e16Smrg      if test "$with_gnu_ld" = no; then
774452b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
774552b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
77464b0ead49Smrg
774752b01e16Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
774852b01e16Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
77494b0ead49Smrg
775052b01e16Smrg	# hardcode_minus_L: Not really in the search PATH,
775152b01e16Smrg	# but as the default location of the library.
775252b01e16Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
775352b01e16Smrg      fi
775452b01e16Smrg      ;;
77554b0ead49Smrg
775652b01e16Smrg    hpux11*)
775752b01e16Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
775852b01e16Smrg	case $host_cpu in
775952b01e16Smrg	hppa*64*)
776052b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
776152b01e16Smrg	  ;;
776252b01e16Smrg	ia64*)
776352b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
776452b01e16Smrg	  ;;
776552b01e16Smrg	*)
776652b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
776752b01e16Smrg	  ;;
776852b01e16Smrg	esac
776952b01e16Smrg      else
777052b01e16Smrg	case $host_cpu in
777152b01e16Smrg	hppa*64*)
777252b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
777352b01e16Smrg	  ;;
777452b01e16Smrg	ia64*)
777552b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
777652b01e16Smrg	  ;;
777752b01e16Smrg	*)
777852b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
777952b01e16Smrg	  ;;
778052b01e16Smrg	esac
778152b01e16Smrg      fi
778252b01e16Smrg      if test "$with_gnu_ld" = no; then
778352b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
778452b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
77854b0ead49Smrg
778652b01e16Smrg	case $host_cpu in
778752b01e16Smrg	hppa*64*|ia64*)
778852b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
778952b01e16Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
779052b01e16Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
779152b01e16Smrg	  ;;
779252b01e16Smrg	*)
779352b01e16Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
779452b01e16Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
77954b0ead49Smrg
779652b01e16Smrg	  # hardcode_minus_L: Not really in the search PATH,
779752b01e16Smrg	  # but as the default location of the library.
779852b01e16Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
779952b01e16Smrg	  ;;
780052b01e16Smrg	esac
780152b01e16Smrg      fi
780252b01e16Smrg      ;;
78034b0ead49Smrg
780452b01e16Smrg    irix5* | irix6* | nonstopux*)
780552b01e16Smrg      if test "$GCC" = yes; then
780652b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
780752b01e16Smrg      else
780852b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
780952b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
781052b01e16Smrg      fi
781152b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
781252b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
781352b01e16Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
781452b01e16Smrg      ;;
78154b0ead49Smrg
781652b01e16Smrg    netbsd*)
781752b01e16Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
781852b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
781952b01e16Smrg      else
782052b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
782152b01e16Smrg      fi
782252b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
782352b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
782452b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
782552b01e16Smrg      ;;
78264b0ead49Smrg
782752b01e16Smrg    newsos6)
782852b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
782952b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
783052b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
783152b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
783252b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
783352b01e16Smrg      ;;
78344b0ead49Smrg
783552b01e16Smrg    openbsd*)
783652b01e16Smrg      if test -f /usr/libexec/ld.so; then
783752b01e16Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
783852b01e16Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
783952b01e16Smrg	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
784052b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
784152b01e16Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
784252b01e16Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
784352b01e16Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
784452b01e16Smrg	else
784552b01e16Smrg	  case $host_os in
784652b01e16Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
784752b01e16Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
784852b01e16Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
784952b01e16Smrg	     ;;
785052b01e16Smrg	   *)
785152b01e16Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
785252b01e16Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
785352b01e16Smrg	     ;;
785452b01e16Smrg	  esac
785552b01e16Smrg        fi
785652b01e16Smrg      else
785752b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
785852b01e16Smrg      fi
785952b01e16Smrg      ;;
78604b0ead49Smrg
786152b01e16Smrg    os2*)
786252b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
786352b01e16Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
786452b01e16Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
786552b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
786652b01e16Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
786752b01e16Smrg      ;;
78684b0ead49Smrg
786952b01e16Smrg    osf3*)
787052b01e16Smrg      if test "$GCC" = yes; then
787152b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
787252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
787352b01e16Smrg      else
787452b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
787552b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
787652b01e16Smrg      fi
787752b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
787852b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
787952b01e16Smrg      ;;
78804b0ead49Smrg
788152b01e16Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
788252b01e16Smrg      if test "$GCC" = yes; then
788352b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
788452b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
788552b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
788652b01e16Smrg      else
788752b01e16Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
788852b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
788952b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
789052b01e16Smrg	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
78914b0ead49Smrg
789252b01e16Smrg	# Both c and cxx compiler support -rpath directly
789352b01e16Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
789452b01e16Smrg      fi
789552b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
789652b01e16Smrg      ;;
789752b01e16Smrg
789852b01e16Smrg    solaris*)
789952b01e16Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
790052b01e16Smrg      if test "$GCC" = yes; then
790152b01e16Smrg	wlarc='${wl}'
790252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
790352b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
790452b01e16Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
790552b01e16Smrg      else
790652b01e16Smrg	wlarc=''
790752b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
790852b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
790952b01e16Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
791052b01e16Smrg      fi
791152b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
791252b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
791352b01e16Smrg      case $host_os in
791452b01e16Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
791552b01e16Smrg      *)
791652b01e16Smrg	# The compiler driver will combine and reorder linker options,
791752b01e16Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
791852b01e16Smrg	# but is careful enough not to reorder.
791952b01e16Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
792052b01e16Smrg	if test "$GCC" = yes; then
792152b01e16Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
792252b01e16Smrg	else
792352b01e16Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
79244b0ead49Smrg	fi
792552b01e16Smrg	;;
792652b01e16Smrg      esac
792752b01e16Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
792852b01e16Smrg      ;;
79294b0ead49Smrg
793052b01e16Smrg    sunos4*)
793152b01e16Smrg      if test "x$host_vendor" = xsequent; then
793252b01e16Smrg	# Use $CC to link under sequent, because it throws in some extra .o
793352b01e16Smrg	# files that make .init and .fini sections work.
793452b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
793552b01e16Smrg      else
793652b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
793752b01e16Smrg      fi
793852b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
793952b01e16Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
794052b01e16Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
794152b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
794252b01e16Smrg      ;;
79434b0ead49Smrg
794452b01e16Smrg    sysv4)
794552b01e16Smrg      case $host_vendor in
794652b01e16Smrg	sni)
794752b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
794852b01e16Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
794952b01e16Smrg	;;
795052b01e16Smrg	siemens)
795152b01e16Smrg	  ## LD is ld it makes a PLAMLIB
795252b01e16Smrg	  ## CC just makes a GrossModule.
795352b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
795452b01e16Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
795552b01e16Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
795652b01e16Smrg        ;;
795752b01e16Smrg	motorola)
795852b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
795952b01e16Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
796052b01e16Smrg	;;
796152b01e16Smrg      esac
796252b01e16Smrg      runpath_var='LD_RUN_PATH'
796352b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
796452b01e16Smrg      ;;
79654b0ead49Smrg
796652b01e16Smrg    sysv4.3*)
796752b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
796852b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
796952b01e16Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
797052b01e16Smrg      ;;
79714b0ead49Smrg
797252b01e16Smrg    sysv4*MP*)
797352b01e16Smrg      if test -d /usr/nec; then
797452b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
797552b01e16Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
797652b01e16Smrg	runpath_var=LD_RUN_PATH
797752b01e16Smrg	hardcode_runpath_var=yes
797852b01e16Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
797952b01e16Smrg      fi
798052b01e16Smrg      ;;
79814b0ead49Smrg
798252b01e16Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
798352b01e16Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
798452b01e16Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
798552b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
798652b01e16Smrg      runpath_var='LD_RUN_PATH'
79874b0ead49Smrg
798852b01e16Smrg      if test "$GCC" = yes; then
798952b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
799052b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
799152b01e16Smrg      else
799252b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
799352b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
799452b01e16Smrg      fi
799552b01e16Smrg      ;;
79964b0ead49Smrg
799752b01e16Smrg    sysv5* | sco3.2v5* | sco5v6*)
799852b01e16Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
799952b01e16Smrg      # link with -lc, and that would cause any symbols used from libc to
800052b01e16Smrg      # always be unresolved, which means just about no library would
800152b01e16Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
800252b01e16Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
800352b01e16Smrg      # as -z defs.
800452b01e16Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
800552b01e16Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
800652b01e16Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
800752b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
800852b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
800952b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
801052b01e16Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
801152b01e16Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
801252b01e16Smrg      runpath_var='LD_RUN_PATH'
80134b0ead49Smrg
801452b01e16Smrg      if test "$GCC" = yes; then
801552b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
801652b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
801752b01e16Smrg      else
801852b01e16Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
801952b01e16Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
802052b01e16Smrg      fi
802152b01e16Smrg      ;;
80224b0ead49Smrg
802352b01e16Smrg    uts4*)
802452b01e16Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
802552b01e16Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
802652b01e16Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
802752b01e16Smrg      ;;
80284b0ead49Smrg
802952b01e16Smrg    *)
803052b01e16Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
803152b01e16Smrg      ;;
80324b0ead49Smrg    esac
803352b01e16Smrg  fi
803452b01e16Smrg])
803552b01e16SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
803652b01e16Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
80374b0ead49Smrg
803852b01e16Smrg#
803952b01e16Smrg# Do we need to explicitly link libc?
804052b01e16Smrg#
804152b01e16Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
804252b01e16Smrgx|xyes)
804352b01e16Smrg  # Assume -lc should be added
804452b01e16Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
80454b0ead49Smrg
804652b01e16Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
804752b01e16Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
804852b01e16Smrg    *'~'*)
804952b01e16Smrg      # FIXME: we may have to deal with multi-command sequences.
805052b01e16Smrg      ;;
805152b01e16Smrg    '$CC '*)
805252b01e16Smrg      # Test whether the compiler implicitly links with -lc since on some
805352b01e16Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
805452b01e16Smrg      # to ld, don't add -lc before -lgcc.
805552b01e16Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
805652b01e16Smrg      $rm conftest*
805752b01e16Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
80584b0ead49Smrg
805952b01e16Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
806052b01e16Smrg        soname=conftest
806152b01e16Smrg        lib=conftest
806252b01e16Smrg        libobjs=conftest.$ac_objext
806352b01e16Smrg        deplibs=
806452b01e16Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
806552b01e16Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
806652b01e16Smrg        compiler_flags=-v
806752b01e16Smrg        linker_flags=-v
806852b01e16Smrg        verstring=
806952b01e16Smrg        output_objdir=.
807052b01e16Smrg        libname=conftest
807152b01e16Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
807252b01e16Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
807352b01e16Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
807452b01e16Smrg        then
807552b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
807652b01e16Smrg        else
807752b01e16Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
807852b01e16Smrg        fi
807952b01e16Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
808052b01e16Smrg      else
808152b01e16Smrg        cat conftest.err 1>&5
808252b01e16Smrg      fi
808352b01e16Smrg      $rm conftest*
808452b01e16Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
808552b01e16Smrg      ;;
808652b01e16Smrg    esac
808752b01e16Smrg  fi
808852b01e16Smrg  ;;
808952b01e16Smrgesac
809052b01e16Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
80914b0ead49Smrg
809252b01e16Smrg
809352b01e16Smrg# _LT_AC_FILE_LTDLL_C
80944b0ead49Smrg# -------------------
809552b01e16Smrg# Be careful that the start marker always follows a newline.
809652b01e16SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
809752b01e16Smrg# /* ltdll.c starts here */
809852b01e16Smrg# #define WIN32_LEAN_AND_MEAN
809952b01e16Smrg# #include <windows.h>
810052b01e16Smrg# #undef WIN32_LEAN_AND_MEAN
810152b01e16Smrg# #include <stdio.h>
81024b0ead49Smrg#
810352b01e16Smrg# #ifndef __CYGWIN__
810452b01e16Smrg# #  ifdef __CYGWIN32__
810552b01e16Smrg# #    define __CYGWIN__ __CYGWIN32__
810652b01e16Smrg# #  endif
810752b01e16Smrg# #endif
810852b01e16Smrg#
810952b01e16Smrg# #ifdef __cplusplus
811052b01e16Smrg# extern "C" {
811152b01e16Smrg# #endif
811252b01e16Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
811352b01e16Smrg# #ifdef __cplusplus
811452b01e16Smrg# }
811552b01e16Smrg# #endif
811652b01e16Smrg#
811752b01e16Smrg# #ifdef __CYGWIN__
811852b01e16Smrg# #include <cygwin/cygwin_dll.h>
811952b01e16Smrg# DECLARE_CYGWIN_DLL( DllMain );
812052b01e16Smrg# #endif
812152b01e16Smrg# HINSTANCE __hDllInstance_base;
812252b01e16Smrg#
812352b01e16Smrg# BOOL APIENTRY
812452b01e16Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
812552b01e16Smrg# {
812652b01e16Smrg#   __hDllInstance_base = hInst;
812752b01e16Smrg#   return TRUE;
812852b01e16Smrg# }
812952b01e16Smrg# /* ltdll.c ends here */
813052b01e16Smrg])# _LT_AC_FILE_LTDLL_C
81314b0ead49Smrg
81324b0ead49Smrg
813352b01e16Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
813452b01e16Smrg# ---------------------------------
813552b01e16SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
81364b0ead49Smrg
81374b0ead49Smrg
813852b01e16Smrg# old names
813952b01e16SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
814052b01e16SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
814152b01e16SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
814252b01e16SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
814352b01e16SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
814452b01e16SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
814552b01e16SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
81464b0ead49Smrg
814752b01e16Smrg# This is just to silence aclocal about the macro not being used
814852b01e16Smrgifelse([AC_DISABLE_FAST_INSTALL])
81494b0ead49Smrg
815052b01e16SmrgAC_DEFUN([LT_AC_PROG_GCJ],
815152b01e16Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
815252b01e16Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
815352b01e16Smrg  AC_SUBST(GCJFLAGS)
815452b01e16Smrg])
81554b0ead49Smrg
815652b01e16SmrgAC_DEFUN([LT_AC_PROG_RC],
815752b01e16Smrg[AC_CHECK_TOOL(RC, windres, no)
815852b01e16Smrg])
81594b0ead49Smrg
81604b0ead49Smrg
816152b01e16Smrg# Cheap backport of AS_EXECUTABLE_P and required macros
816252b01e16Smrg# from Autoconf 2.59; we should not use $as_executable_p directly.
81634b0ead49Smrg
816452b01e16Smrg# _AS_TEST_PREPARE
816552b01e16Smrg# ----------------
816652b01e16Smrgm4_ifndef([_AS_TEST_PREPARE],
816752b01e16Smrg[m4_defun([_AS_TEST_PREPARE],
816852b01e16Smrg[if test -x / >/dev/null 2>&1; then
816952b01e16Smrg  as_executable_p='test -x'
817052b01e16Smrgelse
817152b01e16Smrg  as_executable_p='test -f'
81724b0ead49Smrgfi
817352b01e16Smrg])])# _AS_TEST_PREPARE
81744b0ead49Smrg
817552b01e16Smrg# AS_EXECUTABLE_P
817652b01e16Smrg# ---------------
817752b01e16Smrg# Check whether a file is executable.
817852b01e16Smrgm4_ifndef([AS_EXECUTABLE_P],
817952b01e16Smrg[m4_defun([AS_EXECUTABLE_P],
818052b01e16Smrg[AS_REQUIRE([_AS_TEST_PREPARE])dnl
818152b01e16Smrg$as_executable_p $1[]dnl
818252b01e16Smrg])])# AS_EXECUTABLE_P
81834b0ead49Smrg
818452b01e16Smrg# NOTE: This macro has been submitted for inclusion into   #
818552b01e16Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
818652b01e16Smrg#  a released version of Autoconf we should remove this    #
818752b01e16Smrg#  macro and use it instead.                               #
818852b01e16Smrg# LT_AC_PROG_SED
818952b01e16Smrg# --------------
819052b01e16Smrg# Check for a fully-functional sed program, that truncates
819152b01e16Smrg# as few characters as possible.  Prefer GNU sed if found.
819252b01e16SmrgAC_DEFUN([LT_AC_PROG_SED],
819352b01e16Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
819452b01e16SmrgAC_CACHE_VAL(lt_cv_path_SED,
819552b01e16Smrg[# Loop through the user's path and test for sed and gsed.
819652b01e16Smrg# Then use that list of sed's as ones to test for truncation.
819752b01e16Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
819852b01e16Smrgfor as_dir in $PATH
819952b01e16Smrgdo
820052b01e16Smrg  IFS=$as_save_IFS
820152b01e16Smrg  test -z "$as_dir" && as_dir=.
820252b01e16Smrg  for lt_ac_prog in sed gsed; do
820352b01e16Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
820452b01e16Smrg      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
820552b01e16Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
820652b01e16Smrg      fi
820752b01e16Smrg    done
820852b01e16Smrg  done
820952b01e16Smrgdone
821052b01e16SmrgIFS=$as_save_IFS
821152b01e16Smrglt_ac_max=0
821252b01e16Smrglt_ac_count=0
821352b01e16Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
821452b01e16Smrg# along with /bin/sed that truncates output.
821552b01e16Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
821652b01e16Smrg  test ! -f $lt_ac_sed && continue
821752b01e16Smrg  cat /dev/null > conftest.in
821852b01e16Smrg  lt_ac_count=0
821952b01e16Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
822052b01e16Smrg  # Check for GNU sed and select it if it is found.
822152b01e16Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
822252b01e16Smrg    lt_cv_path_SED=$lt_ac_sed
822352b01e16Smrg    break
822452b01e16Smrg  fi
822552b01e16Smrg  while true; do
822652b01e16Smrg    cat conftest.in conftest.in >conftest.tmp
822752b01e16Smrg    mv conftest.tmp conftest.in
822852b01e16Smrg    cp conftest.in conftest.nl
822952b01e16Smrg    echo >>conftest.nl
823052b01e16Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
823152b01e16Smrg    cmp -s conftest.out conftest.nl || break
823252b01e16Smrg    # 10000 chars as input seems more than enough
823352b01e16Smrg    test $lt_ac_count -gt 10 && break
823452b01e16Smrg    lt_ac_count=`expr $lt_ac_count + 1`
823552b01e16Smrg    if test $lt_ac_count -gt $lt_ac_max; then
823652b01e16Smrg      lt_ac_max=$lt_ac_count
823752b01e16Smrg      lt_cv_path_SED=$lt_ac_sed
823852b01e16Smrg    fi
823952b01e16Smrg  done
824052b01e16Smrgdone
824152b01e16Smrg])
824252b01e16SmrgSED=$lt_cv_path_SED
824352b01e16SmrgAC_SUBST([SED])
824452b01e16SmrgAC_MSG_RESULT([$SED])
824552b01e16Smrg])
82464b0ead49Smrg
824752b01e16Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
824852b01e16Smrg# 
824952b01e16Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
825052b01e16Smrg#
825152b01e16Smrg# This program is free software; you can redistribute it and/or modify
825252b01e16Smrg# it under the terms of the GNU General Public License as published by
825352b01e16Smrg# the Free Software Foundation; either version 2 of the License, or
825452b01e16Smrg# (at your option) any later version.
825552b01e16Smrg#
825652b01e16Smrg# This program is distributed in the hope that it will be useful, but
825752b01e16Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
825852b01e16Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
825952b01e16Smrg# General Public License for more details.
826052b01e16Smrg#
826152b01e16Smrg# You should have received a copy of the GNU General Public License
826252b01e16Smrg# along with this program; if not, write to the Free Software
826352b01e16Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
826452b01e16Smrg#
826552b01e16Smrg# As a special exception to the GNU General Public License, if you
826652b01e16Smrg# distribute this file as part of a program that contains a
826752b01e16Smrg# configuration script generated by Autoconf, you may include it under
826852b01e16Smrg# the same distribution terms that you use for the rest of that program.
82694b0ead49Smrg
827052b01e16Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
827152b01e16Smrg# ----------------------------------
827252b01e16SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
827352b01e16Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
827452b01e16Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
827552b01e16SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
827652b01e16Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
827752b01e16Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
827852b01e16Smrgfi
827952b01e16Smrgif test -n "$PKG_CONFIG"; then
828052b01e16Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
828152b01e16Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
828252b01e16Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
828352b01e16Smrg		AC_MSG_RESULT([yes])
828452b01e16Smrg	else
828552b01e16Smrg		AC_MSG_RESULT([no])
828652b01e16Smrg		PKG_CONFIG=""
828752b01e16Smrg	fi
828852b01e16Smrg		
828952b01e16Smrgfi[]dnl
829052b01e16Smrg])# PKG_PROG_PKG_CONFIG
82914b0ead49Smrg
829252b01e16Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
82934b0ead49Smrg#
829452b01e16Smrg# Check to see whether a particular set of modules exists.  Similar
829552b01e16Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
829652b01e16Smrg#
829752b01e16Smrg#
829852b01e16Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
829952b01e16Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
830052b01e16Smrg# PKG_CHECK_EXISTS manually
830152b01e16Smrg# --------------------------------------------------------------
830252b01e16SmrgAC_DEFUN([PKG_CHECK_EXISTS],
830352b01e16Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
830452b01e16Smrgif test -n "$PKG_CONFIG" && \
830552b01e16Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
830652b01e16Smrg  m4_ifval([$2], [$2], [:])
830752b01e16Smrgm4_ifvaln([$3], [else
830852b01e16Smrg  $3])dnl
830952b01e16Smrgfi])
83104b0ead49Smrg
83114b0ead49Smrg
831252b01e16Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
831352b01e16Smrg# ---------------------------------------------
831452b01e16Smrgm4_define([_PKG_CONFIG],
831552b01e16Smrg[if test -n "$$1"; then
831652b01e16Smrg    pkg_cv_[]$1="$$1"
831752b01e16Smrg elif test -n "$PKG_CONFIG"; then
831852b01e16Smrg    PKG_CHECK_EXISTS([$3],
831952b01e16Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
832052b01e16Smrg		     [pkg_failed=yes])
832152b01e16Smrg else
832252b01e16Smrg    pkg_failed=untried
832352b01e16Smrgfi[]dnl
832452b01e16Smrg])# _PKG_CONFIG
832552b01e16Smrg
832652b01e16Smrg# _PKG_SHORT_ERRORS_SUPPORTED
832752b01e16Smrg# -----------------------------
832852b01e16SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
832952b01e16Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
833052b01e16Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
833152b01e16Smrg        _pkg_short_errors_supported=yes
83324b0ead49Smrgelse
833352b01e16Smrg        _pkg_short_errors_supported=no
833452b01e16Smrgfi[]dnl
833552b01e16Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
83364b0ead49Smrg
83374b0ead49Smrg
833852b01e16Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
833952b01e16Smrg# [ACTION-IF-NOT-FOUND])
83404b0ead49Smrg#
83414b0ead49Smrg#
834252b01e16Smrg# Note that if there is a possibility the first call to
834352b01e16Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
834452b01e16Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
834552b01e16Smrg#
834652b01e16Smrg#
834752b01e16Smrg# --------------------------------------------------------------
834852b01e16SmrgAC_DEFUN([PKG_CHECK_MODULES],
834952b01e16Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
835052b01e16SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
835152b01e16SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
83524b0ead49Smrg
835352b01e16Smrgpkg_failed=no
835452b01e16SmrgAC_MSG_CHECKING([for $1])
83554b0ead49Smrg
835652b01e16Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
835752b01e16Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
83584b0ead49Smrg
835952b01e16Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
836052b01e16Smrgand $1[]_LIBS to avoid the need to call pkg-config.
836152b01e16SmrgSee the pkg-config man page for more details.])
83624b0ead49Smrg
836352b01e16Smrgif test $pkg_failed = yes; then
836452b01e16Smrg        _PKG_SHORT_ERRORS_SUPPORTED
836552b01e16Smrg        if test $_pkg_short_errors_supported = yes; then
836652b01e16Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
836752b01e16Smrg        else 
836852b01e16Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
836952b01e16Smrg        fi
837052b01e16Smrg	# Put the nasty error message in config.log where it belongs
837152b01e16Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
83724b0ead49Smrg
837352b01e16Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
837452b01e16Smrg[Package requirements ($2) were not met:
83754b0ead49Smrg
837652b01e16Smrg$$1_PKG_ERRORS
83774b0ead49Smrg
837852b01e16SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
837952b01e16Smrginstalled software in a non-standard prefix.
83804b0ead49Smrg
838152b01e16Smrg_PKG_TEXT
838252b01e16Smrg])],
838352b01e16Smrg		[AC_MSG_RESULT([no])
838452b01e16Smrg                $4])
838552b01e16Smrgelif test $pkg_failed = untried; then
838652b01e16Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
838752b01e16Smrg[The pkg-config script could not be found or is too old.  Make sure it
838852b01e16Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
838952b01e16Smrgpath to pkg-config.
839052b01e16Smrg
839152b01e16Smrg_PKG_TEXT
839252b01e16Smrg
839352b01e16SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
839452b01e16Smrg		[$4])
839552b01e16Smrgelse
839652b01e16Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
839752b01e16Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
839852b01e16Smrg        AC_MSG_RESULT([yes])
839952b01e16Smrg	ifelse([$3], , :, [$3])
840052b01e16Smrgfi[]dnl
840152b01e16Smrg])# PKG_CHECK_MODULES
84024b0ead49Smrg
8403