aclocal.m4 revision 862f5301
144dda7b2Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2ff559fabSmrg
3ff559fabSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
47a3b38f7Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5ff559fabSmrg# This file is free software; the Free Software Foundation
6ff559fabSmrg# gives unlimited permission to copy and/or distribute it,
7ff559fabSmrg# with or without modifications, as long as this notice is preserved.
8ff559fabSmrg
9ff559fabSmrg# This program is distributed in the hope that it will be useful,
10ff559fabSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ff559fabSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ff559fabSmrg# PARTICULAR PURPOSE.
13ff559fabSmrg
147a3b38f7Smrgm4_ifndef([AC_AUTOCONF_VERSION],
157a3b38f7Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1644dda7b2Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
1744dda7b2Smrg[m4_warning([this file was generated for autoconf 2.68.
187a3b38f7SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
197a3b38f7SmrgIf you have problems, you may need to regenerate the build system entirely.
207a3b38f7SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21ff559fabSmrg
2244dda7b2Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23ff559fabSmrg#
2444dda7b2Smrg# This file is free software; the Free Software Foundation
2544dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
2644dda7b2Smrg# with or without modifications, as long as this notice is preserved.
2744dda7b2Smrg
2844dda7b2Smrg# AM_AUTOMAKE_VERSION(VERSION)
2944dda7b2Smrg# ----------------------------
3044dda7b2Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3144dda7b2Smrg# generated from the m4 files accompanying Automake X.Y.
3244dda7b2Smrg# (This private macro should not be called outside this file.)
3344dda7b2SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3444dda7b2Smrg[am__api_version='1.11'
3544dda7b2Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3644dda7b2Smrgdnl require some minimum version.  Point them to the right macro.
3744dda7b2Smrgm4_if([$1], [1.11.1], [],
3844dda7b2Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3944dda7b2Smrg])
4044dda7b2Smrg
4144dda7b2Smrg# _AM_AUTOCONF_VERSION(VERSION)
4244dda7b2Smrg# -----------------------------
4344dda7b2Smrg# aclocal traces this macro to find the Autoconf version.
4444dda7b2Smrg# This is a private macro too.  Using m4_define simplifies
4544dda7b2Smrg# the logic in aclocal, which can simply ignore this definition.
4644dda7b2Smrgm4_define([_AM_AUTOCONF_VERSION], [])
4744dda7b2Smrg
4844dda7b2Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4944dda7b2Smrg# -------------------------------
5044dda7b2Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5144dda7b2Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5244dda7b2SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5344dda7b2Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
5444dda7b2Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5544dda7b2Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5644dda7b2Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5744dda7b2Smrg
5844dda7b2Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5944dda7b2Smrg
6044dda7b2Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61ff559fabSmrg#
6244dda7b2Smrg# This file is free software; the Free Software Foundation
6344dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
6444dda7b2Smrg# with or without modifications, as long as this notice is preserved.
657a3b38f7Smrg
6644dda7b2Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6744dda7b2Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6844dda7b2Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69ff559fabSmrg#
7044dda7b2Smrg# Of course, Automake must honor this variable whenever it calls a
7144dda7b2Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7244dda7b2Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7344dda7b2Smrg# depending on how configure is run.  This is pretty annoying, since
7444dda7b2Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7544dda7b2Smrg# source directory, any form will work fine, but in subdirectories a
7644dda7b2Smrg# relative path needs to be adjusted first.
77ff559fabSmrg#
7844dda7b2Smrg# $ac_aux_dir/missing
7944dda7b2Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8044dda7b2Smrg# $top_srcdir/$ac_aux_dir/missing
8144dda7b2Smrg#    fails if $ac_aux_dir is absolute,
8244dda7b2Smrg#    fails when called from a subdirectory in a VPATH build with
8344dda7b2Smrg#          a relative $ac_aux_dir
84ff559fabSmrg#
8544dda7b2Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8644dda7b2Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8744dda7b2Smrg# harmless because $srcdir is `.', but things will broke when you
8844dda7b2Smrg# start a VPATH build or use an absolute $srcdir.
89ff559fabSmrg#
9044dda7b2Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9144dda7b2Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9244dda7b2Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9344dda7b2Smrg# and then we would define $MISSING as
9444dda7b2Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9544dda7b2Smrg# This will work as long as MISSING is not called from configure, because
9644dda7b2Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9744dda7b2Smrg# However there are other variables, like CC, which are often used in
9844dda7b2Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99ff559fabSmrg#
10044dda7b2Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10144dda7b2Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10244dda7b2Smrg# configured tree to be moved without reconfiguration.
103ff559fabSmrg
10444dda7b2SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10544dda7b2Smrg[dnl Rely on autoconf to set up CDPATH properly.
10644dda7b2SmrgAC_PREREQ([2.50])dnl
10744dda7b2Smrg# expand $ac_aux_dir to an absolute path
10844dda7b2Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1097a3b38f7Smrg])
110ff559fabSmrg
11144dda7b2Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112ff559fabSmrg
11344dda7b2Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11444dda7b2Smrg# Free Software Foundation, Inc.
11544dda7b2Smrg#
11644dda7b2Smrg# This file is free software; the Free Software Foundation
11744dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
11844dda7b2Smrg# with or without modifications, as long as this notice is preserved.
119ff559fabSmrg
12044dda7b2Smrg# serial 9
121ff559fabSmrg
12244dda7b2Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12344dda7b2Smrg# -------------------------------------
12444dda7b2Smrg# Define a conditional.
12544dda7b2SmrgAC_DEFUN([AM_CONDITIONAL],
12644dda7b2Smrg[AC_PREREQ(2.52)dnl
12744dda7b2Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12844dda7b2Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12944dda7b2SmrgAC_SUBST([$1_TRUE])dnl
13044dda7b2SmrgAC_SUBST([$1_FALSE])dnl
13144dda7b2Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13244dda7b2Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13344dda7b2Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13444dda7b2Smrgif $2; then
13544dda7b2Smrg  $1_TRUE=
13644dda7b2Smrg  $1_FALSE='#'
13744dda7b2Smrgelse
13844dda7b2Smrg  $1_TRUE='#'
13944dda7b2Smrg  $1_FALSE=
14044dda7b2Smrgfi
14144dda7b2SmrgAC_CONFIG_COMMANDS_PRE(
14244dda7b2Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14344dda7b2Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14444dda7b2SmrgUsually this means the macro was only invoked conditionally.]])
14544dda7b2Smrgfi])])
146ff559fabSmrg
14744dda7b2Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14844dda7b2Smrg# Free Software Foundation, Inc.
14944dda7b2Smrg#
15044dda7b2Smrg# This file is free software; the Free Software Foundation
15144dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
15244dda7b2Smrg# with or without modifications, as long as this notice is preserved.
153ff559fabSmrg
15444dda7b2Smrg# serial 10
155ff559fabSmrg
15644dda7b2Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15744dda7b2Smrg# written in clear, in which case automake, when reading aclocal.m4,
15844dda7b2Smrg# will think it sees a *use*, and therefore will trigger all it's
15944dda7b2Smrg# C support machinery.  Also note that it means that autoscan, seeing
16044dda7b2Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161ff559fabSmrg
162ff559fabSmrg
16344dda7b2Smrg# _AM_DEPENDENCIES(NAME)
1647a3b38f7Smrg# ----------------------
16544dda7b2Smrg# See how the compiler implements dependency checking.
16644dda7b2Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16744dda7b2Smrg# We try a few techniques and use that to set a single cache variable.
16844dda7b2Smrg#
16944dda7b2Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
17044dda7b2Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
17144dda7b2Smrg# dependency, and given that the user is not expected to run this macro,
17244dda7b2Smrg# just rely on AC_PROG_CC.
17344dda7b2SmrgAC_DEFUN([_AM_DEPENDENCIES],
17444dda7b2Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17544dda7b2SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17644dda7b2SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17744dda7b2SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1787a3b38f7Smrg
17944dda7b2Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18044dda7b2Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18144dda7b2Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
18244dda7b2Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
18344dda7b2Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18444dda7b2Smrg                   [depcc="$$1"   am_compiler_list=])
1857a3b38f7Smrg
18644dda7b2SmrgAC_CACHE_CHECK([dependency style of $depcc],
18744dda7b2Smrg               [am_cv_$1_dependencies_compiler_type],
18844dda7b2Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18944dda7b2Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
19044dda7b2Smrg  # making bogus files that we don't know about and never remove.  For
19144dda7b2Smrg  # instance it was reported that on HP-UX the gcc test will end up
19244dda7b2Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
19344dda7b2Smrg  # in D'.
19444dda7b2Smrg  mkdir conftest.dir
19544dda7b2Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19644dda7b2Smrg  # using a relative directory.
19744dda7b2Smrg  cp "$am_depcomp" conftest.dir
19844dda7b2Smrg  cd conftest.dir
19944dda7b2Smrg  # We will build objects and dependencies in a subdirectory because
20044dda7b2Smrg  # it helps to detect inapplicable dependency modes.  For instance
20144dda7b2Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20244dda7b2Smrg  # side effect of compilation, but ICC will put the dependencies in
20344dda7b2Smrg  # the current directory while Tru64 will put them in the object
20444dda7b2Smrg  # directory.
20544dda7b2Smrg  mkdir sub
206ff559fabSmrg
20744dda7b2Smrg  am_cv_$1_dependencies_compiler_type=none
20844dda7b2Smrg  if test "$am_compiler_list" = ""; then
20944dda7b2Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210ff559fabSmrg  fi
21144dda7b2Smrg  am__universal=false
21244dda7b2Smrg  m4_case([$1], [CC],
21344dda7b2Smrg    [case " $depcc " in #(
21444dda7b2Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21544dda7b2Smrg     esac],
21644dda7b2Smrg    [CXX],
21744dda7b2Smrg    [case " $depcc " in #(
21844dda7b2Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21944dda7b2Smrg     esac])
220ff559fabSmrg
22144dda7b2Smrg  for depmode in $am_compiler_list; do
22244dda7b2Smrg    # Setup a source with many dependencies, because some compilers
22344dda7b2Smrg    # like to wrap large dependency lists on column 80 (with \), and
22444dda7b2Smrg    # we should not choose a depcomp mode which is confused by this.
22544dda7b2Smrg    #
22644dda7b2Smrg    # We need to recreate these files for each test, as the compiler may
22744dda7b2Smrg    # overwrite some of them when testing with obscure command lines.
22844dda7b2Smrg    # This happens at least with the AIX C compiler.
22944dda7b2Smrg    : > sub/conftest.c
23044dda7b2Smrg    for i in 1 2 3 4 5 6; do
23144dda7b2Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23244dda7b2Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23344dda7b2Smrg      # Solaris 8's {/usr,}/bin/sh.
23444dda7b2Smrg      touch sub/conftst$i.h
23544dda7b2Smrg    done
23644dda7b2Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237ff559fabSmrg
23844dda7b2Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23944dda7b2Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24044dda7b2Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24144dda7b2Smrg    # versions had trouble with output in subdirs
24244dda7b2Smrg    am__obj=sub/conftest.${OBJEXT-o}
24344dda7b2Smrg    am__minus_obj="-o $am__obj"
24444dda7b2Smrg    case $depmode in
24544dda7b2Smrg    gcc)
24644dda7b2Smrg      # This depmode causes a compiler race in universal mode.
24744dda7b2Smrg      test "$am__universal" = false || continue
24844dda7b2Smrg      ;;
24944dda7b2Smrg    nosideeffect)
25044dda7b2Smrg      # after this tag, mechanisms are not by side-effect, so they'll
25144dda7b2Smrg      # only be used when explicitly requested
25244dda7b2Smrg      if test "x$enable_dependency_tracking" = xyes; then
25344dda7b2Smrg	continue
25444dda7b2Smrg      else
25544dda7b2Smrg	break
25644dda7b2Smrg      fi
25744dda7b2Smrg      ;;
25844dda7b2Smrg    msvisualcpp | msvcmsys)
25944dda7b2Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
26044dda7b2Smrg      # not run yet.  These depmodes are late enough in the game, and
26144dda7b2Smrg      # so weak that their functioning should not be impacted.
26244dda7b2Smrg      am__obj=conftest.${OBJEXT-o}
26344dda7b2Smrg      am__minus_obj=
26444dda7b2Smrg      ;;
26544dda7b2Smrg    none) break ;;
26644dda7b2Smrg    esac
26744dda7b2Smrg    if depmode=$depmode \
26844dda7b2Smrg       source=sub/conftest.c object=$am__obj \
26944dda7b2Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27044dda7b2Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27144dda7b2Smrg         >/dev/null 2>conftest.err &&
27244dda7b2Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27344dda7b2Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27444dda7b2Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27544dda7b2Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27644dda7b2Smrg      # icc doesn't choke on unknown options, it will just issue warnings
27744dda7b2Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
27844dda7b2Smrg      # that says an option was ignored or not supported.
27944dda7b2Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28044dda7b2Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28144dda7b2Smrg      # The diagnosis changed in icc 8.0:
28244dda7b2Smrg      #   icc: Command line remark: option '-MP' not supported
28344dda7b2Smrg      if (grep 'ignoring option' conftest.err ||
28444dda7b2Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28544dda7b2Smrg        am_cv_$1_dependencies_compiler_type=$depmode
28644dda7b2Smrg        break
28744dda7b2Smrg      fi
28844dda7b2Smrg    fi
28944dda7b2Smrg  done
2907a3b38f7Smrg
29144dda7b2Smrg  cd ..
29244dda7b2Smrg  rm -rf conftest.dir
29344dda7b2Smrgelse
29444dda7b2Smrg  am_cv_$1_dependencies_compiler_type=none
29544dda7b2Smrgfi
29644dda7b2Smrg])
29744dda7b2SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29844dda7b2SmrgAM_CONDITIONAL([am__fastdep$1], [
29944dda7b2Smrg  test "x$enable_dependency_tracking" != xno \
30044dda7b2Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
30144dda7b2Smrg])
302ff559fabSmrg
303ff559fabSmrg
30444dda7b2Smrg# AM_SET_DEPDIR
30544dda7b2Smrg# -------------
30644dda7b2Smrg# Choose a directory name for dependency files.
30744dda7b2Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
30844dda7b2SmrgAC_DEFUN([AM_SET_DEPDIR],
30944dda7b2Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
31044dda7b2SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
31144dda7b2Smrg])
312ff559fabSmrg
3137a3b38f7Smrg
31444dda7b2Smrg# AM_DEP_TRACK
31544dda7b2Smrg# ------------
31644dda7b2SmrgAC_DEFUN([AM_DEP_TRACK],
31744dda7b2Smrg[AC_ARG_ENABLE(dependency-tracking,
31844dda7b2Smrg[  --disable-dependency-tracking  speeds up one-time build
31944dda7b2Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
32044dda7b2Smrgif test "x$enable_dependency_tracking" != xno; then
32144dda7b2Smrg  am_depcomp="$ac_aux_dir/depcomp"
32244dda7b2Smrg  AMDEPBACKSLASH='\'
32344dda7b2Smrgfi
32444dda7b2SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32544dda7b2SmrgAC_SUBST([AMDEPBACKSLASH])dnl
32644dda7b2Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32744dda7b2Smrg])
3287a3b38f7Smrg
32944dda7b2Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3307a3b38f7Smrg
33144dda7b2Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33244dda7b2Smrg# Free Software Foundation, Inc.
33344dda7b2Smrg#
33444dda7b2Smrg# This file is free software; the Free Software Foundation
33544dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
33644dda7b2Smrg# with or without modifications, as long as this notice is preserved.
3377a3b38f7Smrg
33844dda7b2Smrg#serial 5
3397a3b38f7Smrg
34044dda7b2Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3417a3b38f7Smrg# ------------------------------
34244dda7b2SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34344dda7b2Smrg[{
34444dda7b2Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34544dda7b2Smrg  # are listed without --file.  Let's play safe and only enable the eval
34644dda7b2Smrg  # if we detect the quoting.
34744dda7b2Smrg  case $CONFIG_FILES in
34844dda7b2Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
34944dda7b2Smrg  *)   set x $CONFIG_FILES ;;
35044dda7b2Smrg  esac
35144dda7b2Smrg  shift
35244dda7b2Smrg  for mf
35344dda7b2Smrg  do
35444dda7b2Smrg    # Strip MF so we end up with the name of the file.
35544dda7b2Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35644dda7b2Smrg    # Check whether this is an Automake generated Makefile or not.
35744dda7b2Smrg    # We used to match only the files named `Makefile.in', but
35844dda7b2Smrg    # some people rename them; so instead we look at the file content.
35944dda7b2Smrg    # Grep'ing the first line is not enough: some people post-process
36044dda7b2Smrg    # each Makefile.in and add a new line on top of each file to say so.
36144dda7b2Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36244dda7b2Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36344dda7b2Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36444dda7b2Smrg      dirpart=`AS_DIRNAME("$mf")`
36544dda7b2Smrg    else
36644dda7b2Smrg      continue
36744dda7b2Smrg    fi
36844dda7b2Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
36944dda7b2Smrg    # from the Makefile without running `make'.
37044dda7b2Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37144dda7b2Smrg    test -z "$DEPDIR" && continue
37244dda7b2Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37344dda7b2Smrg    test -z "am__include" && continue
37444dda7b2Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37544dda7b2Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
37644dda7b2Smrg    U=`sed -n 's/^U = //p' < "$mf"`
37744dda7b2Smrg    # Find all dependency output files, they are included files with
37844dda7b2Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37944dda7b2Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38044dda7b2Smrg    # expansion.
38144dda7b2Smrg    for file in `sed -n "
38244dda7b2Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38344dda7b2Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38444dda7b2Smrg      # Make sure the directory exists.
38544dda7b2Smrg      test -f "$dirpart/$file" && continue
38644dda7b2Smrg      fdir=`AS_DIRNAME(["$file"])`
38744dda7b2Smrg      AS_MKDIR_P([$dirpart/$fdir])
38844dda7b2Smrg      # echo "creating $dirpart/$file"
38944dda7b2Smrg      echo '# dummy' > "$dirpart/$file"
39044dda7b2Smrg    done
39144dda7b2Smrg  done
39244dda7b2Smrg}
39344dda7b2Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3947a3b38f7Smrg
3957a3b38f7Smrg
39644dda7b2Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39744dda7b2Smrg# -----------------------------
39844dda7b2Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
39944dda7b2Smrg#
40044dda7b2Smrg# This code is only required when automatic dependency tracking
40144dda7b2Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
40244dda7b2Smrg# need in order to bootstrap the dependency handling code.
40344dda7b2SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40444dda7b2Smrg[AC_CONFIG_COMMANDS([depfiles],
40544dda7b2Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40644dda7b2Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407ff559fabSmrg])
4087a3b38f7Smrg
40944dda7b2Smrg# Do all the work for Automake.                             -*- Autoconf -*-
4107a3b38f7Smrg
41144dda7b2Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
41244dda7b2Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
41344dda7b2Smrg#
41444dda7b2Smrg# This file is free software; the Free Software Foundation
41544dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
41644dda7b2Smrg# with or without modifications, as long as this notice is preserved.
4177a3b38f7Smrg
41844dda7b2Smrg# serial 16
419ff559fabSmrg
42044dda7b2Smrg# This macro actually does too much.  Some checks are only needed if
42144dda7b2Smrg# your package does certain things.  But this isn't really a big deal.
422ff559fabSmrg
42344dda7b2Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42444dda7b2Smrg# AM_INIT_AUTOMAKE([OPTIONS])
42544dda7b2Smrg# -----------------------------------------------
42644dda7b2Smrg# The call with PACKAGE and VERSION arguments is the old style
42744dda7b2Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42844dda7b2Smrg# and VERSION should now be passed to AC_INIT and removed from
42944dda7b2Smrg# the call to AM_INIT_AUTOMAKE.
43044dda7b2Smrg# We support both call styles for the transition.  After
43144dda7b2Smrg# the next Automake release, Autoconf can make the AC_INIT
43244dda7b2Smrg# arguments mandatory, and then we can depend on a new Autoconf
43344dda7b2Smrg# release and drop the old call support.
43444dda7b2SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
43544dda7b2Smrg[AC_PREREQ([2.62])dnl
43644dda7b2Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43744dda7b2Smrgdnl the ones we care about.
43844dda7b2Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43944dda7b2SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44044dda7b2SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
44144dda7b2Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
44244dda7b2Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
44344dda7b2Smrg  # is not polluted with repeated "-I."
44444dda7b2Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
44544dda7b2Smrg  # test to see if srcdir already configured
44644dda7b2Smrg  if test -f $srcdir/config.status; then
44744dda7b2Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
44844dda7b2Smrg  fi
44944dda7b2Smrgfi
450ff559fabSmrg
45144dda7b2Smrg# test whether we have cygpath
45244dda7b2Smrgif test -z "$CYGPATH_W"; then
45344dda7b2Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45444dda7b2Smrg    CYGPATH_W='cygpath -w'
45544dda7b2Smrg  else
45644dda7b2Smrg    CYGPATH_W=echo
45744dda7b2Smrg  fi
45844dda7b2Smrgfi
45944dda7b2SmrgAC_SUBST([CYGPATH_W])
460ff559fabSmrg
46144dda7b2Smrg# Define the identity of the package.
46244dda7b2Smrgdnl Distinguish between old-style and new-style calls.
46344dda7b2Smrgm4_ifval([$2],
46444dda7b2Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46544dda7b2Smrg AC_SUBST([PACKAGE], [$1])dnl
46644dda7b2Smrg AC_SUBST([VERSION], [$2])],
46744dda7b2Smrg[_AM_SET_OPTIONS([$1])dnl
46844dda7b2Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
46944dda7b2Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
47044dda7b2Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47144dda7b2Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47244dda7b2Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473ff559fabSmrg
47444dda7b2Smrg_AM_IF_OPTION([no-define],,
47544dda7b2Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
47644dda7b2Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477ff559fabSmrg
47844dda7b2Smrg# Some tools Automake needs.
47944dda7b2SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48044dda7b2SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48144dda7b2SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
48244dda7b2SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
48344dda7b2SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
48444dda7b2SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
48544dda7b2SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
48644dda7b2SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
48744dda7b2SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
48844dda7b2SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
48944dda7b2Smrg# We need awk for the "check" target.  The system "awk" is bad on
49044dda7b2Smrg# some platforms.
49144dda7b2SmrgAC_REQUIRE([AC_PROG_AWK])dnl
49244dda7b2SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
49344dda7b2SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
49444dda7b2Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
49544dda7b2Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
49644dda7b2Smrg			     [_AM_PROG_TAR([v7])])])
49744dda7b2Smrg_AM_IF_OPTION([no-dependencies],,
49844dda7b2Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
49944dda7b2Smrg		  [_AM_DEPENDENCIES(CC)],
50044dda7b2Smrg		  [define([AC_PROG_CC],
50144dda7b2Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
50244dda7b2SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
50344dda7b2Smrg		  [_AM_DEPENDENCIES(CXX)],
50444dda7b2Smrg		  [define([AC_PROG_CXX],
50544dda7b2Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
50644dda7b2SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
50744dda7b2Smrg		  [_AM_DEPENDENCIES(OBJC)],
50844dda7b2Smrg		  [define([AC_PROG_OBJC],
50944dda7b2Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
51044dda7b2Smrg])
51144dda7b2Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
51244dda7b2Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
51344dda7b2Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
51444dda7b2Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
51544dda7b2SmrgAC_CONFIG_COMMANDS_PRE(dnl
51644dda7b2Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
51744dda7b2Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5187a3b38f7Smrg])
519ff559fabSmrg
52044dda7b2Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
52144dda7b2Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
52244dda7b2Smrgdnl mangled by Autoconf and run in a shell conditional statement.
52344dda7b2Smrgm4_define([_AC_COMPILER_EXEEXT],
52444dda7b2Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525ff559fabSmrg
526ff559fabSmrg
52744dda7b2Smrg# When config.status generates a header, we must update the stamp-h file.
52844dda7b2Smrg# This file resides in the same directory as the config header
52944dda7b2Smrg# that is generated.  The stamp files are numbered to have different names.
530ff559fabSmrg
53144dda7b2Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
53244dda7b2Smrg# loop where config.status creates the headers, so we can generate
53344dda7b2Smrg# our stamp files there.
53444dda7b2SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
53544dda7b2Smrg[# Compute $1's index in $config_headers.
53644dda7b2Smrg_am_arg=$1
53744dda7b2Smrg_am_stamp_count=1
53844dda7b2Smrgfor _am_header in $config_headers :; do
53944dda7b2Smrg  case $_am_header in
54044dda7b2Smrg    $_am_arg | $_am_arg:* )
54144dda7b2Smrg      break ;;
54244dda7b2Smrg    * )
54344dda7b2Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
54444dda7b2Smrg  esac
54544dda7b2Smrgdone
54644dda7b2Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547ff559fabSmrg
54844dda7b2Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
54944dda7b2Smrg#
55044dda7b2Smrg# This file is free software; the Free Software Foundation
55144dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
55244dda7b2Smrg# with or without modifications, as long as this notice is preserved.
553ff559fabSmrg
55444dda7b2Smrg# AM_PROG_INSTALL_SH
55544dda7b2Smrg# ------------------
55644dda7b2Smrg# Define $install_sh.
55744dda7b2SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
55844dda7b2Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
55944dda7b2Smrgif test x"${install_sh}" != xset; then
56044dda7b2Smrg  case $am_aux_dir in
56144dda7b2Smrg  *\ * | *\	*)
56244dda7b2Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
56344dda7b2Smrg  *)
56444dda7b2Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
56544dda7b2Smrg  esac
56644dda7b2Smrgfi
56744dda7b2SmrgAC_SUBST(install_sh)])
568ff559fabSmrg
56944dda7b2Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
57044dda7b2Smrg#
57144dda7b2Smrg# This file is free software; the Free Software Foundation
57244dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
57344dda7b2Smrg# with or without modifications, as long as this notice is preserved.
574ff559fabSmrg
57544dda7b2Smrg# serial 2
5767a3b38f7Smrg
57744dda7b2Smrg# Check whether the underlying file-system supports filenames
57844dda7b2Smrg# with a leading dot.  For instance MS-DOS doesn't.
57944dda7b2SmrgAC_DEFUN([AM_SET_LEADING_DOT],
58044dda7b2Smrg[rm -rf .tst 2>/dev/null
58144dda7b2Smrgmkdir .tst 2>/dev/null
58244dda7b2Smrgif test -d .tst; then
58344dda7b2Smrg  am__leading_dot=.
58444dda7b2Smrgelse
58544dda7b2Smrg  am__leading_dot=_
58644dda7b2Smrgfi
58744dda7b2Smrgrmdir .tst 2>/dev/null
58844dda7b2SmrgAC_SUBST([am__leading_dot])])
5897a3b38f7Smrg
59044dda7b2Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
59144dda7b2Smrg# From Jim Meyering
5927a3b38f7Smrg
59344dda7b2Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
59444dda7b2Smrg# Free Software Foundation, Inc.
595ff559fabSmrg#
59644dda7b2Smrg# This file is free software; the Free Software Foundation
59744dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
59844dda7b2Smrg# with or without modifications, as long as this notice is preserved.
599ff559fabSmrg
60044dda7b2Smrg# serial 5
601ff559fabSmrg
60244dda7b2Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
60344dda7b2Smrg# ----------------------------------
60444dda7b2Smrg# Control maintainer-specific portions of Makefiles.
60544dda7b2Smrg# Default is to disable them, unless `enable' is passed literally.
60644dda7b2Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
60744dda7b2Smrg# can override the default with the --enable/--disable switch.
60844dda7b2SmrgAC_DEFUN([AM_MAINTAINER_MODE],
60944dda7b2Smrg[m4_case(m4_default([$1], [disable]),
61044dda7b2Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
61144dda7b2Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
61244dda7b2Smrg       [m4_define([am_maintainer_other], [enable])
61344dda7b2Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
61444dda7b2SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
61544dda7b2Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
61644dda7b2Smrg  AC_ARG_ENABLE([maintainer-mode],
61744dda7b2Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
61844dda7b2Smrg			  (and sometimes confusing) to the casual installer],
61944dda7b2Smrg      [USE_MAINTAINER_MODE=$enableval],
62044dda7b2Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
62144dda7b2Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
62244dda7b2Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
62344dda7b2Smrg  MAINT=$MAINTAINER_MODE_TRUE
62444dda7b2Smrg  AC_SUBST([MAINT])dnl
62544dda7b2Smrg]
62644dda7b2Smrg)
627ff559fabSmrg
62844dda7b2SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629ff559fabSmrg
63044dda7b2Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
63144dda7b2Smrg
63244dda7b2Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633ff559fabSmrg#
63444dda7b2Smrg# This file is free software; the Free Software Foundation
63544dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
63644dda7b2Smrg# with or without modifications, as long as this notice is preserved.
637ff559fabSmrg
63844dda7b2Smrg# serial 4
639ff559fabSmrg
64044dda7b2Smrg# AM_MAKE_INCLUDE()
64144dda7b2Smrg# -----------------
64244dda7b2Smrg# Check to see how make treats includes.
64344dda7b2SmrgAC_DEFUN([AM_MAKE_INCLUDE],
64444dda7b2Smrg[am_make=${MAKE-make}
64544dda7b2Smrgcat > confinc << 'END'
64644dda7b2Smrgam__doit:
64744dda7b2Smrg	@echo this is the am__doit target
64844dda7b2Smrg.PHONY: am__doit
64944dda7b2SmrgEND
65044dda7b2Smrg# If we don't find an include directive, just comment out the code.
65144dda7b2SmrgAC_MSG_CHECKING([for style of include used by $am_make])
65244dda7b2Smrgam__include="#"
65344dda7b2Smrgam__quote=
65444dda7b2Smrg_am_result=none
65544dda7b2Smrg# First try GNU make style include.
65644dda7b2Smrgecho "include confinc" > confmf
65744dda7b2Smrg# Ignore all kinds of additional output from `make'.
65844dda7b2Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
65944dda7b2Smrg*the\ am__doit\ target*)
66044dda7b2Smrg  am__include=include
66144dda7b2Smrg  am__quote=
66244dda7b2Smrg  _am_result=GNU
66344dda7b2Smrg  ;;
66444dda7b2Smrgesac
66544dda7b2Smrg# Now try BSD make style include.
66644dda7b2Smrgif test "$am__include" = "#"; then
66744dda7b2Smrg   echo '.include "confinc"' > confmf
66844dda7b2Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
66944dda7b2Smrg   *the\ am__doit\ target*)
67044dda7b2Smrg     am__include=.include
67144dda7b2Smrg     am__quote="\""
67244dda7b2Smrg     _am_result=BSD
67344dda7b2Smrg     ;;
67444dda7b2Smrg   esac
67544dda7b2Smrgfi
67644dda7b2SmrgAC_SUBST([am__include])
67744dda7b2SmrgAC_SUBST([am__quote])
67844dda7b2SmrgAC_MSG_RESULT([$_am_result])
67944dda7b2Smrgrm -f confinc confmf
68044dda7b2Smrg])
6817a3b38f7Smrg
68244dda7b2Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6837a3b38f7Smrg
68444dda7b2Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
68544dda7b2Smrg# Free Software Foundation, Inc.
68644dda7b2Smrg#
68744dda7b2Smrg# This file is free software; the Free Software Foundation
68844dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
68944dda7b2Smrg# with or without modifications, as long as this notice is preserved.
6907a3b38f7Smrg
69144dda7b2Smrg# serial 6
6927a3b38f7Smrg
69344dda7b2Smrg# AM_MISSING_PROG(NAME, PROGRAM)
694ff559fabSmrg# ------------------------------
69544dda7b2SmrgAC_DEFUN([AM_MISSING_PROG],
69644dda7b2Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
69744dda7b2Smrg$1=${$1-"${am_missing_run}$2"}
69844dda7b2SmrgAC_SUBST($1)])
6997a3b38f7Smrg
7007a3b38f7Smrg
70144dda7b2Smrg# AM_MISSING_HAS_RUN
70244dda7b2Smrg# ------------------
70344dda7b2Smrg# Define MISSING if not defined so far and test if it supports --run.
70444dda7b2Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
70544dda7b2SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
70644dda7b2Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
70744dda7b2SmrgAC_REQUIRE_AUX_FILE([missing])dnl
70844dda7b2Smrgif test x"${MISSING+set}" != xset; then
70944dda7b2Smrg  case $am_aux_dir in
71044dda7b2Smrg  *\ * | *\	*)
71144dda7b2Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
71244dda7b2Smrg  *)
71344dda7b2Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
71444dda7b2Smrg  esac
71544dda7b2Smrgfi
71644dda7b2Smrg# Use eval to expand $SHELL
71744dda7b2Smrgif eval "$MISSING --run true"; then
71844dda7b2Smrg  am_missing_run="$MISSING --run "
71944dda7b2Smrgelse
72044dda7b2Smrg  am_missing_run=
72144dda7b2Smrg  AC_MSG_WARN([`missing' script is too old or missing])
72244dda7b2Smrgfi
72344dda7b2Smrg])
724ff559fabSmrg
72544dda7b2Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
72644dda7b2Smrg#
72744dda7b2Smrg# This file is free software; the Free Software Foundation
72844dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
72944dda7b2Smrg# with or without modifications, as long as this notice is preserved.
730ff559fabSmrg
73144dda7b2Smrg# AM_PROG_MKDIR_P
73244dda7b2Smrg# ---------------
73344dda7b2Smrg# Check for `mkdir -p'.
73444dda7b2SmrgAC_DEFUN([AM_PROG_MKDIR_P],
73544dda7b2Smrg[AC_PREREQ([2.60])dnl
73644dda7b2SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
73744dda7b2Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
73844dda7b2Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
73944dda7b2Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
74044dda7b2Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
74144dda7b2Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
74244dda7b2Smrgdnl adjustment using top_builddir (which is defined more often than
74344dda7b2Smrgdnl MKDIR_P).
74444dda7b2SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
74544dda7b2Smrgcase $mkdir_p in
74644dda7b2Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
74744dda7b2Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7487a3b38f7Smrgesac
7497a3b38f7Smrg])
750ff559fabSmrg
75144dda7b2Smrg# Helper functions for option handling.                     -*- Autoconf -*-
752ff559fabSmrg
75344dda7b2Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
75444dda7b2Smrg#
75544dda7b2Smrg# This file is free software; the Free Software Foundation
75644dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
75744dda7b2Smrg# with or without modifications, as long as this notice is preserved.
7587a3b38f7Smrg
75944dda7b2Smrg# serial 4
7607a3b38f7Smrg
76144dda7b2Smrg# _AM_MANGLE_OPTION(NAME)
76244dda7b2Smrg# -----------------------
76344dda7b2SmrgAC_DEFUN([_AM_MANGLE_OPTION],
76444dda7b2Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765ff559fabSmrg
76644dda7b2Smrg# _AM_SET_OPTION(NAME)
76744dda7b2Smrg# ------------------------------
76844dda7b2Smrg# Set option NAME.  Presently that only means defining a flag for this option.
76944dda7b2SmrgAC_DEFUN([_AM_SET_OPTION],
77044dda7b2Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771ff559fabSmrg
77244dda7b2Smrg# _AM_SET_OPTIONS(OPTIONS)
77344dda7b2Smrg# ----------------------------------
77444dda7b2Smrg# OPTIONS is a space-separated list of Automake options.
77544dda7b2SmrgAC_DEFUN([_AM_SET_OPTIONS],
77644dda7b2Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777ff559fabSmrg
77844dda7b2Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
77944dda7b2Smrg# -------------------------------------------
78044dda7b2Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
78144dda7b2SmrgAC_DEFUN([_AM_IF_OPTION],
78244dda7b2Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783ff559fabSmrg
78444dda7b2Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785ff559fabSmrg
78644dda7b2Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
78744dda7b2Smrg# Free Software Foundation, Inc.
78844dda7b2Smrg#
78944dda7b2Smrg# This file is free software; the Free Software Foundation
79044dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
79144dda7b2Smrg# with or without modifications, as long as this notice is preserved.
792ff559fabSmrg
79344dda7b2Smrg# serial 5
794ff559fabSmrg
79544dda7b2Smrg# AM_SANITY_CHECK
79644dda7b2Smrg# ---------------
79744dda7b2SmrgAC_DEFUN([AM_SANITY_CHECK],
79844dda7b2Smrg[AC_MSG_CHECKING([whether build environment is sane])
79944dda7b2Smrg# Just in case
80044dda7b2Smrgsleep 1
80144dda7b2Smrgecho timestamp > conftest.file
80244dda7b2Smrg# Reject unsafe characters in $srcdir or the absolute working directory
80344dda7b2Smrg# name.  Accept space and tab only in the latter.
80444dda7b2Smrgam_lf='
80544dda7b2Smrg'
80644dda7b2Smrgcase `pwd` in
80744dda7b2Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
80844dda7b2Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
80944dda7b2Smrgesac
81044dda7b2Smrgcase $srcdir in
81144dda7b2Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
81244dda7b2Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
81344dda7b2Smrgesac
8147a3b38f7Smrg
81544dda7b2Smrg# Do `set' in a subshell so we don't clobber the current shell's
81644dda7b2Smrg# arguments.  Must try -L first in case configure is actually a
81744dda7b2Smrg# symlink; some systems play weird games with the mod time of symlinks
81844dda7b2Smrg# (eg FreeBSD returns the mod time of the symlink's containing
81944dda7b2Smrg# directory).
82044dda7b2Smrgif (
82144dda7b2Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
82244dda7b2Smrg   if test "$[*]" = "X"; then
82344dda7b2Smrg      # -L didn't work.
82444dda7b2Smrg      set X `ls -t "$srcdir/configure" conftest.file`
82544dda7b2Smrg   fi
82644dda7b2Smrg   rm -f conftest.file
82744dda7b2Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
82844dda7b2Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8297a3b38f7Smrg
83044dda7b2Smrg      # If neither matched, then we have a broken ls.  This can happen
83144dda7b2Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
83244dda7b2Smrg      # broken ls alias from the environment.  This has actually
83344dda7b2Smrg      # happened.  Such a system could not be considered "sane".
83444dda7b2Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83544dda7b2Smrgalias in your environment])
83644dda7b2Smrg   fi
837ff559fabSmrg
83844dda7b2Smrg   test "$[2]" = conftest.file
83944dda7b2Smrg   )
84044dda7b2Smrgthen
84144dda7b2Smrg   # Ok.
84244dda7b2Smrg   :
84344dda7b2Smrgelse
84444dda7b2Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
84544dda7b2SmrgCheck your system clock])
846ff559fabSmrgfi
84744dda7b2SmrgAC_MSG_RESULT(yes)])
8487a3b38f7Smrg
84944dda7b2Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
85044dda7b2Smrg#
85144dda7b2Smrg# This file is free software; the Free Software Foundation
85244dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
85344dda7b2Smrg# with or without modifications, as long as this notice is preserved.
854ff559fabSmrg
85544dda7b2Smrg# serial 1
856ff559fabSmrg
85744dda7b2Smrg# AM_SILENT_RULES([DEFAULT])
85844dda7b2Smrg# --------------------------
85944dda7b2Smrg# Enable less verbose build rules; with the default set to DEFAULT
86044dda7b2Smrg# (`yes' being less verbose, `no' or empty being verbose).
86144dda7b2SmrgAC_DEFUN([AM_SILENT_RULES],
86244dda7b2Smrg[AC_ARG_ENABLE([silent-rules],
86344dda7b2Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
86444dda7b2Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
86544dda7b2Smrgcase $enable_silent_rules in
86644dda7b2Smrgyes) AM_DEFAULT_VERBOSITY=0;;
86744dda7b2Smrgno)  AM_DEFAULT_VERBOSITY=1;;
86844dda7b2Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
86944dda7b2Smrgesac
87044dda7b2SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
87144dda7b2SmrgAM_BACKSLASH='\'
87244dda7b2SmrgAC_SUBST([AM_BACKSLASH])dnl
87344dda7b2Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
87444dda7b2Smrg])
8757a3b38f7Smrg
87644dda7b2Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877ff559fabSmrg#
87844dda7b2Smrg# This file is free software; the Free Software Foundation
87944dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
88044dda7b2Smrg# with or without modifications, as long as this notice is preserved.
8817a3b38f7Smrg
88244dda7b2Smrg# AM_PROG_INSTALL_STRIP
88344dda7b2Smrg# ---------------------
88444dda7b2Smrg# One issue with vendor `install' (even GNU) is that you can't
88544dda7b2Smrg# specify the program used to strip binaries.  This is especially
88644dda7b2Smrg# annoying in cross-compiling environments, where the build's strip
88744dda7b2Smrg# is unlikely to handle the host's binaries.
88844dda7b2Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
88944dda7b2Smrg# always use install-sh in `make install-strip', and initialize
89044dda7b2Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
89144dda7b2SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
89244dda7b2Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
89344dda7b2Smrg# Installed binaries are usually stripped using `strip' when the user
89444dda7b2Smrg# run `make install-strip'.  However `strip' might not be the right
89544dda7b2Smrg# tool to use in cross-compilation environments, therefore Automake
89644dda7b2Smrg# will honor the `STRIP' environment variable to overrule this program.
89744dda7b2Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
89844dda7b2Smrgif test "$cross_compiling" != no; then
89944dda7b2Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
9007a3b38f7Smrgfi
90144dda7b2SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
90244dda7b2SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903ff559fabSmrg
90444dda7b2Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
90544dda7b2Smrg#
90644dda7b2Smrg# This file is free software; the Free Software Foundation
90744dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
90844dda7b2Smrg# with or without modifications, as long as this notice is preserved.
909ff559fabSmrg
91044dda7b2Smrg# serial 2
911ff559fabSmrg
91244dda7b2Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
91344dda7b2Smrg# ---------------------------
91444dda7b2Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
91544dda7b2Smrg# This macro is traced by Automake.
91644dda7b2SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917ff559fabSmrg
91844dda7b2Smrg# AM_SUBST_NOTMAKE(VARIABLE)
91944dda7b2Smrg# ---------------------------
92044dda7b2Smrg# Public sister of _AM_SUBST_NOTMAKE.
92144dda7b2SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922ff559fabSmrg
92344dda7b2Smrg# Check how to create a tarball.                            -*- Autoconf -*-
924ff559fabSmrg
92544dda7b2Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
92644dda7b2Smrg#
92744dda7b2Smrg# This file is free software; the Free Software Foundation
92844dda7b2Smrg# gives unlimited permission to copy and/or distribute it,
92944dda7b2Smrg# with or without modifications, as long as this notice is preserved.
930ff559fabSmrg
93144dda7b2Smrg# serial 2
932ff559fabSmrg
93344dda7b2Smrg# _AM_PROG_TAR(FORMAT)
93444dda7b2Smrg# --------------------
93544dda7b2Smrg# Check how to create a tarball in format FORMAT.
93644dda7b2Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
93744dda7b2Smrg#
93844dda7b2Smrg# Substitute a variable $(am__tar) that is a command
93944dda7b2Smrg# writing to stdout a FORMAT-tarball containing the directory
94044dda7b2Smrg# $tardir.
94144dda7b2Smrg#     tardir=directory && $(am__tar) > result.tar
94244dda7b2Smrg#
94344dda7b2Smrg# Substitute a variable $(am__untar) that extract such
94444dda7b2Smrg# a tarball read from stdin.
94544dda7b2Smrg#     $(am__untar) < result.tar
94644dda7b2SmrgAC_DEFUN([_AM_PROG_TAR],
94744dda7b2Smrg[# Always define AMTAR for backward compatibility.
94844dda7b2SmrgAM_MISSING_PROG([AMTAR], [tar])
94944dda7b2Smrgm4_if([$1], [v7],
95044dda7b2Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
95144dda7b2Smrg     [m4_case([$1], [ustar],, [pax],,
95244dda7b2Smrg              [m4_fatal([Unknown tar format])])
95344dda7b2SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
95444dda7b2Smrg# Loop over all known methods to create a tar archive until one works.
95544dda7b2Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
95644dda7b2Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
95744dda7b2Smrg# Do not fold the above two line into one, because Tru64 sh and
95844dda7b2Smrg# Solaris sh will not grok spaces in the rhs of `-'.
95944dda7b2Smrgfor _am_tool in $_am_tools
96044dda7b2Smrgdo
96144dda7b2Smrg  case $_am_tool in
96244dda7b2Smrg  gnutar)
96344dda7b2Smrg    for _am_tar in tar gnutar gtar;
96444dda7b2Smrg    do
96544dda7b2Smrg      AM_RUN_LOG([$_am_tar --version]) && break
96644dda7b2Smrg    done
96744dda7b2Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
96844dda7b2Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
96944dda7b2Smrg    am__untar="$_am_tar -xf -"
97044dda7b2Smrg    ;;
97144dda7b2Smrg  plaintar)
97244dda7b2Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
97344dda7b2Smrg    # ustar tarball either.
97444dda7b2Smrg    (tar --version) >/dev/null 2>&1 && continue
97544dda7b2Smrg    am__tar='tar chf - "$$tardir"'
97644dda7b2Smrg    am__tar_='tar chf - "$tardir"'
97744dda7b2Smrg    am__untar='tar xf -'
97844dda7b2Smrg    ;;
97944dda7b2Smrg  pax)
98044dda7b2Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
98144dda7b2Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
98244dda7b2Smrg    am__untar='pax -r'
98344dda7b2Smrg    ;;
98444dda7b2Smrg  cpio)
98544dda7b2Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
98644dda7b2Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
98744dda7b2Smrg    am__untar='cpio -i -H $1 -d'
98844dda7b2Smrg    ;;
98944dda7b2Smrg  none)
99044dda7b2Smrg    am__tar=false
99144dda7b2Smrg    am__tar_=false
99244dda7b2Smrg    am__untar=false
99344dda7b2Smrg    ;;
99444dda7b2Smrg  esac
995ff559fabSmrg
99644dda7b2Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
99744dda7b2Smrg  # and am__untar set.
99844dda7b2Smrg  test -n "${am_cv_prog_tar_$1}" && break
999ff559fabSmrg
100044dda7b2Smrg  # tar/untar a dummy directory, and stop if the command works
100144dda7b2Smrg  rm -rf conftest.dir
100244dda7b2Smrg  mkdir conftest.dir
100344dda7b2Smrg  echo GrepMe > conftest.dir/file
100444dda7b2Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
100544dda7b2Smrg  rm -rf conftest.dir
100644dda7b2Smrg  if test -s conftest.tar; then
100744dda7b2Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
100844dda7b2Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
100944dda7b2Smrg  fi
101044dda7b2Smrgdone
101144dda7b2Smrgrm -rf conftest.dir
1012ff559fabSmrg
101344dda7b2SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
101444dda7b2SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
101544dda7b2SmrgAC_SUBST([am__tar])
101644dda7b2SmrgAC_SUBST([am__untar])
101744dda7b2Smrg]) # _AM_PROG_TAR
10187a3b38f7Smrg
1019862f5301Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1020862f5301Smrg# 
1021862f5301Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
102244dda7b2Smrg#
1023862f5301Smrg# This program is free software; you can redistribute it and/or modify
1024862f5301Smrg# it under the terms of the GNU General Public License as published by
1025862f5301Smrg# the Free Software Foundation; either version 2 of the License, or
1026862f5301Smrg# (at your option) any later version.
102744dda7b2Smrg#
1028862f5301Smrg# This program is distributed in the hope that it will be useful, but
1029862f5301Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1030862f5301Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1031862f5301Smrg# General Public License for more details.
103244dda7b2Smrg#
1033862f5301Smrg# You should have received a copy of the GNU General Public License
1034862f5301Smrg# along with this program; if not, write to the Free Software
1035862f5301Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
103644dda7b2Smrg#
1037862f5301Smrg# As a special exception to the GNU General Public License, if you
1038862f5301Smrg# distribute this file as part of a program that contains a
1039862f5301Smrg# configuration script generated by Autoconf, you may include it under
1040862f5301Smrg# the same distribution terms that you use for the rest of that program.
1041ff559fabSmrg
1042862f5301Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1043862f5301Smrg# ----------------------------------
1044862f5301SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1045862f5301Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1046862f5301Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1047862f5301SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1048862f5301Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1049862f5301Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
105044dda7b2Smrgfi
1051862f5301Smrgif test -n "$PKG_CONFIG"; then
1052862f5301Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
1053862f5301Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1054862f5301Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
105544dda7b2Smrg		AC_MSG_RESULT([yes])
105644dda7b2Smrg	else
1057862f5301Smrg		AC_MSG_RESULT([no])
1058862f5301Smrg		PKG_CONFIG=""
105944dda7b2Smrg	fi
1060862f5301Smrg		
1061862f5301Smrgfi[]dnl
1062862f5301Smrg])# PKG_PROG_PKG_CONFIG
10637a3b38f7Smrg
1064862f5301Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
106544dda7b2Smrg#
1066862f5301Smrg# Check to see whether a particular set of modules exists.  Similar
1067862f5301Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1068862f5301Smrg#
1069862f5301Smrg#
1070862f5301Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1071862f5301Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
1072862f5301Smrg# PKG_CHECK_EXISTS manually
1073862f5301Smrg# --------------------------------------------------------------
1074862f5301SmrgAC_DEFUN([PKG_CHECK_EXISTS],
1075862f5301Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1076862f5301Smrgif test -n "$PKG_CONFIG" && \
1077862f5301Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1078862f5301Smrg  m4_ifval([$2], [$2], [:])
1079862f5301Smrgm4_ifvaln([$3], [else
1080862f5301Smrg  $3])dnl
1081862f5301Smrgfi])
10827a3b38f7Smrg
10837a3b38f7Smrg
1084862f5301Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1085862f5301Smrg# ---------------------------------------------
1086862f5301Smrgm4_define([_PKG_CONFIG],
1087862f5301Smrg[if test -n "$$1"; then
1088862f5301Smrg    pkg_cv_[]$1="$$1"
1089862f5301Smrg elif test -n "$PKG_CONFIG"; then
1090862f5301Smrg    PKG_CHECK_EXISTS([$3],
1091862f5301Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1092862f5301Smrg		     [pkg_failed=yes])
1093862f5301Smrg else
1094862f5301Smrg    pkg_failed=untried
1095862f5301Smrgfi[]dnl
1096862f5301Smrg])# _PKG_CONFIG
10977a3b38f7Smrg
1098862f5301Smrg# _PKG_SHORT_ERRORS_SUPPORTED
1099862f5301Smrg# -----------------------------
1100862f5301SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1101862f5301Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1102862f5301Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1103862f5301Smrg        _pkg_short_errors_supported=yes
1104862f5301Smrgelse
1105862f5301Smrg        _pkg_short_errors_supported=no
1106862f5301Smrgfi[]dnl
1107862f5301Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
11087a3b38f7Smrg
11097a3b38f7Smrg
1110862f5301Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1111862f5301Smrg# [ACTION-IF-NOT-FOUND])
1112862f5301Smrg#
1113862f5301Smrg#
1114862f5301Smrg# Note that if there is a possibility the first call to
1115862f5301Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1116862f5301Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1117862f5301Smrg#
1118862f5301Smrg#
1119862f5301Smrg# --------------------------------------------------------------
1120862f5301SmrgAC_DEFUN([PKG_CHECK_MODULES],
1121862f5301Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1122862f5301SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1123862f5301SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1124ff559fabSmrg
1125862f5301Smrgpkg_failed=no
1126862f5301SmrgAC_MSG_CHECKING([for $1])
1127ff559fabSmrg
1128862f5301Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1129862f5301Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1130ff559fabSmrg
1131862f5301Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1132862f5301Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1133862f5301SmrgSee the pkg-config man page for more details.])
1134ff559fabSmrg
1135862f5301Smrgif test $pkg_failed = yes; then
1136862f5301Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1137862f5301Smrg        if test $_pkg_short_errors_supported = yes; then
1138862f5301Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1139862f5301Smrg        else 
1140862f5301Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1141862f5301Smrg        fi
1142862f5301Smrg	# Put the nasty error message in config.log where it belongs
1143862f5301Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1144ff559fabSmrg
1145862f5301Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1146862f5301Smrg[Package requirements ($2) were not met:
1147ff559fabSmrg
1148862f5301Smrg$$1_PKG_ERRORS
114944dda7b2Smrg
1150862f5301SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1151862f5301Smrginstalled software in a non-standard prefix.
1152ff559fabSmrg
1153862f5301Smrg_PKG_TEXT
1154862f5301Smrg])],
1155862f5301Smrg		[AC_MSG_RESULT([no])
1156862f5301Smrg                $4])
1157862f5301Smrgelif test $pkg_failed = untried; then
1158862f5301Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
1159862f5301Smrg[The pkg-config script could not be found or is too old.  Make sure it
1160862f5301Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1161862f5301Smrgpath to pkg-config.
1162862f5301Smrg
1163862f5301Smrg_PKG_TEXT
1164862f5301Smrg
1165862f5301SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1166862f5301Smrg		[$4])
116744dda7b2Smrgelse
1168862f5301Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1169862f5301Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1170862f5301Smrg        AC_MSG_RESULT([yes])
1171862f5301Smrg	ifelse([$3], , :, [$3])
1172862f5301Smrgfi[]dnl
1173862f5301Smrg])# PKG_CHECK_MODULES
1174ff559fabSmrg
1175862f5301Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1176862f5301Smrg#
1177862f5301Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1178862f5301Smrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
1179862f5301Smrg#                 Inc.
1180862f5301Smrg#   Written by Gordon Matzigkeit, 1996
1181862f5301Smrg#
1182862f5301Smrg# This file is free software; the Free Software Foundation gives
1183862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
1184862f5301Smrg# modifications, as long as this notice is preserved.
1185ff559fabSmrg
1186862f5301Smrgm4_define([_LT_COPYING], [dnl
1187862f5301Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1188862f5301Smrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
1189862f5301Smrg#                 Inc.
1190862f5301Smrg#   Written by Gordon Matzigkeit, 1996
119144dda7b2Smrg#
1192862f5301Smrg#   This file is part of GNU Libtool.
1193862f5301Smrg#
1194862f5301Smrg# GNU Libtool is free software; you can redistribute it and/or
1195862f5301Smrg# modify it under the terms of the GNU General Public License as
1196862f5301Smrg# published by the Free Software Foundation; either version 2 of
1197862f5301Smrg# the License, or (at your option) any later version.
1198862f5301Smrg#
1199862f5301Smrg# As a special exception to the GNU General Public License,
1200862f5301Smrg# if you distribute this file as part of a program or library that
1201862f5301Smrg# is built using GNU Libtool, you may include this file under the
1202862f5301Smrg# same distribution terms that you use for the rest of that program.
1203862f5301Smrg#
1204862f5301Smrg# GNU Libtool is distributed in the hope that it will be useful,
1205862f5301Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
1206862f5301Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1207862f5301Smrg# GNU General Public License for more details.
1208862f5301Smrg#
1209862f5301Smrg# You should have received a copy of the GNU General Public License
1210862f5301Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
1211862f5301Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1212862f5301Smrg# obtained by writing to the Free Software Foundation, Inc.,
1213862f5301Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1214862f5301Smrg])
12157a3b38f7Smrg
1216862f5301Smrg# serial 57 LT_INIT
1217ff559fabSmrg
1218ff559fabSmrg
1219862f5301Smrg# LT_PREREQ(VERSION)
1220862f5301Smrg# ------------------
1221862f5301Smrg# Complain and exit if this libtool version is less that VERSION.
1222862f5301Smrgm4_defun([LT_PREREQ],
1223862f5301Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1224862f5301Smrg       [m4_default([$3],
1225862f5301Smrg		   [m4_fatal([Libtool version $1 or higher is required],
1226862f5301Smrg		             63)])],
1227862f5301Smrg       [$2])])
1228ff559fabSmrg
1229ff559fabSmrg
1230862f5301Smrg# _LT_CHECK_BUILDDIR
1231862f5301Smrg# ------------------
1232862f5301Smrg# Complain if the absolute build directory name contains unusual characters
1233862f5301Smrgm4_defun([_LT_CHECK_BUILDDIR],
1234862f5301Smrg[case `pwd` in
1235862f5301Smrg  *\ * | *\	*)
1236862f5301Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1237862f5301Smrgesac
1238862f5301Smrg])
1239ff559fabSmrg
1240ff559fabSmrg
1241862f5301Smrg# LT_INIT([OPTIONS])
1242862f5301Smrg# ------------------
1243862f5301SmrgAC_DEFUN([LT_INIT],
1244862f5301Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1245862f5301SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1246862f5301SmrgAC_BEFORE([$0], [LT_LANG])dnl
1247862f5301SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
1248862f5301SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
1249862f5301Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
1250ff559fabSmrg
1251862f5301Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
1252862f5301Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1253862f5301Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1254862f5301Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1255862f5301Smrgdnl unless we require an AC_DEFUNed macro:
1256862f5301SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
1257862f5301SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
1258862f5301SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
1259862f5301SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1260862f5301Smrgm4_require([_LT_PROG_LTMAIN])dnl
1261ff559fabSmrg
1262862f5301Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1263ff559fabSmrg
1264862f5301Smrgdnl Parse OPTIONS
1265862f5301Smrg_LT_SET_OPTIONS([$0], [$1])
1266ff559fabSmrg
1267862f5301Smrg# This can be used to rebuild libtool when needed
1268862f5301SmrgLIBTOOL_DEPS="$ltmain"
1269ff559fabSmrg
1270862f5301Smrg# Always use our own libtool.
1271862f5301SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1272862f5301SmrgAC_SUBST(LIBTOOL)dnl
1273ff559fabSmrg
1274862f5301Smrg_LT_SETUP
1275ff559fabSmrg
1276862f5301Smrg# Only expand once:
1277862f5301Smrgm4_define([LT_INIT])
1278862f5301Smrg])# LT_INIT
1279ff559fabSmrg
1280862f5301Smrg# Old names:
1281862f5301SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1282862f5301SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1283862f5301Smrgdnl aclocal-1.4 backwards compatibility:
1284862f5301Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1285862f5301Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1286ff559fabSmrg
1287ff559fabSmrg
1288862f5301Smrg# _LT_CC_BASENAME(CC)
1289862f5301Smrg# -------------------
1290862f5301Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1291862f5301Smrgm4_defun([_LT_CC_BASENAME],
1292862f5301Smrg[for cc_temp in $1""; do
1293862f5301Smrg  case $cc_temp in
1294862f5301Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1295862f5301Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1296862f5301Smrg    \-*) ;;
1297862f5301Smrg    *) break;;
1298862f5301Smrg  esac
1299862f5301Smrgdone
1300862f5301Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1301862f5301Smrg])
1302ff559fabSmrg
1303ff559fabSmrg
1304862f5301Smrg# _LT_FILEUTILS_DEFAULTS
1305862f5301Smrg# ----------------------
1306862f5301Smrg# It is okay to use these file commands and assume they have been set
1307862f5301Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1308862f5301Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1309862f5301Smrg[: ${CP="cp -f"}
1310862f5301Smrg: ${MV="mv -f"}
1311862f5301Smrg: ${RM="rm -f"}
1312862f5301Smrg])# _LT_FILEUTILS_DEFAULTS
1313ff559fabSmrg
1314ff559fabSmrg
1315862f5301Smrg# _LT_SETUP
1316862f5301Smrg# ---------
1317862f5301Smrgm4_defun([_LT_SETUP],
1318862f5301Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1319862f5301SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1320862f5301SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1321862f5301SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
132244dda7b2Smrg
1323862f5301Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1324862f5301Smrg_LT_DECL([], [host], [0])dnl
1325862f5301Smrg_LT_DECL([], [host_os], [0])dnl
1326862f5301Smrgdnl
1327862f5301Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1328862f5301Smrg_LT_DECL([], [build], [0])dnl
1329862f5301Smrg_LT_DECL([], [build_os], [0])dnl
1330862f5301Smrgdnl
1331862f5301SmrgAC_REQUIRE([AC_PROG_CC])dnl
1332862f5301SmrgAC_REQUIRE([LT_PATH_LD])dnl
1333862f5301SmrgAC_REQUIRE([LT_PATH_NM])dnl
1334862f5301Smrgdnl
1335862f5301SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1336862f5301Smrgtest -z "$LN_S" && LN_S="ln -s"
1337862f5301Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1338862f5301Smrgdnl
1339862f5301SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1340862f5301Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1341862f5301Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1342862f5301Smrgdnl
1343862f5301Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1344862f5301Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
1345862f5301Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1346862f5301Smrgm4_require([_LT_CMD_RELOAD])dnl
1347862f5301Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
1348862f5301Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1349862f5301Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
1350862f5301Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1351862f5301Smrgm4_require([_LT_WITH_SYSROOT])dnl
1352862f5301Smrg
1353862f5301Smrg_LT_CONFIG_LIBTOOL_INIT([
1354862f5301Smrg# See if we are running on zsh, and set the options which allow our
1355862f5301Smrg# commands through without removal of \ escapes INIT.
1356862f5301Smrgif test -n "\${ZSH_VERSION+set}" ; then
1357862f5301Smrg   setopt NO_GLOB_SUBST
1358862f5301Smrgfi
1359862f5301Smrg])
1360862f5301Smrgif test -n "${ZSH_VERSION+set}" ; then
1361862f5301Smrg   setopt NO_GLOB_SUBST
136244dda7b2Smrgfi
1363ff559fabSmrg
1364862f5301Smrg_LT_CHECK_OBJDIR
1365ff559fabSmrg
1366862f5301Smrgm4_require([_LT_TAG_COMPILER])dnl
136744dda7b2Smrg
1368862f5301Smrgcase $host_os in
1369862f5301Smrgaix3*)
1370862f5301Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
1371862f5301Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
1372862f5301Smrg  # vanish in a puff of smoke.
1373862f5301Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
1374862f5301Smrg    COLLECT_NAMES=
1375862f5301Smrg    export COLLECT_NAMES
1376862f5301Smrg  fi
1377862f5301Smrg  ;;
1378862f5301Smrgesac
137944dda7b2Smrg
1380862f5301Smrg# Global variables:
1381862f5301Smrgofile=libtool
1382862f5301Smrgcan_build_shared=yes
1383ff559fabSmrg
1384862f5301Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
1385862f5301Smrg# which needs '.lib').
1386862f5301Smrglibext=a
138744dda7b2Smrg
1388862f5301Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1389ff559fabSmrg
1390862f5301Smrgold_CC="$CC"
1391862f5301Smrgold_CFLAGS="$CFLAGS"
139244dda7b2Smrg
1393862f5301Smrg# Set sane defaults for various variables
1394862f5301Smrgtest -z "$CC" && CC=cc
1395862f5301Smrgtest -z "$LTCC" && LTCC=$CC
1396862f5301Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1397862f5301Smrgtest -z "$LD" && LD=ld
1398862f5301Smrgtest -z "$ac_objext" && ac_objext=o
1399ff559fabSmrg
1400862f5301Smrg_LT_CC_BASENAME([$compiler])
1401ff559fabSmrg
1402862f5301Smrg# Only perform the check for file, if the check method requires it
1403862f5301Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
1404862f5301Smrgcase $deplibs_check_method in
1405862f5301Smrgfile_magic*)
1406862f5301Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1407862f5301Smrg    _LT_PATH_MAGIC
1408862f5301Smrg  fi
1409862f5301Smrg  ;;
1410862f5301Smrgesac
1411ff559fabSmrg
1412862f5301Smrg# Use C for the default configuration in the libtool script
1413862f5301SmrgLT_SUPPORTED_TAG([CC])
1414862f5301Smrg_LT_LANG_C_CONFIG
1415862f5301Smrg_LT_LANG_DEFAULT_CONFIG
1416862f5301Smrg_LT_CONFIG_COMMANDS
1417862f5301Smrg])# _LT_SETUP
1418ff559fabSmrg
141944dda7b2Smrg
1420862f5301Smrg# _LT_PREPARE_SED_QUOTE_VARS
1421862f5301Smrg# --------------------------
1422862f5301Smrg# Define a few sed substitution that help us do robust quoting.
1423862f5301Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1424862f5301Smrg[# Backslashify metacharacters that are still active within
1425862f5301Smrg# double-quoted strings.
1426862f5301Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1427ff559fabSmrg
1428862f5301Smrg# Same as above, but do not quote variable references.
1429862f5301Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
143044dda7b2Smrg
1431862f5301Smrg# Sed substitution to delay expansion of an escaped shell variable in a
1432862f5301Smrg# double_quote_subst'ed string.
1433862f5301Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1434ff559fabSmrg
1435862f5301Smrg# Sed substitution to delay expansion of an escaped single quote.
1436862f5301Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
143744dda7b2Smrg
1438862f5301Smrg# Sed substitution to avoid accidental globbing in evaled expressions
1439862f5301Smrgno_glob_subst='s/\*/\\\*/g'
1440862f5301Smrg])
144144dda7b2Smrg
1442862f5301Smrg# _LT_PROG_LTMAIN
1443862f5301Smrg# ---------------
1444862f5301Smrg# Note that this code is called both from `configure', and `config.status'
1445862f5301Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1446862f5301Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
1447862f5301Smrg# so we pass a copy along to make sure it has a sensible value anyway.
1448862f5301Smrgm4_defun([_LT_PROG_LTMAIN],
1449862f5301Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1450862f5301Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1451862f5301Smrgltmain="$ac_aux_dir/ltmain.sh"
1452862f5301Smrg])# _LT_PROG_LTMAIN
1453ff559fabSmrg
1454ff559fabSmrg
1455ff559fabSmrg
1456862f5301Smrg# So that we can recreate a full libtool script including additional
1457862f5301Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1458862f5301Smrg# in macros and then make a single call at the end using the `libtool'
1459862f5301Smrg# label.
1460ff559fabSmrg
1461ff559fabSmrg
1462862f5301Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1463862f5301Smrg# ----------------------------------------
1464862f5301Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1465862f5301Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
1466862f5301Smrg[m4_ifval([$1],
1467862f5301Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1468862f5301Smrg                     [$1
1469862f5301Smrg])])])
1470ff559fabSmrg
1471862f5301Smrg# Initialize.
1472862f5301Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
1473ff559fabSmrg
1474ff559fabSmrg
1475862f5301Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
1476862f5301Smrg# ------------------------------
1477862f5301Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1478862f5301Smrgm4_define([_LT_CONFIG_LIBTOOL],
1479862f5301Smrg[m4_ifval([$1],
1480862f5301Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1481862f5301Smrg                     [$1
1482862f5301Smrg])])])
1483ff559fabSmrg
1484862f5301Smrg# Initialize.
1485862f5301Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1486ff559fabSmrg
1487ff559fabSmrg
1488862f5301Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1489862f5301Smrg# -----------------------------------------------------
1490862f5301Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
1491862f5301Smrg[_LT_CONFIG_LIBTOOL([$1])
1492862f5301Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
1493862f5301Smrg])
1494ff559fabSmrg
1495ff559fabSmrg
1496862f5301Smrg# _LT_FORMAT_COMMENT([COMMENT])
1497862f5301Smrg# -----------------------------
1498862f5301Smrg# Add leading comment marks to the start of each line, and a trailing
1499862f5301Smrg# full-stop to the whole comment if one is not present already.
1500862f5301Smrgm4_define([_LT_FORMAT_COMMENT],
1501862f5301Smrg[m4_ifval([$1], [
1502862f5301Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1503862f5301Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1504862f5301Smrg)])
1505ff559fabSmrg
1506ff559fabSmrg
1507ff559fabSmrg
1508ff559fabSmrg
1509ff559fabSmrg
1510862f5301Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1511862f5301Smrg# -------------------------------------------------------------------
1512862f5301Smrg# CONFIGNAME is the name given to the value in the libtool script.
1513862f5301Smrg# VARNAME is the (base) name used in the configure script.
1514862f5301Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1515862f5301Smrg# VARNAME.  Any other value will be used directly.
1516862f5301Smrgm4_define([_LT_DECL],
1517862f5301Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1518862f5301Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1519862f5301Smrg	[m4_ifval([$1], [$1], [$2])])
1520862f5301Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1521862f5301Smrg    m4_ifval([$4],
1522862f5301Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1523862f5301Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
1524862f5301Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
1525862f5301Smrg])
1526ff559fabSmrg
1527ff559fabSmrg
1528862f5301Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1529862f5301Smrg# --------------------------------------------------------
1530862f5301Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1531ff559fabSmrg
1532ff559fabSmrg
1533862f5301Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1534862f5301Smrg# ------------------------------------------------
1535862f5301Smrgm4_define([lt_decl_tag_varnames],
1536862f5301Smrg[_lt_decl_filter([tagged?], [yes], $@)])
1537862f5301Smrg
1538862f5301Smrg
1539862f5301Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1540862f5301Smrg# ---------------------------------------------------------
1541862f5301Smrgm4_define([_lt_decl_filter],
1542862f5301Smrg[m4_case([$#],
1543862f5301Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
1544862f5301Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1545862f5301Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1546862f5301Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1547862f5301Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
154844dda7b2Smrg])
1549ff559fabSmrg
1550ff559fabSmrg
1551862f5301Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1552862f5301Smrg# --------------------------------------------------
1553862f5301Smrgm4_define([lt_decl_quote_varnames],
1554862f5301Smrg[_lt_decl_filter([value], [1], $@)])
15557a3b38f7Smrg
1556ff559fabSmrg
1557862f5301Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1558862f5301Smrg# ---------------------------------------------------
1559862f5301Smrgm4_define([lt_decl_dquote_varnames],
1560862f5301Smrg[_lt_decl_filter([value], [2], $@)])
1561ff559fabSmrg
1562ff559fabSmrg
1563862f5301Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1564862f5301Smrg# ---------------------------------------------------
1565862f5301Smrgm4_define([lt_decl_varnames_tagged],
1566862f5301Smrg[m4_assert([$# <= 2])dnl
1567862f5301Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
1568862f5301Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1569862f5301Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1570862f5301Smrgm4_define([_lt_decl_varnames_tagged],
1571862f5301Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
15727a3b38f7Smrg
15737a3b38f7Smrg
1574862f5301Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1575862f5301Smrg# ------------------------------------------------
1576862f5301Smrgm4_define([lt_decl_all_varnames],
1577862f5301Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
1578862f5301Smrg     m4_if([$2], [],
1579862f5301Smrg	   m4_quote(lt_decl_varnames),
1580862f5301Smrg	m4_quote(m4_shift($@))))[]dnl
1581862f5301Smrg])
1582862f5301Smrgm4_define([_lt_decl_all_varnames],
1583862f5301Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
1584862f5301Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1585862f5301Smrg])
15867a3b38f7Smrg
15877a3b38f7Smrg
1588862f5301Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1589862f5301Smrg# ------------------------------------
1590862f5301Smrg# Quote a variable value, and forward it to `config.status' so that its
1591862f5301Smrg# declaration there will have the same value as in `configure'.  VARNAME
1592862f5301Smrg# must have a single quote delimited value for this to work.
1593862f5301Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
1594862f5301Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1595ff559fabSmrg
15967a3b38f7Smrg
1597862f5301Smrg# _LT_CONFIG_STATUS_DECLARATIONS
1598862f5301Smrg# ------------------------------
1599862f5301Smrg# We delimit libtool config variables with single quotes, so when
1600862f5301Smrg# we write them to config.status, we have to be sure to quote all
1601862f5301Smrg# embedded single quotes properly.  In configure, this macro expands
1602862f5301Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1603862f5301Smrg#
1604862f5301Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1605862f5301Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1606862f5301Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1607862f5301Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
16087a3b38f7Smrg
160944dda7b2Smrg
1610862f5301Smrg# _LT_LIBTOOL_TAGS
1611862f5301Smrg# ----------------
1612862f5301Smrg# Output comment and list of tags supported by the script
1613862f5301Smrgm4_defun([_LT_LIBTOOL_TAGS],
1614862f5301Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1615862f5301Smrgavailable_tags="_LT_TAGS"dnl
1616862f5301Smrg])
1617ff559fabSmrg
1618ff559fabSmrg
1619862f5301Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1620862f5301Smrg# -----------------------------------
1621862f5301Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
1622862f5301Smrg# expand to a commented shell variable setting:
162344dda7b2Smrg#
1624862f5301Smrg#    # Some comment about what VAR is for.
1625862f5301Smrg#    visible_name=$lt_internal_name
1626862f5301Smrgm4_define([_LT_LIBTOOL_DECLARE],
1627862f5301Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1628862f5301Smrg					   [description])))[]dnl
1629862f5301Smrgm4_pushdef([_libtool_name],
1630862f5301Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1631862f5301Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1632862f5301Smrg    [0], [_libtool_name=[$]$1],
1633862f5301Smrg    [1], [_libtool_name=$lt_[]$1],
1634862f5301Smrg    [2], [_libtool_name=$lt_[]$1],
1635862f5301Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1636862f5301Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
163744dda7b2Smrg])
1638ff559fabSmrg
1639ff559fabSmrg
1640862f5301Smrg# _LT_LIBTOOL_CONFIG_VARS
1641862f5301Smrg# -----------------------
1642862f5301Smrg# Produce commented declarations of non-tagged libtool config variables
1643862f5301Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1644862f5301Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1645862f5301Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
1646862f5301Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
1647862f5301Smrg[m4_foreach([_lt_var],
1648862f5301Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1649862f5301Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1650ff559fabSmrg
1651ff559fabSmrg
1652862f5301Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
1653862f5301Smrg# -------------------------
1654862f5301Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
1655862f5301Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1656862f5301Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1657ff559fabSmrg
1658ff559fabSmrg
1659862f5301Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
1660862f5301Smrg# ------------------------------
1661862f5301Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1662ff559fabSmrg
1663ff559fabSmrg
1664862f5301Smrg# _LT_CONFIG_COMMANDS
1665862f5301Smrg# -------------------
1666862f5301Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1667862f5301Smrg# variables for single and double quote escaping we saved from calls
1668862f5301Smrg# to _LT_DECL, we can put quote escaped variables declarations
1669862f5301Smrg# into `config.status', and then the shell code to quote escape them in
1670862f5301Smrg# for loops in `config.status'.  Finally, any additional code accumulated
1671862f5301Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1672862f5301Smrgm4_defun([_LT_CONFIG_COMMANDS],
1673862f5301Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
1674862f5301Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
1675862f5301Smrg	dnl instead of duplicating it all over again into config.status,
1676862f5301Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
1677862f5301Smrg	dnl needs to know what name is stored there:
1678862f5301Smrg        [AC_CONFIG_COMMANDS([libtool],
1679862f5301Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1680862f5301Smrg    dnl If the libtool generation code is destined for config.status,
1681862f5301Smrg    dnl expand the accumulated commands and init code now:
1682862f5301Smrg    [AC_CONFIG_COMMANDS([libtool],
1683862f5301Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1684862f5301Smrg])#_LT_CONFIG_COMMANDS
1685ff559fabSmrg
1686ff559fabSmrg
1687862f5301Smrg# Initialize.
1688862f5301Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1689862f5301Smrg[
169044dda7b2Smrg
1691862f5301Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
1692862f5301Smrg# if CDPATH is set.
1693862f5301Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
169444dda7b2Smrg
1695862f5301Smrgsed_quote_subst='$sed_quote_subst'
1696862f5301Smrgdouble_quote_subst='$double_quote_subst'
1697862f5301Smrgdelay_variable_subst='$delay_variable_subst'
1698862f5301Smrg_LT_CONFIG_STATUS_DECLARATIONS
1699862f5301SmrgLTCC='$LTCC'
1700862f5301SmrgLTCFLAGS='$LTCFLAGS'
1701862f5301Smrgcompiler='$compiler_DEFAULT'
170244dda7b2Smrg
1703862f5301Smrg# A function that is used when there is no print builtin or printf.
1704862f5301Smrgfunc_fallback_echo ()
1705862f5301Smrg{
1706862f5301Smrg  eval 'cat <<_LTECHO_EOF
1707862f5301Smrg\$[]1
1708862f5301Smrg_LTECHO_EOF'
1709862f5301Smrg}
171044dda7b2Smrg
1711862f5301Smrg# Quote evaled strings.
1712862f5301Smrgfor var in lt_decl_all_varnames([[ \
1713862f5301Smrg]], lt_decl_quote_varnames); do
1714862f5301Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1715862f5301Smrg    *[[\\\\\\\`\\"\\\$]]*)
1716862f5301Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1717862f5301Smrg      ;;
1718862f5301Smrg    *)
1719862f5301Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1720862f5301Smrg      ;;
1721862f5301Smrg    esac
172244dda7b2Smrgdone
1723ff559fabSmrg
1724862f5301Smrg# Double-quote double-evaled strings.
1725862f5301Smrgfor var in lt_decl_all_varnames([[ \
1726862f5301Smrg]], lt_decl_dquote_varnames); do
1727862f5301Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1728862f5301Smrg    *[[\\\\\\\`\\"\\\$]]*)
1729862f5301Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1730862f5301Smrg      ;;
1731862f5301Smrg    *)
1732862f5301Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1733862f5301Smrg      ;;
1734862f5301Smrg    esac
1735862f5301Smrgdone
1736ff559fabSmrg
1737862f5301Smrg_LT_OUTPUT_LIBTOOL_INIT
1738862f5301Smrg])
17397a3b38f7Smrg
1740862f5301Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1741862f5301Smrg# ------------------------------------
1742862f5301Smrg# Generate a child script FILE with all initialization necessary to
1743862f5301Smrg# reuse the environment learned by the parent script, and make the
1744862f5301Smrg# file executable.  If COMMENT is supplied, it is inserted after the
1745862f5301Smrg# `#!' sequence but before initialization text begins.  After this
1746862f5301Smrg# macro, additional text can be appended to FILE to form the body of
1747862f5301Smrg# the child script.  The macro ends with non-zero status if the
1748862f5301Smrg# file could not be fully written (such as if the disk is full).
1749862f5301Smrgm4_ifdef([AS_INIT_GENERATED],
1750862f5301Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1751862f5301Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
1752862f5301Smrg[m4_require([AS_PREPARE])]dnl
1753862f5301Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1754862f5301Smrg[lt_write_fail=0
1755862f5301Smrgcat >$1 <<_ASEOF || lt_write_fail=1
1756862f5301Smrg#! $SHELL
1757862f5301Smrg# Generated by $as_me.
1758862f5301Smrg$2
1759862f5301SmrgSHELL=\${CONFIG_SHELL-$SHELL}
1760862f5301Smrgexport SHELL
1761862f5301Smrg_ASEOF
1762862f5301Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
1763862f5301SmrgAS_SHELL_SANITIZE
1764862f5301Smrg_AS_PREPARE
1765862f5301Smrgexec AS_MESSAGE_FD>&1
1766862f5301Smrg_ASEOF
1767862f5301Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
1768862f5301Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
17697a3b38f7Smrg
1770862f5301Smrg# LT_OUTPUT
177144dda7b2Smrg# ---------
1772862f5301Smrg# This macro allows early generation of the libtool script (before
1773862f5301Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
1774862f5301Smrg# tests.
1775862f5301SmrgAC_DEFUN([LT_OUTPUT],
1776862f5301Smrg[: ${CONFIG_LT=./config.lt}
1777862f5301SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
1778862f5301Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1779862f5301Smrg[# Run this file to recreate a libtool stub with the current configuration.])
1780ff559fabSmrg
1781862f5301Smrgcat >>"$CONFIG_LT" <<\_LTEOF
1782862f5301Smrglt_cl_silent=false
1783862f5301Smrgexec AS_MESSAGE_LOG_FD>>config.log
1784862f5301Smrg{
1785862f5301Smrg  echo
1786862f5301Smrg  AS_BOX([Running $as_me.])
1787862f5301Smrg} >&AS_MESSAGE_LOG_FD
1788ff559fabSmrg
1789862f5301Smrglt_cl_help="\
1790862f5301Smrg\`$as_me' creates a local libtool stub from the current configuration,
1791862f5301Smrgfor use in further configure time tests before the real libtool is
1792862f5301Smrggenerated.
1793ff559fabSmrg
1794862f5301SmrgUsage: $[0] [[OPTIONS]]
1795ff559fabSmrg
1796862f5301Smrg  -h, --help      print this help, then exit
1797862f5301Smrg  -V, --version   print version number, then exit
1798862f5301Smrg  -q, --quiet     do not print progress messages
1799862f5301Smrg  -d, --debug     don't remove temporary files
1800ff559fabSmrg
1801862f5301SmrgReport bugs to <bug-libtool@gnu.org>."
1802ff559fabSmrg
1803862f5301Smrglt_cl_version="\
1804862f5301Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1805862f5301Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1806862f5301Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
1807ff559fabSmrg
1808862f5301SmrgCopyright (C) 2010 Free Software Foundation, Inc.
1809862f5301SmrgThis config.lt script is free software; the Free Software Foundation
1810862f5301Smrggives unlimited permision to copy, distribute and modify it."
1811ff559fabSmrg
1812862f5301Smrgwhile test $[#] != 0
1813862f5301Smrgdo
1814862f5301Smrg  case $[1] in
1815862f5301Smrg    --version | --v* | -V )
1816862f5301Smrg      echo "$lt_cl_version"; exit 0 ;;
1817862f5301Smrg    --help | --h* | -h )
1818862f5301Smrg      echo "$lt_cl_help"; exit 0 ;;
1819862f5301Smrg    --debug | --d* | -d )
1820862f5301Smrg      debug=: ;;
1821862f5301Smrg    --quiet | --q* | --silent | --s* | -q )
1822862f5301Smrg      lt_cl_silent=: ;;
1823ff559fabSmrg
1824862f5301Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
1825862f5301SmrgTry \`$[0] --help' for more information.]) ;;
1826ff559fabSmrg
1827862f5301Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
1828862f5301SmrgTry \`$[0] --help' for more information.]) ;;
1829862f5301Smrg  esac
1830862f5301Smrg  shift
1831862f5301Smrgdone
1832ff559fabSmrg
1833862f5301Smrgif $lt_cl_silent; then
1834862f5301Smrg  exec AS_MESSAGE_FD>/dev/null
1835862f5301Smrgfi
1836862f5301Smrg_LTEOF
1837ff559fabSmrg
1838862f5301Smrgcat >>"$CONFIG_LT" <<_LTEOF
1839862f5301Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1840862f5301Smrg_LTEOF
1841ff559fabSmrg
1842862f5301Smrgcat >>"$CONFIG_LT" <<\_LTEOF
1843862f5301SmrgAC_MSG_NOTICE([creating $ofile])
1844862f5301Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
1845862f5301SmrgAS_EXIT(0)
1846862f5301Smrg_LTEOF
1847862f5301Smrgchmod +x "$CONFIG_LT"
1848ff559fabSmrg
1849862f5301Smrg# configure is writing to config.log, but config.lt does its own redirection,
1850862f5301Smrg# appending to config.log, which fails on DOS, as config.log is still kept
1851862f5301Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
1852862f5301Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
1853862f5301Smrglt_cl_success=:
1854862f5301Smrgtest "$silent" = yes &&
1855862f5301Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
1856862f5301Smrgexec AS_MESSAGE_LOG_FD>/dev/null
1857862f5301Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1858862f5301Smrgexec AS_MESSAGE_LOG_FD>>config.log
1859862f5301Smrg$lt_cl_success || AS_EXIT(1)
1860862f5301Smrg])# LT_OUTPUT
1861ff559fabSmrg
1862ff559fabSmrg
1863862f5301Smrg# _LT_CONFIG(TAG)
186444dda7b2Smrg# ---------------
1865862f5301Smrg# If TAG is the built-in tag, create an initial libtool script with a
1866862f5301Smrg# default configuration from the untagged config vars.  Otherwise add code
1867862f5301Smrg# to config.status for appending the configuration named by TAG from the
1868862f5301Smrg# matching tagged config vars.
1869862f5301Smrgm4_defun([_LT_CONFIG],
1870862f5301Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1871862f5301Smrg_LT_CONFIG_SAVE_COMMANDS([
1872862f5301Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1873862f5301Smrg  m4_if(_LT_TAG, [C], [
1874862f5301Smrg    # See if we are running on zsh, and set the options which allow our
1875862f5301Smrg    # commands through without removal of \ escapes.
1876862f5301Smrg    if test -n "${ZSH_VERSION+set}" ; then
1877862f5301Smrg      setopt NO_GLOB_SUBST
1878862f5301Smrg    fi
1879ff559fabSmrg
1880862f5301Smrg    cfgfile="${ofile}T"
1881862f5301Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1882862f5301Smrg    $RM "$cfgfile"
1883ff559fabSmrg
1884862f5301Smrg    cat <<_LT_EOF >> "$cfgfile"
1885862f5301Smrg#! $SHELL
18867a3b38f7Smrg
1887862f5301Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1888862f5301Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1889862f5301Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1890862f5301Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1891862f5301Smrg#
1892862f5301Smrg_LT_COPYING
1893862f5301Smrg_LT_LIBTOOL_TAGS
1894ff559fabSmrg
1895862f5301Smrg# ### BEGIN LIBTOOL CONFIG
1896862f5301Smrg_LT_LIBTOOL_CONFIG_VARS
1897862f5301Smrg_LT_LIBTOOL_TAG_VARS
1898862f5301Smrg# ### END LIBTOOL CONFIG
1899ff559fabSmrg
1900862f5301Smrg_LT_EOF
1901ff559fabSmrg
1902862f5301Smrg  case $host_os in
1903862f5301Smrg  aix3*)
1904862f5301Smrg    cat <<\_LT_EOF >> "$cfgfile"
1905862f5301Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
1906862f5301Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
1907862f5301Smrg# vanish in a puff of smoke.
1908862f5301Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
1909862f5301Smrg  COLLECT_NAMES=
1910862f5301Smrg  export COLLECT_NAMES
1911862f5301Smrgfi
1912862f5301Smrg_LT_EOF
1913862f5301Smrg    ;;
1914862f5301Smrg  esac
1915ff559fabSmrg
1916862f5301Smrg  _LT_PROG_LTMAIN
1917ff559fabSmrg
1918862f5301Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
1919862f5301Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1920862f5301Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
1921862f5301Smrg  # is reportedly fixed, but why not run on old versions too?
1922862f5301Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
1923862f5301Smrg     || (rm -f "$cfgfile"; exit 1)
1924ff559fabSmrg
1925862f5301Smrg  _LT_PROG_REPLACE_SHELLFNS
1926ff559fabSmrg
1927862f5301Smrg   mv -f "$cfgfile" "$ofile" ||
1928862f5301Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1929862f5301Smrg  chmod +x "$ofile"
1930862f5301Smrg],
1931862f5301Smrg[cat <<_LT_EOF >> "$ofile"
1932ff559fabSmrg
1933862f5301Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1934862f5301Smrgdnl in a comment (ie after a #).
1935862f5301Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
1936862f5301Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1937862f5301Smrg# ### END LIBTOOL TAG CONFIG: $1
1938862f5301Smrg_LT_EOF
1939862f5301Smrg])dnl /m4_if
1940862f5301Smrg],
1941862f5301Smrg[m4_if([$1], [], [
1942862f5301Smrg    PACKAGE='$PACKAGE'
1943862f5301Smrg    VERSION='$VERSION'
1944862f5301Smrg    TIMESTAMP='$TIMESTAMP'
1945862f5301Smrg    RM='$RM'
1946862f5301Smrg    ofile='$ofile'], [])
1947862f5301Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
1948862f5301Smrg])# _LT_CONFIG
1949ff559fabSmrg
1950ff559fabSmrg
1951862f5301Smrg# LT_SUPPORTED_TAG(TAG)
1952862f5301Smrg# ---------------------
1953862f5301Smrg# Trace this macro to discover what tags are supported by the libtool
1954862f5301Smrg# --tag option, using:
1955862f5301Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1956862f5301SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
1957ff559fabSmrg
19587a3b38f7Smrg
1959862f5301Smrg# C support is built-in for now
1960862f5301Smrgm4_define([_LT_LANG_C_enabled], [])
1961862f5301Smrgm4_define([_LT_TAGS], [])
19627a3b38f7Smrg
1963ff559fabSmrg
1964862f5301Smrg# LT_LANG(LANG)
1965862f5301Smrg# -------------
1966862f5301Smrg# Enable libtool support for the given language if not already enabled.
1967862f5301SmrgAC_DEFUN([LT_LANG],
1968862f5301Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
1969862f5301Smrgm4_case([$1],
1970862f5301Smrg  [C],			[_LT_LANG(C)],
1971862f5301Smrg  [C++],		[_LT_LANG(CXX)],
1972862f5301Smrg  [Java],		[_LT_LANG(GCJ)],
1973862f5301Smrg  [Fortran 77],		[_LT_LANG(F77)],
1974862f5301Smrg  [Fortran],		[_LT_LANG(FC)],
1975862f5301Smrg  [Windows Resource],	[_LT_LANG(RC)],
1976862f5301Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1977862f5301Smrg    [_LT_LANG($1)],
1978862f5301Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1979862f5301Smrg])# LT_LANG
1980ff559fabSmrg
19817a3b38f7Smrg
1982862f5301Smrg# _LT_LANG(LANGNAME)
1983862f5301Smrg# ------------------
1984862f5301Smrgm4_defun([_LT_LANG],
1985862f5301Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1986862f5301Smrg  [LT_SUPPORTED_TAG([$1])dnl
1987862f5301Smrg  m4_append([_LT_TAGS], [$1 ])dnl
1988862f5301Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1989862f5301Smrg  _LT_LANG_$1_CONFIG($1)])dnl
1990862f5301Smrg])# _LT_LANG
19917a3b38f7Smrg
1992ff559fabSmrg
1993862f5301Smrg# _LT_LANG_DEFAULT_CONFIG
1994862f5301Smrg# -----------------------
1995862f5301Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
1996862f5301Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1997862f5301Smrg  [LT_LANG(CXX)],
1998862f5301Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
19997a3b38f7Smrg
2000862f5301SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
2001862f5301Smrg  [LT_LANG(F77)],
2002862f5301Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
20037a3b38f7Smrg
2004862f5301SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
2005862f5301Smrg  [LT_LANG(FC)],
2006862f5301Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
20077a3b38f7Smrg
2008862f5301Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
2009862f5301Smrgdnl pulling things in needlessly.
2010862f5301SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
2011862f5301Smrg  [LT_LANG(GCJ)],
2012862f5301Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
2013862f5301Smrg    [LT_LANG(GCJ)],
2014862f5301Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
2015862f5301Smrg      [LT_LANG(GCJ)],
2016862f5301Smrg      [m4_ifdef([AC_PROG_GCJ],
2017862f5301Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
2018862f5301Smrg       m4_ifdef([A][M_PROG_GCJ],
2019862f5301Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
2020862f5301Smrg       m4_ifdef([LT_PROG_GCJ],
2021862f5301Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
2022ff559fabSmrg
2023862f5301SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
2024862f5301Smrg  [LT_LANG(RC)],
2025862f5301Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
2026862f5301Smrg])# _LT_LANG_DEFAULT_CONFIG
2027ff559fabSmrg
2028862f5301Smrg# Obsolete macros:
2029862f5301SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
2030862f5301SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
2031862f5301SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
2032862f5301SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
2033862f5301SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
2034862f5301Smrgdnl aclocal-1.4 backwards compatibility:
2035862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
2036862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
2037862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
2038862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
2039862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
2040ff559fabSmrg
2041ff559fabSmrg
2042862f5301Smrg# _LT_TAG_COMPILER
204344dda7b2Smrg# ----------------
2044862f5301Smrgm4_defun([_LT_TAG_COMPILER],
2045862f5301Smrg[AC_REQUIRE([AC_PROG_CC])dnl
2046ff559fabSmrg
2047862f5301Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
2048862f5301Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
2049862f5301Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
2050862f5301Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
2051ff559fabSmrg
2052862f5301Smrg# If no C compiler was specified, use CC.
2053862f5301SmrgLTCC=${LTCC-"$CC"}
2054ff559fabSmrg
2055862f5301Smrg# If no C compiler flags were specified, use CFLAGS.
2056862f5301SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2057ff559fabSmrg
2058862f5301Smrg# Allow CC to be a program name with arguments.
2059862f5301Smrgcompiler=$CC
2060862f5301Smrg])# _LT_TAG_COMPILER
2061ff559fabSmrg
2062ff559fabSmrg
2063862f5301Smrg# _LT_COMPILER_BOILERPLATE
2064862f5301Smrg# ------------------------
2065862f5301Smrg# Check for compiler boilerplate output or warnings with
2066862f5301Smrg# the simple compiler test code.
2067862f5301Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
2068862f5301Smrg[m4_require([_LT_DECL_SED])dnl
2069862f5301Smrgac_outfile=conftest.$ac_objext
2070862f5301Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
2071862f5301Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2072862f5301Smrg_lt_compiler_boilerplate=`cat conftest.err`
2073862f5301Smrg$RM conftest*
2074862f5301Smrg])# _LT_COMPILER_BOILERPLATE
2075ff559fabSmrg
2076ff559fabSmrg
2077862f5301Smrg# _LT_LINKER_BOILERPLATE
2078862f5301Smrg# ----------------------
2079862f5301Smrg# Check for linker boilerplate output or warnings with
2080862f5301Smrg# the simple link test code.
2081862f5301Smrgm4_defun([_LT_LINKER_BOILERPLATE],
2082862f5301Smrg[m4_require([_LT_DECL_SED])dnl
2083862f5301Smrgac_outfile=conftest.$ac_objext
2084862f5301Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
2085862f5301Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2086862f5301Smrg_lt_linker_boilerplate=`cat conftest.err`
2087862f5301Smrg$RM -r conftest*
2088862f5301Smrg])# _LT_LINKER_BOILERPLATE
2089ff559fabSmrg
2090862f5301Smrg# _LT_REQUIRED_DARWIN_CHECKS
2091862f5301Smrg# -------------------------
2092862f5301Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
2093862f5301Smrg  case $host_os in
2094862f5301Smrg    rhapsody* | darwin*)
2095862f5301Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
2096862f5301Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
2097862f5301Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
2098862f5301Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
2099862f5301Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
2100862f5301Smrg    _LT_DECL([], [DSYMUTIL], [1],
2101862f5301Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
2102862f5301Smrg    _LT_DECL([], [NMEDIT], [1],
2103862f5301Smrg      [Tool to change global to local symbols on Mac OS X])
2104862f5301Smrg    _LT_DECL([], [LIPO], [1],
2105862f5301Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
2106862f5301Smrg    _LT_DECL([], [OTOOL], [1],
2107862f5301Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2108862f5301Smrg    _LT_DECL([], [OTOOL64], [1],
2109862f5301Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2110ff559fabSmrg
2111862f5301Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2112862f5301Smrg      [lt_cv_apple_cc_single_mod=no
2113862f5301Smrg      if test -z "${LT_MULTI_MODULE}"; then
2114862f5301Smrg	# By default we will add the -single_module flag. You can override
2115862f5301Smrg	# by either setting the environment variable LT_MULTI_MODULE
2116862f5301Smrg	# non-empty at configure time, or by adding -multi_module to the
2117862f5301Smrg	# link flags.
2118862f5301Smrg	rm -rf libconftest.dylib*
2119862f5301Smrg	echo "int foo(void){return 1;}" > conftest.c
2120862f5301Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2121862f5301Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2122862f5301Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2123862f5301Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2124862f5301Smrg        _lt_result=$?
2125862f5301Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
2126862f5301Smrg	  lt_cv_apple_cc_single_mod=yes
2127862f5301Smrg	else
2128862f5301Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
2129862f5301Smrg	fi
2130862f5301Smrg	rm -rf libconftest.dylib*
2131862f5301Smrg	rm -f conftest.*
2132862f5301Smrg      fi])
2133862f5301Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2134862f5301Smrg      [lt_cv_ld_exported_symbols_list],
2135862f5301Smrg      [lt_cv_ld_exported_symbols_list=no
2136862f5301Smrg      save_LDFLAGS=$LDFLAGS
2137862f5301Smrg      echo "_main" > conftest.sym
2138862f5301Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2139862f5301Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2140862f5301Smrg	[lt_cv_ld_exported_symbols_list=yes],
2141862f5301Smrg	[lt_cv_ld_exported_symbols_list=no])
2142862f5301Smrg	LDFLAGS="$save_LDFLAGS"
2143862f5301Smrg    ])
2144862f5301Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2145862f5301Smrg      [lt_cv_ld_force_load=no
2146862f5301Smrg      cat > conftest.c << _LT_EOF
2147862f5301Smrgint forced_loaded() { return 2;}
2148862f5301Smrg_LT_EOF
2149862f5301Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2150862f5301Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2151862f5301Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2152862f5301Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2153862f5301Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2154862f5301Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2155862f5301Smrg      cat > conftest.c << _LT_EOF
2156862f5301Smrgint main() { return 0;}
2157862f5301Smrg_LT_EOF
2158862f5301Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2159862f5301Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2160862f5301Smrg      _lt_result=$?
2161862f5301Smrg      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
2162862f5301Smrg	lt_cv_ld_force_load=yes
2163862f5301Smrg      else
2164862f5301Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
2165862f5301Smrg      fi
2166862f5301Smrg        rm -f conftest.err libconftest.a conftest conftest.c
2167862f5301Smrg        rm -rf conftest.dSYM
2168862f5301Smrg    ])
2169862f5301Smrg    case $host_os in
2170862f5301Smrg    rhapsody* | darwin1.[[012]])
2171862f5301Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2172862f5301Smrg    darwin1.*)
2173862f5301Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2174862f5301Smrg    darwin*) # darwin 5.x on
2175862f5301Smrg      # if running on 10.5 or later, the deployment target defaults
2176862f5301Smrg      # to the OS version, if on x86, and 10.4, the deployment
2177862f5301Smrg      # target defaults to 10.4. Don't you love it?
2178862f5301Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2179862f5301Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2180862f5301Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2181862f5301Smrg	10.[[012]]*)
2182862f5301Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2183862f5301Smrg	10.*)
2184862f5301Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2185862f5301Smrg      esac
2186862f5301Smrg    ;;
2187862f5301Smrg  esac
2188862f5301Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2189862f5301Smrg      _lt_dar_single_mod='$single_module'
2190862f5301Smrg    fi
2191862f5301Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2192862f5301Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2193862f5301Smrg    else
2194862f5301Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2195862f5301Smrg    fi
2196862f5301Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2197862f5301Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
2198862f5301Smrg    else
2199862f5301Smrg      _lt_dsymutil=
2200862f5301Smrg    fi
2201862f5301Smrg    ;;
2202862f5301Smrg  esac
2203862f5301Smrg])
2204ff559fabSmrg
2205ff559fabSmrg
2206862f5301Smrg# _LT_DARWIN_LINKER_FEATURES
2207862f5301Smrg# --------------------------
2208862f5301Smrg# Checks for linker and compiler features on darwin
2209862f5301Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
2210862f5301Smrg[
2211862f5301Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2212862f5301Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2213862f5301Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
2214862f5301Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
2215862f5301Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2216862f5301Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
2217862f5301Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
2218862f5301Smrg  else
2219862f5301Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2220862f5301Smrg  fi
2221862f5301Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
2222862f5301Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2223862f5301Smrg  case $cc_basename in
2224862f5301Smrg     ifort*) _lt_dar_can_shared=yes ;;
2225862f5301Smrg     *) _lt_dar_can_shared=$GCC ;;
2226862f5301Smrg  esac
2227862f5301Smrg  if test "$_lt_dar_can_shared" = "yes"; then
2228862f5301Smrg    output_verbose_link_cmd=func_echo_all
2229862f5301Smrg    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
2230862f5301Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2231862f5301Smrg    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
2232862f5301Smrg    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
2233862f5301Smrg    m4_if([$1], [CXX],
2234862f5301Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2235862f5301Smrg      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
2236862f5301Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
2237862f5301Smrg    fi
2238862f5301Smrg],[])
2239862f5301Smrg  else
2240862f5301Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
2241862f5301Smrg  fi
22427a3b38f7Smrg])
2243ff559fabSmrg
2244862f5301Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2245862f5301Smrg# ----------------------------------
2246862f5301Smrg# Links a minimal program and checks the executable
2247862f5301Smrg# for the system default hardcoded library path. In most cases,
2248862f5301Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
2249862f5301Smrg# the location of the communication and MPI libs are included too.
2250862f5301Smrg# If we don't find anything, use the default library path according
2251862f5301Smrg# to the aix ld manual.
2252862f5301Smrg# Store the results from the different compilers for each TAGNAME.
2253862f5301Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
2254862f5301Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
2255862f5301Smrg[m4_require([_LT_DECL_SED])dnl
2256862f5301Smrgif test "${lt_cv_aix_libpath+set}" = set; then
2257862f5301Smrg  aix_libpath=$lt_cv_aix_libpath
2258862f5301Smrgelse
2259862f5301Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2260862f5301Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2261862f5301Smrg  lt_aix_libpath_sed='[
2262862f5301Smrg      /Import File Strings/,/^$/ {
2263862f5301Smrg	  /^0/ {
2264862f5301Smrg	      s/^0  *\([^ ]*\) *$/\1/
2265862f5301Smrg	      p
2266862f5301Smrg	  }
2267862f5301Smrg      }]'
2268862f5301Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2269862f5301Smrg  # Check for a 64-bit object if we didn't find anything.
2270862f5301Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2271862f5301Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2272862f5301Smrg  fi],[])
2273862f5301Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2274862f5301Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2275862f5301Smrg  fi
2276862f5301Smrg  ])
2277862f5301Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2278862f5301Smrgfi
2279862f5301Smrg])# _LT_SYS_MODULE_PATH_AIX
2280ff559fabSmrg
2281ff559fabSmrg
2282862f5301Smrg# _LT_SHELL_INIT(ARG)
2283862f5301Smrg# -------------------
2284862f5301Smrgm4_define([_LT_SHELL_INIT],
2285862f5301Smrg[m4_divert_text([M4SH-INIT], [$1
2286862f5301Smrg])])# _LT_SHELL_INIT
22877a3b38f7Smrg
2288ff559fabSmrg
2289ff559fabSmrg
2290862f5301Smrg# _LT_PROG_ECHO_BACKSLASH
2291862f5301Smrg# -----------------------
2292862f5301Smrg# Find how we can fake an echo command that does not interpret backslash.
2293862f5301Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
2294862f5301Smrg# of the generated configure script which will find a shell with a builtin
2295862f5301Smrg# printf (which we can use as an echo command).
2296862f5301Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
2297862f5301Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2298862f5301SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2299862f5301SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2300ff559fabSmrg
2301862f5301SmrgAC_MSG_CHECKING([how to print strings])
2302862f5301Smrg# Test print first, because it will be a builtin if present.
2303862f5301Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2304862f5301Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2305862f5301Smrg  ECHO='print -r --'
2306862f5301Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2307862f5301Smrg  ECHO='printf %s\n'
2308862f5301Smrgelse
2309862f5301Smrg  # Use this function as a fallback that always works.
2310862f5301Smrg  func_fallback_echo ()
2311862f5301Smrg  {
2312862f5301Smrg    eval 'cat <<_LTECHO_EOF
2313862f5301Smrg$[]1
2314862f5301Smrg_LTECHO_EOF'
2315862f5301Smrg  }
2316862f5301Smrg  ECHO='func_fallback_echo'
2317862f5301Smrgfi
2318ff559fabSmrg
2319862f5301Smrg# func_echo_all arg...
2320862f5301Smrg# Invoke $ECHO with all args, space-separated.
2321862f5301Smrgfunc_echo_all ()
2322862f5301Smrg{
2323862f5301Smrg    $ECHO "$*" 
2324862f5301Smrg}
2325ff559fabSmrg
2326862f5301Smrgcase "$ECHO" in
2327862f5301Smrg  printf*) AC_MSG_RESULT([printf]) ;;
2328862f5301Smrg  print*) AC_MSG_RESULT([print -r]) ;;
2329862f5301Smrg  *) AC_MSG_RESULT([cat]) ;;
2330862f5301Smrgesac
2331ff559fabSmrg
2332862f5301Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
2333862f5301Smrg[_AS_DETECT_SUGGESTED([
2334862f5301Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2335862f5301Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2336862f5301Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2337862f5301Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2338862f5301Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
2339862f5301Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
2340862f5301Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2341ff559fabSmrg
2342862f5301Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2343862f5301Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2344862f5301Smrg])# _LT_PROG_ECHO_BACKSLASH
2345ff559fabSmrg
2346ff559fabSmrg
2347862f5301Smrg# _LT_WITH_SYSROOT
2348862f5301Smrg# ----------------
2349862f5301SmrgAC_DEFUN([_LT_WITH_SYSROOT],
2350862f5301Smrg[AC_MSG_CHECKING([for sysroot])
2351862f5301SmrgAC_ARG_WITH([sysroot],
2352862f5301Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2353862f5301Smrg                        (or the compiler's sysroot if not specified).],
2354862f5301Smrg[], [with_sysroot=no])
2355862f5301Smrg
2356862f5301Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
2357862f5301Smrgdnl in case the user passed a directory name.
2358862f5301Smrglt_sysroot=
2359862f5301Smrgcase ${with_sysroot} in #(
2360862f5301Smrg yes)
2361862f5301Smrg   if test "$GCC" = yes; then
2362862f5301Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2363862f5301Smrg   fi
2364862f5301Smrg   ;; #(
2365862f5301Smrg /*)
2366862f5301Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2367862f5301Smrg   ;; #(
2368862f5301Smrg no|'')
2369862f5301Smrg   ;; #(
2370862f5301Smrg *)
2371862f5301Smrg   AC_MSG_RESULT([${with_sysroot}])
2372862f5301Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
2373862f5301Smrg   ;;
2374862f5301Smrgesac
2375ff559fabSmrg
2376862f5301Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
2377862f5301Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2378862f5301Smrg[dependent libraries, and in which our libraries should be installed.])])
2379ff559fabSmrg
2380862f5301Smrg# _LT_ENABLE_LOCK
2381862f5301Smrg# ---------------
2382862f5301Smrgm4_defun([_LT_ENABLE_LOCK],
2383862f5301Smrg[AC_ARG_ENABLE([libtool-lock],
2384862f5301Smrg  [AS_HELP_STRING([--disable-libtool-lock],
2385862f5301Smrg    [avoid locking (might break parallel builds)])])
2386862f5301Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2387ff559fabSmrg
2388862f5301Smrg# Some flags need to be propagated to the compiler or linker for good
2389862f5301Smrg# libtool support.
2390862f5301Smrgcase $host in
2391862f5301Smrgia64-*-hpux*)
2392862f5301Smrg  # Find out which ABI we are using.
2393862f5301Smrg  echo 'int i;' > conftest.$ac_ext
2394862f5301Smrg  if AC_TRY_EVAL(ac_compile); then
2395862f5301Smrg    case `/usr/bin/file conftest.$ac_objext` in
2396862f5301Smrg      *ELF-32*)
2397862f5301Smrg	HPUX_IA64_MODE="32"
2398862f5301Smrg	;;
2399862f5301Smrg      *ELF-64*)
2400862f5301Smrg	HPUX_IA64_MODE="64"
2401862f5301Smrg	;;
2402862f5301Smrg    esac
2403862f5301Smrg  fi
2404862f5301Smrg  rm -rf conftest*
2405862f5301Smrg  ;;
2406862f5301Smrg*-*-irix6*)
2407862f5301Smrg  # Find out which ABI we are using.
2408862f5301Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2409862f5301Smrg  if AC_TRY_EVAL(ac_compile); then
2410862f5301Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
2411862f5301Smrg      case `/usr/bin/file conftest.$ac_objext` in
2412862f5301Smrg	*32-bit*)
2413862f5301Smrg	  LD="${LD-ld} -melf32bsmip"
2414862f5301Smrg	  ;;
2415862f5301Smrg	*N32*)
2416862f5301Smrg	  LD="${LD-ld} -melf32bmipn32"
2417862f5301Smrg	  ;;
2418862f5301Smrg	*64-bit*)
2419862f5301Smrg	  LD="${LD-ld} -melf64bmip"
2420862f5301Smrg	;;
2421862f5301Smrg      esac
2422862f5301Smrg    else
2423862f5301Smrg      case `/usr/bin/file conftest.$ac_objext` in
2424862f5301Smrg	*32-bit*)
2425862f5301Smrg	  LD="${LD-ld} -32"
2426862f5301Smrg	  ;;
2427862f5301Smrg	*N32*)
2428862f5301Smrg	  LD="${LD-ld} -n32"
2429862f5301Smrg	  ;;
2430862f5301Smrg	*64-bit*)
2431862f5301Smrg	  LD="${LD-ld} -64"
2432862f5301Smrg	  ;;
2433862f5301Smrg      esac
2434862f5301Smrg    fi
2435862f5301Smrg  fi
2436862f5301Smrg  rm -rf conftest*
2437862f5301Smrg  ;;
2438ff559fabSmrg
2439862f5301Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2440862f5301Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2441862f5301Smrg  # Find out which ABI we are using.
2442862f5301Smrg  echo 'int i;' > conftest.$ac_ext
2443862f5301Smrg  if AC_TRY_EVAL(ac_compile); then
2444862f5301Smrg    case `/usr/bin/file conftest.o` in
2445862f5301Smrg      *32-bit*)
2446862f5301Smrg	case $host in
2447862f5301Smrg	  x86_64-*kfreebsd*-gnu)
2448862f5301Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
2449862f5301Smrg	    ;;
2450862f5301Smrg	  x86_64-*linux*)
2451862f5301Smrg	    LD="${LD-ld} -m elf_i386"
2452862f5301Smrg	    ;;
2453862f5301Smrg	  ppc64-*linux*|powerpc64-*linux*)
2454862f5301Smrg	    LD="${LD-ld} -m elf32ppclinux"
2455862f5301Smrg	    ;;
2456862f5301Smrg	  s390x-*linux*)
2457862f5301Smrg	    LD="${LD-ld} -m elf_s390"
2458862f5301Smrg	    ;;
2459862f5301Smrg	  sparc64-*linux*)
2460862f5301Smrg	    LD="${LD-ld} -m elf32_sparc"
2461862f5301Smrg	    ;;
2462862f5301Smrg	esac
2463862f5301Smrg	;;
2464862f5301Smrg      *64-bit*)
2465862f5301Smrg	case $host in
2466862f5301Smrg	  x86_64-*kfreebsd*-gnu)
2467862f5301Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
2468862f5301Smrg	    ;;
2469862f5301Smrg	  x86_64-*linux*)
2470862f5301Smrg	    LD="${LD-ld} -m elf_x86_64"
2471862f5301Smrg	    ;;
2472862f5301Smrg	  ppc*-*linux*|powerpc*-*linux*)
2473862f5301Smrg	    LD="${LD-ld} -m elf64ppc"
2474862f5301Smrg	    ;;
2475862f5301Smrg	  s390*-*linux*|s390*-*tpf*)
2476862f5301Smrg	    LD="${LD-ld} -m elf64_s390"
2477862f5301Smrg	    ;;
2478862f5301Smrg	  sparc*-*linux*)
2479862f5301Smrg	    LD="${LD-ld} -m elf64_sparc"
2480862f5301Smrg	    ;;
2481862f5301Smrg	esac
2482862f5301Smrg	;;
2483862f5301Smrg    esac
2484862f5301Smrg  fi
2485862f5301Smrg  rm -rf conftest*
2486862f5301Smrg  ;;
2487ff559fabSmrg
2488862f5301Smrg*-*-sco3.2v5*)
2489862f5301Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2490862f5301Smrg  SAVE_CFLAGS="$CFLAGS"
2491862f5301Smrg  CFLAGS="$CFLAGS -belf"
2492862f5301Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2493862f5301Smrg    [AC_LANG_PUSH(C)
2494862f5301Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2495862f5301Smrg     AC_LANG_POP])
2496862f5301Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2497862f5301Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2498862f5301Smrg    CFLAGS="$SAVE_CFLAGS"
2499862f5301Smrg  fi
2500862f5301Smrg  ;;
2501862f5301Smrgsparc*-*solaris*)
2502862f5301Smrg  # Find out which ABI we are using.
2503862f5301Smrg  echo 'int i;' > conftest.$ac_ext
2504862f5301Smrg  if AC_TRY_EVAL(ac_compile); then
2505862f5301Smrg    case `/usr/bin/file conftest.o` in
2506862f5301Smrg    *64-bit*)
2507862f5301Smrg      case $lt_cv_prog_gnu_ld in
2508862f5301Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
2509862f5301Smrg      *)
2510862f5301Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2511862f5301Smrg	  LD="${LD-ld} -64"
2512862f5301Smrg	fi
2513862f5301Smrg	;;
2514862f5301Smrg      esac
2515862f5301Smrg      ;;
2516862f5301Smrg    esac
2517862f5301Smrg  fi
2518862f5301Smrg  rm -rf conftest*
2519862f5301Smrg  ;;
2520862f5301Smrgesac
2521ff559fabSmrg
2522862f5301Smrgneed_locks="$enable_libtool_lock"
2523862f5301Smrg])# _LT_ENABLE_LOCK
2524ff559fabSmrg
2525ff559fabSmrg
2526862f5301Smrg# _LT_PROG_AR
2527862f5301Smrg# -----------
2528862f5301Smrgm4_defun([_LT_PROG_AR],
2529862f5301Smrg[AC_CHECK_TOOLS(AR, [ar], false)
2530862f5301Smrg: ${AR=ar}
2531862f5301Smrg: ${AR_FLAGS=cru}
2532862f5301Smrg_LT_DECL([], [AR], [1], [The archiver])
2533862f5301Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2534862f5301Smrg
2535862f5301SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2536862f5301Smrg  [lt_cv_ar_at_file=no
2537862f5301Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2538862f5301Smrg     [echo conftest.$ac_objext > conftest.lst
2539862f5301Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2540862f5301Smrg      AC_TRY_EVAL([lt_ar_try])
2541862f5301Smrg      if test "$ac_status" -eq 0; then
2542862f5301Smrg	# Ensure the archiver fails upon bogus file names.
2543862f5301Smrg	rm -f conftest.$ac_objext libconftest.a
2544862f5301Smrg	AC_TRY_EVAL([lt_ar_try])
2545862f5301Smrg	if test "$ac_status" -ne 0; then
2546862f5301Smrg          lt_cv_ar_at_file=@
2547862f5301Smrg        fi
2548862f5301Smrg      fi
2549862f5301Smrg      rm -f conftest.* libconftest.a
2550862f5301Smrg     ])
2551862f5301Smrg  ])
2552ff559fabSmrg
2553862f5301Smrgif test "x$lt_cv_ar_at_file" = xno; then
2554862f5301Smrg  archiver_list_spec=
2555862f5301Smrgelse
2556862f5301Smrg  archiver_list_spec=$lt_cv_ar_at_file
2557862f5301Smrgfi
2558862f5301Smrg_LT_DECL([], [archiver_list_spec], [1],
2559862f5301Smrg  [How to feed a file listing to the archiver])
2560862f5301Smrg])# _LT_PROG_AR
2561ff559fabSmrg
2562ff559fabSmrg
2563862f5301Smrg# _LT_CMD_OLD_ARCHIVE
2564862f5301Smrg# -------------------
2565862f5301Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
2566862f5301Smrg[_LT_PROG_AR
2567ff559fabSmrg
2568862f5301SmrgAC_CHECK_TOOL(STRIP, strip, :)
2569862f5301Smrgtest -z "$STRIP" && STRIP=:
2570862f5301Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2571ff559fabSmrg
2572862f5301SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
2573862f5301Smrgtest -z "$RANLIB" && RANLIB=:
2574862f5301Smrg_LT_DECL([], [RANLIB], [1],
2575862f5301Smrg    [Commands used to install an old-style archive])
2576ff559fabSmrg
2577862f5301Smrg# Determine commands to create old-style static archives.
2578862f5301Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2579862f5301Smrgold_postinstall_cmds='chmod 644 $oldlib'
2580862f5301Smrgold_postuninstall_cmds=
2581ff559fabSmrg
2582862f5301Smrgif test -n "$RANLIB"; then
2583862f5301Smrg  case $host_os in
2584862f5301Smrg  openbsd*)
2585862f5301Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
2586862f5301Smrg    ;;
2587862f5301Smrg  *)
2588862f5301Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
2589862f5301Smrg    ;;
2590862f5301Smrg  esac
2591862f5301Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
2592862f5301Smrgfi
2593ff559fabSmrg
2594862f5301Smrgcase $host_os in
2595862f5301Smrg  darwin*)
2596862f5301Smrg    lock_old_archive_extraction=yes ;;
2597862f5301Smrg  *)
2598862f5301Smrg    lock_old_archive_extraction=no ;;
2599862f5301Smrgesac
2600862f5301Smrg_LT_DECL([], [old_postinstall_cmds], [2])
2601862f5301Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
2602862f5301Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
2603862f5301Smrg    [Commands used to build an old-style archive])
2604862f5301Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
2605862f5301Smrg    [Whether to use a lock for old archive extraction])
2606862f5301Smrg])# _LT_CMD_OLD_ARCHIVE
2607ff559fabSmrg
2608ff559fabSmrg
2609862f5301Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2610862f5301Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2611862f5301Smrg# ----------------------------------------------------------------
2612862f5301Smrg# Check whether the given compiler option works
2613862f5301SmrgAC_DEFUN([_LT_COMPILER_OPTION],
2614862f5301Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2615862f5301Smrgm4_require([_LT_DECL_SED])dnl
2616862f5301SmrgAC_CACHE_CHECK([$1], [$2],
2617862f5301Smrg  [$2=no
2618862f5301Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2619862f5301Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2620862f5301Smrg   lt_compiler_flag="$3"
2621862f5301Smrg   # Insert the option either (1) after the last *FLAGS variable, or
2622862f5301Smrg   # (2) before a word containing "conftest.", or (3) at the end.
2623862f5301Smrg   # Note that $ac_compile itself does not contain backslashes and begins
2624862f5301Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2625862f5301Smrg   # The option is referenced via a variable to avoid confusing sed.
2626862f5301Smrg   lt_compile=`echo "$ac_compile" | $SED \
2627862f5301Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2628862f5301Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2629862f5301Smrg   -e 's:$: $lt_compiler_flag:'`
2630862f5301Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2631862f5301Smrg   (eval "$lt_compile" 2>conftest.err)
2632862f5301Smrg   ac_status=$?
2633862f5301Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
2634862f5301Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2635862f5301Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
2636862f5301Smrg     # The compiler can only warn and ignore the option if not recognized
2637862f5301Smrg     # So say no if there are warnings other than the usual output.
2638862f5301Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2639862f5301Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2640862f5301Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2641862f5301Smrg       $2=yes
2642862f5301Smrg     fi
2643862f5301Smrg   fi
2644862f5301Smrg   $RM conftest*
2645862f5301Smrg])
2646ff559fabSmrg
2647862f5301Smrgif test x"[$]$2" = xyes; then
2648862f5301Smrg    m4_if([$5], , :, [$5])
2649862f5301Smrgelse
2650862f5301Smrg    m4_if([$6], , :, [$6])
2651862f5301Smrgfi
2652862f5301Smrg])# _LT_COMPILER_OPTION
2653ff559fabSmrg
2654862f5301Smrg# Old name:
2655862f5301SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2656862f5301Smrgdnl aclocal-1.4 backwards compatibility:
2657862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2658ff559fabSmrg
2659ff559fabSmrg
2660862f5301Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2661862f5301Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2662862f5301Smrg# ----------------------------------------------------
2663862f5301Smrg# Check whether the given linker option works
2664862f5301SmrgAC_DEFUN([_LT_LINKER_OPTION],
2665862f5301Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2666862f5301Smrgm4_require([_LT_DECL_SED])dnl
2667862f5301SmrgAC_CACHE_CHECK([$1], [$2],
2668862f5301Smrg  [$2=no
2669862f5301Smrg   save_LDFLAGS="$LDFLAGS"
2670862f5301Smrg   LDFLAGS="$LDFLAGS $3"
2671862f5301Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2672862f5301Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2673862f5301Smrg     # The linker can only warn and ignore the option if not recognized
2674862f5301Smrg     # So say no if there are warnings
2675862f5301Smrg     if test -s conftest.err; then
2676862f5301Smrg       # Append any errors to the config.log.
2677862f5301Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2678862f5301Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2679862f5301Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2680862f5301Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
2681862f5301Smrg         $2=yes
2682862f5301Smrg       fi
2683862f5301Smrg     else
2684862f5301Smrg       $2=yes
2685862f5301Smrg     fi
2686862f5301Smrg   fi
2687862f5301Smrg   $RM -r conftest*
2688862f5301Smrg   LDFLAGS="$save_LDFLAGS"
2689862f5301Smrg])
2690ff559fabSmrg
2691862f5301Smrgif test x"[$]$2" = xyes; then
2692862f5301Smrg    m4_if([$4], , :, [$4])
2693862f5301Smrgelse
2694862f5301Smrg    m4_if([$5], , :, [$5])
2695862f5301Smrgfi
2696862f5301Smrg])# _LT_LINKER_OPTION
2697ff559fabSmrg
2698862f5301Smrg# Old name:
2699862f5301SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2700862f5301Smrgdnl aclocal-1.4 backwards compatibility:
2701862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2702ff559fabSmrg
2703ff559fabSmrg
2704862f5301Smrg# LT_CMD_MAX_LEN
2705862f5301Smrg#---------------
2706862f5301SmrgAC_DEFUN([LT_CMD_MAX_LEN],
2707862f5301Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2708862f5301Smrg# find the maximum length of command line arguments
2709862f5301SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
2710862f5301SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2711862f5301Smrg  i=0
2712862f5301Smrg  teststring="ABCD"
2713ff559fabSmrg
2714862f5301Smrg  case $build_os in
2715862f5301Smrg  msdosdjgpp*)
2716862f5301Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
2717862f5301Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
2718862f5301Smrg    # during glob expansion).  Even if it were fixed, the result of this
2719862f5301Smrg    # check would be larger than it should be.
2720862f5301Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2721862f5301Smrg    ;;
2722ff559fabSmrg
2723862f5301Smrg  gnu*)
2724862f5301Smrg    # Under GNU Hurd, this test is not required because there is
2725862f5301Smrg    # no limit to the length of command line arguments.
2726862f5301Smrg    # Libtool will interpret -1 as no limit whatsoever
2727862f5301Smrg    lt_cv_sys_max_cmd_len=-1;
2728862f5301Smrg    ;;
272944dda7b2Smrg
2730862f5301Smrg  cygwin* | mingw* | cegcc*)
2731862f5301Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
2732862f5301Smrg    # about 5 minutes as the teststring grows exponentially.
2733862f5301Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
2734862f5301Smrg    # you end up with a "frozen" computer, even though with patience
2735862f5301Smrg    # the test eventually succeeds (with a max line length of 256k).
2736862f5301Smrg    # Instead, let's just punt: use the minimum linelength reported by
2737862f5301Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
2738862f5301Smrg    lt_cv_sys_max_cmd_len=8192;
2739862f5301Smrg    ;;
274044dda7b2Smrg
2741862f5301Smrg  mint*)
2742862f5301Smrg    # On MiNT this can take a long time and run out of memory.
2743862f5301Smrg    lt_cv_sys_max_cmd_len=8192;
2744862f5301Smrg    ;;
274544dda7b2Smrg
2746862f5301Smrg  amigaos*)
2747862f5301Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
2748862f5301Smrg    # So we just punt and use a minimum line length of 8192.
2749862f5301Smrg    lt_cv_sys_max_cmd_len=8192;
2750862f5301Smrg    ;;
275144dda7b2Smrg
2752862f5301Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2753862f5301Smrg    # This has been around since 386BSD, at least.  Likely further.
2754862f5301Smrg    if test -x /sbin/sysctl; then
2755862f5301Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2756862f5301Smrg    elif test -x /usr/sbin/sysctl; then
2757862f5301Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2758862f5301Smrg    else
2759862f5301Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2760862f5301Smrg    fi
2761862f5301Smrg    # And add a safety zone
2762862f5301Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2763862f5301Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2764862f5301Smrg    ;;
276544dda7b2Smrg
2766862f5301Smrg  interix*)
2767862f5301Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2768862f5301Smrg    lt_cv_sys_max_cmd_len=196608
2769862f5301Smrg    ;;
277044dda7b2Smrg
2771862f5301Smrg  osf*)
2772862f5301Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2773862f5301Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2774862f5301Smrg    # nice to cause kernel panics so lets avoid the loop below.
2775862f5301Smrg    # First set a reasonable default.
2776862f5301Smrg    lt_cv_sys_max_cmd_len=16384
2777862f5301Smrg    #
2778862f5301Smrg    if test -x /sbin/sysconfig; then
2779862f5301Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2780862f5301Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
278144dda7b2Smrg      esac
278244dda7b2Smrg    fi
2783862f5301Smrg    ;;
2784862f5301Smrg  sco3.2v5*)
2785862f5301Smrg    lt_cv_sys_max_cmd_len=102400
2786862f5301Smrg    ;;
2787862f5301Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
2788862f5301Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2789862f5301Smrg    if test -n "$kargmax"; then
2790862f5301Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
279144dda7b2Smrg    else
2792862f5301Smrg      lt_cv_sys_max_cmd_len=32768
279344dda7b2Smrg    fi
2794862f5301Smrg    ;;
2795862f5301Smrg  *)
2796862f5301Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2797862f5301Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
2798862f5301Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2799862f5301Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
280044dda7b2Smrg    else
2801862f5301Smrg      # Make teststring a little bigger before we do anything with it.
2802862f5301Smrg      # a 1K string should be a reasonable start.
2803862f5301Smrg      for i in 1 2 3 4 5 6 7 8 ; do
2804862f5301Smrg        teststring=$teststring$teststring
2805862f5301Smrg      done
2806862f5301Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2807862f5301Smrg      # If test is not a shell built-in, we'll probably end up computing a
2808862f5301Smrg      # maximum length that is only half of the actual maximum length, but
2809862f5301Smrg      # we can't tell.
2810862f5301Smrg      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
2811862f5301Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2812862f5301Smrg	      test $i != 17 # 1/2 MB should be enough
2813862f5301Smrg      do
2814862f5301Smrg        i=`expr $i + 1`
2815862f5301Smrg        teststring=$teststring$teststring
2816862f5301Smrg      done
2817862f5301Smrg      # Only check the string length outside the loop.
2818862f5301Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2819862f5301Smrg      teststring=
2820862f5301Smrg      # Add a significant safety factor because C++ compilers can tack on
2821862f5301Smrg      # massive amounts of additional arguments before passing them to the
2822862f5301Smrg      # linker.  It appears as though 1/2 is a usable value.
2823862f5301Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
282444dda7b2Smrg    fi
282544dda7b2Smrg    ;;
282644dda7b2Smrg  esac
282744dda7b2Smrg])
2828862f5301Smrgif test -n $lt_cv_sys_max_cmd_len ; then
2829862f5301Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2830862f5301Smrgelse
2831862f5301Smrg  AC_MSG_RESULT(none)
2832862f5301Smrgfi
2833862f5301Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
2834862f5301Smrg_LT_DECL([], [max_cmd_len], [0],
2835862f5301Smrg    [What is the maximum length of a command?])
2836862f5301Smrg])# LT_CMD_MAX_LEN
283744dda7b2Smrg
2838862f5301Smrg# Old name:
2839862f5301SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2840862f5301Smrgdnl aclocal-1.4 backwards compatibility:
2841862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
284244dda7b2Smrg
284344dda7b2Smrg
2844862f5301Smrg# _LT_HEADER_DLFCN
2845862f5301Smrg# ----------------
2846862f5301Smrgm4_defun([_LT_HEADER_DLFCN],
2847862f5301Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2848862f5301Smrg])# _LT_HEADER_DLFCN
284944dda7b2Smrg
285044dda7b2Smrg
2851862f5301Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2852862f5301Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2853862f5301Smrg# ----------------------------------------------------------------
2854862f5301Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
2855862f5301Smrg[m4_require([_LT_HEADER_DLFCN])dnl
2856862f5301Smrgif test "$cross_compiling" = yes; then :
2857862f5301Smrg  [$4]
2858862f5301Smrgelse
2859862f5301Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2860862f5301Smrg  lt_status=$lt_dlunknown
2861862f5301Smrg  cat > conftest.$ac_ext <<_LT_EOF
2862862f5301Smrg[#line $LINENO "configure"
2863862f5301Smrg#include "confdefs.h"
286444dda7b2Smrg
2865862f5301Smrg#if HAVE_DLFCN_H
2866862f5301Smrg#include <dlfcn.h>
2867862f5301Smrg#endif
286844dda7b2Smrg
2869862f5301Smrg#include <stdio.h>
287044dda7b2Smrg
2871862f5301Smrg#ifdef RTLD_GLOBAL
2872862f5301Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
2873862f5301Smrg#else
2874862f5301Smrg#  ifdef DL_GLOBAL
2875862f5301Smrg#    define LT_DLGLOBAL		DL_GLOBAL
2876862f5301Smrg#  else
2877862f5301Smrg#    define LT_DLGLOBAL		0
2878862f5301Smrg#  endif
2879862f5301Smrg#endif
288044dda7b2Smrg
2881862f5301Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2882862f5301Smrg   find out it does not work in some platform. */
2883862f5301Smrg#ifndef LT_DLLAZY_OR_NOW
2884862f5301Smrg#  ifdef RTLD_LAZY
2885862f5301Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2886862f5301Smrg#  else
2887862f5301Smrg#    ifdef DL_LAZY
2888862f5301Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
2889862f5301Smrg#    else
2890862f5301Smrg#      ifdef RTLD_NOW
2891862f5301Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2892862f5301Smrg#      else
2893862f5301Smrg#        ifdef DL_NOW
2894862f5301Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
2895862f5301Smrg#        else
2896862f5301Smrg#          define LT_DLLAZY_OR_NOW	0
2897862f5301Smrg#        endif
2898862f5301Smrg#      endif
2899862f5301Smrg#    endif
2900862f5301Smrg#  endif
2901862f5301Smrg#endif
290244dda7b2Smrg
2903862f5301Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
2904862f5301Smrg   correspondingly for the symbols needed.  */
2905862f5301Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2906862f5301Smrgint fnord () __attribute__((visibility("default")));
2907862f5301Smrg#endif
2908862f5301Smrg
2909862f5301Smrgint fnord () { return 42; }
2910862f5301Smrgint main ()
291144dda7b2Smrg{
2912862f5301Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2913862f5301Smrg  int status = $lt_dlunknown;
291444dda7b2Smrg
2915862f5301Smrg  if (self)
2916862f5301Smrg    {
2917862f5301Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2918862f5301Smrg      else
2919862f5301Smrg        {
2920862f5301Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2921862f5301Smrg          else puts (dlerror ());
2922862f5301Smrg	}
2923862f5301Smrg      /* dlclose (self); */
2924862f5301Smrg    }
2925862f5301Smrg  else
2926862f5301Smrg    puts (dlerror ());
292744dda7b2Smrg
2928862f5301Smrg  return status;
2929862f5301Smrg}]
2930862f5301Smrg_LT_EOF
2931862f5301Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2932862f5301Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2933862f5301Smrg    lt_status=$?
2934862f5301Smrg    case x$lt_status in
2935862f5301Smrg      x$lt_dlno_uscore) $1 ;;
2936862f5301Smrg      x$lt_dlneed_uscore) $2 ;;
2937862f5301Smrg      x$lt_dlunknown|x*) $3 ;;
2938862f5301Smrg    esac
2939862f5301Smrg  else :
2940862f5301Smrg    # compilation failed
2941862f5301Smrg    $3
2942862f5301Smrg  fi
2943862f5301Smrgfi
2944862f5301Smrgrm -fr conftest*
2945862f5301Smrg])# _LT_TRY_DLOPEN_SELF
294644dda7b2Smrg
294744dda7b2Smrg
2948862f5301Smrg# LT_SYS_DLOPEN_SELF
2949862f5301Smrg# ------------------
2950862f5301SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
2951862f5301Smrg[m4_require([_LT_HEADER_DLFCN])dnl
2952862f5301Smrgif test "x$enable_dlopen" != xyes; then
2953862f5301Smrg  enable_dlopen=unknown
2954862f5301Smrg  enable_dlopen_self=unknown
2955862f5301Smrg  enable_dlopen_self_static=unknown
2956862f5301Smrgelse
2957862f5301Smrg  lt_cv_dlopen=no
2958862f5301Smrg  lt_cv_dlopen_libs=
295944dda7b2Smrg
2960862f5301Smrg  case $host_os in
2961862f5301Smrg  beos*)
2962862f5301Smrg    lt_cv_dlopen="load_add_on"
2963862f5301Smrg    lt_cv_dlopen_libs=
2964862f5301Smrg    lt_cv_dlopen_self=yes
2965862f5301Smrg    ;;
296644dda7b2Smrg
2967862f5301Smrg  mingw* | pw32* | cegcc*)
2968862f5301Smrg    lt_cv_dlopen="LoadLibrary"
2969862f5301Smrg    lt_cv_dlopen_libs=
2970862f5301Smrg    ;;
297144dda7b2Smrg
2972862f5301Smrg  cygwin*)
2973862f5301Smrg    lt_cv_dlopen="dlopen"
2974862f5301Smrg    lt_cv_dlopen_libs=
2975862f5301Smrg    ;;
297644dda7b2Smrg
2977862f5301Smrg  darwin*)
2978862f5301Smrg  # if libdl is installed we need to link against it
2979862f5301Smrg    AC_CHECK_LIB([dl], [dlopen],
2980862f5301Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2981862f5301Smrg    lt_cv_dlopen="dyld"
2982862f5301Smrg    lt_cv_dlopen_libs=
2983862f5301Smrg    lt_cv_dlopen_self=yes
2984862f5301Smrg    ])
2985862f5301Smrg    ;;
298644dda7b2Smrg
2987862f5301Smrg  *)
2988862f5301Smrg    AC_CHECK_FUNC([shl_load],
2989862f5301Smrg	  [lt_cv_dlopen="shl_load"],
2990862f5301Smrg      [AC_CHECK_LIB([dld], [shl_load],
2991862f5301Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2992862f5301Smrg	[AC_CHECK_FUNC([dlopen],
2993862f5301Smrg	      [lt_cv_dlopen="dlopen"],
2994862f5301Smrg	  [AC_CHECK_LIB([dl], [dlopen],
2995862f5301Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2996862f5301Smrg	    [AC_CHECK_LIB([svld], [dlopen],
2997862f5301Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2998862f5301Smrg	      [AC_CHECK_LIB([dld], [dld_link],
2999862f5301Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
3000862f5301Smrg	      ])
3001862f5301Smrg	    ])
3002862f5301Smrg	  ])
3003862f5301Smrg	])
3004862f5301Smrg      ])
3005862f5301Smrg    ;;
3006862f5301Smrg  esac
300744dda7b2Smrg
3008862f5301Smrg  if test "x$lt_cv_dlopen" != xno; then
3009862f5301Smrg    enable_dlopen=yes
3010862f5301Smrg  else
3011862f5301Smrg    enable_dlopen=no
3012862f5301Smrg  fi
301344dda7b2Smrg
3014862f5301Smrg  case $lt_cv_dlopen in
3015862f5301Smrg  dlopen)
3016862f5301Smrg    save_CPPFLAGS="$CPPFLAGS"
3017862f5301Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
301844dda7b2Smrg
3019862f5301Smrg    save_LDFLAGS="$LDFLAGS"
3020862f5301Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
302144dda7b2Smrg
3022862f5301Smrg    save_LIBS="$LIBS"
3023862f5301Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
302444dda7b2Smrg
3025862f5301Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
3026862f5301Smrg	  lt_cv_dlopen_self, [dnl
3027862f5301Smrg	  _LT_TRY_DLOPEN_SELF(
3028862f5301Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
3029862f5301Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
3030862f5301Smrg    ])
303144dda7b2Smrg
3032862f5301Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
3033862f5301Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
3034862f5301Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
3035862f5301Smrg	  lt_cv_dlopen_self_static, [dnl
3036862f5301Smrg	  _LT_TRY_DLOPEN_SELF(
3037862f5301Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
3038862f5301Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
3039862f5301Smrg      ])
3040862f5301Smrg    fi
3041862f5301Smrg
3042862f5301Smrg    CPPFLAGS="$save_CPPFLAGS"
3043862f5301Smrg    LDFLAGS="$save_LDFLAGS"
3044862f5301Smrg    LIBS="$save_LIBS"
304544dda7b2Smrg    ;;
304644dda7b2Smrg  esac
3047862f5301Smrg
3048862f5301Smrg  case $lt_cv_dlopen_self in
3049862f5301Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
3050862f5301Smrg  *) enable_dlopen_self=unknown ;;
3051862f5301Smrg  esac
3052862f5301Smrg
3053862f5301Smrg  case $lt_cv_dlopen_self_static in
3054862f5301Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
3055862f5301Smrg  *) enable_dlopen_self_static=unknown ;;
3056862f5301Smrg  esac
305744dda7b2Smrgfi
3058862f5301Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
3059862f5301Smrg	 [Whether dlopen is supported])
3060862f5301Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
3061862f5301Smrg	 [Whether dlopen of programs is supported])
3062862f5301Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
3063862f5301Smrg	 [Whether dlopen of statically linked programs is supported])
3064862f5301Smrg])# LT_SYS_DLOPEN_SELF
306544dda7b2Smrg
3066862f5301Smrg# Old name:
3067862f5301SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
3068862f5301Smrgdnl aclocal-1.4 backwards compatibility:
3069862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
307044dda7b2Smrg
307144dda7b2Smrg
3072862f5301Smrg# _LT_COMPILER_C_O([TAGNAME])
3073862f5301Smrg# ---------------------------
3074862f5301Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
3075862f5301Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
3076862f5301Smrgm4_defun([_LT_COMPILER_C_O],
3077862f5301Smrg[m4_require([_LT_DECL_SED])dnl
3078862f5301Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3079862f5301Smrgm4_require([_LT_TAG_COMPILER])dnl
3080862f5301SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3081862f5301Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3082862f5301Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3083862f5301Smrg   $RM -r conftest 2>/dev/null
3084862f5301Smrg   mkdir conftest
3085862f5301Smrg   cd conftest
3086862f5301Smrg   mkdir out
308744dda7b2Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3088862f5301Smrg
3089862f5301Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
309044dda7b2Smrg   # Insert the option either (1) after the last *FLAGS variable, or
309144dda7b2Smrg   # (2) before a word containing "conftest.", or (3) at the end.
309244dda7b2Smrg   # Note that $ac_compile itself does not contain backslashes and begins
309344dda7b2Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
309444dda7b2Smrg   lt_compile=`echo "$ac_compile" | $SED \
309544dda7b2Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
309644dda7b2Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
309744dda7b2Smrg   -e 's:$: $lt_compiler_flag:'`
309844dda7b2Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3099862f5301Smrg   (eval "$lt_compile" 2>out/conftest.err)
310044dda7b2Smrg   ac_status=$?
3101862f5301Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
310244dda7b2Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3103862f5301Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3104862f5301Smrg   then
310544dda7b2Smrg     # The compiler can only warn and ignore the option if not recognized
3106862f5301Smrg     # So say no if there are warnings
3107862f5301Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3108862f5301Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3109862f5301Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3110862f5301Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
311144dda7b2Smrg     fi
311244dda7b2Smrg   fi
3113862f5301Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3114862f5301Smrg   $RM conftest*
3115862f5301Smrg   # SGI C++ compiler will create directory out/ii_files/ for
3116862f5301Smrg   # template instantiation
3117862f5301Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3118862f5301Smrg   $RM out/* && rmdir out
3119862f5301Smrg   cd ..
3120862f5301Smrg   $RM -r conftest
312144dda7b2Smrg   $RM conftest*
312244dda7b2Smrg])
3123862f5301Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3124862f5301Smrg	[Does compiler simultaneously support -c and -o options?])
3125862f5301Smrg])# _LT_COMPILER_C_O
312644dda7b2Smrg
312744dda7b2Smrg
3128862f5301Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3129862f5301Smrg# ----------------------------------
3130862f5301Smrg# Check to see if we can do hard links to lock some files if needed
3131862f5301Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
3132862f5301Smrg[m4_require([_LT_ENABLE_LOCK])dnl
3133862f5301Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3134862f5301Smrg_LT_COMPILER_C_O([$1])
313544dda7b2Smrg
3136862f5301Smrghard_links="nottested"
3137862f5301Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3138862f5301Smrg  # do not overwrite the value of need_locks provided by the user
3139862f5301Smrg  AC_MSG_CHECKING([if we can lock with hard links])
3140862f5301Smrg  hard_links=yes
3141862f5301Smrg  $RM conftest*
3142862f5301Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3143862f5301Smrg  touch conftest.a
3144862f5301Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
3145862f5301Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3146862f5301Smrg  AC_MSG_RESULT([$hard_links])
3147862f5301Smrg  if test "$hard_links" = no; then
3148862f5301Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3149862f5301Smrg    need_locks=warn
3150862f5301Smrg  fi
315144dda7b2Smrgelse
3152862f5301Smrg  need_locks=no
315344dda7b2Smrgfi
3154862f5301Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3155862f5301Smrg])# _LT_COMPILER_FILE_LOCKS
315644dda7b2Smrg
315744dda7b2Smrg
3158862f5301Smrg# _LT_CHECK_OBJDIR
3159862f5301Smrg# ----------------
3160862f5301Smrgm4_defun([_LT_CHECK_OBJDIR],
3161862f5301Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3162862f5301Smrg[rm -f .libs 2>/dev/null
3163862f5301Smrgmkdir .libs 2>/dev/null
3164862f5301Smrgif test -d .libs; then
3165862f5301Smrg  lt_cv_objdir=.libs
3166862f5301Smrgelse
3167862f5301Smrg  # MS-DOS does not allow filenames that begin with a dot.
3168862f5301Smrg  lt_cv_objdir=_libs
3169862f5301Smrgfi
3170862f5301Smrgrmdir .libs 2>/dev/null])
3171862f5301Smrgobjdir=$lt_cv_objdir
3172862f5301Smrg_LT_DECL([], [objdir], [0],
3173862f5301Smrg         [The name of the directory that contains temporary libtool files])dnl
3174862f5301Smrgm4_pattern_allow([LT_OBJDIR])dnl
3175862f5301SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3176862f5301Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3177862f5301Smrg])# _LT_CHECK_OBJDIR
317844dda7b2Smrg
317944dda7b2Smrg
3180862f5301Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3181862f5301Smrg# --------------------------------------
3182862f5301Smrg# Check hardcoding attributes.
3183862f5301Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3184862f5301Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
3185862f5301Smrg_LT_TAGVAR(hardcode_action, $1)=
3186862f5301Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3187862f5301Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3188862f5301Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
318944dda7b2Smrg
3190862f5301Smrg  # We can hardcode non-existent directories.
3191862f5301Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3192862f5301Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3193862f5301Smrg     # have to relink, otherwise we might link with an installed library
3194862f5301Smrg     # when we should be linking with a yet-to-be-installed one
3195862f5301Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3196862f5301Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3197862f5301Smrg    # Linking always hardcodes the temporary library directory.
3198862f5301Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
3199862f5301Smrg  else
3200862f5301Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3201862f5301Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
3202862f5301Smrg  fi
3203862f5301Smrgelse
3204862f5301Smrg  # We cannot hardcode anything, or else we can only hardcode existing
3205862f5301Smrg  # directories.
3206862f5301Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
3207862f5301Smrgfi
3208862f5301SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
320944dda7b2Smrg
3210862f5301Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3211862f5301Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3212862f5301Smrg  # Fast installation is not supported
3213862f5301Smrg  enable_fast_install=no
3214862f5301Smrgelif test "$shlibpath_overrides_runpath" = yes ||
3215862f5301Smrg     test "$enable_shared" = no; then
3216862f5301Smrg  # Fast installation is not necessary
3217862f5301Smrg  enable_fast_install=needless
3218862f5301Smrgfi
3219862f5301Smrg_LT_TAGDECL([], [hardcode_action], [0],
3220862f5301Smrg    [How to hardcode a shared library path into an executable])
3221862f5301Smrg])# _LT_LINKER_HARDCODE_LIBPATH
322244dda7b2Smrg
322344dda7b2Smrg
3224862f5301Smrg# _LT_CMD_STRIPLIB
3225862f5301Smrg# ----------------
3226862f5301Smrgm4_defun([_LT_CMD_STRIPLIB],
3227862f5301Smrg[m4_require([_LT_DECL_EGREP])
3228862f5301Smrgstriplib=
3229862f5301Smrgold_striplib=
3230862f5301SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
3231862f5301Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3232862f5301Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3233862f5301Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3234862f5301Smrg  AC_MSG_RESULT([yes])
3235862f5301Smrgelse
3236862f5301Smrg# FIXME - insert some real tests, host_os isn't really good enough
3237862f5301Smrg  case $host_os in
3238862f5301Smrg  darwin*)
3239862f5301Smrg    if test -n "$STRIP" ; then
3240862f5301Smrg      striplib="$STRIP -x"
3241862f5301Smrg      old_striplib="$STRIP -S"
3242862f5301Smrg      AC_MSG_RESULT([yes])
324344dda7b2Smrg    else
3244862f5301Smrg      AC_MSG_RESULT([no])
324544dda7b2Smrg    fi
324644dda7b2Smrg    ;;
3247862f5301Smrg  *)
3248862f5301Smrg    AC_MSG_RESULT([no])
324944dda7b2Smrg    ;;
3250862f5301Smrg  esac
3251862f5301Smrgfi
3252862f5301Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3253862f5301Smrg_LT_DECL([], [striplib], [1])
3254862f5301Smrg])# _LT_CMD_STRIPLIB
325544dda7b2Smrg
3256862f5301Smrg
3257862f5301Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
3258862f5301Smrg# -----------------------------
3259862f5301Smrg# PORTME Fill in your ld.so characteristics
3260862f5301Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
3261862f5301Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3262862f5301Smrgm4_require([_LT_DECL_EGREP])dnl
3263862f5301Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3264862f5301Smrgm4_require([_LT_DECL_OBJDUMP])dnl
3265862f5301Smrgm4_require([_LT_DECL_SED])dnl
3266862f5301Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
3267862f5301SmrgAC_MSG_CHECKING([dynamic linker characteristics])
3268862f5301Smrgm4_if([$1],
3269862f5301Smrg	[], [
3270862f5301Smrgif test "$GCC" = yes; then
3271862f5301Smrg  case $host_os in
3272862f5301Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3273862f5301Smrg    *) lt_awk_arg="/^libraries:/" ;;
3274862f5301Smrg  esac
3275862f5301Smrg  case $host_os in
3276862f5301Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3277862f5301Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
3278862f5301Smrg  esac
3279862f5301Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3280862f5301Smrg  case $lt_search_path_spec in
3281862f5301Smrg  *\;*)
3282862f5301Smrg    # if the path contains ";" then we assume it to be the separator
3283862f5301Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
3284862f5301Smrg    # assumed that no part of a normal pathname contains ";" but that should
3285862f5301Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
3286862f5301Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
328744dda7b2Smrg    ;;
328844dda7b2Smrg  *)
3289862f5301Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3290862f5301Smrg    ;;
3291862f5301Smrg  esac
3292862f5301Smrg  # Ok, now we have the path, separated by spaces, we can step through it
3293862f5301Smrg  # and add multilib dir if necessary.
3294862f5301Smrg  lt_tmp_lt_search_path_spec=
3295862f5301Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3296862f5301Smrg  for lt_sys_path in $lt_search_path_spec; do
3297862f5301Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3298862f5301Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
329944dda7b2Smrg    else
3300862f5301Smrg      test -d "$lt_sys_path" && \
3301862f5301Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
330244dda7b2Smrg    fi
3303862f5301Smrg  done
3304862f5301Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3305862f5301SmrgBEGIN {RS=" "; FS="/|\n";} {
3306862f5301Smrg  lt_foo="";
3307862f5301Smrg  lt_count=0;
3308862f5301Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
3309862f5301Smrg    if ($lt_i != "" && $lt_i != ".") {
3310862f5301Smrg      if ($lt_i == "..") {
3311862f5301Smrg        lt_count++;
3312862f5301Smrg      } else {
3313862f5301Smrg        if (lt_count == 0) {
3314862f5301Smrg          lt_foo="/" $lt_i lt_foo;
3315862f5301Smrg        } else {
3316862f5301Smrg          lt_count--;
3317862f5301Smrg        }
3318862f5301Smrg      }
3319862f5301Smrg    }
3320862f5301Smrg  }
3321862f5301Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3322862f5301Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3323862f5301Smrg}'`
3324862f5301Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
3325862f5301Smrg  # for these hosts.
3326862f5301Smrg  case $host_os in
3327862f5301Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3328862f5301Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
332944dda7b2Smrg  esac
3330862f5301Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
333144dda7b2Smrgelse
3332862f5301Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3333862f5301Smrgfi])
3334862f5301Smrglibrary_names_spec=
3335862f5301Smrglibname_spec='lib$name'
3336862f5301Smrgsoname_spec=
3337862f5301Smrgshrext_cmds=".so"
3338862f5301Smrgpostinstall_cmds=
3339862f5301Smrgpostuninstall_cmds=
3340862f5301Smrgfinish_cmds=
3341862f5301Smrgfinish_eval=
3342862f5301Smrgshlibpath_var=
3343862f5301Smrgshlibpath_overrides_runpath=unknown
3344862f5301Smrgversion_type=none
3345862f5301Smrgdynamic_linker="$host_os ld.so"
3346862f5301Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
3347862f5301Smrgneed_lib_prefix=unknown
3348862f5301Smrghardcode_into_libs=no
334944dda7b2Smrg
3350862f5301Smrg# when you set need_version to no, make sure it does not cause -set_version
3351862f5301Smrg# flags to be left without arguments
3352862f5301Smrgneed_version=unknown
335344dda7b2Smrg
3354862f5301Smrgcase $host_os in
3355862f5301Smrgaix3*)
3356862f5301Smrg  version_type=linux
3357862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3358862f5301Smrg  shlibpath_var=LIBPATH
335944dda7b2Smrg
3360862f5301Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
3361862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3362862f5301Smrg  ;;
336344dda7b2Smrg
3364862f5301Smrgaix[[4-9]]*)
3365862f5301Smrg  version_type=linux
3366862f5301Smrg  need_lib_prefix=no
3367862f5301Smrg  need_version=no
3368862f5301Smrg  hardcode_into_libs=yes
3369862f5301Smrg  if test "$host_cpu" = ia64; then
3370862f5301Smrg    # AIX 5 supports IA64
3371862f5301Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3372862f5301Smrg    shlibpath_var=LD_LIBRARY_PATH
3373862f5301Smrg  else
3374862f5301Smrg    # With GCC up to 2.95.x, collect2 would create an import file
3375862f5301Smrg    # for dependence libraries.  The import file would start with
3376862f5301Smrg    # the line `#! .'.  This would cause the generated library to
3377862f5301Smrg    # depend on `.', always an invalid library.  This was fixed in
3378862f5301Smrg    # development snapshots of GCC prior to 3.0.
3379862f5301Smrg    case $host_os in
3380862f5301Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
3381862f5301Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3382862f5301Smrg	   echo ' yes '
3383862f5301Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3384862f5301Smrg	:
3385862f5301Smrg      else
3386862f5301Smrg	can_build_shared=no
3387862f5301Smrg      fi
3388862f5301Smrg      ;;
3389862f5301Smrg    esac
3390862f5301Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3391862f5301Smrg    # soname into executable. Probably we can add versioning support to
3392862f5301Smrg    # collect2, so additional links can be useful in future.
3393862f5301Smrg    if test "$aix_use_runtimelinking" = yes; then
3394862f5301Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3395862f5301Smrg      # instead of lib<name>.a to let people know that these are not
3396862f5301Smrg      # typical AIX shared libraries.
3397862f5301Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3398862f5301Smrg    else
3399862f5301Smrg      # We preserve .a as extension for shared libraries through AIX4.2
3400862f5301Smrg      # and later when we are not doing run time linking.
3401862f5301Smrg      library_names_spec='${libname}${release}.a $libname.a'
3402862f5301Smrg      soname_spec='${libname}${release}${shared_ext}$major'
3403862f5301Smrg    fi
3404862f5301Smrg    shlibpath_var=LIBPATH
3405862f5301Smrg  fi
3406862f5301Smrg  ;;
340744dda7b2Smrg
3408862f5301Smrgamigaos*)
3409862f5301Smrg  case $host_cpu in
3410862f5301Smrg  powerpc)
3411862f5301Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
3412862f5301Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3413862f5301Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3414862f5301Smrg    ;;
3415862f5301Smrg  m68k)
3416862f5301Smrg    library_names_spec='$libname.ixlibrary $libname.a'
3417862f5301Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3418862f5301Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
3419862f5301Smrg    ;;
3420862f5301Smrg  esac
3421862f5301Smrg  ;;
342244dda7b2Smrg
3423862f5301Smrgbeos*)
3424862f5301Smrg  library_names_spec='${libname}${shared_ext}'
3425862f5301Smrg  dynamic_linker="$host_os ld.so"
3426862f5301Smrg  shlibpath_var=LIBRARY_PATH
3427862f5301Smrg  ;;
342844dda7b2Smrg
3429862f5301Smrgbsdi[[45]]*)
3430862f5301Smrg  version_type=linux
3431862f5301Smrg  need_version=no
3432862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3433862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3434862f5301Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3435862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3436862f5301Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3437862f5301Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3438862f5301Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
3439862f5301Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3440862f5301Smrg  # libtool to hard-code these into programs
3441862f5301Smrg  ;;
344244dda7b2Smrg
3443862f5301Smrgcygwin* | mingw* | pw32* | cegcc*)
3444862f5301Smrg  version_type=windows
3445862f5301Smrg  shrext_cmds=".dll"
3446862f5301Smrg  need_version=no
3447862f5301Smrg  need_lib_prefix=no
344844dda7b2Smrg
3449862f5301Smrg  case $GCC,$cc_basename in
3450862f5301Smrg  yes,*)
3451862f5301Smrg    # gcc
3452862f5301Smrg    library_names_spec='$libname.dll.a'
3453862f5301Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3454862f5301Smrg    postinstall_cmds='base_file=`basename \${file}`~
3455862f5301Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3456862f5301Smrg      dldir=$destdir/`dirname \$dlpath`~
3457862f5301Smrg      test -d \$dldir || mkdir -p \$dldir~
3458862f5301Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
3459862f5301Smrg      chmod a+x \$dldir/$dlname~
3460862f5301Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3461862f5301Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3462862f5301Smrg      fi'
3463862f5301Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3464862f5301Smrg      dlpath=$dir/\$dldll~
3465862f5301Smrg       $RM \$dlpath'
3466862f5301Smrg    shlibpath_overrides_runpath=yes
346744dda7b2Smrg
3468862f5301Smrg    case $host_os in
3469862f5301Smrg    cygwin*)
3470862f5301Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3471862f5301Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3472862f5301Smrgm4_if([$1], [],[
3473862f5301Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3474862f5301Smrg      ;;
3475862f5301Smrg    mingw* | cegcc*)
3476862f5301Smrg      # MinGW DLLs use traditional 'lib' prefix
3477862f5301Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3478862f5301Smrg      ;;
3479862f5301Smrg    pw32*)
3480862f5301Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
3481862f5301Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3482862f5301Smrg      ;;
3483862f5301Smrg    esac
3484862f5301Smrg    dynamic_linker='Win32 ld.exe'
3485862f5301Smrg    ;;
348644dda7b2Smrg
3487862f5301Smrg  *,cl*)
3488862f5301Smrg    # Native MSVC
3489862f5301Smrg    libname_spec='$name'
3490862f5301Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3491862f5301Smrg    library_names_spec='${libname}.dll.lib'
3492862f5301Smrg
3493862f5301Smrg    case $build_os in
3494862f5301Smrg    mingw*)
3495862f5301Smrg      sys_lib_search_path_spec=
3496862f5301Smrg      lt_save_ifs=$IFS
3497862f5301Smrg      IFS=';'
3498862f5301Smrg      for lt_path in $LIB
3499862f5301Smrg      do
3500862f5301Smrg        IFS=$lt_save_ifs
3501862f5301Smrg        # Let DOS variable expansion print the short 8.3 style file name.
3502862f5301Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3503862f5301Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3504862f5301Smrg      done
3505862f5301Smrg      IFS=$lt_save_ifs
3506862f5301Smrg      # Convert to MSYS style.
3507862f5301Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3508862f5301Smrg      ;;
3509862f5301Smrg    cygwin*)
3510862f5301Smrg      # Convert to unix form, then to dos form, then back to unix form
3511862f5301Smrg      # but this time dos style (no spaces!) so that the unix form looks
3512862f5301Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
3513862f5301Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3514862f5301Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3515862f5301Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3516862f5301Smrg      ;;
3517862f5301Smrg    *)
3518862f5301Smrg      sys_lib_search_path_spec="$LIB"
3519862f5301Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3520862f5301Smrg        # It is most probably a Windows format PATH.
3521862f5301Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
352244dda7b2Smrg      else
3523862f5301Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3524862f5301Smrg      fi
3525862f5301Smrg      # FIXME: find the short name or the path components, as spaces are
3526862f5301Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
3527862f5301Smrg      ;;
3528ff559fabSmrg    esac
3529ff559fabSmrg
3530862f5301Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3531862f5301Smrg    postinstall_cmds='base_file=`basename \${file}`~
3532862f5301Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3533862f5301Smrg      dldir=$destdir/`dirname \$dlpath`~
3534862f5301Smrg      test -d \$dldir || mkdir -p \$dldir~
3535862f5301Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
3536862f5301Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3537862f5301Smrg      dlpath=$dir/\$dldll~
3538862f5301Smrg       $RM \$dlpath'
3539862f5301Smrg    shlibpath_overrides_runpath=yes
3540862f5301Smrg    dynamic_linker='Win32 link.exe'
354144dda7b2Smrg    ;;
3542ff559fabSmrg
3543862f5301Smrg  *)
3544862f5301Smrg    # Assume MSVC wrapper
3545862f5301Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3546862f5301Smrg    dynamic_linker='Win32 ld.exe'
354744dda7b2Smrg    ;;
3548862f5301Smrg  esac
3549862f5301Smrg  # FIXME: first we should search . and the directory the executable is in
3550862f5301Smrg  shlibpath_var=PATH
3551862f5301Smrg  ;;
3552ff559fabSmrg
3553862f5301Smrgdarwin* | rhapsody*)
3554862f5301Smrg  dynamic_linker="$host_os dyld"
3555862f5301Smrg  version_type=darwin
3556862f5301Smrg  need_lib_prefix=no
3557862f5301Smrg  need_version=no
3558862f5301Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3559862f5301Smrg  soname_spec='${libname}${release}${major}$shared_ext'
3560862f5301Smrg  shlibpath_overrides_runpath=yes
3561862f5301Smrg  shlibpath_var=DYLD_LIBRARY_PATH
3562862f5301Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3563862f5301Smrgm4_if([$1], [],[
3564862f5301Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3565862f5301Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3566862f5301Smrg  ;;
3567ff559fabSmrg
3568862f5301Smrgdgux*)
3569862f5301Smrg  version_type=linux
3570862f5301Smrg  need_lib_prefix=no
3571862f5301Smrg  need_version=no
3572862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3573862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3574862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3575862f5301Smrg  ;;
35767a3b38f7Smrg
3577862f5301Smrgfreebsd1*)
3578862f5301Smrg  dynamic_linker=no
3579862f5301Smrg  ;;
35807a3b38f7Smrg
3581862f5301Smrgfreebsd* | dragonfly*)
3582862f5301Smrg  # DragonFly does not have aout.  When/if they implement a new
3583862f5301Smrg  # versioning mechanism, adjust this.
3584862f5301Smrg  if test -x /usr/bin/objformat; then
3585862f5301Smrg    objformat=`/usr/bin/objformat`
358644dda7b2Smrg  else
3587862f5301Smrg    case $host_os in
3588862f5301Smrg    freebsd[[123]]*) objformat=aout ;;
3589862f5301Smrg    *) objformat=elf ;;
3590862f5301Smrg    esac
359144dda7b2Smrg  fi
3592862f5301Smrg  version_type=freebsd-$objformat
3593862f5301Smrg  case $version_type in
3594862f5301Smrg    freebsd-elf*)
3595862f5301Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3596862f5301Smrg      need_version=no
3597862f5301Smrg      need_lib_prefix=no
3598862f5301Smrg      ;;
3599862f5301Smrg    freebsd-*)
3600862f5301Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3601862f5301Smrg      need_version=yes
3602862f5301Smrg      ;;
3603862f5301Smrg  esac
3604862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3605862f5301Smrg  case $host_os in
3606862f5301Smrg  freebsd2*)
3607862f5301Smrg    shlibpath_overrides_runpath=yes
3608862f5301Smrg    ;;
3609862f5301Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3610862f5301Smrg    shlibpath_overrides_runpath=yes
3611862f5301Smrg    hardcode_into_libs=yes
3612862f5301Smrg    ;;
3613862f5301Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3614862f5301Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3615862f5301Smrg    shlibpath_overrides_runpath=no
3616862f5301Smrg    hardcode_into_libs=yes
3617862f5301Smrg    ;;
3618862f5301Smrg  *) # from 4.6 on, and DragonFly
3619862f5301Smrg    shlibpath_overrides_runpath=yes
3620862f5301Smrg    hardcode_into_libs=yes
3621862f5301Smrg    ;;
3622862f5301Smrg  esac
3623862f5301Smrg  ;;
36247a3b38f7Smrg
3625862f5301Smrggnu*)
3626862f5301Smrg  version_type=linux
3627862f5301Smrg  need_lib_prefix=no
3628862f5301Smrg  need_version=no
3629862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3630862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3631862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3632862f5301Smrg  hardcode_into_libs=yes
3633862f5301Smrg  ;;
36347a3b38f7Smrg
3635862f5301Smrghaiku*)
3636862f5301Smrg  version_type=linux
3637862f5301Smrg  need_lib_prefix=no
3638862f5301Smrg  need_version=no
3639862f5301Smrg  dynamic_linker="$host_os runtime_loader"
3640862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3641862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3642862f5301Smrg  shlibpath_var=LIBRARY_PATH
3643862f5301Smrg  shlibpath_overrides_runpath=yes
3644862f5301Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3645862f5301Smrg  hardcode_into_libs=yes
3646862f5301Smrg  ;;
36477a3b38f7Smrg
3648862f5301Smrghpux9* | hpux10* | hpux11*)
3649862f5301Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
3650862f5301Smrg  # link against other versions.
3651862f5301Smrg  version_type=sunos
3652862f5301Smrg  need_lib_prefix=no
3653862f5301Smrg  need_version=no
3654862f5301Smrg  case $host_cpu in
3655862f5301Smrg  ia64*)
3656862f5301Smrg    shrext_cmds='.so'
3657862f5301Smrg    hardcode_into_libs=yes
3658862f5301Smrg    dynamic_linker="$host_os dld.so"
3659862f5301Smrg    shlibpath_var=LD_LIBRARY_PATH
3660862f5301Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3661862f5301Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3662862f5301Smrg    soname_spec='${libname}${release}${shared_ext}$major'
3663862f5301Smrg    if test "X$HPUX_IA64_MODE" = X32; then
3664862f5301Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3665862f5301Smrg    else
3666862f5301Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
366744dda7b2Smrg    fi
3668862f5301Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3669862f5301Smrg    ;;
3670862f5301Smrg  hppa*64*)
3671862f5301Smrg    shrext_cmds='.sl'
3672862f5301Smrg    hardcode_into_libs=yes
3673862f5301Smrg    dynamic_linker="$host_os dld.sl"
3674862f5301Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3675862f5301Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3676862f5301Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3677862f5301Smrg    soname_spec='${libname}${release}${shared_ext}$major'
3678862f5301Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3679862f5301Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3680862f5301Smrg    ;;
3681862f5301Smrg  *)
3682862f5301Smrg    shrext_cmds='.sl'
3683862f5301Smrg    dynamic_linker="$host_os dld.sl"
3684862f5301Smrg    shlibpath_var=SHLIB_PATH
3685862f5301Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3686862f5301Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3687862f5301Smrg    soname_spec='${libname}${release}${shared_ext}$major'
368844dda7b2Smrg    ;;
368944dda7b2Smrg  esac
3690862f5301Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3691862f5301Smrg  postinstall_cmds='chmod 555 $lib'
3692862f5301Smrg  # or fails outright, so override atomically:
3693862f5301Smrg  install_override_mode=555
3694862f5301Smrg  ;;
36957a3b38f7Smrg
3696862f5301Smrginterix[[3-9]]*)
3697862f5301Smrg  version_type=linux
3698862f5301Smrg  need_lib_prefix=no
3699862f5301Smrg  need_version=no
3700862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3701862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3702862f5301Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3703862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3704862f5301Smrg  shlibpath_overrides_runpath=no
3705862f5301Smrg  hardcode_into_libs=yes
3706862f5301Smrg  ;;
37077a3b38f7Smrg
3708862f5301Smrgirix5* | irix6* | nonstopux*)
3709862f5301Smrg  case $host_os in
3710862f5301Smrg    nonstopux*) version_type=nonstopux ;;
3711862f5301Smrg    *)
3712862f5301Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
3713862f5301Smrg		version_type=linux
3714862f5301Smrg	else
3715862f5301Smrg		version_type=irix
3716862f5301Smrg	fi ;;
371744dda7b2Smrg  esac
3718862f5301Smrg  need_lib_prefix=no
3719862f5301Smrg  need_version=no
3720862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3721862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3722862f5301Smrg  case $host_os in
3723862f5301Smrg  irix5* | nonstopux*)
3724862f5301Smrg    libsuff= shlibsuff=
3725862f5301Smrg    ;;
3726862f5301Smrg  *)
3727862f5301Smrg    case $LD in # libtool.m4 will add one of these switches to LD
3728862f5301Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3729862f5301Smrg      libsuff= shlibsuff= libmagic=32-bit;;
3730862f5301Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3731862f5301Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
3732862f5301Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3733862f5301Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3734862f5301Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
3735862f5301Smrg    esac
3736862f5301Smrg    ;;
3737862f5301Smrg  esac
3738862f5301Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3739862f5301Smrg  shlibpath_overrides_runpath=no
3740862f5301Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3741862f5301Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3742862f5301Smrg  hardcode_into_libs=yes
3743862f5301Smrg  ;;
37447a3b38f7Smrg
3745862f5301Smrg# No shared lib support for Linux oldld, aout, or coff.
3746862f5301Smrglinux*oldld* | linux*aout* | linux*coff*)
3747862f5301Smrg  dynamic_linker=no
3748862f5301Smrg  ;;
37497a3b38f7Smrg
3750862f5301Smrg# This must be Linux ELF.
3751862f5301Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
3752862f5301Smrg  version_type=linux
3753862f5301Smrg  need_lib_prefix=no
3754862f5301Smrg  need_version=no
3755862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3756862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3757862f5301Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3758862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3759862f5301Smrg  shlibpath_overrides_runpath=no
37607a3b38f7Smrg
3761862f5301Smrg  # Some binutils ld are patched to set DT_RUNPATH
3762862f5301Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3763862f5301Smrg    [lt_cv_shlibpath_overrides_runpath=no
3764862f5301Smrg    save_LDFLAGS=$LDFLAGS
3765862f5301Smrg    save_libdir=$libdir
3766862f5301Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3767862f5301Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3768862f5301Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3769862f5301Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3770862f5301Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
3771862f5301Smrg    LDFLAGS=$save_LDFLAGS
3772862f5301Smrg    libdir=$save_libdir
3773862f5301Smrg    ])
3774862f5301Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
37757a3b38f7Smrg
3776862f5301Smrg  # This implies no fast_install, which is unacceptable.
3777862f5301Smrg  # Some rework will be needed to allow for fast_install
3778862f5301Smrg  # before this can be enabled.
3779862f5301Smrg  hardcode_into_libs=yes
37807a3b38f7Smrg
3781862f5301Smrg  # Append ld.so.conf contents to the search path
3782862f5301Smrg  if test -f /etc/ld.so.conf; then
3783862f5301Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
3784862f5301Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
378544dda7b2Smrg  fi
37867a3b38f7Smrg
3787862f5301Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
3788862f5301Smrg  # powerpc, because MkLinux only supported shared libraries with the
3789862f5301Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
3790862f5301Smrg  # most powerpc-linux boxes support dynamic linking these days and
3791862f5301Smrg  # people can always --disable-shared, the test was removed, and we
3792862f5301Smrg  # assume the GNU/Linux dynamic linker is in use.
3793862f5301Smrg  dynamic_linker='GNU/Linux ld.so'
3794862f5301Smrg  ;;
37957a3b38f7Smrg
3796862f5301Smrgnetbsd*)
3797862f5301Smrg  version_type=sunos
3798862f5301Smrg  need_lib_prefix=no
3799862f5301Smrg  need_version=no
3800862f5301Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3801862f5301Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3802862f5301Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3803862f5301Smrg    dynamic_linker='NetBSD (a.out) ld.so'
380444dda7b2Smrg  else
3805862f5301Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3806862f5301Smrg    soname_spec='${libname}${release}${shared_ext}$major'
3807862f5301Smrg    dynamic_linker='NetBSD ld.elf_so'
380844dda7b2Smrg  fi
3809862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3810862f5301Smrg  shlibpath_overrides_runpath=yes
3811862f5301Smrg  hardcode_into_libs=yes
3812862f5301Smrg  ;;
3813ff559fabSmrg
3814862f5301Smrgnewsos6)
3815862f5301Smrg  version_type=linux
3816862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3817862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3818862f5301Smrg  shlibpath_overrides_runpath=yes
3819862f5301Smrg  ;;
3820ff559fabSmrg
3821862f5301Smrg*nto* | *qnx*)
3822862f5301Smrg  version_type=qnx
3823862f5301Smrg  need_lib_prefix=no
3824862f5301Smrg  need_version=no
3825862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3826862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3827862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3828862f5301Smrg  shlibpath_overrides_runpath=no
3829862f5301Smrg  hardcode_into_libs=yes
3830862f5301Smrg  dynamic_linker='ldqnx.so'
3831862f5301Smrg  ;;
3832ff559fabSmrg
3833862f5301Smrgopenbsd*)
3834862f5301Smrg  version_type=sunos
3835862f5301Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
3836862f5301Smrg  need_lib_prefix=no
3837862f5301Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
38387a3b38f7Smrg  case $host_os in
3839862f5301Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3840862f5301Smrg    *)				need_version=no  ;;
3841ff559fabSmrg  esac
3842862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3843862f5301Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3844862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3845862f5301Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3846862f5301Smrg    case $host_os in
3847862f5301Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
3848862f5301Smrg	shlibpath_overrides_runpath=no
3849862f5301Smrg	;;
3850862f5301Smrg      *)
3851862f5301Smrg	shlibpath_overrides_runpath=yes
3852862f5301Smrg	;;
3853862f5301Smrg      esac
3854862f5301Smrg  else
3855862f5301Smrg    shlibpath_overrides_runpath=yes
3856862f5301Smrg  fi
3857862f5301Smrg  ;;
3858ff559fabSmrg
3859862f5301Smrgos2*)
3860862f5301Smrg  libname_spec='$name'
3861862f5301Smrg  shrext_cmds=".dll"
3862862f5301Smrg  need_lib_prefix=no
3863862f5301Smrg  library_names_spec='$libname${shared_ext} $libname.a'
3864862f5301Smrg  dynamic_linker='OS/2 ld.exe'
3865862f5301Smrg  shlibpath_var=LIBPATH
3866862f5301Smrg  ;;
3867ff559fabSmrg
3868862f5301Smrgosf3* | osf4* | osf5*)
3869862f5301Smrg  version_type=osf
3870862f5301Smrg  need_lib_prefix=no
3871862f5301Smrg  need_version=no
3872862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3873862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3874862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3875862f5301Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3876862f5301Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3877862f5301Smrg  ;;
3878862f5301Smrg
3879862f5301Smrgrdos*)
3880862f5301Smrg  dynamic_linker=no
3881862f5301Smrg  ;;
3882862f5301Smrg
3883862f5301Smrgsolaris*)
3884862f5301Smrg  version_type=linux
3885862f5301Smrg  need_lib_prefix=no
3886862f5301Smrg  need_version=no
3887862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3888862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3889862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3890862f5301Smrg  shlibpath_overrides_runpath=yes
3891862f5301Smrg  hardcode_into_libs=yes
3892862f5301Smrg  # ldd complains unless libraries are executable
3893862f5301Smrg  postinstall_cmds='chmod +x $lib'
3894862f5301Smrg  ;;
3895862f5301Smrg
3896862f5301Smrgsunos4*)
3897862f5301Smrg  version_type=sunos
3898862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3899862f5301Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3900862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3901862f5301Smrg  shlibpath_overrides_runpath=yes
3902862f5301Smrg  if test "$with_gnu_ld" = yes; then
3903862f5301Smrg    need_lib_prefix=no
3904862f5301Smrg  fi
3905862f5301Smrg  need_version=yes
3906862f5301Smrg  ;;
3907862f5301Smrg
3908862f5301Smrgsysv4 | sysv4.3*)
3909862f5301Smrg  version_type=linux
3910862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3911862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3912862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3913862f5301Smrg  case $host_vendor in
3914862f5301Smrg    sni)
3915862f5301Smrg      shlibpath_overrides_runpath=no
3916862f5301Smrg      need_lib_prefix=no
3917862f5301Smrg      runpath_var=LD_RUN_PATH
3918862f5301Smrg      ;;
3919862f5301Smrg    siemens)
3920862f5301Smrg      need_lib_prefix=no
3921862f5301Smrg      ;;
3922862f5301Smrg    motorola)
3923862f5301Smrg      need_lib_prefix=no
3924862f5301Smrg      need_version=no
3925862f5301Smrg      shlibpath_overrides_runpath=no
3926862f5301Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3927862f5301Smrg      ;;
392844dda7b2Smrg  esac
3929862f5301Smrg  ;;
393044dda7b2Smrg
3931862f5301Smrgsysv4*MP*)
3932862f5301Smrg  if test -d /usr/nec ;then
3933862f5301Smrg    version_type=linux
3934862f5301Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3935862f5301Smrg    soname_spec='$libname${shared_ext}.$major'
3936862f5301Smrg    shlibpath_var=LD_LIBRARY_PATH
3937862f5301Smrg  fi
393844dda7b2Smrg  ;;
393944dda7b2Smrg
3940862f5301Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3941862f5301Smrg  version_type=freebsd-elf
394244dda7b2Smrg  need_lib_prefix=no
394344dda7b2Smrg  need_version=no
3944862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3945862f5301Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3946862f5301Smrg  shlibpath_var=LD_LIBRARY_PATH
3947862f5301Smrg  shlibpath_overrides_runpath=yes
394844dda7b2Smrg  hardcode_into_libs=yes
3949862f5301Smrg  if test "$with_gnu_ld" = yes; then
3950862f5301Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
395144dda7b2Smrg  else
3952862f5301Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
395344dda7b2Smrg    case $host_os in
3954862f5301Smrg      sco3.2v5*)
3955862f5301Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3956862f5301Smrg	;;
395744dda7b2Smrg    esac
395844dda7b2Smrg  fi
3959862f5301Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
396044dda7b2Smrg  ;;
3961ff559fabSmrg
3962862f5301Smrgtpf*)
3963862f5301Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
396444dda7b2Smrg  version_type=linux
3965862f5301Smrg  need_lib_prefix=no
396644dda7b2Smrg  need_version=no
396744dda7b2Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
396844dda7b2Smrg  shlibpath_var=LD_LIBRARY_PATH
3969862f5301Smrg  shlibpath_overrides_runpath=no
3970862f5301Smrg  hardcode_into_libs=yes
397144dda7b2Smrg  ;;
3972ff559fabSmrg
3973862f5301Smrguts4*)
397444dda7b2Smrg  version_type=linux
3975862f5301Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
397644dda7b2Smrg  soname_spec='${libname}${release}${shared_ext}$major'
397744dda7b2Smrg  shlibpath_var=LD_LIBRARY_PATH
397844dda7b2Smrg  ;;
397944dda7b2Smrg
3980862f5301Smrg*)
398144dda7b2Smrg  dynamic_linker=no
398244dda7b2Smrg  ;;
3983862f5301Smrgesac
3984862f5301SmrgAC_MSG_RESULT([$dynamic_linker])
3985862f5301Smrgtest "$dynamic_linker" = no && can_build_shared=no
398644dda7b2Smrg
3987862f5301Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3988862f5301Smrgif test "$GCC" = yes; then
3989862f5301Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3990862f5301Smrgfi
399144dda7b2Smrg
3992862f5301Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3993862f5301Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3994862f5301Smrgfi
3995862f5301Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3996862f5301Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3997862f5301Smrgfi
3998ff559fabSmrg
3999862f5301Smrg_LT_DECL([], [variables_saved_for_relink], [1],
4000862f5301Smrg    [Variables whose values should be saved in libtool wrapper scripts and
4001862f5301Smrg    restored at link time])
4002862f5301Smrg_LT_DECL([], [need_lib_prefix], [0],
4003862f5301Smrg    [Do we need the "lib" prefix for modules?])
4004862f5301Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
4005862f5301Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
4006862f5301Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
4007862f5301Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
4008862f5301Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
4009862f5301Smrg    [Is shlibpath searched before the hard-coded library search path?])
4010862f5301Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
4011862f5301Smrg_LT_DECL([], [library_names_spec], [1],
4012862f5301Smrg    [[List of archive names.  First name is the real one, the rest are links.
4013862f5301Smrg    The last name is the one that the linker finds with -lNAME]])
4014862f5301Smrg_LT_DECL([], [soname_spec], [1],
4015862f5301Smrg    [[The coded name of the library, if different from the real name]])
4016862f5301Smrg_LT_DECL([], [install_override_mode], [1],
4017862f5301Smrg    [Permission mode override for installation of shared libraries])
4018862f5301Smrg_LT_DECL([], [postinstall_cmds], [2],
4019862f5301Smrg    [Command to use after installation of a shared archive])
4020862f5301Smrg_LT_DECL([], [postuninstall_cmds], [2],
4021862f5301Smrg    [Command to use after uninstallation of a shared archive])
4022862f5301Smrg_LT_DECL([], [finish_cmds], [2],
4023862f5301Smrg    [Commands used to finish a libtool library installation in a directory])
4024862f5301Smrg_LT_DECL([], [finish_eval], [1],
4025862f5301Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
4026862f5301Smrg    not shown]])
4027862f5301Smrg_LT_DECL([], [hardcode_into_libs], [0],
4028862f5301Smrg    [Whether we should hardcode library paths into libraries])
4029862f5301Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
4030862f5301Smrg    [Compile-time system search path for libraries])
4031862f5301Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
4032862f5301Smrg    [Run-time system search path for libraries])
4033862f5301Smrg])# _LT_SYS_DYNAMIC_LINKER
403444dda7b2Smrg
403544dda7b2Smrg
4036862f5301Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
4037862f5301Smrg# --------------------------
4038862f5301Smrg# find a file program which can recognize shared library
4039862f5301SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
4040862f5301Smrg[m4_require([_LT_DECL_EGREP])dnl
4041862f5301SmrgAC_MSG_CHECKING([for $1])
4042862f5301SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4043862f5301Smrg[case $MAGIC_CMD in
4044862f5301Smrg[[\\/*] |  ?:[\\/]*])
4045862f5301Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
404644dda7b2Smrg  ;;
4047862f5301Smrg*)
4048862f5301Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
4049862f5301Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4050862f5301Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
4051862f5301Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
4052862f5301Smrgdnl not every word.  This closes a longstanding sh security hole.
4053862f5301Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
4054862f5301Smrg  for ac_dir in $ac_dummy; do
4055862f5301Smrg    IFS="$lt_save_ifs"
4056862f5301Smrg    test -z "$ac_dir" && ac_dir=.
4057862f5301Smrg    if test -f $ac_dir/$1; then
4058862f5301Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4059862f5301Smrg      if test -n "$file_magic_test_file"; then
4060862f5301Smrg	case $deplibs_check_method in
4061862f5301Smrg	"file_magic "*)
4062862f5301Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
4063862f5301Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4064862f5301Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4065862f5301Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
4066862f5301Smrg	    :
4067862f5301Smrg	  else
4068862f5301Smrg	    cat <<_LT_EOF 1>&2
4069ff559fabSmrg
4070862f5301Smrg*** Warning: the command libtool uses to detect shared libraries,
4071862f5301Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
4072862f5301Smrg*** The result is that libtool may fail to recognize shared libraries
4073862f5301Smrg*** as such.  This will affect the creation of libtool libraries that
4074862f5301Smrg*** depend on shared libraries, but programs linked with such libtool
4075862f5301Smrg*** libraries will work regardless of this problem.  Nevertheless, you
4076862f5301Smrg*** may want to report the problem to your system manager and/or to
4077862f5301Smrg*** bug-libtool@gnu.org
4078ff559fabSmrg
4079862f5301Smrg_LT_EOF
4080862f5301Smrg	  fi ;;
4081862f5301Smrg	esac
4082862f5301Smrg      fi
4083862f5301Smrg      break
4084862f5301Smrg    fi
4085862f5301Smrg  done
4086862f5301Smrg  IFS="$lt_save_ifs"
4087862f5301Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
408844dda7b2Smrg  ;;
4089862f5301Smrgesac])
4090862f5301SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4091862f5301Smrgif test -n "$MAGIC_CMD"; then
4092862f5301Smrg  AC_MSG_RESULT($MAGIC_CMD)
4093862f5301Smrgelse
4094862f5301Smrg  AC_MSG_RESULT(no)
4095862f5301Smrgfi
4096862f5301Smrg_LT_DECL([], [MAGIC_CMD], [0],
4097862f5301Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4098862f5301Smrg])# _LT_PATH_TOOL_PREFIX
4099ff559fabSmrg
4100862f5301Smrg# Old name:
4101862f5301SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4102862f5301Smrgdnl aclocal-1.4 backwards compatibility:
4103862f5301Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4104ff559fabSmrg
4105ff559fabSmrg
4106862f5301Smrg# _LT_PATH_MAGIC
4107862f5301Smrg# --------------
4108862f5301Smrg# find a file program which can recognize a shared library
4109862f5301Smrgm4_defun([_LT_PATH_MAGIC],
4110862f5301Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4111862f5301Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
4112862f5301Smrg  if test -n "$ac_tool_prefix"; then
4113862f5301Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
411444dda7b2Smrg  else
4115862f5301Smrg    MAGIC_CMD=:
411644dda7b2Smrg  fi
4117862f5301Smrgfi
4118862f5301Smrg])# _LT_PATH_MAGIC
4119ff559fabSmrg
4120ff559fabSmrg
4121862f5301Smrg# LT_PATH_LD
4122862f5301Smrg# ----------
4123862f5301Smrg# find the pathname to the GNU or non-GNU linker
4124862f5301SmrgAC_DEFUN([LT_PATH_LD],
4125862f5301Smrg[AC_REQUIRE([AC_PROG_CC])dnl
4126862f5301SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
4127862f5301SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
4128862f5301Smrgm4_require([_LT_DECL_SED])dnl
4129862f5301Smrgm4_require([_LT_DECL_EGREP])dnl
4130862f5301Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
413144dda7b2Smrg
4132862f5301SmrgAC_ARG_WITH([gnu-ld],
4133862f5301Smrg    [AS_HELP_STRING([--with-gnu-ld],
4134862f5301Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4135862f5301Smrg    [test "$withval" = no || with_gnu_ld=yes],
4136862f5301Smrg    [with_gnu_ld=no])dnl
4137862f5301Smrg
4138862f5301Smrgac_prog=ld
4139862f5301Smrgif test "$GCC" = yes; then
4140862f5301Smrg  # Check if gcc -print-prog-name=ld gives a path.
4141862f5301Smrg  AC_MSG_CHECKING([for ld used by $CC])
4142862f5301Smrg  case $host in
4143862f5301Smrg  *-*-mingw*)
4144862f5301Smrg    # gcc leaves a trailing carriage return which upsets mingw
4145862f5301Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4146862f5301Smrg  *)
4147862f5301Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
414844dda7b2Smrg  esac
4149862f5301Smrg  case $ac_prog in
4150862f5301Smrg    # Accept absolute paths.
4151862f5301Smrg    [[\\/]]* | ?:[[\\/]]*)
4152862f5301Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
4153862f5301Smrg      # Canonicalize the pathname of ld
4154862f5301Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4155862f5301Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4156862f5301Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4157862f5301Smrg      done
4158862f5301Smrg      test -z "$LD" && LD="$ac_prog"
4159862f5301Smrg      ;;
4160862f5301Smrg  "")
4161862f5301Smrg    # If it fails, then pretend we aren't using GCC.
4162862f5301Smrg    ac_prog=ld
4163862f5301Smrg    ;;
4164862f5301Smrg  *)
4165862f5301Smrg    # If it is relative, then search for the first ld in PATH.
4166862f5301Smrg    with_gnu_ld=unknown
4167862f5301Smrg    ;;
4168862f5301Smrg  esac
4169862f5301Smrgelif test "$with_gnu_ld" = yes; then
4170862f5301Smrg  AC_MSG_CHECKING([for GNU ld])
4171862f5301Smrgelse
4172862f5301Smrg  AC_MSG_CHECKING([for non-GNU ld])
4173862f5301Smrgfi
4174862f5301SmrgAC_CACHE_VAL(lt_cv_path_LD,
4175862f5301Smrg[if test -z "$LD"; then
4176862f5301Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4177862f5301Smrg  for ac_dir in $PATH; do
4178862f5301Smrg    IFS="$lt_save_ifs"
4179862f5301Smrg    test -z "$ac_dir" && ac_dir=.
4180862f5301Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4181862f5301Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
4182862f5301Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
4183862f5301Smrg      # but apparently some variants of GNU ld only accept -v.
4184862f5301Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
4185862f5301Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4186862f5301Smrg      *GNU* | *'with BFD'*)
4187862f5301Smrg	test "$with_gnu_ld" != no && break
418844dda7b2Smrg	;;
418944dda7b2Smrg      *)
4190862f5301Smrg	test "$with_gnu_ld" != yes && break
419144dda7b2Smrg	;;
41927a3b38f7Smrg      esac
4193862f5301Smrg    fi
4194862f5301Smrg  done
4195862f5301Smrg  IFS="$lt_save_ifs"
4196862f5301Smrgelse
4197862f5301Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4198862f5301Smrgfi])
4199862f5301SmrgLD="$lt_cv_path_LD"
4200862f5301Smrgif test -n "$LD"; then
4201862f5301Smrg  AC_MSG_RESULT($LD)
4202862f5301Smrgelse
4203862f5301Smrg  AC_MSG_RESULT(no)
4204862f5301Smrgfi
4205862f5301Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4206862f5301Smrg_LT_PATH_LD_GNU
4207862f5301SmrgAC_SUBST([LD])
4208ff559fabSmrg
4209862f5301Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4210862f5301Smrg])# LT_PATH_LD
4211ff559fabSmrg
4212862f5301Smrg# Old names:
4213862f5301SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4214862f5301SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4215862f5301Smrgdnl aclocal-1.4 backwards compatibility:
4216862f5301Smrgdnl AC_DEFUN([AM_PROG_LD], [])
4217862f5301Smrgdnl AC_DEFUN([AC_PROG_LD], [])
4218ff559fabSmrg
4219ff559fabSmrg
4220862f5301Smrg# _LT_PATH_LD_GNU
4221862f5301Smrg#- --------------
4222862f5301Smrgm4_defun([_LT_PATH_LD_GNU],
4223862f5301Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4224862f5301Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4225862f5301Smrgcase `$LD -v 2>&1 </dev/null` in
4226862f5301Smrg*GNU* | *'with BFD'*)
4227862f5301Smrg  lt_cv_prog_gnu_ld=yes
422844dda7b2Smrg  ;;
4229862f5301Smrg*)
4230862f5301Smrg  lt_cv_prog_gnu_ld=no
423144dda7b2Smrg  ;;
4232862f5301Smrgesac])
4233862f5301Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
4234862f5301Smrg])# _LT_PATH_LD_GNU
4235ff559fabSmrg
4236862f5301Smrg
4237862f5301Smrg# _LT_CMD_RELOAD
4238862f5301Smrg# --------------
4239862f5301Smrg# find reload flag for linker
4240862f5301Smrg#   -- PORTME Some linkers may need a different reload flag.
4241862f5301Smrgm4_defun([_LT_CMD_RELOAD],
4242862f5301Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
4243862f5301Smrg  lt_cv_ld_reload_flag,
4244862f5301Smrg  [lt_cv_ld_reload_flag='-r'])
4245862f5301Smrgreload_flag=$lt_cv_ld_reload_flag
4246862f5301Smrgcase $reload_flag in
4247862f5301Smrg"" | " "*) ;;
4248862f5301Smrg*) reload_flag=" $reload_flag" ;;
4249862f5301Smrgesac
4250862f5301Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
4251862f5301Smrgcase $host_os in
4252862f5301Smrg  cygwin* | mingw* | pw32* | cegcc*)
4253862f5301Smrg    if test "$GCC" != yes; then
4254862f5301Smrg      reload_cmds=false
4255862f5301Smrg    fi
4256862f5301Smrg    ;;
4257862f5301Smrg  darwin*)
4258862f5301Smrg    if test "$GCC" = yes; then
4259862f5301Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4260862f5301Smrg    else
4261862f5301Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4262862f5301Smrg    fi
4263862f5301Smrg    ;;
4264862f5301Smrgesac
4265862f5301Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4266862f5301Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
4267862f5301Smrg])# _LT_CMD_RELOAD
4268862f5301Smrg
4269862f5301Smrg
4270862f5301Smrg# _LT_CHECK_MAGIC_METHOD
4271862f5301Smrg# ----------------------
4272862f5301Smrg# how to check for library dependencies
4273862f5301Smrg#  -- PORTME fill in with the dynamic library characteristics
4274862f5301Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
4275862f5301Smrg[m4_require([_LT_DECL_EGREP])
4276862f5301Smrgm4_require([_LT_DECL_OBJDUMP])
4277862f5301SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
4278862f5301Smrglt_cv_deplibs_check_method,
4279862f5301Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
4280862f5301Smrglt_cv_file_magic_test_file=
4281862f5301Smrglt_cv_deplibs_check_method='unknown'
4282862f5301Smrg# Need to set the preceding variable on all platforms that support
4283862f5301Smrg# interlibrary dependencies.
4284862f5301Smrg# 'none' -- dependencies not supported.
4285862f5301Smrg# `unknown' -- same as none, but documents that we really don't know.
4286862f5301Smrg# 'pass_all' -- all dependencies passed with no checks.
4287862f5301Smrg# 'test_compile' -- check by making test program.
4288862f5301Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
4289862f5301Smrg# which responds to the $file_magic_cmd with a given extended regex.
4290862f5301Smrg# If you have `file' or equivalent on your system and you're not sure
4291862f5301Smrg# whether `pass_all' will *always* work, you probably want this one.
4292862f5301Smrg
4293862f5301Smrgcase $host_os in
4294862f5301Smrgaix[[4-9]]*)
4295862f5301Smrg  lt_cv_deplibs_check_method=pass_all
429644dda7b2Smrg  ;;
4297ff559fabSmrg
4298862f5301Smrgbeos*)
4299862f5301Smrg  lt_cv_deplibs_check_method=pass_all
430044dda7b2Smrg  ;;
4301ff559fabSmrg
4302862f5301Smrgbsdi[[45]]*)
4303862f5301Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4304862f5301Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
4305862f5301Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
4306862f5301Smrg  ;;
4307862f5301Smrg
4308862f5301Smrgcygwin*)
4309862f5301Smrg  # func_win32_libid is a shell function defined in ltmain.sh
4310862f5301Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4311862f5301Smrg  lt_cv_file_magic_cmd='func_win32_libid'
4312862f5301Smrg  ;;
4313862f5301Smrg
4314862f5301Smrgmingw* | pw32*)
4315862f5301Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
4316862f5301Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4317862f5301Smrg  # unless we find 'file', for example because we are cross-compiling.
4318862f5301Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4319862f5301Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4320862f5301Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4321862f5301Smrg    lt_cv_file_magic_cmd='func_win32_libid'
432244dda7b2Smrg  else
4323862f5301Smrg    # Keep this pattern in sync with the one in func_win32_libid.
4324862f5301Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4325862f5301Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
432644dda7b2Smrg  fi
432744dda7b2Smrg  ;;
4328ff559fabSmrg
4329862f5301Smrgcegcc*)
4330862f5301Smrg  # use the weaker test based on 'objdump'. See mingw*.
4331862f5301Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4332862f5301Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
433344dda7b2Smrg  ;;
4334ff559fabSmrg
4335862f5301Smrgdarwin* | rhapsody*)
4336862f5301Smrg  lt_cv_deplibs_check_method=pass_all
433744dda7b2Smrg  ;;
4338ff559fabSmrg
4339862f5301Smrgfreebsd* | dragonfly*)
4340862f5301Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4341862f5301Smrg    case $host_cpu in
4342862f5301Smrg    i*86 )
4343862f5301Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
4344862f5301Smrg      # Let's accept both of them until this is cleared up.
4345862f5301Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4346862f5301Smrg      lt_cv_file_magic_cmd=/usr/bin/file
4347862f5301Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4348862f5301Smrg      ;;
4349862f5301Smrg    esac
4350862f5301Smrg  else
4351862f5301Smrg    lt_cv_deplibs_check_method=pass_all
4352862f5301Smrg  fi
435344dda7b2Smrg  ;;
4354ff559fabSmrg
4355862f5301Smrggnu*)
4356862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4357862f5301Smrg  ;;
4358ff559fabSmrg
4359862f5301Smrghaiku*)
4360862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4361862f5301Smrg  ;;
4362ff559fabSmrg
4363862f5301Smrghpux10.20* | hpux11*)
4364862f5301Smrg  lt_cv_file_magic_cmd=/usr/bin/file
4365862f5301Smrg  case $host_cpu in
4366862f5301Smrg  ia64*)
4367862f5301Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4368862f5301Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4369862f5301Smrg    ;;
4370862f5301Smrg  hppa*64*)
4371862f5301Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
4372862f5301Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4373862f5301Smrg    ;;
4374862f5301Smrg  *)
4375862f5301Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4376862f5301Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4377862f5301Smrg    ;;
4378862f5301Smrg  esac
4379862f5301Smrg  ;;
4380ff559fabSmrg
4381862f5301Smrginterix[[3-9]]*)
4382862f5301Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4383862f5301Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
438444dda7b2Smrg  ;;
4385ff559fabSmrg
4386862f5301Smrgirix5* | irix6* | nonstopux*)
4387862f5301Smrg  case $LD in
4388862f5301Smrg  *-32|*"-32 ") libmagic=32-bit;;
4389862f5301Smrg  *-n32|*"-n32 ") libmagic=N32;;
4390862f5301Smrg  *-64|*"-64 ") libmagic=64-bit;;
4391862f5301Smrg  *) libmagic=never-match;;
4392862f5301Smrg  esac
4393862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4394862f5301Smrg  ;;
439544dda7b2Smrg
4396862f5301Smrg# This must be Linux ELF.
4397862f5301Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
4398862f5301Smrg  lt_cv_deplibs_check_method=pass_all
439944dda7b2Smrg  ;;
440044dda7b2Smrg
4401862f5301Smrgnetbsd*)
4402862f5301Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4403862f5301Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4404862f5301Smrg  else
4405862f5301Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4406862f5301Smrg  fi
4407862f5301Smrg  ;;
4408ff559fabSmrg
4409862f5301Smrgnewos6*)
4410862f5301Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4411862f5301Smrg  lt_cv_file_magic_cmd=/usr/bin/file
4412862f5301Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4413862f5301Smrg  ;;
4414ff559fabSmrg
4415862f5301Smrg*nto* | *qnx*)
4416862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4417862f5301Smrg  ;;
4418862f5301Smrg
4419862f5301Smrgopenbsd*)
4420862f5301Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4421862f5301Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
442244dda7b2Smrg  else
4423862f5301Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
442444dda7b2Smrg  fi
4425862f5301Smrg  ;;
4426ff559fabSmrg
4427862f5301Smrgosf3* | osf4* | osf5*)
4428862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4429862f5301Smrg  ;;
4430ff559fabSmrg
4431862f5301Smrgrdos*)
4432862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4433862f5301Smrg  ;;
4434ff559fabSmrg
4435862f5301Smrgsolaris*)
4436862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4437862f5301Smrg  ;;
4438ff559fabSmrg
4439862f5301Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4440862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4441862f5301Smrg  ;;
4442862f5301Smrg
4443862f5301Smrgsysv4 | sysv4.3*)
4444862f5301Smrg  case $host_vendor in
4445862f5301Smrg  motorola)
4446862f5301Smrg    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]]'
4447862f5301Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
444844dda7b2Smrg    ;;
4449862f5301Smrg  ncr)
4450862f5301Smrg    lt_cv_deplibs_check_method=pass_all
4451862f5301Smrg    ;;
4452862f5301Smrg  sequent)
4453862f5301Smrg    lt_cv_file_magic_cmd='/bin/file'
4454862f5301Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4455862f5301Smrg    ;;
4456862f5301Smrg  sni)
4457862f5301Smrg    lt_cv_file_magic_cmd='/bin/file'
4458862f5301Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4459862f5301Smrg    lt_cv_file_magic_test_file=/lib/libc.so
4460862f5301Smrg    ;;
4461862f5301Smrg  siemens)
4462862f5301Smrg    lt_cv_deplibs_check_method=pass_all
4463862f5301Smrg    ;;
4464862f5301Smrg  pc)
4465862f5301Smrg    lt_cv_deplibs_check_method=pass_all
446644dda7b2Smrg    ;;
446744dda7b2Smrg  esac
446844dda7b2Smrg  ;;
446944dda7b2Smrg
4470862f5301Smrgtpf*)
4471862f5301Smrg  lt_cv_deplibs_check_method=pass_all
4472862f5301Smrg  ;;
447344dda7b2Smrgesac
4474862f5301Smrg])
4475862f5301Smrg
4476862f5301Smrgfile_magic_glob=
4477862f5301Smrgwant_nocaseglob=no
4478862f5301Smrgif test "$build" = "$host"; then
4479862f5301Smrg  case $host_os in
4480862f5301Smrg  mingw* | pw32*)
4481862f5301Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4482862f5301Smrg      want_nocaseglob=yes
448344dda7b2Smrg    else
4484862f5301Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
448544dda7b2Smrg    fi
448644dda7b2Smrg    ;;
4487862f5301Smrg  esac
4488862f5301Smrgfi
4489ff559fabSmrg
4490862f5301Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
4491862f5301Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
4492862f5301Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
4493ff559fabSmrg
449444dda7b2Smrg_LT_DECL([], [deplibs_check_method], [1],
449544dda7b2Smrg    [Method to check whether dependent libraries are shared objects])
449644dda7b2Smrg_LT_DECL([], [file_magic_cmd], [1],
4497862f5301Smrg    [Command to use when deplibs_check_method = "file_magic"])
4498862f5301Smrg_LT_DECL([], [file_magic_glob], [1],
4499862f5301Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
4500862f5301Smrg_LT_DECL([], [want_nocaseglob], [1],
4501862f5301Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
450244dda7b2Smrg])# _LT_CHECK_MAGIC_METHOD
4503ff559fabSmrg
4504ff559fabSmrg
450544dda7b2Smrg# LT_PATH_NM
450644dda7b2Smrg# ----------
450744dda7b2Smrg# find the pathname to a BSD- or MS-compatible name lister
450844dda7b2SmrgAC_DEFUN([LT_PATH_NM],
450944dda7b2Smrg[AC_REQUIRE([AC_PROG_CC])dnl
451044dda7b2SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
451144dda7b2Smrg[if test -n "$NM"; then
451244dda7b2Smrg  # Let the user override the test.
451344dda7b2Smrg  lt_cv_path_NM="$NM"
45147a3b38f7Smrgelse
451544dda7b2Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
451644dda7b2Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
451744dda7b2Smrg    lt_nm_to_check="$lt_nm_to_check nm"
451844dda7b2Smrg  fi
451944dda7b2Smrg  for lt_tmp_nm in $lt_nm_to_check; do
452044dda7b2Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
452144dda7b2Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
452244dda7b2Smrg      IFS="$lt_save_ifs"
452344dda7b2Smrg      test -z "$ac_dir" && ac_dir=.
452444dda7b2Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
452544dda7b2Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
452644dda7b2Smrg	# Check to see if the nm accepts a BSD-compat flag.
452744dda7b2Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
452844dda7b2Smrg	#   nm: unknown option "B" ignored
452944dda7b2Smrg	# Tru64's nm complains that /dev/null is an invalid object file
453044dda7b2Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
453144dda7b2Smrg	*/dev/null* | *'Invalid file or object type'*)
453244dda7b2Smrg	  lt_cv_path_NM="$tmp_nm -B"
453344dda7b2Smrg	  break
453444dda7b2Smrg	  ;;
453544dda7b2Smrg	*)
453644dda7b2Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
453744dda7b2Smrg	  */dev/null*)
453844dda7b2Smrg	    lt_cv_path_NM="$tmp_nm -p"
453944dda7b2Smrg	    break
454044dda7b2Smrg	    ;;
454144dda7b2Smrg	  *)
454244dda7b2Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
454344dda7b2Smrg	    continue # so that we can try to find one that supports BSD flags
454444dda7b2Smrg	    ;;
454544dda7b2Smrg	  esac
454644dda7b2Smrg	  ;;
454744dda7b2Smrg	esac
454844dda7b2Smrg      fi
454944dda7b2Smrg    done
455044dda7b2Smrg    IFS="$lt_save_ifs"
455144dda7b2Smrg  done
455244dda7b2Smrg  : ${lt_cv_path_NM=no}
455344dda7b2Smrgfi])
455444dda7b2Smrgif test "$lt_cv_path_NM" != "no"; then
455544dda7b2Smrg  NM="$lt_cv_path_NM"
455644dda7b2Smrgelse
455744dda7b2Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
455844dda7b2Smrg  if test -n "$DUMPBIN"; then :
455944dda7b2Smrg    # Let the user override the test.
456044dda7b2Smrg  else
456144dda7b2Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
456244dda7b2Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
456344dda7b2Smrg    *COFF*)
456444dda7b2Smrg      DUMPBIN="$DUMPBIN -symbols"
456544dda7b2Smrg      ;;
456644dda7b2Smrg    *)
456744dda7b2Smrg      DUMPBIN=:
456844dda7b2Smrg      ;;
456944dda7b2Smrg    esac
457044dda7b2Smrg  fi
457144dda7b2Smrg  AC_SUBST([DUMPBIN])
457244dda7b2Smrg  if test "$DUMPBIN" != ":"; then
457344dda7b2Smrg    NM="$DUMPBIN"
457444dda7b2Smrg  fi
45757a3b38f7Smrgfi
457644dda7b2Smrgtest -z "$NM" && NM=nm
457744dda7b2SmrgAC_SUBST([NM])
457844dda7b2Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
457944dda7b2Smrg
458044dda7b2SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
458144dda7b2Smrg  [lt_cv_nm_interface="BSD nm"
458244dda7b2Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
458344dda7b2Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
458444dda7b2Smrg  (eval "$ac_compile" 2>conftest.err)
458544dda7b2Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
458644dda7b2Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
458744dda7b2Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
458844dda7b2Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
458944dda7b2Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
459044dda7b2Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
459144dda7b2Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
459244dda7b2Smrg    lt_cv_nm_interface="MS dumpbin"
459344dda7b2Smrg  fi
459444dda7b2Smrg  rm -f conftest*])
459544dda7b2Smrg])# LT_PATH_NM
4596ff559fabSmrg
459744dda7b2Smrg# Old names:
459844dda7b2SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
459944dda7b2SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
46007a3b38f7Smrgdnl aclocal-1.4 backwards compatibility:
460144dda7b2Smrgdnl AC_DEFUN([AM_PROG_NM], [])
460244dda7b2Smrgdnl AC_DEFUN([AC_PROG_NM], [])
4603ff559fabSmrg
4604862f5301Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4605862f5301Smrg# --------------------------------
4606862f5301Smrg# how to determine the name of the shared library
4607862f5301Smrg# associated with a specific link library.
4608862f5301Smrg#  -- PORTME fill in with the dynamic library characteristics
4609862f5301Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4610862f5301Smrg[m4_require([_LT_DECL_EGREP])
4611862f5301Smrgm4_require([_LT_DECL_OBJDUMP])
4612862f5301Smrgm4_require([_LT_DECL_DLLTOOL])
4613862f5301SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
4614862f5301Smrglt_cv_sharedlib_from_linklib_cmd,
4615862f5301Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
4616862f5301Smrg
4617862f5301Smrgcase $host_os in
4618862f5301Smrgcygwin* | mingw* | pw32* | cegcc*)
4619862f5301Smrg  # two different shell functions defined in ltmain.sh
4620862f5301Smrg  # decide which to use based on capabilities of $DLLTOOL
4621862f5301Smrg  case `$DLLTOOL --help 2>&1` in
4622862f5301Smrg  *--identify-strict*)
4623862f5301Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4624862f5301Smrg    ;;
4625862f5301Smrg  *)
4626862f5301Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4627862f5301Smrg    ;;
4628862f5301Smrg  esac
4629862f5301Smrg  ;;
4630862f5301Smrg*)
4631862f5301Smrg  # fallback: assume linklib IS sharedlib
4632862f5301Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4633862f5301Smrg  ;;
4634862f5301Smrgesac
4635862f5301Smrg])
4636862f5301Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4637862f5301Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4638862f5301Smrg
4639862f5301Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4640862f5301Smrg    [Command to associate shared and link libraries])
4641862f5301Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4642862f5301Smrg
4643862f5301Smrg
4644862f5301Smrg# _LT_PATH_MANIFEST_TOOL
4645862f5301Smrg# ----------------------
4646862f5301Smrg# locate the manifest tool
4647862f5301Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
4648862f5301Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4649862f5301Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4650862f5301SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4651862f5301Smrg  [lt_cv_path_mainfest_tool=no
4652862f5301Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4653862f5301Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4654862f5301Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
4655862f5301Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4656862f5301Smrg    lt_cv_path_mainfest_tool=yes
4657862f5301Smrg  fi
4658862f5301Smrg  rm -f conftest*])
4659862f5301Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
4660862f5301Smrg  MANIFEST_TOOL=:
4661862f5301Smrgfi
4662862f5301Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4663862f5301Smrg])# _LT_PATH_MANIFEST_TOOL
4664862f5301Smrg
4665ff559fabSmrg
466644dda7b2Smrg# LT_LIB_M
466744dda7b2Smrg# --------
466844dda7b2Smrg# check for math library
466944dda7b2SmrgAC_DEFUN([LT_LIB_M],
467044dda7b2Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
467144dda7b2SmrgLIBM=
467244dda7b2Smrgcase $host in
467344dda7b2Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
467444dda7b2Smrg  # These system don't have libm, or don't need it
467544dda7b2Smrg  ;;
467644dda7b2Smrg*-ncr-sysv4.3*)
467744dda7b2Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
467844dda7b2Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
467944dda7b2Smrg  ;;
468044dda7b2Smrg*)
468144dda7b2Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
468244dda7b2Smrg  ;;
468344dda7b2Smrgesac
468444dda7b2SmrgAC_SUBST([LIBM])
468544dda7b2Smrg])# LT_LIB_M
468644dda7b2Smrg
468744dda7b2Smrg# Old name:
468844dda7b2SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
468944dda7b2Smrgdnl aclocal-1.4 backwards compatibility:
469044dda7b2Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
46917a3b38f7Smrg
4692ff559fabSmrg
469344dda7b2Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
469444dda7b2Smrg# -------------------------------
469544dda7b2Smrgm4_defun([_LT_COMPILER_NO_RTTI],
469644dda7b2Smrg[m4_require([_LT_TAG_COMPILER])dnl
4697ff559fabSmrg
469844dda7b2Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
46997a3b38f7Smrg
470044dda7b2Smrgif test "$GCC" = yes; then
470144dda7b2Smrg  case $cc_basename in
470244dda7b2Smrg  nvcc*)
470344dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
470444dda7b2Smrg  *)
470544dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
470644dda7b2Smrg  esac
47077a3b38f7Smrg
470844dda7b2Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
470944dda7b2Smrg    lt_cv_prog_compiler_rtti_exceptions,
471044dda7b2Smrg    [-fno-rtti -fno-exceptions], [],
471144dda7b2Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
471244dda7b2Smrgfi
471344dda7b2Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
471444dda7b2Smrg	[Compiler flag to turn off builtin functions])
471544dda7b2Smrg])# _LT_COMPILER_NO_RTTI
47167a3b38f7Smrg
47177a3b38f7Smrg
471844dda7b2Smrg# _LT_CMD_GLOBAL_SYMBOLS
471944dda7b2Smrg# ----------------------
472044dda7b2Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
472144dda7b2Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
472244dda7b2SmrgAC_REQUIRE([AC_PROG_CC])dnl
472344dda7b2SmrgAC_REQUIRE([AC_PROG_AWK])dnl
472444dda7b2SmrgAC_REQUIRE([LT_PATH_NM])dnl
472544dda7b2SmrgAC_REQUIRE([LT_PATH_LD])dnl
472644dda7b2Smrgm4_require([_LT_DECL_SED])dnl
472744dda7b2Smrgm4_require([_LT_DECL_EGREP])dnl
472844dda7b2Smrgm4_require([_LT_TAG_COMPILER])dnl
47297a3b38f7Smrg
473044dda7b2Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
473144dda7b2SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
473244dda7b2SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
473344dda7b2Smrg[
473444dda7b2Smrg# These are sane defaults that work on at least a few old systems.
473544dda7b2Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4736ff559fabSmrg
473744dda7b2Smrg# Character class describing NM global symbol codes.
473844dda7b2Smrgsymcode='[[BCDEGRST]]'
4739ff559fabSmrg
474044dda7b2Smrg# Regexp to match symbols that can be accessed directly from C.
474144dda7b2Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4742ff559fabSmrg
474344dda7b2Smrg# Define system-specific variables.
474444dda7b2Smrgcase $host_os in
474544dda7b2Smrgaix*)
474644dda7b2Smrg  symcode='[[BCDT]]'
474744dda7b2Smrg  ;;
474844dda7b2Smrgcygwin* | mingw* | pw32* | cegcc*)
474944dda7b2Smrg  symcode='[[ABCDGISTW]]'
475044dda7b2Smrg  ;;
475144dda7b2Smrghpux*)
475244dda7b2Smrg  if test "$host_cpu" = ia64; then
475344dda7b2Smrg    symcode='[[ABCDEGRST]]'
475444dda7b2Smrg  fi
475544dda7b2Smrg  ;;
475644dda7b2Smrgirix* | nonstopux*)
475744dda7b2Smrg  symcode='[[BCDEGRST]]'
475844dda7b2Smrg  ;;
475944dda7b2Smrgosf*)
476044dda7b2Smrg  symcode='[[BCDEGQRST]]'
476144dda7b2Smrg  ;;
476244dda7b2Smrgsolaris*)
476344dda7b2Smrg  symcode='[[BDRT]]'
476444dda7b2Smrg  ;;
476544dda7b2Smrgsco3.2v5*)
476644dda7b2Smrg  symcode='[[DT]]'
476744dda7b2Smrg  ;;
476844dda7b2Smrgsysv4.2uw2*)
476944dda7b2Smrg  symcode='[[DT]]'
477044dda7b2Smrg  ;;
477144dda7b2Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
477244dda7b2Smrg  symcode='[[ABDT]]'
477344dda7b2Smrg  ;;
477444dda7b2Smrgsysv4)
477544dda7b2Smrg  symcode='[[DFNSTU]]'
477644dda7b2Smrg  ;;
477744dda7b2Smrgesac
4778ff559fabSmrg
477944dda7b2Smrg# If we're using GNU nm, then use its standard symbol codes.
478044dda7b2Smrgcase `$NM -V 2>&1` in
478144dda7b2Smrg*GNU* | *'with BFD'*)
478244dda7b2Smrg  symcode='[[ABCDGIRSTW]]' ;;
478344dda7b2Smrgesac
4784ff559fabSmrg
478544dda7b2Smrg# Transform an extracted symbol line into a proper C declaration.
478644dda7b2Smrg# Some systems (esp. on ia64) link data and code symbols differently,
478744dda7b2Smrg# so use this general approach.
478844dda7b2Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4789ff559fabSmrg
479044dda7b2Smrg# Transform an extracted symbol line into symbol name and symbol address
4791862f5301Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4792862f5301Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
4793ff559fabSmrg
479444dda7b2Smrg# Handle CRLF in mingw tool chain
479544dda7b2Smrgopt_cr=
479644dda7b2Smrgcase $build_os in
479744dda7b2Smrgmingw*)
479844dda7b2Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
479944dda7b2Smrg  ;;
480044dda7b2Smrgesac
48017a3b38f7Smrg
480244dda7b2Smrg# Try without a prefix underscore, then with it.
480344dda7b2Smrgfor ac_symprfx in "" "_"; do
4804ff559fabSmrg
480544dda7b2Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
480644dda7b2Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4807ff559fabSmrg
480844dda7b2Smrg  # Write the raw and C identifiers.
480944dda7b2Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
481044dda7b2Smrg    # Fake it for dumpbin and say T for any non-static function
481144dda7b2Smrg    # and D for any global variable.
481244dda7b2Smrg    # Also find C++ and __fastcall symbols from MSVC++,
481344dda7b2Smrg    # which start with @ or ?.
481444dda7b2Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
481544dda7b2Smrg"     {last_section=section; section=\$ 3};"\
481644dda7b2Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
481744dda7b2Smrg"     \$ 0!~/External *\|/{next};"\
481844dda7b2Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
481944dda7b2Smrg"     {if(hide[section]) next};"\
482044dda7b2Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
482144dda7b2Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
482244dda7b2Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
482344dda7b2Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
482444dda7b2Smrg"     ' prfx=^$ac_symprfx]"
482544dda7b2Smrg  else
482644dda7b2Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
482744dda7b2Smrg  fi
4828862f5301Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4829ff559fabSmrg
483044dda7b2Smrg  # Check to see that the pipe works correctly.
483144dda7b2Smrg  pipe_works=no
48327a3b38f7Smrg
483344dda7b2Smrg  rm -f conftest*
483444dda7b2Smrg  cat > conftest.$ac_ext <<_LT_EOF
483544dda7b2Smrg#ifdef __cplusplus
483644dda7b2Smrgextern "C" {
483744dda7b2Smrg#endif
483844dda7b2Smrgchar nm_test_var;
483944dda7b2Smrgvoid nm_test_func(void);
484044dda7b2Smrgvoid nm_test_func(void){}
484144dda7b2Smrg#ifdef __cplusplus
484244dda7b2Smrg}
484344dda7b2Smrg#endif
484444dda7b2Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
484544dda7b2Smrg_LT_EOF
4846ff559fabSmrg
484744dda7b2Smrg  if AC_TRY_EVAL(ac_compile); then
484844dda7b2Smrg    # Now try to grab the symbols.
484944dda7b2Smrg    nlist=conftest.nm
485044dda7b2Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
485144dda7b2Smrg      # Try sorting and uniquifying the output.
485244dda7b2Smrg      if sort "$nlist" | uniq > "$nlist"T; then
485344dda7b2Smrg	mv -f "$nlist"T "$nlist"
485444dda7b2Smrg      else
485544dda7b2Smrg	rm -f "$nlist"T
485644dda7b2Smrg      fi
4857ff559fabSmrg
485844dda7b2Smrg      # Make sure that we snagged all the symbols we need.
485944dda7b2Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
486044dda7b2Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
486144dda7b2Smrg	  cat <<_LT_EOF > conftest.$ac_ext
4862862f5301Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4863862f5301Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4864862f5301Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
4865862f5301Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4866862f5301Smrg# define LT@&t@_DLSYM_CONST
4867862f5301Smrg#elif defined(__osf__)
4868862f5301Smrg/* This system does not cope well with relocations in const data.  */
4869862f5301Smrg# define LT@&t@_DLSYM_CONST
4870862f5301Smrg#else
4871862f5301Smrg# define LT@&t@_DLSYM_CONST const
4872862f5301Smrg#endif
4873862f5301Smrg
487444dda7b2Smrg#ifdef __cplusplus
487544dda7b2Smrgextern "C" {
487644dda7b2Smrg#endif
48777a3b38f7Smrg
487844dda7b2Smrg_LT_EOF
487944dda7b2Smrg	  # Now generate the symbol file.
488044dda7b2Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
48817a3b38f7Smrg
488244dda7b2Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
4883ff559fabSmrg
488444dda7b2Smrg/* The mapping between symbol names and symbols.  */
4885862f5301SmrgLT@&t@_DLSYM_CONST struct {
488644dda7b2Smrg  const char *name;
488744dda7b2Smrg  void       *address;
488844dda7b2Smrg}
488944dda7b2Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
489044dda7b2Smrg{
489144dda7b2Smrg  { "@PROGRAM@", (void *) 0 },
489244dda7b2Smrg_LT_EOF
489344dda7b2Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
489444dda7b2Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
489544dda7b2Smrg  {0, (void *) 0}
489644dda7b2Smrg};
48977a3b38f7Smrg
489844dda7b2Smrg/* This works around a problem in FreeBSD linker */
489944dda7b2Smrg#ifdef FREEBSD_WORKAROUND
490044dda7b2Smrgstatic const void *lt_preloaded_setup() {
490144dda7b2Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
490244dda7b2Smrg}
490344dda7b2Smrg#endif
4904ff559fabSmrg
490544dda7b2Smrg#ifdef __cplusplus
490644dda7b2Smrg}
490744dda7b2Smrg#endif
490844dda7b2Smrg_LT_EOF
490944dda7b2Smrg	  # Now try linking the two files.
491044dda7b2Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
4911862f5301Smrg	  lt_globsym_save_LIBS=$LIBS
4912862f5301Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
491344dda7b2Smrg	  LIBS="conftstm.$ac_objext"
491444dda7b2Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
491544dda7b2Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
491644dda7b2Smrg	    pipe_works=yes
491744dda7b2Smrg	  fi
4918862f5301Smrg	  LIBS=$lt_globsym_save_LIBS
4919862f5301Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
49207a3b38f7Smrg	else
492144dda7b2Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
49227a3b38f7Smrg	fi
492344dda7b2Smrg      else
492444dda7b2Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
492544dda7b2Smrg      fi
492644dda7b2Smrg    else
492744dda7b2Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
492844dda7b2Smrg    fi
492944dda7b2Smrg  else
493044dda7b2Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
493144dda7b2Smrg    cat conftest.$ac_ext >&5
493244dda7b2Smrg  fi
493344dda7b2Smrg  rm -rf conftest* conftst*
4934ff559fabSmrg
493544dda7b2Smrg  # Do not use the global_symbol_pipe unless it works.
493644dda7b2Smrg  if test "$pipe_works" = yes; then
493744dda7b2Smrg    break
493844dda7b2Smrg  else
493944dda7b2Smrg    lt_cv_sys_global_symbol_pipe=
494044dda7b2Smrg  fi
494144dda7b2Smrgdone
494244dda7b2Smrg])
494344dda7b2Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
494444dda7b2Smrg  lt_cv_sys_global_symbol_to_cdecl=
494544dda7b2Smrgfi
494644dda7b2Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
494744dda7b2Smrg  AC_MSG_RESULT(failed)
494844dda7b2Smrgelse
494944dda7b2Smrg  AC_MSG_RESULT(ok)
495044dda7b2Smrgfi
4951ff559fabSmrg
4952862f5301Smrg# Response file support.
4953862f5301Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4954862f5301Smrg  nm_file_list_spec='@'
4955862f5301Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4956862f5301Smrg  nm_file_list_spec='@'
4957862f5301Smrgfi
4958862f5301Smrg
495944dda7b2Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
496044dda7b2Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
496144dda7b2Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
496244dda7b2Smrg    [Transform the output of nm in a proper C declaration])
496344dda7b2Smrg_LT_DECL([global_symbol_to_c_name_address],
496444dda7b2Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
496544dda7b2Smrg    [Transform the output of nm in a C name address pair])
496644dda7b2Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
496744dda7b2Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
496844dda7b2Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4969862f5301Smrg_LT_DECL([], [nm_file_list_spec], [1],
4970862f5301Smrg    [Specify filename containing input files for $NM])
497144dda7b2Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
4972ff559fabSmrg
4973ff559fabSmrg
497444dda7b2Smrg# _LT_COMPILER_PIC([TAGNAME])
497544dda7b2Smrg# ---------------------------
497644dda7b2Smrgm4_defun([_LT_COMPILER_PIC],
497744dda7b2Smrg[m4_require([_LT_TAG_COMPILER])dnl
497844dda7b2Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
497944dda7b2Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
498044dda7b2Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4981ff559fabSmrg
498244dda7b2Smrgm4_if([$1], [CXX], [
498344dda7b2Smrg  # C++ specific cases for pic, static, wl, etc.
498444dda7b2Smrg  if test "$GXX" = yes; then
498544dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
498644dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4987ff559fabSmrg
498844dda7b2Smrg    case $host_os in
498944dda7b2Smrg    aix*)
499044dda7b2Smrg      # All AIX code is PIC.
499144dda7b2Smrg      if test "$host_cpu" = ia64; then
499244dda7b2Smrg	# AIX 5 now supports IA64 processor
499344dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
499444dda7b2Smrg      fi
499544dda7b2Smrg      ;;
49967a3b38f7Smrg
499744dda7b2Smrg    amigaos*)
499844dda7b2Smrg      case $host_cpu in
499944dda7b2Smrg      powerpc)
500044dda7b2Smrg            # see comment about AmigaOS4 .so support
500144dda7b2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
50027a3b38f7Smrg        ;;
500344dda7b2Smrg      m68k)
500444dda7b2Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
500544dda7b2Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
500644dda7b2Smrg            # like `-m68040'.
500744dda7b2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
50087a3b38f7Smrg        ;;
500944dda7b2Smrg      esac
501044dda7b2Smrg      ;;
5011ff559fabSmrg
501244dda7b2Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
501344dda7b2Smrg      # PIC is the default for these OSes.
501444dda7b2Smrg      ;;
501544dda7b2Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
501644dda7b2Smrg      # This hack is so that the source file can tell whether it is being
501744dda7b2Smrg      # built for inclusion in a dll (and should export symbols for example).
501844dda7b2Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
501944dda7b2Smrg      # (--disable-auto-import) libraries
502044dda7b2Smrg      m4_if([$1], [GCJ], [],
502144dda7b2Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
502244dda7b2Smrg      ;;
502344dda7b2Smrg    darwin* | rhapsody*)
502444dda7b2Smrg      # PIC is the default on this platform
502544dda7b2Smrg      # Common symbols not allowed in MH_DYLIB files
502644dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
502744dda7b2Smrg      ;;
502844dda7b2Smrg    *djgpp*)
502944dda7b2Smrg      # DJGPP does not support shared libraries at all
503044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
503144dda7b2Smrg      ;;
503244dda7b2Smrg    haiku*)
503344dda7b2Smrg      # PIC is the default for Haiku.
503444dda7b2Smrg      # The "-static" flag exists, but is broken.
503544dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
503644dda7b2Smrg      ;;
503744dda7b2Smrg    interix[[3-9]]*)
503844dda7b2Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
503944dda7b2Smrg      # Instead, we relocate shared libraries at runtime.
504044dda7b2Smrg      ;;
504144dda7b2Smrg    sysv4*MP*)
504244dda7b2Smrg      if test -d /usr/nec; then
504344dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
504444dda7b2Smrg      fi
504544dda7b2Smrg      ;;
504644dda7b2Smrg    hpux*)
504744dda7b2Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
504844dda7b2Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
504944dda7b2Smrg      # sets the default TLS model and affects inlining.
505044dda7b2Smrg      case $host_cpu in
505144dda7b2Smrg      hppa*64*)
50527a3b38f7Smrg	;;
505344dda7b2Smrg      *)
505444dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
505544dda7b2Smrg	;;
505644dda7b2Smrg      esac
505744dda7b2Smrg      ;;
505844dda7b2Smrg    *qnx* | *nto*)
505944dda7b2Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
506044dda7b2Smrg      # it will coredump.
506144dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
506244dda7b2Smrg      ;;
506344dda7b2Smrg    *)
506444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
506544dda7b2Smrg      ;;
506644dda7b2Smrg    esac
506744dda7b2Smrg  else
506844dda7b2Smrg    case $host_os in
506944dda7b2Smrg      aix[[4-9]]*)
507044dda7b2Smrg	# All AIX code is PIC.
507144dda7b2Smrg	if test "$host_cpu" = ia64; then
507244dda7b2Smrg	  # AIX 5 now supports IA64 processor
507344dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
507444dda7b2Smrg	else
507544dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
507644dda7b2Smrg	fi
507744dda7b2Smrg	;;
507844dda7b2Smrg      chorus*)
507944dda7b2Smrg	case $cc_basename in
508044dda7b2Smrg	cxch68*)
508144dda7b2Smrg	  # Green Hills C++ Compiler
508244dda7b2Smrg	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
508344dda7b2Smrg	  ;;
508444dda7b2Smrg	esac
508544dda7b2Smrg	;;
5086862f5301Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
5087862f5301Smrg	# This hack is so that the source file can tell whether it is being
5088862f5301Smrg	# built for inclusion in a dll (and should export symbols for example).
5089862f5301Smrg	m4_if([$1], [GCJ], [],
5090862f5301Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5091862f5301Smrg	;;
509244dda7b2Smrg      dgux*)
509344dda7b2Smrg	case $cc_basename in
509444dda7b2Smrg	  ec++*)
509544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50967a3b38f7Smrg	    ;;
509744dda7b2Smrg	  ghcx*)
509844dda7b2Smrg	    # Green Hills C++ Compiler
509944dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51007a3b38f7Smrg	    ;;
510144dda7b2Smrg	  *)
51027a3b38f7Smrg	    ;;
510344dda7b2Smrg	esac
510444dda7b2Smrg	;;
510544dda7b2Smrg      freebsd* | dragonfly*)
510644dda7b2Smrg	# FreeBSD uses GNU C++
510744dda7b2Smrg	;;
510844dda7b2Smrg      hpux9* | hpux10* | hpux11*)
510944dda7b2Smrg	case $cc_basename in
511044dda7b2Smrg	  CC*)
511144dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
511244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
511344dda7b2Smrg	    if test "$host_cpu" != ia64; then
511444dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
511544dda7b2Smrg	    fi
51167a3b38f7Smrg	    ;;
511744dda7b2Smrg	  aCC*)
511844dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
511944dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
512044dda7b2Smrg	    case $host_cpu in
512144dda7b2Smrg	    hppa*64*|ia64*)
512244dda7b2Smrg	      # +Z the default
51237a3b38f7Smrg	      ;;
512444dda7b2Smrg	    *)
512544dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
51267a3b38f7Smrg	      ;;
51277a3b38f7Smrg	    esac
512844dda7b2Smrg	    ;;
512944dda7b2Smrg	  *)
513044dda7b2Smrg	    ;;
513144dda7b2Smrg	esac
513244dda7b2Smrg	;;
513344dda7b2Smrg      interix*)
513444dda7b2Smrg	# This is c89, which is MS Visual C++ (no shared libs)
513544dda7b2Smrg	# Anyone wants to do a port?
513644dda7b2Smrg	;;
513744dda7b2Smrg      irix5* | irix6* | nonstopux*)
513844dda7b2Smrg	case $cc_basename in
513944dda7b2Smrg	  CC*)
514044dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
514144dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
514244dda7b2Smrg	    # CC pic flag -KPIC is the default.
514344dda7b2Smrg	    ;;
514444dda7b2Smrg	  *)
514544dda7b2Smrg	    ;;
514644dda7b2Smrg	esac
514744dda7b2Smrg	;;
514844dda7b2Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
514944dda7b2Smrg	case $cc_basename in
515044dda7b2Smrg	  KCC*)
515144dda7b2Smrg	    # KAI C++ Compiler
515244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
515344dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
515444dda7b2Smrg	    ;;
515544dda7b2Smrg	  ecpc* )
515644dda7b2Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
515744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
515844dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
515944dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
516044dda7b2Smrg	    ;;
516144dda7b2Smrg	  icpc* )
516244dda7b2Smrg	    # Intel C++, used to be incompatible with GCC.
516344dda7b2Smrg	    # ICC 10 doesn't accept -KPIC any more.
516444dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
516544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
516644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
516744dda7b2Smrg	    ;;
516844dda7b2Smrg	  pgCC* | pgcpp*)
516944dda7b2Smrg	    # Portland Group C++ compiler
517044dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
517144dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
517244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
517344dda7b2Smrg	    ;;
51747a3b38f7Smrg	  cxx*)
51757a3b38f7Smrg	    # Compaq C++
517644dda7b2Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
517744dda7b2Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
517844dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
517944dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
51807a3b38f7Smrg	    ;;
518144dda7b2Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
518244dda7b2Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
518344dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
518444dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
518544dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
51867a3b38f7Smrg	    ;;
51877a3b38f7Smrg	  *)
51887a3b38f7Smrg	    case `$CC -V 2>&1 | sed 5q` in
51897a3b38f7Smrg	    *Sun\ C*)
51907a3b38f7Smrg	      # Sun C++ 5.9
519144dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
519244dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
519344dda7b2Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
51947a3b38f7Smrg	      ;;
51957a3b38f7Smrg	    esac
51967a3b38f7Smrg	    ;;
51977a3b38f7Smrg	esac
51987a3b38f7Smrg	;;
519944dda7b2Smrg      lynxos*)
520044dda7b2Smrg	;;
520144dda7b2Smrg      m88k*)
520244dda7b2Smrg	;;
520344dda7b2Smrg      mvs*)
520444dda7b2Smrg	case $cc_basename in
520544dda7b2Smrg	  cxx*)
520644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
520744dda7b2Smrg	    ;;
520844dda7b2Smrg	  *)
520944dda7b2Smrg	    ;;
521044dda7b2Smrg	esac
521144dda7b2Smrg	;;
521244dda7b2Smrg      netbsd*)
521344dda7b2Smrg	;;
521444dda7b2Smrg      *qnx* | *nto*)
521544dda7b2Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
521644dda7b2Smrg        # it will coredump.
521744dda7b2Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
521844dda7b2Smrg        ;;
521944dda7b2Smrg      osf3* | osf4* | osf5*)
522044dda7b2Smrg	case $cc_basename in
522144dda7b2Smrg	  KCC*)
522244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
522344dda7b2Smrg	    ;;
522444dda7b2Smrg	  RCC*)
522544dda7b2Smrg	    # Rational C++ 2.4.1
522644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
522744dda7b2Smrg	    ;;
522844dda7b2Smrg	  cxx*)
522944dda7b2Smrg	    # Digital/Compaq C++
523044dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
523144dda7b2Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
523244dda7b2Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
523344dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
523444dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
523544dda7b2Smrg	    ;;
523644dda7b2Smrg	  *)
523744dda7b2Smrg	    ;;
523844dda7b2Smrg	esac
523944dda7b2Smrg	;;
524044dda7b2Smrg      psos*)
52417a3b38f7Smrg	;;
524244dda7b2Smrg      solaris*)
524344dda7b2Smrg	case $cc_basename in
524444dda7b2Smrg	  CC* | sunCC*)
524544dda7b2Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
524644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
524744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
524844dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
524944dda7b2Smrg	    ;;
525044dda7b2Smrg	  gcx*)
525144dda7b2Smrg	    # Green Hills C++ Compiler
525244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
525344dda7b2Smrg	    ;;
525444dda7b2Smrg	  *)
525544dda7b2Smrg	    ;;
525644dda7b2Smrg	esac
52577a3b38f7Smrg	;;
525844dda7b2Smrg      sunos4*)
525944dda7b2Smrg	case $cc_basename in
526044dda7b2Smrg	  CC*)
526144dda7b2Smrg	    # Sun C++ 4.x
526244dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
526344dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
526444dda7b2Smrg	    ;;
526544dda7b2Smrg	  lcc*)
526644dda7b2Smrg	    # Lucid
526744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
52687a3b38f7Smrg	    ;;
52697a3b38f7Smrg	  *)
52707a3b38f7Smrg	    ;;
52717a3b38f7Smrg	esac
52727a3b38f7Smrg	;;
527344dda7b2Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
527444dda7b2Smrg	case $cc_basename in
527544dda7b2Smrg	  CC*)
527644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
527744dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
527844dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
527944dda7b2Smrg	    ;;
528044dda7b2Smrg	esac
52817a3b38f7Smrg	;;
528244dda7b2Smrg      tandem*)
528344dda7b2Smrg	case $cc_basename in
528444dda7b2Smrg	  NCC*)
528544dda7b2Smrg	    # NonStop-UX NCC 3.20
528644dda7b2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
528744dda7b2Smrg	    ;;
528844dda7b2Smrg	  *)
528944dda7b2Smrg	    ;;
529044dda7b2Smrg	esac
52917a3b38f7Smrg	;;
529244dda7b2Smrg      vxworks*)
52937a3b38f7Smrg	;;
529444dda7b2Smrg      *)
529544dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
52967a3b38f7Smrg	;;
529744dda7b2Smrg    esac
529844dda7b2Smrg  fi
529944dda7b2Smrg],
530044dda7b2Smrg[
530144dda7b2Smrg  if test "$GCC" = yes; then
530244dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
530344dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5304ff559fabSmrg
530544dda7b2Smrg    case $host_os in
530644dda7b2Smrg      aix*)
530744dda7b2Smrg      # All AIX code is PIC.
530844dda7b2Smrg      if test "$host_cpu" = ia64; then
530944dda7b2Smrg	# AIX 5 now supports IA64 processor
531044dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
531144dda7b2Smrg      fi
531244dda7b2Smrg      ;;
5313ff559fabSmrg
531444dda7b2Smrg    amigaos*)
531544dda7b2Smrg      case $host_cpu in
531644dda7b2Smrg      powerpc)
531744dda7b2Smrg            # see comment about AmigaOS4 .so support
531844dda7b2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
531944dda7b2Smrg        ;;
532044dda7b2Smrg      m68k)
532144dda7b2Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
532244dda7b2Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
532344dda7b2Smrg            # like `-m68040'.
532444dda7b2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
532544dda7b2Smrg        ;;
532644dda7b2Smrg      esac
532744dda7b2Smrg      ;;
53287a3b38f7Smrg
532944dda7b2Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
533044dda7b2Smrg      # PIC is the default for these OSes.
533144dda7b2Smrg      ;;
53327a3b38f7Smrg
533344dda7b2Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
533444dda7b2Smrg      # This hack is so that the source file can tell whether it is being
533544dda7b2Smrg      # built for inclusion in a dll (and should export symbols for example).
533644dda7b2Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
533744dda7b2Smrg      # (--disable-auto-import) libraries
533844dda7b2Smrg      m4_if([$1], [GCJ], [],
533944dda7b2Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
534044dda7b2Smrg      ;;
53417a3b38f7Smrg
534244dda7b2Smrg    darwin* | rhapsody*)
534344dda7b2Smrg      # PIC is the default on this platform
534444dda7b2Smrg      # Common symbols not allowed in MH_DYLIB files
534544dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
534644dda7b2Smrg      ;;
5347ff559fabSmrg
534844dda7b2Smrg    haiku*)
534944dda7b2Smrg      # PIC is the default for Haiku.
535044dda7b2Smrg      # The "-static" flag exists, but is broken.
535144dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
535244dda7b2Smrg      ;;
5353ff559fabSmrg
535444dda7b2Smrg    hpux*)
535544dda7b2Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
535644dda7b2Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
535744dda7b2Smrg      # sets the default TLS model and affects inlining.
535844dda7b2Smrg      case $host_cpu in
535944dda7b2Smrg      hppa*64*)
536044dda7b2Smrg	# +Z the default
536144dda7b2Smrg	;;
536244dda7b2Smrg      *)
536344dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
536444dda7b2Smrg	;;
536544dda7b2Smrg      esac
536644dda7b2Smrg      ;;
5367ff559fabSmrg
536844dda7b2Smrg    interix[[3-9]]*)
536944dda7b2Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
537044dda7b2Smrg      # Instead, we relocate shared libraries at runtime.
537144dda7b2Smrg      ;;
53727a3b38f7Smrg
537344dda7b2Smrg    msdosdjgpp*)
537444dda7b2Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
537544dda7b2Smrg      # on systems that don't support them.
537644dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
537744dda7b2Smrg      enable_shared=no
537844dda7b2Smrg      ;;
5379ff559fabSmrg
538044dda7b2Smrg    *nto* | *qnx*)
538144dda7b2Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
538244dda7b2Smrg      # it will coredump.
538344dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
538444dda7b2Smrg      ;;
5385ff559fabSmrg
538644dda7b2Smrg    sysv4*MP*)
538744dda7b2Smrg      if test -d /usr/nec; then
538844dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
538944dda7b2Smrg      fi
539044dda7b2Smrg      ;;
5391ff559fabSmrg
539244dda7b2Smrg    *)
539344dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
539444dda7b2Smrg      ;;
539544dda7b2Smrg    esac
53967a3b38f7Smrg
539744dda7b2Smrg    case $cc_basename in
539844dda7b2Smrg    nvcc*) # Cuda Compiler Driver 2.2
539944dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
540044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
540144dda7b2Smrg      ;;
540244dda7b2Smrg    esac
540344dda7b2Smrg  else
540444dda7b2Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
540544dda7b2Smrg    case $host_os in
540644dda7b2Smrg    aix*)
540744dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
540844dda7b2Smrg      if test "$host_cpu" = ia64; then
540944dda7b2Smrg	# AIX 5 now supports IA64 processor
541044dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
541144dda7b2Smrg      else
541244dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
541344dda7b2Smrg      fi
541444dda7b2Smrg      ;;
54157a3b38f7Smrg
541644dda7b2Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
541744dda7b2Smrg      # This hack is so that the source file can tell whether it is being
541844dda7b2Smrg      # built for inclusion in a dll (and should export symbols for example).
541944dda7b2Smrg      m4_if([$1], [GCJ], [],
542044dda7b2Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
542144dda7b2Smrg      ;;
54227a3b38f7Smrg
542344dda7b2Smrg    hpux9* | hpux10* | hpux11*)
542444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
542544dda7b2Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
542644dda7b2Smrg      # not for PA HP-UX.
542744dda7b2Smrg      case $host_cpu in
542844dda7b2Smrg      hppa*64*|ia64*)
542944dda7b2Smrg	# +Z the default
543044dda7b2Smrg	;;
543144dda7b2Smrg      *)
543244dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
543344dda7b2Smrg	;;
543444dda7b2Smrg      esac
543544dda7b2Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
543644dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
543744dda7b2Smrg      ;;
5438ff559fabSmrg
543944dda7b2Smrg    irix5* | irix6* | nonstopux*)
544044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
544144dda7b2Smrg      # PIC (with -KPIC) is the default.
544244dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
544344dda7b2Smrg      ;;
5444ff559fabSmrg
544544dda7b2Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
54467a3b38f7Smrg      case $cc_basename in
544744dda7b2Smrg      # old Intel for x86_64 which still supported -KPIC.
544844dda7b2Smrg      ecc*)
544944dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
545044dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
545144dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
545244dda7b2Smrg        ;;
545344dda7b2Smrg      # icc used to be incompatible with GCC.
545444dda7b2Smrg      # ICC 10 doesn't accept -KPIC any more.
545544dda7b2Smrg      icc* | ifort*)
545644dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
545744dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
545844dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
545944dda7b2Smrg        ;;
546044dda7b2Smrg      # Lahey Fortran 8.1.
546144dda7b2Smrg      lf95*)
546244dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
546344dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
546444dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
546544dda7b2Smrg	;;
5466862f5301Smrg      nagfor*)
5467862f5301Smrg	# NAG Fortran compiler
5468862f5301Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5469862f5301Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5470862f5301Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5471862f5301Smrg	;;
547244dda7b2Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
547344dda7b2Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
547444dda7b2Smrg	# which looks to be a dead project)
547544dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
547644dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
547744dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
547844dda7b2Smrg        ;;
547944dda7b2Smrg      ccc*)
548044dda7b2Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
548144dda7b2Smrg        # All Alpha code is PIC.
548244dda7b2Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
548344dda7b2Smrg        ;;
548444dda7b2Smrg      xl* | bgxl* | bgf* | mpixl*)
548544dda7b2Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
548644dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
548744dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
548844dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
548944dda7b2Smrg	;;
549044dda7b2Smrg      *)
549144dda7b2Smrg	case `$CC -V 2>&1 | sed 5q` in
549244dda7b2Smrg	*Sun\ F* | *Sun*Fortran*)
549344dda7b2Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
549444dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
549544dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
549644dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
54977a3b38f7Smrg	  ;;
549844dda7b2Smrg	*Sun\ C*)
549944dda7b2Smrg	  # Sun C 5.9
550044dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
550144dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
550244dda7b2Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55037a3b38f7Smrg	  ;;
550444dda7b2Smrg	esac
550544dda7b2Smrg	;;
55067a3b38f7Smrg      esac
55077a3b38f7Smrg      ;;
5508ff559fabSmrg
550944dda7b2Smrg    newsos6)
551044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
551144dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
551244dda7b2Smrg      ;;
5513ff559fabSmrg
551444dda7b2Smrg    *nto* | *qnx*)
551544dda7b2Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
551644dda7b2Smrg      # it will coredump.
551744dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
55187a3b38f7Smrg      ;;
5519ff559fabSmrg
552044dda7b2Smrg    osf3* | osf4* | osf5*)
552144dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
552244dda7b2Smrg      # All OSF/1 code is PIC.
552344dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
552444dda7b2Smrg      ;;
5525ff559fabSmrg
552644dda7b2Smrg    rdos*)
552744dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
552844dda7b2Smrg      ;;
5529ff559fabSmrg
553044dda7b2Smrg    solaris*)
553144dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
553244dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
553344dda7b2Smrg      case $cc_basename in
553444dda7b2Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
553544dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
55367a3b38f7Smrg      *)
553744dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
553844dda7b2Smrg      esac
553944dda7b2Smrg      ;;
5540ff559fabSmrg
554144dda7b2Smrg    sunos4*)
554244dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
554344dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
554444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
554544dda7b2Smrg      ;;
55467a3b38f7Smrg
554744dda7b2Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
554844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
554944dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
555044dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
555144dda7b2Smrg      ;;
55527a3b38f7Smrg
555344dda7b2Smrg    sysv4*MP*)
555444dda7b2Smrg      if test -d /usr/nec ;then
555544dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
555644dda7b2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
555744dda7b2Smrg      fi
555844dda7b2Smrg      ;;
55597a3b38f7Smrg
556044dda7b2Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
556144dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
556244dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
556344dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
556444dda7b2Smrg      ;;
55657a3b38f7Smrg
556644dda7b2Smrg    unicos*)
556744dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
556844dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
556944dda7b2Smrg      ;;
5570ff559fabSmrg
557144dda7b2Smrg    uts4*)
557244dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
557344dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
557444dda7b2Smrg      ;;
5575ff559fabSmrg
557644dda7b2Smrg    *)
557744dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
557844dda7b2Smrg      ;;
557944dda7b2Smrg    esac
558044dda7b2Smrg  fi
558144dda7b2Smrg])
558244dda7b2Smrgcase $host_os in
558344dda7b2Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
558444dda7b2Smrg  *djgpp*)
558544dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
558644dda7b2Smrg    ;;
558744dda7b2Smrg  *)
558844dda7b2Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
558944dda7b2Smrg    ;;
559044dda7b2Smrgesac
5591862f5301Smrg
5592862f5301SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
5593862f5301Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5594862f5301Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5595862f5301Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5596ff559fabSmrg
559744dda7b2Smrg#
559844dda7b2Smrg# Check to make sure the PIC flag actually works.
559944dda7b2Smrg#
560044dda7b2Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
560144dda7b2Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
560244dda7b2Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
560344dda7b2Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
560444dda7b2Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
560544dda7b2Smrg     "" | " "*) ;;
560644dda7b2Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
560744dda7b2Smrg     esac],
560844dda7b2Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
560944dda7b2Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
561044dda7b2Smrgfi
561144dda7b2Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
561244dda7b2Smrg	[Additional compiler flags for building library objects])
5613ff559fabSmrg
5614862f5301Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5615862f5301Smrg	[How to pass a linker flag through the compiler])
561644dda7b2Smrg#
561744dda7b2Smrg# Check to make sure the static flag actually works.
561844dda7b2Smrg#
561944dda7b2Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
562044dda7b2Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
562144dda7b2Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
562244dda7b2Smrg  $lt_tmp_static_flag,
562344dda7b2Smrg  [],
562444dda7b2Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
562544dda7b2Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
562644dda7b2Smrg	[Compiler flag to prevent dynamic linking])
562744dda7b2Smrg])# _LT_COMPILER_PIC
56287a3b38f7Smrg
56297a3b38f7Smrg
563044dda7b2Smrg# _LT_LINKER_SHLIBS([TAGNAME])
563144dda7b2Smrg# ----------------------------
563244dda7b2Smrg# See if the linker supports building shared libraries.
563344dda7b2Smrgm4_defun([_LT_LINKER_SHLIBS],
563444dda7b2Smrg[AC_REQUIRE([LT_PATH_LD])dnl
563544dda7b2SmrgAC_REQUIRE([LT_PATH_NM])dnl
5636862f5301Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
563744dda7b2Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
563844dda7b2Smrgm4_require([_LT_DECL_EGREP])dnl
563944dda7b2Smrgm4_require([_LT_DECL_SED])dnl
564044dda7b2Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
564144dda7b2Smrgm4_require([_LT_TAG_COMPILER])dnl
564244dda7b2SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
564344dda7b2Smrgm4_if([$1], [CXX], [
564444dda7b2Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5645862f5301Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
564644dda7b2Smrg  case $host_os in
564744dda7b2Smrg  aix[[4-9]]*)
564844dda7b2Smrg    # If we're using GNU nm, then we don't want the "-C" option.
564944dda7b2Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
565044dda7b2Smrg    # Also, AIX nm treats weak defined symbols like other global defined
565144dda7b2Smrg    # symbols, whereas GNU nm marks them as "W".
565244dda7b2Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
565344dda7b2Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
565444dda7b2Smrg    else
565544dda7b2Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
565644dda7b2Smrg    fi
565744dda7b2Smrg    ;;
565844dda7b2Smrg  pw32*)
565944dda7b2Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5660862f5301Smrg    ;;
566144dda7b2Smrg  cygwin* | mingw* | cegcc*)
5662862f5301Smrg    case $cc_basename in
5663862f5301Smrg    cl*) ;;
5664862f5301Smrg    *)
5665862f5301Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5666862f5301Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5667862f5301Smrg      ;;
5668862f5301Smrg    esac
5669862f5301Smrg    ;;
567044dda7b2Smrg  *)
567144dda7b2Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5672862f5301Smrg    ;;
567344dda7b2Smrg  esac
567444dda7b2Smrg], [
567544dda7b2Smrg  runpath_var=
567644dda7b2Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
567744dda7b2Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
567844dda7b2Smrg  _LT_TAGVAR(archive_cmds, $1)=
567944dda7b2Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
568044dda7b2Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
568144dda7b2Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
568244dda7b2Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
568344dda7b2Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
568444dda7b2Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
568544dda7b2Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
568644dda7b2Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
568744dda7b2Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
568844dda7b2Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
568944dda7b2Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
569044dda7b2Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
569144dda7b2Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
569244dda7b2Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
569344dda7b2Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
569444dda7b2Smrg  _LT_TAGVAR(module_cmds, $1)=
569544dda7b2Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
569644dda7b2Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
569744dda7b2Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
569844dda7b2Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
569944dda7b2Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
570044dda7b2Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
570144dda7b2Smrg  # included in the symbol list
570244dda7b2Smrg  _LT_TAGVAR(include_expsyms, $1)=
570344dda7b2Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
570444dda7b2Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
570544dda7b2Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
570644dda7b2Smrg  # as well as any symbol that contains `d'.
570744dda7b2Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
570844dda7b2Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
570944dda7b2Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
571044dda7b2Smrg  # the symbol is explicitly referenced.  Since portable code cannot
571144dda7b2Smrg  # rely on this symbol name, it's probably fine to never include it in
571244dda7b2Smrg  # preloaded symbol tables.
571344dda7b2Smrg  # Exclude shared library initialization/finalization symbols.
571444dda7b2Smrgdnl Note also adjust exclude_expsyms for C++ above.
571544dda7b2Smrg  extract_expsyms_cmds=
571644dda7b2Smrg
571744dda7b2Smrg  case $host_os in
571844dda7b2Smrg  cygwin* | mingw* | pw32* | cegcc*)
571944dda7b2Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
572044dda7b2Smrg    # When not using gcc, we currently assume that we are using
572144dda7b2Smrg    # Microsoft Visual C++.
572244dda7b2Smrg    if test "$GCC" != yes; then
572344dda7b2Smrg      with_gnu_ld=no
572444dda7b2Smrg    fi
572544dda7b2Smrg    ;;
572644dda7b2Smrg  interix*)
572744dda7b2Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
572844dda7b2Smrg    with_gnu_ld=yes
572944dda7b2Smrg    ;;
573044dda7b2Smrg  openbsd*)
573144dda7b2Smrg    with_gnu_ld=no
573244dda7b2Smrg    ;;
573344dda7b2Smrg  esac
57347a3b38f7Smrg
573544dda7b2Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
57367a3b38f7Smrg
573744dda7b2Smrg  # On some targets, GNU ld is compatible enough with the native linker
573844dda7b2Smrg  # that we're better off using the native interface for both.
573944dda7b2Smrg  lt_use_gnu_ld_interface=no
574044dda7b2Smrg  if test "$with_gnu_ld" = yes; then
574144dda7b2Smrg    case $host_os in
574244dda7b2Smrg      aix*)
574344dda7b2Smrg	# The AIX port of GNU ld has always aspired to compatibility
574444dda7b2Smrg	# with the native linker.  However, as the warning in the GNU ld
574544dda7b2Smrg	# block says, versions before 2.19.5* couldn't really create working
574644dda7b2Smrg	# shared libraries, regardless of the interface used.
574744dda7b2Smrg	case `$LD -v 2>&1` in
574844dda7b2Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
574944dda7b2Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
575044dda7b2Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
575144dda7b2Smrg	  *)
575244dda7b2Smrg	    lt_use_gnu_ld_interface=yes
575344dda7b2Smrg	    ;;
575444dda7b2Smrg	esac
575544dda7b2Smrg	;;
575644dda7b2Smrg      *)
575744dda7b2Smrg	lt_use_gnu_ld_interface=yes
575844dda7b2Smrg	;;
575944dda7b2Smrg    esac
576044dda7b2Smrg  fi
57617a3b38f7Smrg
576244dda7b2Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
576344dda7b2Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
576444dda7b2Smrg    wlarc='${wl}'
57657a3b38f7Smrg
576644dda7b2Smrg    # Set some defaults for GNU ld with shared library support. These
576744dda7b2Smrg    # are reset later if shared libraries are not supported. Putting them
576844dda7b2Smrg    # here allows them to be overridden if necessary.
576944dda7b2Smrg    runpath_var=LD_RUN_PATH
577044dda7b2Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
577144dda7b2Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
577244dda7b2Smrg    # ancient GNU ld didn't support --whole-archive et. al.
577344dda7b2Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
577444dda7b2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
577544dda7b2Smrg    else
577644dda7b2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
577744dda7b2Smrg    fi
577844dda7b2Smrg    supports_anon_versioning=no
577944dda7b2Smrg    case `$LD -v 2>&1` in
578044dda7b2Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
578144dda7b2Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
578244dda7b2Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
578344dda7b2Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
578444dda7b2Smrg      *\ 2.11.*) ;; # other 2.11 versions
578544dda7b2Smrg      *) supports_anon_versioning=yes ;;
578644dda7b2Smrg    esac
57877a3b38f7Smrg
578844dda7b2Smrg    # See if GNU ld supports shared libraries.
578944dda7b2Smrg    case $host_os in
579044dda7b2Smrg    aix[[3-9]]*)
579144dda7b2Smrg      # On AIX/PPC, the GNU linker is very broken
579244dda7b2Smrg      if test "$host_cpu" != ia64; then
579344dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
579444dda7b2Smrg	cat <<_LT_EOF 1>&2
57957a3b38f7Smrg
579644dda7b2Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
579744dda7b2Smrg*** to be unable to reliably create shared libraries on AIX.
579844dda7b2Smrg*** Therefore, libtool is disabling shared libraries support.  If you
579944dda7b2Smrg*** really care for shared libraries, you may want to install binutils
580044dda7b2Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
580144dda7b2Smrg*** You will then need to restart the configuration process.
58027a3b38f7Smrg
580344dda7b2Smrg_LT_EOF
580444dda7b2Smrg      fi
580544dda7b2Smrg      ;;
58067a3b38f7Smrg
580744dda7b2Smrg    amigaos*)
580844dda7b2Smrg      case $host_cpu in
580944dda7b2Smrg      powerpc)
581044dda7b2Smrg            # see comment about AmigaOS4 .so support
581144dda7b2Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
581244dda7b2Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
581344dda7b2Smrg        ;;
581444dda7b2Smrg      m68k)
581544dda7b2Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
581644dda7b2Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
581744dda7b2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
581844dda7b2Smrg        ;;
581944dda7b2Smrg      esac
582044dda7b2Smrg      ;;
58217a3b38f7Smrg
582244dda7b2Smrg    beos*)
582344dda7b2Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
582444dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
582544dda7b2Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
582644dda7b2Smrg	# support --undefined.  This deserves some investigation.  FIXME
582744dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
582844dda7b2Smrg      else
582944dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
583044dda7b2Smrg      fi
583144dda7b2Smrg      ;;
58327a3b38f7Smrg
583344dda7b2Smrg    cygwin* | mingw* | pw32* | cegcc*)
583444dda7b2Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
583544dda7b2Smrg      # as there is no search path for DLLs.
583644dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
583744dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
583844dda7b2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
583944dda7b2Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
584044dda7b2Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5841862f5301Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5842862f5301Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
58437a3b38f7Smrg
584444dda7b2Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
584544dda7b2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
584644dda7b2Smrg	# If the export-symbols file already is a .def file (1st line
584744dda7b2Smrg	# is EXPORTS), use it as is; otherwise, prepend...
584844dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
584944dda7b2Smrg	  cp $export_symbols $output_objdir/$soname.def;
585044dda7b2Smrg	else
585144dda7b2Smrg	  echo EXPORTS > $output_objdir/$soname.def;
585244dda7b2Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
585344dda7b2Smrg	fi~
585444dda7b2Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
585544dda7b2Smrg      else
585644dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
585744dda7b2Smrg      fi
58587a3b38f7Smrg      ;;
58597a3b38f7Smrg
586044dda7b2Smrg    haiku*)
586144dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
586244dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
586344dda7b2Smrg      ;;
5864ff559fabSmrg
586544dda7b2Smrg    interix[[3-9]]*)
586644dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
586744dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
586844dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
586944dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
587044dda7b2Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
587144dda7b2Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
587244dda7b2Smrg      # default) and relocated if they conflict, which is a slow very memory
587344dda7b2Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
587444dda7b2Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
587544dda7b2Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
587644dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
587744dda7b2Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
58787a3b38f7Smrg      ;;
58797a3b38f7Smrg
588044dda7b2Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
588144dda7b2Smrg      tmp_diet=no
588244dda7b2Smrg      if test "$host_os" = linux-dietlibc; then
588344dda7b2Smrg	case $cc_basename in
588444dda7b2Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
588544dda7b2Smrg	esac
588644dda7b2Smrg      fi
588744dda7b2Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
588844dda7b2Smrg	 && test "$tmp_diet" = no
588944dda7b2Smrg      then
5890862f5301Smrg	tmp_addflag=' $pic_flag'
589144dda7b2Smrg	tmp_sharedflag='-shared'
589244dda7b2Smrg	case $cc_basename,$host_cpu in
589344dda7b2Smrg        pgcc*)				# Portland Group C compiler
589444dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
589544dda7b2Smrg	  tmp_addflag=' $pic_flag'
589644dda7b2Smrg	  ;;
589744dda7b2Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
589844dda7b2Smrg					# Portland Group f77 and f90 compilers
589944dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
590044dda7b2Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
590144dda7b2Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
590244dda7b2Smrg	  tmp_addflag=' -i_dynamic' ;;
590344dda7b2Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
590444dda7b2Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
590544dda7b2Smrg	ifc* | ifort*)			# Intel Fortran compiler
590644dda7b2Smrg	  tmp_addflag=' -nofor_main' ;;
590744dda7b2Smrg	lf95*)				# Lahey Fortran 8.1
590844dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
590944dda7b2Smrg	  tmp_sharedflag='--shared' ;;
591044dda7b2Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
591144dda7b2Smrg	  tmp_sharedflag='-qmkshrobj'
591244dda7b2Smrg	  tmp_addflag= ;;
591344dda7b2Smrg	nvcc*)	# Cuda Compiler Driver 2.2
591444dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
591544dda7b2Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
591644dda7b2Smrg	  ;;
591744dda7b2Smrg	esac
591844dda7b2Smrg	case `$CC -V 2>&1 | sed 5q` in
591944dda7b2Smrg	*Sun\ C*)			# Sun C 5.9
592044dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
592144dda7b2Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
592244dda7b2Smrg	  tmp_sharedflag='-G' ;;
592344dda7b2Smrg	*Sun\ F*)			# Sun Fortran 8.3
592444dda7b2Smrg	  tmp_sharedflag='-G' ;;
592544dda7b2Smrg	esac
592644dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5927ff559fabSmrg
592844dda7b2Smrg        if test "x$supports_anon_versioning" = xyes; then
592944dda7b2Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
593044dda7b2Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
593144dda7b2Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
593244dda7b2Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
593344dda7b2Smrg        fi
59347a3b38f7Smrg
593544dda7b2Smrg	case $cc_basename in
593644dda7b2Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
593744dda7b2Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
593844dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
593944dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
594044dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
594144dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
594244dda7b2Smrg	  if test "x$supports_anon_versioning" = xyes; then
594344dda7b2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
594444dda7b2Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
594544dda7b2Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
594644dda7b2Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
594744dda7b2Smrg	  fi
594844dda7b2Smrg	  ;;
594944dda7b2Smrg	esac
595044dda7b2Smrg      else
595144dda7b2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
595244dda7b2Smrg      fi
595344dda7b2Smrg      ;;
59547a3b38f7Smrg
595544dda7b2Smrg    netbsd*)
595644dda7b2Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
595744dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
595844dda7b2Smrg	wlarc=
595944dda7b2Smrg      else
5960862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5961862f5301Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
596244dda7b2Smrg      fi
596344dda7b2Smrg      ;;
5964ff559fabSmrg
596544dda7b2Smrg    solaris*)
596644dda7b2Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
596744dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
596844dda7b2Smrg	cat <<_LT_EOF 1>&2
5969ff559fabSmrg
597044dda7b2Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
597144dda7b2Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
597244dda7b2Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
597344dda7b2Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
597444dda7b2Smrg*** your PATH or compiler configuration so that the native linker is
597544dda7b2Smrg*** used, and then restart.
5976ff559fabSmrg
597744dda7b2Smrg_LT_EOF
597844dda7b2Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5979862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5980862f5301Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
598144dda7b2Smrg      else
598244dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
598344dda7b2Smrg      fi
598444dda7b2Smrg      ;;
5985ff559fabSmrg
598644dda7b2Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
598744dda7b2Smrg      case `$LD -v 2>&1` in
598844dda7b2Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
598944dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
599044dda7b2Smrg	cat <<_LT_EOF 1>&2
5991ff559fabSmrg
599244dda7b2Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
599344dda7b2Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
599444dda7b2Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
599544dda7b2Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
599644dda7b2Smrg*** your PATH or compiler configuration so that the native linker is
599744dda7b2Smrg*** used, and then restart.
5998ff559fabSmrg
599944dda7b2Smrg_LT_EOF
600044dda7b2Smrg	;;
600144dda7b2Smrg	*)
600244dda7b2Smrg	  # For security reasons, it is highly recommended that you always
600344dda7b2Smrg	  # use absolute paths for naming shared libraries, and exclude the
600444dda7b2Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
600544dda7b2Smrg	  # requires that you compile everything twice, which is a pain.
600644dda7b2Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
600744dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
600844dda7b2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
600944dda7b2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
601044dda7b2Smrg	  else
601144dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
601244dda7b2Smrg	  fi
601344dda7b2Smrg	;;
601444dda7b2Smrg      esac
601544dda7b2Smrg      ;;
60167a3b38f7Smrg
601744dda7b2Smrg    sunos4*)
601844dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
601944dda7b2Smrg      wlarc=
602044dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
602144dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
602244dda7b2Smrg      ;;
6023ff559fabSmrg
602444dda7b2Smrg    *)
602544dda7b2Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6026862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6027862f5301Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
602844dda7b2Smrg      else
602944dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
603044dda7b2Smrg      fi
603144dda7b2Smrg      ;;
603244dda7b2Smrg    esac
6033ff559fabSmrg
603444dda7b2Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
603544dda7b2Smrg      runpath_var=
603644dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
603744dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
603844dda7b2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
603944dda7b2Smrg    fi
604044dda7b2Smrg  else
604144dda7b2Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
604244dda7b2Smrg    case $host_os in
604344dda7b2Smrg    aix3*)
604444dda7b2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
604544dda7b2Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
604644dda7b2Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
604744dda7b2Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
604844dda7b2Smrg      # are no directories specified by -L.
604944dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
605044dda7b2Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
605144dda7b2Smrg	# Neither direct hardcoding nor static linking is supported with a
605244dda7b2Smrg	# broken collect2.
605344dda7b2Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
605444dda7b2Smrg      fi
605544dda7b2Smrg      ;;
6056ff559fabSmrg
605744dda7b2Smrg    aix[[4-9]]*)
605844dda7b2Smrg      if test "$host_cpu" = ia64; then
605944dda7b2Smrg	# On IA64, the linker does run time linking by default, so we don't
606044dda7b2Smrg	# have to do anything special.
606144dda7b2Smrg	aix_use_runtimelinking=no
606244dda7b2Smrg	exp_sym_flag='-Bexport'
606344dda7b2Smrg	no_entry_flag=""
606444dda7b2Smrg      else
606544dda7b2Smrg	# If we're using GNU nm, then we don't want the "-C" option.
606644dda7b2Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
606744dda7b2Smrg	# Also, AIX nm treats weak defined symbols like other global
606844dda7b2Smrg	# defined symbols, whereas GNU nm marks them as "W".
606944dda7b2Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
607044dda7b2Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
607144dda7b2Smrg	else
607244dda7b2Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
607344dda7b2Smrg	fi
607444dda7b2Smrg	aix_use_runtimelinking=no
6075ff559fabSmrg
607644dda7b2Smrg	# Test if we are trying to use run time linking or normal
607744dda7b2Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
607844dda7b2Smrg	# need to do runtime linking.
607944dda7b2Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
608044dda7b2Smrg	  for ld_flag in $LDFLAGS; do
608144dda7b2Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
608244dda7b2Smrg	    aix_use_runtimelinking=yes
608344dda7b2Smrg	    break
608444dda7b2Smrg	  fi
608544dda7b2Smrg	  done
608644dda7b2Smrg	  ;;
608744dda7b2Smrg	esac
6088ff559fabSmrg
608944dda7b2Smrg	exp_sym_flag='-bexport'
609044dda7b2Smrg	no_entry_flag='-bnoentry'
609144dda7b2Smrg      fi
60927a3b38f7Smrg
609344dda7b2Smrg      # When large executables or shared objects are built, AIX ld can
609444dda7b2Smrg      # have problems creating the table of contents.  If linking a library
609544dda7b2Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
609644dda7b2Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
609744dda7b2Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
60987a3b38f7Smrg
609944dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)=''
610044dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
610144dda7b2Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
610244dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
610344dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
610444dda7b2Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
61057a3b38f7Smrg
610644dda7b2Smrg      if test "$GCC" = yes; then
610744dda7b2Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
610844dda7b2Smrg	# We only want to do this on AIX 4.2 and lower, the check
610944dda7b2Smrg	# below for broken collect2 doesn't work under 4.3+
611044dda7b2Smrg	  collect2name=`${CC} -print-prog-name=collect2`
611144dda7b2Smrg	  if test -f "$collect2name" &&
611244dda7b2Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
611344dda7b2Smrg	  then
611444dda7b2Smrg	  # We have reworked collect2
611544dda7b2Smrg	  :
611644dda7b2Smrg	  else
611744dda7b2Smrg	  # We have old collect2
611844dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
611944dda7b2Smrg	  # It fails to find uninstalled libraries when the uninstalled
612044dda7b2Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
612144dda7b2Smrg	  # to unsupported forces relinking
612244dda7b2Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
612344dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
612444dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
612544dda7b2Smrg	  fi
612644dda7b2Smrg	  ;;
612744dda7b2Smrg	esac
612844dda7b2Smrg	shared_flag='-shared'
612944dda7b2Smrg	if test "$aix_use_runtimelinking" = yes; then
613044dda7b2Smrg	  shared_flag="$shared_flag "'${wl}-G'
613144dda7b2Smrg	fi
613244dda7b2Smrg      else
613344dda7b2Smrg	# not using gcc
613444dda7b2Smrg	if test "$host_cpu" = ia64; then
613544dda7b2Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
613644dda7b2Smrg	# chokes on -Wl,-G. The following line is correct:
613744dda7b2Smrg	  shared_flag='-G'
613844dda7b2Smrg	else
613944dda7b2Smrg	  if test "$aix_use_runtimelinking" = yes; then
614044dda7b2Smrg	    shared_flag='${wl}-G'
614144dda7b2Smrg	  else
614244dda7b2Smrg	    shared_flag='${wl}-bM:SRE'
614344dda7b2Smrg	  fi
614444dda7b2Smrg	fi
614544dda7b2Smrg      fi
61467a3b38f7Smrg
614744dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
614844dda7b2Smrg      # It seems that -bexpall does not export symbols beginning with
614944dda7b2Smrg      # underscore (_), so it is better to generate a list of symbols to export.
615044dda7b2Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
615144dda7b2Smrg      if test "$aix_use_runtimelinking" = yes; then
615244dda7b2Smrg	# Warning - without using the other runtime loading flags (-brtl),
615344dda7b2Smrg	# -berok will link without error, but may produce a broken library.
615444dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
615544dda7b2Smrg        # Determine the default libpath from the value encoded in an
615644dda7b2Smrg        # empty executable.
6157862f5301Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
615844dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
615944dda7b2Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
616044dda7b2Smrg      else
616144dda7b2Smrg	if test "$host_cpu" = ia64; then
616244dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
616344dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
616444dda7b2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
616544dda7b2Smrg	else
616644dda7b2Smrg	 # Determine the default libpath from the value encoded in an
616744dda7b2Smrg	 # empty executable.
6168862f5301Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
616944dda7b2Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
617044dda7b2Smrg	  # Warning - without using the other run time loading flags,
617144dda7b2Smrg	  # -berok will link without error, but may produce a broken library.
617244dda7b2Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
617344dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
617444dda7b2Smrg	  if test "$with_gnu_ld" = yes; then
617544dda7b2Smrg	    # We only use this code for GNU lds that support --whole-archive.
617644dda7b2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
617744dda7b2Smrg	  else
617844dda7b2Smrg	    # Exported symbols can be pulled into shared objects from archives
617944dda7b2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
618044dda7b2Smrg	  fi
618144dda7b2Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
618244dda7b2Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
618344dda7b2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
618444dda7b2Smrg	fi
618544dda7b2Smrg      fi
618644dda7b2Smrg      ;;
61877a3b38f7Smrg
618844dda7b2Smrg    amigaos*)
618944dda7b2Smrg      case $host_cpu in
619044dda7b2Smrg      powerpc)
619144dda7b2Smrg            # see comment about AmigaOS4 .so support
619244dda7b2Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
619344dda7b2Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
619444dda7b2Smrg        ;;
619544dda7b2Smrg      m68k)
619644dda7b2Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
619744dda7b2Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
619844dda7b2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
619944dda7b2Smrg        ;;
620044dda7b2Smrg      esac
620144dda7b2Smrg      ;;
62027a3b38f7Smrg
620344dda7b2Smrg    bsdi[[45]]*)
620444dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
620544dda7b2Smrg      ;;
6206ff559fabSmrg
620744dda7b2Smrg    cygwin* | mingw* | pw32* | cegcc*)
620844dda7b2Smrg      # When not using gcc, we currently assume that we are using
620944dda7b2Smrg      # Microsoft Visual C++.
621044dda7b2Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
621144dda7b2Smrg      # no search path for DLLs.
6212862f5301Smrg      case $cc_basename in
6213862f5301Smrg      cl*)
6214862f5301Smrg	# Native MSVC
6215862f5301Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6216862f5301Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6217862f5301Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
6218862f5301Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
6219862f5301Smrg	# Tell ltmain to make .lib files, not .a files.
6220862f5301Smrg	libext=lib
6221862f5301Smrg	# Tell ltmain to make .dll files, not .so files.
6222862f5301Smrg	shrext_cmds=".dll"
6223862f5301Smrg	# FIXME: Setting linknames here is a bad hack.
6224862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6225862f5301Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6226862f5301Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6227862f5301Smrg	  else
6228862f5301Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6229862f5301Smrg	  fi~
6230862f5301Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6231862f5301Smrg	  linknames='
6232862f5301Smrg	# The linker will not automatically build a static lib if we build a DLL.
6233862f5301Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6234862f5301Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6235862f5301Smrg	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
6236862f5301Smrg	# Don't use ranlib
6237862f5301Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6238862f5301Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6239862f5301Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6240862f5301Smrg	  case $lt_outputfile in
6241862f5301Smrg	    *.exe|*.EXE) ;;
6242862f5301Smrg	    *)
6243862f5301Smrg	      lt_outputfile="$lt_outputfile.exe"
6244862f5301Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6245862f5301Smrg	      ;;
6246862f5301Smrg	  esac~
6247862f5301Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6248862f5301Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6249862f5301Smrg	    $RM "$lt_outputfile.manifest";
6250862f5301Smrg	  fi'
6251862f5301Smrg	;;
6252862f5301Smrg      *)
6253862f5301Smrg	# Assume MSVC wrapper
6254862f5301Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6255862f5301Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6256862f5301Smrg	# Tell ltmain to make .lib files, not .a files.
6257862f5301Smrg	libext=lib
6258862f5301Smrg	# Tell ltmain to make .dll files, not .so files.
6259862f5301Smrg	shrext_cmds=".dll"
6260862f5301Smrg	# FIXME: Setting linknames here is a bad hack.
6261862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6262862f5301Smrg	# The linker will automatically build a .lib file if we build a DLL.
6263862f5301Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6264862f5301Smrg	# FIXME: Should let the user specify the lib program.
6265862f5301Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6266862f5301Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6267862f5301Smrg	;;
6268862f5301Smrg      esac
626944dda7b2Smrg      ;;
62707a3b38f7Smrg
627144dda7b2Smrg    darwin* | rhapsody*)
627244dda7b2Smrg      _LT_DARWIN_LINKER_FEATURES($1)
627344dda7b2Smrg      ;;
62747a3b38f7Smrg
627544dda7b2Smrg    dgux*)
627644dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
627744dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
627844dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
627944dda7b2Smrg      ;;
6280ff559fabSmrg
628144dda7b2Smrg    freebsd1*)
628244dda7b2Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
628344dda7b2Smrg      ;;
6284ff559fabSmrg
628544dda7b2Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
628644dda7b2Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
628744dda7b2Smrg    # does not break anything, and helps significantly (at the cost of a little
628844dda7b2Smrg    # extra space).
628944dda7b2Smrg    freebsd2.2*)
629044dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
629144dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
629244dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
629344dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
629444dda7b2Smrg      ;;
6295ff559fabSmrg
629644dda7b2Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
629744dda7b2Smrg    freebsd2*)
629844dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
629944dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
630044dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
630144dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
630244dda7b2Smrg      ;;
63037a3b38f7Smrg
630444dda7b2Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
630544dda7b2Smrg    freebsd* | dragonfly*)
6306862f5301Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
630744dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
630844dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
630944dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
631044dda7b2Smrg      ;;
63117a3b38f7Smrg
631244dda7b2Smrg    hpux9*)
631344dda7b2Smrg      if test "$GCC" = yes; then
6314862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
631544dda7b2Smrg      else
631644dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
631744dda7b2Smrg      fi
631844dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
631944dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
632044dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63217a3b38f7Smrg
632244dda7b2Smrg      # hardcode_minus_L: Not really in the search PATH,
632344dda7b2Smrg      # but as the default location of the library.
632444dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
632544dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
632644dda7b2Smrg      ;;
63277a3b38f7Smrg
632844dda7b2Smrg    hpux10*)
632944dda7b2Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6330862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
633144dda7b2Smrg      else
633244dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
633344dda7b2Smrg      fi
633444dda7b2Smrg      if test "$with_gnu_ld" = no; then
633544dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
633644dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
633744dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
633844dda7b2Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
633944dda7b2Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
634044dda7b2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
634144dda7b2Smrg	# hardcode_minus_L: Not really in the search PATH,
634244dda7b2Smrg	# but as the default location of the library.
634344dda7b2Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
634444dda7b2Smrg      fi
634544dda7b2Smrg      ;;
6346ff559fabSmrg
634744dda7b2Smrg    hpux11*)
634844dda7b2Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
634944dda7b2Smrg	case $host_cpu in
635044dda7b2Smrg	hppa*64*)
635144dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
635244dda7b2Smrg	  ;;
635344dda7b2Smrg	ia64*)
6354862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
635544dda7b2Smrg	  ;;
635644dda7b2Smrg	*)
6357862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
635844dda7b2Smrg	  ;;
635944dda7b2Smrg	esac
636044dda7b2Smrg      else
636144dda7b2Smrg	case $host_cpu in
636244dda7b2Smrg	hppa*64*)
636344dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
636444dda7b2Smrg	  ;;
636544dda7b2Smrg	ia64*)
636644dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
636744dda7b2Smrg	  ;;
636844dda7b2Smrg	*)
636944dda7b2Smrg	m4_if($1, [], [
637044dda7b2Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
637144dda7b2Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
637244dda7b2Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
637344dda7b2Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
637444dda7b2Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
637544dda7b2Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
637644dda7b2Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
637744dda7b2Smrg	  ;;
637844dda7b2Smrg	esac
637944dda7b2Smrg      fi
638044dda7b2Smrg      if test "$with_gnu_ld" = no; then
638144dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
638244dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
63837a3b38f7Smrg
638444dda7b2Smrg	case $host_cpu in
638544dda7b2Smrg	hppa*64*|ia64*)
638644dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
638744dda7b2Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
638844dda7b2Smrg	  ;;
638944dda7b2Smrg	*)
639044dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
639144dda7b2Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
639244dda7b2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63937a3b38f7Smrg
639444dda7b2Smrg	  # hardcode_minus_L: Not really in the search PATH,
639544dda7b2Smrg	  # but as the default location of the library.
639644dda7b2Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
639744dda7b2Smrg	  ;;
639844dda7b2Smrg	esac
639944dda7b2Smrg      fi
640044dda7b2Smrg      ;;
64017a3b38f7Smrg
640244dda7b2Smrg    irix5* | irix6* | nonstopux*)
640344dda7b2Smrg      if test "$GCC" = yes; then
6404862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
640544dda7b2Smrg	# Try to use the -exported_symbol ld option, if it does not
640644dda7b2Smrg	# work, assume that -exports_file does not work either and
640744dda7b2Smrg	# implicitly export all symbols.
6408862f5301Smrg	# This should be the same for all languages, so no per-tag cache variable.
6409862f5301Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6410862f5301Smrg	  [lt_cv_irix_exported_symbol],
6411862f5301Smrg	  [save_LDFLAGS="$LDFLAGS"
6412862f5301Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6413862f5301Smrg	   AC_LINK_IFELSE(
6414862f5301Smrg	     [AC_LANG_SOURCE(
6415862f5301Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6416862f5301Smrg			      [C++], [[int foo (void) { return 0; }]],
6417862f5301Smrg			      [Fortran 77], [[
6418862f5301Smrg      subroutine foo
6419862f5301Smrg      end]],
6420862f5301Smrg			      [Fortran], [[
6421862f5301Smrg      subroutine foo
6422862f5301Smrg      end]])])],
6423862f5301Smrg	      [lt_cv_irix_exported_symbol=yes],
6424862f5301Smrg	      [lt_cv_irix_exported_symbol=no])
6425862f5301Smrg           LDFLAGS="$save_LDFLAGS"])
6426862f5301Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
6427862f5301Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
6428862f5301Smrg	fi
642944dda7b2Smrg      else
643044dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
643144dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
643244dda7b2Smrg      fi
643344dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
643444dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
643544dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
643644dda7b2Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
643744dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
643844dda7b2Smrg      ;;
64397a3b38f7Smrg
644044dda7b2Smrg    netbsd*)
644144dda7b2Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
644244dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
644344dda7b2Smrg      else
644444dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
644544dda7b2Smrg      fi
644644dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
644744dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
644844dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
644944dda7b2Smrg      ;;
64507a3b38f7Smrg
645144dda7b2Smrg    newsos6)
645244dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
645344dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
645444dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
645544dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
645644dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
645744dda7b2Smrg      ;;
64587a3b38f7Smrg
645944dda7b2Smrg    *nto* | *qnx*)
646044dda7b2Smrg      ;;
64617a3b38f7Smrg
646244dda7b2Smrg    openbsd*)
646344dda7b2Smrg      if test -f /usr/libexec/ld.so; then
646444dda7b2Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
646544dda7b2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
646644dda7b2Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
646744dda7b2Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
646844dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
646944dda7b2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
647044dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
647144dda7b2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
647244dda7b2Smrg	else
647344dda7b2Smrg	  case $host_os in
647444dda7b2Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
647544dda7b2Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
647644dda7b2Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
647744dda7b2Smrg	     ;;
647844dda7b2Smrg	   *)
647944dda7b2Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
648044dda7b2Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
648144dda7b2Smrg	     ;;
648244dda7b2Smrg	  esac
6483ff559fabSmrg	fi
648444dda7b2Smrg      else
648544dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
648644dda7b2Smrg      fi
648744dda7b2Smrg      ;;
64887a3b38f7Smrg
648944dda7b2Smrg    os2*)
649044dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
649144dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
649244dda7b2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
649344dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
649444dda7b2Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
649544dda7b2Smrg      ;;
64967a3b38f7Smrg
649744dda7b2Smrg    osf3*)
649844dda7b2Smrg      if test "$GCC" = yes; then
649944dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
650044dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
650144dda7b2Smrg      else
650244dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
650344dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
650444dda7b2Smrg      fi
650544dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
650644dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
650744dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
650844dda7b2Smrg      ;;
65097a3b38f7Smrg
651044dda7b2Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
651144dda7b2Smrg      if test "$GCC" = yes; then
651244dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6513862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
651444dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
651544dda7b2Smrg      else
651644dda7b2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
651744dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
651844dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
651944dda7b2Smrg	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
65207a3b38f7Smrg
652144dda7b2Smrg	# Both c and cxx compiler support -rpath directly
652244dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
652344dda7b2Smrg      fi
652444dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
652544dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
652644dda7b2Smrg      ;;
65277a3b38f7Smrg
652844dda7b2Smrg    solaris*)
652944dda7b2Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
653044dda7b2Smrg      if test "$GCC" = yes; then
653144dda7b2Smrg	wlarc='${wl}'
6532862f5301Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
653344dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6534862f5301Smrg	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
653544dda7b2Smrg      else
653644dda7b2Smrg	case `$CC -V 2>&1` in
653744dda7b2Smrg	*"Compilers 5.0"*)
653844dda7b2Smrg	  wlarc=''
653944dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
654044dda7b2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
654144dda7b2Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
654244dda7b2Smrg	  ;;
654344dda7b2Smrg	*)
654444dda7b2Smrg	  wlarc='${wl}'
654544dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
654644dda7b2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
654744dda7b2Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
654844dda7b2Smrg	  ;;
654944dda7b2Smrg	esac
655044dda7b2Smrg      fi
655144dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
655244dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
655344dda7b2Smrg      case $host_os in
655444dda7b2Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
655544dda7b2Smrg      *)
655644dda7b2Smrg	# The compiler driver will combine and reorder linker options,
655744dda7b2Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
655844dda7b2Smrg	# but is careful enough not to reorder.
655944dda7b2Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
656044dda7b2Smrg	if test "$GCC" = yes; then
656144dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
656244dda7b2Smrg	else
656344dda7b2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
656444dda7b2Smrg	fi
656544dda7b2Smrg	;;
656644dda7b2Smrg      esac
656744dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
656844dda7b2Smrg      ;;
6569ff559fabSmrg
657044dda7b2Smrg    sunos4*)
657144dda7b2Smrg      if test "x$host_vendor" = xsequent; then
657244dda7b2Smrg	# Use $CC to link under sequent, because it throws in some extra .o
657344dda7b2Smrg	# files that make .init and .fini sections work.
657444dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
657544dda7b2Smrg      else
657644dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
657744dda7b2Smrg      fi
657844dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
657944dda7b2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
658044dda7b2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
658144dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
658244dda7b2Smrg      ;;
6583ff559fabSmrg
658444dda7b2Smrg    sysv4)
658544dda7b2Smrg      case $host_vendor in
658644dda7b2Smrg	sni)
658744dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
658844dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
658944dda7b2Smrg	;;
659044dda7b2Smrg	siemens)
659144dda7b2Smrg	  ## LD is ld it makes a PLAMLIB
659244dda7b2Smrg	  ## CC just makes a GrossModule.
659344dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
659444dda7b2Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
659544dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
659644dda7b2Smrg        ;;
659744dda7b2Smrg	motorola)
659844dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
659944dda7b2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
660044dda7b2Smrg	;;
660144dda7b2Smrg      esac
660244dda7b2Smrg      runpath_var='LD_RUN_PATH'
660344dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
660444dda7b2Smrg      ;;
6605ff559fabSmrg
660644dda7b2Smrg    sysv4.3*)
660744dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
660844dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
660944dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
661044dda7b2Smrg      ;;
6611ff559fabSmrg
661244dda7b2Smrg    sysv4*MP*)
661344dda7b2Smrg      if test -d /usr/nec; then
661444dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
661544dda7b2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
661644dda7b2Smrg	runpath_var=LD_RUN_PATH
661744dda7b2Smrg	hardcode_runpath_var=yes
661844dda7b2Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
661944dda7b2Smrg      fi
662044dda7b2Smrg      ;;
6621ff559fabSmrg
662244dda7b2Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
662344dda7b2Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
662444dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
662544dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
662644dda7b2Smrg      runpath_var='LD_RUN_PATH'
6627ff559fabSmrg
662844dda7b2Smrg      if test "$GCC" = yes; then
662944dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
663044dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
663144dda7b2Smrg      else
663244dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
663344dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
663444dda7b2Smrg      fi
663544dda7b2Smrg      ;;
6636ff559fabSmrg
663744dda7b2Smrg    sysv5* | sco3.2v5* | sco5v6*)
663844dda7b2Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
663944dda7b2Smrg      # link with -lc, and that would cause any symbols used from libc to
664044dda7b2Smrg      # always be unresolved, which means just about no library would
664144dda7b2Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
664244dda7b2Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
664344dda7b2Smrg      # as -z defs.
664444dda7b2Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
664544dda7b2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
664644dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
664744dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
664844dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
664944dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
665044dda7b2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
665144dda7b2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
665244dda7b2Smrg      runpath_var='LD_RUN_PATH'
66537a3b38f7Smrg
665444dda7b2Smrg      if test "$GCC" = yes; then
665544dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
665644dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
665744dda7b2Smrg      else
665844dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
665944dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
666044dda7b2Smrg      fi
666144dda7b2Smrg      ;;
66627a3b38f7Smrg
666344dda7b2Smrg    uts4*)
666444dda7b2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
666544dda7b2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
666644dda7b2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
666744dda7b2Smrg      ;;
66687a3b38f7Smrg
666944dda7b2Smrg    *)
667044dda7b2Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
667144dda7b2Smrg      ;;
667244dda7b2Smrg    esac
66737a3b38f7Smrg
667444dda7b2Smrg    if test x$host_vendor = xsni; then
667544dda7b2Smrg      case $host in
667644dda7b2Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
667744dda7b2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
667844dda7b2Smrg	;;
667944dda7b2Smrg      esac
668044dda7b2Smrg    fi
668144dda7b2Smrg  fi
668244dda7b2Smrg])
668344dda7b2SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
668444dda7b2Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
66857a3b38f7Smrg
668644dda7b2Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
66877a3b38f7Smrg
668844dda7b2Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
668944dda7b2Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
669044dda7b2Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
669144dda7b2Smrg    [The commands to extract the exported symbol list from a shared archive])
66927a3b38f7Smrg
669344dda7b2Smrg#
669444dda7b2Smrg# Do we need to explicitly link libc?
669544dda7b2Smrg#
669644dda7b2Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
669744dda7b2Smrgx|xyes)
669844dda7b2Smrg  # Assume -lc should be added
669944dda7b2Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
67007a3b38f7Smrg
670144dda7b2Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
670244dda7b2Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
670344dda7b2Smrg    *'~'*)
670444dda7b2Smrg      # FIXME: we may have to deal with multi-command sequences.
670544dda7b2Smrg      ;;
670644dda7b2Smrg    '$CC '*)
670744dda7b2Smrg      # Test whether the compiler implicitly links with -lc since on some
670844dda7b2Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
670944dda7b2Smrg      # to ld, don't add -lc before -lgcc.
671044dda7b2Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
671144dda7b2Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
671244dda7b2Smrg	[$RM conftest*
671344dda7b2Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
671444dda7b2Smrg
671544dda7b2Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
671644dda7b2Smrg	  soname=conftest
671744dda7b2Smrg	  lib=conftest
671844dda7b2Smrg	  libobjs=conftest.$ac_objext
671944dda7b2Smrg	  deplibs=
672044dda7b2Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
672144dda7b2Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
672244dda7b2Smrg	  compiler_flags=-v
672344dda7b2Smrg	  linker_flags=-v
672444dda7b2Smrg	  verstring=
672544dda7b2Smrg	  output_objdir=.
672644dda7b2Smrg	  libname=conftest
672744dda7b2Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
672844dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
672944dda7b2Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
673044dda7b2Smrg	  then
673144dda7b2Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
673244dda7b2Smrg	  else
673344dda7b2Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
673444dda7b2Smrg	  fi
673544dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
673644dda7b2Smrg	else
673744dda7b2Smrg	  cat conftest.err 1>&5
673844dda7b2Smrg	fi
673944dda7b2Smrg	$RM conftest*
674044dda7b2Smrg	])
674144dda7b2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
674244dda7b2Smrg      ;;
674344dda7b2Smrg    esac
674444dda7b2Smrg  fi
674544dda7b2Smrg  ;;
674644dda7b2Smrgesac
67477a3b38f7Smrg
674844dda7b2Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
674944dda7b2Smrg    [Whether or not to add -lc for building shared libraries])
675044dda7b2Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
675144dda7b2Smrg    [enable_shared_with_static_runtimes], [0],
675244dda7b2Smrg    [Whether or not to disallow shared libs when runtime libs are static])
675344dda7b2Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
675444dda7b2Smrg    [Compiler flag to allow reflexive dlopens])
675544dda7b2Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
675644dda7b2Smrg    [Compiler flag to generate shared objects directly from archives])
675744dda7b2Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
675844dda7b2Smrg    [Whether the compiler copes with passing no objects directly])
675944dda7b2Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
676044dda7b2Smrg    [Create an old-style archive from a shared archive])
676144dda7b2Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
676244dda7b2Smrg    [Create a temporary old-style archive to link instead of a shared archive])
676344dda7b2Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
676444dda7b2Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
676544dda7b2Smrg_LT_TAGDECL([], [module_cmds], [2],
676644dda7b2Smrg    [Commands used to build a loadable module if different from building
676744dda7b2Smrg    a shared archive.])
676844dda7b2Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
676944dda7b2Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
677044dda7b2Smrg    [Whether we are building with GNU ld or not])
677144dda7b2Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
677244dda7b2Smrg    [Flag that allows shared libraries with undefined symbols to be built])
677344dda7b2Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
677444dda7b2Smrg    [Flag that enforces no undefined symbols])
677544dda7b2Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
677644dda7b2Smrg    [Flag to hardcode $libdir into a binary during linking.
677744dda7b2Smrg    This must work even if $libdir does not exist])
677844dda7b2Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
677944dda7b2Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
678044dda7b2Smrg    during linking.  This must work even if $libdir does not exist]])
678144dda7b2Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
678244dda7b2Smrg    [Whether we need a single "-rpath" flag with a separated argument])
678344dda7b2Smrg_LT_TAGDECL([], [hardcode_direct], [0],
678444dda7b2Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
678544dda7b2Smrg    DIR into the resulting binary])
678644dda7b2Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
678744dda7b2Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
678844dda7b2Smrg    DIR into the resulting binary and the resulting library dependency is
678944dda7b2Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
679044dda7b2Smrg    library is relocated])
679144dda7b2Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
679244dda7b2Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
679344dda7b2Smrg    into the resulting binary])
679444dda7b2Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
679544dda7b2Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
679644dda7b2Smrg    into the resulting binary])
679744dda7b2Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
679844dda7b2Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
679944dda7b2Smrg    into the library and all subsequent libraries and executables linked
680044dda7b2Smrg    against it])
680144dda7b2Smrg_LT_TAGDECL([], [inherit_rpath], [0],
680244dda7b2Smrg    [Set to yes if linker adds runtime paths of dependent libraries
680344dda7b2Smrg    to runtime path list])
680444dda7b2Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
680544dda7b2Smrg    [Whether libtool must link a program against all its dependency libraries])
680644dda7b2Smrg_LT_TAGDECL([], [always_export_symbols], [0],
680744dda7b2Smrg    [Set to "yes" if exported symbols are required])
680844dda7b2Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
680944dda7b2Smrg    [The commands to list exported symbols])
681044dda7b2Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
681144dda7b2Smrg    [Symbols that should not be listed in the preloaded symbols])
681244dda7b2Smrg_LT_TAGDECL([], [include_expsyms], [1],
681344dda7b2Smrg    [Symbols that must always be exported])
681444dda7b2Smrg_LT_TAGDECL([], [prelink_cmds], [2],
681544dda7b2Smrg    [Commands necessary for linking programs (against libraries) with templates])
6816862f5301Smrg_LT_TAGDECL([], [postlink_cmds], [2],
6817862f5301Smrg    [Commands necessary for finishing linking programs])
681844dda7b2Smrg_LT_TAGDECL([], [file_list_spec], [1],
681944dda7b2Smrg    [Specify filename containing input files])
682044dda7b2Smrgdnl FIXME: Not yet implemented
682144dda7b2Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
682244dda7b2Smrgdnl    [Compiler flag to generate thread safe objects])
682344dda7b2Smrg])# _LT_LINKER_SHLIBS
68247a3b38f7Smrg
68257a3b38f7Smrg
682644dda7b2Smrg# _LT_LANG_C_CONFIG([TAG])
682744dda7b2Smrg# ------------------------
682844dda7b2Smrg# Ensure that the configuration variables for a C compiler are suitably
682944dda7b2Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
683044dda7b2Smrg# the compiler configuration to `libtool'.
683144dda7b2Smrgm4_defun([_LT_LANG_C_CONFIG],
683244dda7b2Smrg[m4_require([_LT_DECL_EGREP])dnl
683344dda7b2Smrglt_save_CC="$CC"
683444dda7b2SmrgAC_LANG_PUSH(C)
68357a3b38f7Smrg
683644dda7b2Smrg# Source file extension for C test sources.
683744dda7b2Smrgac_ext=c
68387a3b38f7Smrg
683944dda7b2Smrg# Object file extension for compiled C test sources.
68407a3b38f7Smrgobjext=o
68417a3b38f7Smrg_LT_TAGVAR(objext, $1)=$objext
68427a3b38f7Smrg
68437a3b38f7Smrg# Code to be used in simple compile tests
684444dda7b2Smrglt_simple_compile_test_code="int some_variable = 0;"
68457a3b38f7Smrg
68467a3b38f7Smrg# Code to be used in simple link tests
684744dda7b2Smrglt_simple_link_test_code='int main(){return(0);}'
68487a3b38f7Smrg
68497a3b38f7Smrg_LT_TAG_COMPILER
685044dda7b2Smrg# Save the default compiler, since it gets overwritten when the other
685144dda7b2Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
685244dda7b2Smrgcompiler_DEFAULT=$CC
68537a3b38f7Smrg
68547a3b38f7Smrg# save warnings/boilerplate of simple test code
68557a3b38f7Smrg_LT_COMPILER_BOILERPLATE
68567a3b38f7Smrg_LT_LINKER_BOILERPLATE
68577a3b38f7Smrg
68587a3b38f7Smrgif test -n "$compiler"; then
685944dda7b2Smrg  _LT_COMPILER_NO_RTTI($1)
686044dda7b2Smrg  _LT_COMPILER_PIC($1)
686144dda7b2Smrg  _LT_COMPILER_C_O($1)
686244dda7b2Smrg  _LT_COMPILER_FILE_LOCKS($1)
686344dda7b2Smrg  _LT_LINKER_SHLIBS($1)
686444dda7b2Smrg  _LT_SYS_DYNAMIC_LINKER($1)
686544dda7b2Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
686644dda7b2Smrg  LT_SYS_DLOPEN_SELF
686744dda7b2Smrg  _LT_CMD_STRIPLIB
68687a3b38f7Smrg
686944dda7b2Smrg  # Report which library types will actually be built
687044dda7b2Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
687144dda7b2Smrg  AC_MSG_RESULT([$can_build_shared])
68727a3b38f7Smrg
687344dda7b2Smrg  AC_MSG_CHECKING([whether to build shared libraries])
687444dda7b2Smrg  test "$can_build_shared" = "no" && enable_shared=no
68757a3b38f7Smrg
687644dda7b2Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
687744dda7b2Smrg  # are all built from PIC.
687844dda7b2Smrg  case $host_os in
687944dda7b2Smrg  aix3*)
688044dda7b2Smrg    test "$enable_shared" = yes && enable_static=no
688144dda7b2Smrg    if test -n "$RANLIB"; then
688244dda7b2Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
688344dda7b2Smrg      postinstall_cmds='$RANLIB $lib'
688444dda7b2Smrg    fi
688544dda7b2Smrg    ;;
68867a3b38f7Smrg
688744dda7b2Smrg  aix[[4-9]]*)
688844dda7b2Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
688944dda7b2Smrg      test "$enable_shared" = yes && enable_static=no
689044dda7b2Smrg    fi
689144dda7b2Smrg    ;;
68927a3b38f7Smrg  esac
689344dda7b2Smrg  AC_MSG_RESULT([$enable_shared])
68947a3b38f7Smrg
689544dda7b2Smrg  AC_MSG_CHECKING([whether to build static libraries])
689644dda7b2Smrg  # Make sure either enable_shared or enable_static is yes.
689744dda7b2Smrg  test "$enable_shared" = yes || enable_static=yes
689844dda7b2Smrg  AC_MSG_RESULT([$enable_static])
68997a3b38f7Smrg
690044dda7b2Smrg  _LT_CONFIG($1)
690144dda7b2Smrgfi
690244dda7b2SmrgAC_LANG_POP
690344dda7b2SmrgCC="$lt_save_CC"
690444dda7b2Smrg])# _LT_LANG_C_CONFIG
69057a3b38f7Smrg
69067a3b38f7Smrg
690744dda7b2Smrg# _LT_LANG_CXX_CONFIG([TAG])
690844dda7b2Smrg# --------------------------
690944dda7b2Smrg# Ensure that the configuration variables for a C++ compiler are suitably
691044dda7b2Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
691144dda7b2Smrg# the compiler configuration to `libtool'.
691244dda7b2Smrgm4_defun([_LT_LANG_CXX_CONFIG],
691344dda7b2Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
691444dda7b2Smrgm4_require([_LT_DECL_EGREP])dnl
6915862f5301Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
691644dda7b2Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
691744dda7b2Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
691844dda7b2Smrg    (test "X$CXX" != "Xg++"))) ; then
691944dda7b2Smrg  AC_PROG_CXXCPP
692044dda7b2Smrgelse
692144dda7b2Smrg  _lt_caught_CXX_error=yes
692244dda7b2Smrgfi
69237a3b38f7Smrg
692444dda7b2SmrgAC_LANG_PUSH(C++)
692544dda7b2Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
692644dda7b2Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
692744dda7b2Smrg_LT_TAGVAR(always_export_symbols, $1)=no
692844dda7b2Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
692944dda7b2Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
693044dda7b2Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
693144dda7b2Smrg_LT_TAGVAR(hardcode_direct, $1)=no
693244dda7b2Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
693344dda7b2Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
693444dda7b2Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
693544dda7b2Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
693644dda7b2Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
693744dda7b2Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
693844dda7b2Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
693944dda7b2Smrg_LT_TAGVAR(inherit_rpath, $1)=no
694044dda7b2Smrg_LT_TAGVAR(module_cmds, $1)=
694144dda7b2Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
694244dda7b2Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
694344dda7b2Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
694444dda7b2Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
694544dda7b2Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
694644dda7b2Smrg_LT_TAGVAR(no_undefined_flag, $1)=
694744dda7b2Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
694844dda7b2Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
69497a3b38f7Smrg
695044dda7b2Smrg# Source file extension for C++ test sources.
695144dda7b2Smrgac_ext=cpp
69527a3b38f7Smrg
695344dda7b2Smrg# Object file extension for compiled C++ test sources.
695444dda7b2Smrgobjext=o
695544dda7b2Smrg_LT_TAGVAR(objext, $1)=$objext
69567a3b38f7Smrg
695744dda7b2Smrg# No sense in running all these tests if we already determined that
695844dda7b2Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
695944dda7b2Smrg# are currently assumed to apply to all compilers on this platform,
696044dda7b2Smrg# and will be corrupted by setting them based on a non-working compiler.
696144dda7b2Smrgif test "$_lt_caught_CXX_error" != yes; then
696244dda7b2Smrg  # Code to be used in simple compile tests
696344dda7b2Smrg  lt_simple_compile_test_code="int some_variable = 0;"
69647a3b38f7Smrg
696544dda7b2Smrg  # Code to be used in simple link tests
696644dda7b2Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
69677a3b38f7Smrg
696844dda7b2Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
696944dda7b2Smrg  _LT_TAG_COMPILER
69707a3b38f7Smrg
697144dda7b2Smrg  # save warnings/boilerplate of simple test code
697244dda7b2Smrg  _LT_COMPILER_BOILERPLATE
697344dda7b2Smrg  _LT_LINKER_BOILERPLATE
69747a3b38f7Smrg
697544dda7b2Smrg  # Allow CC to be a program name with arguments.
697644dda7b2Smrg  lt_save_CC=$CC
6977862f5301Smrg  lt_save_CFLAGS=$CFLAGS
697844dda7b2Smrg  lt_save_LD=$LD
697944dda7b2Smrg  lt_save_GCC=$GCC
698044dda7b2Smrg  GCC=$GXX
698144dda7b2Smrg  lt_save_with_gnu_ld=$with_gnu_ld
698244dda7b2Smrg  lt_save_path_LD=$lt_cv_path_LD
698344dda7b2Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
698444dda7b2Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
698544dda7b2Smrg  else
698644dda7b2Smrg    $as_unset lt_cv_prog_gnu_ld
698744dda7b2Smrg  fi
698844dda7b2Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
698944dda7b2Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
699044dda7b2Smrg  else
699144dda7b2Smrg    $as_unset lt_cv_path_LD
699244dda7b2Smrg  fi
699344dda7b2Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
699444dda7b2Smrg  CC=${CXX-"c++"}
6995862f5301Smrg  CFLAGS=$CXXFLAGS
699644dda7b2Smrg  compiler=$CC
699744dda7b2Smrg  _LT_TAGVAR(compiler, $1)=$CC
699844dda7b2Smrg  _LT_CC_BASENAME([$compiler])
69997a3b38f7Smrg
700044dda7b2Smrg  if test -n "$compiler"; then
700144dda7b2Smrg    # We don't want -fno-exception when compiling C++ code, so set the
700244dda7b2Smrg    # no_builtin_flag separately
700344dda7b2Smrg    if test "$GXX" = yes; then
700444dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
700544dda7b2Smrg    else
700644dda7b2Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
700744dda7b2Smrg    fi
70087a3b38f7Smrg
700944dda7b2Smrg    if test "$GXX" = yes; then
701044dda7b2Smrg      # Set up default GNU C++ configuration
70117a3b38f7Smrg
701244dda7b2Smrg      LT_PATH_LD
70137a3b38f7Smrg
701444dda7b2Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
701544dda7b2Smrg      # archiving commands below assume that GNU ld is being used.
701644dda7b2Smrg      if test "$with_gnu_ld" = yes; then
7017862f5301Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7018862f5301Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
70197a3b38f7Smrg
702044dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
702144dda7b2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
70227a3b38f7Smrg
702344dda7b2Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
702444dda7b2Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
702544dda7b2Smrg        #     investigate it a little bit more. (MM)
702644dda7b2Smrg        wlarc='${wl}'
70277a3b38f7Smrg
702844dda7b2Smrg        # ancient GNU ld didn't support --whole-archive et. al.
702944dda7b2Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
703044dda7b2Smrg	  $GREP 'no-whole-archive' > /dev/null; then
703144dda7b2Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
703244dda7b2Smrg        else
703344dda7b2Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
703444dda7b2Smrg        fi
703544dda7b2Smrg      else
703644dda7b2Smrg        with_gnu_ld=no
703744dda7b2Smrg        wlarc=
70387a3b38f7Smrg
703944dda7b2Smrg        # A generic and very simple default shared library creation
704044dda7b2Smrg        # command for GNU C++ for the case where it uses the native
704144dda7b2Smrg        # linker, instead of GNU ld.  If possible, this setting should
704244dda7b2Smrg        # overridden to take advantage of the native linker features on
704344dda7b2Smrg        # the platform it is being used on.
704444dda7b2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
704544dda7b2Smrg      fi
70467a3b38f7Smrg
704744dda7b2Smrg      # Commands to make compiler produce verbose output that lists
704844dda7b2Smrg      # what "hidden" libraries, object files and flags are used when
704944dda7b2Smrg      # linking a shared library.
705044dda7b2Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
70517a3b38f7Smrg
705244dda7b2Smrg    else
705344dda7b2Smrg      GXX=no
705444dda7b2Smrg      with_gnu_ld=no
705544dda7b2Smrg      wlarc=
705644dda7b2Smrg    fi
70577a3b38f7Smrg
705844dda7b2Smrg    # PORTME: fill in a description of your system's C++ link characteristics
705944dda7b2Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
706044dda7b2Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
706144dda7b2Smrg    case $host_os in
706244dda7b2Smrg      aix3*)
706344dda7b2Smrg        # FIXME: insert proper C++ library support
706444dda7b2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
706544dda7b2Smrg        ;;
706644dda7b2Smrg      aix[[4-9]]*)
706744dda7b2Smrg        if test "$host_cpu" = ia64; then
706844dda7b2Smrg          # On IA64, the linker does run time linking by default, so we don't
706944dda7b2Smrg          # have to do anything special.
707044dda7b2Smrg          aix_use_runtimelinking=no
707144dda7b2Smrg          exp_sym_flag='-Bexport'
707244dda7b2Smrg          no_entry_flag=""
707344dda7b2Smrg        else
707444dda7b2Smrg          aix_use_runtimelinking=no
70757a3b38f7Smrg
707644dda7b2Smrg          # Test if we are trying to use run time linking or normal
707744dda7b2Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
707844dda7b2Smrg          # need to do runtime linking.
707944dda7b2Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
708044dda7b2Smrg	    for ld_flag in $LDFLAGS; do
708144dda7b2Smrg	      case $ld_flag in
708244dda7b2Smrg	      *-brtl*)
708344dda7b2Smrg	        aix_use_runtimelinking=yes
708444dda7b2Smrg	        break
708544dda7b2Smrg	        ;;
708644dda7b2Smrg	      esac
708744dda7b2Smrg	    done
708844dda7b2Smrg	    ;;
708944dda7b2Smrg          esac
70907a3b38f7Smrg
709144dda7b2Smrg          exp_sym_flag='-bexport'
709244dda7b2Smrg          no_entry_flag='-bnoentry'
709344dda7b2Smrg        fi
70947a3b38f7Smrg
709544dda7b2Smrg        # When large executables or shared objects are built, AIX ld can
709644dda7b2Smrg        # have problems creating the table of contents.  If linking a library
709744dda7b2Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
709844dda7b2Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
709944dda7b2Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
71007a3b38f7Smrg
710144dda7b2Smrg        _LT_TAGVAR(archive_cmds, $1)=''
710244dda7b2Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
710344dda7b2Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
710444dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
710544dda7b2Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
710644dda7b2Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
71077a3b38f7Smrg
710844dda7b2Smrg        if test "$GXX" = yes; then
710944dda7b2Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
711044dda7b2Smrg          # We only want to do this on AIX 4.2 and lower, the check
711144dda7b2Smrg          # below for broken collect2 doesn't work under 4.3+
711244dda7b2Smrg	  collect2name=`${CC} -print-prog-name=collect2`
711344dda7b2Smrg	  if test -f "$collect2name" &&
711444dda7b2Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
711544dda7b2Smrg	  then
711644dda7b2Smrg	    # We have reworked collect2
711744dda7b2Smrg	    :
711844dda7b2Smrg	  else
711944dda7b2Smrg	    # We have old collect2
712044dda7b2Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
712144dda7b2Smrg	    # It fails to find uninstalled libraries when the uninstalled
712244dda7b2Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
712344dda7b2Smrg	    # to unsupported forces relinking
712444dda7b2Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
712544dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
712644dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
712744dda7b2Smrg	  fi
712844dda7b2Smrg          esac
712944dda7b2Smrg          shared_flag='-shared'
713044dda7b2Smrg	  if test "$aix_use_runtimelinking" = yes; then
713144dda7b2Smrg	    shared_flag="$shared_flag "'${wl}-G'
713244dda7b2Smrg	  fi
713344dda7b2Smrg        else
713444dda7b2Smrg          # not using gcc
713544dda7b2Smrg          if test "$host_cpu" = ia64; then
713644dda7b2Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
713744dda7b2Smrg	  # chokes on -Wl,-G. The following line is correct:
713844dda7b2Smrg	  shared_flag='-G'
713944dda7b2Smrg          else
714044dda7b2Smrg	    if test "$aix_use_runtimelinking" = yes; then
714144dda7b2Smrg	      shared_flag='${wl}-G'
714244dda7b2Smrg	    else
714344dda7b2Smrg	      shared_flag='${wl}-bM:SRE'
714444dda7b2Smrg	    fi
714544dda7b2Smrg          fi
714644dda7b2Smrg        fi
71477a3b38f7Smrg
714844dda7b2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
714944dda7b2Smrg        # It seems that -bexpall does not export symbols beginning with
715044dda7b2Smrg        # underscore (_), so it is better to generate a list of symbols to
715144dda7b2Smrg	# export.
715244dda7b2Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
715344dda7b2Smrg        if test "$aix_use_runtimelinking" = yes; then
715444dda7b2Smrg          # Warning - without using the other runtime loading flags (-brtl),
715544dda7b2Smrg          # -berok will link without error, but may produce a broken library.
715644dda7b2Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
715744dda7b2Smrg          # Determine the default libpath from the value encoded in an empty
715844dda7b2Smrg          # executable.
7159862f5301Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
716044dda7b2Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
71617a3b38f7Smrg
716244dda7b2Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
716344dda7b2Smrg        else
716444dda7b2Smrg          if test "$host_cpu" = ia64; then
716544dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
716644dda7b2Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
716744dda7b2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
716844dda7b2Smrg          else
716944dda7b2Smrg	    # Determine the default libpath from the value encoded in an
717044dda7b2Smrg	    # empty executable.
7171862f5301Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
717244dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
717344dda7b2Smrg	    # Warning - without using the other run time loading flags,
717444dda7b2Smrg	    # -berok will link without error, but may produce a broken library.
717544dda7b2Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
717644dda7b2Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
717744dda7b2Smrg	    if test "$with_gnu_ld" = yes; then
717844dda7b2Smrg	      # We only use this code for GNU lds that support --whole-archive.
717944dda7b2Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
718044dda7b2Smrg	    else
718144dda7b2Smrg	      # Exported symbols can be pulled into shared objects from archives
718244dda7b2Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
718344dda7b2Smrg	    fi
718444dda7b2Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
718544dda7b2Smrg	    # This is similar to how AIX traditionally builds its shared
718644dda7b2Smrg	    # libraries.
718744dda7b2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
718844dda7b2Smrg          fi
718944dda7b2Smrg        fi
719044dda7b2Smrg        ;;
71917a3b38f7Smrg
719244dda7b2Smrg      beos*)
719344dda7b2Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
719444dda7b2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
719544dda7b2Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
719644dda7b2Smrg	  # support --undefined.  This deserves some investigation.  FIXME
719744dda7b2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
719844dda7b2Smrg	else
719944dda7b2Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
720044dda7b2Smrg	fi
720144dda7b2Smrg	;;
72027a3b38f7Smrg
720344dda7b2Smrg      chorus*)
720444dda7b2Smrg        case $cc_basename in
720544dda7b2Smrg          *)
720644dda7b2Smrg	  # FIXME: insert proper C++ library support
720744dda7b2Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
720844dda7b2Smrg	  ;;
720944dda7b2Smrg        esac
721044dda7b2Smrg        ;;
72117a3b38f7Smrg
721244dda7b2Smrg      cygwin* | mingw* | pw32* | cegcc*)
7213862f5301Smrg	case $GXX,$cc_basename in
7214862f5301Smrg	,cl* | no,cl*)
7215862f5301Smrg	  # Native MSVC
7216862f5301Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7217862f5301Smrg	  # no search path for DLLs.
7218862f5301Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7219862f5301Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7220862f5301Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
7221862f5301Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
7222862f5301Smrg	  # Tell ltmain to make .lib files, not .a files.
7223862f5301Smrg	  libext=lib
7224862f5301Smrg	  # Tell ltmain to make .dll files, not .so files.
7225862f5301Smrg	  shrext_cmds=".dll"
7226862f5301Smrg	  # FIXME: Setting linknames here is a bad hack.
7227862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7228862f5301Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7229862f5301Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7230862f5301Smrg	    else
7231862f5301Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7232862f5301Smrg	    fi~
7233862f5301Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7234862f5301Smrg	    linknames='
7235862f5301Smrg	  # The linker will not automatically build a static lib if we build a DLL.
7236862f5301Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7237862f5301Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7238862f5301Smrg	  # Don't use ranlib
7239862f5301Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7240862f5301Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7241862f5301Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7242862f5301Smrg	    case $lt_outputfile in
7243862f5301Smrg	      *.exe|*.EXE) ;;
7244862f5301Smrg	      *)
7245862f5301Smrg		lt_outputfile="$lt_outputfile.exe"
7246862f5301Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
7247862f5301Smrg		;;
7248862f5301Smrg	    esac~
7249862f5301Smrg	    func_to_tool_file "$lt_outputfile"~
7250862f5301Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7251862f5301Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7252862f5301Smrg	      $RM "$lt_outputfile.manifest";
7253862f5301Smrg	    fi'
7254862f5301Smrg	  ;;
7255862f5301Smrg	*)
7256862f5301Smrg	  # g++
7257862f5301Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7258862f5301Smrg	  # as there is no search path for DLLs.
7259862f5301Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7260862f5301Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7261862f5301Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7262862f5301Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
7263862f5301Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7264862f5301Smrg
7265862f5301Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7266862f5301Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
7267862f5301Smrg	    # If the export-symbols file already is a .def file (1st line
7268862f5301Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
7269862f5301Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7270862f5301Smrg	      cp $export_symbols $output_objdir/$soname.def;
7271862f5301Smrg	    else
7272862f5301Smrg	      echo EXPORTS > $output_objdir/$soname.def;
7273862f5301Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
7274862f5301Smrg	    fi~
7275862f5301Smrg	    $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'
7276862f5301Smrg	  else
7277862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7278862f5301Smrg	  fi
7279862f5301Smrg	  ;;
7280862f5301Smrg	esac
7281862f5301Smrg	;;
728244dda7b2Smrg      darwin* | rhapsody*)
728344dda7b2Smrg        _LT_DARWIN_LINKER_FEATURES($1)
728444dda7b2Smrg	;;
72857a3b38f7Smrg
728644dda7b2Smrg      dgux*)
728744dda7b2Smrg        case $cc_basename in
728844dda7b2Smrg          ec++*)
728944dda7b2Smrg	    # FIXME: insert proper C++ library support
729044dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
729144dda7b2Smrg	    ;;
729244dda7b2Smrg          ghcx*)
729344dda7b2Smrg	    # Green Hills C++ Compiler
729444dda7b2Smrg	    # FIXME: insert proper C++ library support
729544dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
729644dda7b2Smrg	    ;;
729744dda7b2Smrg          *)
729844dda7b2Smrg	    # FIXME: insert proper C++ library support
729944dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
730044dda7b2Smrg	    ;;
730144dda7b2Smrg        esac
730244dda7b2Smrg        ;;
73037a3b38f7Smrg
730444dda7b2Smrg      freebsd[[12]]*)
730544dda7b2Smrg        # C++ shared libraries reported to be fairly broken before
730644dda7b2Smrg	# switch to ELF
730744dda7b2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
730844dda7b2Smrg        ;;
73097a3b38f7Smrg
731044dda7b2Smrg      freebsd-elf*)
731144dda7b2Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
731244dda7b2Smrg        ;;
73137a3b38f7Smrg
731444dda7b2Smrg      freebsd* | dragonfly*)
731544dda7b2Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
731644dda7b2Smrg        # conventions
731744dda7b2Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
731844dda7b2Smrg        ;;
73197a3b38f7Smrg
732044dda7b2Smrg      gnu*)
732144dda7b2Smrg        ;;
73227a3b38f7Smrg
732344dda7b2Smrg      haiku*)
732444dda7b2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
732544dda7b2Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
732644dda7b2Smrg        ;;
73277a3b38f7Smrg
732844dda7b2Smrg      hpux9*)
732944dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
733044dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
733144dda7b2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
733244dda7b2Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
733344dda7b2Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
733444dda7b2Smrg				             # but as the default
733544dda7b2Smrg				             # location of the library.
73367a3b38f7Smrg
733744dda7b2Smrg        case $cc_basename in
733844dda7b2Smrg          CC*)
733944dda7b2Smrg            # FIXME: insert proper C++ library support
734044dda7b2Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
734144dda7b2Smrg            ;;
734244dda7b2Smrg          aCC*)
734344dda7b2Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
734444dda7b2Smrg            # Commands to make compiler produce verbose output that lists
734544dda7b2Smrg            # what "hidden" libraries, object files and flags are used when
734644dda7b2Smrg            # linking a shared library.
734744dda7b2Smrg            #
734844dda7b2Smrg            # There doesn't appear to be a way to prevent this compiler from
734944dda7b2Smrg            # explicitly linking system object files so we need to strip them
735044dda7b2Smrg            # from the output so that they don't get included in the library
735144dda7b2Smrg            # dependencies.
735244dda7b2Smrg            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
735344dda7b2Smrg            ;;
735444dda7b2Smrg          *)
735544dda7b2Smrg            if test "$GXX" = yes; then
7356862f5301Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
735744dda7b2Smrg            else
735844dda7b2Smrg              # FIXME: insert proper C++ library support
735944dda7b2Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
736044dda7b2Smrg            fi
736144dda7b2Smrg            ;;
736244dda7b2Smrg        esac
736344dda7b2Smrg        ;;
73647a3b38f7Smrg
736544dda7b2Smrg      hpux10*|hpux11*)
736644dda7b2Smrg        if test $with_gnu_ld = no; then
736744dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
736844dda7b2Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
73697a3b38f7Smrg
737044dda7b2Smrg          case $host_cpu in
737144dda7b2Smrg            hppa*64*|ia64*)
737244dda7b2Smrg              ;;
737344dda7b2Smrg            *)
737444dda7b2Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
737544dda7b2Smrg              ;;
737644dda7b2Smrg          esac
737744dda7b2Smrg        fi
737844dda7b2Smrg        case $host_cpu in
737944dda7b2Smrg          hppa*64*|ia64*)
738044dda7b2Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
738144dda7b2Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
738244dda7b2Smrg            ;;
738344dda7b2Smrg          *)
738444dda7b2Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
738544dda7b2Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
738644dda7b2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
738744dda7b2Smrg					         # but as the default
738844dda7b2Smrg					         # location of the library.
738944dda7b2Smrg            ;;
739044dda7b2Smrg        esac
73917a3b38f7Smrg
739244dda7b2Smrg        case $cc_basename in
739344dda7b2Smrg          CC*)
739444dda7b2Smrg	    # FIXME: insert proper C++ library support
739544dda7b2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
739644dda7b2Smrg	    ;;
739744dda7b2Smrg          aCC*)
739844dda7b2Smrg	    case $host_cpu in
739944dda7b2Smrg	      hppa*64*)
740044dda7b2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
740144dda7b2Smrg	        ;;
740244dda7b2Smrg	      ia64*)
740344dda7b2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
740444dda7b2Smrg	        ;;
740544dda7b2Smrg	      *)
740644dda7b2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
740744dda7b2Smrg	        ;;
740844dda7b2Smrg	    esac
740944dda7b2Smrg	    # Commands to make compiler produce verbose output that lists
741044dda7b2Smrg	    # what "hidden" libraries, object files and flags are used when
741144dda7b2Smrg	    # linking a shared library.
741244dda7b2Smrg	    #
741344dda7b2Smrg	    # There doesn't appear to be a way to prevent this compiler from
741444dda7b2Smrg	    # explicitly linking system object files so we need to strip them
741544dda7b2Smrg	    # from the output so that they don't get included in the library
741644dda7b2Smrg	    # dependencies.
741744dda7b2Smrg	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
741844dda7b2Smrg	    ;;
741944dda7b2Smrg          *)
742044dda7b2Smrg	    if test "$GXX" = yes; then
742144dda7b2Smrg	      if test $with_gnu_ld = no; then
742244dda7b2Smrg	        case $host_cpu in
742344dda7b2Smrg	          hppa*64*)
742444dda7b2Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
742544dda7b2Smrg	            ;;
742644dda7b2Smrg	          ia64*)
7427862f5301Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
742844dda7b2Smrg	            ;;
742944dda7b2Smrg	          *)
7430862f5301Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
743144dda7b2Smrg	            ;;
743244dda7b2Smrg	        esac
743344dda7b2Smrg	      fi
743444dda7b2Smrg	    else
743544dda7b2Smrg	      # FIXME: insert proper C++ library support
743644dda7b2Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
743744dda7b2Smrg	    fi
743844dda7b2Smrg	    ;;
743944dda7b2Smrg        esac
744044dda7b2Smrg        ;;
74417a3b38f7Smrg
744244dda7b2Smrg      interix[[3-9]]*)
744344dda7b2Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
744444dda7b2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
744544dda7b2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
744644dda7b2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
744744dda7b2Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
744844dda7b2Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
744944dda7b2Smrg	# default) and relocated if they conflict, which is a slow very memory
745044dda7b2Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
745144dda7b2Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
745244dda7b2Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
745344dda7b2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
745444dda7b2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
745544dda7b2Smrg	;;
745644dda7b2Smrg      irix5* | irix6*)
745744dda7b2Smrg        case $cc_basename in
745844dda7b2Smrg          CC*)
745944dda7b2Smrg	    # SGI C++
746044dda7b2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
74617a3b38f7Smrg
746244dda7b2Smrg	    # Archives containing C++ object files must be created using
746344dda7b2Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
746444dda7b2Smrg	    # necessary to make sure instantiated templates are included
746544dda7b2Smrg	    # in the archive.
746644dda7b2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
746744dda7b2Smrg	    ;;
746844dda7b2Smrg          *)
746944dda7b2Smrg	    if test "$GXX" = yes; then
747044dda7b2Smrg	      if test "$with_gnu_ld" = no; then
7471862f5301Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
747244dda7b2Smrg	      else
7473862f5301Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
747444dda7b2Smrg	      fi
747544dda7b2Smrg	    fi
747644dda7b2Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
747744dda7b2Smrg	    ;;
747844dda7b2Smrg        esac
747944dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
748044dda7b2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
748144dda7b2Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
748244dda7b2Smrg        ;;
74837a3b38f7Smrg
748444dda7b2Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
748544dda7b2Smrg        case $cc_basename in
748644dda7b2Smrg          KCC*)
748744dda7b2Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
74887a3b38f7Smrg
748944dda7b2Smrg	    # KCC will only create a shared library if the output file
749044dda7b2Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
749144dda7b2Smrg	    # to its proper name (with version) after linking.
749244dda7b2Smrg	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
749344dda7b2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
749444dda7b2Smrg	    # Commands to make compiler produce verbose output that lists
749544dda7b2Smrg	    # what "hidden" libraries, object files and flags are used when
749644dda7b2Smrg	    # linking a shared library.
749744dda7b2Smrg	    #
749844dda7b2Smrg	    # There doesn't appear to be a way to prevent this compiler from
749944dda7b2Smrg	    # explicitly linking system object files so we need to strip them
750044dda7b2Smrg	    # from the output so that they don't get included in the library
750144dda7b2Smrg	    # dependencies.
750244dda7b2Smrg	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
75037a3b38f7Smrg
750444dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
750544dda7b2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75067a3b38f7Smrg
750744dda7b2Smrg	    # Archives containing C++ object files must be created using
750844dda7b2Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
750944dda7b2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
751044dda7b2Smrg	    ;;
751144dda7b2Smrg	  icpc* | ecpc* )
751244dda7b2Smrg	    # Intel C++
751344dda7b2Smrg	    with_gnu_ld=yes
751444dda7b2Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
751544dda7b2Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
751644dda7b2Smrg	    # earlier do not add the objects themselves.
751744dda7b2Smrg	    case `$CC -V 2>&1` in
751844dda7b2Smrg	      *"Version 7."*)
751944dda7b2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
752044dda7b2Smrg		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
752144dda7b2Smrg		;;
752244dda7b2Smrg	      *)  # Version 8.0 or newer
752344dda7b2Smrg	        tmp_idyn=
752444dda7b2Smrg	        case $host_cpu in
752544dda7b2Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
752644dda7b2Smrg		esac
752744dda7b2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
752844dda7b2Smrg		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
752944dda7b2Smrg		;;
753044dda7b2Smrg	    esac
753144dda7b2Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
753244dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
753344dda7b2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
753444dda7b2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
753544dda7b2Smrg	    ;;
753644dda7b2Smrg          pgCC* | pgcpp*)
753744dda7b2Smrg            # Portland Group C++ compiler
753844dda7b2Smrg	    case `$CC -V` in
753944dda7b2Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
754044dda7b2Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
754144dda7b2Smrg		rm -rf $tpldir~
754244dda7b2Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
754344dda7b2Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
754444dda7b2Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
754544dda7b2Smrg		rm -rf $tpldir~
754644dda7b2Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
754744dda7b2Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
754844dda7b2Smrg		$RANLIB $oldlib'
754944dda7b2Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
755044dda7b2Smrg		rm -rf $tpldir~
755144dda7b2Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
755244dda7b2Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
755344dda7b2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
755444dda7b2Smrg		rm -rf $tpldir~
755544dda7b2Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
755644dda7b2Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
755744dda7b2Smrg	      ;;
755844dda7b2Smrg	    *) # Version 6 and above use weak symbols
755944dda7b2Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
756044dda7b2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
756144dda7b2Smrg	      ;;
756244dda7b2Smrg	    esac
75637a3b38f7Smrg
756444dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
756544dda7b2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
756644dda7b2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
756744dda7b2Smrg            ;;
756844dda7b2Smrg	  cxx*)
756944dda7b2Smrg	    # Compaq C++
757044dda7b2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
757144dda7b2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
75727a3b38f7Smrg
757344dda7b2Smrg	    runpath_var=LD_RUN_PATH
757444dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
757544dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
75767a3b38f7Smrg
757744dda7b2Smrg	    # Commands to make compiler produce verbose output that lists
757844dda7b2Smrg	    # what "hidden" libraries, object files and flags are used when
757944dda7b2Smrg	    # linking a shared library.
758044dda7b2Smrg	    #
758144dda7b2Smrg	    # There doesn't appear to be a way to prevent this compiler from
758244dda7b2Smrg	    # explicitly linking system object files so we need to strip them
758344dda7b2Smrg	    # from the output so that they don't get included in the library
758444dda7b2Smrg	    # dependencies.
758544dda7b2Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
758644dda7b2Smrg	    ;;
758744dda7b2Smrg	  xl* | mpixl* | bgxl*)
758844dda7b2Smrg	    # IBM XL 8.0 on PPC, with GNU ld
758944dda7b2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
759044dda7b2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
759144dda7b2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
759244dda7b2Smrg	    if test "x$supports_anon_versioning" = xyes; then
759344dda7b2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
759444dda7b2Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
759544dda7b2Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
759644dda7b2Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
759744dda7b2Smrg	    fi
759844dda7b2Smrg	    ;;
759944dda7b2Smrg	  *)
760044dda7b2Smrg	    case `$CC -V 2>&1 | sed 5q` in
760144dda7b2Smrg	    *Sun\ C*)
760244dda7b2Smrg	      # Sun C++ 5.9
760344dda7b2Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
760444dda7b2Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
760544dda7b2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
760644dda7b2Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
760744dda7b2Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
760844dda7b2Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
76097a3b38f7Smrg
7610862f5301Smrg	      # Not sure whether something based on
7611862f5301Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7612862f5301Smrg	      # would be better.
7613862f5301Smrg	      output_verbose_link_cmd='func_echo_all'
7614862f5301Smrg
7615862f5301Smrg	      # Archives containing C++ object files must be created using
7616862f5301Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7617862f5301Smrg	      # necessary to make sure instantiated templates are included
7618862f5301Smrg	      # in the archive.
7619862f5301Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7620862f5301Smrg	      ;;
7621862f5301Smrg	    esac
7622862f5301Smrg	    ;;
7623862f5301Smrg	esac
7624862f5301Smrg	;;
7625862f5301Smrg
7626862f5301Smrg      lynxos*)
7627862f5301Smrg        # FIXME: insert proper C++ library support
7628862f5301Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
7629862f5301Smrg	;;
7630862f5301Smrg
7631862f5301Smrg      m88k*)
7632862f5301Smrg        # FIXME: insert proper C++ library support
7633862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7634862f5301Smrg	;;
7635862f5301Smrg
7636862f5301Smrg      mvs*)
7637862f5301Smrg        case $cc_basename in
7638862f5301Smrg          cxx*)
7639862f5301Smrg	    # FIXME: insert proper C++ library support
7640862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7641862f5301Smrg	    ;;
7642862f5301Smrg	  *)
7643862f5301Smrg	    # FIXME: insert proper C++ library support
7644862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7645862f5301Smrg	    ;;
7646862f5301Smrg	esac
7647862f5301Smrg	;;
7648862f5301Smrg
7649862f5301Smrg      netbsd*)
7650862f5301Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7651862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7652862f5301Smrg	  wlarc=
7653862f5301Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7654862f5301Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7655862f5301Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7656862f5301Smrg	fi
7657862f5301Smrg	# Workaround some broken pre-1.5 toolchains
7658862f5301Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7659862f5301Smrg	;;
7660862f5301Smrg
7661862f5301Smrg      *nto* | *qnx*)
7662862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7663862f5301Smrg	;;
7664862f5301Smrg
7665862f5301Smrg      openbsd2*)
7666862f5301Smrg        # C++ shared libraries are fairly broken
7667862f5301Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
7668862f5301Smrg	;;
7669862f5301Smrg
7670862f5301Smrg      openbsd*)
7671862f5301Smrg	if test -f /usr/libexec/ld.so; then
7672862f5301Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7673862f5301Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7674862f5301Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7675862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7676862f5301Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7677862f5301Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7678862f5301Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
7679862f5301Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7680862f5301Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7681862f5301Smrg	  fi
7682862f5301Smrg	  output_verbose_link_cmd=func_echo_all
7683862f5301Smrg	else
7684862f5301Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7685862f5301Smrg	fi
7686862f5301Smrg	;;
7687862f5301Smrg
7688862f5301Smrg      osf3* | osf4* | osf5*)
7689862f5301Smrg        case $cc_basename in
7690862f5301Smrg          KCC*)
7691862f5301Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7692862f5301Smrg
7693862f5301Smrg	    # KCC will only create a shared library if the output file
7694862f5301Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7695862f5301Smrg	    # to its proper name (with version) after linking.
7696862f5301Smrg	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7697862f5301Smrg
7698862f5301Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7699862f5301Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7700862f5301Smrg
7701862f5301Smrg	    # Archives containing C++ object files must be created using
7702862f5301Smrg	    # the KAI C++ compiler.
7703862f5301Smrg	    case $host in
7704862f5301Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7705862f5301Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7706862f5301Smrg	    esac
7707862f5301Smrg	    ;;
7708862f5301Smrg          RCC*)
7709862f5301Smrg	    # Rational C++ 2.4.1
7710862f5301Smrg	    # FIXME: insert proper C++ library support
7711862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7712862f5301Smrg	    ;;
7713862f5301Smrg          cxx*)
7714862f5301Smrg	    case $host in
7715862f5301Smrg	      osf3*)
7716862f5301Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7717862f5301Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7718862f5301Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7719862f5301Smrg		;;
7720862f5301Smrg	      *)
7721862f5301Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7722862f5301Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
7723862f5301Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7724862f5301Smrg	          echo "-hidden">> $lib.exp~
7725862f5301Smrg	          $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~
7726862f5301Smrg	          $RM $lib.exp'
7727862f5301Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7728862f5301Smrg		;;
7729862f5301Smrg	    esac
7730862f5301Smrg
7731862f5301Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7732862f5301Smrg
7733862f5301Smrg	    # Commands to make compiler produce verbose output that lists
7734862f5301Smrg	    # what "hidden" libraries, object files and flags are used when
7735862f5301Smrg	    # linking a shared library.
7736862f5301Smrg	    #
7737862f5301Smrg	    # There doesn't appear to be a way to prevent this compiler from
7738862f5301Smrg	    # explicitly linking system object files so we need to strip them
7739862f5301Smrg	    # from the output so that they don't get included in the library
7740862f5301Smrg	    # dependencies.
7741862f5301Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7742862f5301Smrg	    ;;
7743862f5301Smrg	  *)
7744862f5301Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7745862f5301Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7746862f5301Smrg	      case $host in
7747862f5301Smrg	        osf3*)
7748862f5301Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7749862f5301Smrg		  ;;
7750862f5301Smrg	        *)
7751862f5301Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7752862f5301Smrg		  ;;
7753862f5301Smrg	      esac
7754862f5301Smrg
7755862f5301Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7756862f5301Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7757862f5301Smrg
7758862f5301Smrg	      # Commands to make compiler produce verbose output that lists
7759862f5301Smrg	      # what "hidden" libraries, object files and flags are used when
7760862f5301Smrg	      # linking a shared library.
7761862f5301Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7762862f5301Smrg
7763862f5301Smrg	    else
7764862f5301Smrg	      # FIXME: insert proper C++ library support
7765862f5301Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7766862f5301Smrg	    fi
7767862f5301Smrg	    ;;
7768862f5301Smrg        esac
7769862f5301Smrg        ;;
7770862f5301Smrg
7771862f5301Smrg      psos*)
7772862f5301Smrg        # FIXME: insert proper C++ library support
7773862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7774862f5301Smrg        ;;
7775862f5301Smrg
7776862f5301Smrg      sunos4*)
7777862f5301Smrg        case $cc_basename in
7778862f5301Smrg          CC*)
7779862f5301Smrg	    # Sun C++ 4.x
7780862f5301Smrg	    # FIXME: insert proper C++ library support
7781862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7782862f5301Smrg	    ;;
7783862f5301Smrg          lcc*)
7784862f5301Smrg	    # Lucid
7785862f5301Smrg	    # FIXME: insert proper C++ library support
7786862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7787862f5301Smrg	    ;;
7788862f5301Smrg          *)
7789862f5301Smrg	    # FIXME: insert proper C++ library support
7790862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7791862f5301Smrg	    ;;
7792862f5301Smrg        esac
7793862f5301Smrg        ;;
7794862f5301Smrg
7795862f5301Smrg      solaris*)
7796862f5301Smrg        case $cc_basename in
7797862f5301Smrg          CC* | sunCC*)
7798862f5301Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
7799862f5301Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7800862f5301Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7801862f5301Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7802862f5301Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7803862f5301Smrg	      $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'
7804862f5301Smrg
7805862f5301Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7806862f5301Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7807862f5301Smrg	    case $host_os in
7808862f5301Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7809862f5301Smrg	      *)
7810862f5301Smrg		# The compiler driver will combine and reorder linker options,
7811862f5301Smrg		# but understands `-z linker_flag'.
7812862f5301Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7813862f5301Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7814862f5301Smrg	        ;;
7815862f5301Smrg	    esac
7816862f5301Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7817862f5301Smrg
7818862f5301Smrg	    output_verbose_link_cmd='func_echo_all'
7819862f5301Smrg
7820862f5301Smrg	    # Archives containing C++ object files must be created using
7821862f5301Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7822862f5301Smrg	    # necessary to make sure instantiated templates are included
7823862f5301Smrg	    # in the archive.
7824862f5301Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7825862f5301Smrg	    ;;
7826862f5301Smrg          gcx*)
7827862f5301Smrg	    # Green Hills C++ Compiler
7828862f5301Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7829862f5301Smrg
7830862f5301Smrg	    # The C++ compiler must be used to create the archive.
7831862f5301Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7832862f5301Smrg	    ;;
7833862f5301Smrg          *)
7834862f5301Smrg	    # GNU C++ compiler with Solaris linker
7835862f5301Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7836862f5301Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7837862f5301Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7838862f5301Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7839862f5301Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7840862f5301Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7841862f5301Smrg
7842862f5301Smrg	        # Commands to make compiler produce verbose output that lists
7843862f5301Smrg	        # what "hidden" libraries, object files and flags are used when
7844862f5301Smrg	        # linking a shared library.
7845862f5301Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7846862f5301Smrg	      else
7847862f5301Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7848862f5301Smrg	        # platform.
7849862f5301Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7850862f5301Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7851862f5301Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7852862f5301Smrg
7853862f5301Smrg	        # Commands to make compiler produce verbose output that lists
7854862f5301Smrg	        # what "hidden" libraries, object files and flags are used when
7855862f5301Smrg	        # linking a shared library.
7856862f5301Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7857862f5301Smrg	      fi
7858862f5301Smrg
7859862f5301Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7860862f5301Smrg	      case $host_os in
7861862f5301Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7862862f5301Smrg		*)
7863862f5301Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7864862f5301Smrg		  ;;
7865862f5301Smrg	      esac
7866862f5301Smrg	    fi
7867862f5301Smrg	    ;;
7868862f5301Smrg        esac
7869862f5301Smrg        ;;
7870862f5301Smrg
7871862f5301Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7872862f5301Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7873862f5301Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7874862f5301Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7875862f5301Smrg      runpath_var='LD_RUN_PATH'
7876862f5301Smrg
7877862f5301Smrg      case $cc_basename in
7878862f5301Smrg        CC*)
7879862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7880862f5301Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7881862f5301Smrg	  ;;
7882862f5301Smrg	*)
7883862f5301Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7884862f5301Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7885862f5301Smrg	  ;;
7886862f5301Smrg      esac
7887862f5301Smrg      ;;
7888862f5301Smrg
7889862f5301Smrg      sysv5* | sco3.2v5* | sco5v6*)
7890862f5301Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
7891862f5301Smrg	# link with -lc, and that would cause any symbols used from libc to
7892862f5301Smrg	# always be unresolved, which means just about no library would
7893862f5301Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
7894862f5301Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
7895862f5301Smrg	# as -z defs.
7896862f5301Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7897862f5301Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7898862f5301Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7899862f5301Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7900862f5301Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7901862f5301Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7902862f5301Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7903862f5301Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7904862f5301Smrg	runpath_var='LD_RUN_PATH'
7905862f5301Smrg
7906862f5301Smrg	case $cc_basename in
7907862f5301Smrg          CC*)
7908862f5301Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7909862f5301Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7910862f5301Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7911862f5301Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7912862f5301Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7913862f5301Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
7914862f5301Smrg	    ;;
7915862f5301Smrg	  *)
7916862f5301Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7917862f5301Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7918862f5301Smrg	    ;;
7919862f5301Smrg	esac
7920862f5301Smrg      ;;
7921862f5301Smrg
7922862f5301Smrg      tandem*)
7923862f5301Smrg        case $cc_basename in
7924862f5301Smrg          NCC*)
7925862f5301Smrg	    # NonStop-UX NCC 3.20
7926862f5301Smrg	    # FIXME: insert proper C++ library support
7927862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7928862f5301Smrg	    ;;
7929862f5301Smrg          *)
7930862f5301Smrg	    # FIXME: insert proper C++ library support
7931862f5301Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7932862f5301Smrg	    ;;
7933862f5301Smrg        esac
7934862f5301Smrg        ;;
7935862f5301Smrg
7936862f5301Smrg      vxworks*)
7937862f5301Smrg        # FIXME: insert proper C++ library support
7938862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7939862f5301Smrg        ;;
7940862f5301Smrg
7941862f5301Smrg      *)
7942862f5301Smrg        # FIXME: insert proper C++ library support
7943862f5301Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7944862f5301Smrg        ;;
7945862f5301Smrg    esac
7946862f5301Smrg
7947862f5301Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7948862f5301Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7949862f5301Smrg
7950862f5301Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
7951862f5301Smrg    _LT_TAGVAR(LD, $1)="$LD"
7952862f5301Smrg
7953862f5301Smrg    ## CAVEAT EMPTOR:
7954862f5301Smrg    ## There is no encapsulation within the following macros, do not change
7955862f5301Smrg    ## the running order or otherwise move them around unless you know exactly
7956862f5301Smrg    ## what you are doing...
7957862f5301Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7958862f5301Smrg    _LT_COMPILER_PIC($1)
7959862f5301Smrg    _LT_COMPILER_C_O($1)
7960862f5301Smrg    _LT_COMPILER_FILE_LOCKS($1)
7961862f5301Smrg    _LT_LINKER_SHLIBS($1)
7962862f5301Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7963862f5301Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7964862f5301Smrg
7965862f5301Smrg    _LT_CONFIG($1)
7966862f5301Smrg  fi # test -n "$compiler"
7967862f5301Smrg
7968862f5301Smrg  CC=$lt_save_CC
7969862f5301Smrg  CFLAGS=$lt_save_CFLAGS
7970862f5301Smrg  LDCXX=$LD
7971862f5301Smrg  LD=$lt_save_LD
7972862f5301Smrg  GCC=$lt_save_GCC
7973862f5301Smrg  with_gnu_ld=$lt_save_with_gnu_ld
7974862f5301Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7975862f5301Smrg  lt_cv_path_LD=$lt_save_path_LD
7976862f5301Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7977862f5301Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7978862f5301Smrgfi # test "$_lt_caught_CXX_error" != yes
7979862f5301Smrg
7980862f5301SmrgAC_LANG_POP
7981862f5301Smrg])# _LT_LANG_CXX_CONFIG
7982862f5301Smrg
7983862f5301Smrg
7984862f5301Smrg# _LT_FUNC_STRIPNAME_CNF
7985862f5301Smrg# ----------------------
7986862f5301Smrg# func_stripname_cnf prefix suffix name
7987862f5301Smrg# strip PREFIX and SUFFIX off of NAME.
7988862f5301Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7989862f5301Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7990862f5301Smrg# dot (in which case that matches only a dot).
7991862f5301Smrg#
7992862f5301Smrg# This function is identical to the (non-XSI) version of func_stripname,
7993862f5301Smrg# except this one can be used by m4 code that may be executed by configure,
7994862f5301Smrg# rather than the libtool script.
7995862f5301Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7996862f5301SmrgAC_REQUIRE([_LT_DECL_SED])
7997862f5301SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7998862f5301Smrgfunc_stripname_cnf ()
7999862f5301Smrg{
8000862f5301Smrg  case ${2} in
8001862f5301Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
8002862f5301Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
8003862f5301Smrg  esac
8004862f5301Smrg} # func_stripname_cnf
8005862f5301Smrg])# _LT_FUNC_STRIPNAME_CNF
8006862f5301Smrg
8007862f5301Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
8008862f5301Smrg# ---------------------------------
8009862f5301Smrg# Figure out "hidden" library dependencies from verbose
8010862f5301Smrg# compiler output when linking a shared library.
8011862f5301Smrg# Parse the compiler output and extract the necessary
8012862f5301Smrg# objects, libraries and library flags.
8013862f5301Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
8014862f5301Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
8015862f5301SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
8016862f5301Smrg# Dependencies to place before and after the object being linked:
8017862f5301Smrg_LT_TAGVAR(predep_objects, $1)=
8018862f5301Smrg_LT_TAGVAR(postdep_objects, $1)=
8019862f5301Smrg_LT_TAGVAR(predeps, $1)=
8020862f5301Smrg_LT_TAGVAR(postdeps, $1)=
8021862f5301Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
8022862f5301Smrg
8023862f5301Smrgdnl we can't use the lt_simple_compile_test_code here,
8024862f5301Smrgdnl because it contains code intended for an executable,
8025862f5301Smrgdnl not a library.  It's possible we should let each
8026862f5301Smrgdnl tag define a new lt_????_link_test_code variable,
8027862f5301Smrgdnl but it's only used here...
8028862f5301Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
8029862f5301Smrgint a;
8030862f5301Smrgvoid foo (void) { a = 0; }
8031862f5301Smrg_LT_EOF
8032862f5301Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
8033862f5301Smrgclass Foo
8034862f5301Smrg{
8035862f5301Smrgpublic:
8036862f5301Smrg  Foo (void) { a = 0; }
8037862f5301Smrgprivate:
8038862f5301Smrg  int a;
8039862f5301Smrg};
8040862f5301Smrg_LT_EOF
8041862f5301Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
8042862f5301Smrg      subroutine foo
8043862f5301Smrg      implicit none
8044862f5301Smrg      integer*4 a
8045862f5301Smrg      a=0
8046862f5301Smrg      return
8047862f5301Smrg      end
8048862f5301Smrg_LT_EOF
8049862f5301Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
8050862f5301Smrg      subroutine foo
8051862f5301Smrg      implicit none
8052862f5301Smrg      integer a
8053862f5301Smrg      a=0
8054862f5301Smrg      return
8055862f5301Smrg      end
8056862f5301Smrg_LT_EOF
8057862f5301Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
8058862f5301Smrgpublic class foo {
8059862f5301Smrg  private int a;
8060862f5301Smrg  public void bar (void) {
8061862f5301Smrg    a = 0;
8062862f5301Smrg  }
8063862f5301Smrg};
8064862f5301Smrg_LT_EOF
8065862f5301Smrg])
8066862f5301Smrg
8067862f5301Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
8068862f5301Smrgcase "$CC $CFLAGS " in #(
8069862f5301Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8070862f5301Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8071862f5301Smrgesac
8072862f5301Smrg
8073862f5301Smrgdnl Parse the compiler output and extract the necessary
8074862f5301Smrgdnl objects, libraries and library flags.
8075862f5301Smrgif AC_TRY_EVAL(ac_compile); then
8076862f5301Smrg  # Parse the compiler output and extract the necessary
8077862f5301Smrg  # objects, libraries and library flags.
8078862f5301Smrg
8079862f5301Smrg  # Sentinel used to keep track of whether or not we are before
8080862f5301Smrg  # the conftest object file.
8081862f5301Smrg  pre_test_object_deps_done=no
8082862f5301Smrg
8083862f5301Smrg  for p in `eval "$output_verbose_link_cmd"`; do
8084862f5301Smrg    case ${prev}${p} in
8085862f5301Smrg
8086862f5301Smrg    -L* | -R* | -l*)
8087862f5301Smrg       # Some compilers place space between "-{L,R}" and the path.
8088862f5301Smrg       # Remove the space.
8089862f5301Smrg       if test $p = "-L" ||
8090862f5301Smrg          test $p = "-R"; then
8091862f5301Smrg	 prev=$p
8092862f5301Smrg	 continue
8093862f5301Smrg       fi
8094862f5301Smrg
8095862f5301Smrg       # Expand the sysroot to ease extracting the directories later.
8096862f5301Smrg       if test -z "$prev"; then
8097862f5301Smrg         case $p in
8098862f5301Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8099862f5301Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8100862f5301Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8101862f5301Smrg         esac
8102862f5301Smrg       fi
8103862f5301Smrg       case $p in
8104862f5301Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8105862f5301Smrg       esac
8106862f5301Smrg       if test "$pre_test_object_deps_done" = no; then
8107862f5301Smrg	 case ${prev} in
8108862f5301Smrg	 -L | -R)
8109862f5301Smrg	   # Internal compiler library paths should come after those
8110862f5301Smrg	   # provided the user.  The postdeps already come after the
8111862f5301Smrg	   # user supplied libs so there is no need to process them.
8112862f5301Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8113862f5301Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8114862f5301Smrg	   else
8115862f5301Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8116862f5301Smrg	   fi
8117862f5301Smrg	   ;;
8118862f5301Smrg	 # The "-l" case would never come before the object being
8119862f5301Smrg	 # linked, so don't bother handling this case.
8120862f5301Smrg	 esac
8121862f5301Smrg       else
8122862f5301Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8123862f5301Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8124862f5301Smrg	 else
8125862f5301Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8126862f5301Smrg	 fi
8127862f5301Smrg       fi
8128862f5301Smrg       prev=
8129862f5301Smrg       ;;
8130862f5301Smrg
8131862f5301Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
8132862f5301Smrg    *.$objext)
8133862f5301Smrg       # This assumes that the test object file only shows up
8134862f5301Smrg       # once in the compiler output.
8135862f5301Smrg       if test "$p" = "conftest.$objext"; then
8136862f5301Smrg	 pre_test_object_deps_done=yes
8137862f5301Smrg	 continue
8138862f5301Smrg       fi
8139862f5301Smrg
8140862f5301Smrg       if test "$pre_test_object_deps_done" = no; then
8141862f5301Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8142862f5301Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
8143862f5301Smrg	 else
8144862f5301Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8145862f5301Smrg	 fi
8146862f5301Smrg       else
8147862f5301Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8148862f5301Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
8149862f5301Smrg	 else
8150862f5301Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8151862f5301Smrg	 fi
8152862f5301Smrg       fi
8153862f5301Smrg       ;;
81547a3b38f7Smrg
8155862f5301Smrg    *) ;; # Ignore the rest.
81567a3b38f7Smrg
8157862f5301Smrg    esac
8158862f5301Smrg  done
81597a3b38f7Smrg
8160862f5301Smrg  # Clean up.
8161862f5301Smrg  rm -f a.out a.exe
8162862f5301Smrgelse
8163862f5301Smrg  echo "libtool.m4: error: problem compiling $1 test program"
8164862f5301Smrgfi
81657a3b38f7Smrg
8166862f5301Smrg$RM -f confest.$objext
8167862f5301SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
81687a3b38f7Smrg
8169862f5301Smrg# PORTME: override above test on systems where it is broken
8170862f5301Smrgm4_if([$1], [CXX],
8171862f5301Smrg[case $host_os in
8172862f5301Smrginterix[[3-9]]*)
8173862f5301Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8174862f5301Smrg  # hack all around it, let's just trust "g++" to DTRT.
8175862f5301Smrg  _LT_TAGVAR(predep_objects,$1)=
8176862f5301Smrg  _LT_TAGVAR(postdep_objects,$1)=
8177862f5301Smrg  _LT_TAGVAR(postdeps,$1)=
8178862f5301Smrg  ;;
81797a3b38f7Smrg
8180862f5301Smrglinux*)
8181862f5301Smrg  case `$CC -V 2>&1 | sed 5q` in
8182862f5301Smrg  *Sun\ C*)
8183862f5301Smrg    # Sun C++ 5.9
81847a3b38f7Smrg
8185862f5301Smrg    # The more standards-conforming stlport4 library is
8186862f5301Smrg    # incompatible with the Cstd library. Avoid specifying
8187862f5301Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
8188862f5301Smrg    # -library=stlport4 depends on it.
8189862f5301Smrg    case " $CXX $CXXFLAGS " in
8190862f5301Smrg    *" -library=stlport4 "*)
8191862f5301Smrg      solaris_use_stlport4=yes
8192862f5301Smrg      ;;
8193862f5301Smrg    esac
81947a3b38f7Smrg
8195862f5301Smrg    if test "$solaris_use_stlport4" != yes; then
8196862f5301Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8197862f5301Smrg    fi
8198862f5301Smrg    ;;
8199862f5301Smrg  esac
8200862f5301Smrg  ;;
82017a3b38f7Smrg
8202862f5301Smrgsolaris*)
8203862f5301Smrg  case $cc_basename in
8204862f5301Smrg  CC* | sunCC*)
8205862f5301Smrg    # The more standards-conforming stlport4 library is
8206862f5301Smrg    # incompatible with the Cstd library. Avoid specifying
8207862f5301Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
8208862f5301Smrg    # -library=stlport4 depends on it.
8209862f5301Smrg    case " $CXX $CXXFLAGS " in
8210862f5301Smrg    *" -library=stlport4 "*)
8211862f5301Smrg      solaris_use_stlport4=yes
8212862f5301Smrg      ;;
8213862f5301Smrg    esac
82147a3b38f7Smrg
8215862f5301Smrg    # Adding this requires a known-good setup of shared libraries for
8216862f5301Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
8217862f5301Smrg    # archive will be linked into the output, leading to subtle bugs.
8218862f5301Smrg    if test "$solaris_use_stlport4" != yes; then
8219862f5301Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8220862f5301Smrg    fi
8221862f5301Smrg    ;;
8222862f5301Smrg  esac
8223862f5301Smrg  ;;
8224862f5301Smrgesac
8225862f5301Smrg])
82267a3b38f7Smrg
8227862f5301Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
8228862f5301Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8229862f5301Smrgesac
8230862f5301Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8231862f5301Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8232862f5301Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8233862f5301Smrgfi
8234862f5301Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8235862f5301Smrg    [The directories searched by this compiler when creating a shared library])
8236862f5301Smrg_LT_TAGDECL([], [predep_objects], [1],
8237862f5301Smrg    [Dependencies to place before and after the objects being linked to
8238862f5301Smrg    create a shared library])
8239862f5301Smrg_LT_TAGDECL([], [postdep_objects], [1])
8240862f5301Smrg_LT_TAGDECL([], [predeps], [1])
8241862f5301Smrg_LT_TAGDECL([], [postdeps], [1])
8242862f5301Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
8243862f5301Smrg    [The library search path used internally by the compiler when linking
8244862f5301Smrg    a shared library])
8245862f5301Smrg])# _LT_SYS_HIDDEN_LIBDEPS
82467a3b38f7Smrg
82477a3b38f7Smrg
8248862f5301Smrg# _LT_LANG_F77_CONFIG([TAG])
8249862f5301Smrg# --------------------------
8250862f5301Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
8251862f5301Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
8252862f5301Smrg# to write the compiler configuration to `libtool'.
8253862f5301Smrgm4_defun([_LT_LANG_F77_CONFIG],
8254862f5301Smrg[AC_LANG_PUSH(Fortran 77)
8255862f5301Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
8256862f5301Smrg  _lt_disable_F77=yes
8257862f5301Smrgfi
8258862f5301Smrg
8259862f5301Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8260862f5301Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
8261862f5301Smrg_LT_TAGVAR(always_export_symbols, $1)=no
8262862f5301Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8263862f5301Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8264862f5301Smrg_LT_TAGVAR(hardcode_direct, $1)=no
8265862f5301Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8266862f5301Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8267862f5301Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8268862f5301Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8269862f5301Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8270862f5301Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
8271862f5301Smrg_LT_TAGVAR(inherit_rpath, $1)=no
8272862f5301Smrg_LT_TAGVAR(module_cmds, $1)=
8273862f5301Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
8274862f5301Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8275862f5301Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8276862f5301Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8277862f5301Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8278862f5301Smrg_LT_TAGVAR(no_undefined_flag, $1)=
8279862f5301Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8280862f5301Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8281862f5301Smrg
8282862f5301Smrg# Source file extension for f77 test sources.
8283862f5301Smrgac_ext=f
8284862f5301Smrg
8285862f5301Smrg# Object file extension for compiled f77 test sources.
8286862f5301Smrgobjext=o
8287862f5301Smrg_LT_TAGVAR(objext, $1)=$objext
8288862f5301Smrg
8289862f5301Smrg# No sense in running all these tests if we already determined that
8290862f5301Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
8291862f5301Smrg# are currently assumed to apply to all compilers on this platform,
8292862f5301Smrg# and will be corrupted by setting them based on a non-working compiler.
8293862f5301Smrgif test "$_lt_disable_F77" != yes; then
8294862f5301Smrg  # Code to be used in simple compile tests
8295862f5301Smrg  lt_simple_compile_test_code="\
8296862f5301Smrg      subroutine t
8297862f5301Smrg      return
8298862f5301Smrg      end
8299862f5301Smrg"
8300862f5301Smrg
8301862f5301Smrg  # Code to be used in simple link tests
8302862f5301Smrg  lt_simple_link_test_code="\
8303862f5301Smrg      program t
8304862f5301Smrg      end
8305862f5301Smrg"
83067a3b38f7Smrg
8307862f5301Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8308862f5301Smrg  _LT_TAG_COMPILER
83097a3b38f7Smrg
8310862f5301Smrg  # save warnings/boilerplate of simple test code
8311862f5301Smrg  _LT_COMPILER_BOILERPLATE
8312862f5301Smrg  _LT_LINKER_BOILERPLATE
83137a3b38f7Smrg
8314862f5301Smrg  # Allow CC to be a program name with arguments.
8315862f5301Smrg  lt_save_CC="$CC"
8316862f5301Smrg  lt_save_GCC=$GCC
8317862f5301Smrg  lt_save_CFLAGS=$CFLAGS
8318862f5301Smrg  CC=${F77-"f77"}
8319862f5301Smrg  CFLAGS=$FFLAGS
8320862f5301Smrg  compiler=$CC
8321862f5301Smrg  _LT_TAGVAR(compiler, $1)=$CC
8322862f5301Smrg  _LT_CC_BASENAME([$compiler])
8323862f5301Smrg  GCC=$G77
8324862f5301Smrg  if test -n "$compiler"; then
8325862f5301Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8326862f5301Smrg    AC_MSG_RESULT([$can_build_shared])
83277a3b38f7Smrg
8328862f5301Smrg    AC_MSG_CHECKING([whether to build shared libraries])
8329862f5301Smrg    test "$can_build_shared" = "no" && enable_shared=no
83307a3b38f7Smrg
8331862f5301Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
8332862f5301Smrg    # are all built from PIC.
8333862f5301Smrg    case $host_os in
8334862f5301Smrg      aix3*)
8335862f5301Smrg        test "$enable_shared" = yes && enable_static=no
8336862f5301Smrg        if test -n "$RANLIB"; then
8337862f5301Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8338862f5301Smrg          postinstall_cmds='$RANLIB $lib'
8339862f5301Smrg        fi
834044dda7b2Smrg        ;;
8341862f5301Smrg      aix[[4-9]]*)
8342862f5301Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8343862f5301Smrg	  test "$enable_shared" = yes && enable_static=no
8344862f5301Smrg	fi
834544dda7b2Smrg        ;;
8346862f5301Smrg    esac
8347862f5301Smrg    AC_MSG_RESULT([$enable_shared])
83487a3b38f7Smrg
8349862f5301Smrg    AC_MSG_CHECKING([whether to build static libraries])
8350862f5301Smrg    # Make sure either enable_shared or enable_static is yes.
8351862f5301Smrg    test "$enable_shared" = yes || enable_static=yes
8352862f5301Smrg    AC_MSG_RESULT([$enable_static])
83537a3b38f7Smrg
8354862f5301Smrg    _LT_TAGVAR(GCC, $1)="$G77"
8355862f5301Smrg    _LT_TAGVAR(LD, $1)="$LD"
83567a3b38f7Smrg
8357862f5301Smrg    ## CAVEAT EMPTOR:
8358862f5301Smrg    ## There is no encapsulation within the following macros, do not change
8359862f5301Smrg    ## the running order or otherwise move them around unless you know exactly
8360862f5301Smrg    ## what you are doing...
8361862f5301Smrg    _LT_COMPILER_PIC($1)
8362862f5301Smrg    _LT_COMPILER_C_O($1)
8363862f5301Smrg    _LT_COMPILER_FILE_LOCKS($1)
8364862f5301Smrg    _LT_LINKER_SHLIBS($1)
8365862f5301Smrg    _LT_SYS_DYNAMIC_LINKER($1)
8366862f5301Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
83677a3b38f7Smrg
8368862f5301Smrg    _LT_CONFIG($1)
8369862f5301Smrg  fi # test -n "$compiler"
83707a3b38f7Smrg
8371862f5301Smrg  GCC=$lt_save_GCC
8372862f5301Smrg  CC="$lt_save_CC"
8373862f5301Smrg  CFLAGS="$lt_save_CFLAGS"
8374862f5301Smrgfi # test "$_lt_disable_F77" != yes
83757a3b38f7Smrg
8376862f5301SmrgAC_LANG_POP
8377862f5301Smrg])# _LT_LANG_F77_CONFIG
83787a3b38f7Smrg
83797a3b38f7Smrg
8380862f5301Smrg# _LT_LANG_FC_CONFIG([TAG])
8381862f5301Smrg# -------------------------
8382862f5301Smrg# Ensure that the configuration variables for a Fortran compiler are
8383862f5301Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
8384862f5301Smrg# to write the compiler configuration to `libtool'.
8385862f5301Smrgm4_defun([_LT_LANG_FC_CONFIG],
8386862f5301Smrg[AC_LANG_PUSH(Fortran)
83877a3b38f7Smrg
8388862f5301Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
8389862f5301Smrg  _lt_disable_FC=yes
8390862f5301Smrgfi
83917a3b38f7Smrg
8392862f5301Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8393862f5301Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
8394862f5301Smrg_LT_TAGVAR(always_export_symbols, $1)=no
8395862f5301Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8396862f5301Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8397862f5301Smrg_LT_TAGVAR(hardcode_direct, $1)=no
8398862f5301Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8399862f5301Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8400862f5301Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8401862f5301Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8402862f5301Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8403862f5301Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
8404862f5301Smrg_LT_TAGVAR(inherit_rpath, $1)=no
8405862f5301Smrg_LT_TAGVAR(module_cmds, $1)=
8406862f5301Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
8407862f5301Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8408862f5301Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8409862f5301Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8410862f5301Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8411862f5301Smrg_LT_TAGVAR(no_undefined_flag, $1)=
8412862f5301Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8413862f5301Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8414862f5301Smrg
8415862f5301Smrg# Source file extension for fc test sources.
8416862f5301Smrgac_ext=${ac_fc_srcext-f}
8417862f5301Smrg
8418862f5301Smrg# Object file extension for compiled fc test sources.
8419862f5301Smrgobjext=o
8420862f5301Smrg_LT_TAGVAR(objext, $1)=$objext
8421862f5301Smrg
8422862f5301Smrg# No sense in running all these tests if we already determined that
8423862f5301Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
8424862f5301Smrg# are currently assumed to apply to all compilers on this platform,
8425862f5301Smrg# and will be corrupted by setting them based on a non-working compiler.
8426862f5301Smrgif test "$_lt_disable_FC" != yes; then
8427862f5301Smrg  # Code to be used in simple compile tests
8428862f5301Smrg  lt_simple_compile_test_code="\
8429862f5301Smrg      subroutine t
8430862f5301Smrg      return
8431862f5301Smrg      end
8432862f5301Smrg"
8433862f5301Smrg
8434862f5301Smrg  # Code to be used in simple link tests
8435862f5301Smrg  lt_simple_link_test_code="\
8436862f5301Smrg      program t
8437862f5301Smrg      end
8438862f5301Smrg"
8439862f5301Smrg
8440862f5301Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8441862f5301Smrg  _LT_TAG_COMPILER
84427a3b38f7Smrg
8443862f5301Smrg  # save warnings/boilerplate of simple test code
8444862f5301Smrg  _LT_COMPILER_BOILERPLATE
8445862f5301Smrg  _LT_LINKER_BOILERPLATE
84467a3b38f7Smrg
8447862f5301Smrg  # Allow CC to be a program name with arguments.
8448862f5301Smrg  lt_save_CC="$CC"
8449862f5301Smrg  lt_save_GCC=$GCC
8450862f5301Smrg  lt_save_CFLAGS=$CFLAGS
8451862f5301Smrg  CC=${FC-"f95"}
8452862f5301Smrg  CFLAGS=$FCFLAGS
8453862f5301Smrg  compiler=$CC
8454862f5301Smrg  GCC=$ac_cv_fc_compiler_gnu
84557a3b38f7Smrg
8456862f5301Smrg  _LT_TAGVAR(compiler, $1)=$CC
8457862f5301Smrg  _LT_CC_BASENAME([$compiler])
84587a3b38f7Smrg
8459862f5301Smrg  if test -n "$compiler"; then
8460862f5301Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8461862f5301Smrg    AC_MSG_RESULT([$can_build_shared])
84627a3b38f7Smrg
8463862f5301Smrg    AC_MSG_CHECKING([whether to build shared libraries])
8464862f5301Smrg    test "$can_build_shared" = "no" && enable_shared=no
8465862f5301Smrg
8466862f5301Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
8467862f5301Smrg    # are all built from PIC.
8468862f5301Smrg    case $host_os in
8469862f5301Smrg      aix3*)
8470862f5301Smrg        test "$enable_shared" = yes && enable_static=no
8471862f5301Smrg        if test -n "$RANLIB"; then
8472862f5301Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8473862f5301Smrg          postinstall_cmds='$RANLIB $lib'
8474862f5301Smrg        fi
8475862f5301Smrg        ;;
8476862f5301Smrg      aix[[4-9]]*)
8477862f5301Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8478862f5301Smrg	  test "$enable_shared" = yes && enable_static=no
8479862f5301Smrg	fi
848044dda7b2Smrg        ;;
848144dda7b2Smrg    esac
8482862f5301Smrg    AC_MSG_RESULT([$enable_shared])
84837a3b38f7Smrg
8484862f5301Smrg    AC_MSG_CHECKING([whether to build static libraries])
8485862f5301Smrg    # Make sure either enable_shared or enable_static is yes.
8486862f5301Smrg    test "$enable_shared" = yes || enable_static=yes
8487862f5301Smrg    AC_MSG_RESULT([$enable_static])
84887a3b38f7Smrg
8489862f5301Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
849044dda7b2Smrg    _LT_TAGVAR(LD, $1)="$LD"
84917a3b38f7Smrg
849244dda7b2Smrg    ## CAVEAT EMPTOR:
849344dda7b2Smrg    ## There is no encapsulation within the following macros, do not change
849444dda7b2Smrg    ## the running order or otherwise move them around unless you know exactly
849544dda7b2Smrg    ## what you are doing...
849644dda7b2Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
849744dda7b2Smrg    _LT_COMPILER_PIC($1)
849844dda7b2Smrg    _LT_COMPILER_C_O($1)
849944dda7b2Smrg    _LT_COMPILER_FILE_LOCKS($1)
850044dda7b2Smrg    _LT_LINKER_SHLIBS($1)
850144dda7b2Smrg    _LT_SYS_DYNAMIC_LINKER($1)
850244dda7b2Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
85037a3b38f7Smrg
8504862f5301Smrg    _LT_CONFIG($1)
8505862f5301Smrg  fi # test -n "$compiler"
8506862f5301Smrg
8507862f5301Smrg  GCC=$lt_save_GCC
8508862f5301Smrg  CC=$lt_save_CC
8509862f5301Smrg  CFLAGS=$lt_save_CFLAGS
8510862f5301Smrgfi # test "$_lt_disable_FC" != yes
8511862f5301Smrg
8512862f5301SmrgAC_LANG_POP
8513862f5301Smrg])# _LT_LANG_FC_CONFIG
8514862f5301Smrg
8515862f5301Smrg
8516862f5301Smrg# _LT_LANG_GCJ_CONFIG([TAG])
8517862f5301Smrg# --------------------------
8518862f5301Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
8519862f5301Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8520862f5301Smrg# to write the compiler configuration to `libtool'.
8521862f5301Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
8522862f5301Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
8523862f5301SmrgAC_LANG_SAVE
8524862f5301Smrg
8525862f5301Smrg# Source file extension for Java test sources.
8526862f5301Smrgac_ext=java
8527862f5301Smrg
8528862f5301Smrg# Object file extension for compiled Java test sources.
8529862f5301Smrgobjext=o
8530862f5301Smrg_LT_TAGVAR(objext, $1)=$objext
8531862f5301Smrg
8532862f5301Smrg# Code to be used in simple compile tests
8533862f5301Smrglt_simple_compile_test_code="class foo {}"
8534862f5301Smrg
8535862f5301Smrg# Code to be used in simple link tests
8536862f5301Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8537862f5301Smrg
8538862f5301Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8539862f5301Smrg_LT_TAG_COMPILER
8540862f5301Smrg
8541862f5301Smrg# save warnings/boilerplate of simple test code
8542862f5301Smrg_LT_COMPILER_BOILERPLATE
8543862f5301Smrg_LT_LINKER_BOILERPLATE
8544862f5301Smrg
8545862f5301Smrg# Allow CC to be a program name with arguments.
8546862f5301Smrglt_save_CC=$CC
8547862f5301Smrglt_save_CFLAGS=$CFLAGS
8548862f5301Smrglt_save_GCC=$GCC
8549862f5301SmrgGCC=yes
8550862f5301SmrgCC=${GCJ-"gcj"}
8551862f5301SmrgCFLAGS=$GCJFLAGS
8552862f5301Smrgcompiler=$CC
8553862f5301Smrg_LT_TAGVAR(compiler, $1)=$CC
8554862f5301Smrg_LT_TAGVAR(LD, $1)="$LD"
8555862f5301Smrg_LT_CC_BASENAME([$compiler])
8556862f5301Smrg
8557862f5301Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
8558862f5301Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8559862f5301Smrg
8560862f5301Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8561862f5301Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8562862f5301Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8563862f5301Smrg
8564862f5301Smrgif test -n "$compiler"; then
8565862f5301Smrg  _LT_COMPILER_NO_RTTI($1)
8566862f5301Smrg  _LT_COMPILER_PIC($1)
8567862f5301Smrg  _LT_COMPILER_C_O($1)
8568862f5301Smrg  _LT_COMPILER_FILE_LOCKS($1)
8569862f5301Smrg  _LT_LINKER_SHLIBS($1)
8570862f5301Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8571862f5301Smrg
8572862f5301Smrg  _LT_CONFIG($1)
8573862f5301Smrgfi
8574862f5301Smrg
8575862f5301SmrgAC_LANG_RESTORE
8576862f5301Smrg
8577862f5301SmrgGCC=$lt_save_GCC
8578862f5301SmrgCC=$lt_save_CC
8579862f5301SmrgCFLAGS=$lt_save_CFLAGS
8580862f5301Smrg])# _LT_LANG_GCJ_CONFIG
8581862f5301Smrg
8582862f5301Smrg
8583862f5301Smrg# _LT_LANG_RC_CONFIG([TAG])
8584862f5301Smrg# -------------------------
8585862f5301Smrg# Ensure that the configuration variables for the Windows resource compiler
8586862f5301Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8587862f5301Smrg# to write the compiler configuration to `libtool'.
8588862f5301Smrgm4_defun([_LT_LANG_RC_CONFIG],
8589862f5301Smrg[AC_REQUIRE([LT_PROG_RC])dnl
8590862f5301SmrgAC_LANG_SAVE
8591862f5301Smrg
8592862f5301Smrg# Source file extension for RC test sources.
8593862f5301Smrgac_ext=rc
8594862f5301Smrg
8595862f5301Smrg# Object file extension for compiled RC test sources.
8596862f5301Smrgobjext=o
8597862f5301Smrg_LT_TAGVAR(objext, $1)=$objext
8598862f5301Smrg
8599862f5301Smrg# Code to be used in simple compile tests
8600862f5301Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8601862f5301Smrg
8602862f5301Smrg# Code to be used in simple link tests
8603862f5301Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
8604862f5301Smrg
8605862f5301Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8606862f5301Smrg_LT_TAG_COMPILER
8607862f5301Smrg
8608862f5301Smrg# save warnings/boilerplate of simple test code
8609862f5301Smrg_LT_COMPILER_BOILERPLATE
8610862f5301Smrg_LT_LINKER_BOILERPLATE
8611862f5301Smrg
8612862f5301Smrg# Allow CC to be a program name with arguments.
8613862f5301Smrglt_save_CC="$CC"
8614862f5301Smrglt_save_CFLAGS=$CFLAGS
8615862f5301Smrglt_save_GCC=$GCC
8616862f5301SmrgGCC=
8617862f5301SmrgCC=${RC-"windres"}
8618862f5301SmrgCFLAGS=
8619862f5301Smrgcompiler=$CC
8620862f5301Smrg_LT_TAGVAR(compiler, $1)=$CC
8621862f5301Smrg_LT_CC_BASENAME([$compiler])
8622862f5301Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8623862f5301Smrg
8624862f5301Smrgif test -n "$compiler"; then
8625862f5301Smrg  :
8626862f5301Smrg  _LT_CONFIG($1)
8627862f5301Smrgfi
8628862f5301Smrg
8629862f5301SmrgGCC=$lt_save_GCC
8630862f5301SmrgAC_LANG_RESTORE
8631862f5301SmrgCC=$lt_save_CC
8632862f5301SmrgCFLAGS=$lt_save_CFLAGS
8633862f5301Smrg])# _LT_LANG_RC_CONFIG
8634862f5301Smrg
8635862f5301Smrg
8636862f5301Smrg# LT_PROG_GCJ
8637862f5301Smrg# -----------
8638862f5301SmrgAC_DEFUN([LT_PROG_GCJ],
8639862f5301Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8640862f5301Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8641862f5301Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
8642862f5301Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8643862f5301Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
8644862f5301Smrg])
8645862f5301Smrg
8646862f5301Smrg# Old name:
8647862f5301SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8648862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8649862f5301Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8650862f5301Smrg
8651862f5301Smrg
8652862f5301Smrg# LT_PROG_RC
8653862f5301Smrg# ----------
8654862f5301SmrgAC_DEFUN([LT_PROG_RC],
8655862f5301Smrg[AC_CHECK_TOOL(RC, windres,)
8656862f5301Smrg])
8657862f5301Smrg
8658862f5301Smrg# Old name:
8659862f5301SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8660862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8661862f5301Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8662862f5301Smrg
8663862f5301Smrg
8664862f5301Smrg# _LT_DECL_EGREP
8665862f5301Smrg# --------------
8666862f5301Smrg# If we don't have a new enough Autoconf to choose the best grep
8667862f5301Smrg# available, choose the one first in the user's PATH.
8668862f5301Smrgm4_defun([_LT_DECL_EGREP],
8669862f5301Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8670862f5301SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8671862f5301Smrgtest -z "$GREP" && GREP=grep
8672862f5301Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8673862f5301Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8674862f5301Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8675862f5301Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8676862f5301SmrgAC_SUBST([GREP])
8677862f5301Smrg])
8678862f5301Smrg
86797a3b38f7Smrg
8680862f5301Smrg# _LT_DECL_OBJDUMP
8681862f5301Smrg# --------------
8682862f5301Smrg# If we don't have a new enough Autoconf to choose the best objdump
8683862f5301Smrg# available, choose the one first in the user's PATH.
8684862f5301Smrgm4_defun([_LT_DECL_OBJDUMP],
8685862f5301Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8686862f5301Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8687862f5301Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8688862f5301SmrgAC_SUBST([OBJDUMP])
8689862f5301Smrg])
86907a3b38f7Smrg
8691862f5301Smrg# _LT_DECL_DLLTOOL
8692862f5301Smrg# ----------------
8693862f5301Smrg# Ensure DLLTOOL variable is set.
8694862f5301Smrgm4_defun([_LT_DECL_DLLTOOL],
8695862f5301Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8696862f5301Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8697862f5301Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8698862f5301SmrgAC_SUBST([DLLTOOL])
8699862f5301Smrg])
87007a3b38f7Smrg
8701862f5301Smrg# _LT_DECL_SED
8702862f5301Smrg# ------------
8703862f5301Smrg# Check for a fully-functional sed program, that truncates
8704862f5301Smrg# as few characters as possible.  Prefer GNU sed if found.
8705862f5301Smrgm4_defun([_LT_DECL_SED],
8706862f5301Smrg[AC_PROG_SED
8707862f5301Smrgtest -z "$SED" && SED=sed
8708862f5301SmrgXsed="$SED -e 1s/^X//"
8709862f5301Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8710862f5301Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8711862f5301Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8712862f5301Smrg])# _LT_DECL_SED
87137a3b38f7Smrg
8714862f5301Smrgm4_ifndef([AC_PROG_SED], [
8715862f5301Smrg# NOTE: This macro has been submitted for inclusion into   #
8716862f5301Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8717862f5301Smrg#  a released version of Autoconf we should remove this    #
8718862f5301Smrg#  macro and use it instead.                               #
87197a3b38f7Smrg
8720862f5301Smrgm4_defun([AC_PROG_SED],
8721862f5301Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8722862f5301SmrgAC_CACHE_VAL(lt_cv_path_SED,
8723862f5301Smrg[# Loop through the user's path and test for sed and gsed.
8724862f5301Smrg# Then use that list of sed's as ones to test for truncation.
8725862f5301Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8726862f5301Smrgfor as_dir in $PATH
8727862f5301Smrgdo
8728862f5301Smrg  IFS=$as_save_IFS
8729862f5301Smrg  test -z "$as_dir" && as_dir=.
8730862f5301Smrg  for lt_ac_prog in sed gsed; do
8731862f5301Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
8732862f5301Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8733862f5301Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8734862f5301Smrg      fi
8735862f5301Smrg    done
8736862f5301Smrg  done
8737862f5301Smrgdone
8738862f5301SmrgIFS=$as_save_IFS
8739862f5301Smrglt_ac_max=0
8740862f5301Smrglt_ac_count=0
8741862f5301Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8742862f5301Smrg# along with /bin/sed that truncates output.
8743862f5301Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8744862f5301Smrg  test ! -f $lt_ac_sed && continue
8745862f5301Smrg  cat /dev/null > conftest.in
8746862f5301Smrg  lt_ac_count=0
8747862f5301Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8748862f5301Smrg  # Check for GNU sed and select it if it is found.
8749862f5301Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8750862f5301Smrg    lt_cv_path_SED=$lt_ac_sed
8751862f5301Smrg    break
8752862f5301Smrg  fi
8753862f5301Smrg  while true; do
8754862f5301Smrg    cat conftest.in conftest.in >conftest.tmp
8755862f5301Smrg    mv conftest.tmp conftest.in
8756862f5301Smrg    cp conftest.in conftest.nl
8757862f5301Smrg    echo >>conftest.nl
8758862f5301Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8759862f5301Smrg    cmp -s conftest.out conftest.nl || break
8760862f5301Smrg    # 10000 chars as input seems more than enough
8761862f5301Smrg    test $lt_ac_count -gt 10 && break
8762862f5301Smrg    lt_ac_count=`expr $lt_ac_count + 1`
8763862f5301Smrg    if test $lt_ac_count -gt $lt_ac_max; then
8764862f5301Smrg      lt_ac_max=$lt_ac_count
8765862f5301Smrg      lt_cv_path_SED=$lt_ac_sed
8766862f5301Smrg    fi
8767862f5301Smrg  done
8768862f5301Smrgdone
876944dda7b2Smrg])
8770862f5301SmrgSED=$lt_cv_path_SED
8771862f5301SmrgAC_SUBST([SED])
8772862f5301SmrgAC_MSG_RESULT([$SED])
8773862f5301Smrg])#AC_PROG_SED
8774862f5301Smrg])#m4_ifndef
87757a3b38f7Smrg
8776862f5301Smrg# Old name:
8777862f5301SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8778862f5301Smrgdnl aclocal-1.4 backwards compatibility:
8779862f5301Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
87807a3b38f7Smrg
87817a3b38f7Smrg
8782862f5301Smrg# _LT_CHECK_SHELL_FEATURES
8783862f5301Smrg# ------------------------
8784862f5301Smrg# Find out whether the shell is Bourne or XSI compatible,
8785862f5301Smrg# or has some other useful features.
8786862f5301Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8787862f5301Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8788862f5301Smrg# Try some XSI features
8789862f5301Smrgxsi_shell=no
8790862f5301Smrg( _lt_dummy="a/b/c"
8791862f5301Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8792862f5301Smrg      = c,a/b,b/c, \
8793862f5301Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
8794862f5301Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8795862f5301Smrg  && xsi_shell=yes
8796862f5301SmrgAC_MSG_RESULT([$xsi_shell])
8797862f5301Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
87987a3b38f7Smrg
8799862f5301SmrgAC_MSG_CHECKING([whether the shell understands "+="])
8800862f5301Smrglt_shell_append=no
8801862f5301Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8802862f5301Smrg    >/dev/null 2>&1 \
8803862f5301Smrg  && lt_shell_append=yes
8804862f5301SmrgAC_MSG_RESULT([$lt_shell_append])
8805862f5301Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
88067a3b38f7Smrg
8807862f5301Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8808862f5301Smrg  lt_unset=unset
8809862f5301Smrgelse
8810862f5301Smrg  lt_unset=false
8811862f5301Smrgfi
8812862f5301Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
88137a3b38f7Smrg
8814862f5301Smrg# test EBCDIC or ASCII
8815862f5301Smrgcase `echo X|tr X '\101'` in
8816862f5301Smrg A) # ASCII based system
8817862f5301Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8818862f5301Smrg  lt_SP2NL='tr \040 \012'
8819862f5301Smrg  lt_NL2SP='tr \015\012 \040\040'
8820862f5301Smrg  ;;
8821862f5301Smrg *) # EBCDIC based system
8822862f5301Smrg  lt_SP2NL='tr \100 \n'
8823862f5301Smrg  lt_NL2SP='tr \r\n \100\100'
8824862f5301Smrg  ;;
8825862f5301Smrgesac
8826862f5301Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8827862f5301Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8828862f5301Smrg])# _LT_CHECK_SHELL_FEATURES
8829862f5301Smrg
8830862f5301Smrg
8831862f5301Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8832862f5301Smrg# ------------------------------------------------------
8833862f5301Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8834862f5301Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8835862f5301Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
8836862f5301Smrg[dnl {
8837862f5301Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
8838862f5301Smrg$1 ()\
8839862f5301Smrg{\
8840862f5301Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8841862f5301Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8842862f5301Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
8843862f5301Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8844862f5301Smrgtest 0 -eq $? || _lt_function_replace_fail=:
8845862f5301Smrg])
88467a3b38f7Smrg
88477a3b38f7Smrg
8848862f5301Smrg# _LT_PROG_REPLACE_SHELLFNS
8849862f5301Smrg# -------------------------
8850862f5301Smrg# Replace existing portable implementations of several shell functions with
8851862f5301Smrg# equivalent extended shell implementations where those features are available..
8852862f5301Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
8853862f5301Smrg[if test x"$xsi_shell" = xyes; then
8854862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8855862f5301Smrg    case ${1} in
8856862f5301Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
8857862f5301Smrg      *  ) func_dirname_result="${3}" ;;
8858862f5301Smrg    esac])
8859862f5301Smrg
8860862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8861862f5301Smrg    func_basename_result="${1##*/}"])
8862862f5301Smrg
8863862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8864862f5301Smrg    case ${1} in
8865862f5301Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
8866862f5301Smrg      *  ) func_dirname_result="${3}" ;;
886744dda7b2Smrg    esac
8868862f5301Smrg    func_basename_result="${1##*/}"])
88697a3b38f7Smrg
8870862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8871862f5301Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8872862f5301Smrg    # positional parameters, so assign one to ordinary parameter first.
8873862f5301Smrg    func_stripname_result=${3}
8874862f5301Smrg    func_stripname_result=${func_stripname_result#"${1}"}
8875862f5301Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
8876862f5301Smrg
8877862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8878862f5301Smrg    func_split_long_opt_name=${1%%=*}
8879862f5301Smrg    func_split_long_opt_arg=${1#*=}])
8880862f5301Smrg
8881862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8882862f5301Smrg    func_split_short_opt_arg=${1#??}
8883862f5301Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8884862f5301Smrg
8885862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8886862f5301Smrg    case ${1} in
8887862f5301Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8888862f5301Smrg      *)    func_lo2o_result=${1} ;;
8889862f5301Smrg    esac])
8890862f5301Smrg
8891862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8892862f5301Smrg
8893862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8894862f5301Smrg
8895862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
889644dda7b2Smrgfi
88977a3b38f7Smrg
8898862f5301Smrgif test x"$lt_shell_append" = xyes; then
8899862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
89007a3b38f7Smrg
8901862f5301Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8902862f5301Smrg    func_quote_for_eval "${2}"
8903862f5301Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8904862f5301Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
89057a3b38f7Smrg
8906862f5301Smrg  # Save a `func_append' function call where possible by direct use of '+='
8907862f5301Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8908862f5301Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
8909862f5301Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8910862f5301Smrg  test 0 -eq $? || _lt_function_replace_fail=:
8911862f5301Smrgelse
8912862f5301Smrg  # Save a `func_append' function call even when '+=' is not available
8913862f5301Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8914862f5301Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
8915862f5301Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8916862f5301Smrg  test 0 -eq $? || _lt_function_replace_fail=:
8917862f5301Smrgfi
89187a3b38f7Smrg
8919862f5301Smrgif test x"$_lt_function_replace_fail" = x":"; then
8920862f5301Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8921862f5301Smrgfi
8922862f5301Smrg])
89237a3b38f7Smrg
8924862f5301Smrg# _LT_PATH_CONVERSION_FUNCTIONS
8925862f5301Smrg# -----------------------------
8926862f5301Smrg# Determine which file name conversion functions should be used by
8927862f5301Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8928862f5301Smrg# for certain cross-compile configurations and native mingw.
8929862f5301Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8930862f5301Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8931862f5301SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8932862f5301SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8933862f5301SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8934862f5301Smrg[case $host in
8935862f5301Smrg  *-*-mingw* )
8936862f5301Smrg    case $build in
8937862f5301Smrg      *-*-mingw* ) # actually msys
8938862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8939862f5301Smrg        ;;
8940862f5301Smrg      *-*-cygwin* )
8941862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8942862f5301Smrg        ;;
8943862f5301Smrg      * ) # otherwise, assume *nix
8944862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8945862f5301Smrg        ;;
8946862f5301Smrg    esac
894744dda7b2Smrg    ;;
8948862f5301Smrg  *-*-cygwin* )
8949862f5301Smrg    case $build in
8950862f5301Smrg      *-*-mingw* ) # actually msys
8951862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8952862f5301Smrg        ;;
8953862f5301Smrg      *-*-cygwin* )
8954862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8955862f5301Smrg        ;;
8956862f5301Smrg      * ) # otherwise, assume *nix
8957862f5301Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8958862f5301Smrg        ;;
895944dda7b2Smrg    esac
896044dda7b2Smrg    ;;
8961862f5301Smrg  * ) # unhandled hosts (and "normal" native builds)
8962862f5301Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8963862f5301Smrg    ;;
896444dda7b2Smrgesac
896544dda7b2Smrg])
8966862f5301Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8967862f5301SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8968862f5301Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8969862f5301Smrg         [0], [convert $build file names to $host format])dnl
8970862f5301Smrg
8971862f5301SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8972862f5301SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8973862f5301Smrg[#assume ordinary cross tools, or native build.
8974862f5301Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
8975862f5301Smrgcase $host in
8976862f5301Smrg  *-*-mingw* )
8977862f5301Smrg    case $build in
8978862f5301Smrg      *-*-mingw* ) # actually msys
8979862f5301Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8980862f5301Smrg        ;;
8981862f5301Smrg    esac
8982862f5301Smrg    ;;
898344dda7b2Smrgesac
8984862f5301Smrg])
8985862f5301Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8986862f5301SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8987862f5301Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8988862f5301Smrg         [0], [convert $build files to toolchain format])dnl
8989862f5301Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
89907a3b38f7Smrg
8991862f5301Smrg# Helper functions for option handling.                    -*- Autoconf -*-
8992862f5301Smrg#
8993862f5301Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
8994862f5301Smrg#   Inc.
8995862f5301Smrg#   Written by Gary V. Vaughan, 2004
8996862f5301Smrg#
8997862f5301Smrg# This file is free software; the Free Software Foundation gives
8998862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
8999862f5301Smrg# modifications, as long as this notice is preserved.
90007a3b38f7Smrg
9001862f5301Smrg# serial 7 ltoptions.m4
90027a3b38f7Smrg
9003862f5301Smrg# This is to help aclocal find these macros, as it can't see m4_define.
9004862f5301SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
90057a3b38f7Smrg
90067a3b38f7Smrg
9007862f5301Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9008862f5301Smrg# ------------------------------------------
9009862f5301Smrgm4_define([_LT_MANGLE_OPTION],
9010862f5301Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
90117a3b38f7Smrg
90127a3b38f7Smrg
9013862f5301Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9014862f5301Smrg# ---------------------------------------
9015862f5301Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9016862f5301Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9017862f5301Smrg# saved as a flag.
9018862f5301Smrgm4_define([_LT_SET_OPTION],
9019862f5301Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9020862f5301Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9021862f5301Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
9022862f5301Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
9023862f5301Smrg])
90247a3b38f7Smrg
902544dda7b2Smrg
9026862f5301Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9027862f5301Smrg# ------------------------------------------------------------
9028862f5301Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9029862f5301Smrgm4_define([_LT_IF_OPTION],
9030862f5301Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
903144dda7b2Smrg
903244dda7b2Smrg
9033862f5301Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9034862f5301Smrg# -------------------------------------------------------
9035862f5301Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9036862f5301Smrg# are set.
9037862f5301Smrgm4_define([_LT_UNLESS_OPTIONS],
9038862f5301Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9039862f5301Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9040862f5301Smrg		      [m4_define([$0_found])])])[]dnl
9041862f5301Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9042862f5301Smrg])[]dnl
9043862f5301Smrg])
9044862f5301Smrg
9045862f5301Smrg
9046862f5301Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9047862f5301Smrg# ----------------------------------------
9048862f5301Smrg# OPTION-LIST is a space-separated list of Libtool options associated
9049862f5301Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
9050862f5301Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9051862f5301Smrg# the unknown option and exit.
9052862f5301Smrgm4_defun([_LT_SET_OPTIONS],
9053862f5301Smrg[# Set options
9054862f5301Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9055862f5301Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
9056862f5301Smrg
9057862f5301Smrgm4_if([$1],[LT_INIT],[
9058862f5301Smrg  dnl
9059862f5301Smrg  dnl Simply set some default values (i.e off) if boolean options were not
9060862f5301Smrg  dnl specified:
9061862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9062862f5301Smrg  ])
9063862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9064862f5301Smrg  ])
9065862f5301Smrg  dnl
9066862f5301Smrg  dnl If no reference was made to various pairs of opposing options, then
9067862f5301Smrg  dnl we run the default mode handler for the pair.  For example, if neither
9068862f5301Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9069862f5301Smrg  dnl archives by default:
9070862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9071862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9072862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9073862f5301Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9074862f5301Smrg  		   [_LT_ENABLE_FAST_INSTALL])
9075862f5301Smrg  ])
9076862f5301Smrg])# _LT_SET_OPTIONS
9077862f5301Smrg
907844dda7b2Smrg
90797a3b38f7Smrg
9080862f5301Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9081862f5301Smrg# -----------------------------------------
9082862f5301Smrgm4_define([_LT_MANGLE_DEFUN],
9083862f5301Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
90847a3b38f7Smrg
90857a3b38f7Smrg
9086862f5301Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9087862f5301Smrg# -----------------------------------------------
9088862f5301Smrgm4_define([LT_OPTION_DEFINE],
9089862f5301Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9090862f5301Smrg])# LT_OPTION_DEFINE
90917a3b38f7Smrg
90927a3b38f7Smrg
9093862f5301Smrg# dlopen
9094862f5301Smrg# ------
9095862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9096862f5301Smrg])
90977a3b38f7Smrg
9098862f5301SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
9099862f5301Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
9100862f5301SmrgAC_DIAGNOSE([obsolete],
9101862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9102862f5301Smrgput the `dlopen' option into LT_INIT's first parameter.])
9103862f5301Smrg])
91047a3b38f7Smrg
9105862f5301Smrgdnl aclocal-1.4 backwards compatibility:
9106862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
91077a3b38f7Smrg
91087a3b38f7Smrg
9109862f5301Smrg# win32-dll
9110862f5301Smrg# ---------
9111862f5301Smrg# Declare package support for building win32 dll's.
9112862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
9113862f5301Smrg[enable_win32_dll=yes
91147a3b38f7Smrg
9115862f5301Smrgcase $host in
9116862f5301Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9117862f5301Smrg  AC_CHECK_TOOL(AS, as, false)
9118862f5301Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9119862f5301Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9120862f5301Smrg  ;;
9121862f5301Smrgesac
91227a3b38f7Smrg
9123862f5301Smrgtest -z "$AS" && AS=as
9124862f5301Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
91257a3b38f7Smrg
9126862f5301Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
9127862f5301Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
91287a3b38f7Smrg
9129862f5301Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
9130862f5301Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9131862f5301Smrg])# win32-dll
91327a3b38f7Smrg
9133862f5301SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9134862f5301Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9135862f5301Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
9136862f5301SmrgAC_DIAGNOSE([obsolete],
9137862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9138862f5301Smrgput the `win32-dll' option into LT_INIT's first parameter.])
9139862f5301Smrg])
91407a3b38f7Smrg
9141862f5301Smrgdnl aclocal-1.4 backwards compatibility:
9142862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
914344dda7b2Smrg
91447a3b38f7Smrg
9145862f5301Smrg# _LT_ENABLE_SHARED([DEFAULT])
9146862f5301Smrg# ----------------------------
9147862f5301Smrg# implement the --enable-shared flag, and supports the `shared' and
9148862f5301Smrg# `disable-shared' LT_INIT options.
9149862f5301Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9150862f5301Smrgm4_define([_LT_ENABLE_SHARED],
9151862f5301Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9152862f5301SmrgAC_ARG_ENABLE([shared],
9153862f5301Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9154862f5301Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9155862f5301Smrg    [p=${PACKAGE-default}
9156862f5301Smrg    case $enableval in
9157862f5301Smrg    yes) enable_shared=yes ;;
9158862f5301Smrg    no) enable_shared=no ;;
9159862f5301Smrg    *)
9160862f5301Smrg      enable_shared=no
9161862f5301Smrg      # Look at the argument we got.  We use all the common list separators.
9162862f5301Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9163862f5301Smrg      for pkg in $enableval; do
9164862f5301Smrg	IFS="$lt_save_ifs"
9165862f5301Smrg	if test "X$pkg" = "X$p"; then
9166862f5301Smrg	  enable_shared=yes
9167862f5301Smrg	fi
9168862f5301Smrg      done
9169862f5301Smrg      IFS="$lt_save_ifs"
9170862f5301Smrg      ;;
9171862f5301Smrg    esac],
9172862f5301Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
91737a3b38f7Smrg
9174862f5301Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9175862f5301Smrg	[Whether or not to build shared libraries])
9176862f5301Smrg])# _LT_ENABLE_SHARED
91777a3b38f7Smrg
9178862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9179862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
91807a3b38f7Smrg
9181862f5301Smrg# Old names:
9182862f5301SmrgAC_DEFUN([AC_ENABLE_SHARED],
9183862f5301Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9184862f5301Smrg])
91857a3b38f7Smrg
9186862f5301SmrgAC_DEFUN([AC_DISABLE_SHARED],
9187862f5301Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
9188862f5301Smrg])
91897a3b38f7Smrg
9190862f5301SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9191862f5301SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
91927a3b38f7Smrg
9193862f5301Smrgdnl aclocal-1.4 backwards compatibility:
9194862f5301Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
9195862f5301Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
91967a3b38f7Smrg
91977a3b38f7Smrg
91987a3b38f7Smrg
9199862f5301Smrg# _LT_ENABLE_STATIC([DEFAULT])
9200862f5301Smrg# ----------------------------
9201862f5301Smrg# implement the --enable-static flag, and support the `static' and
9202862f5301Smrg# `disable-static' LT_INIT options.
9203862f5301Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9204862f5301Smrgm4_define([_LT_ENABLE_STATIC],
9205862f5301Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9206862f5301SmrgAC_ARG_ENABLE([static],
9207862f5301Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9208862f5301Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9209862f5301Smrg    [p=${PACKAGE-default}
9210862f5301Smrg    case $enableval in
9211862f5301Smrg    yes) enable_static=yes ;;
9212862f5301Smrg    no) enable_static=no ;;
9213862f5301Smrg    *)
9214862f5301Smrg     enable_static=no
9215862f5301Smrg      # Look at the argument we got.  We use all the common list separators.
9216862f5301Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9217862f5301Smrg      for pkg in $enableval; do
9218862f5301Smrg	IFS="$lt_save_ifs"
9219862f5301Smrg	if test "X$pkg" = "X$p"; then
9220862f5301Smrg	  enable_static=yes
9221862f5301Smrg	fi
9222862f5301Smrg      done
9223862f5301Smrg      IFS="$lt_save_ifs"
9224862f5301Smrg      ;;
9225862f5301Smrg    esac],
9226862f5301Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9227862f5301Smrg
9228862f5301Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
9229862f5301Smrg	[Whether or not to build static libraries])
9230862f5301Smrg])# _LT_ENABLE_STATIC
9231862f5301Smrg
9232862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9233862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
92347a3b38f7Smrg
9235862f5301Smrg# Old names:
9236862f5301SmrgAC_DEFUN([AC_ENABLE_STATIC],
9237862f5301Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9238862f5301Smrg])
92397a3b38f7Smrg
9240862f5301SmrgAC_DEFUN([AC_DISABLE_STATIC],
9241862f5301Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
9242862f5301Smrg])
92437a3b38f7Smrg
9244862f5301SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9245862f5301SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
92467a3b38f7Smrg
9247862f5301Smrgdnl aclocal-1.4 backwards compatibility:
9248862f5301Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
9249862f5301Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
92507a3b38f7Smrg
92517a3b38f7Smrg
92527a3b38f7Smrg
9253862f5301Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9254862f5301Smrg# ----------------------------------
9255862f5301Smrg# implement the --enable-fast-install flag, and support the `fast-install'
9256862f5301Smrg# and `disable-fast-install' LT_INIT options.
9257862f5301Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9258862f5301Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
9259862f5301Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9260862f5301SmrgAC_ARG_ENABLE([fast-install],
9261862f5301Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9262862f5301Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9263862f5301Smrg    [p=${PACKAGE-default}
9264862f5301Smrg    case $enableval in
9265862f5301Smrg    yes) enable_fast_install=yes ;;
9266862f5301Smrg    no) enable_fast_install=no ;;
9267862f5301Smrg    *)
9268862f5301Smrg      enable_fast_install=no
9269862f5301Smrg      # Look at the argument we got.  We use all the common list separators.
9270862f5301Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9271862f5301Smrg      for pkg in $enableval; do
9272862f5301Smrg	IFS="$lt_save_ifs"
9273862f5301Smrg	if test "X$pkg" = "X$p"; then
9274862f5301Smrg	  enable_fast_install=yes
9275862f5301Smrg	fi
9276862f5301Smrg      done
9277862f5301Smrg      IFS="$lt_save_ifs"
9278862f5301Smrg      ;;
9279862f5301Smrg    esac],
9280862f5301Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
92817a3b38f7Smrg
9282862f5301Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
9283862f5301Smrg	 [Whether or not to optimize for fast installation])dnl
9284862f5301Smrg])# _LT_ENABLE_FAST_INSTALL
92857a3b38f7Smrg
9286862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9287862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
92887a3b38f7Smrg
9289862f5301Smrg# Old names:
9290862f5301SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
9291862f5301Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9292862f5301SmrgAC_DIAGNOSE([obsolete],
9293862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9294862f5301Smrgthe `fast-install' option into LT_INIT's first parameter.])
9295862f5301Smrg])
92967a3b38f7Smrg
9297862f5301SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
9298862f5301Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9299862f5301SmrgAC_DIAGNOSE([obsolete],
9300862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9301862f5301Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
9302862f5301Smrg])
93037a3b38f7Smrg
9304862f5301Smrgdnl aclocal-1.4 backwards compatibility:
9305862f5301Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9306862f5301Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
93077a3b38f7Smrg
93087a3b38f7Smrg
9309862f5301Smrg# _LT_WITH_PIC([MODE])
9310862f5301Smrg# --------------------
9311862f5301Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9312862f5301Smrg# LT_INIT options.
9313862f5301Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9314862f5301Smrgm4_define([_LT_WITH_PIC],
9315862f5301Smrg[AC_ARG_WITH([pic],
9316862f5301Smrg    [AS_HELP_STRING([--with-pic],
9317862f5301Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9318862f5301Smrg    [pic_mode="$withval"],
9319862f5301Smrg    [pic_mode=default])
9320ff559fabSmrg
9321862f5301Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9322ff559fabSmrg
9323862f5301Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9324862f5301Smrg])# _LT_WITH_PIC
9325ff559fabSmrg
9326862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9327862f5301SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9328ff559fabSmrg
9329862f5301Smrg# Old name:
9330862f5301SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
9331862f5301Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
9332862f5301SmrgAC_DIAGNOSE([obsolete],
9333862f5301Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9334862f5301Smrgput the `pic-only' option into LT_INIT's first parameter.])
9335862f5301Smrg])
9336ff559fabSmrg
9337862f5301Smrgdnl aclocal-1.4 backwards compatibility:
9338862f5301Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9339ff559fabSmrg
9340ff559fabSmrg
9341862f5301Smrgm4_define([_LTDL_MODE], [])
9342862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9343862f5301Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
9344862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
9345862f5301Smrg		 [m4_define([_LTDL_MODE], [recursive])])
9346862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
9347862f5301Smrg		 [m4_define([_LTDL_MODE], [subproject])])
9348ff559fabSmrg
9349862f5301Smrgm4_define([_LTDL_TYPE], [])
9350862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
9351862f5301Smrg		 [m4_define([_LTDL_TYPE], [installable])])
9352862f5301SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
9353862f5301Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
9354ff559fabSmrg
9355862f5301Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9356862f5301Smrg#
9357862f5301Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9358862f5301Smrg# Written by Gary V. Vaughan, 2004
9359862f5301Smrg#
9360862f5301Smrg# This file is free software; the Free Software Foundation gives
9361862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
9362862f5301Smrg# modifications, as long as this notice is preserved.
9363ff559fabSmrg
9364862f5301Smrg# serial 6 ltsugar.m4
936544dda7b2Smrg
9366862f5301Smrg# This is to help aclocal find these macros, as it can't see m4_define.
9367862f5301SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
936844dda7b2Smrg
936944dda7b2Smrg
9370862f5301Smrg# lt_join(SEP, ARG1, [ARG2...])
9371862f5301Smrg# -----------------------------
9372862f5301Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9373862f5301Smrg# associated separator.
9374862f5301Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9375862f5301Smrg# versions in m4sugar had bugs.
9376862f5301Smrgm4_define([lt_join],
9377862f5301Smrg[m4_if([$#], [1], [],
9378862f5301Smrg       [$#], [2], [[$2]],
9379862f5301Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9380862f5301Smrgm4_define([_lt_join],
9381862f5301Smrg[m4_if([$#$2], [2], [],
9382862f5301Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
938344dda7b2Smrg
938444dda7b2Smrg
9385862f5301Smrg# lt_car(LIST)
9386862f5301Smrg# lt_cdr(LIST)
9387862f5301Smrg# ------------
9388862f5301Smrg# Manipulate m4 lists.
9389862f5301Smrg# These macros are necessary as long as will still need to support
9390862f5301Smrg# Autoconf-2.59 which quotes differently.
9391862f5301Smrgm4_define([lt_car], [[$1]])
9392862f5301Smrgm4_define([lt_cdr],
9393862f5301Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9394862f5301Smrg       [$#], 1, [],
9395862f5301Smrg       [m4_dquote(m4_shift($@))])])
9396862f5301Smrgm4_define([lt_unquote], $1)
9397ff559fabSmrg
9398ff559fabSmrg
9399862f5301Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9400862f5301Smrg# ------------------------------------------
9401862f5301Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9402862f5301Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
9403862f5301Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9404862f5301Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9405862f5301Smrg# than defined and empty).
9406862f5301Smrg#
9407862f5301Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
9408862f5301Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9409862f5301Smrgm4_define([lt_append],
9410862f5301Smrg[m4_define([$1],
9411862f5301Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9412ff559fabSmrg
9413ff559fabSmrg
9414ff559fabSmrg
9415862f5301Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9416862f5301Smrg# ----------------------------------------------------------
9417862f5301Smrg# Produce a SEP delimited list of all paired combinations of elements of
9418862f5301Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9419862f5301Smrg# has the form PREFIXmINFIXSUFFIXn.
9420862f5301Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
9421862f5301Smrgm4_define([lt_combine],
9422862f5301Smrg[m4_if(m4_eval([$# > 3]), [1],
9423862f5301Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9424862f5301Smrg[[m4_foreach([_Lt_prefix], [$2],
9425862f5301Smrg	     [m4_foreach([_Lt_suffix],
9426862f5301Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9427862f5301Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9428ff559fabSmrg
9429ff559fabSmrg
9430862f5301Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9431862f5301Smrg# -----------------------------------------------------------------------
9432862f5301Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9433862f5301Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9434862f5301Smrgm4_define([lt_if_append_uniq],
9435862f5301Smrg[m4_ifdef([$1],
9436862f5301Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9437862f5301Smrg		 [lt_append([$1], [$2], [$3])$4],
9438862f5301Smrg		 [$5])],
9439862f5301Smrg	  [lt_append([$1], [$2], [$3])$4])])
94407a3b38f7Smrg
9441ff559fabSmrg
9442862f5301Smrg# lt_dict_add(DICT, KEY, VALUE)
9443862f5301Smrg# -----------------------------
9444862f5301Smrgm4_define([lt_dict_add],
9445862f5301Smrg[m4_define([$1($2)], [$3])])
9446ff559fabSmrg
9447ff559fabSmrg
9448862f5301Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9449862f5301Smrg# --------------------------------------------
9450862f5301Smrgm4_define([lt_dict_add_subkey],
9451862f5301Smrg[m4_define([$1($2:$3)], [$4])])
9452ff559fabSmrg
9453ff559fabSmrg
9454862f5301Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
9455862f5301Smrg# ----------------------------------
9456862f5301Smrgm4_define([lt_dict_fetch],
9457862f5301Smrg[m4_ifval([$3],
9458862f5301Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9459862f5301Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9460ff559fabSmrg
9461ff559fabSmrg
9462862f5301Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9463862f5301Smrg# -----------------------------------------------------------------
9464862f5301Smrgm4_define([lt_if_dict_fetch],
9465862f5301Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9466862f5301Smrg	[$5],
9467862f5301Smrg    [$6])])
9468ff559fabSmrg
9469ff559fabSmrg
9470862f5301Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9471862f5301Smrg# --------------------------------------------------------------
9472862f5301Smrgm4_define([lt_dict_filter],
9473862f5301Smrg[m4_if([$5], [], [],
9474862f5301Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9475862f5301Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9476862f5301Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9477862f5301Smrg])
9478ff559fabSmrg
9479862f5301Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
9480862f5301Smrg#
9481862f5301Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
9482862f5301Smrg#   Written by Scott James Remnant, 2004
9483862f5301Smrg#
9484862f5301Smrg# This file is free software; the Free Software Foundation gives
9485862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
9486862f5301Smrg# modifications, as long as this notice is preserved.
9487ff559fabSmrg
9488862f5301Smrg# @configure_input@
9489ff559fabSmrg
9490862f5301Smrg# serial 3293 ltversion.m4
9491862f5301Smrg# This file is part of GNU Libtool
9492ff559fabSmrg
9493862f5301Smrgm4_define([LT_PACKAGE_VERSION], [2.4])
9494862f5301Smrgm4_define([LT_PACKAGE_REVISION], [1.3293])
9495ff559fabSmrg
9496862f5301SmrgAC_DEFUN([LTVERSION_VERSION],
9497862f5301Smrg[macro_version='2.4'
9498862f5301Smrgmacro_revision='1.3293'
9499862f5301Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9500862f5301Smrg_LT_DECL(, macro_revision, 0)
9501862f5301Smrg])
9502ff559fabSmrg
9503862f5301Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9504862f5301Smrg#
9505862f5301Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9506862f5301Smrg#   Written by Scott James Remnant, 2004.
9507862f5301Smrg#
9508862f5301Smrg# This file is free software; the Free Software Foundation gives
9509862f5301Smrg# unlimited permission to copy and/or distribute it, with or without
9510862f5301Smrg# modifications, as long as this notice is preserved.
9511ff559fabSmrg
9512862f5301Smrg# serial 5 lt~obsolete.m4
9513ff559fabSmrg
9514862f5301Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
9515862f5301Smrg#
9516862f5301Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9517862f5301Smrg# which have later been changed to m4_define as they aren't part of the
9518862f5301Smrg# exported API, or moved to Autoconf or Automake where they belong.
9519862f5301Smrg#
9520862f5301Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9521862f5301Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9522862f5301Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
9523862f5301Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9524862f5301Smrg# and doesn't know about Autoconf macros at all.)
9525862f5301Smrg#
9526862f5301Smrg# So we provide this file, which has a silly filename so it's always
9527862f5301Smrg# included after everything else.  This provides aclocal with the
9528862f5301Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9529862f5301Smrg# because those macros already exist, or will be overwritten later.
9530862f5301Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9531862f5301Smrg#
9532862f5301Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9533862f5301Smrg# Yes, that means every name once taken will need to remain here until
9534862f5301Smrg# we give up compatibility with versions before 1.7, at which point
9535862f5301Smrg# we need to keep only those names which we still refer to.
9536ff559fabSmrg
9537862f5301Smrg# This is to help aclocal find these macros, as it can't see m4_define.
9538862f5301SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9539ff559fabSmrg
9540862f5301Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9541862f5301Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9542862f5301Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9543862f5301Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9544862f5301Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9545862f5301Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9546862f5301Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9547862f5301Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9548862f5301Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9549862f5301Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9550862f5301Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9551862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9552862f5301Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9553862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9554862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9555862f5301Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9556862f5301Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9557862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9558862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9559862f5301Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9560862f5301Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9561862f5301Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9562862f5301Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9563862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9564862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9565862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9566862f5301Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9567862f5301Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9568862f5301Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9569862f5301Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9570862f5301Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9571862f5301Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9572862f5301Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9573862f5301Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9574862f5301Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9575862f5301Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9576862f5301Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9577862f5301Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9578862f5301Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9579862f5301Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9580862f5301Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9581862f5301Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9582862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9583862f5301Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9584862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9585862f5301Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9586862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9587862f5301Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9588862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9589862f5301Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9590862f5301Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9591862f5301Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9592862f5301Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9593862f5301Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9594862f5301Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9595862f5301Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9596862f5301Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9597862f5301Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9598862f5301Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9599862f5301Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9600862f5301Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9601ff559fabSmrg
9602862f5301Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9603862f5301Smrgdnl
9604862f5301Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9605862f5301Smrgdnl 
9606862f5301Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9607862f5301Smrgdnl copy of this software and associated documentation files (the "Software"),
9608862f5301Smrgdnl to deal in the Software without restriction, including without limitation
9609862f5301Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9610862f5301Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
9611862f5301Smrgdnl Software is furnished to do so, subject to the following conditions:
9612862f5301Smrgdnl
9613862f5301Smrgdnl The above copyright notice and this permission notice (including the next
9614862f5301Smrgdnl paragraph) shall be included in all copies or substantial portions of the
9615862f5301Smrgdnl Software.
9616862f5301Smrgdnl
9617862f5301Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9618862f5301Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9619862f5301Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9620862f5301Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9621862f5301Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9622862f5301Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9623862f5301Smrgdnl DEALINGS IN THE SOFTWARE.
962444dda7b2Smrg
9625862f5301Smrg# XORG_MACROS_VERSION(required-version)
9626862f5301Smrg# -------------------------------------
9627862f5301Smrg# Minimum version: 1.1.0
9628862f5301Smrg#
9629862f5301Smrg# If you're using a macro added in Version 1.1 or newer, include this in
9630862f5301Smrg# your configure.ac with the minimum required version, such as:
9631862f5301Smrg# XORG_MACROS_VERSION(1.1)
9632862f5301Smrg#
9633862f5301Smrg# To ensure that this macro is defined, also add:
9634862f5301Smrg# m4_ifndef([XORG_MACROS_VERSION],
9635862f5301Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9636862f5301Smrg#
9637862f5301Smrg#
9638862f5301Smrg# See the "minimum version" comment for each macro you use to see what 
9639862f5301Smrg# version you require.
9640862f5301Smrgm4_defun([XORG_MACROS_VERSION],[
9641862f5301Smrgm4_define([vers_have], [1.16.2])
9642862f5301Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9643862f5301Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9644862f5301Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9645862f5301Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9646862f5301Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9647862f5301Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9648862f5301Smrgm4_undefine([vers_have])
9649862f5301Smrgm4_undefine([maj_have])
9650862f5301Smrgm4_undefine([maj_needed])
9651862f5301Smrg]) # XORG_MACROS_VERSION
965244dda7b2Smrg
9653862f5301Smrg# XORG_PROG_RAWCPP()
9654862f5301Smrg# ------------------
9655862f5301Smrg# Minimum version: 1.0.0
9656862f5301Smrg#
9657862f5301Smrg# Find cpp program and necessary flags for use in pre-processing text files
9658862f5301Smrg# such as man pages and config files
9659862f5301SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9660862f5301SmrgAC_REQUIRE([AC_PROG_CPP])
9661862f5301SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9662862f5301Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9663ff559fabSmrg
9664862f5301Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9665862f5301Smrg# which is not the best choice for supporting other OS'es, but covers most
9666862f5301Smrg# of the ones we need for now.
9667862f5301SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9668862f5301SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9669862f5301Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9670862f5301Smrg	AC_MSG_RESULT([no])
9671862f5301Smrgelse
9672862f5301Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9673862f5301Smrg		RAWCPPFLAGS=-undef
9674862f5301Smrg		AC_MSG_RESULT([yes])
9675862f5301Smrg	# under Cygwin unix is still defined even with -undef
9676862f5301Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9677862f5301Smrg		RAWCPPFLAGS="-undef -ansi"
9678862f5301Smrg		AC_MSG_RESULT([yes, with -ansi])
9679862f5301Smrg	else
9680862f5301Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9681862f5301Smrg	fi
9682862f5301Smrgfi
9683862f5301Smrgrm -f conftest.$ac_ext
9684ff559fabSmrg
9685862f5301SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9686862f5301SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9687862f5301Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9688862f5301Smrg	AC_MSG_RESULT([no])
9689862f5301Smrgelse
9690862f5301Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9691862f5301Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9692862f5301Smrg		AC_MSG_RESULT([yes])
9693862f5301Smrg	else
9694862f5301Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9695862f5301Smrg	fi
9696862f5301Smrgfi
9697862f5301Smrgrm -f conftest.$ac_ext
9698862f5301SmrgAC_SUBST(RAWCPPFLAGS)
9699862f5301Smrg]) # XORG_PROG_RAWCPP
9700ff559fabSmrg
9701862f5301Smrg# XORG_MANPAGE_SECTIONS()
9702862f5301Smrg# -----------------------
9703862f5301Smrg# Minimum version: 1.0.0
9704862f5301Smrg#
9705862f5301Smrg# Determine which sections man pages go in for the different man page types
9706862f5301Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9707862f5301Smrg# Not sure if there's any better way than just hardcoding by OS name.
9708862f5301Smrg# Override default settings by setting environment variables
9709862f5301Smrg# Added MAN_SUBSTS in version 1.8
9710862f5301Smrg# Added AC_PROG_SED in version 1.8
9711ff559fabSmrg
9712862f5301SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9713862f5301SmrgAC_REQUIRE([AC_CANONICAL_HOST])
9714862f5301SmrgAC_REQUIRE([AC_PROG_SED])
9715ff559fabSmrg
9716862f5301Smrgif test x$APP_MAN_SUFFIX = x    ; then
9717862f5301Smrg    APP_MAN_SUFFIX=1
9718862f5301Smrgfi
9719862f5301Smrgif test x$APP_MAN_DIR = x    ; then
9720862f5301Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9721862f5301Smrgfi
9722ff559fabSmrg
9723862f5301Smrgif test x$LIB_MAN_SUFFIX = x    ; then
9724862f5301Smrg    LIB_MAN_SUFFIX=3
9725862f5301Smrgfi
9726862f5301Smrgif test x$LIB_MAN_DIR = x    ; then
9727862f5301Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9728862f5301Smrgfi
972944dda7b2Smrg
9730862f5301Smrgif test x$FILE_MAN_SUFFIX = x    ; then
9731862f5301Smrg    case $host_os in
9732862f5301Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9733862f5301Smrg	*)		FILE_MAN_SUFFIX=5  ;;
9734862f5301Smrg    esac
9735862f5301Smrgfi
9736862f5301Smrgif test x$FILE_MAN_DIR = x    ; then
9737862f5301Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9738862f5301Smrgfi
973944dda7b2Smrg
9740862f5301Smrgif test x$MISC_MAN_SUFFIX = x    ; then
9741862f5301Smrg    case $host_os in
9742862f5301Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9743862f5301Smrg	*)		MISC_MAN_SUFFIX=7  ;;
9744862f5301Smrg    esac
9745862f5301Smrgfi
9746862f5301Smrgif test x$MISC_MAN_DIR = x    ; then
9747862f5301Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9748862f5301Smrgfi
974944dda7b2Smrg
9750862f5301Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9751862f5301Smrg    case $host_os in
9752862f5301Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9753862f5301Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9754862f5301Smrg    esac
9755862f5301Smrgfi
9756862f5301Smrgif test x$DRIVER_MAN_DIR = x    ; then
9757862f5301Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9758862f5301Smrgfi
975944dda7b2Smrg
9760862f5301Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9761862f5301Smrg    case $host_os in
9762862f5301Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9763862f5301Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9764862f5301Smrg    esac
9765862f5301Smrgfi
9766862f5301Smrgif test x$ADMIN_MAN_DIR = x    ; then
9767862f5301Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9768862f5301Smrgfi
976944dda7b2Smrg
977044dda7b2Smrg
9771862f5301SmrgAC_SUBST([APP_MAN_SUFFIX])
9772862f5301SmrgAC_SUBST([LIB_MAN_SUFFIX])
9773862f5301SmrgAC_SUBST([FILE_MAN_SUFFIX])
9774862f5301SmrgAC_SUBST([MISC_MAN_SUFFIX])
9775862f5301SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9776862f5301SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9777862f5301SmrgAC_SUBST([APP_MAN_DIR])
9778862f5301SmrgAC_SUBST([LIB_MAN_DIR])
9779862f5301SmrgAC_SUBST([FILE_MAN_DIR])
9780862f5301SmrgAC_SUBST([MISC_MAN_DIR])
9781862f5301SmrgAC_SUBST([DRIVER_MAN_DIR])
9782862f5301SmrgAC_SUBST([ADMIN_MAN_DIR])
978344dda7b2Smrg
9784862f5301SmrgXORG_MAN_PAGE="X Version 11"
9785862f5301SmrgAC_SUBST([XORG_MAN_PAGE])
9786862f5301SmrgMAN_SUBSTS="\
9787862f5301Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9788862f5301Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9789862f5301Smrg	-e 's|__xservername__|Xorg|g' \
9790862f5301Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
9791862f5301Smrg	-e 's|__projectroot__|\$(prefix)|g' \
9792862f5301Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9793862f5301Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9794862f5301Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9795862f5301Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9796862f5301Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9797862f5301Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9798862f5301Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9799862f5301SmrgAC_SUBST([MAN_SUBSTS])
980044dda7b2Smrg
9801862f5301Smrg]) # XORG_MANPAGE_SECTIONS
9802ff559fabSmrg
9803862f5301Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9804862f5301Smrg# ------------------------
9805862f5301Smrg# Minimum version: 1.7.0
980644dda7b2Smrg#
9807862f5301Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9808862f5301Smrg# provided by xorg-sgml-doctools, if installed.
9809862f5301SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9810862f5301SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9811862f5301SmrgXORG_SGML_PATH=
9812862f5301SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9813862f5301Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9814862f5301Smrg    [m4_ifval([$1],[:],
9815862f5301Smrg        [if test x"$cross_compiling" != x"yes" ; then
9816862f5301Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9817862f5301Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9818862f5301Smrg         fi])
9819862f5301Smrg    ])
9820ff559fabSmrg
9821862f5301Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9822862f5301Smrg# the path and the name of the doc stylesheet
9823862f5301Smrgif test "x$XORG_SGML_PATH" != "x" ; then
9824862f5301Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
9825862f5301Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9826862f5301Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9827862f5301Smrgelse
9828862f5301Smrg   AC_MSG_RESULT([no])
9829862f5301Smrgfi
9830ff559fabSmrg
9831862f5301SmrgAC_SUBST(XORG_SGML_PATH)
9832862f5301SmrgAC_SUBST(STYLESHEET_SRCDIR)
9833862f5301SmrgAC_SUBST(XSL_STYLESHEET)
9834862f5301SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9835862f5301Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9836ff559fabSmrg
9837862f5301Smrg# XORG_CHECK_LINUXDOC
9838862f5301Smrg# -------------------
9839862f5301Smrg# Minimum version: 1.0.0
9840862f5301Smrg#
9841862f5301Smrg# Defines the variable MAKE_TEXT if the necessary tools and
9842862f5301Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9843862f5301Smrg# Whether or not the necessary tools and files are found can be checked
9844862f5301Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9845862f5301SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9846862f5301SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9847862f5301SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9848ff559fabSmrg
9849862f5301SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9850ff559fabSmrg
9851862f5301SmrgAC_MSG_CHECKING([whether to build documentation])
9852ff559fabSmrg
9853862f5301Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9854862f5301Smrg   BUILDDOC=yes
9855862f5301Smrgelse
9856862f5301Smrg   BUILDDOC=no
9857862f5301Smrgfi
9858ff559fabSmrg
9859862f5301SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9860ff559fabSmrg
9861862f5301SmrgAC_MSG_RESULT([$BUILDDOC])
9862ff559fabSmrg
9863862f5301SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9864ff559fabSmrg
9865862f5301Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9866862f5301Smrg   BUILDPDFDOC=yes
9867862f5301Smrgelse
9868862f5301Smrg   BUILDPDFDOC=no
9869862f5301Smrgfi
9870ff559fabSmrg
9871862f5301SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9872ff559fabSmrg
9873862f5301SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9874ff559fabSmrg
9875862f5301SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9876862f5301SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9877862f5301SmrgMAKE_PDF="$PS2PDF"
9878862f5301SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9879ff559fabSmrg
9880862f5301SmrgAC_SUBST(MAKE_TEXT)
9881862f5301SmrgAC_SUBST(MAKE_PS)
9882862f5301SmrgAC_SUBST(MAKE_PDF)
9883862f5301SmrgAC_SUBST(MAKE_HTML)
9884862f5301Smrg]) # XORG_CHECK_LINUXDOC
9885ff559fabSmrg
9886862f5301Smrg# XORG_CHECK_DOCBOOK
9887862f5301Smrg# -------------------
9888862f5301Smrg# Minimum version: 1.0.0
9889862f5301Smrg#
9890862f5301Smrg# Checks for the ability to build output formats from SGML DocBook source.
9891862f5301Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9892862f5301Smrg# indicates whether the necessary tools and files are found and, if set,
9893862f5301Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9894862f5301SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9895862f5301SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9896ff559fabSmrg
9897862f5301SmrgBUILDTXTDOC=no
9898862f5301SmrgBUILDPDFDOC=no
9899862f5301SmrgBUILDPSDOC=no
9900862f5301SmrgBUILDHTMLDOC=no
9901ff559fabSmrg
9902862f5301SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9903862f5301SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9904862f5301SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9905862f5301SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
990644dda7b2Smrg
9907862f5301SmrgAC_MSG_CHECKING([whether to build text documentation])
9908862f5301Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9909862f5301Smrg   test x$BUILD_TXTDOC != xno; then
9910862f5301Smrg	BUILDTXTDOC=yes
9911862f5301Smrgfi
9912862f5301SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9913862f5301SmrgAC_MSG_RESULT([$BUILDTXTDOC])
991444dda7b2Smrg
9915862f5301SmrgAC_MSG_CHECKING([whether to build PDF documentation])
9916862f5301Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9917862f5301Smrg   test x$BUILD_PDFDOC != xno; then
9918862f5301Smrg	BUILDPDFDOC=yes
9919862f5301Smrgfi
9920862f5301SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9921862f5301SmrgAC_MSG_RESULT([$BUILDPDFDOC])
99227a3b38f7Smrg
9923862f5301SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9924862f5301Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9925862f5301Smrg   test x$BUILD_PSDOC != xno; then
9926862f5301Smrg	BUILDPSDOC=yes
9927862f5301Smrgfi
9928862f5301SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9929862f5301SmrgAC_MSG_RESULT([$BUILDPSDOC])
99307a3b38f7Smrg
9931862f5301SmrgAC_MSG_CHECKING([whether to build HTML documentation])
9932862f5301Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9933862f5301Smrg   test x$BUILD_HTMLDOC != xno; then
9934862f5301Smrg	BUILDHTMLDOC=yes
9935862f5301Smrgfi
9936862f5301SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9937862f5301SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9938ff559fabSmrg
9939862f5301SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9940862f5301SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9941862f5301SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9942862f5301SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9943ff559fabSmrg
9944862f5301SmrgAC_SUBST(MAKE_TEXT)
9945862f5301SmrgAC_SUBST(MAKE_PS)
9946862f5301SmrgAC_SUBST(MAKE_PDF)
9947862f5301SmrgAC_SUBST(MAKE_HTML)
9948862f5301Smrg]) # XORG_CHECK_DOCBOOK
9949ff559fabSmrg
9950862f5301Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9951862f5301Smrg# ----------------
9952862f5301Smrg# Minimum version: 1.5.0
9953862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9954862f5301Smrg#
9955862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
9956862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
9957862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9958862f5301Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9959862f5301Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9960862f5301Smrg# --with-xmlto assumes 'auto'.
9961862f5301Smrg#
9962862f5301Smrg# Interface to module:
9963862f5301Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9964862f5301Smrg# XMLTO:	returns the path of the xmlto program found
9965862f5301Smrg#		returns the path set by the user in the environment
9966862f5301Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9967862f5301Smrg#		'no' user instructs the module not to use xmlto
9968862f5301Smrg#
9969862f5301Smrg# Added in version 1.10.0
9970862f5301Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9971862f5301Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9972862f5301Smrg#
9973862f5301Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9974862f5301Smrg#
9975862f5301SmrgAC_DEFUN([XORG_WITH_XMLTO],[
9976862f5301SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9977862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
9978862f5301SmrgAC_ARG_WITH(xmlto,
9979862f5301Smrg	AS_HELP_STRING([--with-xmlto],
9980862f5301Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9981862f5301Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9982862f5301Smrgm4_undefine([_defopt])
9983ff559fabSmrg
9984862f5301Smrgif test "x$use_xmlto" = x"auto"; then
9985862f5301Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9986862f5301Smrg   if test "x$XMLTO" = "x"; then
9987862f5301Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9988862f5301Smrg	have_xmlto=no
9989862f5301Smrg   else
9990862f5301Smrg        have_xmlto=yes
9991862f5301Smrg   fi
9992862f5301Smrgelif test "x$use_xmlto" = x"yes" ; then
9993862f5301Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9994862f5301Smrg   if test "x$XMLTO" = "x"; then
9995862f5301Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9996862f5301Smrg   fi
9997862f5301Smrg   have_xmlto=yes
9998862f5301Smrgelif test "x$use_xmlto" = x"no" ; then
9999862f5301Smrg   if test "x$XMLTO" != "x"; then
10000862f5301Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10001862f5301Smrg   fi
10002862f5301Smrg   have_xmlto=no
10003862f5301Smrgelse
10004862f5301Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10005862f5301Smrgfi
10006ff559fabSmrg
10007862f5301Smrg# Test for a minimum version of xmlto, if provided.
10008862f5301Smrgm4_ifval([$1],
10009862f5301Smrg[if test "$have_xmlto" = yes; then
10010862f5301Smrg    # scrape the xmlto version
10011862f5301Smrg    AC_MSG_CHECKING([the xmlto version])
10012862f5301Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10013862f5301Smrg    AC_MSG_RESULT([$xmlto_version])
10014862f5301Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
10015862f5301Smrg        [if test "x$use_xmlto" = xauto; then
10016862f5301Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10017862f5301Smrg            have_xmlto=no
10018862f5301Smrg        else
10019862f5301Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10020862f5301Smrg        fi])
10021862f5301Smrgfi])
10022ff559fabSmrg
10023862f5301Smrg# Test for the ability of xmlto to generate a text target
10024862f5301Smrghave_xmlto_text=no
10025862f5301Smrgcat > conftest.xml << "EOF"
10026862f5301SmrgEOF
10027862f5301SmrgAS_IF([test "$have_xmlto" = yes],
10028862f5301Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10029862f5301Smrg             [have_xmlto_text=yes],
10030862f5301Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10031862f5301Smrgrm -f conftest.xml
10032862f5301SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10033862f5301SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10034862f5301Smrg]) # XORG_WITH_XMLTO
10035ff559fabSmrg
10036862f5301Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10037862f5301Smrg# --------------------------------------------
10038862f5301Smrg# Minimum version: 1.12.0
10039862f5301Smrg# Minimum version for optional DEFAULT argument: 1.12.0
10040862f5301Smrg#
10041862f5301Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10042862f5301Smrg# XML-based language used for the transformation of XML documents.
10043862f5301Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10044862f5301Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
10045862f5301Smrg# The XSLT processor is often used as a standalone tool for transformations.
10046862f5301Smrg# It should not be assumed that this tool is used only to work with documnetation.
10047862f5301Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10048862f5301Smrg#
10049862f5301Smrg# Interface to module:
10050862f5301Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10051862f5301Smrg# XSLTPROC:	 returns the path of the xsltproc program found
10052862f5301Smrg#		 returns the path set by the user in the environment
10053862f5301Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10054862f5301Smrg#		  'no' user instructs the module not to use xsltproc
10055862f5301Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
10056862f5301Smrg#
10057862f5301Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10058862f5301Smrg#
10059862f5301SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
10060862f5301SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10061862f5301Smrg# Preserves the interface, should it be implemented later
10062862f5301Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10063862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
10064862f5301SmrgAC_ARG_WITH(xsltproc,
10065862f5301Smrg	AS_HELP_STRING([--with-xsltproc],
10066862f5301Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10067862f5301Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10068862f5301Smrgm4_undefine([_defopt])
10069ff559fabSmrg
10070862f5301Smrgif test "x$use_xsltproc" = x"auto"; then
10071862f5301Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10072862f5301Smrg   if test "x$XSLTPROC" = "x"; then
10073862f5301Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10074862f5301Smrg	have_xsltproc=no
10075862f5301Smrg   else
10076862f5301Smrg        have_xsltproc=yes
10077862f5301Smrg   fi
10078862f5301Smrgelif test "x$use_xsltproc" = x"yes" ; then
10079862f5301Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10080862f5301Smrg   if test "x$XSLTPROC" = "x"; then
10081862f5301Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10082862f5301Smrg   fi
10083862f5301Smrg   have_xsltproc=yes
10084862f5301Smrgelif test "x$use_xsltproc" = x"no" ; then
10085862f5301Smrg   if test "x$XSLTPROC" != "x"; then
10086862f5301Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10087862f5301Smrg   fi
10088862f5301Smrg   have_xsltproc=no
10089862f5301Smrgelse
10090862f5301Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10091862f5301Smrgfi
10092ff559fabSmrg
10093862f5301SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10094862f5301Smrg]) # XORG_WITH_XSLTPROC
10095ff559fabSmrg
10096862f5301Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10097862f5301Smrg# ----------------------------------------
10098862f5301Smrg# Minimum version: 1.15.0
10099862f5301Smrg#
10100862f5301Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
10101862f5301Smrg# scanning arbitrary text files, extracting information from those text files,
10102862f5301Smrg# and printing reports based on that information.
10103862f5301Smrg#
10104862f5301Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
10105862f5301Smrg#
10106862f5301Smrg# Interface to module:
10107862f5301Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
10108862f5301Smrg# PERL:	     returns the path of the perl program found
10109862f5301Smrg#	     returns the path set by the user in the environment
10110862f5301Smrg# --with-perl: 'yes' user instructs the module to use perl
10111862f5301Smrg#	       'no' user instructs the module not to use perl
10112862f5301Smrg# have_perl: returns yes if perl found in PATH or no
10113862f5301Smrg#
10114862f5301Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10115862f5301Smrg#
10116862f5301SmrgAC_DEFUN([XORG_WITH_PERL],[
10117862f5301SmrgAC_ARG_VAR([PERL], [Path to perl command])
10118862f5301Smrg# Preserves the interface, should it be implemented later
10119862f5301Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10120862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
10121862f5301SmrgAC_ARG_WITH(perl,
10122862f5301Smrg	AS_HELP_STRING([--with-perl],
10123862f5301Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
10124862f5301Smrg	   [use_perl=$withval], [use_perl=]_defopt)
10125862f5301Smrgm4_undefine([_defopt])
1012644dda7b2Smrg
10127862f5301Smrgif test "x$use_perl" = x"auto"; then
10128862f5301Smrg   AC_PATH_PROG([PERL], [perl])
10129862f5301Smrg   if test "x$PERL" = "x"; then
10130862f5301Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
10131862f5301Smrg	have_perl=no
10132862f5301Smrg   else
10133862f5301Smrg        have_perl=yes
10134862f5301Smrg   fi
10135862f5301Smrgelif test "x$use_perl" = x"yes" ; then
10136862f5301Smrg   AC_PATH_PROG([PERL], [perl])
10137862f5301Smrg   if test "x$PERL" = "x"; then
10138862f5301Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10139862f5301Smrg   fi
10140862f5301Smrg   have_perl=yes
10141862f5301Smrgelif test "x$use_perl" = x"no" ; then
10142862f5301Smrg   if test "x$PERL" != "x"; then
10143862f5301Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10144862f5301Smrg   fi
10145862f5301Smrg   have_perl=no
10146862f5301Smrgelse
10147862f5301Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10148862f5301Smrgfi
1014944dda7b2Smrg
10150862f5301SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10151862f5301Smrg]) # XORG_WITH_PERL
1015244dda7b2Smrg
10153862f5301Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10154862f5301Smrg# ----------------
10155862f5301Smrg# Minimum version: 1.5.0
10156862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10157862f5301Smrg#
10158862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10159862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
10160862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10161862f5301Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10162862f5301Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10163862f5301Smrg# --with-asciidoc assumes 'auto'.
10164862f5301Smrg#
10165862f5301Smrg# Interface to module:
10166862f5301Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10167862f5301Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
10168862f5301Smrg#		 returns the path set by the user in the environment
10169862f5301Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10170862f5301Smrg#		  'no' user instructs the module not to use asciidoc
10171862f5301Smrg#
10172862f5301Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10173862f5301Smrg#
10174862f5301SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
10175862f5301SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10176862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
10177862f5301SmrgAC_ARG_WITH(asciidoc,
10178862f5301Smrg	AS_HELP_STRING([--with-asciidoc],
10179862f5301Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10180862f5301Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10181862f5301Smrgm4_undefine([_defopt])
10182ff559fabSmrg
10183862f5301Smrgif test "x$use_asciidoc" = x"auto"; then
10184862f5301Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10185862f5301Smrg   if test "x$ASCIIDOC" = "x"; then
10186862f5301Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10187862f5301Smrg	have_asciidoc=no
10188862f5301Smrg   else
10189862f5301Smrg        have_asciidoc=yes
10190862f5301Smrg   fi
10191862f5301Smrgelif test "x$use_asciidoc" = x"yes" ; then
10192862f5301Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10193862f5301Smrg   if test "x$ASCIIDOC" = "x"; then
10194862f5301Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10195862f5301Smrg   fi
10196862f5301Smrg   have_asciidoc=yes
10197862f5301Smrgelif test "x$use_asciidoc" = x"no" ; then
10198862f5301Smrg   if test "x$ASCIIDOC" != "x"; then
10199862f5301Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10200862f5301Smrg   fi
10201862f5301Smrg   have_asciidoc=no
10202862f5301Smrgelse
10203862f5301Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10204862f5301Smrgfi
10205862f5301Smrgm4_ifval([$1],
10206862f5301Smrg[if test "$have_asciidoc" = yes; then
10207862f5301Smrg    # scrape the asciidoc version
10208862f5301Smrg    AC_MSG_CHECKING([the asciidoc version])
10209862f5301Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10210862f5301Smrg    AC_MSG_RESULT([$asciidoc_version])
10211862f5301Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10212862f5301Smrg        [if test "x$use_asciidoc" = xauto; then
10213862f5301Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10214862f5301Smrg            have_asciidoc=no
10215862f5301Smrg        else
10216862f5301Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10217862f5301Smrg        fi])
10218862f5301Smrgfi])
10219862f5301SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10220862f5301Smrg]) # XORG_WITH_ASCIIDOC
10221ff559fabSmrg
10222862f5301Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10223862f5301Smrg# --------------------------------
10224862f5301Smrg# Minimum version: 1.5.0
10225862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10226862f5301Smrg#
10227862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10228862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
10229862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10230862f5301Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
10231862f5301Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
10232862f5301Smrg# --with-doxygen assumes 'auto'.
10233862f5301Smrg#
10234862f5301Smrg# Interface to module:
10235862f5301Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10236862f5301Smrg# DOXYGEN:	 returns the path of the doxygen program found
10237862f5301Smrg#		 returns the path set by the user in the environment
10238862f5301Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
10239862f5301Smrg#		  'no' user instructs the module not to use doxygen
10240862f5301Smrg#
10241862f5301Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10242862f5301Smrg#
10243862f5301SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
10244862f5301SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10245862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
10246862f5301SmrgAC_ARG_WITH(doxygen,
10247862f5301Smrg	AS_HELP_STRING([--with-doxygen],
10248862f5301Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10249862f5301Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10250862f5301Smrgm4_undefine([_defopt])
10251ff559fabSmrg
10252862f5301Smrgif test "x$use_doxygen" = x"auto"; then
10253862f5301Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10254862f5301Smrg   if test "x$DOXYGEN" = "x"; then
10255862f5301Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10256862f5301Smrg	have_doxygen=no
10257862f5301Smrg   else
10258862f5301Smrg        have_doxygen=yes
10259862f5301Smrg   fi
10260862f5301Smrgelif test "x$use_doxygen" = x"yes" ; then
10261862f5301Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10262862f5301Smrg   if test "x$DOXYGEN" = "x"; then
10263862f5301Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10264862f5301Smrg   fi
10265862f5301Smrg   have_doxygen=yes
10266862f5301Smrgelif test "x$use_doxygen" = x"no" ; then
10267862f5301Smrg   if test "x$DOXYGEN" != "x"; then
10268862f5301Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10269862f5301Smrg   fi
10270862f5301Smrg   have_doxygen=no
10271862f5301Smrgelse
10272862f5301Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10273862f5301Smrgfi
10274862f5301Smrgm4_ifval([$1],
10275862f5301Smrg[if test "$have_doxygen" = yes; then
10276862f5301Smrg    # scrape the doxygen version
10277862f5301Smrg    AC_MSG_CHECKING([the doxygen version])
10278862f5301Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10279862f5301Smrg    AC_MSG_RESULT([$doxygen_version])
10280862f5301Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
10281862f5301Smrg        [if test "x$use_doxygen" = xauto; then
10282862f5301Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10283862f5301Smrg            have_doxygen=no
10284862f5301Smrg        else
10285862f5301Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10286862f5301Smrg        fi])
10287862f5301Smrgfi])
10288862f5301SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10289862f5301Smrg]) # XORG_WITH_DOXYGEN
102907a3b38f7Smrg
10291862f5301Smrg# XORG_WITH_GROFF([DEFAULT])
10292862f5301Smrg# ----------------
10293862f5301Smrg# Minimum version: 1.6.0
10294862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10295862f5301Smrg#
10296862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10297862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
10298862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10299862f5301Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
10300862f5301Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
10301862f5301Smrg# --with-groff assumes 'auto'.
10302862f5301Smrg#
10303862f5301Smrg# Interface to module:
10304862f5301Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10305862f5301Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10306862f5301Smrg# HAVE_GROFF_MS: the -ms macros package
10307862f5301Smrg# GROFF:	 returns the path of the groff program found
10308862f5301Smrg#		 returns the path set by the user in the environment
10309862f5301Smrg# --with-groff:	 'yes' user instructs the module to use groff
10310862f5301Smrg#		 'no' user instructs the module not to use groff
10311862f5301Smrg#
10312862f5301Smrg# Added in version 1.9.0:
10313862f5301Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10314862f5301Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10315862f5301Smrg#		   psselect from the psutils package.
10316862f5301Smrg#		   the ghostcript package. Refer to the grohtml man pages
10317862f5301Smrg#
10318862f5301Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10319862f5301Smrg#
10320862f5301Smrg# OS and distros often splits groff in a basic and full package, the former
10321862f5301Smrg# having the groff program and the later having devices, fonts and macros
10322862f5301Smrg# Checking for the groff executable is not enough.
10323862f5301Smrg#
10324862f5301Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
10325862f5301Smrg# unset HAVE_GROFF or GROFF env variables.
10326862f5301Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10327862f5301Smrg#
10328862f5301SmrgAC_DEFUN([XORG_WITH_GROFF],[
10329862f5301SmrgAC_ARG_VAR([GROFF], [Path to groff command])
10330862f5301Smrgm4_define([_defopt], m4_default([$1], [auto]))
10331862f5301SmrgAC_ARG_WITH(groff,
10332862f5301Smrg	AS_HELP_STRING([--with-groff],
10333862f5301Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10334862f5301Smrg	   [use_groff=$withval], [use_groff=]_defopt)
10335862f5301Smrgm4_undefine([_defopt])
103367a3b38f7Smrg
10337862f5301Smrgif test "x$use_groff" = x"auto"; then
10338862f5301Smrg   AC_PATH_PROG([GROFF], [groff])
10339862f5301Smrg   if test "x$GROFF" = "x"; then
10340862f5301Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10341862f5301Smrg	have_groff=no
10342862f5301Smrg   else
10343862f5301Smrg        have_groff=yes
10344862f5301Smrg   fi
10345862f5301Smrgelif test "x$use_groff" = x"yes" ; then
10346862f5301Smrg   AC_PATH_PROG([GROFF], [groff])
10347862f5301Smrg   if test "x$GROFF" = "x"; then
10348862f5301Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10349862f5301Smrg   fi
10350862f5301Smrg   have_groff=yes
10351862f5301Smrgelif test "x$use_groff" = x"no" ; then
10352862f5301Smrg   if test "x$GROFF" != "x"; then
10353862f5301Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10354862f5301Smrg   fi
10355862f5301Smrg   have_groff=no
10356862f5301Smrgelse
10357862f5301Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10358862f5301Smrgfi
103597a3b38f7Smrg
10360862f5301Smrg# We have groff, test for the presence of the macro packages
10361862f5301Smrgif test "x$have_groff" = x"yes"; then
10362862f5301Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10363862f5301Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10364862f5301Smrg        groff_ms_works=yes
10365862f5301Smrg    else
10366862f5301Smrg        groff_ms_works=no
10367862f5301Smrg    fi
10368862f5301Smrg    AC_MSG_RESULT([$groff_ms_works])
10369862f5301Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10370862f5301Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10371862f5301Smrg        groff_mm_works=yes
10372862f5301Smrg    else
10373862f5301Smrg        groff_mm_works=no
10374862f5301Smrg    fi
10375862f5301Smrg    AC_MSG_RESULT([$groff_mm_works])
10376862f5301Smrgfi
10377ff559fabSmrg
10378862f5301Smrg# We have groff, test for HTML dependencies, one command per package
10379862f5301Smrgif test "x$have_groff" = x"yes"; then
10380862f5301Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10381862f5301Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10382862f5301Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10383862f5301Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10384862f5301Smrg      have_groff_html=yes
10385862f5301Smrg   else
10386862f5301Smrg      have_groff_html=no
10387862f5301Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10388862f5301Smrg   fi
10389862f5301Smrgfi
10390ff559fabSmrg
10391862f5301Smrg# Set Automake conditionals for Makefiles
10392862f5301SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10393862f5301SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10394862f5301SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10395862f5301SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10396862f5301Smrg]) # XORG_WITH_GROFF
10397ff559fabSmrg
10398862f5301Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10399862f5301Smrg# ---------------------------------------
10400862f5301Smrg# Minimum version: 1.6.0
10401862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10402862f5301Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10403862f5301Smrg#
10404862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10405862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
10406862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10407862f5301Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
10408862f5301Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
10409862f5301Smrg# --with-fop assumes 'auto'.
10410862f5301Smrg#
10411862f5301Smrg# Interface to module:
10412862f5301Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10413862f5301Smrg# FOP:	 	returns the path of the fop program found
10414862f5301Smrg#		returns the path set by the user in the environment
10415862f5301Smrg# --with-fop: 	'yes' user instructs the module to use fop
10416862f5301Smrg#		'no' user instructs the module not to use fop
10417862f5301Smrg#
10418862f5301Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10419862f5301Smrg#
10420862f5301SmrgAC_DEFUN([XORG_WITH_FOP],[
10421862f5301SmrgAC_ARG_VAR([FOP], [Path to fop command])
10422862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
10423862f5301SmrgAC_ARG_WITH(fop,
10424862f5301Smrg	AS_HELP_STRING([--with-fop],
10425862f5301Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10426862f5301Smrg	   [use_fop=$withval], [use_fop=]_defopt)
10427862f5301Smrgm4_undefine([_defopt])
10428ff559fabSmrg
10429862f5301Smrgif test "x$use_fop" = x"auto"; then
10430862f5301Smrg   AC_PATH_PROG([FOP], [fop])
10431862f5301Smrg   if test "x$FOP" = "x"; then
10432862f5301Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10433862f5301Smrg	have_fop=no
10434862f5301Smrg   else
10435862f5301Smrg        have_fop=yes
10436862f5301Smrg   fi
10437862f5301Smrgelif test "x$use_fop" = x"yes" ; then
10438862f5301Smrg   AC_PATH_PROG([FOP], [fop])
10439862f5301Smrg   if test "x$FOP" = "x"; then
10440862f5301Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10441862f5301Smrg   fi
10442862f5301Smrg   have_fop=yes
10443862f5301Smrgelif test "x$use_fop" = x"no" ; then
10444862f5301Smrg   if test "x$FOP" != "x"; then
10445862f5301Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10446862f5301Smrg   fi
10447862f5301Smrg   have_fop=no
10448862f5301Smrgelse
10449862f5301Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10450862f5301Smrgfi
10451ff559fabSmrg
10452862f5301Smrg# Test for a minimum version of fop, if provided.
10453862f5301Smrgm4_ifval([$1],
10454862f5301Smrg[if test "$have_fop" = yes; then
10455862f5301Smrg    # scrape the fop version
10456862f5301Smrg    AC_MSG_CHECKING([for fop minimum version])
10457862f5301Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10458862f5301Smrg    AC_MSG_RESULT([$fop_version])
10459862f5301Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
10460862f5301Smrg        [if test "x$use_fop" = xauto; then
10461862f5301Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10462862f5301Smrg            have_fop=no
10463862f5301Smrg        else
10464862f5301Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10465862f5301Smrg        fi])
10466862f5301Smrgfi])
10467862f5301SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10468862f5301Smrg]) # XORG_WITH_FOP
10469ff559fabSmrg
10470862f5301Smrg# XORG_WITH_PS2PDF([DEFAULT])
10471862f5301Smrg# ----------------
10472862f5301Smrg# Minimum version: 1.6.0
10473862f5301Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10474862f5301Smrg#
10475862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10476862f5301Smrg# not at the appropriate level. This macro enables a module to test for the
10477862f5301Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10478862f5301Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10479862f5301Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10480862f5301Smrg# --with-ps2pdf assumes 'auto'.
10481862f5301Smrg#
10482862f5301Smrg# Interface to module:
10483862f5301Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10484862f5301Smrg# PS2PDF:	returns the path of the ps2pdf program found
10485862f5301Smrg#		returns the path set by the user in the environment
10486862f5301Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10487862f5301Smrg#		 'no' user instructs the module not to use ps2pdf
10488862f5301Smrg#
10489862f5301Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10490862f5301Smrg#
10491862f5301SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10492862f5301SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10493862f5301Smrgm4_define([_defopt], m4_default([$1], [auto]))
10494862f5301SmrgAC_ARG_WITH(ps2pdf,
10495862f5301Smrg	AS_HELP_STRING([--with-ps2pdf],
10496862f5301Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10497862f5301Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10498862f5301Smrgm4_undefine([_defopt])
10499ff559fabSmrg
10500862f5301Smrgif test "x$use_ps2pdf" = x"auto"; then
10501862f5301Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10502862f5301Smrg   if test "x$PS2PDF" = "x"; then
10503862f5301Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10504862f5301Smrg	have_ps2pdf=no
10505862f5301Smrg   else
10506862f5301Smrg        have_ps2pdf=yes
10507862f5301Smrg   fi
10508862f5301Smrgelif test "x$use_ps2pdf" = x"yes" ; then
10509862f5301Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10510862f5301Smrg   if test "x$PS2PDF" = "x"; then
10511862f5301Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10512862f5301Smrg   fi
10513862f5301Smrg   have_ps2pdf=yes
10514862f5301Smrgelif test "x$use_ps2pdf" = x"no" ; then
10515862f5301Smrg   if test "x$PS2PDF" != "x"; then
10516862f5301Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10517862f5301Smrg   fi
10518862f5301Smrg   have_ps2pdf=no
10519862f5301Smrgelse
10520862f5301Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10521862f5301Smrgfi
10522862f5301SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10523862f5301Smrg]) # XORG_WITH_PS2PDF
10524ff559fabSmrg
10525862f5301Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
10526862f5301Smrg# ----------------
10527862f5301Smrg# Minimum version: 1.6.0
10528862f5301Smrg#
10529862f5301Smrg# Documentation tools are not always available on all platforms and sometimes
10530862f5301Smrg# not at the appropriate level. This macro enables a builder to skip all
10531862f5301Smrg# documentation targets except traditional man pages.
10532862f5301Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10533862f5301Smrg# maximum flexibilty in controlling documentation building.
10534862f5301Smrg# Refer to:
10535862f5301Smrg# XORG_WITH_XMLTO         --with-xmlto
10536862f5301Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10537862f5301Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10538862f5301Smrg# XORG_WITH_FOP           --with-fop
10539862f5301Smrg# XORG_WITH_GROFF         --with-groff
10540862f5301Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10541862f5301Smrg#
10542862f5301Smrg# Interface to module:
10543862f5301Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10544862f5301Smrg# --enable-docs: 'yes' user instructs the module to generate docs
10545862f5301Smrg#		 'no' user instructs the module not to generate docs
10546862f5301Smrg# parm1:	specify the default value, yes or no.
10547862f5301Smrg#
10548862f5301SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10549862f5301Smrgm4_define([docs_default], m4_default([$1], [yes]))
10550862f5301SmrgAC_ARG_ENABLE(docs,
10551862f5301Smrg	AS_HELP_STRING([--enable-docs],
10552862f5301Smrg	   [Enable building the documentation (default: ]docs_default[)]),
10553862f5301Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
10554862f5301Smrgm4_undefine([docs_default])
10555862f5301SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10556862f5301SmrgAC_MSG_CHECKING([whether to build documentation])
10557862f5301SmrgAC_MSG_RESULT([$build_docs])
10558862f5301Smrg]) # XORG_ENABLE_DOCS
10559ff559fabSmrg
10560862f5301Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10561862f5301Smrg# ----------------
10562862f5301Smrg# Minimum version: 1.6.0
10563862f5301Smrg#
10564862f5301Smrg# This macro enables a builder to skip all developer documentation.
10565862f5301Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10566862f5301Smrg# maximum flexibilty in controlling documentation building.
10567862f5301Smrg# Refer to:
10568862f5301Smrg# XORG_WITH_XMLTO         --with-xmlto
10569862f5301Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10570862f5301Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10571862f5301Smrg# XORG_WITH_FOP           --with-fop
10572862f5301Smrg# XORG_WITH_GROFF         --with-groff
10573862f5301Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10574862f5301Smrg#
10575862f5301Smrg# Interface to module:
10576862f5301Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10577862f5301Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10578862f5301Smrg#			'no' user instructs the module not to generate developer docs
10579862f5301Smrg# parm1:		specify the default value, yes or no.
10580862f5301Smrg#
10581862f5301SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10582862f5301Smrgm4_define([devel_default], m4_default([$1], [yes]))
10583862f5301SmrgAC_ARG_ENABLE(devel-docs,
10584862f5301Smrg	AS_HELP_STRING([--enable-devel-docs],
10585862f5301Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10586862f5301Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10587862f5301Smrgm4_undefine([devel_default])
10588862f5301SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10589862f5301SmrgAC_MSG_CHECKING([whether to build developer documentation])
10590862f5301SmrgAC_MSG_RESULT([$build_devel_docs])
10591862f5301Smrg]) # XORG_ENABLE_DEVEL_DOCS
1059244dda7b2Smrg
10593862f5301Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
10594862f5301Smrg# ----------------
10595862f5301Smrg# Minimum version: 1.6.0
10596862f5301Smrg#
10597862f5301Smrg# This macro enables a builder to skip all functional specification targets.
10598862f5301Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10599862f5301Smrg# maximum flexibilty in controlling documentation building.
10600862f5301Smrg# Refer to:
10601862f5301Smrg# XORG_WITH_XMLTO         --with-xmlto
10602862f5301Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10603862f5301Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10604862f5301Smrg# XORG_WITH_FOP           --with-fop
10605862f5301Smrg# XORG_WITH_GROFF         --with-groff
10606862f5301Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10607862f5301Smrg#
10608862f5301Smrg# Interface to module:
10609862f5301Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10610862f5301Smrg# --enable-specs:	'yes' user instructs the module to generate specs
10611862f5301Smrg#			'no' user instructs the module not to generate specs
10612862f5301Smrg# parm1:		specify the default value, yes or no.
10613862f5301Smrg#
10614862f5301SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10615862f5301Smrgm4_define([spec_default], m4_default([$1], [yes]))
10616862f5301SmrgAC_ARG_ENABLE(specs,
10617862f5301Smrg	AS_HELP_STRING([--enable-specs],
10618862f5301Smrg	   [Enable building the specs (default: ]spec_default[)]),
10619862f5301Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
10620862f5301Smrgm4_undefine([spec_default])
10621862f5301SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10622862f5301SmrgAC_MSG_CHECKING([whether to build functional specifications])
10623862f5301SmrgAC_MSG_RESULT([$build_specs])
10624862f5301Smrg]) # XORG_ENABLE_SPECS
106257a3b38f7Smrg
10626862f5301Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10627862f5301Smrg# ----------------------------------------------
10628862f5301Smrg# Minimum version: 1.13.0
10629862f5301Smrg#
10630862f5301Smrg# This macro enables a builder to enable/disable unit testing
10631862f5301Smrg# It makes no assumption about the test cases implementation
10632862f5301Smrg# Test cases may or may not use Automake "Support for test suites"
10633862f5301Smrg# They may or may not use the software utility library GLib
10634862f5301Smrg#
10635862f5301Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10636862f5301Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10637862f5301Smrg# The variable enable_unit_tests is used by other macros in this file.
10638862f5301Smrg#
10639862f5301Smrg# Interface to module:
10640862f5301Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10641862f5301Smrg# enable_unit_tests:    used in configure.ac for additional configuration
10642862f5301Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10643862f5301Smrg#			'no' user instructs the module not to build tests
10644862f5301Smrg# parm1:		specify the default value, yes or no.
10645862f5301Smrg#
10646862f5301SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10647862f5301SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10648862f5301SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10649862f5301SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10650862f5301Smrgm4_define([_defopt], m4_default([$1], [auto]))
10651862f5301SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10652862f5301Smrg	[Enable building unit test cases (default: ]_defopt[)]),
10653862f5301Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10654862f5301Smrgm4_undefine([_defopt])
10655862f5301SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10656862f5301SmrgAC_MSG_CHECKING([whether to build unit test cases])
10657862f5301SmrgAC_MSG_RESULT([$enable_unit_tests])
10658862f5301Smrg]) # XORG_ENABLE_UNIT_TESTS
106597a3b38f7Smrg
10660862f5301Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10661862f5301Smrg# ----------------------------------------
10662862f5301Smrg# Minimum version: 1.13.0
10663862f5301Smrg#
10664862f5301Smrg# GLib is a library which provides advanced data structures and functions.
10665862f5301Smrg# This macro enables a module to test for the presence of Glib.
10666862f5301Smrg#
10667862f5301Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10668862f5301Smrg# Otherwise the value of $enable_unit_tests is blank.
10669862f5301Smrg#
10670862f5301Smrg# Interface to module:
10671862f5301Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
10672862f5301Smrg# with_glib: used in configure.ac to know if GLib has been found
10673862f5301Smrg# --with-glib:	'yes' user instructs the module to use glib
10674862f5301Smrg#		'no' user instructs the module not to use glib
10675862f5301Smrg#
10676862f5301SmrgAC_DEFUN([XORG_WITH_GLIB],[
10677862f5301SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10678862f5301Smrgm4_define([_defopt], m4_default([$2], [auto]))
10679862f5301SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10680862f5301Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10681862f5301Smrg	[with_glib=$withval], [with_glib=]_defopt)
10682862f5301Smrgm4_undefine([_defopt])
10683ff559fabSmrg
10684862f5301Smrghave_glib=no
10685862f5301Smrg# Do not probe GLib if user explicitly disabled unit testing
10686862f5301Smrgif test "x$enable_unit_tests" != x"no"; then
10687862f5301Smrg  # Do not probe GLib if user explicitly disabled it
10688862f5301Smrg  if test "x$with_glib" != x"no"; then
10689862f5301Smrg    m4_ifval(
10690862f5301Smrg      [$1],
10691862f5301Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10692862f5301Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10693862f5301Smrg    )
10694862f5301Smrg  fi
10695862f5301Smrgfi
10696ff559fabSmrg
10697862f5301Smrg# Not having GLib when unit testing has been explicitly requested is an error
10698862f5301Smrgif test "x$enable_unit_tests" = x"yes"; then
10699862f5301Smrg  if test "x$have_glib" = x"no"; then
10700862f5301Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10701862f5301Smrg  fi
10702862f5301Smrgfi
10703ff559fabSmrg
10704862f5301Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
10705862f5301Smrgif test "x$enable_unit_tests" = x"no"; then
10706862f5301Smrg  if test "x$with_glib" = x"yes"; then
10707862f5301Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10708862f5301Smrg  fi
10709862f5301Smrgfi
10710ff559fabSmrg
10711862f5301Smrg# Not having GLib when it has been explicitly requested is an error
10712862f5301Smrgif test "x$with_glib" = x"yes"; then
10713862f5301Smrg  if test "x$have_glib" = x"no"; then
10714862f5301Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10715862f5301Smrg  fi
10716862f5301Smrgfi
10717ff559fabSmrg
10718862f5301SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10719862f5301Smrg]) # XORG_WITH_GLIB
10720ff559fabSmrg
10721862f5301Smrg# XORG_LD_WRAP([required|optional])
10722862f5301Smrg# ---------------------------------
10723862f5301Smrg# Minimum version: 1.13.0
10724862f5301Smrg#
10725862f5301Smrg# Check if linker supports -wrap, passed via compiler flags
10726862f5301Smrg#
10727862f5301Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10728862f5301Smrg# Otherwise the value of $enable_unit_tests is blank.
10729862f5301Smrg#
10730862f5301Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
10731862f5301Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10732862f5301Smrg# available, an argument of "optional" allows use when some unit tests require
10733862f5301Smrg# ld -wrap and others do not.
10734862f5301Smrg#
10735862f5301SmrgAC_DEFUN([XORG_LD_WRAP],[
10736862f5301SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10737862f5301Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
10738862f5301Smrg                      void __wrap_exit(int status) { return; }],
10739862f5301Smrg                     [exit(0);])])
10740862f5301Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
10741862f5301Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10742862f5301Smrg  if test "x$have_ld_wrap" = x"no"; then
10743862f5301Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10744862f5301Smrg  fi
10745862f5301Smrgfi
10746862f5301SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10747862f5301Smrg#
10748862f5301Smrg]) # XORG_LD_WRAP
10749ff559fabSmrg
10750862f5301Smrg# XORG_CHECK_LINKER_FLAGS
10751862f5301Smrg# -----------------------
10752862f5301Smrg# SYNOPSIS
10753862f5301Smrg#
10754862f5301Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10755862f5301Smrg#
10756862f5301Smrg# DESCRIPTION
10757862f5301Smrg#
10758862f5301Smrg#   Check whether the given linker FLAGS work with the current language's
10759862f5301Smrg#   linker, or whether they give an error.
10760862f5301Smrg#
10761862f5301Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10762862f5301Smrg#   success/failure.
10763862f5301Smrg#
10764862f5301Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
10765862f5301Smrg#
10766862f5301Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10767862f5301Smrg#
10768862f5301Smrg# LICENSE
10769862f5301Smrg#
10770862f5301Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10771862f5301Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10772862f5301Smrg#   Copyright (c) 2009 Matteo Frigo
10773862f5301Smrg#
10774862f5301Smrg#   This program is free software: you can redistribute it and/or modify it
10775862f5301Smrg#   under the terms of the GNU General Public License as published by the
10776862f5301Smrg#   Free Software Foundation, either version 3 of the License, or (at your
10777862f5301Smrg#   option) any later version.
10778862f5301Smrg#
10779862f5301Smrg#   This program is distributed in the hope that it will be useful, but
10780862f5301Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
10781862f5301Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10782862f5301Smrg#   Public License for more details.
10783862f5301Smrg#
10784862f5301Smrg#   You should have received a copy of the GNU General Public License along
10785862f5301Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
10786862f5301Smrg#
10787862f5301Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
10788862f5301Smrg#   gives unlimited permission to copy, distribute and modify the configure
10789862f5301Smrg#   scripts that are the output of Autoconf when processing the Macro. You
10790862f5301Smrg#   need not follow the terms of the GNU General Public License when using
10791862f5301Smrg#   or distributing such scripts, even though portions of the text of the
10792862f5301Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
10793862f5301Smrg#   all other use of the material that constitutes the Autoconf Macro.
10794862f5301Smrg#
10795862f5301Smrg#   This special exception to the GPL applies to versions of the Autoconf
10796862f5301Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
10797862f5301Smrg#   modified version of the Autoconf Macro, you may extend this special
10798862f5301Smrg#   exception to the GPL to apply to your modified version as well.#
10799862f5301SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10800862f5301Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
10801862f5301Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10802862f5301SmrgAS_LITERAL_IF([$1],
10803862f5301Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10804862f5301Smrg      ax_save_FLAGS=$LDFLAGS
10805862f5301Smrg      LDFLAGS="$1"
10806862f5301Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10807862f5301Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10808862f5301Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10809862f5301Smrg      LDFLAGS=$ax_save_FLAGS])],
10810862f5301Smrg  [ax_save_FLAGS=$LDFLAGS
10811862f5301Smrg   LDFLAGS="$1"
10812862f5301Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10813862f5301Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10814862f5301Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10815862f5301Smrg   LDFLAGS=$ax_save_FLAGS])
10816862f5301Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10817862f5301SmrgAC_MSG_RESULT($xorg_check_linker_flags)
10818862f5301Smrgif test "x$xorg_check_linker_flags" = xyes; then
10819862f5301Smrg	m4_default([$2], :)
10820862f5301Smrgelse
10821862f5301Smrg	m4_default([$3], :)
10822862f5301Smrgfi
10823862f5301Smrg]) # XORG_CHECK_LINKER_FLAGS
10824ff559fabSmrg
10825862f5301Smrg# XORG_MEMORY_CHECK_FLAGS
10826862f5301Smrg# -----------------------
10827862f5301Smrg# Minimum version: 1.16.0
10828862f5301Smrg#
10829862f5301Smrg# This macro attempts to find appropriate memory checking functionality
10830862f5301Smrg# for various platforms which unit testing code may use to catch various
10831862f5301Smrg# forms of memory allocation and access errors in testing.
10832862f5301Smrg#
10833862f5301Smrg# Interface to module:
10834862f5301Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10835862f5301Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10836862f5301Smrg#
10837862f5301Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10838862f5301Smrg#
10839862f5301SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10840ff559fabSmrg
10841862f5301SmrgAC_REQUIRE([AC_CANONICAL_HOST])
10842862f5301SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10843862f5301Smrg           [Environment variables to enable memory checking in tests])
10844ff559fabSmrg
10845862f5301Smrg# Check for different types of support on different platforms
10846862f5301Smrgcase $host_os in
10847862f5301Smrg    solaris*)
10848862f5301Smrg        AC_CHECK_LIB([umem], [umem_alloc],
10849862f5301Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10850862f5301Smrg        ;;
10851862f5301Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10852862f5301Smrg        # both directly and inverted, so should not be 0 or 255.
10853862f5301Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
10854862f5301Smrg        ;;
10855862f5301Smrg    darwin*)
10856862f5301Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10857862f5301Smrg        ;;
10858862f5301Smrg    *bsd*)
10859862f5301Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10860862f5301Smrg        ;;
10861862f5301Smrgesac
10862ff559fabSmrg
10863862f5301Smrg# User supplied flags override default flags
10864862f5301Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10865862f5301Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10866862f5301Smrgfi
10867ff559fabSmrg
10868862f5301SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10869862f5301Smrg]) # XORG_WITH_LINT
10870ff559fabSmrg
10871862f5301Smrg# XORG_CHECK_MALLOC_ZERO
10872862f5301Smrg# ----------------------
10873862f5301Smrg# Minimum version: 1.0.0
1087444dda7b2Smrg#
10875862f5301Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10876862f5301Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
10877862f5301Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10878862f5301SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10879862f5301SmrgAC_ARG_ENABLE(malloc0returnsnull,
10880862f5301Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
10881862f5301Smrg		       [malloc(0) returns NULL (default: auto)]),
10882862f5301Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10883862f5301Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
108847a3b38f7Smrg
10885862f5301SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
10886862f5301Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10887862f5301Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
10888862f5301Smrg#include <stdlib.h>
10889862f5301Smrg],[
10890862f5301Smrg    char *m0, *r0, *c0, *p;
10891862f5301Smrg    m0 = malloc(0);
10892862f5301Smrg    p = malloc(10);
10893862f5301Smrg    r0 = realloc(p,0);
10894862f5301Smrg    c0 = calloc(0,10);
10895862f5301Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10896862f5301Smrg])],
10897862f5301Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
10898862f5301Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
10899862f5301Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
10900862f5301Smrgfi
10901862f5301SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
109027a3b38f7Smrg
10903862f5301Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10904862f5301Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10905862f5301Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10906862f5301Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10907862f5301Smrgelse
10908862f5301Smrg	MALLOC_ZERO_CFLAGS=""
10909862f5301Smrg	XMALLOC_ZERO_CFLAGS=""
10910862f5301Smrg	XTMALLOC_ZERO_CFLAGS=""
10911862f5301Smrgfi
10912ff559fabSmrg
10913862f5301SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
10914862f5301SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
10915862f5301SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
10916862f5301Smrg]) # XORG_CHECK_MALLOC_ZERO
10917ff559fabSmrg
10918862f5301Smrg# XORG_WITH_LINT()
10919862f5301Smrg# ----------------
10920862f5301Smrg# Minimum version: 1.1.0
10921862f5301Smrg#
10922862f5301Smrg# This macro enables the use of a tool that flags some suspicious and
10923862f5301Smrg# non-portable constructs (likely to be bugs) in C language source code.
10924862f5301Smrg# It will attempt to locate the tool and use appropriate options.
10925862f5301Smrg# There are various lint type tools on different platforms.
10926862f5301Smrg#
10927862f5301Smrg# Interface to module:
10928862f5301Smrg# LINT:		returns the path to the tool found on the platform
10929862f5301Smrg#		or the value set to LINT on the configure cmd line
10930862f5301Smrg#		also an Automake conditional
10931862f5301Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
10932862f5301Smrg#
10933862f5301Smrg# --with-lint:	'yes' user instructs the module to use lint
10934862f5301Smrg#		'no' user instructs the module not to use lint (default)
10935862f5301Smrg#
10936862f5301Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10937862f5301Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10938862f5301Smrg#
10939862f5301SmrgAC_DEFUN([XORG_WITH_LINT],[
109407a3b38f7Smrg
10941862f5301SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10942862f5301SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10943862f5301SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10944862f5301Smrg		[Use a lint-style source code checker (default: disabled)])],
10945862f5301Smrg		[use_lint=$withval], [use_lint=no])
109467a3b38f7Smrg
10947862f5301Smrg# Obtain platform specific info like program name and options
10948862f5301Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10949862f5301Smrgcase $host_os in
10950862f5301Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10951862f5301Smrg	lint_name=splint
10952862f5301Smrg	lint_options="-badflag"
10953862f5301Smrg	;;
10954862f5301Smrg  *freebsd* | *netbsd*)
10955862f5301Smrg	lint_name=lint
10956862f5301Smrg	lint_options="-u -b"
10957862f5301Smrg	;;
10958862f5301Smrg  *solaris*)
10959862f5301Smrg	lint_name=lint
10960862f5301Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10961862f5301Smrg	;;
10962862f5301Smrgesac
109637a3b38f7Smrg
10964862f5301Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10965862f5301Smrgif test "x$use_lint" = x"yes" ; then
10966862f5301Smrg   AC_PATH_PROG([LINT], [$lint_name])
10967862f5301Smrg   if test "x$LINT" = "x"; then
10968862f5301Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10969862f5301Smrg   fi
10970862f5301Smrgelif test "x$use_lint" = x"no" ; then
10971862f5301Smrg   if test "x$LINT" != "x"; then
10972862f5301Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10973862f5301Smrg   fi
10974862f5301Smrgelse
10975862f5301Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10976862f5301Smrgfi
109777a3b38f7Smrg
10978862f5301Smrg# User supplied flags override default flags
10979862f5301Smrgif test "x$LINT_FLAGS" != "x"; then
10980862f5301Smrg   lint_options=$LINT_FLAGS
10981862f5301Smrgfi
10982ff559fabSmrg
10983862f5301SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10984862f5301SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10985ff559fabSmrg
10986862f5301Smrg]) # XORG_WITH_LINT
10987ff559fabSmrg
10988862f5301Smrg# XORG_LINT_LIBRARY(LIBNAME)
10989862f5301Smrg# --------------------------
10990862f5301Smrg# Minimum version: 1.1.0
10991862f5301Smrg#
10992862f5301Smrg# Sets up flags for building lint libraries for checking programs that call
10993862f5301Smrg# functions in the library.
10994862f5301Smrg#
10995862f5301Smrg# Interface to module:
10996862f5301Smrg# LINTLIB		- Automake variable with the name of lint library file to make
10997862f5301Smrg# MAKE_LINT_LIB		- Automake conditional
10998862f5301Smrg#
10999862f5301Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11000862f5301Smrg#			  - 'no' user instructs the module not to create a lint library (default)
110017a3b38f7Smrg
11002862f5301SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
11003862f5301SmrgAC_REQUIRE([XORG_WITH_LINT])
11004862f5301SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11005862f5301Smrg	[Create lint library (default: disabled)])],
11006862f5301Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
110077a3b38f7Smrg
11008862f5301Smrgif test "x$make_lint_lib" = x"yes" ; then
11009862f5301Smrg   LINTLIB=llib-l$1.ln
11010862f5301Smrg   if test "x$LINT" = "x"; then
11011862f5301Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11012862f5301Smrg   fi
11013862f5301Smrgelif test "x$make_lint_lib" != x"no" ; then
11014862f5301Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11015862f5301Smrgfi
1101644dda7b2Smrg
11017862f5301SmrgAC_SUBST(LINTLIB)
11018862f5301SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1101944dda7b2Smrg
11020862f5301Smrg]) # XORG_LINT_LIBRARY
11021862f5301Smrg
11022862f5301Smrg# XORG_COMPILER_BRAND
11023862f5301Smrg# -------------------
11024862f5301Smrg# Minimum version: 1.14.0
11025862f5301Smrg#
11026862f5301Smrg# Checks for various brands of compilers and sets flags as appropriate:
11027862f5301Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11028862f5301Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11029862f5301Smrg#   clang compiler - sets CLANGCC to "yes"
11030862f5301Smrg#   Intel compiler - sets INTELCC to "yes"
11031862f5301Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11032862f5301Smrg#
11033862f5301SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
11034862f5301SmrgAC_LANG_CASE(
11035862f5301Smrg	[C], [
11036862f5301Smrg		AC_REQUIRE([AC_PROG_CC_C99])
11037862f5301Smrg	],
11038862f5301Smrg	[C++], [
11039862f5301Smrg		AC_REQUIRE([AC_PROG_CXX])
11040862f5301Smrg	]
11041862f5301Smrg)
11042862f5301SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11043862f5301SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11044862f5301SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11045862f5301Smrg]) # XORG_COMPILER_BRAND
1104644dda7b2Smrg
11047862f5301Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11048862f5301Smrg# ---------------
11049862f5301Smrg# Minimum version: 1.16.0
11050862f5301Smrg#
11051862f5301Smrg# Test if the compiler works when passed the given flag as a command line argument.
11052862f5301Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11053862f5301Smrg# next flag in the list until there are no more options.
11054862f5301Smrg#
11055862f5301Smrg# Note that this does not guarantee that the compiler supports the flag as some
11056862f5301Smrg# compilers will simply ignore arguments that they do not understand, but we do
11057862f5301Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
11058862f5301Smrg# -Werror=unused-command-line-argument
11059862f5301Smrg#
11060862f5301SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
11061862f5301Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11062862f5301Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11063862f5301Smrg
11064862f5301SmrgAC_LANG_COMPILER_REQUIRE
11065862f5301Smrg
11066862f5301SmrgAC_LANG_CASE(
11067862f5301Smrg	[C], [
11068862f5301Smrg		AC_REQUIRE([AC_PROG_CC_C99])
11069862f5301Smrg		define([PREFIX], [C])
11070862f5301Smrg	],
11071862f5301Smrg	[C++], [
11072862f5301Smrg		define([PREFIX], [CXX])
11073862f5301Smrg	]
11074862f5301Smrg)
110757a3b38f7Smrg
11076862f5301Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11077862f5301Smrg
11078862f5301Smrgif test "x$xorg_testset_unknown_warning_option" = "x" ; then
11079862f5301Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11080862f5301Smrg	AC_CACHE_CHECK([if compiler supports -Werror=unknown-warning-option],
11081862f5301Smrg			xorg_cv_compiler_flag_unknown_warning_option,
11082862f5301Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11083862f5301Smrg					  [xorg_cv_compiler_flag_unknown_warning_option=yes],
11084862f5301Smrg					  [xorg_cv_compiler_flag_unknown_warning_option=no]))
11085862f5301Smrg	xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
11086862f5301Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11087862f5301Smrgfi
110887a3b38f7Smrg
11089862f5301Smrgif test "x$xorg_testset_unused_command_line_argument" = "x" ; then
11090862f5301Smrg	if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11091862f5301Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11092862f5301Smrg	fi
11093862f5301Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11094862f5301Smrg	AC_CACHE_CHECK([if compiler supports -Werror=unused-command-line-argument],
11095862f5301Smrg			xorg_cv_compiler_flag_unused_command_line_argument,
11096862f5301Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11097862f5301Smrg					  [xorg_cv_compiler_flag_unused_command_line_argument=yes],
11098862f5301Smrg					  [xorg_cv_compiler_flag_unused_command_line_argument=no]))
11099862f5301Smrg	xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
11100862f5301Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11101862f5301Smrgfi
111027a3b38f7Smrg
11103862f5301Smrgfound="no"
11104862f5301Smrgm4_foreach([flag], m4_cdr($@), [
11105862f5301Smrg	if test $found = "no" ; then
11106862f5301Smrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11107862f5301Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11108862f5301Smrg		fi
11109862f5301Smrg
11110862f5301Smrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11111862f5301Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11112862f5301Smrg		fi
11113862f5301Smrg
11114862f5301Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11115862f5301Smrg
11116862f5301Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11117862f5301Smrg		AC_MSG_CHECKING([if $CC supports ]flag[])
11118862f5301Smrg		cacheid=`AS_ECHO([xorg_cv_cc_flag_]flag[])`
11119862f5301Smrg		AC_CACHE_VAL(AS_TR_SH($cacheid),
11120862f5301Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11121862f5301Smrg					     [eval AS_TR_SH($cacheid)=yes],
11122862f5301Smrg					     [eval AS_TR_SH($cacheid)=no])])
11123862f5301Smrg
11124862f5301Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11125862f5301Smrg
11126862f5301Smrg		eval supported=$AS_TR_SH($cacheid)
11127862f5301Smrg		AC_MSG_RESULT([$supported])
11128862f5301Smrg		if test "$supported" = "yes" ; then
11129862f5301Smrg			$1="$$1 ]flag["
11130862f5301Smrg			found="yes"
11131862f5301Smrg		fi
11132862f5301Smrg	fi
11133862f5301Smrg])
11134862f5301Smrg]) # XORG_TESTSET_CFLAG
11135ff559fabSmrg
11136862f5301Smrg# XORG_COMPILER_FLAGS
11137862f5301Smrg# ---------------
11138862f5301Smrg# Minimum version: 1.16.0
11139862f5301Smrg#
11140862f5301Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11141862f5301Smrg# arguments supported by the selected compiler which do NOT alter the generated
11142862f5301Smrg# code.  These arguments will cause the compiler to print various warnings
11143862f5301Smrg# during compilation AND turn a conservative set of warnings into errors.
11144862f5301Smrg#
11145862f5301Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11146862f5301Smrg# future versions of util-macros as options are added to new compilers.
11147862f5301Smrg#
11148862f5301SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
11149862f5301SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11150862f5301Smrg
11151862f5301SmrgAC_ARG_ENABLE(selective-werror,
11152862f5301Smrg              AS_HELP_STRING([--disable-selective-werror],
11153862f5301Smrg                             [Turn off selective compiler errors. (default: enabled)]),
11154862f5301Smrg              [SELECTIVE_WERROR=$enableval],
11155862f5301Smrg              [SELECTIVE_WERROR=yes])
11156862f5301Smrg
11157862f5301SmrgAC_LANG_CASE(
11158862f5301Smrg        [C], [
11159862f5301Smrg                define([PREFIX], [C])
11160862f5301Smrg        ],
11161862f5301Smrg        [C++], [
11162862f5301Smrg                define([PREFIX], [CXX])
11163862f5301Smrg        ]
11164862f5301Smrg)
11165862f5301Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
11166862f5301Smrgif test "x$SUNCC" = "xyes"; then
11167862f5301Smrg    [BASE_]PREFIX[FLAGS]="-v"
11168862f5301Smrgelse
11169862f5301Smrg    [BASE_]PREFIX[FLAGS]=""
11170862f5301Smrgfi
11171ff559fabSmrg
11172862f5301Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11173862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11174862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11175862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11176862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11177862f5301Smrg
11178862f5301SmrgAC_LANG_CASE(
11179862f5301Smrg	[C], [
11180862f5301Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11181862f5301Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11182862f5301Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11183862f5301Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11184862f5301Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11185862f5301Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11186862f5301Smrg	]
11187862f5301Smrg)
11188ff559fabSmrg
11189862f5301Smrg# This chunk adds additional warnings that could catch undesired effects.
11190862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11191862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11192862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11193862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11194862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11195862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11196862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11197862f5301Smrg
11198862f5301Smrg# These are currently disabled because they are noisy.  They will be enabled
11199862f5301Smrg# in the future once the codebase is sufficiently modernized to silence
11200862f5301Smrg# them.  For now, I don't want them to drown out the other warnings.
11201862f5301Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11202862f5301Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11203862f5301Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11204862f5301Smrg
11205862f5301Smrg# Turn some warnings into errors, so we don't accidently get successful builds
11206862f5301Smrg# when there are problems that should be fixed.
11207862f5301Smrg
11208862f5301Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
11209862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11210862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11211862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11212862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11213862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11214862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11215862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11216862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11217862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11218862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11219862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11220862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11221862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11222862f5301Smrgelse
11223862f5301SmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
11224862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11225862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11226862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11227862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11228862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11229862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11230862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11231862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11232862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11233862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11234862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11235862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11236862f5301SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11237862f5301Smrgfi
1123844dda7b2Smrg
11239862f5301SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11240862f5301Smrg]) # XORG_COMPILER_FLAGS
1124144dda7b2Smrg
11242862f5301Smrg# XORG_CWARNFLAGS
11243862f5301Smrg# ---------------
11244862f5301Smrg# Minimum version: 1.2.0
11245862f5301Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
112467a3b38f7Smrg#
11247862f5301Smrg# Defines CWARNFLAGS to enable C compiler warnings.
112487a3b38f7Smrg#
11249862f5301Smrg# This function is deprecated because it defines -fno-strict-aliasing
11250862f5301Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11251862f5301Smrg# is needed, then it should be added explicitly in the module when
11252862f5301Smrg# it is updated to use BASE_CFLAGS.
11253862f5301Smrg#
11254862f5301SmrgAC_DEFUN([XORG_CWARNFLAGS], [
11255862f5301SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11256862f5301SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11257862f5301SmrgAC_LANG_CASE(
11258862f5301Smrg	[C], [
11259862f5301Smrg		CWARNFLAGS="$BASE_CFLAGS"
11260862f5301Smrg		if  test "x$GCC" = xyes ; then
11261862f5301Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11262862f5301Smrg		fi
11263862f5301Smrg		AC_SUBST(CWARNFLAGS)
11264862f5301Smrg	]
11265862f5301Smrg)
11266862f5301Smrg]) # XORG_CWARNFLAGS
11267ff559fabSmrg
11268862f5301Smrg# XORG_STRICT_OPTION
11269862f5301Smrg# -----------------------
11270862f5301Smrg# Minimum version: 1.3.0
11271862f5301Smrg#
11272862f5301Smrg# Add configure option to enable strict compilation flags, such as treating
11273862f5301Smrg# warnings as fatal errors.
11274862f5301Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11275862f5301Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11276862f5301Smrg#
11277862f5301Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11278862f5301Smrg# when strict compilation is unconditionally desired.
11279862f5301SmrgAC_DEFUN([XORG_STRICT_OPTION], [
11280862f5301SmrgAC_REQUIRE([XORG_CWARNFLAGS])
11281862f5301SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
112827a3b38f7Smrg
11283862f5301SmrgAC_ARG_ENABLE(strict-compilation,
11284862f5301Smrg			  AS_HELP_STRING([--enable-strict-compilation],
11285862f5301Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11286862f5301Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11287ff559fabSmrg
11288862f5301SmrgAC_LANG_CASE(
11289862f5301Smrg        [C], [
11290862f5301Smrg                define([PREFIX], [C])
11291862f5301Smrg        ],
11292862f5301Smrg        [C++], [
11293862f5301Smrg                define([PREFIX], [CXX])
11294862f5301Smrg        ]
11295862f5301Smrg)
1129644dda7b2Smrg
11297862f5301Smrg[STRICT_]PREFIX[FLAGS]=""
11298862f5301SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11299862f5301SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1130044dda7b2Smrg
11301862f5301Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11302862f5301Smrg# activate it with -Werror, so we add it here explicitly.
11303862f5301SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11304ff559fabSmrg
11305862f5301Smrgif test "x$STRICT_COMPILE" = "xyes"; then
11306862f5301Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11307862f5301Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11308862f5301Smrgfi
11309862f5301SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11310862f5301SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11311862f5301SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11312862f5301Smrg]) # XORG_STRICT_OPTION
11313ff559fabSmrg
11314862f5301Smrg# XORG_DEFAULT_OPTIONS
11315862f5301Smrg# --------------------
11316862f5301Smrg# Minimum version: 1.3.0
113177a3b38f7Smrg#
11318862f5301Smrg# Defines default options for X.Org modules.
113197a3b38f7Smrg#
11320862f5301SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11321862f5301SmrgAC_REQUIRE([AC_PROG_INSTALL])
11322862f5301SmrgXORG_COMPILER_FLAGS
11323862f5301SmrgXORG_CWARNFLAGS
11324862f5301SmrgXORG_STRICT_OPTION
11325862f5301SmrgXORG_RELEASE_VERSION
11326862f5301SmrgXORG_CHANGELOG
11327862f5301SmrgXORG_INSTALL
11328862f5301SmrgXORG_MANPAGE_SECTIONS
11329862f5301Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11330862f5301Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11331862f5301Smrg]) # XORG_DEFAULT_OPTIONS
11332862f5301Smrg
11333862f5301Smrg# XORG_INSTALL()
11334862f5301Smrg# ----------------
11335862f5301Smrg# Minimum version: 1.4.0
113367a3b38f7Smrg#
11337862f5301Smrg# Defines the variable INSTALL_CMD as the command to copy
11338862f5301Smrg# INSTALL from $prefix/share/util-macros.
1133944dda7b2Smrg#
11340862f5301SmrgAC_DEFUN([XORG_INSTALL], [
11341862f5301SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11342862f5301Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11343862f5301SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11344862f5301Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11345862f5301Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11346862f5301Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11347862f5301SmrgAC_SUBST([INSTALL_CMD])
11348862f5301Smrg]) # XORG_INSTALL
11349862f5301Smrgdnl Copyright 2005 Red Hat, Inc
11350862f5301Smrgdnl
11351862f5301Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11352862f5301Smrgdnl documentation for any purpose is hereby granted without fee, provided that
11353862f5301Smrgdnl the above copyright notice appear in all copies and that both that
11354862f5301Smrgdnl copyright notice and this permission notice appear in supporting
11355862f5301Smrgdnl documentation.
11356862f5301Smrgdnl
11357862f5301Smrgdnl The above copyright notice and this permission notice shall be included
11358862f5301Smrgdnl in all copies or substantial portions of the Software.
11359862f5301Smrgdnl
11360862f5301Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11361862f5301Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11362862f5301Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11363862f5301Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11364862f5301Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11365862f5301Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11366862f5301Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
11367862f5301Smrgdnl
11368862f5301Smrgdnl Except as contained in this notice, the name of the copyright holders shall
11369862f5301Smrgdnl not be used in advertising or otherwise to promote the sale, use or
11370862f5301Smrgdnl other dealings in this Software without prior written authorization
11371862f5301Smrgdnl from the copyright holders.
11372862f5301Smrgdnl
1137344dda7b2Smrg
11374862f5301Smrg# XORG_RELEASE_VERSION
11375862f5301Smrg# --------------------
11376862f5301Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11377862f5301Smrg 
11378862f5301SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11379862f5301Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11380862f5301Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11381862f5301Smrg		[Major version of this package])
11382862f5301Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11383862f5301Smrg	if test "x$PVM" = "x"; then
11384862f5301Smrg		PVM="0"
11385862f5301Smrg	fi
11386862f5301Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11387862f5301Smrg		[$PVM],
11388862f5301Smrg		[Minor version of this package])
11389862f5301Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11390862f5301Smrg	if test "x$PVP" = "x"; then
11391862f5301Smrg		PVP="0"
11392862f5301Smrg	fi
11393862f5301Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11394862f5301Smrg		[$PVP],
11395862f5301Smrg		[Patch version of this package])
11396862f5301Smrg])
1139744dda7b2Smrg
11398862f5301Smrg# XORG_CHANGELOG()
11399862f5301Smrg# ----------------
11400862f5301Smrg# Minimum version: 1.2.0
11401862f5301Smrg#
11402862f5301Smrg# Defines the variable CHANGELOG_CMD as the command to generate
11403862f5301Smrg# ChangeLog from git.
11404862f5301Smrg#
11405862f5301Smrg#
11406862f5301SmrgAC_DEFUN([XORG_CHANGELOG], [
11407862f5301SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11408862f5301Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11409862f5301Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11410862f5301Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11411862f5301SmrgAC_SUBST([CHANGELOG_CMD])
11412862f5301Smrg]) # XORG_CHANGELOG
11413ff559fabSmrg
11414