aclocal.m4 revision d9dcd5ae
1d9dcd5aeSmrg# generated automatically by aclocal 1.13.2 -*- Autoconf -*-
2d9dcd5aeSmrg
3d9dcd5aeSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4191cded7Smrg
5191cded7Smrg# This file is free software; the Free Software Foundation
6191cded7Smrg# gives unlimited permission to copy and/or distribute it,
7191cded7Smrg# with or without modifications, as long as this notice is preserved.
8191cded7Smrg
9191cded7Smrg# This program is distributed in the hope that it will be useful,
10191cded7Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11191cded7Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12191cded7Smrg# PARTICULAR PURPOSE.
13191cded7Smrg
14d9dcd5aeSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15b290cf36Smrgm4_ifndef([AC_AUTOCONF_VERSION],
16b290cf36Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17ba064abeSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18ba064abeSmrg[m4_warning([this file was generated for autoconf 2.68.
19b290cf36SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20b290cf36SmrgIf you have problems, you may need to regenerate the build system entirely.
21d9dcd5aeSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22b290cf36Smrg
23d9dcd5aeSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
24b290cf36Smrg#
25ba064abeSmrg# This file is free software; the Free Software Foundation
26ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
27ba064abeSmrg# with or without modifications, as long as this notice is preserved.
28ba064abeSmrg
29ba064abeSmrg# AM_AUTOMAKE_VERSION(VERSION)
30ba064abeSmrg# ----------------------------
31ba064abeSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32ba064abeSmrg# generated from the m4 files accompanying Automake X.Y.
33ba064abeSmrg# (This private macro should not be called outside this file.)
34ba064abeSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
35d9dcd5aeSmrg[am__api_version='1.13'
36ba064abeSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37ba064abeSmrgdnl require some minimum version.  Point them to the right macro.
38d9dcd5aeSmrgm4_if([$1], [1.13.2], [],
39ba064abeSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40ba064abeSmrg])
41ba064abeSmrg
42ba064abeSmrg# _AM_AUTOCONF_VERSION(VERSION)
43ba064abeSmrg# -----------------------------
44ba064abeSmrg# aclocal traces this macro to find the Autoconf version.
45ba064abeSmrg# This is a private macro too.  Using m4_define simplifies
46ba064abeSmrg# the logic in aclocal, which can simply ignore this definition.
47ba064abeSmrgm4_define([_AM_AUTOCONF_VERSION], [])
48ba064abeSmrg
49ba064abeSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50ba064abeSmrg# -------------------------------
51ba064abeSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52ba064abeSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53ba064abeSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54d9dcd5aeSmrg[AM_AUTOMAKE_VERSION([1.13.2])dnl
55ba064abeSmrgm4_ifndef([AC_AUTOCONF_VERSION],
56ba064abeSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57ba064abeSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58ba064abeSmrg
59ba064abeSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60ba064abeSmrg
61d9dcd5aeSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
62b290cf36Smrg#
63ba064abeSmrg# This file is free software; the Free Software Foundation
64ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
65ba064abeSmrg# with or without modifications, as long as this notice is preserved.
66b290cf36Smrg
67ba064abeSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68d9dcd5aeSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69d9dcd5aeSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70b290cf36Smrg#
71ba064abeSmrg# Of course, Automake must honor this variable whenever it calls a
72ba064abeSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73ba064abeSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74ba064abeSmrg# depending on how configure is run.  This is pretty annoying, since
75ba064abeSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76ba064abeSmrg# source directory, any form will work fine, but in subdirectories a
77ba064abeSmrg# relative path needs to be adjusted first.
78b290cf36Smrg#
79ba064abeSmrg# $ac_aux_dir/missing
80ba064abeSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81ba064abeSmrg# $top_srcdir/$ac_aux_dir/missing
82ba064abeSmrg#    fails if $ac_aux_dir is absolute,
83ba064abeSmrg#    fails when called from a subdirectory in a VPATH build with
84ba064abeSmrg#          a relative $ac_aux_dir
85b290cf36Smrg#
86ba064abeSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87ba064abeSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
88d9dcd5aeSmrg# harmless because $srcdir is '.', but things will broke when you
89ba064abeSmrg# start a VPATH build or use an absolute $srcdir.
90b290cf36Smrg#
91ba064abeSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92ba064abeSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93ba064abeSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94ba064abeSmrg# and then we would define $MISSING as
95ba064abeSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96ba064abeSmrg# This will work as long as MISSING is not called from configure, because
97ba064abeSmrg# unfortunately $(top_srcdir) has no meaning in configure.
98ba064abeSmrg# However there are other variables, like CC, which are often used in
99ba064abeSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
100b290cf36Smrg#
101ba064abeSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
102ba064abeSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
103ba064abeSmrg# configured tree to be moved without reconfiguration.
104191cded7Smrg
105ba064abeSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
106ba064abeSmrg[dnl Rely on autoconf to set up CDPATH properly.
107ba064abeSmrgAC_PREREQ([2.50])dnl
108ba064abeSmrg# expand $ac_aux_dir to an absolute path
109ba064abeSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
110b290cf36Smrg])
111b290cf36Smrg
112ba064abeSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
113b290cf36Smrg
114d9dcd5aeSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
115ba064abeSmrg#
116ba064abeSmrg# This file is free software; the Free Software Foundation
117ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
118ba064abeSmrg# with or without modifications, as long as this notice is preserved.
119191cded7Smrg
120ba064abeSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
121ba064abeSmrg# -------------------------------------
122ba064abeSmrg# Define a conditional.
123ba064abeSmrgAC_DEFUN([AM_CONDITIONAL],
124d9dcd5aeSmrg[AC_PREREQ([2.52])dnl
125d9dcd5aeSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
126d9dcd5aeSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
127ba064abeSmrgAC_SUBST([$1_TRUE])dnl
128ba064abeSmrgAC_SUBST([$1_FALSE])dnl
129ba064abeSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
130ba064abeSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
131ba064abeSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
132ba064abeSmrgif $2; then
133ba064abeSmrg  $1_TRUE=
134ba064abeSmrg  $1_FALSE='#'
135ba064abeSmrgelse
136ba064abeSmrg  $1_TRUE='#'
137ba064abeSmrg  $1_FALSE=
138ba064abeSmrgfi
139ba064abeSmrgAC_CONFIG_COMMANDS_PRE(
140ba064abeSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
141ba064abeSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
142ba064abeSmrgUsually this means the macro was only invoked conditionally.]])
143ba064abeSmrgfi])])
144191cded7Smrg
145d9dcd5aeSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
146ba064abeSmrg#
147ba064abeSmrg# This file is free software; the Free Software Foundation
148ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
149ba064abeSmrg# with or without modifications, as long as this notice is preserved.
150b290cf36Smrg
151b290cf36Smrg
152d9dcd5aeSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
153ba064abeSmrg# written in clear, in which case automake, when reading aclocal.m4,
154ba064abeSmrg# will think it sees a *use*, and therefore will trigger all it's
155ba064abeSmrg# C support machinery.  Also note that it means that autoscan, seeing
156ba064abeSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
157b290cf36Smrg
158b290cf36Smrg
159ba064abeSmrg# _AM_DEPENDENCIES(NAME)
160b290cf36Smrg# ----------------------
161ba064abeSmrg# See how the compiler implements dependency checking.
162d9dcd5aeSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
163ba064abeSmrg# We try a few techniques and use that to set a single cache variable.
164ba064abeSmrg#
165ba064abeSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
166ba064abeSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
167ba064abeSmrg# dependency, and given that the user is not expected to run this macro,
168ba064abeSmrg# just rely on AC_PROG_CC.
169ba064abeSmrgAC_DEFUN([_AM_DEPENDENCIES],
170ba064abeSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
171ba064abeSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
172ba064abeSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
173ba064abeSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
174b290cf36Smrg
175d9dcd5aeSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
176d9dcd5aeSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
177d9dcd5aeSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
178d9dcd5aeSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
179d9dcd5aeSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
180d9dcd5aeSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
181d9dcd5aeSmrg                    [depcc="$$1"   am_compiler_list=])
182b290cf36Smrg
183ba064abeSmrgAC_CACHE_CHECK([dependency style of $depcc],
184ba064abeSmrg               [am_cv_$1_dependencies_compiler_type],
185ba064abeSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
186ba064abeSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
187ba064abeSmrg  # making bogus files that we don't know about and never remove.  For
188ba064abeSmrg  # instance it was reported that on HP-UX the gcc test will end up
189d9dcd5aeSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
190d9dcd5aeSmrg  # in D".
191d9dcd5aeSmrg  rm -rf conftest.dir
192ba064abeSmrg  mkdir conftest.dir
193ba064abeSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
194ba064abeSmrg  # using a relative directory.
195ba064abeSmrg  cp "$am_depcomp" conftest.dir
196ba064abeSmrg  cd conftest.dir
197ba064abeSmrg  # We will build objects and dependencies in a subdirectory because
198ba064abeSmrg  # it helps to detect inapplicable dependency modes.  For instance
199ba064abeSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
200ba064abeSmrg  # side effect of compilation, but ICC will put the dependencies in
201ba064abeSmrg  # the current directory while Tru64 will put them in the object
202ba064abeSmrg  # directory.
203ba064abeSmrg  mkdir sub
204191cded7Smrg
205ba064abeSmrg  am_cv_$1_dependencies_compiler_type=none
206ba064abeSmrg  if test "$am_compiler_list" = ""; then
207ba064abeSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
208191cded7Smrg  fi
209ba064abeSmrg  am__universal=false
210ba064abeSmrg  m4_case([$1], [CC],
211ba064abeSmrg    [case " $depcc " in #(
212ba064abeSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
213ba064abeSmrg     esac],
214ba064abeSmrg    [CXX],
215ba064abeSmrg    [case " $depcc " in #(
216ba064abeSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
217ba064abeSmrg     esac])
218191cded7Smrg
219ba064abeSmrg  for depmode in $am_compiler_list; do
220ba064abeSmrg    # Setup a source with many dependencies, because some compilers
221ba064abeSmrg    # like to wrap large dependency lists on column 80 (with \), and
222ba064abeSmrg    # we should not choose a depcomp mode which is confused by this.
223ba064abeSmrg    #
224ba064abeSmrg    # We need to recreate these files for each test, as the compiler may
225ba064abeSmrg    # overwrite some of them when testing with obscure command lines.
226ba064abeSmrg    # This happens at least with the AIX C compiler.
227ba064abeSmrg    : > sub/conftest.c
228ba064abeSmrg    for i in 1 2 3 4 5 6; do
229ba064abeSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
230d9dcd5aeSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
231d9dcd5aeSmrg      # Solaris 10 /bin/sh.
232d9dcd5aeSmrg      echo '/* dummy */' > sub/conftst$i.h
233ba064abeSmrg    done
234ba064abeSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
235191cded7Smrg
236d9dcd5aeSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
237ba064abeSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
238d9dcd5aeSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
239d9dcd5aeSmrg    # versions had trouble with output in subdirs.
240ba064abeSmrg    am__obj=sub/conftest.${OBJEXT-o}
241ba064abeSmrg    am__minus_obj="-o $am__obj"
242ba064abeSmrg    case $depmode in
243ba064abeSmrg    gcc)
244ba064abeSmrg      # This depmode causes a compiler race in universal mode.
245ba064abeSmrg      test "$am__universal" = false || continue
246ba064abeSmrg      ;;
247ba064abeSmrg    nosideeffect)
248d9dcd5aeSmrg      # After this tag, mechanisms are not by side-effect, so they'll
249d9dcd5aeSmrg      # only be used when explicitly requested.
250ba064abeSmrg      if test "x$enable_dependency_tracking" = xyes; then
251ba064abeSmrg	continue
252ba064abeSmrg      else
253ba064abeSmrg	break
254ba064abeSmrg      fi
255ba064abeSmrg      ;;
256d9dcd5aeSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
257d9dcd5aeSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
258ba064abeSmrg      # not run yet.  These depmodes are late enough in the game, and
259ba064abeSmrg      # so weak that their functioning should not be impacted.
260ba064abeSmrg      am__obj=conftest.${OBJEXT-o}
261ba064abeSmrg      am__minus_obj=
262ba064abeSmrg      ;;
263ba064abeSmrg    none) break ;;
264ba064abeSmrg    esac
265ba064abeSmrg    if depmode=$depmode \
266ba064abeSmrg       source=sub/conftest.c object=$am__obj \
267ba064abeSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
268ba064abeSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
269ba064abeSmrg         >/dev/null 2>conftest.err &&
270ba064abeSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
271ba064abeSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
272ba064abeSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
273ba064abeSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
274ba064abeSmrg      # icc doesn't choke on unknown options, it will just issue warnings
275ba064abeSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
276ba064abeSmrg      # that says an option was ignored or not supported.
277ba064abeSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
278ba064abeSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
279ba064abeSmrg      # The diagnosis changed in icc 8.0:
280ba064abeSmrg      #   icc: Command line remark: option '-MP' not supported
281ba064abeSmrg      if (grep 'ignoring option' conftest.err ||
282ba064abeSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
283ba064abeSmrg        am_cv_$1_dependencies_compiler_type=$depmode
284ba064abeSmrg        break
285ba064abeSmrg      fi
286ba064abeSmrg    fi
287ba064abeSmrg  done
288191cded7Smrg
289ba064abeSmrg  cd ..
290ba064abeSmrg  rm -rf conftest.dir
291ba064abeSmrgelse
292ba064abeSmrg  am_cv_$1_dependencies_compiler_type=none
293ba064abeSmrgfi
294ba064abeSmrg])
295ba064abeSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
296ba064abeSmrgAM_CONDITIONAL([am__fastdep$1], [
297ba064abeSmrg  test "x$enable_dependency_tracking" != xno \
298ba064abeSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
299ba064abeSmrg])
300191cded7Smrg
301191cded7Smrg
302ba064abeSmrg# AM_SET_DEPDIR
303ba064abeSmrg# -------------
304ba064abeSmrg# Choose a directory name for dependency files.
305d9dcd5aeSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
306ba064abeSmrgAC_DEFUN([AM_SET_DEPDIR],
307ba064abeSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
308ba064abeSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
309ba064abeSmrg])
310191cded7Smrg
311191cded7Smrg
312ba064abeSmrg# AM_DEP_TRACK
313ba064abeSmrg# ------------
314ba064abeSmrgAC_DEFUN([AM_DEP_TRACK],
315d9dcd5aeSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
316d9dcd5aeSmrgAS_HELP_STRING(
317d9dcd5aeSmrg  [--enable-dependency-tracking],
318d9dcd5aeSmrg  [do not reject slow dependency extractors])
319d9dcd5aeSmrgAS_HELP_STRING(
320d9dcd5aeSmrg  [--disable-dependency-tracking],
321d9dcd5aeSmrg  [speeds up one-time build])])
322ba064abeSmrgif test "x$enable_dependency_tracking" != xno; then
323ba064abeSmrg  am_depcomp="$ac_aux_dir/depcomp"
324ba064abeSmrg  AMDEPBACKSLASH='\'
325d9dcd5aeSmrg  am__nodep='_no'
326ba064abeSmrgfi
327ba064abeSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
328ba064abeSmrgAC_SUBST([AMDEPBACKSLASH])dnl
329ba064abeSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
330d9dcd5aeSmrgAC_SUBST([am__nodep])dnl
331d9dcd5aeSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
332ba064abeSmrg])
333191cded7Smrg
334ba064abeSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
335191cded7Smrg
336d9dcd5aeSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
337ba064abeSmrg#
338ba064abeSmrg# This file is free software; the Free Software Foundation
339ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
340ba064abeSmrg# with or without modifications, as long as this notice is preserved.
341191cded7Smrg
342191cded7Smrg
343ba064abeSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
344b290cf36Smrg# ------------------------------
345ba064abeSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
346ba064abeSmrg[{
347d9dcd5aeSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
348ba064abeSmrg  # are listed without --file.  Let's play safe and only enable the eval
349ba064abeSmrg  # if we detect the quoting.
350ba064abeSmrg  case $CONFIG_FILES in
351ba064abeSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
352ba064abeSmrg  *)   set x $CONFIG_FILES ;;
353ba064abeSmrg  esac
354ba064abeSmrg  shift
355ba064abeSmrg  for mf
356ba064abeSmrg  do
357ba064abeSmrg    # Strip MF so we end up with the name of the file.
358ba064abeSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
359ba064abeSmrg    # Check whether this is an Automake generated Makefile or not.
360d9dcd5aeSmrg    # We used to match only the files named 'Makefile.in', but
361ba064abeSmrg    # some people rename them; so instead we look at the file content.
362ba064abeSmrg    # Grep'ing the first line is not enough: some people post-process
363ba064abeSmrg    # each Makefile.in and add a new line on top of each file to say so.
364ba064abeSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
365ba064abeSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
366ba064abeSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
367ba064abeSmrg      dirpart=`AS_DIRNAME("$mf")`
368ba064abeSmrg    else
369ba064abeSmrg      continue
370ba064abeSmrg    fi
371ba064abeSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
372d9dcd5aeSmrg    # from the Makefile without running 'make'.
373ba064abeSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
374ba064abeSmrg    test -z "$DEPDIR" && continue
375ba064abeSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
376d9dcd5aeSmrg    test -z "$am__include" && continue
377ba064abeSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
378ba064abeSmrg    # Find all dependency output files, they are included files with
379ba064abeSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
380ba064abeSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
381ba064abeSmrg    # expansion.
382ba064abeSmrg    for file in `sed -n "
383ba064abeSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
384d9dcd5aeSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
385ba064abeSmrg      # Make sure the directory exists.
386ba064abeSmrg      test -f "$dirpart/$file" && continue
387ba064abeSmrg      fdir=`AS_DIRNAME(["$file"])`
388ba064abeSmrg      AS_MKDIR_P([$dirpart/$fdir])
389ba064abeSmrg      # echo "creating $dirpart/$file"
390ba064abeSmrg      echo '# dummy' > "$dirpart/$file"
391ba064abeSmrg    done
392ba064abeSmrg  done
393ba064abeSmrg}
394ba064abeSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
395b290cf36Smrg
396b290cf36Smrg
397ba064abeSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
398ba064abeSmrg# -----------------------------
399ba064abeSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
400ba064abeSmrg#
401ba064abeSmrg# This code is only required when automatic dependency tracking
402d9dcd5aeSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
403ba064abeSmrg# need in order to bootstrap the dependency handling code.
404ba064abeSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
405ba064abeSmrg[AC_CONFIG_COMMANDS([depfiles],
406ba064abeSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
407ba064abeSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
408191cded7Smrg])
409191cded7Smrg
410ba064abeSmrg# Do all the work for Automake.                             -*- Autoconf -*-
411b290cf36Smrg
412d9dcd5aeSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
413ba064abeSmrg#
414ba064abeSmrg# This file is free software; the Free Software Foundation
415ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
416ba064abeSmrg# with or without modifications, as long as this notice is preserved.
417b290cf36Smrg
418ba064abeSmrg# This macro actually does too much.  Some checks are only needed if
419ba064abeSmrg# your package does certain things.  But this isn't really a big deal.
420191cded7Smrg
421ba064abeSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
422ba064abeSmrg# AM_INIT_AUTOMAKE([OPTIONS])
423ba064abeSmrg# -----------------------------------------------
424ba064abeSmrg# The call with PACKAGE and VERSION arguments is the old style
425ba064abeSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
426ba064abeSmrg# and VERSION should now be passed to AC_INIT and removed from
427ba064abeSmrg# the call to AM_INIT_AUTOMAKE.
428ba064abeSmrg# We support both call styles for the transition.  After
429ba064abeSmrg# the next Automake release, Autoconf can make the AC_INIT
430ba064abeSmrg# arguments mandatory, and then we can depend on a new Autoconf
431ba064abeSmrg# release and drop the old call support.
432ba064abeSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
433d9dcd5aeSmrg[AC_PREREQ([2.65])dnl
434ba064abeSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
435ba064abeSmrgdnl the ones we care about.
436ba064abeSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
437ba064abeSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
438ba064abeSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
439ba064abeSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
440ba064abeSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
441ba064abeSmrg  # is not polluted with repeated "-I."
442ba064abeSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
443ba064abeSmrg  # test to see if srcdir already configured
444ba064abeSmrg  if test -f $srcdir/config.status; then
445ba064abeSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
446ba064abeSmrg  fi
447ba064abeSmrgfi
448191cded7Smrg
449ba064abeSmrg# test whether we have cygpath
450ba064abeSmrgif test -z "$CYGPATH_W"; then
451ba064abeSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
452ba064abeSmrg    CYGPATH_W='cygpath -w'
453ba064abeSmrg  else
454ba064abeSmrg    CYGPATH_W=echo
455ba064abeSmrg  fi
456ba064abeSmrgfi
457ba064abeSmrgAC_SUBST([CYGPATH_W])
458191cded7Smrg
459ba064abeSmrg# Define the identity of the package.
460ba064abeSmrgdnl Distinguish between old-style and new-style calls.
461ba064abeSmrgm4_ifval([$2],
462d9dcd5aeSmrg[AC_DIAGNOSE([obsolete],
463d9dcd5aeSmrg             [$0: two- and three-arguments forms are deprecated.])
464d9dcd5aeSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465ba064abeSmrg AC_SUBST([PACKAGE], [$1])dnl
466ba064abeSmrg AC_SUBST([VERSION], [$2])],
467ba064abeSmrg[_AM_SET_OPTIONS([$1])dnl
468ba064abeSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469d9dcd5aeSmrgm4_if(
470d9dcd5aeSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
471d9dcd5aeSmrg  [ok:ok],,
472ba064abeSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
473ba064abeSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
474ba064abeSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
475191cded7Smrg
476ba064abeSmrg_AM_IF_OPTION([no-define],,
477d9dcd5aeSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
478d9dcd5aeSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
479191cded7Smrg
480ba064abeSmrg# Some tools Automake needs.
481ba064abeSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
482ba064abeSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
483d9dcd5aeSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
484d9dcd5aeSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
485d9dcd5aeSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
486d9dcd5aeSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
487d9dcd5aeSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
488ba064abeSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
489ba064abeSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
490d9dcd5aeSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
491d9dcd5aeSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
492d9dcd5aeSmrg# dies out for good.  For more background, see:
493d9dcd5aeSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
494d9dcd5aeSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
495d9dcd5aeSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
496ba064abeSmrg# We need awk for the "check" target.  The system "awk" is bad on
497ba064abeSmrg# some platforms.
498ba064abeSmrgAC_REQUIRE([AC_PROG_AWK])dnl
499ba064abeSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
500ba064abeSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
501ba064abeSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
502ba064abeSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
503ba064abeSmrg			     [_AM_PROG_TAR([v7])])])
504ba064abeSmrg_AM_IF_OPTION([no-dependencies],,
505ba064abeSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
506d9dcd5aeSmrg		  [_AM_DEPENDENCIES([CC])],
507d9dcd5aeSmrg		  [m4_define([AC_PROG_CC],
508d9dcd5aeSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
509ba064abeSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
510d9dcd5aeSmrg		  [_AM_DEPENDENCIES([CXX])],
511d9dcd5aeSmrg		  [m4_define([AC_PROG_CXX],
512d9dcd5aeSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
513ba064abeSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
514d9dcd5aeSmrg		  [_AM_DEPENDENCIES([OBJC])],
515d9dcd5aeSmrg		  [m4_define([AC_PROG_OBJC],
516d9dcd5aeSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
517d9dcd5aeSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
518d9dcd5aeSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
519d9dcd5aeSmrg		  [m4_define([AC_PROG_OBJCXX],
520d9dcd5aeSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
521ba064abeSmrg])
522d9dcd5aeSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
523d9dcd5aeSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
524d9dcd5aeSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
525d9dcd5aeSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
526ba064abeSmrgAC_CONFIG_COMMANDS_PRE(dnl
527ba064abeSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
528ba064abeSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
529b290cf36Smrg])
530191cded7Smrg
531d9dcd5aeSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
532ba064abeSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
533ba064abeSmrgdnl mangled by Autoconf and run in a shell conditional statement.
534ba064abeSmrgm4_define([_AC_COMPILER_EXEEXT],
535ba064abeSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
536191cded7Smrg
537191cded7Smrg
538ba064abeSmrg# When config.status generates a header, we must update the stamp-h file.
539ba064abeSmrg# This file resides in the same directory as the config header
540ba064abeSmrg# that is generated.  The stamp files are numbered to have different names.
541191cded7Smrg
542ba064abeSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
543ba064abeSmrg# loop where config.status creates the headers, so we can generate
544ba064abeSmrg# our stamp files there.
545ba064abeSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
546ba064abeSmrg[# Compute $1's index in $config_headers.
547ba064abeSmrg_am_arg=$1
548ba064abeSmrg_am_stamp_count=1
549ba064abeSmrgfor _am_header in $config_headers :; do
550ba064abeSmrg  case $_am_header in
551ba064abeSmrg    $_am_arg | $_am_arg:* )
552ba064abeSmrg      break ;;
553ba064abeSmrg    * )
554ba064abeSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
555ba064abeSmrg  esac
556ba064abeSmrgdone
557ba064abeSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
558191cded7Smrg
559d9dcd5aeSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
560ba064abeSmrg#
561ba064abeSmrg# This file is free software; the Free Software Foundation
562ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
563ba064abeSmrg# with or without modifications, as long as this notice is preserved.
564191cded7Smrg
565ba064abeSmrg# AM_PROG_INSTALL_SH
566ba064abeSmrg# ------------------
567ba064abeSmrg# Define $install_sh.
568ba064abeSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
569ba064abeSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
570ba064abeSmrgif test x"${install_sh}" != xset; then
571ba064abeSmrg  case $am_aux_dir in
572ba064abeSmrg  *\ * | *\	*)
573ba064abeSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
574ba064abeSmrg  *)
575ba064abeSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
576ba064abeSmrg  esac
577ba064abeSmrgfi
578d9dcd5aeSmrgAC_SUBST([install_sh])])
579191cded7Smrg
580d9dcd5aeSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
581ba064abeSmrg#
582ba064abeSmrg# This file is free software; the Free Software Foundation
583ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
584ba064abeSmrg# with or without modifications, as long as this notice is preserved.
585191cded7Smrg
586ba064abeSmrg# Check whether the underlying file-system supports filenames
587ba064abeSmrg# with a leading dot.  For instance MS-DOS doesn't.
588ba064abeSmrgAC_DEFUN([AM_SET_LEADING_DOT],
589ba064abeSmrg[rm -rf .tst 2>/dev/null
590ba064abeSmrgmkdir .tst 2>/dev/null
591ba064abeSmrgif test -d .tst; then
592ba064abeSmrg  am__leading_dot=.
593ba064abeSmrgelse
594ba064abeSmrg  am__leading_dot=_
595ba064abeSmrgfi
596ba064abeSmrgrmdir .tst 2>/dev/null
597ba064abeSmrgAC_SUBST([am__leading_dot])])
598191cded7Smrg
599ba064abeSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
600ba064abeSmrg
601d9dcd5aeSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
602b290cf36Smrg#
603ba064abeSmrg# This file is free software; the Free Software Foundation
604ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
605ba064abeSmrg# with or without modifications, as long as this notice is preserved.
606191cded7Smrg
607ba064abeSmrg# AM_MAKE_INCLUDE()
608ba064abeSmrg# -----------------
609ba064abeSmrg# Check to see how make treats includes.
610ba064abeSmrgAC_DEFUN([AM_MAKE_INCLUDE],
611ba064abeSmrg[am_make=${MAKE-make}
612ba064abeSmrgcat > confinc << 'END'
613ba064abeSmrgam__doit:
614ba064abeSmrg	@echo this is the am__doit target
615ba064abeSmrg.PHONY: am__doit
616ba064abeSmrgEND
617ba064abeSmrg# If we don't find an include directive, just comment out the code.
618ba064abeSmrgAC_MSG_CHECKING([for style of include used by $am_make])
619ba064abeSmrgam__include="#"
620ba064abeSmrgam__quote=
621ba064abeSmrg_am_result=none
622ba064abeSmrg# First try GNU make style include.
623ba064abeSmrgecho "include confinc" > confmf
624d9dcd5aeSmrg# Ignore all kinds of additional output from 'make'.
625ba064abeSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
626ba064abeSmrg*the\ am__doit\ target*)
627ba064abeSmrg  am__include=include
628ba064abeSmrg  am__quote=
629ba064abeSmrg  _am_result=GNU
630ba064abeSmrg  ;;
631ba064abeSmrgesac
632ba064abeSmrg# Now try BSD make style include.
633ba064abeSmrgif test "$am__include" = "#"; then
634ba064abeSmrg   echo '.include "confinc"' > confmf
635ba064abeSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
636ba064abeSmrg   *the\ am__doit\ target*)
637ba064abeSmrg     am__include=.include
638ba064abeSmrg     am__quote="\""
639ba064abeSmrg     _am_result=BSD
640ba064abeSmrg     ;;
641ba064abeSmrg   esac
642ba064abeSmrgfi
643ba064abeSmrgAC_SUBST([am__include])
644ba064abeSmrgAC_SUBST([am__quote])
645ba064abeSmrgAC_MSG_RESULT([$_am_result])
646ba064abeSmrgrm -f confinc confmf
647ba064abeSmrg])
648b290cf36Smrg
649ba064abeSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
650b290cf36Smrg
651d9dcd5aeSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
652ba064abeSmrg#
653ba064abeSmrg# This file is free software; the Free Software Foundation
654ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
655ba064abeSmrg# with or without modifications, as long as this notice is preserved.
656b290cf36Smrg
657ba064abeSmrg# AM_MISSING_PROG(NAME, PROGRAM)
658b290cf36Smrg# ------------------------------
659ba064abeSmrgAC_DEFUN([AM_MISSING_PROG],
660ba064abeSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
661ba064abeSmrg$1=${$1-"${am_missing_run}$2"}
662ba064abeSmrgAC_SUBST($1)])
663b290cf36Smrg
664ba064abeSmrg# AM_MISSING_HAS_RUN
665ba064abeSmrg# ------------------
666d9dcd5aeSmrg# Define MISSING if not defined so far and test if it is modern enough.
667d9dcd5aeSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
668ba064abeSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
669ba064abeSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
670ba064abeSmrgAC_REQUIRE_AUX_FILE([missing])dnl
671ba064abeSmrgif test x"${MISSING+set}" != xset; then
672ba064abeSmrg  case $am_aux_dir in
673ba064abeSmrg  *\ * | *\	*)
674ba064abeSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
675ba064abeSmrg  *)
676ba064abeSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
677ba064abeSmrg  esac
678ba064abeSmrgfi
679ba064abeSmrg# Use eval to expand $SHELL
680d9dcd5aeSmrgif eval "$MISSING --is-lightweight"; then
681d9dcd5aeSmrg  am_missing_run="$MISSING "
682ba064abeSmrgelse
683ba064abeSmrg  am_missing_run=
684d9dcd5aeSmrg  AC_MSG_WARN(['missing' script is too old or missing])
685ba064abeSmrgfi
686ba064abeSmrg])
687b290cf36Smrg
688ba064abeSmrg# Helper functions for option handling.                     -*- Autoconf -*-
689191cded7Smrg
690d9dcd5aeSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
691ba064abeSmrg#
692ba064abeSmrg# This file is free software; the Free Software Foundation
693ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
694ba064abeSmrg# with or without modifications, as long as this notice is preserved.
695b290cf36Smrg
696ba064abeSmrg# _AM_MANGLE_OPTION(NAME)
697ba064abeSmrg# -----------------------
698ba064abeSmrgAC_DEFUN([_AM_MANGLE_OPTION],
699ba064abeSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
700191cded7Smrg
701ba064abeSmrg# _AM_SET_OPTION(NAME)
702d9dcd5aeSmrg# --------------------
703ba064abeSmrg# Set option NAME.  Presently that only means defining a flag for this option.
704ba064abeSmrgAC_DEFUN([_AM_SET_OPTION],
705d9dcd5aeSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
706191cded7Smrg
707ba064abeSmrg# _AM_SET_OPTIONS(OPTIONS)
708d9dcd5aeSmrg# ------------------------
709ba064abeSmrg# OPTIONS is a space-separated list of Automake options.
710ba064abeSmrgAC_DEFUN([_AM_SET_OPTIONS],
711ba064abeSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
712191cded7Smrg
713ba064abeSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
714ba064abeSmrg# -------------------------------------------
715ba064abeSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
716ba064abeSmrgAC_DEFUN([_AM_IF_OPTION],
717ba064abeSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
718191cded7Smrg
719ba064abeSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
720191cded7Smrg
721d9dcd5aeSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
722ba064abeSmrg#
723ba064abeSmrg# This file is free software; the Free Software Foundation
724ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
725ba064abeSmrg# with or without modifications, as long as this notice is preserved.
726191cded7Smrg
727ba064abeSmrg# AM_SANITY_CHECK
728ba064abeSmrg# ---------------
729ba064abeSmrgAC_DEFUN([AM_SANITY_CHECK],
730ba064abeSmrg[AC_MSG_CHECKING([whether build environment is sane])
731ba064abeSmrg# Reject unsafe characters in $srcdir or the absolute working directory
732ba064abeSmrg# name.  Accept space and tab only in the latter.
733ba064abeSmrgam_lf='
734ba064abeSmrg'
735ba064abeSmrgcase `pwd` in
736ba064abeSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
737ba064abeSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
738ba064abeSmrgesac
739ba064abeSmrgcase $srcdir in
740ba064abeSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
741d9dcd5aeSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
742ba064abeSmrgesac
743b290cf36Smrg
744d9dcd5aeSmrg# Do 'set' in a subshell so we don't clobber the current shell's
745ba064abeSmrg# arguments.  Must try -L first in case configure is actually a
746ba064abeSmrg# symlink; some systems play weird games with the mod time of symlinks
747ba064abeSmrg# (eg FreeBSD returns the mod time of the symlink's containing
748ba064abeSmrg# directory).
749ba064abeSmrgif (
750d9dcd5aeSmrg   am_has_slept=no
751d9dcd5aeSmrg   for am_try in 1 2; do
752d9dcd5aeSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
753d9dcd5aeSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
754d9dcd5aeSmrg     if test "$[*]" = "X"; then
755d9dcd5aeSmrg	# -L didn't work.
756d9dcd5aeSmrg	set X `ls -t "$srcdir/configure" conftest.file`
757d9dcd5aeSmrg     fi
758d9dcd5aeSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
759d9dcd5aeSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
760d9dcd5aeSmrg
761d9dcd5aeSmrg	# If neither matched, then we have a broken ls.  This can happen
762d9dcd5aeSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
763d9dcd5aeSmrg	# broken ls alias from the environment.  This has actually
764d9dcd5aeSmrg	# happened.  Such a system could not be considered "sane".
765d9dcd5aeSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
766d9dcd5aeSmrg  alias in your environment])
767d9dcd5aeSmrg     fi
768d9dcd5aeSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
769d9dcd5aeSmrg       break
770d9dcd5aeSmrg     fi
771d9dcd5aeSmrg     # Just in case.
772d9dcd5aeSmrg     sleep 1
773d9dcd5aeSmrg     am_has_slept=yes
774d9dcd5aeSmrg   done
775ba064abeSmrg   test "$[2]" = conftest.file
776ba064abeSmrg   )
777ba064abeSmrgthen
778ba064abeSmrg   # Ok.
779ba064abeSmrg   :
780ba064abeSmrgelse
781ba064abeSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
782ba064abeSmrgCheck your system clock])
783b290cf36Smrgfi
784d9dcd5aeSmrgAC_MSG_RESULT([yes])
785d9dcd5aeSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
786d9dcd5aeSmrg# generated files are strictly newer.
787d9dcd5aeSmrgam_sleep_pid=
788d9dcd5aeSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
789d9dcd5aeSmrg  ( sleep 1 ) &
790d9dcd5aeSmrg  am_sleep_pid=$!
791d9dcd5aeSmrgfi
792d9dcd5aeSmrgAC_CONFIG_COMMANDS_PRE(
793d9dcd5aeSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
794d9dcd5aeSmrg   if test -n "$am_sleep_pid"; then
795d9dcd5aeSmrg     # Hide warnings about reused PIDs.
796d9dcd5aeSmrg     wait $am_sleep_pid 2>/dev/null
797d9dcd5aeSmrg   fi
798d9dcd5aeSmrg   AC_MSG_RESULT([done])])
799d9dcd5aeSmrgrm -f conftest.file
800d9dcd5aeSmrg])
801b290cf36Smrg
802d9dcd5aeSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
803ba064abeSmrg#
804ba064abeSmrg# This file is free software; the Free Software Foundation
805ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
806ba064abeSmrg# with or without modifications, as long as this notice is preserved.
807191cded7Smrg
808ba064abeSmrg# AM_SILENT_RULES([DEFAULT])
809ba064abeSmrg# --------------------------
810ba064abeSmrg# Enable less verbose build rules; with the default set to DEFAULT
811d9dcd5aeSmrg# ("yes" being less verbose, "no" or empty being verbose).
812ba064abeSmrgAC_DEFUN([AM_SILENT_RULES],
813d9dcd5aeSmrg[AC_ARG_ENABLE([silent-rules], [dnl
814d9dcd5aeSmrgAS_HELP_STRING(
815d9dcd5aeSmrg  [--enable-silent-rules],
816d9dcd5aeSmrg  [less verbose build output (undo: "make V=1")])
817d9dcd5aeSmrgAS_HELP_STRING(
818d9dcd5aeSmrg  [--disable-silent-rules],
819d9dcd5aeSmrg  [verbose build output (undo: "make V=0")])dnl
820d9dcd5aeSmrg])
821d9dcd5aeSmrgcase $enable_silent_rules in @%:@ (((
822d9dcd5aeSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
823d9dcd5aeSmrg   no) AM_DEFAULT_VERBOSITY=1;;
824d9dcd5aeSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
825ba064abeSmrgesac
826d9dcd5aeSmrgdnl
827d9dcd5aeSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
828d9dcd5aeSmrgdnl do not support nested variable expansions.
829d9dcd5aeSmrgdnl See automake bug#9928 and bug#10237.
830d9dcd5aeSmrgam_make=${MAKE-make}
831d9dcd5aeSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
832d9dcd5aeSmrg   [am_cv_make_support_nested_variables],
833d9dcd5aeSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
834d9dcd5aeSmrgBAR0=false
835d9dcd5aeSmrgBAR1=true
836d9dcd5aeSmrgV=1
837d9dcd5aeSmrgam__doit:
838d9dcd5aeSmrg	@$(TRUE)
839d9dcd5aeSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
840d9dcd5aeSmrg  am_cv_make_support_nested_variables=yes
841d9dcd5aeSmrgelse
842d9dcd5aeSmrg  am_cv_make_support_nested_variables=no
843d9dcd5aeSmrgfi])
844d9dcd5aeSmrgif test $am_cv_make_support_nested_variables = yes; then
845d9dcd5aeSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
846d9dcd5aeSmrg  AM_V='$(V)'
847d9dcd5aeSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
848d9dcd5aeSmrgelse
849d9dcd5aeSmrg  AM_V=$AM_DEFAULT_VERBOSITY
850d9dcd5aeSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
851d9dcd5aeSmrgfi
852d9dcd5aeSmrgAC_SUBST([AM_V])dnl
853d9dcd5aeSmrgAM_SUBST_NOTMAKE([AM_V])dnl
854d9dcd5aeSmrgAC_SUBST([AM_DEFAULT_V])dnl
855d9dcd5aeSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
856ba064abeSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
857ba064abeSmrgAM_BACKSLASH='\'
858ba064abeSmrgAC_SUBST([AM_BACKSLASH])dnl
859ba064abeSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
860ba064abeSmrg])
861191cded7Smrg
862d9dcd5aeSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
863b290cf36Smrg#
864ba064abeSmrg# This file is free software; the Free Software Foundation
865ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
866ba064abeSmrg# with or without modifications, as long as this notice is preserved.
867191cded7Smrg
868ba064abeSmrg# AM_PROG_INSTALL_STRIP
869ba064abeSmrg# ---------------------
870d9dcd5aeSmrg# One issue with vendor 'install' (even GNU) is that you can't
871ba064abeSmrg# specify the program used to strip binaries.  This is especially
872ba064abeSmrg# annoying in cross-compiling environments, where the build's strip
873ba064abeSmrg# is unlikely to handle the host's binaries.
874ba064abeSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
875d9dcd5aeSmrg# always use install-sh in "make install-strip", and initialize
876ba064abeSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
877ba064abeSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
878ba064abeSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
879d9dcd5aeSmrg# Installed binaries are usually stripped using 'strip' when the user
880d9dcd5aeSmrg# run "make install-strip".  However 'strip' might not be the right
881ba064abeSmrg# tool to use in cross-compilation environments, therefore Automake
882d9dcd5aeSmrg# will honor the 'STRIP' environment variable to overrule this program.
883d9dcd5aeSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
884ba064abeSmrgif test "$cross_compiling" != no; then
885ba064abeSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
886b290cf36Smrgfi
887ba064abeSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
888ba064abeSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
889191cded7Smrg
890d9dcd5aeSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
891ba064abeSmrg#
892ba064abeSmrg# This file is free software; the Free Software Foundation
893ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
894ba064abeSmrg# with or without modifications, as long as this notice is preserved.
895191cded7Smrg
896ba064abeSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
897ba064abeSmrg# ---------------------------
898ba064abeSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
899ba064abeSmrg# This macro is traced by Automake.
900ba064abeSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
901191cded7Smrg
902ba064abeSmrg# AM_SUBST_NOTMAKE(VARIABLE)
903d9dcd5aeSmrg# --------------------------
904ba064abeSmrg# Public sister of _AM_SUBST_NOTMAKE.
905ba064abeSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
906191cded7Smrg
907ba064abeSmrg# Check how to create a tarball.                            -*- Autoconf -*-
908191cded7Smrg
909d9dcd5aeSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
910ba064abeSmrg#
911ba064abeSmrg# This file is free software; the Free Software Foundation
912ba064abeSmrg# gives unlimited permission to copy and/or distribute it,
913ba064abeSmrg# with or without modifications, as long as this notice is preserved.
914191cded7Smrg
915ba064abeSmrg# _AM_PROG_TAR(FORMAT)
916ba064abeSmrg# --------------------
917ba064abeSmrg# Check how to create a tarball in format FORMAT.
918d9dcd5aeSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
919ba064abeSmrg#
920ba064abeSmrg# Substitute a variable $(am__tar) that is a command
921ba064abeSmrg# writing to stdout a FORMAT-tarball containing the directory
922ba064abeSmrg# $tardir.
923ba064abeSmrg#     tardir=directory && $(am__tar) > result.tar
924ba064abeSmrg#
925ba064abeSmrg# Substitute a variable $(am__untar) that extract such
926ba064abeSmrg# a tarball read from stdin.
927ba064abeSmrg#     $(am__untar) < result.tar
928d9dcd5aeSmrg#
929ba064abeSmrgAC_DEFUN([_AM_PROG_TAR],
930d9dcd5aeSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
931d9dcd5aeSmrg# in the wild :-(  We should find a proper way to deprecate it ...
932d9dcd5aeSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
933d9dcd5aeSmrg
934d9dcd5aeSmrg# We'll loop over all known methods to create a tar archive until one works.
935ba064abeSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
936191cded7Smrg
937d9dcd5aeSmrgm4_if([$1], [v7],
938d9dcd5aeSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
939d9dcd5aeSmrg
940d9dcd5aeSmrg  [m4_case([$1],
941d9dcd5aeSmrg    [ustar],
942d9dcd5aeSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
943d9dcd5aeSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
944d9dcd5aeSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
945d9dcd5aeSmrg      # and bug#13588).
946d9dcd5aeSmrg      am_max_uid=2097151 # 2^21 - 1
947d9dcd5aeSmrg      am_max_gid=$am_max_uid
948d9dcd5aeSmrg      # The $UID and $GID variables are not portable, so we need to resort
949d9dcd5aeSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
950d9dcd5aeSmrg      # below are definitely unexpected, so allow the users to see them
951d9dcd5aeSmrg      # (that is, avoid stderr redirection).
952d9dcd5aeSmrg      am_uid=`id -u || echo unknown`
953d9dcd5aeSmrg      am_gid=`id -g || echo unknown`
954d9dcd5aeSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
955d9dcd5aeSmrg      if test $am_uid -le $am_max_uid; then
956d9dcd5aeSmrg         AC_MSG_RESULT([yes])
957d9dcd5aeSmrg      else
958d9dcd5aeSmrg         AC_MSG_RESULT([no])
959d9dcd5aeSmrg         _am_tools=none
960d9dcd5aeSmrg      fi
961d9dcd5aeSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
962d9dcd5aeSmrg      if test $am_gid -le $am_max_gid; then
963d9dcd5aeSmrg         AC_MSG_RESULT([yes])
964d9dcd5aeSmrg      else
965d9dcd5aeSmrg        AC_MSG_RESULT([no])
966d9dcd5aeSmrg        _am_tools=none
967d9dcd5aeSmrg      fi],
968d9dcd5aeSmrg
969d9dcd5aeSmrg  [pax],
970d9dcd5aeSmrg    [],
971191cded7Smrg
972d9dcd5aeSmrg  [m4_fatal([Unknown tar format])])
973d9dcd5aeSmrg
974d9dcd5aeSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
975d9dcd5aeSmrg
976d9dcd5aeSmrg  # Go ahead even if we have the value already cached.  We do so because we
977d9dcd5aeSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
978d9dcd5aeSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
979d9dcd5aeSmrg
980d9dcd5aeSmrg  for _am_tool in $_am_tools; do
981d9dcd5aeSmrg    case $_am_tool in
982d9dcd5aeSmrg    gnutar)
983d9dcd5aeSmrg      for _am_tar in tar gnutar gtar; do
984d9dcd5aeSmrg        AM_RUN_LOG([$_am_tar --version]) && break
985d9dcd5aeSmrg      done
986d9dcd5aeSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
987d9dcd5aeSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
988d9dcd5aeSmrg      am__untar="$_am_tar -xf -"
989d9dcd5aeSmrg      ;;
990d9dcd5aeSmrg    plaintar)
991d9dcd5aeSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
992d9dcd5aeSmrg      # ustar tarball either.
993d9dcd5aeSmrg      (tar --version) >/dev/null 2>&1 && continue
994d9dcd5aeSmrg      am__tar='tar chf - "$$tardir"'
995d9dcd5aeSmrg      am__tar_='tar chf - "$tardir"'
996d9dcd5aeSmrg      am__untar='tar xf -'
997d9dcd5aeSmrg      ;;
998d9dcd5aeSmrg    pax)
999d9dcd5aeSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
1000d9dcd5aeSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
1001d9dcd5aeSmrg      am__untar='pax -r'
1002d9dcd5aeSmrg      ;;
1003d9dcd5aeSmrg    cpio)
1004d9dcd5aeSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1005d9dcd5aeSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1006d9dcd5aeSmrg      am__untar='cpio -i -H $1 -d'
1007d9dcd5aeSmrg      ;;
1008d9dcd5aeSmrg    none)
1009d9dcd5aeSmrg      am__tar=false
1010d9dcd5aeSmrg      am__tar_=false
1011d9dcd5aeSmrg      am__untar=false
1012d9dcd5aeSmrg      ;;
1013d9dcd5aeSmrg    esac
1014d9dcd5aeSmrg
1015d9dcd5aeSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
1016d9dcd5aeSmrg    # and am__untar set.
1017d9dcd5aeSmrg    test -n "${am_cv_prog_tar_$1}" && break
1018d9dcd5aeSmrg
1019d9dcd5aeSmrg    # tar/untar a dummy directory, and stop if the command works.
1020d9dcd5aeSmrg    rm -rf conftest.dir
1021d9dcd5aeSmrg    mkdir conftest.dir
1022d9dcd5aeSmrg    echo GrepMe > conftest.dir/file
1023d9dcd5aeSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1024d9dcd5aeSmrg    rm -rf conftest.dir
1025d9dcd5aeSmrg    if test -s conftest.tar; then
1026d9dcd5aeSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
1027d9dcd5aeSmrg      AM_RUN_LOG([cat conftest.dir/file])
1028d9dcd5aeSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1029d9dcd5aeSmrg    fi
1030d9dcd5aeSmrg  done
1031ba064abeSmrg  rm -rf conftest.dir
1032191cded7Smrg
1033d9dcd5aeSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1034d9dcd5aeSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1035d9dcd5aeSmrg
1036ba064abeSmrgAC_SUBST([am__tar])
1037ba064abeSmrgAC_SUBST([am__untar])
1038ba064abeSmrg]) # _AM_PROG_TAR
1039b290cf36Smrg
1040d9dcd5aeSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1041d9dcd5aeSmrg#
1042d9dcd5aeSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1043d9dcd5aeSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1044d9dcd5aeSmrg#                 Foundation, Inc.
1045d9dcd5aeSmrg#   Written by Gordon Matzigkeit, 1996
1046d9dcd5aeSmrg#
1047d9dcd5aeSmrg# This file is free software; the Free Software Foundation gives
1048d9dcd5aeSmrg# unlimited permission to copy and/or distribute it, with or without
1049d9dcd5aeSmrg# modifications, as long as this notice is preserved.
1050b290cf36Smrg
1051d9dcd5aeSmrgm4_define([_LT_COPYING], [dnl
1052d9dcd5aeSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1053d9dcd5aeSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1054d9dcd5aeSmrg#                 Foundation, Inc.
1055d9dcd5aeSmrg#   Written by Gordon Matzigkeit, 1996
1056ba064abeSmrg#
1057d9dcd5aeSmrg#   This file is part of GNU Libtool.
1058ba064abeSmrg#
1059d9dcd5aeSmrg# GNU Libtool is free software; you can redistribute it and/or
1060d9dcd5aeSmrg# modify it under the terms of the GNU General Public License as
1061d9dcd5aeSmrg# published by the Free Software Foundation; either version 2 of
1062d9dcd5aeSmrg# the License, or (at your option) any later version.
1063ba064abeSmrg#
1064d9dcd5aeSmrg# As a special exception to the GNU General Public License,
1065d9dcd5aeSmrg# if you distribute this file as part of a program or library that
1066d9dcd5aeSmrg# is built using GNU Libtool, you may include this file under the
1067d9dcd5aeSmrg# same distribution terms that you use for the rest of that program.
1068ba064abeSmrg#
1069d9dcd5aeSmrg# GNU Libtool is distributed in the hope that it will be useful,
1070d9dcd5aeSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
1071d9dcd5aeSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1072d9dcd5aeSmrg# GNU General Public License for more details.
1073ba064abeSmrg#
1074d9dcd5aeSmrg# You should have received a copy of the GNU General Public License
1075d9dcd5aeSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
1076d9dcd5aeSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1077d9dcd5aeSmrg# obtained by writing to the Free Software Foundation, Inc.,
1078d9dcd5aeSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1079d9dcd5aeSmrg])
1080191cded7Smrg
1081d9dcd5aeSmrg# serial 57 LT_INIT
1082b290cf36Smrg
1083b290cf36Smrg
1084d9dcd5aeSmrg# LT_PREREQ(VERSION)
1085d9dcd5aeSmrg# ------------------
1086d9dcd5aeSmrg# Complain and exit if this libtool version is less that VERSION.
1087d9dcd5aeSmrgm4_defun([LT_PREREQ],
1088d9dcd5aeSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1089d9dcd5aeSmrg       [m4_default([$3],
1090d9dcd5aeSmrg		   [m4_fatal([Libtool version $1 or higher is required],
1091d9dcd5aeSmrg		             63)])],
1092d9dcd5aeSmrg       [$2])])
1093b290cf36Smrg
1094b290cf36Smrg
1095d9dcd5aeSmrg# _LT_CHECK_BUILDDIR
1096d9dcd5aeSmrg# ------------------
1097d9dcd5aeSmrg# Complain if the absolute build directory name contains unusual characters
1098d9dcd5aeSmrgm4_defun([_LT_CHECK_BUILDDIR],
1099d9dcd5aeSmrg[case `pwd` in
1100d9dcd5aeSmrg  *\ * | *\	*)
1101d9dcd5aeSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1102d9dcd5aeSmrgesac
1103d9dcd5aeSmrg])
1104b290cf36Smrg
1105b290cf36Smrg
1106d9dcd5aeSmrg# LT_INIT([OPTIONS])
1107d9dcd5aeSmrg# ------------------
1108d9dcd5aeSmrgAC_DEFUN([LT_INIT],
1109d9dcd5aeSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1110d9dcd5aeSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1111d9dcd5aeSmrgAC_BEFORE([$0], [LT_LANG])dnl
1112d9dcd5aeSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
1113d9dcd5aeSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
1114d9dcd5aeSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
1115191cded7Smrg
1116d9dcd5aeSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
1117d9dcd5aeSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1118d9dcd5aeSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1119d9dcd5aeSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1120d9dcd5aeSmrgdnl unless we require an AC_DEFUNed macro:
1121d9dcd5aeSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
1122d9dcd5aeSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
1123d9dcd5aeSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
1124d9dcd5aeSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1125d9dcd5aeSmrgm4_require([_LT_PROG_LTMAIN])dnl
1126191cded7Smrg
1127d9dcd5aeSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1128191cded7Smrg
1129d9dcd5aeSmrgdnl Parse OPTIONS
1130d9dcd5aeSmrg_LT_SET_OPTIONS([$0], [$1])
1131191cded7Smrg
1132d9dcd5aeSmrg# This can be used to rebuild libtool when needed
1133d9dcd5aeSmrgLIBTOOL_DEPS="$ltmain"
1134191cded7Smrg
1135d9dcd5aeSmrg# Always use our own libtool.
1136d9dcd5aeSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1137d9dcd5aeSmrgAC_SUBST(LIBTOOL)dnl
1138191cded7Smrg
1139d9dcd5aeSmrg_LT_SETUP
1140ba064abeSmrg
1141d9dcd5aeSmrg# Only expand once:
1142d9dcd5aeSmrgm4_define([LT_INIT])
1143d9dcd5aeSmrg])# LT_INIT
1144191cded7Smrg
1145d9dcd5aeSmrg# Old names:
1146d9dcd5aeSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1147d9dcd5aeSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1148d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
1149d9dcd5aeSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1150d9dcd5aeSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1151191cded7Smrg
1152191cded7Smrg
1153d9dcd5aeSmrg# _LT_CC_BASENAME(CC)
1154ba064abeSmrg# -------------------
1155d9dcd5aeSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1156d9dcd5aeSmrgm4_defun([_LT_CC_BASENAME],
1157d9dcd5aeSmrg[for cc_temp in $1""; do
1158d9dcd5aeSmrg  case $cc_temp in
1159d9dcd5aeSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1160d9dcd5aeSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1161d9dcd5aeSmrg    \-*) ;;
1162d9dcd5aeSmrg    *) break;;
1163d9dcd5aeSmrg  esac
1164d9dcd5aeSmrgdone
1165d9dcd5aeSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1166d9dcd5aeSmrg])
1167191cded7Smrg
1168191cded7Smrg
1169d9dcd5aeSmrg# _LT_FILEUTILS_DEFAULTS
1170d9dcd5aeSmrg# ----------------------
1171d9dcd5aeSmrg# It is okay to use these file commands and assume they have been set
1172d9dcd5aeSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1173d9dcd5aeSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1174d9dcd5aeSmrg[: ${CP="cp -f"}
1175d9dcd5aeSmrg: ${MV="mv -f"}
1176d9dcd5aeSmrg: ${RM="rm -f"}
1177d9dcd5aeSmrg])# _LT_FILEUTILS_DEFAULTS
1178191cded7Smrg
1179191cded7Smrg
1180d9dcd5aeSmrg# _LT_SETUP
1181d9dcd5aeSmrg# ---------
1182d9dcd5aeSmrgm4_defun([_LT_SETUP],
1183d9dcd5aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1184d9dcd5aeSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1185d9dcd5aeSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1186d9dcd5aeSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1187191cded7Smrg
1188d9dcd5aeSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1189d9dcd5aeSmrgdnl
1190d9dcd5aeSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1191d9dcd5aeSmrg_LT_DECL([], [host], [0])dnl
1192d9dcd5aeSmrg_LT_DECL([], [host_os], [0])dnl
1193d9dcd5aeSmrgdnl
1194d9dcd5aeSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1195d9dcd5aeSmrg_LT_DECL([], [build], [0])dnl
1196d9dcd5aeSmrg_LT_DECL([], [build_os], [0])dnl
1197d9dcd5aeSmrgdnl
1198d9dcd5aeSmrgAC_REQUIRE([AC_PROG_CC])dnl
1199d9dcd5aeSmrgAC_REQUIRE([LT_PATH_LD])dnl
1200d9dcd5aeSmrgAC_REQUIRE([LT_PATH_NM])dnl
1201d9dcd5aeSmrgdnl
1202d9dcd5aeSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1203d9dcd5aeSmrgtest -z "$LN_S" && LN_S="ln -s"
1204d9dcd5aeSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1205d9dcd5aeSmrgdnl
1206d9dcd5aeSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1207d9dcd5aeSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1208d9dcd5aeSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1209d9dcd5aeSmrgdnl
1210d9dcd5aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1211d9dcd5aeSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
1212d9dcd5aeSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1213d9dcd5aeSmrgm4_require([_LT_CMD_RELOAD])dnl
1214d9dcd5aeSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
1215d9dcd5aeSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1216d9dcd5aeSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
1217d9dcd5aeSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1218d9dcd5aeSmrgm4_require([_LT_WITH_SYSROOT])dnl
1219b290cf36Smrg
1220d9dcd5aeSmrg_LT_CONFIG_LIBTOOL_INIT([
1221d9dcd5aeSmrg# See if we are running on zsh, and set the options which allow our
1222d9dcd5aeSmrg# commands through without removal of \ escapes INIT.
1223d9dcd5aeSmrgif test -n "\${ZSH_VERSION+set}" ; then
1224d9dcd5aeSmrg   setopt NO_GLOB_SUBST
1225d9dcd5aeSmrgfi
1226d9dcd5aeSmrg])
1227d9dcd5aeSmrgif test -n "${ZSH_VERSION+set}" ; then
1228d9dcd5aeSmrg   setopt NO_GLOB_SUBST
1229191cded7Smrgfi
1230191cded7Smrg
1231d9dcd5aeSmrg_LT_CHECK_OBJDIR
1232191cded7Smrg
1233d9dcd5aeSmrgm4_require([_LT_TAG_COMPILER])dnl
1234191cded7Smrg
1235d9dcd5aeSmrgcase $host_os in
1236d9dcd5aeSmrgaix3*)
1237d9dcd5aeSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
1238d9dcd5aeSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
1239d9dcd5aeSmrg  # vanish in a puff of smoke.
1240d9dcd5aeSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
1241d9dcd5aeSmrg    COLLECT_NAMES=
1242d9dcd5aeSmrg    export COLLECT_NAMES
1243d9dcd5aeSmrg  fi
1244d9dcd5aeSmrg  ;;
1245d9dcd5aeSmrgesac
1246191cded7Smrg
1247d9dcd5aeSmrg# Global variables:
1248d9dcd5aeSmrgofile=libtool
1249d9dcd5aeSmrgcan_build_shared=yes
1250191cded7Smrg
1251d9dcd5aeSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
1252d9dcd5aeSmrg# which needs '.lib').
1253d9dcd5aeSmrglibext=a
1254191cded7Smrg
1255d9dcd5aeSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1256191cded7Smrg
1257d9dcd5aeSmrgold_CC="$CC"
1258d9dcd5aeSmrgold_CFLAGS="$CFLAGS"
1259191cded7Smrg
1260d9dcd5aeSmrg# Set sane defaults for various variables
1261d9dcd5aeSmrgtest -z "$CC" && CC=cc
1262d9dcd5aeSmrgtest -z "$LTCC" && LTCC=$CC
1263d9dcd5aeSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1264d9dcd5aeSmrgtest -z "$LD" && LD=ld
1265d9dcd5aeSmrgtest -z "$ac_objext" && ac_objext=o
1266191cded7Smrg
1267d9dcd5aeSmrg_LT_CC_BASENAME([$compiler])
1268191cded7Smrg
1269d9dcd5aeSmrg# Only perform the check for file, if the check method requires it
1270d9dcd5aeSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
1271d9dcd5aeSmrgcase $deplibs_check_method in
1272d9dcd5aeSmrgfile_magic*)
1273d9dcd5aeSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1274d9dcd5aeSmrg    _LT_PATH_MAGIC
1275d9dcd5aeSmrg  fi
1276d9dcd5aeSmrg  ;;
1277d9dcd5aeSmrgesac
1278191cded7Smrg
1279d9dcd5aeSmrg# Use C for the default configuration in the libtool script
1280d9dcd5aeSmrgLT_SUPPORTED_TAG([CC])
1281d9dcd5aeSmrg_LT_LANG_C_CONFIG
1282d9dcd5aeSmrg_LT_LANG_DEFAULT_CONFIG
1283d9dcd5aeSmrg_LT_CONFIG_COMMANDS
1284d9dcd5aeSmrg])# _LT_SETUP
1285191cded7Smrg
1286b290cf36Smrg
1287d9dcd5aeSmrg# _LT_PREPARE_SED_QUOTE_VARS
1288d9dcd5aeSmrg# --------------------------
1289d9dcd5aeSmrg# Define a few sed substitution that help us do robust quoting.
1290d9dcd5aeSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1291d9dcd5aeSmrg[# Backslashify metacharacters that are still active within
1292d9dcd5aeSmrg# double-quoted strings.
1293d9dcd5aeSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1294191cded7Smrg
1295d9dcd5aeSmrg# Same as above, but do not quote variable references.
1296d9dcd5aeSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
1297ba064abeSmrg
1298d9dcd5aeSmrg# Sed substitution to delay expansion of an escaped shell variable in a
1299d9dcd5aeSmrg# double_quote_subst'ed string.
1300d9dcd5aeSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1301191cded7Smrg
1302d9dcd5aeSmrg# Sed substitution to delay expansion of an escaped single quote.
1303d9dcd5aeSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1304191cded7Smrg
1305d9dcd5aeSmrg# Sed substitution to avoid accidental globbing in evaled expressions
1306d9dcd5aeSmrgno_glob_subst='s/\*/\\\*/g'
1307d9dcd5aeSmrg])
1308ba064abeSmrg
1309d9dcd5aeSmrg# _LT_PROG_LTMAIN
1310d9dcd5aeSmrg# ---------------
1311d9dcd5aeSmrg# Note that this code is called both from `configure', and `config.status'
1312d9dcd5aeSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1313d9dcd5aeSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
1314d9dcd5aeSmrg# so we pass a copy along to make sure it has a sensible value anyway.
1315d9dcd5aeSmrgm4_defun([_LT_PROG_LTMAIN],
1316d9dcd5aeSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1317d9dcd5aeSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1318d9dcd5aeSmrgltmain="$ac_aux_dir/ltmain.sh"
1319d9dcd5aeSmrg])# _LT_PROG_LTMAIN
1320ba064abeSmrg
1321b290cf36Smrg
1322ba064abeSmrg
1323d9dcd5aeSmrg# So that we can recreate a full libtool script including additional
1324d9dcd5aeSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1325d9dcd5aeSmrg# in macros and then make a single call at the end using the `libtool'
1326d9dcd5aeSmrg# label.
1327191cded7Smrg
1328ba064abeSmrg
1329d9dcd5aeSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1330d9dcd5aeSmrg# ----------------------------------------
1331d9dcd5aeSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1332d9dcd5aeSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
1333d9dcd5aeSmrg[m4_ifval([$1],
1334d9dcd5aeSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1335d9dcd5aeSmrg                     [$1
1336d9dcd5aeSmrg])])])
1337b290cf36Smrg
1338d9dcd5aeSmrg# Initialize.
1339d9dcd5aeSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
1340b290cf36Smrg
1341191cded7Smrg
1342d9dcd5aeSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
1343d9dcd5aeSmrg# ------------------------------
1344d9dcd5aeSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1345d9dcd5aeSmrgm4_define([_LT_CONFIG_LIBTOOL],
1346d9dcd5aeSmrg[m4_ifval([$1],
1347d9dcd5aeSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1348d9dcd5aeSmrg                     [$1
1349d9dcd5aeSmrg])])])
1350191cded7Smrg
1351d9dcd5aeSmrg# Initialize.
1352d9dcd5aeSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1353ba064abeSmrg
1354b290cf36Smrg
1355d9dcd5aeSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1356d9dcd5aeSmrg# -----------------------------------------------------
1357d9dcd5aeSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
1358d9dcd5aeSmrg[_LT_CONFIG_LIBTOOL([$1])
1359d9dcd5aeSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
1360d9dcd5aeSmrg])
1361ba064abeSmrg
1362b290cf36Smrg
1363d9dcd5aeSmrg# _LT_FORMAT_COMMENT([COMMENT])
1364d9dcd5aeSmrg# -----------------------------
1365d9dcd5aeSmrg# Add leading comment marks to the start of each line, and a trailing
1366d9dcd5aeSmrg# full-stop to the whole comment if one is not present already.
1367d9dcd5aeSmrgm4_define([_LT_FORMAT_COMMENT],
1368d9dcd5aeSmrg[m4_ifval([$1], [
1369d9dcd5aeSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1370d9dcd5aeSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1371d9dcd5aeSmrg)])
1372ba064abeSmrg
1373ba064abeSmrg
1374b290cf36Smrg
1375b290cf36Smrg
1376b290cf36Smrg
1377d9dcd5aeSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1378d9dcd5aeSmrg# -------------------------------------------------------------------
1379d9dcd5aeSmrg# CONFIGNAME is the name given to the value in the libtool script.
1380d9dcd5aeSmrg# VARNAME is the (base) name used in the configure script.
1381d9dcd5aeSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1382d9dcd5aeSmrg# VARNAME.  Any other value will be used directly.
1383d9dcd5aeSmrgm4_define([_LT_DECL],
1384d9dcd5aeSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1385d9dcd5aeSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1386d9dcd5aeSmrg	[m4_ifval([$1], [$1], [$2])])
1387d9dcd5aeSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1388d9dcd5aeSmrg    m4_ifval([$4],
1389d9dcd5aeSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1390d9dcd5aeSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
1391d9dcd5aeSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
1392d9dcd5aeSmrg])
1393b290cf36Smrg
1394b290cf36Smrg
1395d9dcd5aeSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1396d9dcd5aeSmrg# --------------------------------------------------------
1397d9dcd5aeSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1398191cded7Smrg
1399191cded7Smrg
1400d9dcd5aeSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1401d9dcd5aeSmrg# ------------------------------------------------
1402d9dcd5aeSmrgm4_define([lt_decl_tag_varnames],
1403d9dcd5aeSmrg[_lt_decl_filter([tagged?], [yes], $@)])
1404b290cf36Smrg
1405191cded7Smrg
1406d9dcd5aeSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1407d9dcd5aeSmrg# ---------------------------------------------------------
1408d9dcd5aeSmrgm4_define([_lt_decl_filter],
1409d9dcd5aeSmrg[m4_case([$#],
1410d9dcd5aeSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
1411d9dcd5aeSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1412d9dcd5aeSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1413d9dcd5aeSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1414d9dcd5aeSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1415d9dcd5aeSmrg])
1416191cded7Smrg
1417191cded7Smrg
1418d9dcd5aeSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1419d9dcd5aeSmrg# --------------------------------------------------
1420d9dcd5aeSmrgm4_define([lt_decl_quote_varnames],
1421d9dcd5aeSmrg[_lt_decl_filter([value], [1], $@)])
1422191cded7Smrg
1423191cded7Smrg
1424d9dcd5aeSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1425d9dcd5aeSmrg# ---------------------------------------------------
1426d9dcd5aeSmrgm4_define([lt_decl_dquote_varnames],
1427d9dcd5aeSmrg[_lt_decl_filter([value], [2], $@)])
1428191cded7Smrg
1429191cded7Smrg
1430d9dcd5aeSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1431d9dcd5aeSmrg# ---------------------------------------------------
1432d9dcd5aeSmrgm4_define([lt_decl_varnames_tagged],
1433d9dcd5aeSmrg[m4_assert([$# <= 2])dnl
1434d9dcd5aeSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
1435d9dcd5aeSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1436d9dcd5aeSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1437d9dcd5aeSmrgm4_define([_lt_decl_varnames_tagged],
1438d9dcd5aeSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1439b290cf36Smrg
1440191cded7Smrg
1441d9dcd5aeSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1442d9dcd5aeSmrg# ------------------------------------------------
1443d9dcd5aeSmrgm4_define([lt_decl_all_varnames],
1444d9dcd5aeSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
1445d9dcd5aeSmrg     m4_if([$2], [],
1446d9dcd5aeSmrg	   m4_quote(lt_decl_varnames),
1447d9dcd5aeSmrg	m4_quote(m4_shift($@))))[]dnl
1448d9dcd5aeSmrg])
1449d9dcd5aeSmrgm4_define([_lt_decl_all_varnames],
1450d9dcd5aeSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
1451d9dcd5aeSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1452d9dcd5aeSmrg])
1453191cded7Smrg
1454191cded7Smrg
1455d9dcd5aeSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1456d9dcd5aeSmrg# ------------------------------------
1457d9dcd5aeSmrg# Quote a variable value, and forward it to `config.status' so that its
1458d9dcd5aeSmrg# declaration there will have the same value as in `configure'.  VARNAME
1459d9dcd5aeSmrg# must have a single quote delimited value for this to work.
1460d9dcd5aeSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
1461d9dcd5aeSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1462191cded7Smrg
1463191cded7Smrg
1464d9dcd5aeSmrg# _LT_CONFIG_STATUS_DECLARATIONS
1465d9dcd5aeSmrg# ------------------------------
1466d9dcd5aeSmrg# We delimit libtool config variables with single quotes, so when
1467d9dcd5aeSmrg# we write them to config.status, we have to be sure to quote all
1468d9dcd5aeSmrg# embedded single quotes properly.  In configure, this macro expands
1469d9dcd5aeSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1470ba064abeSmrg#
1471d9dcd5aeSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1472d9dcd5aeSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1473d9dcd5aeSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1474d9dcd5aeSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1475191cded7Smrg
1476191cded7Smrg
1477d9dcd5aeSmrg# _LT_LIBTOOL_TAGS
1478ba064abeSmrg# ----------------
1479d9dcd5aeSmrg# Output comment and list of tags supported by the script
1480d9dcd5aeSmrgm4_defun([_LT_LIBTOOL_TAGS],
1481d9dcd5aeSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1482d9dcd5aeSmrgavailable_tags="_LT_TAGS"dnl
1483d9dcd5aeSmrg])
1484191cded7Smrg
1485191cded7Smrg
1486d9dcd5aeSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1487d9dcd5aeSmrg# -----------------------------------
1488d9dcd5aeSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
1489d9dcd5aeSmrg# expand to a commented shell variable setting:
1490ba064abeSmrg#
1491d9dcd5aeSmrg#    # Some comment about what VAR is for.
1492d9dcd5aeSmrg#    visible_name=$lt_internal_name
1493d9dcd5aeSmrgm4_define([_LT_LIBTOOL_DECLARE],
1494d9dcd5aeSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1495d9dcd5aeSmrg					   [description])))[]dnl
1496d9dcd5aeSmrgm4_pushdef([_libtool_name],
1497d9dcd5aeSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1498d9dcd5aeSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1499d9dcd5aeSmrg    [0], [_libtool_name=[$]$1],
1500d9dcd5aeSmrg    [1], [_libtool_name=$lt_[]$1],
1501d9dcd5aeSmrg    [2], [_libtool_name=$lt_[]$1],
1502d9dcd5aeSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1503d9dcd5aeSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1504d9dcd5aeSmrg])
1505191cded7Smrg
1506191cded7Smrg
1507d9dcd5aeSmrg# _LT_LIBTOOL_CONFIG_VARS
1508d9dcd5aeSmrg# -----------------------
1509d9dcd5aeSmrg# Produce commented declarations of non-tagged libtool config variables
1510d9dcd5aeSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1511d9dcd5aeSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1512d9dcd5aeSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
1513d9dcd5aeSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
1514d9dcd5aeSmrg[m4_foreach([_lt_var],
1515d9dcd5aeSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1516d9dcd5aeSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1517191cded7Smrg
1518191cded7Smrg
1519d9dcd5aeSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
1520d9dcd5aeSmrg# -------------------------
1521d9dcd5aeSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
1522d9dcd5aeSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1523d9dcd5aeSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1524191cded7Smrg
1525191cded7Smrg
1526d9dcd5aeSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
1527d9dcd5aeSmrg# ------------------------------
1528d9dcd5aeSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1529191cded7Smrg
1530191cded7Smrg
1531d9dcd5aeSmrg# _LT_CONFIG_COMMANDS
1532d9dcd5aeSmrg# -------------------
1533d9dcd5aeSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1534d9dcd5aeSmrg# variables for single and double quote escaping we saved from calls
1535d9dcd5aeSmrg# to _LT_DECL, we can put quote escaped variables declarations
1536d9dcd5aeSmrg# into `config.status', and then the shell code to quote escape them in
1537d9dcd5aeSmrg# for loops in `config.status'.  Finally, any additional code accumulated
1538d9dcd5aeSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1539d9dcd5aeSmrgm4_defun([_LT_CONFIG_COMMANDS],
1540d9dcd5aeSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
1541d9dcd5aeSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
1542d9dcd5aeSmrg	dnl instead of duplicating it all over again into config.status,
1543d9dcd5aeSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
1544d9dcd5aeSmrg	dnl needs to know what name is stored there:
1545d9dcd5aeSmrg        [AC_CONFIG_COMMANDS([libtool],
1546d9dcd5aeSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1547d9dcd5aeSmrg    dnl If the libtool generation code is destined for config.status,
1548d9dcd5aeSmrg    dnl expand the accumulated commands and init code now:
1549d9dcd5aeSmrg    [AC_CONFIG_COMMANDS([libtool],
1550d9dcd5aeSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1551d9dcd5aeSmrg])#_LT_CONFIG_COMMANDS
1552191cded7Smrg
1553191cded7Smrg
1554d9dcd5aeSmrg# Initialize.
1555d9dcd5aeSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1556d9dcd5aeSmrg[
1557191cded7Smrg
1558d9dcd5aeSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
1559d9dcd5aeSmrg# if CDPATH is set.
1560d9dcd5aeSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1561191cded7Smrg
1562d9dcd5aeSmrgsed_quote_subst='$sed_quote_subst'
1563d9dcd5aeSmrgdouble_quote_subst='$double_quote_subst'
1564d9dcd5aeSmrgdelay_variable_subst='$delay_variable_subst'
1565d9dcd5aeSmrg_LT_CONFIG_STATUS_DECLARATIONS
1566d9dcd5aeSmrgLTCC='$LTCC'
1567d9dcd5aeSmrgLTCFLAGS='$LTCFLAGS'
1568d9dcd5aeSmrgcompiler='$compiler_DEFAULT'
1569191cded7Smrg
1570d9dcd5aeSmrg# A function that is used when there is no print builtin or printf.
1571d9dcd5aeSmrgfunc_fallback_echo ()
1572d9dcd5aeSmrg{
1573d9dcd5aeSmrg  eval 'cat <<_LTECHO_EOF
1574d9dcd5aeSmrg\$[]1
1575d9dcd5aeSmrg_LTECHO_EOF'
1576d9dcd5aeSmrg}
1577ba064abeSmrg
1578d9dcd5aeSmrg# Quote evaled strings.
1579d9dcd5aeSmrgfor var in lt_decl_all_varnames([[ \
1580d9dcd5aeSmrg]], lt_decl_quote_varnames); do
1581d9dcd5aeSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1582d9dcd5aeSmrg    *[[\\\\\\\`\\"\\\$]]*)
1583d9dcd5aeSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1584d9dcd5aeSmrg      ;;
1585d9dcd5aeSmrg    *)
1586d9dcd5aeSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1587d9dcd5aeSmrg      ;;
1588d9dcd5aeSmrg    esac
1589d9dcd5aeSmrgdone
1590191cded7Smrg
1591d9dcd5aeSmrg# Double-quote double-evaled strings.
1592d9dcd5aeSmrgfor var in lt_decl_all_varnames([[ \
1593d9dcd5aeSmrg]], lt_decl_dquote_varnames); do
1594d9dcd5aeSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1595d9dcd5aeSmrg    *[[\\\\\\\`\\"\\\$]]*)
1596d9dcd5aeSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1597d9dcd5aeSmrg      ;;
1598d9dcd5aeSmrg    *)
1599d9dcd5aeSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1600d9dcd5aeSmrg      ;;
1601d9dcd5aeSmrg    esac
1602d9dcd5aeSmrgdone
1603191cded7Smrg
1604d9dcd5aeSmrg_LT_OUTPUT_LIBTOOL_INIT
1605ba064abeSmrg])
1606191cded7Smrg
1607d9dcd5aeSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1608d9dcd5aeSmrg# ------------------------------------
1609d9dcd5aeSmrg# Generate a child script FILE with all initialization necessary to
1610d9dcd5aeSmrg# reuse the environment learned by the parent script, and make the
1611d9dcd5aeSmrg# file executable.  If COMMENT is supplied, it is inserted after the
1612d9dcd5aeSmrg# `#!' sequence but before initialization text begins.  After this
1613d9dcd5aeSmrg# macro, additional text can be appended to FILE to form the body of
1614d9dcd5aeSmrg# the child script.  The macro ends with non-zero status if the
1615d9dcd5aeSmrg# file could not be fully written (such as if the disk is full).
1616d9dcd5aeSmrgm4_ifdef([AS_INIT_GENERATED],
1617d9dcd5aeSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1618d9dcd5aeSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
1619d9dcd5aeSmrg[m4_require([AS_PREPARE])]dnl
1620d9dcd5aeSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1621d9dcd5aeSmrg[lt_write_fail=0
1622d9dcd5aeSmrgcat >$1 <<_ASEOF || lt_write_fail=1
1623d9dcd5aeSmrg#! $SHELL
1624d9dcd5aeSmrg# Generated by $as_me.
1625d9dcd5aeSmrg$2
1626d9dcd5aeSmrgSHELL=\${CONFIG_SHELL-$SHELL}
1627d9dcd5aeSmrgexport SHELL
1628d9dcd5aeSmrg_ASEOF
1629d9dcd5aeSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
1630d9dcd5aeSmrgAS_SHELL_SANITIZE
1631d9dcd5aeSmrg_AS_PREPARE
1632d9dcd5aeSmrgexec AS_MESSAGE_FD>&1
1633d9dcd5aeSmrg_ASEOF
1634d9dcd5aeSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
1635d9dcd5aeSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1636191cded7Smrg
1637d9dcd5aeSmrg# LT_OUTPUT
1638d9dcd5aeSmrg# ---------
1639d9dcd5aeSmrg# This macro allows early generation of the libtool script (before
1640d9dcd5aeSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
1641d9dcd5aeSmrg# tests.
1642d9dcd5aeSmrgAC_DEFUN([LT_OUTPUT],
1643d9dcd5aeSmrg[: ${CONFIG_LT=./config.lt}
1644d9dcd5aeSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
1645d9dcd5aeSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1646d9dcd5aeSmrg[# Run this file to recreate a libtool stub with the current configuration.])
1647191cded7Smrg
1648d9dcd5aeSmrgcat >>"$CONFIG_LT" <<\_LTEOF
1649d9dcd5aeSmrglt_cl_silent=false
1650d9dcd5aeSmrgexec AS_MESSAGE_LOG_FD>>config.log
1651d9dcd5aeSmrg{
1652d9dcd5aeSmrg  echo
1653d9dcd5aeSmrg  AS_BOX([Running $as_me.])
1654d9dcd5aeSmrg} >&AS_MESSAGE_LOG_FD
1655191cded7Smrg
1656d9dcd5aeSmrglt_cl_help="\
1657d9dcd5aeSmrg\`$as_me' creates a local libtool stub from the current configuration,
1658d9dcd5aeSmrgfor use in further configure time tests before the real libtool is
1659d9dcd5aeSmrggenerated.
1660191cded7Smrg
1661d9dcd5aeSmrgUsage: $[0] [[OPTIONS]]
1662191cded7Smrg
1663d9dcd5aeSmrg  -h, --help      print this help, then exit
1664d9dcd5aeSmrg  -V, --version   print version number, then exit
1665d9dcd5aeSmrg  -q, --quiet     do not print progress messages
1666d9dcd5aeSmrg  -d, --debug     don't remove temporary files
1667191cded7Smrg
1668d9dcd5aeSmrgReport bugs to <bug-libtool@gnu.org>."
1669191cded7Smrg
1670d9dcd5aeSmrglt_cl_version="\
1671d9dcd5aeSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1672d9dcd5aeSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1673d9dcd5aeSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
1674191cded7Smrg
1675d9dcd5aeSmrgCopyright (C) 2011 Free Software Foundation, Inc.
1676d9dcd5aeSmrgThis config.lt script is free software; the Free Software Foundation
1677d9dcd5aeSmrggives unlimited permision to copy, distribute and modify it."
1678191cded7Smrg
1679d9dcd5aeSmrgwhile test $[#] != 0
1680d9dcd5aeSmrgdo
1681d9dcd5aeSmrg  case $[1] in
1682d9dcd5aeSmrg    --version | --v* | -V )
1683d9dcd5aeSmrg      echo "$lt_cl_version"; exit 0 ;;
1684d9dcd5aeSmrg    --help | --h* | -h )
1685d9dcd5aeSmrg      echo "$lt_cl_help"; exit 0 ;;
1686d9dcd5aeSmrg    --debug | --d* | -d )
1687d9dcd5aeSmrg      debug=: ;;
1688d9dcd5aeSmrg    --quiet | --q* | --silent | --s* | -q )
1689d9dcd5aeSmrg      lt_cl_silent=: ;;
1690191cded7Smrg
1691d9dcd5aeSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
1692d9dcd5aeSmrgTry \`$[0] --help' for more information.]) ;;
1693ba064abeSmrg
1694d9dcd5aeSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
1695d9dcd5aeSmrgTry \`$[0] --help' for more information.]) ;;
1696d9dcd5aeSmrg  esac
1697d9dcd5aeSmrg  shift
1698d9dcd5aeSmrgdone
1699ba064abeSmrg
1700d9dcd5aeSmrgif $lt_cl_silent; then
1701d9dcd5aeSmrg  exec AS_MESSAGE_FD>/dev/null
1702d9dcd5aeSmrgfi
1703d9dcd5aeSmrg_LTEOF
1704ba064abeSmrg
1705d9dcd5aeSmrgcat >>"$CONFIG_LT" <<_LTEOF
1706d9dcd5aeSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1707d9dcd5aeSmrg_LTEOF
1708ba064abeSmrg
1709d9dcd5aeSmrgcat >>"$CONFIG_LT" <<\_LTEOF
1710d9dcd5aeSmrgAC_MSG_NOTICE([creating $ofile])
1711d9dcd5aeSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
1712d9dcd5aeSmrgAS_EXIT(0)
1713d9dcd5aeSmrg_LTEOF
1714d9dcd5aeSmrgchmod +x "$CONFIG_LT"
1715191cded7Smrg
1716d9dcd5aeSmrg# configure is writing to config.log, but config.lt does its own redirection,
1717d9dcd5aeSmrg# appending to config.log, which fails on DOS, as config.log is still kept
1718d9dcd5aeSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
1719d9dcd5aeSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
1720d9dcd5aeSmrglt_cl_success=:
1721d9dcd5aeSmrgtest "$silent" = yes &&
1722d9dcd5aeSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
1723d9dcd5aeSmrgexec AS_MESSAGE_LOG_FD>/dev/null
1724d9dcd5aeSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1725d9dcd5aeSmrgexec AS_MESSAGE_LOG_FD>>config.log
1726d9dcd5aeSmrg$lt_cl_success || AS_EXIT(1)
1727d9dcd5aeSmrg])# LT_OUTPUT
1728191cded7Smrg
1729191cded7Smrg
1730d9dcd5aeSmrg# _LT_CONFIG(TAG)
1731d9dcd5aeSmrg# ---------------
1732d9dcd5aeSmrg# If TAG is the built-in tag, create an initial libtool script with a
1733d9dcd5aeSmrg# default configuration from the untagged config vars.  Otherwise add code
1734d9dcd5aeSmrg# to config.status for appending the configuration named by TAG from the
1735d9dcd5aeSmrg# matching tagged config vars.
1736d9dcd5aeSmrgm4_defun([_LT_CONFIG],
1737d9dcd5aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1738d9dcd5aeSmrg_LT_CONFIG_SAVE_COMMANDS([
1739d9dcd5aeSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1740d9dcd5aeSmrg  m4_if(_LT_TAG, [C], [
1741d9dcd5aeSmrg    # See if we are running on zsh, and set the options which allow our
1742d9dcd5aeSmrg    # commands through without removal of \ escapes.
1743d9dcd5aeSmrg    if test -n "${ZSH_VERSION+set}" ; then
1744d9dcd5aeSmrg      setopt NO_GLOB_SUBST
1745d9dcd5aeSmrg    fi
1746191cded7Smrg
1747d9dcd5aeSmrg    cfgfile="${ofile}T"
1748d9dcd5aeSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1749d9dcd5aeSmrg    $RM "$cfgfile"
1750191cded7Smrg
1751d9dcd5aeSmrg    cat <<_LT_EOF >> "$cfgfile"
1752d9dcd5aeSmrg#! $SHELL
1753191cded7Smrg
1754d9dcd5aeSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1755d9dcd5aeSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1756d9dcd5aeSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1757d9dcd5aeSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1758d9dcd5aeSmrg#
1759d9dcd5aeSmrg_LT_COPYING
1760d9dcd5aeSmrg_LT_LIBTOOL_TAGS
1761191cded7Smrg
1762d9dcd5aeSmrg# ### BEGIN LIBTOOL CONFIG
1763d9dcd5aeSmrg_LT_LIBTOOL_CONFIG_VARS
1764d9dcd5aeSmrg_LT_LIBTOOL_TAG_VARS
1765d9dcd5aeSmrg# ### END LIBTOOL CONFIG
1766b290cf36Smrg
1767d9dcd5aeSmrg_LT_EOF
1768b290cf36Smrg
1769d9dcd5aeSmrg  case $host_os in
1770d9dcd5aeSmrg  aix3*)
1771d9dcd5aeSmrg    cat <<\_LT_EOF >> "$cfgfile"
1772d9dcd5aeSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
1773d9dcd5aeSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
1774d9dcd5aeSmrg# vanish in a puff of smoke.
1775d9dcd5aeSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
1776d9dcd5aeSmrg  COLLECT_NAMES=
1777d9dcd5aeSmrg  export COLLECT_NAMES
1778d9dcd5aeSmrgfi
1779d9dcd5aeSmrg_LT_EOF
1780d9dcd5aeSmrg    ;;
1781d9dcd5aeSmrg  esac
1782b290cf36Smrg
1783d9dcd5aeSmrg  _LT_PROG_LTMAIN
1784b290cf36Smrg
1785d9dcd5aeSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
1786d9dcd5aeSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1787d9dcd5aeSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
1788d9dcd5aeSmrg  # is reportedly fixed, but why not run on old versions too?
1789d9dcd5aeSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
1790d9dcd5aeSmrg     || (rm -f "$cfgfile"; exit 1)
1791b290cf36Smrg
1792d9dcd5aeSmrg  _LT_PROG_REPLACE_SHELLFNS
1793191cded7Smrg
1794d9dcd5aeSmrg   mv -f "$cfgfile" "$ofile" ||
1795d9dcd5aeSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1796d9dcd5aeSmrg  chmod +x "$ofile"
1797d9dcd5aeSmrg],
1798d9dcd5aeSmrg[cat <<_LT_EOF >> "$ofile"
1799191cded7Smrg
1800d9dcd5aeSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1801d9dcd5aeSmrgdnl in a comment (ie after a #).
1802d9dcd5aeSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
1803d9dcd5aeSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1804d9dcd5aeSmrg# ### END LIBTOOL TAG CONFIG: $1
1805d9dcd5aeSmrg_LT_EOF
1806d9dcd5aeSmrg])dnl /m4_if
1807d9dcd5aeSmrg],
1808d9dcd5aeSmrg[m4_if([$1], [], [
1809d9dcd5aeSmrg    PACKAGE='$PACKAGE'
1810d9dcd5aeSmrg    VERSION='$VERSION'
1811d9dcd5aeSmrg    TIMESTAMP='$TIMESTAMP'
1812d9dcd5aeSmrg    RM='$RM'
1813d9dcd5aeSmrg    ofile='$ofile'], [])
1814d9dcd5aeSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
1815d9dcd5aeSmrg])# _LT_CONFIG
1816b290cf36Smrg
1817ba064abeSmrg
1818d9dcd5aeSmrg# LT_SUPPORTED_TAG(TAG)
1819d9dcd5aeSmrg# ---------------------
1820d9dcd5aeSmrg# Trace this macro to discover what tags are supported by the libtool
1821d9dcd5aeSmrg# --tag option, using:
1822d9dcd5aeSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1823d9dcd5aeSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
1824191cded7Smrg
1825b290cf36Smrg
1826d9dcd5aeSmrg# C support is built-in for now
1827d9dcd5aeSmrgm4_define([_LT_LANG_C_enabled], [])
1828d9dcd5aeSmrgm4_define([_LT_TAGS], [])
1829b290cf36Smrg
1830b290cf36Smrg
1831d9dcd5aeSmrg# LT_LANG(LANG)
1832d9dcd5aeSmrg# -------------
1833d9dcd5aeSmrg# Enable libtool support for the given language if not already enabled.
1834d9dcd5aeSmrgAC_DEFUN([LT_LANG],
1835d9dcd5aeSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
1836d9dcd5aeSmrgm4_case([$1],
1837d9dcd5aeSmrg  [C],			[_LT_LANG(C)],
1838d9dcd5aeSmrg  [C++],		[_LT_LANG(CXX)],
1839d9dcd5aeSmrg  [Go],			[_LT_LANG(GO)],
1840d9dcd5aeSmrg  [Java],		[_LT_LANG(GCJ)],
1841d9dcd5aeSmrg  [Fortran 77],		[_LT_LANG(F77)],
1842d9dcd5aeSmrg  [Fortran],		[_LT_LANG(FC)],
1843d9dcd5aeSmrg  [Windows Resource],	[_LT_LANG(RC)],
1844d9dcd5aeSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1845d9dcd5aeSmrg    [_LT_LANG($1)],
1846d9dcd5aeSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1847d9dcd5aeSmrg])# LT_LANG
1848b290cf36Smrg
1849191cded7Smrg
1850d9dcd5aeSmrg# _LT_LANG(LANGNAME)
1851d9dcd5aeSmrg# ------------------
1852d9dcd5aeSmrgm4_defun([_LT_LANG],
1853d9dcd5aeSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1854d9dcd5aeSmrg  [LT_SUPPORTED_TAG([$1])dnl
1855d9dcd5aeSmrg  m4_append([_LT_TAGS], [$1 ])dnl
1856d9dcd5aeSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1857d9dcd5aeSmrg  _LT_LANG_$1_CONFIG($1)])dnl
1858d9dcd5aeSmrg])# _LT_LANG
1859191cded7Smrg
1860191cded7Smrg
1861d9dcd5aeSmrgm4_ifndef([AC_PROG_GO], [
1862d9dcd5aeSmrg# NOTE: This macro has been submitted for inclusion into   #
1863d9dcd5aeSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1864d9dcd5aeSmrg#  a released version of Autoconf we should remove this    #
1865d9dcd5aeSmrg#  macro and use it instead.                               #
1866d9dcd5aeSmrgm4_defun([AC_PROG_GO],
1867d9dcd5aeSmrg[AC_LANG_PUSH(Go)dnl
1868d9dcd5aeSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
1869d9dcd5aeSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1870d9dcd5aeSmrg_AC_ARG_VAR_LDFLAGS()dnl
1871d9dcd5aeSmrgAC_CHECK_TOOL(GOC, gccgo)
1872d9dcd5aeSmrgif test -z "$GOC"; then
1873d9dcd5aeSmrg  if test -n "$ac_tool_prefix"; then
1874d9dcd5aeSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1875d9dcd5aeSmrg  fi
1876d9dcd5aeSmrgfi
1877d9dcd5aeSmrgif test -z "$GOC"; then
1878d9dcd5aeSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1879d9dcd5aeSmrgfi
1880d9dcd5aeSmrg])#m4_defun
1881d9dcd5aeSmrg])#m4_ifndef
1882191cded7Smrg
1883191cded7Smrg
1884d9dcd5aeSmrg# _LT_LANG_DEFAULT_CONFIG
1885d9dcd5aeSmrg# -----------------------
1886d9dcd5aeSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
1887d9dcd5aeSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1888d9dcd5aeSmrg  [LT_LANG(CXX)],
1889d9dcd5aeSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1890191cded7Smrg
1891d9dcd5aeSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
1892d9dcd5aeSmrg  [LT_LANG(F77)],
1893d9dcd5aeSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
1894191cded7Smrg
1895d9dcd5aeSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
1896d9dcd5aeSmrg  [LT_LANG(FC)],
1897d9dcd5aeSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
1898191cded7Smrg
1899d9dcd5aeSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
1900d9dcd5aeSmrgdnl pulling things in needlessly.
1901d9dcd5aeSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
1902d9dcd5aeSmrg  [LT_LANG(GCJ)],
1903d9dcd5aeSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1904d9dcd5aeSmrg    [LT_LANG(GCJ)],
1905d9dcd5aeSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
1906d9dcd5aeSmrg      [LT_LANG(GCJ)],
1907d9dcd5aeSmrg      [m4_ifdef([AC_PROG_GCJ],
1908d9dcd5aeSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
1909d9dcd5aeSmrg       m4_ifdef([A][M_PROG_GCJ],
1910d9dcd5aeSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
1911d9dcd5aeSmrg       m4_ifdef([LT_PROG_GCJ],
1912d9dcd5aeSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
1913191cded7Smrg
1914d9dcd5aeSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
1915d9dcd5aeSmrg  [LT_LANG(GO)],
1916d9dcd5aeSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
1917191cded7Smrg
1918d9dcd5aeSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
1919d9dcd5aeSmrg  [LT_LANG(RC)],
1920d9dcd5aeSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
1921d9dcd5aeSmrg])# _LT_LANG_DEFAULT_CONFIG
1922191cded7Smrg
1923d9dcd5aeSmrg# Obsolete macros:
1924d9dcd5aeSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
1925d9dcd5aeSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
1926d9dcd5aeSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
1927d9dcd5aeSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
1928d9dcd5aeSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
1929d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
1930d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
1931d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
1932d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
1933d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
1934d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
1935191cded7Smrg
1936191cded7Smrg
1937d9dcd5aeSmrg# _LT_TAG_COMPILER
1938d9dcd5aeSmrg# ----------------
1939d9dcd5aeSmrgm4_defun([_LT_TAG_COMPILER],
1940d9dcd5aeSmrg[AC_REQUIRE([AC_PROG_CC])dnl
1941191cded7Smrg
1942d9dcd5aeSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
1943d9dcd5aeSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
1944d9dcd5aeSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
1945d9dcd5aeSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
1946191cded7Smrg
1947d9dcd5aeSmrg# If no C compiler was specified, use CC.
1948d9dcd5aeSmrgLTCC=${LTCC-"$CC"}
1949191cded7Smrg
1950d9dcd5aeSmrg# If no C compiler flags were specified, use CFLAGS.
1951d9dcd5aeSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1952191cded7Smrg
1953d9dcd5aeSmrg# Allow CC to be a program name with arguments.
1954d9dcd5aeSmrgcompiler=$CC
1955d9dcd5aeSmrg])# _LT_TAG_COMPILER
1956191cded7Smrg
1957b290cf36Smrg
1958d9dcd5aeSmrg# _LT_COMPILER_BOILERPLATE
1959d9dcd5aeSmrg# ------------------------
1960d9dcd5aeSmrg# Check for compiler boilerplate output or warnings with
1961d9dcd5aeSmrg# the simple compiler test code.
1962d9dcd5aeSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
1963d9dcd5aeSmrg[m4_require([_LT_DECL_SED])dnl
1964d9dcd5aeSmrgac_outfile=conftest.$ac_objext
1965d9dcd5aeSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
1966d9dcd5aeSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1967d9dcd5aeSmrg_lt_compiler_boilerplate=`cat conftest.err`
1968d9dcd5aeSmrg$RM conftest*
1969d9dcd5aeSmrg])# _LT_COMPILER_BOILERPLATE
1970b290cf36Smrg
1971191cded7Smrg
1972d9dcd5aeSmrg# _LT_LINKER_BOILERPLATE
1973d9dcd5aeSmrg# ----------------------
1974d9dcd5aeSmrg# Check for linker boilerplate output or warnings with
1975d9dcd5aeSmrg# the simple link test code.
1976d9dcd5aeSmrgm4_defun([_LT_LINKER_BOILERPLATE],
1977d9dcd5aeSmrg[m4_require([_LT_DECL_SED])dnl
1978d9dcd5aeSmrgac_outfile=conftest.$ac_objext
1979d9dcd5aeSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
1980d9dcd5aeSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1981d9dcd5aeSmrg_lt_linker_boilerplate=`cat conftest.err`
1982d9dcd5aeSmrg$RM -r conftest*
1983d9dcd5aeSmrg])# _LT_LINKER_BOILERPLATE
1984191cded7Smrg
1985d9dcd5aeSmrg# _LT_REQUIRED_DARWIN_CHECKS
1986d9dcd5aeSmrg# -------------------------
1987d9dcd5aeSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
1988d9dcd5aeSmrg  case $host_os in
1989d9dcd5aeSmrg    rhapsody* | darwin*)
1990d9dcd5aeSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
1991d9dcd5aeSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
1992d9dcd5aeSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
1993d9dcd5aeSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
1994d9dcd5aeSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1995d9dcd5aeSmrg    _LT_DECL([], [DSYMUTIL], [1],
1996d9dcd5aeSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1997d9dcd5aeSmrg    _LT_DECL([], [NMEDIT], [1],
1998d9dcd5aeSmrg      [Tool to change global to local symbols on Mac OS X])
1999d9dcd5aeSmrg    _LT_DECL([], [LIPO], [1],
2000d9dcd5aeSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
2001d9dcd5aeSmrg    _LT_DECL([], [OTOOL], [1],
2002d9dcd5aeSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2003d9dcd5aeSmrg    _LT_DECL([], [OTOOL64], [1],
2004d9dcd5aeSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2005191cded7Smrg
2006d9dcd5aeSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2007d9dcd5aeSmrg      [lt_cv_apple_cc_single_mod=no
2008d9dcd5aeSmrg      if test -z "${LT_MULTI_MODULE}"; then
2009d9dcd5aeSmrg	# By default we will add the -single_module flag. You can override
2010d9dcd5aeSmrg	# by either setting the environment variable LT_MULTI_MODULE
2011d9dcd5aeSmrg	# non-empty at configure time, or by adding -multi_module to the
2012d9dcd5aeSmrg	# link flags.
2013d9dcd5aeSmrg	rm -rf libconftest.dylib*
2014d9dcd5aeSmrg	echo "int foo(void){return 1;}" > conftest.c
2015d9dcd5aeSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2016d9dcd5aeSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2017d9dcd5aeSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2018d9dcd5aeSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2019d9dcd5aeSmrg        _lt_result=$?
2020d9dcd5aeSmrg	# If there is a non-empty error log, and "single_module"
2021d9dcd5aeSmrg	# appears in it, assume the flag caused a linker warning
2022d9dcd5aeSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
2023d9dcd5aeSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
2024d9dcd5aeSmrg	# Otherwise, if the output was created with a 0 exit code from
2025d9dcd5aeSmrg	# the compiler, it worked.
2026d9dcd5aeSmrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2027d9dcd5aeSmrg	  lt_cv_apple_cc_single_mod=yes
2028d9dcd5aeSmrg	else
2029d9dcd5aeSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
2030d9dcd5aeSmrg	fi
2031d9dcd5aeSmrg	rm -rf libconftest.dylib*
2032d9dcd5aeSmrg	rm -f conftest.*
2033d9dcd5aeSmrg      fi])
2034191cded7Smrg
2035d9dcd5aeSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2036d9dcd5aeSmrg      [lt_cv_ld_exported_symbols_list],
2037d9dcd5aeSmrg      [lt_cv_ld_exported_symbols_list=no
2038d9dcd5aeSmrg      save_LDFLAGS=$LDFLAGS
2039d9dcd5aeSmrg      echo "_main" > conftest.sym
2040d9dcd5aeSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2041d9dcd5aeSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2042d9dcd5aeSmrg	[lt_cv_ld_exported_symbols_list=yes],
2043d9dcd5aeSmrg	[lt_cv_ld_exported_symbols_list=no])
2044d9dcd5aeSmrg	LDFLAGS="$save_LDFLAGS"
2045d9dcd5aeSmrg    ])
2046191cded7Smrg
2047d9dcd5aeSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2048d9dcd5aeSmrg      [lt_cv_ld_force_load=no
2049d9dcd5aeSmrg      cat > conftest.c << _LT_EOF
2050d9dcd5aeSmrgint forced_loaded() { return 2;}
2051d9dcd5aeSmrg_LT_EOF
2052d9dcd5aeSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2053d9dcd5aeSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2054d9dcd5aeSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2055d9dcd5aeSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2056d9dcd5aeSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2057d9dcd5aeSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2058d9dcd5aeSmrg      cat > conftest.c << _LT_EOF
2059d9dcd5aeSmrgint main() { return 0;}
2060d9dcd5aeSmrg_LT_EOF
2061d9dcd5aeSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2062d9dcd5aeSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2063d9dcd5aeSmrg      _lt_result=$?
2064d9dcd5aeSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
2065d9dcd5aeSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
2066d9dcd5aeSmrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2067d9dcd5aeSmrg	lt_cv_ld_force_load=yes
2068d9dcd5aeSmrg      else
2069d9dcd5aeSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
2070d9dcd5aeSmrg      fi
2071d9dcd5aeSmrg        rm -f conftest.err libconftest.a conftest conftest.c
2072d9dcd5aeSmrg        rm -rf conftest.dSYM
2073d9dcd5aeSmrg    ])
2074d9dcd5aeSmrg    case $host_os in
2075d9dcd5aeSmrg    rhapsody* | darwin1.[[012]])
2076d9dcd5aeSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2077d9dcd5aeSmrg    darwin1.*)
2078d9dcd5aeSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2079d9dcd5aeSmrg    darwin*) # darwin 5.x on
2080d9dcd5aeSmrg      # if running on 10.5 or later, the deployment target defaults
2081d9dcd5aeSmrg      # to the OS version, if on x86, and 10.4, the deployment
2082d9dcd5aeSmrg      # target defaults to 10.4. Don't you love it?
2083d9dcd5aeSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2084d9dcd5aeSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2085d9dcd5aeSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2086d9dcd5aeSmrg	10.[[012]]*)
2087d9dcd5aeSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2088d9dcd5aeSmrg	10.*)
2089d9dcd5aeSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2090d9dcd5aeSmrg      esac
2091d9dcd5aeSmrg    ;;
2092d9dcd5aeSmrg  esac
2093d9dcd5aeSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2094d9dcd5aeSmrg      _lt_dar_single_mod='$single_module'
2095d9dcd5aeSmrg    fi
2096d9dcd5aeSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2097d9dcd5aeSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2098d9dcd5aeSmrg    else
2099d9dcd5aeSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2100d9dcd5aeSmrg    fi
2101d9dcd5aeSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2102d9dcd5aeSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
2103d9dcd5aeSmrg    else
2104d9dcd5aeSmrg      _lt_dsymutil=
2105d9dcd5aeSmrg    fi
2106d9dcd5aeSmrg    ;;
2107d9dcd5aeSmrg  esac
2108d9dcd5aeSmrg])
2109191cded7Smrg
2110191cded7Smrg
2111d9dcd5aeSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
2112d9dcd5aeSmrg# ---------------------------------
2113d9dcd5aeSmrg# Checks for linker and compiler features on darwin
2114d9dcd5aeSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
2115d9dcd5aeSmrg[
2116d9dcd5aeSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2117d9dcd5aeSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2118d9dcd5aeSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
2119d9dcd5aeSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
2120d9dcd5aeSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2121d9dcd5aeSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
2122d9dcd5aeSmrg    _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\"`'
2123d9dcd5aeSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2124d9dcd5aeSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2125d9dcd5aeSmrg  else
2126d9dcd5aeSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2127d9dcd5aeSmrg  fi
2128d9dcd5aeSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
2129d9dcd5aeSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2130d9dcd5aeSmrg  case $cc_basename in
2131d9dcd5aeSmrg     ifort*) _lt_dar_can_shared=yes ;;
2132d9dcd5aeSmrg     *) _lt_dar_can_shared=$GCC ;;
2133d9dcd5aeSmrg  esac
2134d9dcd5aeSmrg  if test "$_lt_dar_can_shared" = "yes"; then
2135d9dcd5aeSmrg    output_verbose_link_cmd=func_echo_all
2136d9dcd5aeSmrg    _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}"
2137d9dcd5aeSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2138d9dcd5aeSmrg    _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}"
2139d9dcd5aeSmrg    _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}"
2140d9dcd5aeSmrg    m4_if([$1], [CXX],
2141d9dcd5aeSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2142d9dcd5aeSmrg      _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}"
2143d9dcd5aeSmrg      _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}"
2144d9dcd5aeSmrg    fi
2145d9dcd5aeSmrg],[])
2146d9dcd5aeSmrg  else
2147d9dcd5aeSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
2148d9dcd5aeSmrg  fi
2149ba064abeSmrg])
2150191cded7Smrg
2151d9dcd5aeSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2152d9dcd5aeSmrg# ----------------------------------
2153d9dcd5aeSmrg# Links a minimal program and checks the executable
2154d9dcd5aeSmrg# for the system default hardcoded library path. In most cases,
2155d9dcd5aeSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
2156d9dcd5aeSmrg# the location of the communication and MPI libs are included too.
2157d9dcd5aeSmrg# If we don't find anything, use the default library path according
2158d9dcd5aeSmrg# to the aix ld manual.
2159d9dcd5aeSmrg# Store the results from the different compilers for each TAGNAME.
2160d9dcd5aeSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
2161d9dcd5aeSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
2162d9dcd5aeSmrg[m4_require([_LT_DECL_SED])dnl
2163d9dcd5aeSmrgif test "${lt_cv_aix_libpath+set}" = set; then
2164d9dcd5aeSmrg  aix_libpath=$lt_cv_aix_libpath
2165d9dcd5aeSmrgelse
2166d9dcd5aeSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2167d9dcd5aeSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2168d9dcd5aeSmrg  lt_aix_libpath_sed='[
2169d9dcd5aeSmrg      /Import File Strings/,/^$/ {
2170d9dcd5aeSmrg	  /^0/ {
2171d9dcd5aeSmrg	      s/^0  *\([^ ]*\) *$/\1/
2172d9dcd5aeSmrg	      p
2173d9dcd5aeSmrg	  }
2174d9dcd5aeSmrg      }]'
2175d9dcd5aeSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2176d9dcd5aeSmrg  # Check for a 64-bit object if we didn't find anything.
2177d9dcd5aeSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2178d9dcd5aeSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2179d9dcd5aeSmrg  fi],[])
2180d9dcd5aeSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2181d9dcd5aeSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2182d9dcd5aeSmrg  fi
2183d9dcd5aeSmrg  ])
2184d9dcd5aeSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2185d9dcd5aeSmrgfi
2186d9dcd5aeSmrg])# _LT_SYS_MODULE_PATH_AIX
2187191cded7Smrg
2188191cded7Smrg
2189d9dcd5aeSmrg# _LT_SHELL_INIT(ARG)
2190d9dcd5aeSmrg# -------------------
2191d9dcd5aeSmrgm4_define([_LT_SHELL_INIT],
2192d9dcd5aeSmrg[m4_divert_text([M4SH-INIT], [$1
2193d9dcd5aeSmrg])])# _LT_SHELL_INIT
2194191cded7Smrg
2195191cded7Smrg
2196191cded7Smrg
2197d9dcd5aeSmrg# _LT_PROG_ECHO_BACKSLASH
2198d9dcd5aeSmrg# -----------------------
2199d9dcd5aeSmrg# Find how we can fake an echo command that does not interpret backslash.
2200d9dcd5aeSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
2201d9dcd5aeSmrg# of the generated configure script which will find a shell with a builtin
2202d9dcd5aeSmrg# printf (which we can use as an echo command).
2203d9dcd5aeSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
2204d9dcd5aeSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2205d9dcd5aeSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2206d9dcd5aeSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2207191cded7Smrg
2208d9dcd5aeSmrgAC_MSG_CHECKING([how to print strings])
2209d9dcd5aeSmrg# Test print first, because it will be a builtin if present.
2210d9dcd5aeSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2211d9dcd5aeSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2212d9dcd5aeSmrg  ECHO='print -r --'
2213d9dcd5aeSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2214d9dcd5aeSmrg  ECHO='printf %s\n'
2215d9dcd5aeSmrgelse
2216d9dcd5aeSmrg  # Use this function as a fallback that always works.
2217d9dcd5aeSmrg  func_fallback_echo ()
2218d9dcd5aeSmrg  {
2219d9dcd5aeSmrg    eval 'cat <<_LTECHO_EOF
2220d9dcd5aeSmrg$[]1
2221d9dcd5aeSmrg_LTECHO_EOF'
2222d9dcd5aeSmrg  }
2223d9dcd5aeSmrg  ECHO='func_fallback_echo'
2224d9dcd5aeSmrgfi
2225191cded7Smrg
2226d9dcd5aeSmrg# func_echo_all arg...
2227d9dcd5aeSmrg# Invoke $ECHO with all args, space-separated.
2228d9dcd5aeSmrgfunc_echo_all ()
2229d9dcd5aeSmrg{
2230d9dcd5aeSmrg    $ECHO "$*" 
2231d9dcd5aeSmrg}
2232191cded7Smrg
2233d9dcd5aeSmrgcase "$ECHO" in
2234d9dcd5aeSmrg  printf*) AC_MSG_RESULT([printf]) ;;
2235d9dcd5aeSmrg  print*) AC_MSG_RESULT([print -r]) ;;
2236d9dcd5aeSmrg  *) AC_MSG_RESULT([cat]) ;;
2237d9dcd5aeSmrgesac
2238191cded7Smrg
2239d9dcd5aeSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
2240d9dcd5aeSmrg[_AS_DETECT_SUGGESTED([
2241d9dcd5aeSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2242d9dcd5aeSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2243d9dcd5aeSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2244d9dcd5aeSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2245d9dcd5aeSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
2246d9dcd5aeSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
2247d9dcd5aeSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2248191cded7Smrg
2249d9dcd5aeSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2250d9dcd5aeSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2251d9dcd5aeSmrg])# _LT_PROG_ECHO_BACKSLASH
2252191cded7Smrg
2253191cded7Smrg
2254d9dcd5aeSmrg# _LT_WITH_SYSROOT
2255ba064abeSmrg# ----------------
2256d9dcd5aeSmrgAC_DEFUN([_LT_WITH_SYSROOT],
2257d9dcd5aeSmrg[AC_MSG_CHECKING([for sysroot])
2258d9dcd5aeSmrgAC_ARG_WITH([sysroot],
2259d9dcd5aeSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2260d9dcd5aeSmrg                        (or the compiler's sysroot if not specified).],
2261d9dcd5aeSmrg[], [with_sysroot=no])
2262d9dcd5aeSmrg
2263d9dcd5aeSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
2264d9dcd5aeSmrgdnl in case the user passed a directory name.
2265d9dcd5aeSmrglt_sysroot=
2266d9dcd5aeSmrgcase ${with_sysroot} in #(
2267d9dcd5aeSmrg yes)
2268d9dcd5aeSmrg   if test "$GCC" = yes; then
2269d9dcd5aeSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2270d9dcd5aeSmrg   fi
2271d9dcd5aeSmrg   ;; #(
2272d9dcd5aeSmrg /*)
2273d9dcd5aeSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2274d9dcd5aeSmrg   ;; #(
2275d9dcd5aeSmrg no|'')
2276d9dcd5aeSmrg   ;; #(
2277d9dcd5aeSmrg *)
2278d9dcd5aeSmrg   AC_MSG_RESULT([${with_sysroot}])
2279d9dcd5aeSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
2280d9dcd5aeSmrg   ;;
2281d9dcd5aeSmrgesac
2282191cded7Smrg
2283d9dcd5aeSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
2284d9dcd5aeSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2285d9dcd5aeSmrg[dependent libraries, and in which our libraries should be installed.])])
2286191cded7Smrg
2287d9dcd5aeSmrg# _LT_ENABLE_LOCK
2288d9dcd5aeSmrg# ---------------
2289d9dcd5aeSmrgm4_defun([_LT_ENABLE_LOCK],
2290d9dcd5aeSmrg[AC_ARG_ENABLE([libtool-lock],
2291d9dcd5aeSmrg  [AS_HELP_STRING([--disable-libtool-lock],
2292d9dcd5aeSmrg    [avoid locking (might break parallel builds)])])
2293d9dcd5aeSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2294d9dcd5aeSmrg
2295d9dcd5aeSmrg# Some flags need to be propagated to the compiler or linker for good
2296d9dcd5aeSmrg# libtool support.
2297d9dcd5aeSmrgcase $host in
2298d9dcd5aeSmrgia64-*-hpux*)
2299d9dcd5aeSmrg  # Find out which ABI we are using.
2300d9dcd5aeSmrg  echo 'int i;' > conftest.$ac_ext
2301d9dcd5aeSmrg  if AC_TRY_EVAL(ac_compile); then
2302d9dcd5aeSmrg    case `/usr/bin/file conftest.$ac_objext` in
2303d9dcd5aeSmrg      *ELF-32*)
2304d9dcd5aeSmrg	HPUX_IA64_MODE="32"
2305d9dcd5aeSmrg	;;
2306d9dcd5aeSmrg      *ELF-64*)
2307d9dcd5aeSmrg	HPUX_IA64_MODE="64"
2308d9dcd5aeSmrg	;;
2309d9dcd5aeSmrg    esac
2310d9dcd5aeSmrg  fi
2311d9dcd5aeSmrg  rm -rf conftest*
2312d9dcd5aeSmrg  ;;
2313d9dcd5aeSmrg*-*-irix6*)
2314d9dcd5aeSmrg  # Find out which ABI we are using.
2315d9dcd5aeSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2316d9dcd5aeSmrg  if AC_TRY_EVAL(ac_compile); then
2317d9dcd5aeSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
2318d9dcd5aeSmrg      case `/usr/bin/file conftest.$ac_objext` in
2319d9dcd5aeSmrg	*32-bit*)
2320d9dcd5aeSmrg	  LD="${LD-ld} -melf32bsmip"
2321d9dcd5aeSmrg	  ;;
2322d9dcd5aeSmrg	*N32*)
2323d9dcd5aeSmrg	  LD="${LD-ld} -melf32bmipn32"
2324d9dcd5aeSmrg	  ;;
2325d9dcd5aeSmrg	*64-bit*)
2326d9dcd5aeSmrg	  LD="${LD-ld} -melf64bmip"
2327d9dcd5aeSmrg	;;
2328d9dcd5aeSmrg      esac
2329d9dcd5aeSmrg    else
2330d9dcd5aeSmrg      case `/usr/bin/file conftest.$ac_objext` in
2331d9dcd5aeSmrg	*32-bit*)
2332d9dcd5aeSmrg	  LD="${LD-ld} -32"
2333d9dcd5aeSmrg	  ;;
2334d9dcd5aeSmrg	*N32*)
2335d9dcd5aeSmrg	  LD="${LD-ld} -n32"
2336d9dcd5aeSmrg	  ;;
2337d9dcd5aeSmrg	*64-bit*)
2338d9dcd5aeSmrg	  LD="${LD-ld} -64"
2339d9dcd5aeSmrg	  ;;
2340d9dcd5aeSmrg      esac
2341d9dcd5aeSmrg    fi
2342d9dcd5aeSmrg  fi
2343d9dcd5aeSmrg  rm -rf conftest*
2344d9dcd5aeSmrg  ;;
2345191cded7Smrg
2346d9dcd5aeSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2347d9dcd5aeSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2348d9dcd5aeSmrg  # Find out which ABI we are using.
2349d9dcd5aeSmrg  echo 'int i;' > conftest.$ac_ext
2350d9dcd5aeSmrg  if AC_TRY_EVAL(ac_compile); then
2351d9dcd5aeSmrg    case `/usr/bin/file conftest.o` in
2352d9dcd5aeSmrg      *32-bit*)
2353d9dcd5aeSmrg	case $host in
2354d9dcd5aeSmrg	  x86_64-*kfreebsd*-gnu)
2355d9dcd5aeSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
2356d9dcd5aeSmrg	    ;;
2357d9dcd5aeSmrg	  x86_64-*linux*)
2358d9dcd5aeSmrg	    LD="${LD-ld} -m elf_i386"
2359d9dcd5aeSmrg	    ;;
2360d9dcd5aeSmrg	  ppc64-*linux*|powerpc64-*linux*)
2361d9dcd5aeSmrg	    LD="${LD-ld} -m elf32ppclinux"
2362d9dcd5aeSmrg	    ;;
2363d9dcd5aeSmrg	  s390x-*linux*)
2364d9dcd5aeSmrg	    LD="${LD-ld} -m elf_s390"
2365d9dcd5aeSmrg	    ;;
2366d9dcd5aeSmrg	  sparc64-*linux*)
2367d9dcd5aeSmrg	    LD="${LD-ld} -m elf32_sparc"
2368d9dcd5aeSmrg	    ;;
2369d9dcd5aeSmrg	esac
2370d9dcd5aeSmrg	;;
2371d9dcd5aeSmrg      *64-bit*)
2372d9dcd5aeSmrg	case $host in
2373d9dcd5aeSmrg	  x86_64-*kfreebsd*-gnu)
2374d9dcd5aeSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
2375d9dcd5aeSmrg	    ;;
2376d9dcd5aeSmrg	  x86_64-*linux*)
2377d9dcd5aeSmrg	    LD="${LD-ld} -m elf_x86_64"
2378d9dcd5aeSmrg	    ;;
2379d9dcd5aeSmrg	  ppc*-*linux*|powerpc*-*linux*)
2380d9dcd5aeSmrg	    LD="${LD-ld} -m elf64ppc"
2381d9dcd5aeSmrg	    ;;
2382d9dcd5aeSmrg	  s390*-*linux*|s390*-*tpf*)
2383d9dcd5aeSmrg	    LD="${LD-ld} -m elf64_s390"
2384d9dcd5aeSmrg	    ;;
2385d9dcd5aeSmrg	  sparc*-*linux*)
2386d9dcd5aeSmrg	    LD="${LD-ld} -m elf64_sparc"
2387d9dcd5aeSmrg	    ;;
2388d9dcd5aeSmrg	esac
2389d9dcd5aeSmrg	;;
2390d9dcd5aeSmrg    esac
2391d9dcd5aeSmrg  fi
2392d9dcd5aeSmrg  rm -rf conftest*
2393d9dcd5aeSmrg  ;;
2394191cded7Smrg
2395d9dcd5aeSmrg*-*-sco3.2v5*)
2396d9dcd5aeSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2397d9dcd5aeSmrg  SAVE_CFLAGS="$CFLAGS"
2398d9dcd5aeSmrg  CFLAGS="$CFLAGS -belf"
2399d9dcd5aeSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2400d9dcd5aeSmrg    [AC_LANG_PUSH(C)
2401d9dcd5aeSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2402d9dcd5aeSmrg     AC_LANG_POP])
2403d9dcd5aeSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2404d9dcd5aeSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2405d9dcd5aeSmrg    CFLAGS="$SAVE_CFLAGS"
2406d9dcd5aeSmrg  fi
2407d9dcd5aeSmrg  ;;
2408d9dcd5aeSmrg*-*solaris*)
2409d9dcd5aeSmrg  # Find out which ABI we are using.
2410d9dcd5aeSmrg  echo 'int i;' > conftest.$ac_ext
2411d9dcd5aeSmrg  if AC_TRY_EVAL(ac_compile); then
2412d9dcd5aeSmrg    case `/usr/bin/file conftest.o` in
2413d9dcd5aeSmrg    *64-bit*)
2414d9dcd5aeSmrg      case $lt_cv_prog_gnu_ld in
2415d9dcd5aeSmrg      yes*)
2416d9dcd5aeSmrg        case $host in
2417d9dcd5aeSmrg        i?86-*-solaris*)
2418d9dcd5aeSmrg          LD="${LD-ld} -m elf_x86_64"
2419d9dcd5aeSmrg          ;;
2420d9dcd5aeSmrg        sparc*-*-solaris*)
2421d9dcd5aeSmrg          LD="${LD-ld} -m elf64_sparc"
2422d9dcd5aeSmrg          ;;
2423d9dcd5aeSmrg        esac
2424d9dcd5aeSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2425d9dcd5aeSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2426d9dcd5aeSmrg          LD="${LD-ld}_sol2"
2427d9dcd5aeSmrg        fi
2428d9dcd5aeSmrg        ;;
2429d9dcd5aeSmrg      *)
2430d9dcd5aeSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2431d9dcd5aeSmrg	  LD="${LD-ld} -64"
2432d9dcd5aeSmrg	fi
2433d9dcd5aeSmrg	;;
2434d9dcd5aeSmrg      esac
2435d9dcd5aeSmrg      ;;
2436d9dcd5aeSmrg    esac
2437d9dcd5aeSmrg  fi
2438d9dcd5aeSmrg  rm -rf conftest*
2439d9dcd5aeSmrg  ;;
2440d9dcd5aeSmrgesac
2441191cded7Smrg
2442d9dcd5aeSmrgneed_locks="$enable_libtool_lock"
2443d9dcd5aeSmrg])# _LT_ENABLE_LOCK
2444191cded7Smrg
2445191cded7Smrg
2446d9dcd5aeSmrg# _LT_PROG_AR
2447d9dcd5aeSmrg# -----------
2448d9dcd5aeSmrgm4_defun([_LT_PROG_AR],
2449d9dcd5aeSmrg[AC_CHECK_TOOLS(AR, [ar], false)
2450d9dcd5aeSmrg: ${AR=ar}
2451d9dcd5aeSmrg: ${AR_FLAGS=cru}
2452d9dcd5aeSmrg_LT_DECL([], [AR], [1], [The archiver])
2453d9dcd5aeSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2454d9dcd5aeSmrg
2455d9dcd5aeSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2456d9dcd5aeSmrg  [lt_cv_ar_at_file=no
2457d9dcd5aeSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2458d9dcd5aeSmrg     [echo conftest.$ac_objext > conftest.lst
2459d9dcd5aeSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2460d9dcd5aeSmrg      AC_TRY_EVAL([lt_ar_try])
2461d9dcd5aeSmrg      if test "$ac_status" -eq 0; then
2462d9dcd5aeSmrg	# Ensure the archiver fails upon bogus file names.
2463d9dcd5aeSmrg	rm -f conftest.$ac_objext libconftest.a
2464d9dcd5aeSmrg	AC_TRY_EVAL([lt_ar_try])
2465d9dcd5aeSmrg	if test "$ac_status" -ne 0; then
2466d9dcd5aeSmrg          lt_cv_ar_at_file=@
2467d9dcd5aeSmrg        fi
2468d9dcd5aeSmrg      fi
2469d9dcd5aeSmrg      rm -f conftest.* libconftest.a
2470d9dcd5aeSmrg     ])
2471d9dcd5aeSmrg  ])
2472191cded7Smrg
2473d9dcd5aeSmrgif test "x$lt_cv_ar_at_file" = xno; then
2474d9dcd5aeSmrg  archiver_list_spec=
2475d9dcd5aeSmrgelse
2476d9dcd5aeSmrg  archiver_list_spec=$lt_cv_ar_at_file
2477d9dcd5aeSmrgfi
2478d9dcd5aeSmrg_LT_DECL([], [archiver_list_spec], [1],
2479d9dcd5aeSmrg  [How to feed a file listing to the archiver])
2480d9dcd5aeSmrg])# _LT_PROG_AR
2481191cded7Smrg
2482191cded7Smrg
2483d9dcd5aeSmrg# _LT_CMD_OLD_ARCHIVE
2484ba064abeSmrg# -------------------
2485d9dcd5aeSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
2486d9dcd5aeSmrg[_LT_PROG_AR
2487191cded7Smrg
2488d9dcd5aeSmrgAC_CHECK_TOOL(STRIP, strip, :)
2489d9dcd5aeSmrgtest -z "$STRIP" && STRIP=:
2490d9dcd5aeSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2491191cded7Smrg
2492d9dcd5aeSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
2493d9dcd5aeSmrgtest -z "$RANLIB" && RANLIB=:
2494d9dcd5aeSmrg_LT_DECL([], [RANLIB], [1],
2495d9dcd5aeSmrg    [Commands used to install an old-style archive])
2496191cded7Smrg
2497d9dcd5aeSmrg# Determine commands to create old-style static archives.
2498d9dcd5aeSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2499d9dcd5aeSmrgold_postinstall_cmds='chmod 644 $oldlib'
2500d9dcd5aeSmrgold_postuninstall_cmds=
2501191cded7Smrg
2502d9dcd5aeSmrgif test -n "$RANLIB"; then
2503d9dcd5aeSmrg  case $host_os in
2504d9dcd5aeSmrg  openbsd*)
2505d9dcd5aeSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2506d9dcd5aeSmrg    ;;
2507d9dcd5aeSmrg  *)
2508d9dcd5aeSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2509d9dcd5aeSmrg    ;;
2510d9dcd5aeSmrg  esac
2511d9dcd5aeSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2512d9dcd5aeSmrgfi
2513b290cf36Smrg
2514d9dcd5aeSmrgcase $host_os in
2515d9dcd5aeSmrg  darwin*)
2516d9dcd5aeSmrg    lock_old_archive_extraction=yes ;;
2517d9dcd5aeSmrg  *)
2518d9dcd5aeSmrg    lock_old_archive_extraction=no ;;
2519d9dcd5aeSmrgesac
2520d9dcd5aeSmrg_LT_DECL([], [old_postinstall_cmds], [2])
2521d9dcd5aeSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
2522d9dcd5aeSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
2523d9dcd5aeSmrg    [Commands used to build an old-style archive])
2524d9dcd5aeSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
2525d9dcd5aeSmrg    [Whether to use a lock for old archive extraction])
2526d9dcd5aeSmrg])# _LT_CMD_OLD_ARCHIVE
2527b290cf36Smrg
2528191cded7Smrg
2529d9dcd5aeSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2530d9dcd5aeSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2531d9dcd5aeSmrg# ----------------------------------------------------------------
2532d9dcd5aeSmrg# Check whether the given compiler option works
2533d9dcd5aeSmrgAC_DEFUN([_LT_COMPILER_OPTION],
2534d9dcd5aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2535d9dcd5aeSmrgm4_require([_LT_DECL_SED])dnl
2536d9dcd5aeSmrgAC_CACHE_CHECK([$1], [$2],
2537d9dcd5aeSmrg  [$2=no
2538d9dcd5aeSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2539d9dcd5aeSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2540d9dcd5aeSmrg   lt_compiler_flag="$3"
2541d9dcd5aeSmrg   # Insert the option either (1) after the last *FLAGS variable, or
2542d9dcd5aeSmrg   # (2) before a word containing "conftest.", or (3) at the end.
2543d9dcd5aeSmrg   # Note that $ac_compile itself does not contain backslashes and begins
2544d9dcd5aeSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2545d9dcd5aeSmrg   # The option is referenced via a variable to avoid confusing sed.
2546d9dcd5aeSmrg   lt_compile=`echo "$ac_compile" | $SED \
2547d9dcd5aeSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2548d9dcd5aeSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2549d9dcd5aeSmrg   -e 's:$: $lt_compiler_flag:'`
2550d9dcd5aeSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2551d9dcd5aeSmrg   (eval "$lt_compile" 2>conftest.err)
2552d9dcd5aeSmrg   ac_status=$?
2553d9dcd5aeSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
2554d9dcd5aeSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2555d9dcd5aeSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
2556d9dcd5aeSmrg     # The compiler can only warn and ignore the option if not recognized
2557d9dcd5aeSmrg     # So say no if there are warnings other than the usual output.
2558d9dcd5aeSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2559d9dcd5aeSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2560d9dcd5aeSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2561d9dcd5aeSmrg       $2=yes
2562d9dcd5aeSmrg     fi
2563d9dcd5aeSmrg   fi
2564d9dcd5aeSmrg   $RM conftest*
2565191cded7Smrg])
2566191cded7Smrg
2567d9dcd5aeSmrgif test x"[$]$2" = xyes; then
2568d9dcd5aeSmrg    m4_if([$5], , :, [$5])
2569d9dcd5aeSmrgelse
2570d9dcd5aeSmrg    m4_if([$6], , :, [$6])
2571d9dcd5aeSmrgfi
2572d9dcd5aeSmrg])# _LT_COMPILER_OPTION
2573191cded7Smrg
2574d9dcd5aeSmrg# Old name:
2575d9dcd5aeSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2576d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
2577d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2578191cded7Smrg
2579b290cf36Smrg
2580d9dcd5aeSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2581d9dcd5aeSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2582d9dcd5aeSmrg# ----------------------------------------------------
2583d9dcd5aeSmrg# Check whether the given linker option works
2584d9dcd5aeSmrgAC_DEFUN([_LT_LINKER_OPTION],
2585d9dcd5aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2586d9dcd5aeSmrgm4_require([_LT_DECL_SED])dnl
2587d9dcd5aeSmrgAC_CACHE_CHECK([$1], [$2],
2588d9dcd5aeSmrg  [$2=no
2589d9dcd5aeSmrg   save_LDFLAGS="$LDFLAGS"
2590d9dcd5aeSmrg   LDFLAGS="$LDFLAGS $3"
2591d9dcd5aeSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2592d9dcd5aeSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2593d9dcd5aeSmrg     # The linker can only warn and ignore the option if not recognized
2594d9dcd5aeSmrg     # So say no if there are warnings
2595d9dcd5aeSmrg     if test -s conftest.err; then
2596d9dcd5aeSmrg       # Append any errors to the config.log.
2597d9dcd5aeSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2598d9dcd5aeSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2599d9dcd5aeSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2600d9dcd5aeSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
2601d9dcd5aeSmrg         $2=yes
2602d9dcd5aeSmrg       fi
2603d9dcd5aeSmrg     else
2604d9dcd5aeSmrg       $2=yes
2605d9dcd5aeSmrg     fi
2606d9dcd5aeSmrg   fi
2607d9dcd5aeSmrg   $RM -r conftest*
2608d9dcd5aeSmrg   LDFLAGS="$save_LDFLAGS"
2609d9dcd5aeSmrg])
2610191cded7Smrg
2611d9dcd5aeSmrgif test x"[$]$2" = xyes; then
2612d9dcd5aeSmrg    m4_if([$4], , :, [$4])
2613d9dcd5aeSmrgelse
2614d9dcd5aeSmrg    m4_if([$5], , :, [$5])
2615d9dcd5aeSmrgfi
2616d9dcd5aeSmrg])# _LT_LINKER_OPTION
2617191cded7Smrg
2618d9dcd5aeSmrg# Old name:
2619d9dcd5aeSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2620d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
2621d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2622191cded7Smrg
2623191cded7Smrg
2624d9dcd5aeSmrg# LT_CMD_MAX_LEN
2625d9dcd5aeSmrg#---------------
2626d9dcd5aeSmrgAC_DEFUN([LT_CMD_MAX_LEN],
2627d9dcd5aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2628d9dcd5aeSmrg# find the maximum length of command line arguments
2629d9dcd5aeSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
2630d9dcd5aeSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2631d9dcd5aeSmrg  i=0
2632d9dcd5aeSmrg  teststring="ABCD"
2633191cded7Smrg
2634d9dcd5aeSmrg  case $build_os in
2635d9dcd5aeSmrg  msdosdjgpp*)
2636d9dcd5aeSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
2637d9dcd5aeSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
2638d9dcd5aeSmrg    # during glob expansion).  Even if it were fixed, the result of this
2639d9dcd5aeSmrg    # check would be larger than it should be.
2640d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2641d9dcd5aeSmrg    ;;
2642191cded7Smrg
2643d9dcd5aeSmrg  gnu*)
2644d9dcd5aeSmrg    # Under GNU Hurd, this test is not required because there is
2645d9dcd5aeSmrg    # no limit to the length of command line arguments.
2646d9dcd5aeSmrg    # Libtool will interpret -1 as no limit whatsoever
2647d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=-1;
2648d9dcd5aeSmrg    ;;
2649191cded7Smrg
2650d9dcd5aeSmrg  cygwin* | mingw* | cegcc*)
2651d9dcd5aeSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
2652d9dcd5aeSmrg    # about 5 minutes as the teststring grows exponentially.
2653d9dcd5aeSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
2654d9dcd5aeSmrg    # you end up with a "frozen" computer, even though with patience
2655d9dcd5aeSmrg    # the test eventually succeeds (with a max line length of 256k).
2656d9dcd5aeSmrg    # Instead, let's just punt: use the minimum linelength reported by
2657d9dcd5aeSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
2658d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=8192;
2659d9dcd5aeSmrg    ;;
2660191cded7Smrg
2661d9dcd5aeSmrg  mint*)
2662d9dcd5aeSmrg    # On MiNT this can take a long time and run out of memory.
2663d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=8192;
2664d9dcd5aeSmrg    ;;
2665191cded7Smrg
2666d9dcd5aeSmrg  amigaos*)
2667d9dcd5aeSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
2668d9dcd5aeSmrg    # So we just punt and use a minimum line length of 8192.
2669d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=8192;
2670d9dcd5aeSmrg    ;;
2671191cded7Smrg
2672d9dcd5aeSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2673d9dcd5aeSmrg    # This has been around since 386BSD, at least.  Likely further.
2674d9dcd5aeSmrg    if test -x /sbin/sysctl; then
2675d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2676d9dcd5aeSmrg    elif test -x /usr/sbin/sysctl; then
2677d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2678d9dcd5aeSmrg    else
2679d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2680ba064abeSmrg    fi
2681d9dcd5aeSmrg    # And add a safety zone
2682d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2683d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2684d9dcd5aeSmrg    ;;
2685191cded7Smrg
2686d9dcd5aeSmrg  interix*)
2687d9dcd5aeSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2688d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=196608
2689d9dcd5aeSmrg    ;;
2690191cded7Smrg
2691d9dcd5aeSmrg  os2*)
2692d9dcd5aeSmrg    # The test takes a long time on OS/2.
2693d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=8192
2694d9dcd5aeSmrg    ;;
2695191cded7Smrg
2696d9dcd5aeSmrg  osf*)
2697d9dcd5aeSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2698d9dcd5aeSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2699d9dcd5aeSmrg    # nice to cause kernel panics so lets avoid the loop below.
2700d9dcd5aeSmrg    # First set a reasonable default.
2701d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=16384
2702d9dcd5aeSmrg    #
2703d9dcd5aeSmrg    if test -x /sbin/sysconfig; then
2704d9dcd5aeSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2705d9dcd5aeSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2706d9dcd5aeSmrg      esac
2707d9dcd5aeSmrg    fi
2708d9dcd5aeSmrg    ;;
2709d9dcd5aeSmrg  sco3.2v5*)
2710d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=102400
2711d9dcd5aeSmrg    ;;
2712d9dcd5aeSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
2713d9dcd5aeSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2714d9dcd5aeSmrg    if test -n "$kargmax"; then
2715d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2716d9dcd5aeSmrg    else
2717d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=32768
2718d9dcd5aeSmrg    fi
2719d9dcd5aeSmrg    ;;
2720d9dcd5aeSmrg  *)
2721d9dcd5aeSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2722d9dcd5aeSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
2723d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2724d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2725d9dcd5aeSmrg    else
2726d9dcd5aeSmrg      # Make teststring a little bigger before we do anything with it.
2727d9dcd5aeSmrg      # a 1K string should be a reasonable start.
2728d9dcd5aeSmrg      for i in 1 2 3 4 5 6 7 8 ; do
2729d9dcd5aeSmrg        teststring=$teststring$teststring
2730d9dcd5aeSmrg      done
2731d9dcd5aeSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2732d9dcd5aeSmrg      # If test is not a shell built-in, we'll probably end up computing a
2733d9dcd5aeSmrg      # maximum length that is only half of the actual maximum length, but
2734d9dcd5aeSmrg      # we can't tell.
2735d9dcd5aeSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2736d9dcd5aeSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2737d9dcd5aeSmrg	      test $i != 17 # 1/2 MB should be enough
2738d9dcd5aeSmrg      do
2739d9dcd5aeSmrg        i=`expr $i + 1`
2740d9dcd5aeSmrg        teststring=$teststring$teststring
2741d9dcd5aeSmrg      done
2742d9dcd5aeSmrg      # Only check the string length outside the loop.
2743d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2744d9dcd5aeSmrg      teststring=
2745d9dcd5aeSmrg      # Add a significant safety factor because C++ compilers can tack on
2746d9dcd5aeSmrg      # massive amounts of additional arguments before passing them to the
2747d9dcd5aeSmrg      # linker.  It appears as though 1/2 is a usable value.
2748d9dcd5aeSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2749d9dcd5aeSmrg    fi
2750ba064abeSmrg    ;;
2751ba064abeSmrg  esac
2752d9dcd5aeSmrg])
2753d9dcd5aeSmrgif test -n $lt_cv_sys_max_cmd_len ; then
2754d9dcd5aeSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2755d9dcd5aeSmrgelse
2756d9dcd5aeSmrg  AC_MSG_RESULT(none)
2757d9dcd5aeSmrgfi
2758d9dcd5aeSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
2759d9dcd5aeSmrg_LT_DECL([], [max_cmd_len], [0],
2760d9dcd5aeSmrg    [What is the maximum length of a command?])
2761d9dcd5aeSmrg])# LT_CMD_MAX_LEN
2762191cded7Smrg
2763d9dcd5aeSmrg# Old name:
2764d9dcd5aeSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2765d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
2766d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2767191cded7Smrg
2768191cded7Smrg
2769d9dcd5aeSmrg# _LT_HEADER_DLFCN
2770d9dcd5aeSmrg# ----------------
2771d9dcd5aeSmrgm4_defun([_LT_HEADER_DLFCN],
2772d9dcd5aeSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2773d9dcd5aeSmrg])# _LT_HEADER_DLFCN
2774191cded7Smrg
2775191cded7Smrg
2776d9dcd5aeSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2777d9dcd5aeSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2778d9dcd5aeSmrg# ----------------------------------------------------------------
2779d9dcd5aeSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
2780d9dcd5aeSmrg[m4_require([_LT_HEADER_DLFCN])dnl
2781d9dcd5aeSmrgif test "$cross_compiling" = yes; then :
2782d9dcd5aeSmrg  [$4]
2783d9dcd5aeSmrgelse
2784d9dcd5aeSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2785d9dcd5aeSmrg  lt_status=$lt_dlunknown
2786d9dcd5aeSmrg  cat > conftest.$ac_ext <<_LT_EOF
2787d9dcd5aeSmrg[#line $LINENO "configure"
2788d9dcd5aeSmrg#include "confdefs.h"
2789191cded7Smrg
2790d9dcd5aeSmrg#if HAVE_DLFCN_H
2791d9dcd5aeSmrg#include <dlfcn.h>
2792d9dcd5aeSmrg#endif
2793191cded7Smrg
2794d9dcd5aeSmrg#include <stdio.h>
2795191cded7Smrg
2796d9dcd5aeSmrg#ifdef RTLD_GLOBAL
2797d9dcd5aeSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
2798d9dcd5aeSmrg#else
2799d9dcd5aeSmrg#  ifdef DL_GLOBAL
2800d9dcd5aeSmrg#    define LT_DLGLOBAL		DL_GLOBAL
2801d9dcd5aeSmrg#  else
2802d9dcd5aeSmrg#    define LT_DLGLOBAL		0
2803d9dcd5aeSmrg#  endif
2804d9dcd5aeSmrg#endif
2805191cded7Smrg
2806d9dcd5aeSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2807d9dcd5aeSmrg   find out it does not work in some platform. */
2808d9dcd5aeSmrg#ifndef LT_DLLAZY_OR_NOW
2809d9dcd5aeSmrg#  ifdef RTLD_LAZY
2810d9dcd5aeSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2811d9dcd5aeSmrg#  else
2812d9dcd5aeSmrg#    ifdef DL_LAZY
2813d9dcd5aeSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
2814d9dcd5aeSmrg#    else
2815d9dcd5aeSmrg#      ifdef RTLD_NOW
2816d9dcd5aeSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2817d9dcd5aeSmrg#      else
2818d9dcd5aeSmrg#        ifdef DL_NOW
2819d9dcd5aeSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
2820d9dcd5aeSmrg#        else
2821d9dcd5aeSmrg#          define LT_DLLAZY_OR_NOW	0
2822d9dcd5aeSmrg#        endif
2823d9dcd5aeSmrg#      endif
2824d9dcd5aeSmrg#    endif
2825d9dcd5aeSmrg#  endif
2826d9dcd5aeSmrg#endif
2827191cded7Smrg
2828d9dcd5aeSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
2829d9dcd5aeSmrg   correspondingly for the symbols needed.  */
2830d9dcd5aeSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2831d9dcd5aeSmrgint fnord () __attribute__((visibility("default")));
2832d9dcd5aeSmrg#endif
2833191cded7Smrg
2834d9dcd5aeSmrgint fnord () { return 42; }
2835d9dcd5aeSmrgint main ()
2836d9dcd5aeSmrg{
2837d9dcd5aeSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2838d9dcd5aeSmrg  int status = $lt_dlunknown;
2839191cded7Smrg
2840d9dcd5aeSmrg  if (self)
2841d9dcd5aeSmrg    {
2842d9dcd5aeSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2843d9dcd5aeSmrg      else
2844d9dcd5aeSmrg        {
2845d9dcd5aeSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2846d9dcd5aeSmrg          else puts (dlerror ());
2847d9dcd5aeSmrg	}
2848d9dcd5aeSmrg      /* dlclose (self); */
2849d9dcd5aeSmrg    }
2850d9dcd5aeSmrg  else
2851d9dcd5aeSmrg    puts (dlerror ());
2852191cded7Smrg
2853d9dcd5aeSmrg  return status;
2854d9dcd5aeSmrg}]
2855d9dcd5aeSmrg_LT_EOF
2856d9dcd5aeSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2857d9dcd5aeSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2858d9dcd5aeSmrg    lt_status=$?
2859d9dcd5aeSmrg    case x$lt_status in
2860d9dcd5aeSmrg      x$lt_dlno_uscore) $1 ;;
2861d9dcd5aeSmrg      x$lt_dlneed_uscore) $2 ;;
2862d9dcd5aeSmrg      x$lt_dlunknown|x*) $3 ;;
2863d9dcd5aeSmrg    esac
2864d9dcd5aeSmrg  else :
2865d9dcd5aeSmrg    # compilation failed
2866d9dcd5aeSmrg    $3
2867d9dcd5aeSmrg  fi
2868d9dcd5aeSmrgfi
2869d9dcd5aeSmrgrm -fr conftest*
2870d9dcd5aeSmrg])# _LT_TRY_DLOPEN_SELF
2871191cded7Smrg
2872191cded7Smrg
2873d9dcd5aeSmrg# LT_SYS_DLOPEN_SELF
2874d9dcd5aeSmrg# ------------------
2875d9dcd5aeSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
2876d9dcd5aeSmrg[m4_require([_LT_HEADER_DLFCN])dnl
2877d9dcd5aeSmrgif test "x$enable_dlopen" != xyes; then
2878d9dcd5aeSmrg  enable_dlopen=unknown
2879d9dcd5aeSmrg  enable_dlopen_self=unknown
2880d9dcd5aeSmrg  enable_dlopen_self_static=unknown
2881d9dcd5aeSmrgelse
2882d9dcd5aeSmrg  lt_cv_dlopen=no
2883d9dcd5aeSmrg  lt_cv_dlopen_libs=
2884191cded7Smrg
2885d9dcd5aeSmrg  case $host_os in
2886d9dcd5aeSmrg  beos*)
2887d9dcd5aeSmrg    lt_cv_dlopen="load_add_on"
2888d9dcd5aeSmrg    lt_cv_dlopen_libs=
2889d9dcd5aeSmrg    lt_cv_dlopen_self=yes
2890d9dcd5aeSmrg    ;;
2891ba064abeSmrg
2892d9dcd5aeSmrg  mingw* | pw32* | cegcc*)
2893d9dcd5aeSmrg    lt_cv_dlopen="LoadLibrary"
2894d9dcd5aeSmrg    lt_cv_dlopen_libs=
2895d9dcd5aeSmrg    ;;
2896ba064abeSmrg
2897d9dcd5aeSmrg  cygwin*)
2898d9dcd5aeSmrg    lt_cv_dlopen="dlopen"
2899d9dcd5aeSmrg    lt_cv_dlopen_libs=
2900d9dcd5aeSmrg    ;;
2901ba064abeSmrg
2902d9dcd5aeSmrg  darwin*)
2903d9dcd5aeSmrg  # if libdl is installed we need to link against it
2904d9dcd5aeSmrg    AC_CHECK_LIB([dl], [dlopen],
2905d9dcd5aeSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2906d9dcd5aeSmrg    lt_cv_dlopen="dyld"
2907d9dcd5aeSmrg    lt_cv_dlopen_libs=
2908d9dcd5aeSmrg    lt_cv_dlopen_self=yes
2909d9dcd5aeSmrg    ])
2910d9dcd5aeSmrg    ;;
2911ba064abeSmrg
2912d9dcd5aeSmrg  *)
2913d9dcd5aeSmrg    AC_CHECK_FUNC([shl_load],
2914d9dcd5aeSmrg	  [lt_cv_dlopen="shl_load"],
2915d9dcd5aeSmrg      [AC_CHECK_LIB([dld], [shl_load],
2916d9dcd5aeSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2917d9dcd5aeSmrg	[AC_CHECK_FUNC([dlopen],
2918d9dcd5aeSmrg	      [lt_cv_dlopen="dlopen"],
2919d9dcd5aeSmrg	  [AC_CHECK_LIB([dl], [dlopen],
2920d9dcd5aeSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2921d9dcd5aeSmrg	    [AC_CHECK_LIB([svld], [dlopen],
2922d9dcd5aeSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2923d9dcd5aeSmrg	      [AC_CHECK_LIB([dld], [dld_link],
2924d9dcd5aeSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
2925d9dcd5aeSmrg	      ])
2926d9dcd5aeSmrg	    ])
2927d9dcd5aeSmrg	  ])
2928d9dcd5aeSmrg	])
2929d9dcd5aeSmrg      ])
2930d9dcd5aeSmrg    ;;
2931d9dcd5aeSmrg  esac
2932ba064abeSmrg
2933d9dcd5aeSmrg  if test "x$lt_cv_dlopen" != xno; then
2934d9dcd5aeSmrg    enable_dlopen=yes
2935d9dcd5aeSmrg  else
2936d9dcd5aeSmrg    enable_dlopen=no
2937d9dcd5aeSmrg  fi
2938ba064abeSmrg
2939d9dcd5aeSmrg  case $lt_cv_dlopen in
2940d9dcd5aeSmrg  dlopen)
2941d9dcd5aeSmrg    save_CPPFLAGS="$CPPFLAGS"
2942d9dcd5aeSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2943ba064abeSmrg
2944d9dcd5aeSmrg    save_LDFLAGS="$LDFLAGS"
2945d9dcd5aeSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2946ba064abeSmrg
2947d9dcd5aeSmrg    save_LIBS="$LIBS"
2948d9dcd5aeSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2949ba064abeSmrg
2950d9dcd5aeSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2951d9dcd5aeSmrg	  lt_cv_dlopen_self, [dnl
2952d9dcd5aeSmrg	  _LT_TRY_DLOPEN_SELF(
2953d9dcd5aeSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2954d9dcd5aeSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2955d9dcd5aeSmrg    ])
2956ba064abeSmrg
2957d9dcd5aeSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
2958d9dcd5aeSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2959d9dcd5aeSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2960d9dcd5aeSmrg	  lt_cv_dlopen_self_static, [dnl
2961d9dcd5aeSmrg	  _LT_TRY_DLOPEN_SELF(
2962d9dcd5aeSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2963d9dcd5aeSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2964d9dcd5aeSmrg      ])
2965d9dcd5aeSmrg    fi
2966ba064abeSmrg
2967d9dcd5aeSmrg    CPPFLAGS="$save_CPPFLAGS"
2968d9dcd5aeSmrg    LDFLAGS="$save_LDFLAGS"
2969d9dcd5aeSmrg    LIBS="$save_LIBS"
2970d9dcd5aeSmrg    ;;
2971d9dcd5aeSmrg  esac
2972ba064abeSmrg
2973d9dcd5aeSmrg  case $lt_cv_dlopen_self in
2974d9dcd5aeSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2975d9dcd5aeSmrg  *) enable_dlopen_self=unknown ;;
2976d9dcd5aeSmrg  esac
2977ba064abeSmrg
2978d9dcd5aeSmrg  case $lt_cv_dlopen_self_static in
2979d9dcd5aeSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2980d9dcd5aeSmrg  *) enable_dlopen_self_static=unknown ;;
2981ba064abeSmrg  esac
2982d9dcd5aeSmrgfi
2983d9dcd5aeSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2984d9dcd5aeSmrg	 [Whether dlopen is supported])
2985d9dcd5aeSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2986d9dcd5aeSmrg	 [Whether dlopen of programs is supported])
2987d9dcd5aeSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2988d9dcd5aeSmrg	 [Whether dlopen of statically linked programs is supported])
2989d9dcd5aeSmrg])# LT_SYS_DLOPEN_SELF
2990ba064abeSmrg
2991d9dcd5aeSmrg# Old name:
2992d9dcd5aeSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2993d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
2994d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2995ba064abeSmrg
2996ba064abeSmrg
2997d9dcd5aeSmrg# _LT_COMPILER_C_O([TAGNAME])
2998d9dcd5aeSmrg# ---------------------------
2999d9dcd5aeSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
3000d9dcd5aeSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
3001d9dcd5aeSmrgm4_defun([_LT_COMPILER_C_O],
3002ba064abeSmrg[m4_require([_LT_DECL_SED])dnl
3003d9dcd5aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3004d9dcd5aeSmrgm4_require([_LT_TAG_COMPILER])dnl
3005d9dcd5aeSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3006d9dcd5aeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3007d9dcd5aeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3008d9dcd5aeSmrg   $RM -r conftest 2>/dev/null
3009d9dcd5aeSmrg   mkdir conftest
3010d9dcd5aeSmrg   cd conftest
3011d9dcd5aeSmrg   mkdir out
3012d9dcd5aeSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3013ba064abeSmrg
3014d9dcd5aeSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
3015d9dcd5aeSmrg   # Insert the option either (1) after the last *FLAGS variable, or
3016d9dcd5aeSmrg   # (2) before a word containing "conftest.", or (3) at the end.
3017d9dcd5aeSmrg   # Note that $ac_compile itself does not contain backslashes and begins
3018d9dcd5aeSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
3019d9dcd5aeSmrg   lt_compile=`echo "$ac_compile" | $SED \
3020d9dcd5aeSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3021d9dcd5aeSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3022d9dcd5aeSmrg   -e 's:$: $lt_compiler_flag:'`
3023d9dcd5aeSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3024d9dcd5aeSmrg   (eval "$lt_compile" 2>out/conftest.err)
3025d9dcd5aeSmrg   ac_status=$?
3026d9dcd5aeSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3027d9dcd5aeSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3028d9dcd5aeSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3029d9dcd5aeSmrg   then
3030d9dcd5aeSmrg     # The compiler can only warn and ignore the option if not recognized
3031d9dcd5aeSmrg     # So say no if there are warnings
3032d9dcd5aeSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3033d9dcd5aeSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3034d9dcd5aeSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3035d9dcd5aeSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3036d9dcd5aeSmrg     fi
3037d9dcd5aeSmrg   fi
3038d9dcd5aeSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3039d9dcd5aeSmrg   $RM conftest*
3040d9dcd5aeSmrg   # SGI C++ compiler will create directory out/ii_files/ for
3041d9dcd5aeSmrg   # template instantiation
3042d9dcd5aeSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3043d9dcd5aeSmrg   $RM out/* && rmdir out
3044d9dcd5aeSmrg   cd ..
3045d9dcd5aeSmrg   $RM -r conftest
3046d9dcd5aeSmrg   $RM conftest*
3047d9dcd5aeSmrg])
3048d9dcd5aeSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3049d9dcd5aeSmrg	[Does compiler simultaneously support -c and -o options?])
3050d9dcd5aeSmrg])# _LT_COMPILER_C_O
3051ba064abeSmrg
3052ba064abeSmrg
3053d9dcd5aeSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3054d9dcd5aeSmrg# ----------------------------------
3055d9dcd5aeSmrg# Check to see if we can do hard links to lock some files if needed
3056d9dcd5aeSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
3057d9dcd5aeSmrg[m4_require([_LT_ENABLE_LOCK])dnl
3058d9dcd5aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3059d9dcd5aeSmrg_LT_COMPILER_C_O([$1])
3060ba064abeSmrg
3061d9dcd5aeSmrghard_links="nottested"
3062d9dcd5aeSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3063d9dcd5aeSmrg  # do not overwrite the value of need_locks provided by the user
3064d9dcd5aeSmrg  AC_MSG_CHECKING([if we can lock with hard links])
3065d9dcd5aeSmrg  hard_links=yes
3066d9dcd5aeSmrg  $RM conftest*
3067d9dcd5aeSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3068d9dcd5aeSmrg  touch conftest.a
3069d9dcd5aeSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
3070d9dcd5aeSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3071d9dcd5aeSmrg  AC_MSG_RESULT([$hard_links])
3072d9dcd5aeSmrg  if test "$hard_links" = no; then
3073d9dcd5aeSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3074d9dcd5aeSmrg    need_locks=warn
3075d9dcd5aeSmrg  fi
3076ba064abeSmrgelse
3077d9dcd5aeSmrg  need_locks=no
3078ba064abeSmrgfi
3079d9dcd5aeSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3080d9dcd5aeSmrg])# _LT_COMPILER_FILE_LOCKS
3081ba064abeSmrg
3082ba064abeSmrg
3083d9dcd5aeSmrg# _LT_CHECK_OBJDIR
3084d9dcd5aeSmrg# ----------------
3085d9dcd5aeSmrgm4_defun([_LT_CHECK_OBJDIR],
3086d9dcd5aeSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3087d9dcd5aeSmrg[rm -f .libs 2>/dev/null
3088d9dcd5aeSmrgmkdir .libs 2>/dev/null
3089d9dcd5aeSmrgif test -d .libs; then
3090d9dcd5aeSmrg  lt_cv_objdir=.libs
3091d9dcd5aeSmrgelse
3092d9dcd5aeSmrg  # MS-DOS does not allow filenames that begin with a dot.
3093d9dcd5aeSmrg  lt_cv_objdir=_libs
3094d9dcd5aeSmrgfi
3095d9dcd5aeSmrgrmdir .libs 2>/dev/null])
3096d9dcd5aeSmrgobjdir=$lt_cv_objdir
3097d9dcd5aeSmrg_LT_DECL([], [objdir], [0],
3098d9dcd5aeSmrg         [The name of the directory that contains temporary libtool files])dnl
3099d9dcd5aeSmrgm4_pattern_allow([LT_OBJDIR])dnl
3100d9dcd5aeSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3101d9dcd5aeSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3102d9dcd5aeSmrg])# _LT_CHECK_OBJDIR
3103ba064abeSmrg
3104ba064abeSmrg
3105d9dcd5aeSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3106d9dcd5aeSmrg# --------------------------------------
3107d9dcd5aeSmrg# Check hardcoding attributes.
3108d9dcd5aeSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3109d9dcd5aeSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
3110d9dcd5aeSmrg_LT_TAGVAR(hardcode_action, $1)=
3111d9dcd5aeSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3112d9dcd5aeSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3113d9dcd5aeSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3114ba064abeSmrg
3115d9dcd5aeSmrg  # We can hardcode non-existent directories.
3116d9dcd5aeSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3117d9dcd5aeSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3118d9dcd5aeSmrg     # have to relink, otherwise we might link with an installed library
3119d9dcd5aeSmrg     # when we should be linking with a yet-to-be-installed one
3120d9dcd5aeSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3121d9dcd5aeSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3122d9dcd5aeSmrg    # Linking always hardcodes the temporary library directory.
3123d9dcd5aeSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
3124d9dcd5aeSmrg  else
3125d9dcd5aeSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3126d9dcd5aeSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
3127d9dcd5aeSmrg  fi
3128d9dcd5aeSmrgelse
3129d9dcd5aeSmrg  # We cannot hardcode anything, or else we can only hardcode existing
3130d9dcd5aeSmrg  # directories.
3131d9dcd5aeSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
3132d9dcd5aeSmrgfi
3133d9dcd5aeSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3134ba064abeSmrg
3135d9dcd5aeSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3136d9dcd5aeSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3137d9dcd5aeSmrg  # Fast installation is not supported
3138d9dcd5aeSmrg  enable_fast_install=no
3139d9dcd5aeSmrgelif test "$shlibpath_overrides_runpath" = yes ||
3140d9dcd5aeSmrg     test "$enable_shared" = no; then
3141d9dcd5aeSmrg  # Fast installation is not necessary
3142d9dcd5aeSmrg  enable_fast_install=needless
3143d9dcd5aeSmrgfi
3144d9dcd5aeSmrg_LT_TAGDECL([], [hardcode_action], [0],
3145d9dcd5aeSmrg    [How to hardcode a shared library path into an executable])
3146d9dcd5aeSmrg])# _LT_LINKER_HARDCODE_LIBPATH
3147ba064abeSmrg
3148d9dcd5aeSmrg
3149d9dcd5aeSmrg# _LT_CMD_STRIPLIB
3150d9dcd5aeSmrg# ----------------
3151d9dcd5aeSmrgm4_defun([_LT_CMD_STRIPLIB],
3152d9dcd5aeSmrg[m4_require([_LT_DECL_EGREP])
3153d9dcd5aeSmrgstriplib=
3154d9dcd5aeSmrgold_striplib=
3155d9dcd5aeSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
3156d9dcd5aeSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3157d9dcd5aeSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3158d9dcd5aeSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3159d9dcd5aeSmrg  AC_MSG_RESULT([yes])
3160d9dcd5aeSmrgelse
3161d9dcd5aeSmrg# FIXME - insert some real tests, host_os isn't really good enough
3162d9dcd5aeSmrg  case $host_os in
3163d9dcd5aeSmrg  darwin*)
3164d9dcd5aeSmrg    if test -n "$STRIP" ; then
3165d9dcd5aeSmrg      striplib="$STRIP -x"
3166d9dcd5aeSmrg      old_striplib="$STRIP -S"
3167d9dcd5aeSmrg      AC_MSG_RESULT([yes])
3168ba064abeSmrg    else
3169d9dcd5aeSmrg      AC_MSG_RESULT([no])
3170ba064abeSmrg    fi
3171d9dcd5aeSmrg    ;;
3172d9dcd5aeSmrg  *)
3173d9dcd5aeSmrg    AC_MSG_RESULT([no])
3174d9dcd5aeSmrg    ;;
3175d9dcd5aeSmrg  esac
3176d9dcd5aeSmrgfi
3177d9dcd5aeSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3178d9dcd5aeSmrg_LT_DECL([], [striplib], [1])
3179d9dcd5aeSmrg])# _LT_CMD_STRIPLIB
3180ba064abeSmrg
3181ba064abeSmrg
3182d9dcd5aeSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
3183d9dcd5aeSmrg# -----------------------------
3184d9dcd5aeSmrg# PORTME Fill in your ld.so characteristics
3185d9dcd5aeSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
3186d9dcd5aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3187d9dcd5aeSmrgm4_require([_LT_DECL_EGREP])dnl
3188d9dcd5aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3189d9dcd5aeSmrgm4_require([_LT_DECL_OBJDUMP])dnl
3190d9dcd5aeSmrgm4_require([_LT_DECL_SED])dnl
3191d9dcd5aeSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
3192d9dcd5aeSmrgAC_MSG_CHECKING([dynamic linker characteristics])
3193d9dcd5aeSmrgm4_if([$1],
3194d9dcd5aeSmrg	[], [
3195d9dcd5aeSmrgif test "$GCC" = yes; then
3196d9dcd5aeSmrg  case $host_os in
3197d9dcd5aeSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3198d9dcd5aeSmrg    *) lt_awk_arg="/^libraries:/" ;;
3199d9dcd5aeSmrg  esac
3200d9dcd5aeSmrg  case $host_os in
3201d9dcd5aeSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3202d9dcd5aeSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
3203d9dcd5aeSmrg  esac
3204d9dcd5aeSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3205d9dcd5aeSmrg  case $lt_search_path_spec in
3206d9dcd5aeSmrg  *\;*)
3207d9dcd5aeSmrg    # if the path contains ";" then we assume it to be the separator
3208d9dcd5aeSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
3209d9dcd5aeSmrg    # assumed that no part of a normal pathname contains ";" but that should
3210d9dcd5aeSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
3211d9dcd5aeSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3212d9dcd5aeSmrg    ;;
3213d9dcd5aeSmrg  *)
3214d9dcd5aeSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3215d9dcd5aeSmrg    ;;
3216d9dcd5aeSmrg  esac
3217d9dcd5aeSmrg  # Ok, now we have the path, separated by spaces, we can step through it
3218d9dcd5aeSmrg  # and add multilib dir if necessary.
3219d9dcd5aeSmrg  lt_tmp_lt_search_path_spec=
3220d9dcd5aeSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3221d9dcd5aeSmrg  for lt_sys_path in $lt_search_path_spec; do
3222d9dcd5aeSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3223d9dcd5aeSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3224d9dcd5aeSmrg    else
3225d9dcd5aeSmrg      test -d "$lt_sys_path" && \
3226d9dcd5aeSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3227d9dcd5aeSmrg    fi
3228d9dcd5aeSmrg  done
3229d9dcd5aeSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3230d9dcd5aeSmrgBEGIN {RS=" "; FS="/|\n";} {
3231d9dcd5aeSmrg  lt_foo="";
3232d9dcd5aeSmrg  lt_count=0;
3233d9dcd5aeSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
3234d9dcd5aeSmrg    if ($lt_i != "" && $lt_i != ".") {
3235d9dcd5aeSmrg      if ($lt_i == "..") {
3236d9dcd5aeSmrg        lt_count++;
3237d9dcd5aeSmrg      } else {
3238d9dcd5aeSmrg        if (lt_count == 0) {
3239d9dcd5aeSmrg          lt_foo="/" $lt_i lt_foo;
3240d9dcd5aeSmrg        } else {
3241d9dcd5aeSmrg          lt_count--;
3242d9dcd5aeSmrg        }
3243d9dcd5aeSmrg      }
3244d9dcd5aeSmrg    }
3245d9dcd5aeSmrg  }
3246d9dcd5aeSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3247d9dcd5aeSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3248d9dcd5aeSmrg}'`
3249d9dcd5aeSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
3250d9dcd5aeSmrg  # for these hosts.
3251d9dcd5aeSmrg  case $host_os in
3252d9dcd5aeSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3253d9dcd5aeSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3254d9dcd5aeSmrg  esac
3255d9dcd5aeSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3256d9dcd5aeSmrgelse
3257d9dcd5aeSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3258d9dcd5aeSmrgfi])
3259d9dcd5aeSmrglibrary_names_spec=
3260d9dcd5aeSmrglibname_spec='lib$name'
3261d9dcd5aeSmrgsoname_spec=
3262d9dcd5aeSmrgshrext_cmds=".so"
3263d9dcd5aeSmrgpostinstall_cmds=
3264d9dcd5aeSmrgpostuninstall_cmds=
3265d9dcd5aeSmrgfinish_cmds=
3266d9dcd5aeSmrgfinish_eval=
3267d9dcd5aeSmrgshlibpath_var=
3268d9dcd5aeSmrgshlibpath_overrides_runpath=unknown
3269d9dcd5aeSmrgversion_type=none
3270d9dcd5aeSmrgdynamic_linker="$host_os ld.so"
3271d9dcd5aeSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
3272d9dcd5aeSmrgneed_lib_prefix=unknown
3273d9dcd5aeSmrghardcode_into_libs=no
3274d9dcd5aeSmrg
3275d9dcd5aeSmrg# when you set need_version to no, make sure it does not cause -set_version
3276d9dcd5aeSmrg# flags to be left without arguments
3277d9dcd5aeSmrgneed_version=unknown
3278d9dcd5aeSmrg
3279d9dcd5aeSmrgcase $host_os in
3280d9dcd5aeSmrgaix3*)
3281d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3282d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3283d9dcd5aeSmrg  shlibpath_var=LIBPATH
3284d9dcd5aeSmrg
3285d9dcd5aeSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
3286d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3287ba064abeSmrg  ;;
3288d9dcd5aeSmrg
3289d9dcd5aeSmrgaix[[4-9]]*)
3290d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3291d9dcd5aeSmrg  need_lib_prefix=no
3292d9dcd5aeSmrg  need_version=no
3293d9dcd5aeSmrg  hardcode_into_libs=yes
3294d9dcd5aeSmrg  if test "$host_cpu" = ia64; then
3295d9dcd5aeSmrg    # AIX 5 supports IA64
3296d9dcd5aeSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3297d9dcd5aeSmrg    shlibpath_var=LD_LIBRARY_PATH
3298d9dcd5aeSmrg  else
3299d9dcd5aeSmrg    # With GCC up to 2.95.x, collect2 would create an import file
3300d9dcd5aeSmrg    # for dependence libraries.  The import file would start with
3301d9dcd5aeSmrg    # the line `#! .'.  This would cause the generated library to
3302d9dcd5aeSmrg    # depend on `.', always an invalid library.  This was fixed in
3303d9dcd5aeSmrg    # development snapshots of GCC prior to 3.0.
3304d9dcd5aeSmrg    case $host_os in
3305d9dcd5aeSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
3306d9dcd5aeSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3307d9dcd5aeSmrg	   echo ' yes '
3308d9dcd5aeSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3309d9dcd5aeSmrg	:
3310d9dcd5aeSmrg      else
3311d9dcd5aeSmrg	can_build_shared=no
3312d9dcd5aeSmrg      fi
3313ba064abeSmrg      ;;
3314ba064abeSmrg    esac
3315d9dcd5aeSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3316d9dcd5aeSmrg    # soname into executable. Probably we can add versioning support to
3317d9dcd5aeSmrg    # collect2, so additional links can be useful in future.
3318d9dcd5aeSmrg    if test "$aix_use_runtimelinking" = yes; then
3319d9dcd5aeSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3320d9dcd5aeSmrg      # instead of lib<name>.a to let people know that these are not
3321d9dcd5aeSmrg      # typical AIX shared libraries.
3322d9dcd5aeSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3323d9dcd5aeSmrg    else
3324d9dcd5aeSmrg      # We preserve .a as extension for shared libraries through AIX4.2
3325d9dcd5aeSmrg      # and later when we are not doing run time linking.
3326d9dcd5aeSmrg      library_names_spec='${libname}${release}.a $libname.a'
3327d9dcd5aeSmrg      soname_spec='${libname}${release}${shared_ext}$major'
3328d9dcd5aeSmrg    fi
3329d9dcd5aeSmrg    shlibpath_var=LIBPATH
3330ba064abeSmrg  fi
3331ba064abeSmrg  ;;
3332ba064abeSmrg
3333d9dcd5aeSmrgamigaos*)
3334d9dcd5aeSmrg  case $host_cpu in
3335d9dcd5aeSmrg  powerpc)
3336d9dcd5aeSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
3337d9dcd5aeSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3338d9dcd5aeSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3339ba064abeSmrg    ;;
3340d9dcd5aeSmrg  m68k)
3341d9dcd5aeSmrg    library_names_spec='$libname.ixlibrary $libname.a'
3342d9dcd5aeSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3343d9dcd5aeSmrg    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'
3344ba064abeSmrg    ;;
3345ba064abeSmrg  esac
3346d9dcd5aeSmrg  ;;
3347ba064abeSmrg
3348d9dcd5aeSmrgbeos*)
3349d9dcd5aeSmrg  library_names_spec='${libname}${shared_ext}'
3350d9dcd5aeSmrg  dynamic_linker="$host_os ld.so"
3351d9dcd5aeSmrg  shlibpath_var=LIBRARY_PATH
3352d9dcd5aeSmrg  ;;
3353ba064abeSmrg
3354d9dcd5aeSmrgbsdi[[45]]*)
3355d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3356d9dcd5aeSmrg  need_version=no
3357d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3358d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3359d9dcd5aeSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3360d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3361d9dcd5aeSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3362d9dcd5aeSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3363d9dcd5aeSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
3364d9dcd5aeSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3365d9dcd5aeSmrg  # libtool to hard-code these into programs
3366d9dcd5aeSmrg  ;;
3367ba064abeSmrg
3368d9dcd5aeSmrgcygwin* | mingw* | pw32* | cegcc*)
3369d9dcd5aeSmrg  version_type=windows
3370d9dcd5aeSmrg  shrext_cmds=".dll"
3371d9dcd5aeSmrg  need_version=no
3372d9dcd5aeSmrg  need_lib_prefix=no
3373ba064abeSmrg
3374d9dcd5aeSmrg  case $GCC,$cc_basename in
3375d9dcd5aeSmrg  yes,*)
3376d9dcd5aeSmrg    # gcc
3377d9dcd5aeSmrg    library_names_spec='$libname.dll.a'
3378d9dcd5aeSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3379d9dcd5aeSmrg    postinstall_cmds='base_file=`basename \${file}`~
3380d9dcd5aeSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3381d9dcd5aeSmrg      dldir=$destdir/`dirname \$dlpath`~
3382d9dcd5aeSmrg      test -d \$dldir || mkdir -p \$dldir~
3383d9dcd5aeSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
3384d9dcd5aeSmrg      chmod a+x \$dldir/$dlname~
3385d9dcd5aeSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3386d9dcd5aeSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3387d9dcd5aeSmrg      fi'
3388d9dcd5aeSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3389d9dcd5aeSmrg      dlpath=$dir/\$dldll~
3390d9dcd5aeSmrg       $RM \$dlpath'
3391d9dcd5aeSmrg    shlibpath_overrides_runpath=yes
3392ba064abeSmrg
3393d9dcd5aeSmrg    case $host_os in
3394d9dcd5aeSmrg    cygwin*)
3395d9dcd5aeSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3396d9dcd5aeSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3397d9dcd5aeSmrgm4_if([$1], [],[
3398d9dcd5aeSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3399d9dcd5aeSmrg      ;;
3400d9dcd5aeSmrg    mingw* | cegcc*)
3401d9dcd5aeSmrg      # MinGW DLLs use traditional 'lib' prefix
3402d9dcd5aeSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3403d9dcd5aeSmrg      ;;
3404d9dcd5aeSmrg    pw32*)
3405d9dcd5aeSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
3406d9dcd5aeSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3407d9dcd5aeSmrg      ;;
3408d9dcd5aeSmrg    esac
3409d9dcd5aeSmrg    dynamic_linker='Win32 ld.exe'
3410ba064abeSmrg    ;;
3411ba064abeSmrg
3412d9dcd5aeSmrg  *,cl*)
3413d9dcd5aeSmrg    # Native MSVC
3414d9dcd5aeSmrg    libname_spec='$name'
3415d9dcd5aeSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3416d9dcd5aeSmrg    library_names_spec='${libname}.dll.lib'
3417d9dcd5aeSmrg
3418d9dcd5aeSmrg    case $build_os in
3419d9dcd5aeSmrg    mingw*)
3420d9dcd5aeSmrg      sys_lib_search_path_spec=
3421d9dcd5aeSmrg      lt_save_ifs=$IFS
3422d9dcd5aeSmrg      IFS=';'
3423d9dcd5aeSmrg      for lt_path in $LIB
3424d9dcd5aeSmrg      do
3425d9dcd5aeSmrg        IFS=$lt_save_ifs
3426d9dcd5aeSmrg        # Let DOS variable expansion print the short 8.3 style file name.
3427d9dcd5aeSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3428d9dcd5aeSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3429d9dcd5aeSmrg      done
3430d9dcd5aeSmrg      IFS=$lt_save_ifs
3431d9dcd5aeSmrg      # Convert to MSYS style.
3432d9dcd5aeSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3433d9dcd5aeSmrg      ;;
3434d9dcd5aeSmrg    cygwin*)
3435d9dcd5aeSmrg      # Convert to unix form, then to dos form, then back to unix form
3436d9dcd5aeSmrg      # but this time dos style (no spaces!) so that the unix form looks
3437d9dcd5aeSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
3438d9dcd5aeSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3439d9dcd5aeSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3440d9dcd5aeSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3441d9dcd5aeSmrg      ;;
3442d9dcd5aeSmrg    *)
3443d9dcd5aeSmrg      sys_lib_search_path_spec="$LIB"
3444d9dcd5aeSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3445d9dcd5aeSmrg        # It is most probably a Windows format PATH.
3446d9dcd5aeSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3447d9dcd5aeSmrg      else
3448d9dcd5aeSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3449d9dcd5aeSmrg      fi
3450d9dcd5aeSmrg      # FIXME: find the short name or the path components, as spaces are
3451d9dcd5aeSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
3452d9dcd5aeSmrg      ;;
3453d9dcd5aeSmrg    esac
3454ba064abeSmrg
3455d9dcd5aeSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3456d9dcd5aeSmrg    postinstall_cmds='base_file=`basename \${file}`~
3457d9dcd5aeSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3458d9dcd5aeSmrg      dldir=$destdir/`dirname \$dlpath`~
3459d9dcd5aeSmrg      test -d \$dldir || mkdir -p \$dldir~
3460d9dcd5aeSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
3461d9dcd5aeSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3462d9dcd5aeSmrg      dlpath=$dir/\$dldll~
3463d9dcd5aeSmrg       $RM \$dlpath'
3464d9dcd5aeSmrg    shlibpath_overrides_runpath=yes
3465d9dcd5aeSmrg    dynamic_linker='Win32 link.exe'
3466ba064abeSmrg    ;;
3467ba064abeSmrg
3468d9dcd5aeSmrg  *)
3469d9dcd5aeSmrg    # Assume MSVC wrapper
3470d9dcd5aeSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3471d9dcd5aeSmrg    dynamic_linker='Win32 ld.exe'
3472ba064abeSmrg    ;;
3473d9dcd5aeSmrg  esac
3474d9dcd5aeSmrg  # FIXME: first we should search . and the directory the executable is in
3475d9dcd5aeSmrg  shlibpath_var=PATH
3476d9dcd5aeSmrg  ;;
3477ba064abeSmrg
3478d9dcd5aeSmrgdarwin* | rhapsody*)
3479d9dcd5aeSmrg  dynamic_linker="$host_os dyld"
3480d9dcd5aeSmrg  version_type=darwin
3481d9dcd5aeSmrg  need_lib_prefix=no
3482d9dcd5aeSmrg  need_version=no
3483d9dcd5aeSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3484d9dcd5aeSmrg  soname_spec='${libname}${release}${major}$shared_ext'
3485d9dcd5aeSmrg  shlibpath_overrides_runpath=yes
3486d9dcd5aeSmrg  shlibpath_var=DYLD_LIBRARY_PATH
3487d9dcd5aeSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3488d9dcd5aeSmrgm4_if([$1], [],[
3489d9dcd5aeSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3490d9dcd5aeSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3491d9dcd5aeSmrg  ;;
3492ba064abeSmrg
3493d9dcd5aeSmrgdgux*)
3494d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3495d9dcd5aeSmrg  need_lib_prefix=no
3496d9dcd5aeSmrg  need_version=no
3497d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3498d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3499d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3500d9dcd5aeSmrg  ;;
3501ba064abeSmrg
3502d9dcd5aeSmrgfreebsd* | dragonfly*)
3503d9dcd5aeSmrg  # DragonFly does not have aout.  When/if they implement a new
3504d9dcd5aeSmrg  # versioning mechanism, adjust this.
3505d9dcd5aeSmrg  if test -x /usr/bin/objformat; then
3506d9dcd5aeSmrg    objformat=`/usr/bin/objformat`
3507d9dcd5aeSmrg  else
3508d9dcd5aeSmrg    case $host_os in
3509d9dcd5aeSmrg    freebsd[[23]].*) objformat=aout ;;
3510d9dcd5aeSmrg    *) objformat=elf ;;
3511d9dcd5aeSmrg    esac
3512d9dcd5aeSmrg  fi
3513d9dcd5aeSmrg  version_type=freebsd-$objformat
3514d9dcd5aeSmrg  case $version_type in
3515d9dcd5aeSmrg    freebsd-elf*)
3516d9dcd5aeSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3517d9dcd5aeSmrg      need_version=no
3518d9dcd5aeSmrg      need_lib_prefix=no
3519d9dcd5aeSmrg      ;;
3520d9dcd5aeSmrg    freebsd-*)
3521d9dcd5aeSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3522d9dcd5aeSmrg      need_version=yes
3523d9dcd5aeSmrg      ;;
3524d9dcd5aeSmrg  esac
3525d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3526d9dcd5aeSmrg  case $host_os in
3527d9dcd5aeSmrg  freebsd2.*)
3528d9dcd5aeSmrg    shlibpath_overrides_runpath=yes
3529ba064abeSmrg    ;;
3530d9dcd5aeSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3531d9dcd5aeSmrg    shlibpath_overrides_runpath=yes
3532d9dcd5aeSmrg    hardcode_into_libs=yes
3533ba064abeSmrg    ;;
3534d9dcd5aeSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3535d9dcd5aeSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3536d9dcd5aeSmrg    shlibpath_overrides_runpath=no
3537d9dcd5aeSmrg    hardcode_into_libs=yes
3538ba064abeSmrg    ;;
3539d9dcd5aeSmrg  *) # from 4.6 on, and DragonFly
3540d9dcd5aeSmrg    shlibpath_overrides_runpath=yes
3541d9dcd5aeSmrg    hardcode_into_libs=yes
3542d9dcd5aeSmrg    ;;
3543d9dcd5aeSmrg  esac
3544d9dcd5aeSmrg  ;;
3545d9dcd5aeSmrg
3546d9dcd5aeSmrggnu*)
3547d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3548d9dcd5aeSmrg  need_lib_prefix=no
3549d9dcd5aeSmrg  need_version=no
3550d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3551d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3552d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3553d9dcd5aeSmrg  shlibpath_overrides_runpath=no
3554d9dcd5aeSmrg  hardcode_into_libs=yes
3555d9dcd5aeSmrg  ;;
3556d9dcd5aeSmrg
3557d9dcd5aeSmrghaiku*)
3558d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3559d9dcd5aeSmrg  need_lib_prefix=no
3560d9dcd5aeSmrg  need_version=no
3561d9dcd5aeSmrg  dynamic_linker="$host_os runtime_loader"
3562d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3563d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3564d9dcd5aeSmrg  shlibpath_var=LIBRARY_PATH
3565d9dcd5aeSmrg  shlibpath_overrides_runpath=yes
3566d9dcd5aeSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3567d9dcd5aeSmrg  hardcode_into_libs=yes
3568d9dcd5aeSmrg  ;;
3569d9dcd5aeSmrg
3570d9dcd5aeSmrghpux9* | hpux10* | hpux11*)
3571d9dcd5aeSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
3572d9dcd5aeSmrg  # link against other versions.
3573d9dcd5aeSmrg  version_type=sunos
3574d9dcd5aeSmrg  need_lib_prefix=no
3575d9dcd5aeSmrg  need_version=no
3576d9dcd5aeSmrg  case $host_cpu in
3577d9dcd5aeSmrg  ia64*)
3578d9dcd5aeSmrg    shrext_cmds='.so'
3579d9dcd5aeSmrg    hardcode_into_libs=yes
3580d9dcd5aeSmrg    dynamic_linker="$host_os dld.so"
3581d9dcd5aeSmrg    shlibpath_var=LD_LIBRARY_PATH
3582d9dcd5aeSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3583d9dcd5aeSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3584d9dcd5aeSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3585d9dcd5aeSmrg    if test "X$HPUX_IA64_MODE" = X32; then
3586d9dcd5aeSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3587ba064abeSmrg    else
3588d9dcd5aeSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3589ba064abeSmrg    fi
3590d9dcd5aeSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3591d9dcd5aeSmrg    ;;
3592d9dcd5aeSmrg  hppa*64*)
3593d9dcd5aeSmrg    shrext_cmds='.sl'
3594d9dcd5aeSmrg    hardcode_into_libs=yes
3595d9dcd5aeSmrg    dynamic_linker="$host_os dld.sl"
3596d9dcd5aeSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3597d9dcd5aeSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3598d9dcd5aeSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3599d9dcd5aeSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3600d9dcd5aeSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3601d9dcd5aeSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3602ba064abeSmrg    ;;
3603ba064abeSmrg  *)
3604d9dcd5aeSmrg    shrext_cmds='.sl'
3605d9dcd5aeSmrg    dynamic_linker="$host_os dld.sl"
3606d9dcd5aeSmrg    shlibpath_var=SHLIB_PATH
3607d9dcd5aeSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3608d9dcd5aeSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3609d9dcd5aeSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3610ba064abeSmrg    ;;
3611ba064abeSmrg  esac
3612d9dcd5aeSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3613d9dcd5aeSmrg  postinstall_cmds='chmod 555 $lib'
3614d9dcd5aeSmrg  # or fails outright, so override atomically:
3615d9dcd5aeSmrg  install_override_mode=555
3616d9dcd5aeSmrg  ;;
3617ba064abeSmrg
3618d9dcd5aeSmrginterix[[3-9]]*)
3619d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3620d9dcd5aeSmrg  need_lib_prefix=no
3621d9dcd5aeSmrg  need_version=no
3622d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3623d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3624d9dcd5aeSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3625d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3626d9dcd5aeSmrg  shlibpath_overrides_runpath=no
3627d9dcd5aeSmrg  hardcode_into_libs=yes
3628d9dcd5aeSmrg  ;;
3629ba064abeSmrg
3630d9dcd5aeSmrgirix5* | irix6* | nonstopux*)
3631d9dcd5aeSmrg  case $host_os in
3632d9dcd5aeSmrg    nonstopux*) version_type=nonstopux ;;
3633d9dcd5aeSmrg    *)
3634d9dcd5aeSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
3635d9dcd5aeSmrg		version_type=linux # correct to gnu/linux during the next big refactor
3636d9dcd5aeSmrg	else
3637d9dcd5aeSmrg		version_type=irix
3638d9dcd5aeSmrg	fi ;;
3639d9dcd5aeSmrg  esac
3640d9dcd5aeSmrg  need_lib_prefix=no
3641d9dcd5aeSmrg  need_version=no
3642d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3643d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3644d9dcd5aeSmrg  case $host_os in
3645d9dcd5aeSmrg  irix5* | nonstopux*)
3646d9dcd5aeSmrg    libsuff= shlibsuff=
3647d9dcd5aeSmrg    ;;
3648d9dcd5aeSmrg  *)
3649d9dcd5aeSmrg    case $LD in # libtool.m4 will add one of these switches to LD
3650d9dcd5aeSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3651d9dcd5aeSmrg      libsuff= shlibsuff= libmagic=32-bit;;
3652d9dcd5aeSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3653d9dcd5aeSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
3654d9dcd5aeSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3655d9dcd5aeSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3656d9dcd5aeSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
3657d9dcd5aeSmrg    esac
3658d9dcd5aeSmrg    ;;
3659d9dcd5aeSmrg  esac
3660d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3661d9dcd5aeSmrg  shlibpath_overrides_runpath=no
3662d9dcd5aeSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3663d9dcd5aeSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3664d9dcd5aeSmrg  hardcode_into_libs=yes
3665d9dcd5aeSmrg  ;;
3666ba064abeSmrg
3667d9dcd5aeSmrg# No shared lib support for Linux oldld, aout, or coff.
3668d9dcd5aeSmrglinux*oldld* | linux*aout* | linux*coff*)
3669d9dcd5aeSmrg  dynamic_linker=no
3670d9dcd5aeSmrg  ;;
3671ba064abeSmrg
3672d9dcd5aeSmrg# This must be glibc/ELF.
3673d9dcd5aeSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
3674d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3675d9dcd5aeSmrg  need_lib_prefix=no
3676d9dcd5aeSmrg  need_version=no
3677d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3678d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3679d9dcd5aeSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3680d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3681d9dcd5aeSmrg  shlibpath_overrides_runpath=no
3682ba064abeSmrg
3683d9dcd5aeSmrg  # Some binutils ld are patched to set DT_RUNPATH
3684d9dcd5aeSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3685d9dcd5aeSmrg    [lt_cv_shlibpath_overrides_runpath=no
3686d9dcd5aeSmrg    save_LDFLAGS=$LDFLAGS
3687d9dcd5aeSmrg    save_libdir=$libdir
3688d9dcd5aeSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3689d9dcd5aeSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3690d9dcd5aeSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3691d9dcd5aeSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3692d9dcd5aeSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
3693d9dcd5aeSmrg    LDFLAGS=$save_LDFLAGS
3694d9dcd5aeSmrg    libdir=$save_libdir
3695d9dcd5aeSmrg    ])
3696d9dcd5aeSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3697ba064abeSmrg
3698d9dcd5aeSmrg  # This implies no fast_install, which is unacceptable.
3699d9dcd5aeSmrg  # Some rework will be needed to allow for fast_install
3700d9dcd5aeSmrg  # before this can be enabled.
3701d9dcd5aeSmrg  hardcode_into_libs=yes
3702ba064abeSmrg
3703d9dcd5aeSmrg  # Append ld.so.conf contents to the search path
3704d9dcd5aeSmrg  if test -f /etc/ld.so.conf; then
3705d9dcd5aeSmrg    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' ' '`
3706d9dcd5aeSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3707d9dcd5aeSmrg  fi
3708ba064abeSmrg
3709d9dcd5aeSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
3710d9dcd5aeSmrg  # powerpc, because MkLinux only supported shared libraries with the
3711d9dcd5aeSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
3712d9dcd5aeSmrg  # most powerpc-linux boxes support dynamic linking these days and
3713d9dcd5aeSmrg  # people can always --disable-shared, the test was removed, and we
3714d9dcd5aeSmrg  # assume the GNU/Linux dynamic linker is in use.
3715d9dcd5aeSmrg  dynamic_linker='GNU/Linux ld.so'
3716d9dcd5aeSmrg  ;;
3717ba064abeSmrg
3718d9dcd5aeSmrgnetbsd*)
3719d9dcd5aeSmrg  version_type=sunos
3720d9dcd5aeSmrg  need_lib_prefix=no
3721d9dcd5aeSmrg  need_version=no
3722d9dcd5aeSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3723d9dcd5aeSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3724d9dcd5aeSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3725d9dcd5aeSmrg    dynamic_linker='NetBSD (a.out) ld.so'
3726ba064abeSmrg  else
3727d9dcd5aeSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3728d9dcd5aeSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3729d9dcd5aeSmrg    dynamic_linker='NetBSD ld.elf_so'
3730b290cf36Smrg  fi
3731d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3732d9dcd5aeSmrg  shlibpath_overrides_runpath=yes
3733d9dcd5aeSmrg  hardcode_into_libs=yes
3734d9dcd5aeSmrg  ;;
3735191cded7Smrg
3736d9dcd5aeSmrgnewsos6)
3737d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3738d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3739d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3740d9dcd5aeSmrg  shlibpath_overrides_runpath=yes
3741d9dcd5aeSmrg  ;;
3742191cded7Smrg
3743d9dcd5aeSmrg*nto* | *qnx*)
3744d9dcd5aeSmrg  version_type=qnx
3745d9dcd5aeSmrg  need_lib_prefix=no
3746d9dcd5aeSmrg  need_version=no
3747d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3748d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3749d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3750d9dcd5aeSmrg  shlibpath_overrides_runpath=no
3751d9dcd5aeSmrg  hardcode_into_libs=yes
3752d9dcd5aeSmrg  dynamic_linker='ldqnx.so'
3753d9dcd5aeSmrg  ;;
3754191cded7Smrg
3755d9dcd5aeSmrgopenbsd*)
3756d9dcd5aeSmrg  version_type=sunos
3757d9dcd5aeSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
3758d9dcd5aeSmrg  need_lib_prefix=no
3759d9dcd5aeSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3760ba064abeSmrg  case $host_os in
3761d9dcd5aeSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3762d9dcd5aeSmrg    *)				need_version=no  ;;
3763ba064abeSmrg  esac
3764d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3765d9dcd5aeSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3766d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3767d9dcd5aeSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3768d9dcd5aeSmrg    case $host_os in
3769d9dcd5aeSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
3770d9dcd5aeSmrg	shlibpath_overrides_runpath=no
3771d9dcd5aeSmrg	;;
3772d9dcd5aeSmrg      *)
3773d9dcd5aeSmrg	shlibpath_overrides_runpath=yes
3774d9dcd5aeSmrg	;;
3775d9dcd5aeSmrg      esac
3776ba064abeSmrg  else
3777d9dcd5aeSmrg    shlibpath_overrides_runpath=yes
3778ba064abeSmrg  fi
3779d9dcd5aeSmrg  ;;
3780191cded7Smrg
3781d9dcd5aeSmrgos2*)
3782d9dcd5aeSmrg  libname_spec='$name'
3783d9dcd5aeSmrg  shrext_cmds=".dll"
3784d9dcd5aeSmrg  need_lib_prefix=no
3785d9dcd5aeSmrg  library_names_spec='$libname${shared_ext} $libname.a'
3786d9dcd5aeSmrg  dynamic_linker='OS/2 ld.exe'
3787d9dcd5aeSmrg  shlibpath_var=LIBPATH
3788d9dcd5aeSmrg  ;;
3789191cded7Smrg
3790d9dcd5aeSmrgosf3* | osf4* | osf5*)
3791d9dcd5aeSmrg  version_type=osf
3792d9dcd5aeSmrg  need_lib_prefix=no
3793d9dcd5aeSmrg  need_version=no
3794d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3795d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3796d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3797d9dcd5aeSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3798d9dcd5aeSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3799d9dcd5aeSmrg  ;;
3800191cded7Smrg
3801d9dcd5aeSmrgrdos*)
3802d9dcd5aeSmrg  dynamic_linker=no
3803d9dcd5aeSmrg  ;;
3804191cded7Smrg
3805d9dcd5aeSmrgsolaris*)
3806d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3807d9dcd5aeSmrg  need_lib_prefix=no
3808d9dcd5aeSmrg  need_version=no
3809d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3810d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3811d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3812d9dcd5aeSmrg  shlibpath_overrides_runpath=yes
3813d9dcd5aeSmrg  hardcode_into_libs=yes
3814d9dcd5aeSmrg  # ldd complains unless libraries are executable
3815d9dcd5aeSmrg  postinstall_cmds='chmod +x $lib'
3816d9dcd5aeSmrg  ;;
3817191cded7Smrg
3818d9dcd5aeSmrgsunos4*)
3819d9dcd5aeSmrg  version_type=sunos
3820d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3821d9dcd5aeSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3822d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3823d9dcd5aeSmrg  shlibpath_overrides_runpath=yes
3824d9dcd5aeSmrg  if test "$with_gnu_ld" = yes; then
3825d9dcd5aeSmrg    need_lib_prefix=no
3826d9dcd5aeSmrg  fi
3827d9dcd5aeSmrg  need_version=yes
3828d9dcd5aeSmrg  ;;
3829191cded7Smrg
3830d9dcd5aeSmrgsysv4 | sysv4.3*)
3831d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3832d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3833d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3834d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3835d9dcd5aeSmrg  case $host_vendor in
3836d9dcd5aeSmrg    sni)
3837d9dcd5aeSmrg      shlibpath_overrides_runpath=no
3838d9dcd5aeSmrg      need_lib_prefix=no
3839d9dcd5aeSmrg      runpath_var=LD_RUN_PATH
3840d9dcd5aeSmrg      ;;
3841d9dcd5aeSmrg    siemens)
3842d9dcd5aeSmrg      need_lib_prefix=no
3843d9dcd5aeSmrg      ;;
3844d9dcd5aeSmrg    motorola)
3845d9dcd5aeSmrg      need_lib_prefix=no
3846d9dcd5aeSmrg      need_version=no
3847d9dcd5aeSmrg      shlibpath_overrides_runpath=no
3848d9dcd5aeSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3849d9dcd5aeSmrg      ;;
3850ba064abeSmrg  esac
3851d9dcd5aeSmrg  ;;
3852191cded7Smrg
3853d9dcd5aeSmrgsysv4*MP*)
3854d9dcd5aeSmrg  if test -d /usr/nec ;then
3855d9dcd5aeSmrg    version_type=linux # correct to gnu/linux during the next big refactor
3856d9dcd5aeSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3857d9dcd5aeSmrg    soname_spec='$libname${shared_ext}.$major'
3858d9dcd5aeSmrg    shlibpath_var=LD_LIBRARY_PATH
3859d9dcd5aeSmrg  fi
3860d9dcd5aeSmrg  ;;
3861191cded7Smrg
3862d9dcd5aeSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3863d9dcd5aeSmrg  version_type=freebsd-elf
3864d9dcd5aeSmrg  need_lib_prefix=no
3865d9dcd5aeSmrg  need_version=no
3866d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3867d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3868d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3869d9dcd5aeSmrg  shlibpath_overrides_runpath=yes
3870d9dcd5aeSmrg  hardcode_into_libs=yes
3871d9dcd5aeSmrg  if test "$with_gnu_ld" = yes; then
3872d9dcd5aeSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3873d9dcd5aeSmrg  else
3874d9dcd5aeSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3875d9dcd5aeSmrg    case $host_os in
3876d9dcd5aeSmrg      sco3.2v5*)
3877d9dcd5aeSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3878d9dcd5aeSmrg	;;
3879d9dcd5aeSmrg    esac
3880d9dcd5aeSmrg  fi
3881d9dcd5aeSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
3882d9dcd5aeSmrg  ;;
3883191cded7Smrg
3884d9dcd5aeSmrgtpf*)
3885d9dcd5aeSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3886d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3887d9dcd5aeSmrg  need_lib_prefix=no
3888d9dcd5aeSmrg  need_version=no
3889d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3890d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3891d9dcd5aeSmrg  shlibpath_overrides_runpath=no
3892d9dcd5aeSmrg  hardcode_into_libs=yes
3893d9dcd5aeSmrg  ;;
3894191cded7Smrg
3895d9dcd5aeSmrguts4*)
3896d9dcd5aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3897d9dcd5aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3898d9dcd5aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3899d9dcd5aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3900d9dcd5aeSmrg  ;;
3901191cded7Smrg
3902d9dcd5aeSmrg*)
3903d9dcd5aeSmrg  dynamic_linker=no
3904d9dcd5aeSmrg  ;;
3905d9dcd5aeSmrgesac
3906d9dcd5aeSmrgAC_MSG_RESULT([$dynamic_linker])
3907d9dcd5aeSmrgtest "$dynamic_linker" = no && can_build_shared=no
3908191cded7Smrg
3909d9dcd5aeSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3910d9dcd5aeSmrgif test "$GCC" = yes; then
3911d9dcd5aeSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3912ba064abeSmrgfi
3913191cded7Smrg
3914d9dcd5aeSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3915d9dcd5aeSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3916ba064abeSmrgfi
3917d9dcd5aeSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3918d9dcd5aeSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3919b290cf36Smrgfi
3920191cded7Smrg
3921d9dcd5aeSmrg_LT_DECL([], [variables_saved_for_relink], [1],
3922d9dcd5aeSmrg    [Variables whose values should be saved in libtool wrapper scripts and
3923d9dcd5aeSmrg    restored at link time])
3924d9dcd5aeSmrg_LT_DECL([], [need_lib_prefix], [0],
3925d9dcd5aeSmrg    [Do we need the "lib" prefix for modules?])
3926d9dcd5aeSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3927d9dcd5aeSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
3928d9dcd5aeSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3929d9dcd5aeSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3930d9dcd5aeSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3931d9dcd5aeSmrg    [Is shlibpath searched before the hard-coded library search path?])
3932d9dcd5aeSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3933d9dcd5aeSmrg_LT_DECL([], [library_names_spec], [1],
3934d9dcd5aeSmrg    [[List of archive names.  First name is the real one, the rest are links.
3935d9dcd5aeSmrg    The last name is the one that the linker finds with -lNAME]])
3936d9dcd5aeSmrg_LT_DECL([], [soname_spec], [1],
3937d9dcd5aeSmrg    [[The coded name of the library, if different from the real name]])
3938d9dcd5aeSmrg_LT_DECL([], [install_override_mode], [1],
3939d9dcd5aeSmrg    [Permission mode override for installation of shared libraries])
3940d9dcd5aeSmrg_LT_DECL([], [postinstall_cmds], [2],
3941d9dcd5aeSmrg    [Command to use after installation of a shared archive])
3942d9dcd5aeSmrg_LT_DECL([], [postuninstall_cmds], [2],
3943d9dcd5aeSmrg    [Command to use after uninstallation of a shared archive])
3944d9dcd5aeSmrg_LT_DECL([], [finish_cmds], [2],
3945d9dcd5aeSmrg    [Commands used to finish a libtool library installation in a directory])
3946d9dcd5aeSmrg_LT_DECL([], [finish_eval], [1],
3947d9dcd5aeSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
3948d9dcd5aeSmrg    not shown]])
3949d9dcd5aeSmrg_LT_DECL([], [hardcode_into_libs], [0],
3950d9dcd5aeSmrg    [Whether we should hardcode library paths into libraries])
3951d9dcd5aeSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3952d9dcd5aeSmrg    [Compile-time system search path for libraries])
3953d9dcd5aeSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3954d9dcd5aeSmrg    [Run-time system search path for libraries])
3955d9dcd5aeSmrg])# _LT_SYS_DYNAMIC_LINKER
3956191cded7Smrg
3957191cded7Smrg
3958d9dcd5aeSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
3959d9dcd5aeSmrg# --------------------------
3960d9dcd5aeSmrg# find a file program which can recognize shared library
3961d9dcd5aeSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3962d9dcd5aeSmrg[m4_require([_LT_DECL_EGREP])dnl
3963d9dcd5aeSmrgAC_MSG_CHECKING([for $1])
3964d9dcd5aeSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3965d9dcd5aeSmrg[case $MAGIC_CMD in
3966d9dcd5aeSmrg[[\\/*] |  ?:[\\/]*])
3967d9dcd5aeSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3968d9dcd5aeSmrg  ;;
3969d9dcd5aeSmrg*)
3970d9dcd5aeSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
3971d9dcd5aeSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3972d9dcd5aeSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3973d9dcd5aeSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3974d9dcd5aeSmrgdnl not every word.  This closes a longstanding sh security hole.
3975d9dcd5aeSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3976d9dcd5aeSmrg  for ac_dir in $ac_dummy; do
3977d9dcd5aeSmrg    IFS="$lt_save_ifs"
3978d9dcd5aeSmrg    test -z "$ac_dir" && ac_dir=.
3979d9dcd5aeSmrg    if test -f $ac_dir/$1; then
3980d9dcd5aeSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3981d9dcd5aeSmrg      if test -n "$file_magic_test_file"; then
3982d9dcd5aeSmrg	case $deplibs_check_method in
3983d9dcd5aeSmrg	"file_magic "*)
3984d9dcd5aeSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3985d9dcd5aeSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3986d9dcd5aeSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3987d9dcd5aeSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
3988d9dcd5aeSmrg	    :
3989d9dcd5aeSmrg	  else
3990d9dcd5aeSmrg	    cat <<_LT_EOF 1>&2
3991d9dcd5aeSmrg
3992d9dcd5aeSmrg*** Warning: the command libtool uses to detect shared libraries,
3993d9dcd5aeSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3994d9dcd5aeSmrg*** The result is that libtool may fail to recognize shared libraries
3995d9dcd5aeSmrg*** as such.  This will affect the creation of libtool libraries that
3996d9dcd5aeSmrg*** depend on shared libraries, but programs linked with such libtool
3997d9dcd5aeSmrg*** libraries will work regardless of this problem.  Nevertheless, you
3998d9dcd5aeSmrg*** may want to report the problem to your system manager and/or to
3999d9dcd5aeSmrg*** bug-libtool@gnu.org
4000d9dcd5aeSmrg
4001d9dcd5aeSmrg_LT_EOF
4002d9dcd5aeSmrg	  fi ;;
4003d9dcd5aeSmrg	esac
4004d9dcd5aeSmrg      fi
4005d9dcd5aeSmrg      break
4006b290cf36Smrg    fi
4007d9dcd5aeSmrg  done
4008d9dcd5aeSmrg  IFS="$lt_save_ifs"
4009d9dcd5aeSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
4010d9dcd5aeSmrg  ;;
4011d9dcd5aeSmrgesac])
4012d9dcd5aeSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4013d9dcd5aeSmrgif test -n "$MAGIC_CMD"; then
4014d9dcd5aeSmrg  AC_MSG_RESULT($MAGIC_CMD)
4015d9dcd5aeSmrgelse
4016d9dcd5aeSmrg  AC_MSG_RESULT(no)
4017ba064abeSmrgfi
4018d9dcd5aeSmrg_LT_DECL([], [MAGIC_CMD], [0],
4019d9dcd5aeSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4020d9dcd5aeSmrg])# _LT_PATH_TOOL_PREFIX
4021191cded7Smrg
4022d9dcd5aeSmrg# Old name:
4023d9dcd5aeSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4024d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
4025d9dcd5aeSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4026191cded7Smrg
4027d9dcd5aeSmrg
4028d9dcd5aeSmrg# _LT_PATH_MAGIC
4029d9dcd5aeSmrg# --------------
4030d9dcd5aeSmrg# find a file program which can recognize a shared library
4031d9dcd5aeSmrgm4_defun([_LT_PATH_MAGIC],
4032d9dcd5aeSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4033d9dcd5aeSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
4034d9dcd5aeSmrg  if test -n "$ac_tool_prefix"; then
4035d9dcd5aeSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4036d9dcd5aeSmrg  else
4037d9dcd5aeSmrg    MAGIC_CMD=:
4038d9dcd5aeSmrg  fi
4039d9dcd5aeSmrgfi
4040d9dcd5aeSmrg])# _LT_PATH_MAGIC
4041d9dcd5aeSmrg
4042d9dcd5aeSmrg
4043d9dcd5aeSmrg# LT_PATH_LD
4044d9dcd5aeSmrg# ----------
4045d9dcd5aeSmrg# find the pathname to the GNU or non-GNU linker
4046d9dcd5aeSmrgAC_DEFUN([LT_PATH_LD],
4047d9dcd5aeSmrg[AC_REQUIRE([AC_PROG_CC])dnl
4048d9dcd5aeSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
4049d9dcd5aeSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
4050ba064abeSmrgm4_require([_LT_DECL_SED])dnl
4051d9dcd5aeSmrgm4_require([_LT_DECL_EGREP])dnl
4052d9dcd5aeSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4053d9dcd5aeSmrg
4054d9dcd5aeSmrgAC_ARG_WITH([gnu-ld],
4055d9dcd5aeSmrg    [AS_HELP_STRING([--with-gnu-ld],
4056d9dcd5aeSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4057d9dcd5aeSmrg    [test "$withval" = no || with_gnu_ld=yes],
4058d9dcd5aeSmrg    [with_gnu_ld=no])dnl
4059d9dcd5aeSmrg
4060d9dcd5aeSmrgac_prog=ld
4061ba064abeSmrgif test "$GCC" = yes; then
4062d9dcd5aeSmrg  # Check if gcc -print-prog-name=ld gives a path.
4063d9dcd5aeSmrg  AC_MSG_CHECKING([for ld used by $CC])
4064d9dcd5aeSmrg  case $host in
4065d9dcd5aeSmrg  *-*-mingw*)
4066d9dcd5aeSmrg    # gcc leaves a trailing carriage return which upsets mingw
4067d9dcd5aeSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4068d9dcd5aeSmrg  *)
4069d9dcd5aeSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4070ba064abeSmrg  esac
4071d9dcd5aeSmrg  case $ac_prog in
4072d9dcd5aeSmrg    # Accept absolute paths.
4073d9dcd5aeSmrg    [[\\/]]* | ?:[[\\/]]*)
4074d9dcd5aeSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
4075d9dcd5aeSmrg      # Canonicalize the pathname of ld
4076d9dcd5aeSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4077d9dcd5aeSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4078d9dcd5aeSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4079d9dcd5aeSmrg      done
4080d9dcd5aeSmrg      test -z "$LD" && LD="$ac_prog"
4081d9dcd5aeSmrg      ;;
4082d9dcd5aeSmrg  "")
4083d9dcd5aeSmrg    # If it fails, then pretend we aren't using GCC.
4084d9dcd5aeSmrg    ac_prog=ld
4085ba064abeSmrg    ;;
4086ba064abeSmrg  *)
4087d9dcd5aeSmrg    # If it is relative, then search for the first ld in PATH.
4088d9dcd5aeSmrg    with_gnu_ld=unknown
4089ba064abeSmrg    ;;
4090ba064abeSmrg  esac
4091d9dcd5aeSmrgelif test "$with_gnu_ld" = yes; then
4092d9dcd5aeSmrg  AC_MSG_CHECKING([for GNU ld])
4093d9dcd5aeSmrgelse
4094d9dcd5aeSmrg  AC_MSG_CHECKING([for non-GNU ld])
4095d9dcd5aeSmrgfi
4096d9dcd5aeSmrgAC_CACHE_VAL(lt_cv_path_LD,
4097d9dcd5aeSmrg[if test -z "$LD"; then
4098d9dcd5aeSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4099d9dcd5aeSmrg  for ac_dir in $PATH; do
4100d9dcd5aeSmrg    IFS="$lt_save_ifs"
4101d9dcd5aeSmrg    test -z "$ac_dir" && ac_dir=.
4102d9dcd5aeSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4103d9dcd5aeSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
4104d9dcd5aeSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
4105d9dcd5aeSmrg      # but apparently some variants of GNU ld only accept -v.
4106d9dcd5aeSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
4107d9dcd5aeSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4108d9dcd5aeSmrg      *GNU* | *'with BFD'*)
4109d9dcd5aeSmrg	test "$with_gnu_ld" != no && break
4110d9dcd5aeSmrg	;;
4111d9dcd5aeSmrg      *)
4112d9dcd5aeSmrg	test "$with_gnu_ld" != yes && break
4113d9dcd5aeSmrg	;;
4114d9dcd5aeSmrg      esac
4115b290cf36Smrg    fi
4116ba064abeSmrg  done
4117d9dcd5aeSmrg  IFS="$lt_save_ifs"
4118ba064abeSmrgelse
4119d9dcd5aeSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4120ba064abeSmrgfi])
4121d9dcd5aeSmrgLD="$lt_cv_path_LD"
4122d9dcd5aeSmrgif test -n "$LD"; then
4123d9dcd5aeSmrg  AC_MSG_RESULT($LD)
4124d9dcd5aeSmrgelse
4125d9dcd5aeSmrg  AC_MSG_RESULT(no)
4126d9dcd5aeSmrgfi
4127d9dcd5aeSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4128d9dcd5aeSmrg_LT_PATH_LD_GNU
4129d9dcd5aeSmrgAC_SUBST([LD])
4130191cded7Smrg
4131d9dcd5aeSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4132d9dcd5aeSmrg])# LT_PATH_LD
4133ba064abeSmrg
4134d9dcd5aeSmrg# Old names:
4135d9dcd5aeSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4136d9dcd5aeSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4137d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
4138d9dcd5aeSmrgdnl AC_DEFUN([AM_PROG_LD], [])
4139d9dcd5aeSmrgdnl AC_DEFUN([AC_PROG_LD], [])
4140ba064abeSmrg
4141d9dcd5aeSmrg
4142d9dcd5aeSmrg# _LT_PATH_LD_GNU
4143d9dcd5aeSmrg#- --------------
4144d9dcd5aeSmrgm4_defun([_LT_PATH_LD_GNU],
4145d9dcd5aeSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4146d9dcd5aeSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4147d9dcd5aeSmrgcase `$LD -v 2>&1 </dev/null` in
4148d9dcd5aeSmrg*GNU* | *'with BFD'*)
4149d9dcd5aeSmrg  lt_cv_prog_gnu_ld=yes
4150d9dcd5aeSmrg  ;;
4151d9dcd5aeSmrg*)
4152d9dcd5aeSmrg  lt_cv_prog_gnu_ld=no
4153ba064abeSmrg  ;;
4154d9dcd5aeSmrgesac])
4155d9dcd5aeSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
4156d9dcd5aeSmrg])# _LT_PATH_LD_GNU
4157191cded7Smrg
4158d9dcd5aeSmrg
4159d9dcd5aeSmrg# _LT_CMD_RELOAD
4160d9dcd5aeSmrg# --------------
4161d9dcd5aeSmrg# find reload flag for linker
4162d9dcd5aeSmrg#   -- PORTME Some linkers may need a different reload flag.
4163d9dcd5aeSmrgm4_defun([_LT_CMD_RELOAD],
4164d9dcd5aeSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
4165d9dcd5aeSmrg  lt_cv_ld_reload_flag,
4166d9dcd5aeSmrg  [lt_cv_ld_reload_flag='-r'])
4167d9dcd5aeSmrgreload_flag=$lt_cv_ld_reload_flag
4168d9dcd5aeSmrgcase $reload_flag in
4169d9dcd5aeSmrg"" | " "*) ;;
4170d9dcd5aeSmrg*) reload_flag=" $reload_flag" ;;
4171d9dcd5aeSmrgesac
4172d9dcd5aeSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
4173d9dcd5aeSmrgcase $host_os in
4174d9dcd5aeSmrg  cygwin* | mingw* | pw32* | cegcc*)
4175d9dcd5aeSmrg    if test "$GCC" != yes; then
4176d9dcd5aeSmrg      reload_cmds=false
4177d9dcd5aeSmrg    fi
4178ba064abeSmrg    ;;
4179d9dcd5aeSmrg  darwin*)
4180d9dcd5aeSmrg    if test "$GCC" = yes; then
4181d9dcd5aeSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4182d9dcd5aeSmrg    else
4183d9dcd5aeSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4184d9dcd5aeSmrg    fi
4185ba064abeSmrg    ;;
4186d9dcd5aeSmrgesac
4187d9dcd5aeSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4188d9dcd5aeSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
4189d9dcd5aeSmrg])# _LT_CMD_RELOAD
4190d9dcd5aeSmrg
4191d9dcd5aeSmrg
4192d9dcd5aeSmrg# _LT_CHECK_MAGIC_METHOD
4193d9dcd5aeSmrg# ----------------------
4194d9dcd5aeSmrg# how to check for library dependencies
4195d9dcd5aeSmrg#  -- PORTME fill in with the dynamic library characteristics
4196d9dcd5aeSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
4197d9dcd5aeSmrg[m4_require([_LT_DECL_EGREP])
4198d9dcd5aeSmrgm4_require([_LT_DECL_OBJDUMP])
4199d9dcd5aeSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
4200d9dcd5aeSmrglt_cv_deplibs_check_method,
4201d9dcd5aeSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
4202d9dcd5aeSmrglt_cv_file_magic_test_file=
4203d9dcd5aeSmrglt_cv_deplibs_check_method='unknown'
4204d9dcd5aeSmrg# Need to set the preceding variable on all platforms that support
4205d9dcd5aeSmrg# interlibrary dependencies.
4206d9dcd5aeSmrg# 'none' -- dependencies not supported.
4207d9dcd5aeSmrg# `unknown' -- same as none, but documents that we really don't know.
4208d9dcd5aeSmrg# 'pass_all' -- all dependencies passed with no checks.
4209d9dcd5aeSmrg# 'test_compile' -- check by making test program.
4210d9dcd5aeSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
4211d9dcd5aeSmrg# which responds to the $file_magic_cmd with a given extended regex.
4212d9dcd5aeSmrg# If you have `file' or equivalent on your system and you're not sure
4213d9dcd5aeSmrg# whether `pass_all' will *always* work, you probably want this one.
4214d9dcd5aeSmrg
4215d9dcd5aeSmrgcase $host_os in
4216d9dcd5aeSmrgaix[[4-9]]*)
4217d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4218ba064abeSmrg  ;;
4219191cded7Smrg
4220ba064abeSmrgbeos*)
4221d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4222ba064abeSmrg  ;;
4223191cded7Smrg
4224ba064abeSmrgbsdi[[45]]*)
4225d9dcd5aeSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4226d9dcd5aeSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
4227d9dcd5aeSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
4228ba064abeSmrg  ;;
4229ba064abeSmrg
4230d9dcd5aeSmrgcygwin*)
4231d9dcd5aeSmrg  # func_win32_libid is a shell function defined in ltmain.sh
4232d9dcd5aeSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4233d9dcd5aeSmrg  lt_cv_file_magic_cmd='func_win32_libid'
4234ba064abeSmrg  ;;
4235191cded7Smrg
4236d9dcd5aeSmrgmingw* | pw32*)
4237d9dcd5aeSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
4238d9dcd5aeSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4239d9dcd5aeSmrg  # unless we find 'file', for example because we are cross-compiling.
4240d9dcd5aeSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4241d9dcd5aeSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4242d9dcd5aeSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4243d9dcd5aeSmrg    lt_cv_file_magic_cmd='func_win32_libid'
4244d9dcd5aeSmrg  else
4245d9dcd5aeSmrg    # Keep this pattern in sync with the one in func_win32_libid.
4246d9dcd5aeSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4247d9dcd5aeSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
4248d9dcd5aeSmrg  fi
4249ba064abeSmrg  ;;
4250191cded7Smrg
4251d9dcd5aeSmrgcegcc*)
4252d9dcd5aeSmrg  # use the weaker test based on 'objdump'. See mingw*.
4253d9dcd5aeSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4254d9dcd5aeSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
4255ba064abeSmrg  ;;
4256ba064abeSmrg
4257d9dcd5aeSmrgdarwin* | rhapsody*)
4258d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4259ba064abeSmrg  ;;
4260ba064abeSmrg
4261ba064abeSmrgfreebsd* | dragonfly*)
4262d9dcd5aeSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4263d9dcd5aeSmrg    case $host_cpu in
4264d9dcd5aeSmrg    i*86 )
4265d9dcd5aeSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
4266d9dcd5aeSmrg      # Let's accept both of them until this is cleared up.
4267d9dcd5aeSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4268d9dcd5aeSmrg      lt_cv_file_magic_cmd=/usr/bin/file
4269d9dcd5aeSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4270ba064abeSmrg      ;;
4271d9dcd5aeSmrg    esac
4272d9dcd5aeSmrg  else
4273d9dcd5aeSmrg    lt_cv_deplibs_check_method=pass_all
4274d9dcd5aeSmrg  fi
4275ba064abeSmrg  ;;
4276ba064abeSmrg
4277ba064abeSmrggnu*)
4278d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4279ba064abeSmrg  ;;
4280191cded7Smrg
4281ba064abeSmrghaiku*)
4282d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4283ba064abeSmrg  ;;
4284ba064abeSmrg
4285d9dcd5aeSmrghpux10.20* | hpux11*)
4286d9dcd5aeSmrg  lt_cv_file_magic_cmd=/usr/bin/file
4287ba064abeSmrg  case $host_cpu in
4288ba064abeSmrg  ia64*)
4289d9dcd5aeSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4290d9dcd5aeSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4291ba064abeSmrg    ;;
4292ba064abeSmrg  hppa*64*)
4293d9dcd5aeSmrg    [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]']
4294d9dcd5aeSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4295ba064abeSmrg    ;;
4296ba064abeSmrg  *)
4297d9dcd5aeSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4298d9dcd5aeSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4299ba064abeSmrg    ;;
4300ba064abeSmrg  esac
4301ba064abeSmrg  ;;
4302ba064abeSmrg
4303ba064abeSmrginterix[[3-9]]*)
4304d9dcd5aeSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4305d9dcd5aeSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4306ba064abeSmrg  ;;
4307191cded7Smrg
4308ba064abeSmrgirix5* | irix6* | nonstopux*)
4309d9dcd5aeSmrg  case $LD in
4310d9dcd5aeSmrg  *-32|*"-32 ") libmagic=32-bit;;
4311d9dcd5aeSmrg  *-n32|*"-n32 ") libmagic=N32;;
4312d9dcd5aeSmrg  *-64|*"-64 ") libmagic=64-bit;;
4313d9dcd5aeSmrg  *) libmagic=never-match;;
4314ba064abeSmrg  esac
4315d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4316ba064abeSmrg  ;;
4317191cded7Smrg
4318d9dcd5aeSmrg# This must be glibc/ELF.
4319ba064abeSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
4320d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4321ba064abeSmrg  ;;
4322191cded7Smrg
4323ba064abeSmrgnetbsd*)
4324d9dcd5aeSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4325d9dcd5aeSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4326ba064abeSmrg  else
4327d9dcd5aeSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4328ba064abeSmrg  fi
4329ba064abeSmrg  ;;
4330191cded7Smrg
4331d9dcd5aeSmrgnewos6*)
4332d9dcd5aeSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4333d9dcd5aeSmrg  lt_cv_file_magic_cmd=/usr/bin/file
4334d9dcd5aeSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4335ba064abeSmrg  ;;
4336191cded7Smrg
4337ba064abeSmrg*nto* | *qnx*)
4338d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4339ba064abeSmrg  ;;
4340ba064abeSmrg
4341ba064abeSmrgopenbsd*)
4342ba064abeSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4343d9dcd5aeSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4344ba064abeSmrg  else
4345d9dcd5aeSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4346ba064abeSmrg  fi
4347ba064abeSmrg  ;;
4348191cded7Smrg
4349ba064abeSmrgosf3* | osf4* | osf5*)
4350d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4351ba064abeSmrg  ;;
4352191cded7Smrg
4353ba064abeSmrgrdos*)
4354d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4355ba064abeSmrg  ;;
4356191cded7Smrg
4357ba064abeSmrgsolaris*)
4358d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4359ba064abeSmrg  ;;
4360191cded7Smrg
4361d9dcd5aeSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4362d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4363ba064abeSmrg  ;;
4364191cded7Smrg
4365ba064abeSmrgsysv4 | sysv4.3*)
4366ba064abeSmrg  case $host_vendor in
4367d9dcd5aeSmrg  motorola)
4368d9dcd5aeSmrg    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]]'
4369d9dcd5aeSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4370d9dcd5aeSmrg    ;;
4371d9dcd5aeSmrg  ncr)
4372d9dcd5aeSmrg    lt_cv_deplibs_check_method=pass_all
4373d9dcd5aeSmrg    ;;
4374d9dcd5aeSmrg  sequent)
4375d9dcd5aeSmrg    lt_cv_file_magic_cmd='/bin/file'
4376d9dcd5aeSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4377d9dcd5aeSmrg    ;;
4378d9dcd5aeSmrg  sni)
4379d9dcd5aeSmrg    lt_cv_file_magic_cmd='/bin/file'
4380d9dcd5aeSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4381d9dcd5aeSmrg    lt_cv_file_magic_test_file=/lib/libc.so
4382d9dcd5aeSmrg    ;;
4383d9dcd5aeSmrg  siemens)
4384d9dcd5aeSmrg    lt_cv_deplibs_check_method=pass_all
4385d9dcd5aeSmrg    ;;
4386d9dcd5aeSmrg  pc)
4387d9dcd5aeSmrg    lt_cv_deplibs_check_method=pass_all
4388d9dcd5aeSmrg    ;;
4389ba064abeSmrg  esac
4390ba064abeSmrg  ;;
4391191cded7Smrg
4392d9dcd5aeSmrgtpf*)
4393d9dcd5aeSmrg  lt_cv_deplibs_check_method=pass_all
4394ba064abeSmrg  ;;
4395d9dcd5aeSmrgesac
4396d9dcd5aeSmrg])
4397191cded7Smrg
4398d9dcd5aeSmrgfile_magic_glob=
4399d9dcd5aeSmrgwant_nocaseglob=no
4400d9dcd5aeSmrgif test "$build" = "$host"; then
4401d9dcd5aeSmrg  case $host_os in
4402d9dcd5aeSmrg  mingw* | pw32*)
4403d9dcd5aeSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4404d9dcd5aeSmrg      want_nocaseglob=yes
4405d9dcd5aeSmrg    else
4406d9dcd5aeSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4407d9dcd5aeSmrg    fi
4408d9dcd5aeSmrg    ;;
4409d9dcd5aeSmrg  esac
4410d9dcd5aeSmrgfi
4411d9dcd5aeSmrg
4412d9dcd5aeSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
4413d9dcd5aeSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
4414d9dcd5aeSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
4415d9dcd5aeSmrg
4416d9dcd5aeSmrg_LT_DECL([], [deplibs_check_method], [1],
4417d9dcd5aeSmrg    [Method to check whether dependent libraries are shared objects])
4418d9dcd5aeSmrg_LT_DECL([], [file_magic_cmd], [1],
4419d9dcd5aeSmrg    [Command to use when deplibs_check_method = "file_magic"])
4420d9dcd5aeSmrg_LT_DECL([], [file_magic_glob], [1],
4421d9dcd5aeSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
4422d9dcd5aeSmrg_LT_DECL([], [want_nocaseglob], [1],
4423d9dcd5aeSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4424d9dcd5aeSmrg])# _LT_CHECK_MAGIC_METHOD
4425d9dcd5aeSmrg
4426d9dcd5aeSmrg
4427d9dcd5aeSmrg# LT_PATH_NM
4428d9dcd5aeSmrg# ----------
4429d9dcd5aeSmrg# find the pathname to a BSD- or MS-compatible name lister
4430d9dcd5aeSmrgAC_DEFUN([LT_PATH_NM],
4431d9dcd5aeSmrg[AC_REQUIRE([AC_PROG_CC])dnl
4432d9dcd5aeSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4433d9dcd5aeSmrg[if test -n "$NM"; then
4434d9dcd5aeSmrg  # Let the user override the test.
4435d9dcd5aeSmrg  lt_cv_path_NM="$NM"
4436d9dcd5aeSmrgelse
4437d9dcd5aeSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
4438d9dcd5aeSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4439d9dcd5aeSmrg    lt_nm_to_check="$lt_nm_to_check nm"
4440d9dcd5aeSmrg  fi
4441d9dcd5aeSmrg  for lt_tmp_nm in $lt_nm_to_check; do
4442d9dcd5aeSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4443d9dcd5aeSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4444d9dcd5aeSmrg      IFS="$lt_save_ifs"
4445d9dcd5aeSmrg      test -z "$ac_dir" && ac_dir=.
4446d9dcd5aeSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
4447d9dcd5aeSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4448d9dcd5aeSmrg	# Check to see if the nm accepts a BSD-compat flag.
4449d9dcd5aeSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4450d9dcd5aeSmrg	#   nm: unknown option "B" ignored
4451d9dcd5aeSmrg	# Tru64's nm complains that /dev/null is an invalid object file
4452d9dcd5aeSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4453d9dcd5aeSmrg	*/dev/null* | *'Invalid file or object type'*)
4454d9dcd5aeSmrg	  lt_cv_path_NM="$tmp_nm -B"
4455d9dcd5aeSmrg	  break
4456d9dcd5aeSmrg	  ;;
4457d9dcd5aeSmrg	*)
4458d9dcd5aeSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4459d9dcd5aeSmrg	  */dev/null*)
4460d9dcd5aeSmrg	    lt_cv_path_NM="$tmp_nm -p"
4461d9dcd5aeSmrg	    break
4462d9dcd5aeSmrg	    ;;
4463d9dcd5aeSmrg	  *)
4464d9dcd5aeSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4465d9dcd5aeSmrg	    continue # so that we can try to find one that supports BSD flags
4466d9dcd5aeSmrg	    ;;
4467d9dcd5aeSmrg	  esac
4468d9dcd5aeSmrg	  ;;
4469d9dcd5aeSmrg	esac
4470d9dcd5aeSmrg      fi
4471d9dcd5aeSmrg    done
4472d9dcd5aeSmrg    IFS="$lt_save_ifs"
4473d9dcd5aeSmrg  done
4474d9dcd5aeSmrg  : ${lt_cv_path_NM=no}
4475d9dcd5aeSmrgfi])
4476d9dcd5aeSmrgif test "$lt_cv_path_NM" != "no"; then
4477d9dcd5aeSmrg  NM="$lt_cv_path_NM"
4478d9dcd5aeSmrgelse
4479d9dcd5aeSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
4480d9dcd5aeSmrg  if test -n "$DUMPBIN"; then :
4481d9dcd5aeSmrg    # Let the user override the test.
4482ba064abeSmrg  else
4483d9dcd5aeSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4484d9dcd5aeSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4485d9dcd5aeSmrg    *COFF*)
4486d9dcd5aeSmrg      DUMPBIN="$DUMPBIN -symbols"
4487d9dcd5aeSmrg      ;;
4488d9dcd5aeSmrg    *)
4489d9dcd5aeSmrg      DUMPBIN=:
4490d9dcd5aeSmrg      ;;
4491ba064abeSmrg    esac
4492ba064abeSmrg  fi
4493d9dcd5aeSmrg  AC_SUBST([DUMPBIN])
4494d9dcd5aeSmrg  if test "$DUMPBIN" != ":"; then
4495d9dcd5aeSmrg    NM="$DUMPBIN"
4496d9dcd5aeSmrg  fi
4497d9dcd5aeSmrgfi
4498d9dcd5aeSmrgtest -z "$NM" && NM=nm
4499d9dcd5aeSmrgAC_SUBST([NM])
4500d9dcd5aeSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4501191cded7Smrg
4502d9dcd5aeSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4503d9dcd5aeSmrg  [lt_cv_nm_interface="BSD nm"
4504d9dcd5aeSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
4505d9dcd5aeSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4506d9dcd5aeSmrg  (eval "$ac_compile" 2>conftest.err)
4507d9dcd5aeSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
4508d9dcd5aeSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4509d9dcd5aeSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4510d9dcd5aeSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
4511d9dcd5aeSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4512d9dcd5aeSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
4513d9dcd5aeSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4514d9dcd5aeSmrg    lt_cv_nm_interface="MS dumpbin"
4515d9dcd5aeSmrg  fi
4516d9dcd5aeSmrg  rm -f conftest*])
4517d9dcd5aeSmrg])# LT_PATH_NM
4518191cded7Smrg
4519d9dcd5aeSmrg# Old names:
4520d9dcd5aeSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4521d9dcd5aeSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4522d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
4523d9dcd5aeSmrgdnl AC_DEFUN([AM_PROG_NM], [])
4524d9dcd5aeSmrgdnl AC_DEFUN([AC_PROG_NM], [])
4525d9dcd5aeSmrg
4526d9dcd5aeSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4527d9dcd5aeSmrg# --------------------------------
4528d9dcd5aeSmrg# how to determine the name of the shared library
4529d9dcd5aeSmrg# associated with a specific link library.
4530d9dcd5aeSmrg#  -- PORTME fill in with the dynamic library characteristics
4531d9dcd5aeSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4532d9dcd5aeSmrg[m4_require([_LT_DECL_EGREP])
4533d9dcd5aeSmrgm4_require([_LT_DECL_OBJDUMP])
4534d9dcd5aeSmrgm4_require([_LT_DECL_DLLTOOL])
4535d9dcd5aeSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
4536d9dcd5aeSmrglt_cv_sharedlib_from_linklib_cmd,
4537d9dcd5aeSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
4538191cded7Smrg
4539d9dcd5aeSmrgcase $host_os in
4540d9dcd5aeSmrgcygwin* | mingw* | pw32* | cegcc*)
4541d9dcd5aeSmrg  # two different shell functions defined in ltmain.sh
4542d9dcd5aeSmrg  # decide which to use based on capabilities of $DLLTOOL
4543d9dcd5aeSmrg  case `$DLLTOOL --help 2>&1` in
4544d9dcd5aeSmrg  *--identify-strict*)
4545d9dcd5aeSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4546d9dcd5aeSmrg    ;;
4547d9dcd5aeSmrg  *)
4548d9dcd5aeSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4549d9dcd5aeSmrg    ;;
4550d9dcd5aeSmrg  esac
4551d9dcd5aeSmrg  ;;
4552ba064abeSmrg*)
4553d9dcd5aeSmrg  # fallback: assume linklib IS sharedlib
4554d9dcd5aeSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4555ba064abeSmrg  ;;
4556ba064abeSmrgesac
4557d9dcd5aeSmrg])
4558d9dcd5aeSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4559d9dcd5aeSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4560191cded7Smrg
4561d9dcd5aeSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4562d9dcd5aeSmrg    [Command to associate shared and link libraries])
4563d9dcd5aeSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4564191cded7Smrg
4565191cded7Smrg
4566d9dcd5aeSmrg# _LT_PATH_MANIFEST_TOOL
4567d9dcd5aeSmrg# ----------------------
4568d9dcd5aeSmrg# locate the manifest tool
4569d9dcd5aeSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
4570d9dcd5aeSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4571d9dcd5aeSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4572d9dcd5aeSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4573d9dcd5aeSmrg  [lt_cv_path_mainfest_tool=no
4574d9dcd5aeSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4575d9dcd5aeSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4576d9dcd5aeSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
4577d9dcd5aeSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4578d9dcd5aeSmrg    lt_cv_path_mainfest_tool=yes
4579d9dcd5aeSmrg  fi
4580d9dcd5aeSmrg  rm -f conftest*])
4581d9dcd5aeSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
4582d9dcd5aeSmrg  MANIFEST_TOOL=:
4583d9dcd5aeSmrgfi
4584d9dcd5aeSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4585d9dcd5aeSmrg])# _LT_PATH_MANIFEST_TOOL
4586191cded7Smrg
4587191cded7Smrg
4588d9dcd5aeSmrg# LT_LIB_M
4589d9dcd5aeSmrg# --------
4590d9dcd5aeSmrg# check for math library
4591d9dcd5aeSmrgAC_DEFUN([LT_LIB_M],
4592d9dcd5aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4593d9dcd5aeSmrgLIBM=
4594d9dcd5aeSmrgcase $host in
4595d9dcd5aeSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4596d9dcd5aeSmrg  # These system don't have libm, or don't need it
4597d9dcd5aeSmrg  ;;
4598d9dcd5aeSmrg*-ncr-sysv4.3*)
4599d9dcd5aeSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4600d9dcd5aeSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4601ba064abeSmrg  ;;
4602ba064abeSmrg*)
4603d9dcd5aeSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
4604ba064abeSmrg  ;;
4605d9dcd5aeSmrgesac
4606d9dcd5aeSmrgAC_SUBST([LIBM])
4607d9dcd5aeSmrg])# LT_LIB_M
4608ba064abeSmrg
4609ba064abeSmrg# Old name:
4610d9dcd5aeSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4611ba064abeSmrgdnl aclocal-1.4 backwards compatibility:
4612d9dcd5aeSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
4613191cded7Smrg
4614191cded7Smrg
4615d9dcd5aeSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
4616d9dcd5aeSmrg# -------------------------------
4617d9dcd5aeSmrgm4_defun([_LT_COMPILER_NO_RTTI],
4618d9dcd5aeSmrg[m4_require([_LT_TAG_COMPILER])dnl
4619191cded7Smrg
4620d9dcd5aeSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4621191cded7Smrg
4622ba064abeSmrgif test "$GCC" = yes; then
4623d9dcd5aeSmrg  case $cc_basename in
4624d9dcd5aeSmrg  nvcc*)
4625d9dcd5aeSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4626ba064abeSmrg  *)
4627d9dcd5aeSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4628ba064abeSmrg  esac
4629191cded7Smrg
4630d9dcd5aeSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4631d9dcd5aeSmrg    lt_cv_prog_compiler_rtti_exceptions,
4632d9dcd5aeSmrg    [-fno-rtti -fno-exceptions], [],
4633d9dcd5aeSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4634d9dcd5aeSmrgfi
4635d9dcd5aeSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4636d9dcd5aeSmrg	[Compiler flag to turn off builtin functions])
4637d9dcd5aeSmrg])# _LT_COMPILER_NO_RTTI
4638191cded7Smrg
4639ba064abeSmrg
4640d9dcd5aeSmrg# _LT_CMD_GLOBAL_SYMBOLS
4641d9dcd5aeSmrg# ----------------------
4642d9dcd5aeSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4643d9dcd5aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4644d9dcd5aeSmrgAC_REQUIRE([AC_PROG_CC])dnl
4645d9dcd5aeSmrgAC_REQUIRE([AC_PROG_AWK])dnl
4646d9dcd5aeSmrgAC_REQUIRE([LT_PATH_NM])dnl
4647d9dcd5aeSmrgAC_REQUIRE([LT_PATH_LD])dnl
4648d9dcd5aeSmrgm4_require([_LT_DECL_SED])dnl
4649d9dcd5aeSmrgm4_require([_LT_DECL_EGREP])dnl
4650d9dcd5aeSmrgm4_require([_LT_TAG_COMPILER])dnl
4651ba064abeSmrg
4652d9dcd5aeSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
4653d9dcd5aeSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4654d9dcd5aeSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4655d9dcd5aeSmrg[
4656d9dcd5aeSmrg# These are sane defaults that work on at least a few old systems.
4657d9dcd5aeSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4658191cded7Smrg
4659d9dcd5aeSmrg# Character class describing NM global symbol codes.
4660d9dcd5aeSmrgsymcode='[[BCDEGRST]]'
4661191cded7Smrg
4662d9dcd5aeSmrg# Regexp to match symbols that can be accessed directly from C.
4663d9dcd5aeSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4664191cded7Smrg
4665d9dcd5aeSmrg# Define system-specific variables.
4666ba064abeSmrgcase $host_os in
4667d9dcd5aeSmrgaix*)
4668d9dcd5aeSmrg  symcode='[[BCDT]]'
4669ba064abeSmrg  ;;
4670d9dcd5aeSmrgcygwin* | mingw* | pw32* | cegcc*)
4671d9dcd5aeSmrg  symcode='[[ABCDGISTW]]'
4672ba064abeSmrg  ;;
4673d9dcd5aeSmrghpux*)
4674d9dcd5aeSmrg  if test "$host_cpu" = ia64; then
4675d9dcd5aeSmrg    symcode='[[ABCDEGRST]]'
4676191cded7Smrg  fi
4677ba064abeSmrg  ;;
4678d9dcd5aeSmrgirix* | nonstopux*)
4679d9dcd5aeSmrg  symcode='[[BCDEGRST]]'
4680ba064abeSmrg  ;;
4681d9dcd5aeSmrgosf*)
4682d9dcd5aeSmrg  symcode='[[BCDEGQRST]]'
4683ba064abeSmrg  ;;
4684d9dcd5aeSmrgsolaris*)
4685d9dcd5aeSmrg  symcode='[[BDRT]]'
4686191cded7Smrg  ;;
4687d9dcd5aeSmrgsco3.2v5*)
4688d9dcd5aeSmrg  symcode='[[DT]]'
4689ba064abeSmrg  ;;
4690d9dcd5aeSmrgsysv4.2uw2*)
4691d9dcd5aeSmrg  symcode='[[DT]]'
4692ba064abeSmrg  ;;
4693d9dcd5aeSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
4694d9dcd5aeSmrg  symcode='[[ABDT]]'
4695ba064abeSmrg  ;;
4696d9dcd5aeSmrgsysv4)
4697d9dcd5aeSmrg  symcode='[[DFNSTU]]'
4698ba064abeSmrg  ;;
4699d9dcd5aeSmrgesac
4700191cded7Smrg
4701d9dcd5aeSmrg# If we're using GNU nm, then use its standard symbol codes.
4702d9dcd5aeSmrgcase `$NM -V 2>&1` in
4703d9dcd5aeSmrg*GNU* | *'with BFD'*)
4704d9dcd5aeSmrg  symcode='[[ABCDGIRSTW]]' ;;
4705d9dcd5aeSmrgesac
4706191cded7Smrg
4707d9dcd5aeSmrg# Transform an extracted symbol line into a proper C declaration.
4708d9dcd5aeSmrg# Some systems (esp. on ia64) link data and code symbols differently,
4709d9dcd5aeSmrg# so use this general approach.
4710d9dcd5aeSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4711191cded7Smrg
4712d9dcd5aeSmrg# Transform an extracted symbol line into symbol name and symbol address
4713d9dcd5aeSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4714d9dcd5aeSmrglt_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'"
4715191cded7Smrg
4716d9dcd5aeSmrg# Handle CRLF in mingw tool chain
4717d9dcd5aeSmrgopt_cr=
4718d9dcd5aeSmrgcase $build_os in
4719d9dcd5aeSmrgmingw*)
4720d9dcd5aeSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4721ba064abeSmrg  ;;
4722d9dcd5aeSmrgesac
4723191cded7Smrg
4724d9dcd5aeSmrg# Try without a prefix underscore, then with it.
4725d9dcd5aeSmrgfor ac_symprfx in "" "_"; do
4726191cded7Smrg
4727d9dcd5aeSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4728d9dcd5aeSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4729d9dcd5aeSmrg
4730d9dcd5aeSmrg  # Write the raw and C identifiers.
4731d9dcd5aeSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4732d9dcd5aeSmrg    # Fake it for dumpbin and say T for any non-static function
4733d9dcd5aeSmrg    # and D for any global variable.
4734d9dcd5aeSmrg    # Also find C++ and __fastcall symbols from MSVC++,
4735d9dcd5aeSmrg    # which start with @ or ?.
4736d9dcd5aeSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4737d9dcd5aeSmrg"     {last_section=section; section=\$ 3};"\
4738d9dcd5aeSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4739d9dcd5aeSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4740d9dcd5aeSmrg"     \$ 0!~/External *\|/{next};"\
4741d9dcd5aeSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4742d9dcd5aeSmrg"     {if(hide[section]) next};"\
4743d9dcd5aeSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4744d9dcd5aeSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4745d9dcd5aeSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4746d9dcd5aeSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4747d9dcd5aeSmrg"     ' prfx=^$ac_symprfx]"
4748ba064abeSmrg  else
4749d9dcd5aeSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4750ba064abeSmrg  fi
4751d9dcd5aeSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4752b290cf36Smrg
4753d9dcd5aeSmrg  # Check to see that the pipe works correctly.
4754d9dcd5aeSmrg  pipe_works=no
4755b290cf36Smrg
4756d9dcd5aeSmrg  rm -f conftest*
4757d9dcd5aeSmrg  cat > conftest.$ac_ext <<_LT_EOF
4758d9dcd5aeSmrg#ifdef __cplusplus
4759d9dcd5aeSmrgextern "C" {
4760d9dcd5aeSmrg#endif
4761d9dcd5aeSmrgchar nm_test_var;
4762d9dcd5aeSmrgvoid nm_test_func(void);
4763d9dcd5aeSmrgvoid nm_test_func(void){}
4764d9dcd5aeSmrg#ifdef __cplusplus
4765d9dcd5aeSmrg}
4766d9dcd5aeSmrg#endif
4767d9dcd5aeSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
4768d9dcd5aeSmrg_LT_EOF
4769191cded7Smrg
4770d9dcd5aeSmrg  if AC_TRY_EVAL(ac_compile); then
4771d9dcd5aeSmrg    # Now try to grab the symbols.
4772d9dcd5aeSmrg    nlist=conftest.nm
4773d9dcd5aeSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4774d9dcd5aeSmrg      # Try sorting and uniquifying the output.
4775d9dcd5aeSmrg      if sort "$nlist" | uniq > "$nlist"T; then
4776d9dcd5aeSmrg	mv -f "$nlist"T "$nlist"
4777d9dcd5aeSmrg      else
4778d9dcd5aeSmrg	rm -f "$nlist"T
4779d9dcd5aeSmrg      fi
4780ba064abeSmrg
4781d9dcd5aeSmrg      # Make sure that we snagged all the symbols we need.
4782d9dcd5aeSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4783d9dcd5aeSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4784d9dcd5aeSmrg	  cat <<_LT_EOF > conftest.$ac_ext
4785d9dcd5aeSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4786d9dcd5aeSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4787d9dcd5aeSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
4788d9dcd5aeSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4789d9dcd5aeSmrg# define LT@&t@_DLSYM_CONST
4790d9dcd5aeSmrg#elif defined(__osf__)
4791d9dcd5aeSmrg/* This system does not cope well with relocations in const data.  */
4792d9dcd5aeSmrg# define LT@&t@_DLSYM_CONST
4793d9dcd5aeSmrg#else
4794d9dcd5aeSmrg# define LT@&t@_DLSYM_CONST const
4795d9dcd5aeSmrg#endif
4796191cded7Smrg
4797d9dcd5aeSmrg#ifdef __cplusplus
4798d9dcd5aeSmrgextern "C" {
4799d9dcd5aeSmrg#endif
4800191cded7Smrg
4801d9dcd5aeSmrg_LT_EOF
4802d9dcd5aeSmrg	  # Now generate the symbol file.
4803d9dcd5aeSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4804191cded7Smrg
4805d9dcd5aeSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4806191cded7Smrg
4807d9dcd5aeSmrg/* The mapping between symbol names and symbols.  */
4808d9dcd5aeSmrgLT@&t@_DLSYM_CONST struct {
4809d9dcd5aeSmrg  const char *name;
4810d9dcd5aeSmrg  void       *address;
4811d9dcd5aeSmrg}
4812d9dcd5aeSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4813d9dcd5aeSmrg{
4814d9dcd5aeSmrg  { "@PROGRAM@", (void *) 0 },
4815d9dcd5aeSmrg_LT_EOF
4816d9dcd5aeSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4817d9dcd5aeSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4818d9dcd5aeSmrg  {0, (void *) 0}
4819d9dcd5aeSmrg};
4820d9dcd5aeSmrg
4821d9dcd5aeSmrg/* This works around a problem in FreeBSD linker */
4822d9dcd5aeSmrg#ifdef FREEBSD_WORKAROUND
4823d9dcd5aeSmrgstatic const void *lt_preloaded_setup() {
4824d9dcd5aeSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4825d9dcd5aeSmrg}
4826d9dcd5aeSmrg#endif
4827d9dcd5aeSmrg
4828d9dcd5aeSmrg#ifdef __cplusplus
4829d9dcd5aeSmrg}
4830d9dcd5aeSmrg#endif
4831d9dcd5aeSmrg_LT_EOF
4832d9dcd5aeSmrg	  # Now try linking the two files.
4833d9dcd5aeSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
4834d9dcd5aeSmrg	  lt_globsym_save_LIBS=$LIBS
4835d9dcd5aeSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
4836d9dcd5aeSmrg	  LIBS="conftstm.$ac_objext"
4837d9dcd5aeSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4838d9dcd5aeSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4839d9dcd5aeSmrg	    pipe_works=yes
4840d9dcd5aeSmrg	  fi
4841d9dcd5aeSmrg	  LIBS=$lt_globsym_save_LIBS
4842d9dcd5aeSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
4843d9dcd5aeSmrg	else
4844d9dcd5aeSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4845d9dcd5aeSmrg	fi
4846d9dcd5aeSmrg      else
4847d9dcd5aeSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4848ba064abeSmrg      fi
4849d9dcd5aeSmrg    else
4850d9dcd5aeSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4851d9dcd5aeSmrg    fi
4852ba064abeSmrg  else
4853d9dcd5aeSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4854d9dcd5aeSmrg    cat conftest.$ac_ext >&5
4855ba064abeSmrg  fi
4856d9dcd5aeSmrg  rm -rf conftest* conftst*
4857d9dcd5aeSmrg
4858d9dcd5aeSmrg  # Do not use the global_symbol_pipe unless it works.
4859d9dcd5aeSmrg  if test "$pipe_works" = yes; then
4860d9dcd5aeSmrg    break
4861d9dcd5aeSmrg  else
4862d9dcd5aeSmrg    lt_cv_sys_global_symbol_pipe=
4863ba064abeSmrg  fi
4864d9dcd5aeSmrgdone
4865d9dcd5aeSmrg])
4866d9dcd5aeSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4867d9dcd5aeSmrg  lt_cv_sys_global_symbol_to_cdecl=
4868d9dcd5aeSmrgfi
4869d9dcd5aeSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4870d9dcd5aeSmrg  AC_MSG_RESULT(failed)
4871d9dcd5aeSmrgelse
4872d9dcd5aeSmrg  AC_MSG_RESULT(ok)
4873b290cf36Smrgfi
4874ba064abeSmrg
4875d9dcd5aeSmrg# Response file support.
4876d9dcd5aeSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4877d9dcd5aeSmrg  nm_file_list_spec='@'
4878d9dcd5aeSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4879d9dcd5aeSmrg  nm_file_list_spec='@'
4880d9dcd5aeSmrgfi
4881b290cf36Smrg
4882d9dcd5aeSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4883d9dcd5aeSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4884d9dcd5aeSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4885d9dcd5aeSmrg    [Transform the output of nm in a proper C declaration])
4886d9dcd5aeSmrg_LT_DECL([global_symbol_to_c_name_address],
4887d9dcd5aeSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4888d9dcd5aeSmrg    [Transform the output of nm in a C name address pair])
4889d9dcd5aeSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4890d9dcd5aeSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4891d9dcd5aeSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4892d9dcd5aeSmrg_LT_DECL([], [nm_file_list_spec], [1],
4893d9dcd5aeSmrg    [Specify filename containing input files for $NM])
4894d9dcd5aeSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
4895b290cf36Smrg
4896b290cf36Smrg
4897d9dcd5aeSmrg# _LT_COMPILER_PIC([TAGNAME])
4898d9dcd5aeSmrg# ---------------------------
4899d9dcd5aeSmrgm4_defun([_LT_COMPILER_PIC],
4900ba064abeSmrg[m4_require([_LT_TAG_COMPILER])dnl
4901d9dcd5aeSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4902d9dcd5aeSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4903d9dcd5aeSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4904b290cf36Smrg
4905d9dcd5aeSmrgm4_if([$1], [CXX], [
4906d9dcd5aeSmrg  # C++ specific cases for pic, static, wl, etc.
4907d9dcd5aeSmrg  if test "$GXX" = yes; then
4908d9dcd5aeSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4909d9dcd5aeSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4910b290cf36Smrg
4911d9dcd5aeSmrg    case $host_os in
4912d9dcd5aeSmrg    aix*)
4913d9dcd5aeSmrg      # All AIX code is PIC.
4914d9dcd5aeSmrg      if test "$host_cpu" = ia64; then
4915d9dcd5aeSmrg	# AIX 5 now supports IA64 processor
4916d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4917ba064abeSmrg      fi
4918d9dcd5aeSmrg      ;;
4919b290cf36Smrg
4920d9dcd5aeSmrg    amigaos*)
4921d9dcd5aeSmrg      case $host_cpu in
4922d9dcd5aeSmrg      powerpc)
4923d9dcd5aeSmrg            # see comment about AmigaOS4 .so support
4924d9dcd5aeSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4925d9dcd5aeSmrg        ;;
4926d9dcd5aeSmrg      m68k)
4927d9dcd5aeSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4928d9dcd5aeSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
4929d9dcd5aeSmrg            # like `-m68040'.
4930d9dcd5aeSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4931d9dcd5aeSmrg        ;;
4932d9dcd5aeSmrg      esac
4933d9dcd5aeSmrg      ;;
4934b290cf36Smrg
4935ba064abeSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4936ba064abeSmrg      # PIC is the default for these OSes.
4937ba064abeSmrg      ;;
4938ba064abeSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
4939ba064abeSmrg      # This hack is so that the source file can tell whether it is being
4940ba064abeSmrg      # built for inclusion in a dll (and should export symbols for example).
4941ba064abeSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4942ba064abeSmrg      # (--disable-auto-import) libraries
4943ba064abeSmrg      m4_if([$1], [GCJ], [],
4944ba064abeSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4945ba064abeSmrg      ;;
4946ba064abeSmrg    darwin* | rhapsody*)
4947ba064abeSmrg      # PIC is the default on this platform
4948ba064abeSmrg      # Common symbols not allowed in MH_DYLIB files
4949ba064abeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4950ba064abeSmrg      ;;
4951ba064abeSmrg    *djgpp*)
4952ba064abeSmrg      # DJGPP does not support shared libraries at all
4953ba064abeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4954ba064abeSmrg      ;;
4955ba064abeSmrg    haiku*)
4956ba064abeSmrg      # PIC is the default for Haiku.
4957ba064abeSmrg      # The "-static" flag exists, but is broken.
4958ba064abeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4959ba064abeSmrg      ;;
4960ba064abeSmrg    interix[[3-9]]*)
4961ba064abeSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4962ba064abeSmrg      # Instead, we relocate shared libraries at runtime.
4963ba064abeSmrg      ;;
4964ba064abeSmrg    sysv4*MP*)
4965ba064abeSmrg      if test -d /usr/nec; then
4966ba064abeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4967ba064abeSmrg      fi
4968ba064abeSmrg      ;;
4969ba064abeSmrg    hpux*)
4970ba064abeSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4971ba064abeSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4972ba064abeSmrg      # sets the default TLS model and affects inlining.
4973ba064abeSmrg      case $host_cpu in
4974ba064abeSmrg      hppa*64*)
4975191cded7Smrg	;;
4976ba064abeSmrg      *)
4977ba064abeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4978ba064abeSmrg	;;
4979ba064abeSmrg      esac
4980ba064abeSmrg      ;;
4981ba064abeSmrg    *qnx* | *nto*)
4982ba064abeSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4983ba064abeSmrg      # it will coredump.
4984ba064abeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4985ba064abeSmrg      ;;
4986ba064abeSmrg    *)
4987ba064abeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4988ba064abeSmrg      ;;
4989ba064abeSmrg    esac
4990ba064abeSmrg  else
4991ba064abeSmrg    case $host_os in
4992ba064abeSmrg      aix[[4-9]]*)
4993ba064abeSmrg	# All AIX code is PIC.
4994ba064abeSmrg	if test "$host_cpu" = ia64; then
4995ba064abeSmrg	  # AIX 5 now supports IA64 processor
4996ba064abeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4997ba064abeSmrg	else
4998ba064abeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4999ba064abeSmrg	fi
5000ba064abeSmrg	;;
5001ba064abeSmrg      chorus*)
5002ba064abeSmrg	case $cc_basename in
5003ba064abeSmrg	cxch68*)
5004ba064abeSmrg	  # Green Hills C++ Compiler
5005ba064abeSmrg	  # _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"
5006ba064abeSmrg	  ;;
5007ba064abeSmrg	esac
5008ba064abeSmrg	;;
5009d9dcd5aeSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
5010d9dcd5aeSmrg	# This hack is so that the source file can tell whether it is being
5011d9dcd5aeSmrg	# built for inclusion in a dll (and should export symbols for example).
5012d9dcd5aeSmrg	m4_if([$1], [GCJ], [],
5013d9dcd5aeSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5014d9dcd5aeSmrg	;;
5015ba064abeSmrg      dgux*)
5016ba064abeSmrg	case $cc_basename in
5017ba064abeSmrg	  ec++*)
5018ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5019191cded7Smrg	    ;;
5020ba064abeSmrg	  ghcx*)
5021ba064abeSmrg	    # Green Hills C++ Compiler
5022ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5023191cded7Smrg	    ;;
5024ba064abeSmrg	  *)
5025191cded7Smrg	    ;;
5026ba064abeSmrg	esac
5027ba064abeSmrg	;;
5028ba064abeSmrg      freebsd* | dragonfly*)
5029ba064abeSmrg	# FreeBSD uses GNU C++
5030ba064abeSmrg	;;
5031ba064abeSmrg      hpux9* | hpux10* | hpux11*)
5032ba064abeSmrg	case $cc_basename in
5033ba064abeSmrg	  CC*)
5034ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5035ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5036ba064abeSmrg	    if test "$host_cpu" != ia64; then
5037ba064abeSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5038ba064abeSmrg	    fi
5039191cded7Smrg	    ;;
5040ba064abeSmrg	  aCC*)
5041ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5042ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5043ba064abeSmrg	    case $host_cpu in
5044ba064abeSmrg	    hppa*64*|ia64*)
5045ba064abeSmrg	      # +Z the default
5046b290cf36Smrg	      ;;
5047ba064abeSmrg	    *)
5048ba064abeSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5049b290cf36Smrg	      ;;
5050b290cf36Smrg	    esac
5051ba064abeSmrg	    ;;
5052ba064abeSmrg	  *)
5053ba064abeSmrg	    ;;
5054ba064abeSmrg	esac
5055ba064abeSmrg	;;
5056ba064abeSmrg      interix*)
5057ba064abeSmrg	# This is c89, which is MS Visual C++ (no shared libs)
5058ba064abeSmrg	# Anyone wants to do a port?
5059ba064abeSmrg	;;
5060ba064abeSmrg      irix5* | irix6* | nonstopux*)
5061ba064abeSmrg	case $cc_basename in
5062ba064abeSmrg	  CC*)
5063ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5064ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5065ba064abeSmrg	    # CC pic flag -KPIC is the default.
5066ba064abeSmrg	    ;;
5067ba064abeSmrg	  *)
5068ba064abeSmrg	    ;;
5069ba064abeSmrg	esac
5070ba064abeSmrg	;;
5071ba064abeSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5072ba064abeSmrg	case $cc_basename in
5073ba064abeSmrg	  KCC*)
5074ba064abeSmrg	    # KAI C++ Compiler
5075ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5076ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5077ba064abeSmrg	    ;;
5078ba064abeSmrg	  ecpc* )
5079ba064abeSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
5080ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5081ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5082ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5083ba064abeSmrg	    ;;
5084ba064abeSmrg	  icpc* )
5085ba064abeSmrg	    # Intel C++, used to be incompatible with GCC.
5086ba064abeSmrg	    # ICC 10 doesn't accept -KPIC any more.
5087ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5088ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5089ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5090ba064abeSmrg	    ;;
5091ba064abeSmrg	  pgCC* | pgcpp*)
5092ba064abeSmrg	    # Portland Group C++ compiler
5093ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5094ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5095ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5096ba064abeSmrg	    ;;
5097191cded7Smrg	  cxx*)
5098191cded7Smrg	    # Compaq C++
5099ba064abeSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5100ba064abeSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5101ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5102ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5103b290cf36Smrg	    ;;
5104ba064abeSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5105ba064abeSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5106ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5107ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5108ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5109191cded7Smrg	    ;;
5110191cded7Smrg	  *)
5111b290cf36Smrg	    case `$CC -V 2>&1 | sed 5q` in
5112b290cf36Smrg	    *Sun\ C*)
5113b290cf36Smrg	      # Sun C++ 5.9
5114ba064abeSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5115ba064abeSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5116ba064abeSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5117b290cf36Smrg	      ;;
5118b290cf36Smrg	    esac
5119191cded7Smrg	    ;;
5120191cded7Smrg	esac
5121191cded7Smrg	;;
5122ba064abeSmrg      lynxos*)
5123ba064abeSmrg	;;
5124ba064abeSmrg      m88k*)
5125ba064abeSmrg	;;
5126ba064abeSmrg      mvs*)
5127ba064abeSmrg	case $cc_basename in
5128ba064abeSmrg	  cxx*)
5129ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5130ba064abeSmrg	    ;;
5131ba064abeSmrg	  *)
5132ba064abeSmrg	    ;;
5133ba064abeSmrg	esac
5134ba064abeSmrg	;;
5135ba064abeSmrg      netbsd*)
5136ba064abeSmrg	;;
5137ba064abeSmrg      *qnx* | *nto*)
5138ba064abeSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
5139ba064abeSmrg        # it will coredump.
5140ba064abeSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5141ba064abeSmrg        ;;
5142ba064abeSmrg      osf3* | osf4* | osf5*)
5143ba064abeSmrg	case $cc_basename in
5144ba064abeSmrg	  KCC*)
5145ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5146ba064abeSmrg	    ;;
5147ba064abeSmrg	  RCC*)
5148ba064abeSmrg	    # Rational C++ 2.4.1
5149ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5150ba064abeSmrg	    ;;
5151ba064abeSmrg	  cxx*)
5152ba064abeSmrg	    # Digital/Compaq C++
5153ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5154ba064abeSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5155ba064abeSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5156ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5157ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5158ba064abeSmrg	    ;;
5159ba064abeSmrg	  *)
5160ba064abeSmrg	    ;;
5161ba064abeSmrg	esac
5162ba064abeSmrg	;;
5163ba064abeSmrg      psos*)
5164191cded7Smrg	;;
5165ba064abeSmrg      solaris*)
5166ba064abeSmrg	case $cc_basename in
5167ba064abeSmrg	  CC* | sunCC*)
5168ba064abeSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
5169ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5170ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5171ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5172ba064abeSmrg	    ;;
5173ba064abeSmrg	  gcx*)
5174ba064abeSmrg	    # Green Hills C++ Compiler
5175ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5176ba064abeSmrg	    ;;
5177ba064abeSmrg	  *)
5178ba064abeSmrg	    ;;
5179ba064abeSmrg	esac
5180191cded7Smrg	;;
5181ba064abeSmrg      sunos4*)
5182ba064abeSmrg	case $cc_basename in
5183ba064abeSmrg	  CC*)
5184ba064abeSmrg	    # Sun C++ 4.x
5185ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5186ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5187ba064abeSmrg	    ;;
5188ba064abeSmrg	  lcc*)
5189ba064abeSmrg	    # Lucid
5190ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5191191cded7Smrg	    ;;
5192191cded7Smrg	  *)
5193191cded7Smrg	    ;;
5194191cded7Smrg	esac
5195191cded7Smrg	;;
5196ba064abeSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5197ba064abeSmrg	case $cc_basename in
5198ba064abeSmrg	  CC*)
5199ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5200ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5201ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5202ba064abeSmrg	    ;;
5203ba064abeSmrg	esac
5204b290cf36Smrg	;;
5205ba064abeSmrg      tandem*)
5206ba064abeSmrg	case $cc_basename in
5207ba064abeSmrg	  NCC*)
5208ba064abeSmrg	    # NonStop-UX NCC 3.20
5209ba064abeSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5210ba064abeSmrg	    ;;
5211ba064abeSmrg	  *)
5212ba064abeSmrg	    ;;
5213ba064abeSmrg	esac
5214b290cf36Smrg	;;
5215ba064abeSmrg      vxworks*)
5216b290cf36Smrg	;;
5217d9dcd5aeSmrg      *)
5218d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5219d9dcd5aeSmrg	;;
5220d9dcd5aeSmrg    esac
5221d9dcd5aeSmrg  fi
5222d9dcd5aeSmrg],
5223d9dcd5aeSmrg[
5224d9dcd5aeSmrg  if test "$GCC" = yes; then
5225d9dcd5aeSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5226d9dcd5aeSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5227d9dcd5aeSmrg
5228d9dcd5aeSmrg    case $host_os in
5229d9dcd5aeSmrg      aix*)
5230d9dcd5aeSmrg      # All AIX code is PIC.
5231d9dcd5aeSmrg      if test "$host_cpu" = ia64; then
5232d9dcd5aeSmrg	# AIX 5 now supports IA64 processor
5233d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5234d9dcd5aeSmrg      fi
5235d9dcd5aeSmrg      ;;
5236d9dcd5aeSmrg
5237d9dcd5aeSmrg    amigaos*)
5238d9dcd5aeSmrg      case $host_cpu in
5239d9dcd5aeSmrg      powerpc)
5240d9dcd5aeSmrg            # see comment about AmigaOS4 .so support
5241d9dcd5aeSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5242d9dcd5aeSmrg        ;;
5243d9dcd5aeSmrg      m68k)
5244d9dcd5aeSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
5245d9dcd5aeSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
5246d9dcd5aeSmrg            # like `-m68040'.
5247d9dcd5aeSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5248d9dcd5aeSmrg        ;;
5249d9dcd5aeSmrg      esac
5250d9dcd5aeSmrg      ;;
5251d9dcd5aeSmrg
5252d9dcd5aeSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5253d9dcd5aeSmrg      # PIC is the default for these OSes.
5254d9dcd5aeSmrg      ;;
5255d9dcd5aeSmrg
5256d9dcd5aeSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
5257d9dcd5aeSmrg      # This hack is so that the source file can tell whether it is being
5258d9dcd5aeSmrg      # built for inclusion in a dll (and should export symbols for example).
5259d9dcd5aeSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5260d9dcd5aeSmrg      # (--disable-auto-import) libraries
5261d9dcd5aeSmrg      m4_if([$1], [GCJ], [],
5262d9dcd5aeSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5263d9dcd5aeSmrg      ;;
5264d9dcd5aeSmrg
5265d9dcd5aeSmrg    darwin* | rhapsody*)
5266d9dcd5aeSmrg      # PIC is the default on this platform
5267d9dcd5aeSmrg      # Common symbols not allowed in MH_DYLIB files
5268d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5269d9dcd5aeSmrg      ;;
5270d9dcd5aeSmrg
5271d9dcd5aeSmrg    haiku*)
5272d9dcd5aeSmrg      # PIC is the default for Haiku.
5273d9dcd5aeSmrg      # The "-static" flag exists, but is broken.
5274d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5275d9dcd5aeSmrg      ;;
5276d9dcd5aeSmrg
5277d9dcd5aeSmrg    hpux*)
5278d9dcd5aeSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5279d9dcd5aeSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5280d9dcd5aeSmrg      # sets the default TLS model and affects inlining.
5281d9dcd5aeSmrg      case $host_cpu in
5282d9dcd5aeSmrg      hppa*64*)
5283d9dcd5aeSmrg	# +Z the default
5284d9dcd5aeSmrg	;;
5285d9dcd5aeSmrg      *)
5286d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5287d9dcd5aeSmrg	;;
5288d9dcd5aeSmrg      esac
5289d9dcd5aeSmrg      ;;
5290d9dcd5aeSmrg
5291d9dcd5aeSmrg    interix[[3-9]]*)
5292d9dcd5aeSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5293d9dcd5aeSmrg      # Instead, we relocate shared libraries at runtime.
5294d9dcd5aeSmrg      ;;
5295d9dcd5aeSmrg
5296d9dcd5aeSmrg    msdosdjgpp*)
5297d9dcd5aeSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
5298d9dcd5aeSmrg      # on systems that don't support them.
5299d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5300d9dcd5aeSmrg      enable_shared=no
5301d9dcd5aeSmrg      ;;
5302d9dcd5aeSmrg
5303d9dcd5aeSmrg    *nto* | *qnx*)
5304d9dcd5aeSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5305d9dcd5aeSmrg      # it will coredump.
5306d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5307d9dcd5aeSmrg      ;;
5308d9dcd5aeSmrg
5309d9dcd5aeSmrg    sysv4*MP*)
5310d9dcd5aeSmrg      if test -d /usr/nec; then
5311d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5312d9dcd5aeSmrg      fi
5313d9dcd5aeSmrg      ;;
5314d9dcd5aeSmrg
5315d9dcd5aeSmrg    *)
5316d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5317d9dcd5aeSmrg      ;;
5318d9dcd5aeSmrg    esac
5319d9dcd5aeSmrg
5320d9dcd5aeSmrg    case $cc_basename in
5321d9dcd5aeSmrg    nvcc*) # Cuda Compiler Driver 2.2
5322d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5323d9dcd5aeSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5324d9dcd5aeSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5325d9dcd5aeSmrg      fi
5326d9dcd5aeSmrg      ;;
5327d9dcd5aeSmrg    esac
5328d9dcd5aeSmrg  else
5329d9dcd5aeSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
5330d9dcd5aeSmrg    case $host_os in
5331d9dcd5aeSmrg    aix*)
5332d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5333d9dcd5aeSmrg      if test "$host_cpu" = ia64; then
5334d9dcd5aeSmrg	# AIX 5 now supports IA64 processor
5335d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5336d9dcd5aeSmrg      else
5337d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5338d9dcd5aeSmrg      fi
5339d9dcd5aeSmrg      ;;
5340d9dcd5aeSmrg
5341d9dcd5aeSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
5342d9dcd5aeSmrg      # This hack is so that the source file can tell whether it is being
5343d9dcd5aeSmrg      # built for inclusion in a dll (and should export symbols for example).
5344d9dcd5aeSmrg      m4_if([$1], [GCJ], [],
5345d9dcd5aeSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5346d9dcd5aeSmrg      ;;
5347d9dcd5aeSmrg
5348d9dcd5aeSmrg    hpux9* | hpux10* | hpux11*)
5349d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5350d9dcd5aeSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5351d9dcd5aeSmrg      # not for PA HP-UX.
5352d9dcd5aeSmrg      case $host_cpu in
5353d9dcd5aeSmrg      hppa*64*|ia64*)
5354d9dcd5aeSmrg	# +Z the default
5355d9dcd5aeSmrg	;;
5356d9dcd5aeSmrg      *)
5357d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5358d9dcd5aeSmrg	;;
5359d9dcd5aeSmrg      esac
5360d9dcd5aeSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5361d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5362d9dcd5aeSmrg      ;;
5363d9dcd5aeSmrg
5364d9dcd5aeSmrg    irix5* | irix6* | nonstopux*)
5365d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5366d9dcd5aeSmrg      # PIC (with -KPIC) is the default.
5367d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5368d9dcd5aeSmrg      ;;
5369d9dcd5aeSmrg
5370d9dcd5aeSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5371d9dcd5aeSmrg      case $cc_basename in
5372d9dcd5aeSmrg      # old Intel for x86_64 which still supported -KPIC.
5373d9dcd5aeSmrg      ecc*)
5374d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5375d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5376d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5377d9dcd5aeSmrg        ;;
5378d9dcd5aeSmrg      # icc used to be incompatible with GCC.
5379d9dcd5aeSmrg      # ICC 10 doesn't accept -KPIC any more.
5380d9dcd5aeSmrg      icc* | ifort*)
5381d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5382d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5383d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5384d9dcd5aeSmrg        ;;
5385d9dcd5aeSmrg      # Lahey Fortran 8.1.
5386d9dcd5aeSmrg      lf95*)
5387d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5388d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5389d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5390d9dcd5aeSmrg	;;
5391d9dcd5aeSmrg      nagfor*)
5392d9dcd5aeSmrg	# NAG Fortran compiler
5393d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5394d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5395d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5396d9dcd5aeSmrg	;;
5397d9dcd5aeSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5398d9dcd5aeSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
5399d9dcd5aeSmrg	# which looks to be a dead project)
5400d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5401d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5402d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5403d9dcd5aeSmrg        ;;
5404d9dcd5aeSmrg      ccc*)
5405d9dcd5aeSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5406d9dcd5aeSmrg        # All Alpha code is PIC.
5407d9dcd5aeSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5408d9dcd5aeSmrg        ;;
5409d9dcd5aeSmrg      xl* | bgxl* | bgf* | mpixl*)
5410d9dcd5aeSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5411d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5412d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5413d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5414d9dcd5aeSmrg	;;
5415d9dcd5aeSmrg      *)
5416d9dcd5aeSmrg	case `$CC -V 2>&1 | sed 5q` in
5417d9dcd5aeSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5418d9dcd5aeSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5419d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5420d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5421d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5422d9dcd5aeSmrg	  ;;
5423d9dcd5aeSmrg	*Sun\ F* | *Sun*Fortran*)
5424d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5425d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5426d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5427d9dcd5aeSmrg	  ;;
5428d9dcd5aeSmrg	*Sun\ C*)
5429d9dcd5aeSmrg	  # Sun C 5.9
5430d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5431d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5432d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5433d9dcd5aeSmrg	  ;;
5434d9dcd5aeSmrg        *Intel*\ [[CF]]*Compiler*)
5435d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5436d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5437d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5438d9dcd5aeSmrg	  ;;
5439d9dcd5aeSmrg	*Portland\ Group*)
5440d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5441d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5442d9dcd5aeSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5443d9dcd5aeSmrg	  ;;
5444d9dcd5aeSmrg	esac
5445d9dcd5aeSmrg	;;
5446d9dcd5aeSmrg      esac
5447d9dcd5aeSmrg      ;;
5448d9dcd5aeSmrg
5449d9dcd5aeSmrg    newsos6)
5450d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5451d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5452d9dcd5aeSmrg      ;;
5453d9dcd5aeSmrg
5454d9dcd5aeSmrg    *nto* | *qnx*)
5455d9dcd5aeSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5456d9dcd5aeSmrg      # it will coredump.
5457d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5458d9dcd5aeSmrg      ;;
5459d9dcd5aeSmrg
5460d9dcd5aeSmrg    osf3* | osf4* | osf5*)
5461d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5462d9dcd5aeSmrg      # All OSF/1 code is PIC.
5463d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5464d9dcd5aeSmrg      ;;
5465d9dcd5aeSmrg
5466d9dcd5aeSmrg    rdos*)
5467d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5468d9dcd5aeSmrg      ;;
5469d9dcd5aeSmrg
5470d9dcd5aeSmrg    solaris*)
5471d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5472d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5473d9dcd5aeSmrg      case $cc_basename in
5474d9dcd5aeSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5475d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5476d9dcd5aeSmrg      *)
5477d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5478d9dcd5aeSmrg      esac
5479d9dcd5aeSmrg      ;;
5480d9dcd5aeSmrg
5481d9dcd5aeSmrg    sunos4*)
5482d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5483d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5484d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5485d9dcd5aeSmrg      ;;
5486d9dcd5aeSmrg
5487d9dcd5aeSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
5488d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5489d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5490d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5491d9dcd5aeSmrg      ;;
5492d9dcd5aeSmrg
5493d9dcd5aeSmrg    sysv4*MP*)
5494d9dcd5aeSmrg      if test -d /usr/nec ;then
5495d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5496d9dcd5aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5497d9dcd5aeSmrg      fi
5498d9dcd5aeSmrg      ;;
5499d9dcd5aeSmrg
5500d9dcd5aeSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5501d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5502d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5503d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5504d9dcd5aeSmrg      ;;
5505d9dcd5aeSmrg
5506d9dcd5aeSmrg    unicos*)
5507d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5508d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5509d9dcd5aeSmrg      ;;
5510d9dcd5aeSmrg
5511d9dcd5aeSmrg    uts4*)
5512d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5513d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5514d9dcd5aeSmrg      ;;
5515d9dcd5aeSmrg
5516d9dcd5aeSmrg    *)
5517d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5518d9dcd5aeSmrg      ;;
5519d9dcd5aeSmrg    esac
5520d9dcd5aeSmrg  fi
5521d9dcd5aeSmrg])
5522d9dcd5aeSmrgcase $host_os in
5523d9dcd5aeSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
5524d9dcd5aeSmrg  *djgpp*)
5525d9dcd5aeSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5526d9dcd5aeSmrg    ;;
5527d9dcd5aeSmrg  *)
5528d9dcd5aeSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5529d9dcd5aeSmrg    ;;
5530d9dcd5aeSmrgesac
5531d9dcd5aeSmrg
5532d9dcd5aeSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
5533d9dcd5aeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5534d9dcd5aeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5535d9dcd5aeSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5536d9dcd5aeSmrg
5537d9dcd5aeSmrg#
5538d9dcd5aeSmrg# Check to make sure the PIC flag actually works.
5539d9dcd5aeSmrg#
5540d9dcd5aeSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5541d9dcd5aeSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5542d9dcd5aeSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5543d9dcd5aeSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5544d9dcd5aeSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5545d9dcd5aeSmrg     "" | " "*) ;;
5546d9dcd5aeSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5547d9dcd5aeSmrg     esac],
5548d9dcd5aeSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5549d9dcd5aeSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5550d9dcd5aeSmrgfi
5551d9dcd5aeSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5552d9dcd5aeSmrg	[Additional compiler flags for building library objects])
5553d9dcd5aeSmrg
5554d9dcd5aeSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5555d9dcd5aeSmrg	[How to pass a linker flag through the compiler])
5556d9dcd5aeSmrg#
5557d9dcd5aeSmrg# Check to make sure the static flag actually works.
5558d9dcd5aeSmrg#
5559d9dcd5aeSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5560d9dcd5aeSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5561d9dcd5aeSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5562d9dcd5aeSmrg  $lt_tmp_static_flag,
5563d9dcd5aeSmrg  [],
5564d9dcd5aeSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5565d9dcd5aeSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5566d9dcd5aeSmrg	[Compiler flag to prevent dynamic linking])
5567d9dcd5aeSmrg])# _LT_COMPILER_PIC
5568d9dcd5aeSmrg
5569d9dcd5aeSmrg
5570d9dcd5aeSmrg# _LT_LINKER_SHLIBS([TAGNAME])
5571d9dcd5aeSmrg# ----------------------------
5572d9dcd5aeSmrg# See if the linker supports building shared libraries.
5573d9dcd5aeSmrgm4_defun([_LT_LINKER_SHLIBS],
5574d9dcd5aeSmrg[AC_REQUIRE([LT_PATH_LD])dnl
5575d9dcd5aeSmrgAC_REQUIRE([LT_PATH_NM])dnl
5576d9dcd5aeSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5577d9dcd5aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5578d9dcd5aeSmrgm4_require([_LT_DECL_EGREP])dnl
5579d9dcd5aeSmrgm4_require([_LT_DECL_SED])dnl
5580d9dcd5aeSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5581d9dcd5aeSmrgm4_require([_LT_TAG_COMPILER])dnl
5582d9dcd5aeSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5583d9dcd5aeSmrgm4_if([$1], [CXX], [
5584d9dcd5aeSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5585d9dcd5aeSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5586d9dcd5aeSmrg  case $host_os in
5587d9dcd5aeSmrg  aix[[4-9]]*)
5588d9dcd5aeSmrg    # If we're using GNU nm, then we don't want the "-C" option.
5589d9dcd5aeSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5590d9dcd5aeSmrg    # Also, AIX nm treats weak defined symbols like other global defined
5591d9dcd5aeSmrg    # symbols, whereas GNU nm marks them as "W".
5592d9dcd5aeSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5593d9dcd5aeSmrg      _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'
5594d9dcd5aeSmrg    else
5595d9dcd5aeSmrg      _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'
5596d9dcd5aeSmrg    fi
5597d9dcd5aeSmrg    ;;
5598d9dcd5aeSmrg  pw32*)
5599d9dcd5aeSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5600d9dcd5aeSmrg    ;;
5601d9dcd5aeSmrg  cygwin* | mingw* | cegcc*)
5602d9dcd5aeSmrg    case $cc_basename in
5603d9dcd5aeSmrg    cl*)
5604d9dcd5aeSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5605d9dcd5aeSmrg      ;;
5606d9dcd5aeSmrg    *)
5607d9dcd5aeSmrg      _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'
5608d9dcd5aeSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5609d9dcd5aeSmrg      ;;
5610d9dcd5aeSmrg    esac
5611d9dcd5aeSmrg    ;;
5612d9dcd5aeSmrg  *)
5613d9dcd5aeSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5614d9dcd5aeSmrg    ;;
5615d9dcd5aeSmrg  esac
5616d9dcd5aeSmrg], [
5617d9dcd5aeSmrg  runpath_var=
5618d9dcd5aeSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
5619d9dcd5aeSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
5620d9dcd5aeSmrg  _LT_TAGVAR(archive_cmds, $1)=
5621d9dcd5aeSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
5622d9dcd5aeSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
5623d9dcd5aeSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5624d9dcd5aeSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5625d9dcd5aeSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5626d9dcd5aeSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
5627d9dcd5aeSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
5628d9dcd5aeSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5629d9dcd5aeSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5630d9dcd5aeSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5631d9dcd5aeSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
5632d9dcd5aeSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5633d9dcd5aeSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
5634d9dcd5aeSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5635d9dcd5aeSmrg  _LT_TAGVAR(module_cmds, $1)=
5636d9dcd5aeSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
5637d9dcd5aeSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5638d9dcd5aeSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5639d9dcd5aeSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5640d9dcd5aeSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5641d9dcd5aeSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
5642d9dcd5aeSmrg  # included in the symbol list
5643d9dcd5aeSmrg  _LT_TAGVAR(include_expsyms, $1)=
5644d9dcd5aeSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5645d9dcd5aeSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5646d9dcd5aeSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5647d9dcd5aeSmrg  # as well as any symbol that contains `d'.
5648d9dcd5aeSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5649d9dcd5aeSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5650d9dcd5aeSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5651d9dcd5aeSmrg  # the symbol is explicitly referenced.  Since portable code cannot
5652d9dcd5aeSmrg  # rely on this symbol name, it's probably fine to never include it in
5653d9dcd5aeSmrg  # preloaded symbol tables.
5654d9dcd5aeSmrg  # Exclude shared library initialization/finalization symbols.
5655d9dcd5aeSmrgdnl Note also adjust exclude_expsyms for C++ above.
5656d9dcd5aeSmrg  extract_expsyms_cmds=
5657d9dcd5aeSmrg
5658d9dcd5aeSmrg  case $host_os in
5659d9dcd5aeSmrg  cygwin* | mingw* | pw32* | cegcc*)
5660d9dcd5aeSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5661d9dcd5aeSmrg    # When not using gcc, we currently assume that we are using
5662d9dcd5aeSmrg    # Microsoft Visual C++.
5663d9dcd5aeSmrg    if test "$GCC" != yes; then
5664d9dcd5aeSmrg      with_gnu_ld=no
5665d9dcd5aeSmrg    fi
5666d9dcd5aeSmrg    ;;
5667d9dcd5aeSmrg  interix*)
5668d9dcd5aeSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5669d9dcd5aeSmrg    with_gnu_ld=yes
5670d9dcd5aeSmrg    ;;
5671d9dcd5aeSmrg  openbsd*)
5672d9dcd5aeSmrg    with_gnu_ld=no
5673d9dcd5aeSmrg    ;;
5674d9dcd5aeSmrg  esac
5675d9dcd5aeSmrg
5676d9dcd5aeSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5677d9dcd5aeSmrg
5678d9dcd5aeSmrg  # On some targets, GNU ld is compatible enough with the native linker
5679d9dcd5aeSmrg  # that we're better off using the native interface for both.
5680d9dcd5aeSmrg  lt_use_gnu_ld_interface=no
5681d9dcd5aeSmrg  if test "$with_gnu_ld" = yes; then
5682d9dcd5aeSmrg    case $host_os in
5683d9dcd5aeSmrg      aix*)
5684d9dcd5aeSmrg	# The AIX port of GNU ld has always aspired to compatibility
5685d9dcd5aeSmrg	# with the native linker.  However, as the warning in the GNU ld
5686d9dcd5aeSmrg	# block says, versions before 2.19.5* couldn't really create working
5687d9dcd5aeSmrg	# shared libraries, regardless of the interface used.
5688d9dcd5aeSmrg	case `$LD -v 2>&1` in
5689d9dcd5aeSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5690d9dcd5aeSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5691d9dcd5aeSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5692d9dcd5aeSmrg	  *)
5693d9dcd5aeSmrg	    lt_use_gnu_ld_interface=yes
5694d9dcd5aeSmrg	    ;;
5695d9dcd5aeSmrg	esac
5696d9dcd5aeSmrg	;;
5697d9dcd5aeSmrg      *)
5698d9dcd5aeSmrg	lt_use_gnu_ld_interface=yes
5699d9dcd5aeSmrg	;;
5700d9dcd5aeSmrg    esac
5701d9dcd5aeSmrg  fi
5702d9dcd5aeSmrg
5703d9dcd5aeSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
5704d9dcd5aeSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5705d9dcd5aeSmrg    wlarc='${wl}'
5706d9dcd5aeSmrg
5707d9dcd5aeSmrg    # Set some defaults for GNU ld with shared library support. These
5708d9dcd5aeSmrg    # are reset later if shared libraries are not supported. Putting them
5709d9dcd5aeSmrg    # here allows them to be overridden if necessary.
5710d9dcd5aeSmrg    runpath_var=LD_RUN_PATH
5711d9dcd5aeSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5712d9dcd5aeSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5713d9dcd5aeSmrg    # ancient GNU ld didn't support --whole-archive et. al.
5714d9dcd5aeSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5715d9dcd5aeSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5716d9dcd5aeSmrg    else
5717d9dcd5aeSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5718d9dcd5aeSmrg    fi
5719d9dcd5aeSmrg    supports_anon_versioning=no
5720d9dcd5aeSmrg    case `$LD -v 2>&1` in
5721d9dcd5aeSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
5722d9dcd5aeSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5723d9dcd5aeSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5724d9dcd5aeSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5725d9dcd5aeSmrg      *\ 2.11.*) ;; # other 2.11 versions
5726d9dcd5aeSmrg      *) supports_anon_versioning=yes ;;
5727d9dcd5aeSmrg    esac
5728d9dcd5aeSmrg
5729d9dcd5aeSmrg    # See if GNU ld supports shared libraries.
5730d9dcd5aeSmrg    case $host_os in
5731d9dcd5aeSmrg    aix[[3-9]]*)
5732d9dcd5aeSmrg      # On AIX/PPC, the GNU linker is very broken
5733d9dcd5aeSmrg      if test "$host_cpu" != ia64; then
5734d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5735d9dcd5aeSmrg	cat <<_LT_EOF 1>&2
5736d9dcd5aeSmrg
5737d9dcd5aeSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
5738d9dcd5aeSmrg*** to be unable to reliably create shared libraries on AIX.
5739d9dcd5aeSmrg*** Therefore, libtool is disabling shared libraries support.  If you
5740d9dcd5aeSmrg*** really care for shared libraries, you may want to install binutils
5741d9dcd5aeSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5742d9dcd5aeSmrg*** You will then need to restart the configuration process.
5743d9dcd5aeSmrg
5744d9dcd5aeSmrg_LT_EOF
5745d9dcd5aeSmrg      fi
5746d9dcd5aeSmrg      ;;
5747d9dcd5aeSmrg
5748d9dcd5aeSmrg    amigaos*)
5749d9dcd5aeSmrg      case $host_cpu in
5750d9dcd5aeSmrg      powerpc)
5751d9dcd5aeSmrg            # see comment about AmigaOS4 .so support
5752d9dcd5aeSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5753d9dcd5aeSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5754d9dcd5aeSmrg        ;;
5755d9dcd5aeSmrg      m68k)
5756d9dcd5aeSmrg            _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)'
5757d9dcd5aeSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5758d9dcd5aeSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5759d9dcd5aeSmrg        ;;
5760d9dcd5aeSmrg      esac
5761d9dcd5aeSmrg      ;;
5762d9dcd5aeSmrg
5763d9dcd5aeSmrg    beos*)
5764d9dcd5aeSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5765d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5766d9dcd5aeSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5767d9dcd5aeSmrg	# support --undefined.  This deserves some investigation.  FIXME
5768d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5769d9dcd5aeSmrg      else
5770d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5771d9dcd5aeSmrg      fi
5772d9dcd5aeSmrg      ;;
5773d9dcd5aeSmrg
5774d9dcd5aeSmrg    cygwin* | mingw* | pw32* | cegcc*)
5775d9dcd5aeSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5776d9dcd5aeSmrg      # as there is no search path for DLLs.
5777d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5778d9dcd5aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5779d9dcd5aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5780d9dcd5aeSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
5781d9dcd5aeSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5782d9dcd5aeSmrg      _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'
5783d9dcd5aeSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5784d9dcd5aeSmrg
5785d9dcd5aeSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5786d9dcd5aeSmrg        _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'
5787d9dcd5aeSmrg	# If the export-symbols file already is a .def file (1st line
5788d9dcd5aeSmrg	# is EXPORTS), use it as is; otherwise, prepend...
5789d9dcd5aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5790d9dcd5aeSmrg	  cp $export_symbols $output_objdir/$soname.def;
5791d9dcd5aeSmrg	else
5792d9dcd5aeSmrg	  echo EXPORTS > $output_objdir/$soname.def;
5793d9dcd5aeSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
5794d9dcd5aeSmrg	fi~
5795d9dcd5aeSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5796d9dcd5aeSmrg      else
5797d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5798d9dcd5aeSmrg      fi
5799d9dcd5aeSmrg      ;;
5800d9dcd5aeSmrg
5801d9dcd5aeSmrg    haiku*)
5802d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5803d9dcd5aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5804d9dcd5aeSmrg      ;;
5805d9dcd5aeSmrg
5806d9dcd5aeSmrg    interix[[3-9]]*)
5807d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
5808d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5809d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5810d9dcd5aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5811d9dcd5aeSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5812d9dcd5aeSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5813d9dcd5aeSmrg      # default) and relocated if they conflict, which is a slow very memory
5814d9dcd5aeSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5815d9dcd5aeSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5816d9dcd5aeSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5817d9dcd5aeSmrg      _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'
5818d9dcd5aeSmrg      _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'
5819d9dcd5aeSmrg      ;;
5820d9dcd5aeSmrg
5821d9dcd5aeSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5822d9dcd5aeSmrg      tmp_diet=no
5823d9dcd5aeSmrg      if test "$host_os" = linux-dietlibc; then
5824d9dcd5aeSmrg	case $cc_basename in
5825d9dcd5aeSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5826d9dcd5aeSmrg	esac
5827d9dcd5aeSmrg      fi
5828d9dcd5aeSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5829d9dcd5aeSmrg	 && test "$tmp_diet" = no
5830d9dcd5aeSmrg      then
5831d9dcd5aeSmrg	tmp_addflag=' $pic_flag'
5832d9dcd5aeSmrg	tmp_sharedflag='-shared'
5833d9dcd5aeSmrg	case $cc_basename,$host_cpu in
5834d9dcd5aeSmrg        pgcc*)				# Portland Group C compiler
5835d9dcd5aeSmrg	  _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'
5836d9dcd5aeSmrg	  tmp_addflag=' $pic_flag'
5837d9dcd5aeSmrg	  ;;
5838d9dcd5aeSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5839d9dcd5aeSmrg					# Portland Group f77 and f90 compilers
5840d9dcd5aeSmrg	  _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'
5841d9dcd5aeSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5842d9dcd5aeSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5843d9dcd5aeSmrg	  tmp_addflag=' -i_dynamic' ;;
5844d9dcd5aeSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5845d9dcd5aeSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5846d9dcd5aeSmrg	ifc* | ifort*)			# Intel Fortran compiler
5847d9dcd5aeSmrg	  tmp_addflag=' -nofor_main' ;;
5848d9dcd5aeSmrg	lf95*)				# Lahey Fortran 8.1
5849d9dcd5aeSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5850d9dcd5aeSmrg	  tmp_sharedflag='--shared' ;;
5851d9dcd5aeSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5852d9dcd5aeSmrg	  tmp_sharedflag='-qmkshrobj'
5853d9dcd5aeSmrg	  tmp_addflag= ;;
5854d9dcd5aeSmrg	nvcc*)	# Cuda Compiler Driver 2.2
5855d9dcd5aeSmrg	  _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'
5856d9dcd5aeSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5857d9dcd5aeSmrg	  ;;
5858d9dcd5aeSmrg	esac
5859d9dcd5aeSmrg	case `$CC -V 2>&1 | sed 5q` in
5860d9dcd5aeSmrg	*Sun\ C*)			# Sun C 5.9
5861d9dcd5aeSmrg	  _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'
5862d9dcd5aeSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5863d9dcd5aeSmrg	  tmp_sharedflag='-G' ;;
5864d9dcd5aeSmrg	*Sun\ F*)			# Sun Fortran 8.3
5865d9dcd5aeSmrg	  tmp_sharedflag='-G' ;;
5866d9dcd5aeSmrg	esac
5867d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5868d9dcd5aeSmrg
5869d9dcd5aeSmrg        if test "x$supports_anon_versioning" = xyes; then
5870d9dcd5aeSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5871d9dcd5aeSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5872d9dcd5aeSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
5873d9dcd5aeSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5874d9dcd5aeSmrg        fi
5875d9dcd5aeSmrg
5876d9dcd5aeSmrg	case $cc_basename in
5877d9dcd5aeSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
5878d9dcd5aeSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5879d9dcd5aeSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5880d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5881d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5882d9dcd5aeSmrg	  if test "x$supports_anon_versioning" = xyes; then
5883d9dcd5aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5884d9dcd5aeSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5885d9dcd5aeSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
5886d9dcd5aeSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5887d9dcd5aeSmrg	  fi
5888d9dcd5aeSmrg	  ;;
5889d9dcd5aeSmrg	esac
5890d9dcd5aeSmrg      else
5891d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5892d9dcd5aeSmrg      fi
5893d9dcd5aeSmrg      ;;
5894d9dcd5aeSmrg
5895d9dcd5aeSmrg    netbsd*)
5896d9dcd5aeSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5897d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5898d9dcd5aeSmrg	wlarc=
5899d9dcd5aeSmrg      else
5900d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5901d9dcd5aeSmrg	_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'
5902d9dcd5aeSmrg      fi
5903d9dcd5aeSmrg      ;;
5904d9dcd5aeSmrg
5905d9dcd5aeSmrg    solaris*)
5906d9dcd5aeSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5907d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5908d9dcd5aeSmrg	cat <<_LT_EOF 1>&2
5909d9dcd5aeSmrg
5910d9dcd5aeSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5911d9dcd5aeSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
5912d9dcd5aeSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5913d9dcd5aeSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5914d9dcd5aeSmrg*** your PATH or compiler configuration so that the native linker is
5915d9dcd5aeSmrg*** used, and then restart.
5916d9dcd5aeSmrg
5917d9dcd5aeSmrg_LT_EOF
5918d9dcd5aeSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5919d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5920d9dcd5aeSmrg	_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'
5921d9dcd5aeSmrg      else
5922d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5923d9dcd5aeSmrg      fi
5924d9dcd5aeSmrg      ;;
5925d9dcd5aeSmrg
5926d9dcd5aeSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5927d9dcd5aeSmrg      case `$LD -v 2>&1` in
5928d9dcd5aeSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5929d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5930d9dcd5aeSmrg	cat <<_LT_EOF 1>&2
5931d9dcd5aeSmrg
5932d9dcd5aeSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5933d9dcd5aeSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5934d9dcd5aeSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5935d9dcd5aeSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5936d9dcd5aeSmrg*** your PATH or compiler configuration so that the native linker is
5937d9dcd5aeSmrg*** used, and then restart.
5938d9dcd5aeSmrg
5939d9dcd5aeSmrg_LT_EOF
5940d9dcd5aeSmrg	;;
5941d9dcd5aeSmrg	*)
5942d9dcd5aeSmrg	  # For security reasons, it is highly recommended that you always
5943d9dcd5aeSmrg	  # use absolute paths for naming shared libraries, and exclude the
5944d9dcd5aeSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
5945d9dcd5aeSmrg	  # requires that you compile everything twice, which is a pain.
5946d9dcd5aeSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5947d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5948d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5949d9dcd5aeSmrg	    _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'
5950d9dcd5aeSmrg	  else
5951d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5952d9dcd5aeSmrg	  fi
5953d9dcd5aeSmrg	;;
5954d9dcd5aeSmrg      esac
5955d9dcd5aeSmrg      ;;
5956d9dcd5aeSmrg
5957d9dcd5aeSmrg    sunos4*)
5958d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5959d9dcd5aeSmrg      wlarc=
5960d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5961d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5962d9dcd5aeSmrg      ;;
5963d9dcd5aeSmrg
5964d9dcd5aeSmrg    *)
5965d9dcd5aeSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5966d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5967d9dcd5aeSmrg	_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'
5968d9dcd5aeSmrg      else
5969d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5970d9dcd5aeSmrg      fi
5971d9dcd5aeSmrg      ;;
5972d9dcd5aeSmrg    esac
5973d9dcd5aeSmrg
5974d9dcd5aeSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
5975d9dcd5aeSmrg      runpath_var=
5976d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5977d9dcd5aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5978d9dcd5aeSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5979d9dcd5aeSmrg    fi
5980d9dcd5aeSmrg  else
5981d9dcd5aeSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
5982d9dcd5aeSmrg    case $host_os in
5983d9dcd5aeSmrg    aix3*)
5984d9dcd5aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5985d9dcd5aeSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5986d9dcd5aeSmrg      _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'
5987d9dcd5aeSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
5988d9dcd5aeSmrg      # are no directories specified by -L.
5989d9dcd5aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5990d9dcd5aeSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5991d9dcd5aeSmrg	# Neither direct hardcoding nor static linking is supported with a
5992d9dcd5aeSmrg	# broken collect2.
5993d9dcd5aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5994d9dcd5aeSmrg      fi
5995d9dcd5aeSmrg      ;;
5996d9dcd5aeSmrg
5997d9dcd5aeSmrg    aix[[4-9]]*)
5998d9dcd5aeSmrg      if test "$host_cpu" = ia64; then
5999d9dcd5aeSmrg	# On IA64, the linker does run time linking by default, so we don't
6000d9dcd5aeSmrg	# have to do anything special.
6001d9dcd5aeSmrg	aix_use_runtimelinking=no
6002d9dcd5aeSmrg	exp_sym_flag='-Bexport'
6003d9dcd5aeSmrg	no_entry_flag=""
6004d9dcd5aeSmrg      else
6005d9dcd5aeSmrg	# If we're using GNU nm, then we don't want the "-C" option.
6006d9dcd5aeSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6007d9dcd5aeSmrg	# Also, AIX nm treats weak defined symbols like other global
6008d9dcd5aeSmrg	# defined symbols, whereas GNU nm marks them as "W".
6009d9dcd5aeSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6010d9dcd5aeSmrg	  _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'
6011d9dcd5aeSmrg	else
6012d9dcd5aeSmrg	  _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'
6013d9dcd5aeSmrg	fi
6014d9dcd5aeSmrg	aix_use_runtimelinking=no
6015d9dcd5aeSmrg
6016d9dcd5aeSmrg	# Test if we are trying to use run time linking or normal
6017d9dcd5aeSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6018d9dcd5aeSmrg	# need to do runtime linking.
6019d9dcd5aeSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6020d9dcd5aeSmrg	  for ld_flag in $LDFLAGS; do
6021d9dcd5aeSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6022d9dcd5aeSmrg	    aix_use_runtimelinking=yes
6023d9dcd5aeSmrg	    break
6024d9dcd5aeSmrg	  fi
6025d9dcd5aeSmrg	  done
6026d9dcd5aeSmrg	  ;;
6027d9dcd5aeSmrg	esac
6028d9dcd5aeSmrg
6029d9dcd5aeSmrg	exp_sym_flag='-bexport'
6030d9dcd5aeSmrg	no_entry_flag='-bnoentry'
6031d9dcd5aeSmrg      fi
6032d9dcd5aeSmrg
6033d9dcd5aeSmrg      # When large executables or shared objects are built, AIX ld can
6034d9dcd5aeSmrg      # have problems creating the table of contents.  If linking a library
6035d9dcd5aeSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
6036d9dcd5aeSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6037d9dcd5aeSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6038d9dcd5aeSmrg
6039d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)=''
6040d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6041d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6042d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6043d9dcd5aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6044d9dcd5aeSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6045d9dcd5aeSmrg
6046d9dcd5aeSmrg      if test "$GCC" = yes; then
6047d9dcd5aeSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6048d9dcd5aeSmrg	# We only want to do this on AIX 4.2 and lower, the check
6049d9dcd5aeSmrg	# below for broken collect2 doesn't work under 4.3+
6050d9dcd5aeSmrg	  collect2name=`${CC} -print-prog-name=collect2`
6051d9dcd5aeSmrg	  if test -f "$collect2name" &&
6052d9dcd5aeSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6053d9dcd5aeSmrg	  then
6054d9dcd5aeSmrg	  # We have reworked collect2
6055d9dcd5aeSmrg	  :
6056d9dcd5aeSmrg	  else
6057d9dcd5aeSmrg	  # We have old collect2
6058d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6059d9dcd5aeSmrg	  # It fails to find uninstalled libraries when the uninstalled
6060d9dcd5aeSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
6061d9dcd5aeSmrg	  # to unsupported forces relinking
6062d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6063d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6064d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6065d9dcd5aeSmrg	  fi
6066d9dcd5aeSmrg	  ;;
6067d9dcd5aeSmrg	esac
6068d9dcd5aeSmrg	shared_flag='-shared'
6069d9dcd5aeSmrg	if test "$aix_use_runtimelinking" = yes; then
6070d9dcd5aeSmrg	  shared_flag="$shared_flag "'${wl}-G'
6071d9dcd5aeSmrg	fi
6072d9dcd5aeSmrg      else
6073d9dcd5aeSmrg	# not using gcc
6074d9dcd5aeSmrg	if test "$host_cpu" = ia64; then
6075d9dcd5aeSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6076d9dcd5aeSmrg	# chokes on -Wl,-G. The following line is correct:
6077d9dcd5aeSmrg	  shared_flag='-G'
6078d9dcd5aeSmrg	else
6079d9dcd5aeSmrg	  if test "$aix_use_runtimelinking" = yes; then
6080d9dcd5aeSmrg	    shared_flag='${wl}-G'
6081d9dcd5aeSmrg	  else
6082d9dcd5aeSmrg	    shared_flag='${wl}-bM:SRE'
6083d9dcd5aeSmrg	  fi
6084d9dcd5aeSmrg	fi
6085d9dcd5aeSmrg      fi
6086d9dcd5aeSmrg
6087d9dcd5aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6088d9dcd5aeSmrg      # It seems that -bexpall does not export symbols beginning with
6089d9dcd5aeSmrg      # underscore (_), so it is better to generate a list of symbols to export.
6090d9dcd5aeSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
6091d9dcd5aeSmrg      if test "$aix_use_runtimelinking" = yes; then
6092d9dcd5aeSmrg	# Warning - without using the other runtime loading flags (-brtl),
6093d9dcd5aeSmrg	# -berok will link without error, but may produce a broken library.
6094d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6095d9dcd5aeSmrg        # Determine the default libpath from the value encoded in an
6096d9dcd5aeSmrg        # empty executable.
6097d9dcd5aeSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
6098d9dcd5aeSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6099d9dcd5aeSmrg        _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"
6100d9dcd5aeSmrg      else
6101d9dcd5aeSmrg	if test "$host_cpu" = ia64; then
6102d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6103d9dcd5aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6104d9dcd5aeSmrg	  _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"
6105d9dcd5aeSmrg	else
6106d9dcd5aeSmrg	 # Determine the default libpath from the value encoded in an
6107d9dcd5aeSmrg	 # empty executable.
6108d9dcd5aeSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
6109d9dcd5aeSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6110d9dcd5aeSmrg	  # Warning - without using the other run time loading flags,
6111d9dcd5aeSmrg	  # -berok will link without error, but may produce a broken library.
6112d9dcd5aeSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6113d9dcd5aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6114d9dcd5aeSmrg	  if test "$with_gnu_ld" = yes; then
6115d9dcd5aeSmrg	    # We only use this code for GNU lds that support --whole-archive.
6116d9dcd5aeSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6117d9dcd5aeSmrg	  else
6118d9dcd5aeSmrg	    # Exported symbols can be pulled into shared objects from archives
6119d9dcd5aeSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6120d9dcd5aeSmrg	  fi
6121d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6122d9dcd5aeSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
6123d9dcd5aeSmrg	  _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'
6124d9dcd5aeSmrg	fi
6125d9dcd5aeSmrg      fi
6126d9dcd5aeSmrg      ;;
6127d9dcd5aeSmrg
6128d9dcd5aeSmrg    amigaos*)
6129d9dcd5aeSmrg      case $host_cpu in
6130d9dcd5aeSmrg      powerpc)
6131d9dcd5aeSmrg            # see comment about AmigaOS4 .so support
6132d9dcd5aeSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6133d9dcd5aeSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6134d9dcd5aeSmrg        ;;
6135d9dcd5aeSmrg      m68k)
6136d9dcd5aeSmrg            _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)'
6137d9dcd5aeSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6138d9dcd5aeSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6139d9dcd5aeSmrg        ;;
6140d9dcd5aeSmrg      esac
6141d9dcd5aeSmrg      ;;
6142d9dcd5aeSmrg
6143d9dcd5aeSmrg    bsdi[[45]]*)
6144d9dcd5aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6145d9dcd5aeSmrg      ;;
6146d9dcd5aeSmrg
6147d9dcd5aeSmrg    cygwin* | mingw* | pw32* | cegcc*)
6148d9dcd5aeSmrg      # When not using gcc, we currently assume that we are using
6149d9dcd5aeSmrg      # Microsoft Visual C++.
6150d9dcd5aeSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
6151d9dcd5aeSmrg      # no search path for DLLs.
6152d9dcd5aeSmrg      case $cc_basename in
6153d9dcd5aeSmrg      cl*)
6154d9dcd5aeSmrg	# Native MSVC
6155d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6156d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6157d9dcd5aeSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
6158d9dcd5aeSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
6159d9dcd5aeSmrg	# Tell ltmain to make .lib files, not .a files.
6160d9dcd5aeSmrg	libext=lib
6161d9dcd5aeSmrg	# Tell ltmain to make .dll files, not .so files.
6162d9dcd5aeSmrg	shrext_cmds=".dll"
6163d9dcd5aeSmrg	# FIXME: Setting linknames here is a bad hack.
6164d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6165d9dcd5aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6166d9dcd5aeSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6167d9dcd5aeSmrg	  else
6168d9dcd5aeSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6169d9dcd5aeSmrg	  fi~
6170d9dcd5aeSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6171d9dcd5aeSmrg	  linknames='
6172d9dcd5aeSmrg	# The linker will not automatically build a static lib if we build a DLL.
6173d9dcd5aeSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6174d9dcd5aeSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6175d9dcd5aeSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6176d9dcd5aeSmrg	_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'
6177d9dcd5aeSmrg	# Don't use ranlib
6178d9dcd5aeSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6179d9dcd5aeSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6180d9dcd5aeSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6181d9dcd5aeSmrg	  case $lt_outputfile in
6182d9dcd5aeSmrg	    *.exe|*.EXE) ;;
6183d9dcd5aeSmrg	    *)
6184d9dcd5aeSmrg	      lt_outputfile="$lt_outputfile.exe"
6185d9dcd5aeSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6186d9dcd5aeSmrg	      ;;
6187d9dcd5aeSmrg	  esac~
6188d9dcd5aeSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6189d9dcd5aeSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6190d9dcd5aeSmrg	    $RM "$lt_outputfile.manifest";
6191d9dcd5aeSmrg	  fi'
6192d9dcd5aeSmrg	;;
6193d9dcd5aeSmrg      *)
6194d9dcd5aeSmrg	# Assume MSVC wrapper
6195d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6196d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6197d9dcd5aeSmrg	# Tell ltmain to make .lib files, not .a files.
6198d9dcd5aeSmrg	libext=lib
6199d9dcd5aeSmrg	# Tell ltmain to make .dll files, not .so files.
6200d9dcd5aeSmrg	shrext_cmds=".dll"
6201d9dcd5aeSmrg	# FIXME: Setting linknames here is a bad hack.
6202d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6203d9dcd5aeSmrg	# The linker will automatically build a .lib file if we build a DLL.
6204d9dcd5aeSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6205d9dcd5aeSmrg	# FIXME: Should let the user specify the lib program.
6206d9dcd5aeSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6207d9dcd5aeSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6208d9dcd5aeSmrg	;;
6209d9dcd5aeSmrg      esac
6210d9dcd5aeSmrg      ;;
6211d9dcd5aeSmrg
6212d9dcd5aeSmrg    darwin* | rhapsody*)
6213d9dcd5aeSmrg      _LT_DARWIN_LINKER_FEATURES($1)
6214d9dcd5aeSmrg      ;;
6215d9dcd5aeSmrg
6216d9dcd5aeSmrg    dgux*)
6217d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6218d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6219d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6220d9dcd5aeSmrg      ;;
6221d9dcd5aeSmrg
6222d9dcd5aeSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6223d9dcd5aeSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
6224d9dcd5aeSmrg    # does not break anything, and helps significantly (at the cost of a little
6225d9dcd5aeSmrg    # extra space).
6226d9dcd5aeSmrg    freebsd2.2*)
6227d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6228d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6229d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6230d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6231d9dcd5aeSmrg      ;;
6232d9dcd5aeSmrg
6233d9dcd5aeSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6234d9dcd5aeSmrg    freebsd2.*)
6235d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6236d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6237d9dcd5aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6238d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6239d9dcd5aeSmrg      ;;
6240d9dcd5aeSmrg
6241d9dcd5aeSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6242d9dcd5aeSmrg    freebsd* | dragonfly*)
6243d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6244d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6245d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6246d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6247d9dcd5aeSmrg      ;;
6248d9dcd5aeSmrg
6249d9dcd5aeSmrg    hpux9*)
6250d9dcd5aeSmrg      if test "$GCC" = yes; then
6251d9dcd5aeSmrg	_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'
6252d9dcd5aeSmrg      else
6253d9dcd5aeSmrg	_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'
6254d9dcd5aeSmrg      fi
6255d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6256d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6257d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6258d9dcd5aeSmrg
6259d9dcd5aeSmrg      # hardcode_minus_L: Not really in the search PATH,
6260d9dcd5aeSmrg      # but as the default location of the library.
6261d9dcd5aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6262d9dcd5aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6263d9dcd5aeSmrg      ;;
6264d9dcd5aeSmrg
6265d9dcd5aeSmrg    hpux10*)
6266d9dcd5aeSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6267d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6268d9dcd5aeSmrg      else
6269d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6270d9dcd5aeSmrg      fi
6271d9dcd5aeSmrg      if test "$with_gnu_ld" = no; then
6272d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6273d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6274d9dcd5aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
6275d9dcd5aeSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6276d9dcd5aeSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6277d9dcd5aeSmrg	# hardcode_minus_L: Not really in the search PATH,
6278d9dcd5aeSmrg	# but as the default location of the library.
6279d9dcd5aeSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6280d9dcd5aeSmrg      fi
6281d9dcd5aeSmrg      ;;
6282d9dcd5aeSmrg
6283d9dcd5aeSmrg    hpux11*)
6284d9dcd5aeSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6285d9dcd5aeSmrg	case $host_cpu in
6286d9dcd5aeSmrg	hppa*64*)
6287d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6288d9dcd5aeSmrg	  ;;
6289d9dcd5aeSmrg	ia64*)
6290d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6291d9dcd5aeSmrg	  ;;
6292d9dcd5aeSmrg	*)
6293d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6294d9dcd5aeSmrg	  ;;
6295d9dcd5aeSmrg	esac
6296d9dcd5aeSmrg      else
6297d9dcd5aeSmrg	case $host_cpu in
6298d9dcd5aeSmrg	hppa*64*)
6299d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6300d9dcd5aeSmrg	  ;;
6301d9dcd5aeSmrg	ia64*)
6302d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6303d9dcd5aeSmrg	  ;;
6304d9dcd5aeSmrg	*)
6305d9dcd5aeSmrg	m4_if($1, [], [
6306d9dcd5aeSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
6307d9dcd5aeSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6308d9dcd5aeSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
6309d9dcd5aeSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6310d9dcd5aeSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6311d9dcd5aeSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6312d9dcd5aeSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6313d9dcd5aeSmrg	  ;;
6314d9dcd5aeSmrg	esac
6315d9dcd5aeSmrg      fi
6316d9dcd5aeSmrg      if test "$with_gnu_ld" = no; then
6317d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6318d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6319d9dcd5aeSmrg
6320d9dcd5aeSmrg	case $host_cpu in
6321d9dcd5aeSmrg	hppa*64*|ia64*)
6322d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
6323d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6324d9dcd5aeSmrg	  ;;
6325d9dcd5aeSmrg	*)
6326d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6327d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6328d9dcd5aeSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6329d9dcd5aeSmrg
6330d9dcd5aeSmrg	  # hardcode_minus_L: Not really in the search PATH,
6331d9dcd5aeSmrg	  # but as the default location of the library.
6332d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6333d9dcd5aeSmrg	  ;;
6334d9dcd5aeSmrg	esac
6335d9dcd5aeSmrg      fi
6336d9dcd5aeSmrg      ;;
6337d9dcd5aeSmrg
6338d9dcd5aeSmrg    irix5* | irix6* | nonstopux*)
6339d9dcd5aeSmrg      if test "$GCC" = yes; then
6340d9dcd5aeSmrg	_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'
6341d9dcd5aeSmrg	# Try to use the -exported_symbol ld option, if it does not
6342d9dcd5aeSmrg	# work, assume that -exports_file does not work either and
6343d9dcd5aeSmrg	# implicitly export all symbols.
6344d9dcd5aeSmrg	# This should be the same for all languages, so no per-tag cache variable.
6345d9dcd5aeSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6346d9dcd5aeSmrg	  [lt_cv_irix_exported_symbol],
6347d9dcd5aeSmrg	  [save_LDFLAGS="$LDFLAGS"
6348d9dcd5aeSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6349d9dcd5aeSmrg	   AC_LINK_IFELSE(
6350d9dcd5aeSmrg	     [AC_LANG_SOURCE(
6351d9dcd5aeSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6352d9dcd5aeSmrg			      [C++], [[int foo (void) { return 0; }]],
6353d9dcd5aeSmrg			      [Fortran 77], [[
6354d9dcd5aeSmrg      subroutine foo
6355d9dcd5aeSmrg      end]],
6356d9dcd5aeSmrg			      [Fortran], [[
6357d9dcd5aeSmrg      subroutine foo
6358d9dcd5aeSmrg      end]])])],
6359d9dcd5aeSmrg	      [lt_cv_irix_exported_symbol=yes],
6360d9dcd5aeSmrg	      [lt_cv_irix_exported_symbol=no])
6361d9dcd5aeSmrg           LDFLAGS="$save_LDFLAGS"])
6362d9dcd5aeSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
6363d9dcd5aeSmrg          _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'
6364d9dcd5aeSmrg	fi
6365d9dcd5aeSmrg      else
6366d9dcd5aeSmrg	_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'
6367d9dcd5aeSmrg	_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'
6368d9dcd5aeSmrg      fi
6369d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6370d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6371d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6372d9dcd5aeSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
6373d9dcd5aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6374d9dcd5aeSmrg      ;;
6375d9dcd5aeSmrg
6376d9dcd5aeSmrg    netbsd*)
6377d9dcd5aeSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6378d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6379d9dcd5aeSmrg      else
6380d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6381d9dcd5aeSmrg      fi
6382d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6383d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6384d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6385d9dcd5aeSmrg      ;;
6386d9dcd5aeSmrg
6387d9dcd5aeSmrg    newsos6)
6388d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6389d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6390d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6391d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6392d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6393d9dcd5aeSmrg      ;;
6394d9dcd5aeSmrg
6395d9dcd5aeSmrg    *nto* | *qnx*)
6396d9dcd5aeSmrg      ;;
6397d9dcd5aeSmrg
6398d9dcd5aeSmrg    openbsd*)
6399d9dcd5aeSmrg      if test -f /usr/libexec/ld.so; then
6400d9dcd5aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
6401d9dcd5aeSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6402d9dcd5aeSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6403d9dcd5aeSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6404d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6405d9dcd5aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6406d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6407d9dcd5aeSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6408d9dcd5aeSmrg	else
6409d9dcd5aeSmrg	  case $host_os in
6410d9dcd5aeSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6411d9dcd5aeSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6412d9dcd5aeSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6413d9dcd5aeSmrg	     ;;
6414d9dcd5aeSmrg	   *)
6415d9dcd5aeSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6416d9dcd5aeSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6417d9dcd5aeSmrg	     ;;
6418d9dcd5aeSmrg	  esac
6419d9dcd5aeSmrg	fi
6420d9dcd5aeSmrg      else
6421d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6422d9dcd5aeSmrg      fi
6423d9dcd5aeSmrg      ;;
6424d9dcd5aeSmrg
6425d9dcd5aeSmrg    os2*)
6426d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6427d9dcd5aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6428d9dcd5aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6429d9dcd5aeSmrg      _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'
6430d9dcd5aeSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6431d9dcd5aeSmrg      ;;
6432d9dcd5aeSmrg
6433d9dcd5aeSmrg    osf3*)
6434d9dcd5aeSmrg      if test "$GCC" = yes; then
6435d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6436d9dcd5aeSmrg	_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'
6437d9dcd5aeSmrg      else
6438d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6439d9dcd5aeSmrg	_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'
6440d9dcd5aeSmrg      fi
6441d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6442d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6443d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6444d9dcd5aeSmrg      ;;
6445d9dcd5aeSmrg
6446d9dcd5aeSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6447d9dcd5aeSmrg      if test "$GCC" = yes; then
6448d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6449d9dcd5aeSmrg	_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'
6450d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6451d9dcd5aeSmrg      else
6452d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6453d9dcd5aeSmrg	_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'
6454d9dcd5aeSmrg	_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~
6455d9dcd5aeSmrg	$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'
6456d9dcd5aeSmrg
6457d9dcd5aeSmrg	# Both c and cxx compiler support -rpath directly
6458d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6459d9dcd5aeSmrg      fi
6460d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6461d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6462d9dcd5aeSmrg      ;;
6463d9dcd5aeSmrg
6464d9dcd5aeSmrg    solaris*)
6465d9dcd5aeSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6466d9dcd5aeSmrg      if test "$GCC" = yes; then
6467d9dcd5aeSmrg	wlarc='${wl}'
6468d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6469d9dcd5aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6470d9dcd5aeSmrg	  $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'
6471d9dcd5aeSmrg      else
6472d9dcd5aeSmrg	case `$CC -V 2>&1` in
6473d9dcd5aeSmrg	*"Compilers 5.0"*)
6474d9dcd5aeSmrg	  wlarc=''
6475d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6476d9dcd5aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6477d9dcd5aeSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6478d9dcd5aeSmrg	  ;;
6479d9dcd5aeSmrg	*)
6480d9dcd5aeSmrg	  wlarc='${wl}'
6481d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6482d9dcd5aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6483d9dcd5aeSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6484d9dcd5aeSmrg	  ;;
6485d9dcd5aeSmrg	esac
6486d9dcd5aeSmrg      fi
6487d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6488d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6489d9dcd5aeSmrg      case $host_os in
6490d9dcd5aeSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6491d9dcd5aeSmrg      *)
6492d9dcd5aeSmrg	# The compiler driver will combine and reorder linker options,
6493d9dcd5aeSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6494d9dcd5aeSmrg	# but is careful enough not to reorder.
6495d9dcd5aeSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
6496d9dcd5aeSmrg	if test "$GCC" = yes; then
6497d9dcd5aeSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6498d9dcd5aeSmrg	else
6499d9dcd5aeSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6500d9dcd5aeSmrg	fi
6501d9dcd5aeSmrg	;;
6502d9dcd5aeSmrg      esac
6503d9dcd5aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6504d9dcd5aeSmrg      ;;
6505d9dcd5aeSmrg
6506d9dcd5aeSmrg    sunos4*)
6507d9dcd5aeSmrg      if test "x$host_vendor" = xsequent; then
6508d9dcd5aeSmrg	# Use $CC to link under sequent, because it throws in some extra .o
6509d9dcd5aeSmrg	# files that make .init and .fini sections work.
6510d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6511d9dcd5aeSmrg      else
6512d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6513d9dcd5aeSmrg      fi
6514d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6515d9dcd5aeSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6516d9dcd5aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6517d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6518d9dcd5aeSmrg      ;;
6519d9dcd5aeSmrg
6520d9dcd5aeSmrg    sysv4)
6521d9dcd5aeSmrg      case $host_vendor in
6522d9dcd5aeSmrg	sni)
6523d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6524d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6525d9dcd5aeSmrg	;;
6526d9dcd5aeSmrg	siemens)
6527d9dcd5aeSmrg	  ## LD is ld it makes a PLAMLIB
6528d9dcd5aeSmrg	  ## CC just makes a GrossModule.
6529d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6530d9dcd5aeSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6531d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
6532d9dcd5aeSmrg        ;;
6533d9dcd5aeSmrg	motorola)
6534d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6535d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6536191cded7Smrg	;;
6537d9dcd5aeSmrg      esac
6538d9dcd5aeSmrg      runpath_var='LD_RUN_PATH'
6539d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6540d9dcd5aeSmrg      ;;
6541b290cf36Smrg
6542d9dcd5aeSmrg    sysv4.3*)
6543d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6544d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6545d9dcd5aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6546d9dcd5aeSmrg      ;;
6547d9dcd5aeSmrg
6548d9dcd5aeSmrg    sysv4*MP*)
6549d9dcd5aeSmrg      if test -d /usr/nec; then
6550d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6551d9dcd5aeSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6552d9dcd5aeSmrg	runpath_var=LD_RUN_PATH
6553d9dcd5aeSmrg	hardcode_runpath_var=yes
6554d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
6555ba064abeSmrg      fi
6556ba064abeSmrg      ;;
6557b290cf36Smrg
6558d9dcd5aeSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6559d9dcd5aeSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6560d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6561d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6562d9dcd5aeSmrg      runpath_var='LD_RUN_PATH'
6563d9dcd5aeSmrg
6564d9dcd5aeSmrg      if test "$GCC" = yes; then
6565d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6566d9dcd5aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6567d9dcd5aeSmrg      else
6568d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6569d9dcd5aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6570d9dcd5aeSmrg      fi
6571d9dcd5aeSmrg      ;;
6572d9dcd5aeSmrg
6573d9dcd5aeSmrg    sysv5* | sco3.2v5* | sco5v6*)
6574d9dcd5aeSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
6575d9dcd5aeSmrg      # link with -lc, and that would cause any symbols used from libc to
6576d9dcd5aeSmrg      # always be unresolved, which means just about no library would
6577d9dcd5aeSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
6578d9dcd5aeSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
6579d9dcd5aeSmrg      # as -z defs.
6580d9dcd5aeSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6581d9dcd5aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6582d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6583d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6584d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6585d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6586d9dcd5aeSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6587d9dcd5aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6588d9dcd5aeSmrg      runpath_var='LD_RUN_PATH'
6589d9dcd5aeSmrg
6590d9dcd5aeSmrg      if test "$GCC" = yes; then
6591d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6592d9dcd5aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6593d9dcd5aeSmrg      else
6594d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6595d9dcd5aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6596d9dcd5aeSmrg      fi
6597d9dcd5aeSmrg      ;;
6598d9dcd5aeSmrg
6599d9dcd5aeSmrg    uts4*)
6600d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6601d9dcd5aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6602d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6603d9dcd5aeSmrg      ;;
6604d9dcd5aeSmrg
6605d9dcd5aeSmrg    *)
6606d9dcd5aeSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
6607d9dcd5aeSmrg      ;;
6608d9dcd5aeSmrg    esac
6609d9dcd5aeSmrg
6610d9dcd5aeSmrg    if test x$host_vendor = xsni; then
6611d9dcd5aeSmrg      case $host in
6612d9dcd5aeSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6613d9dcd5aeSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6614d9dcd5aeSmrg	;;
6615ba064abeSmrg      esac
6616d9dcd5aeSmrg    fi
6617d9dcd5aeSmrg  fi
6618d9dcd5aeSmrg])
6619d9dcd5aeSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6620d9dcd5aeSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6621d9dcd5aeSmrg
6622d9dcd5aeSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6623d9dcd5aeSmrg
6624d9dcd5aeSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6625d9dcd5aeSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6626d9dcd5aeSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
6627d9dcd5aeSmrg    [The commands to extract the exported symbol list from a shared archive])
6628d9dcd5aeSmrg
6629d9dcd5aeSmrg#
6630d9dcd5aeSmrg# Do we need to explicitly link libc?
6631d9dcd5aeSmrg#
6632d9dcd5aeSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6633d9dcd5aeSmrgx|xyes)
6634d9dcd5aeSmrg  # Assume -lc should be added
6635d9dcd5aeSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6636d9dcd5aeSmrg
6637d9dcd5aeSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
6638d9dcd5aeSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
6639d9dcd5aeSmrg    *'~'*)
6640d9dcd5aeSmrg      # FIXME: we may have to deal with multi-command sequences.
6641d9dcd5aeSmrg      ;;
6642d9dcd5aeSmrg    '$CC '*)
6643d9dcd5aeSmrg      # Test whether the compiler implicitly links with -lc since on some
6644d9dcd5aeSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6645d9dcd5aeSmrg      # to ld, don't add -lc before -lgcc.
6646d9dcd5aeSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6647d9dcd5aeSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6648d9dcd5aeSmrg	[$RM conftest*
6649d9dcd5aeSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6650d9dcd5aeSmrg
6651d9dcd5aeSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6652d9dcd5aeSmrg	  soname=conftest
6653d9dcd5aeSmrg	  lib=conftest
6654d9dcd5aeSmrg	  libobjs=conftest.$ac_objext
6655d9dcd5aeSmrg	  deplibs=
6656d9dcd5aeSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6657d9dcd5aeSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6658d9dcd5aeSmrg	  compiler_flags=-v
6659d9dcd5aeSmrg	  linker_flags=-v
6660d9dcd5aeSmrg	  verstring=
6661d9dcd5aeSmrg	  output_objdir=.
6662d9dcd5aeSmrg	  libname=conftest
6663d9dcd5aeSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6664d9dcd5aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
6665d9dcd5aeSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6666d9dcd5aeSmrg	  then
6667d9dcd5aeSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6668d9dcd5aeSmrg	  else
6669d9dcd5aeSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6670d9dcd5aeSmrg	  fi
6671d9dcd5aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6672d9dcd5aeSmrg	else
6673d9dcd5aeSmrg	  cat conftest.err 1>&5
6674d9dcd5aeSmrg	fi
6675d9dcd5aeSmrg	$RM conftest*
6676d9dcd5aeSmrg	])
6677d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6678ba064abeSmrg      ;;
6679d9dcd5aeSmrg    esac
6680d9dcd5aeSmrg  fi
6681d9dcd5aeSmrg  ;;
6682d9dcd5aeSmrgesac
6683d9dcd5aeSmrg
6684d9dcd5aeSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6685d9dcd5aeSmrg    [Whether or not to add -lc for building shared libraries])
6686d9dcd5aeSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6687d9dcd5aeSmrg    [enable_shared_with_static_runtimes], [0],
6688d9dcd5aeSmrg    [Whether or not to disallow shared libs when runtime libs are static])
6689d9dcd5aeSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6690d9dcd5aeSmrg    [Compiler flag to allow reflexive dlopens])
6691d9dcd5aeSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6692d9dcd5aeSmrg    [Compiler flag to generate shared objects directly from archives])
6693d9dcd5aeSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
6694d9dcd5aeSmrg    [Whether the compiler copes with passing no objects directly])
6695d9dcd5aeSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6696d9dcd5aeSmrg    [Create an old-style archive from a shared archive])
6697d9dcd5aeSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6698d9dcd5aeSmrg    [Create a temporary old-style archive to link instead of a shared archive])
6699d9dcd5aeSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6700d9dcd5aeSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
6701d9dcd5aeSmrg_LT_TAGDECL([], [module_cmds], [2],
6702d9dcd5aeSmrg    [Commands used to build a loadable module if different from building
6703d9dcd5aeSmrg    a shared archive.])
6704d9dcd5aeSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
6705d9dcd5aeSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
6706d9dcd5aeSmrg    [Whether we are building with GNU ld or not])
6707d9dcd5aeSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
6708d9dcd5aeSmrg    [Flag that allows shared libraries with undefined symbols to be built])
6709d9dcd5aeSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
6710d9dcd5aeSmrg    [Flag that enforces no undefined symbols])
6711d9dcd5aeSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6712d9dcd5aeSmrg    [Flag to hardcode $libdir into a binary during linking.
6713d9dcd5aeSmrg    This must work even if $libdir does not exist])
6714d9dcd5aeSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6715d9dcd5aeSmrg    [Whether we need a single "-rpath" flag with a separated argument])
6716d9dcd5aeSmrg_LT_TAGDECL([], [hardcode_direct], [0],
6717d9dcd5aeSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6718d9dcd5aeSmrg    DIR into the resulting binary])
6719d9dcd5aeSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6720d9dcd5aeSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6721d9dcd5aeSmrg    DIR into the resulting binary and the resulting library dependency is
6722d9dcd5aeSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6723d9dcd5aeSmrg    library is relocated])
6724d9dcd5aeSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
6725d9dcd5aeSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6726d9dcd5aeSmrg    into the resulting binary])
6727d9dcd5aeSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6728d9dcd5aeSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6729d9dcd5aeSmrg    into the resulting binary])
6730d9dcd5aeSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
6731d9dcd5aeSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
6732d9dcd5aeSmrg    into the library and all subsequent libraries and executables linked
6733d9dcd5aeSmrg    against it])
6734d9dcd5aeSmrg_LT_TAGDECL([], [inherit_rpath], [0],
6735d9dcd5aeSmrg    [Set to yes if linker adds runtime paths of dependent libraries
6736d9dcd5aeSmrg    to runtime path list])
6737d9dcd5aeSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
6738d9dcd5aeSmrg    [Whether libtool must link a program against all its dependency libraries])
6739d9dcd5aeSmrg_LT_TAGDECL([], [always_export_symbols], [0],
6740d9dcd5aeSmrg    [Set to "yes" if exported symbols are required])
6741d9dcd5aeSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
6742d9dcd5aeSmrg    [The commands to list exported symbols])
6743d9dcd5aeSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
6744d9dcd5aeSmrg    [Symbols that should not be listed in the preloaded symbols])
6745d9dcd5aeSmrg_LT_TAGDECL([], [include_expsyms], [1],
6746d9dcd5aeSmrg    [Symbols that must always be exported])
6747d9dcd5aeSmrg_LT_TAGDECL([], [prelink_cmds], [2],
6748d9dcd5aeSmrg    [Commands necessary for linking programs (against libraries) with templates])
6749d9dcd5aeSmrg_LT_TAGDECL([], [postlink_cmds], [2],
6750d9dcd5aeSmrg    [Commands necessary for finishing linking programs])
6751d9dcd5aeSmrg_LT_TAGDECL([], [file_list_spec], [1],
6752d9dcd5aeSmrg    [Specify filename containing input files])
6753d9dcd5aeSmrgdnl FIXME: Not yet implemented
6754d9dcd5aeSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6755d9dcd5aeSmrgdnl    [Compiler flag to generate thread safe objects])
6756d9dcd5aeSmrg])# _LT_LINKER_SHLIBS
6757b290cf36Smrg
6758b290cf36Smrg
6759d9dcd5aeSmrg# _LT_LANG_C_CONFIG([TAG])
6760d9dcd5aeSmrg# ------------------------
6761d9dcd5aeSmrg# Ensure that the configuration variables for a C compiler are suitably
6762d9dcd5aeSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6763d9dcd5aeSmrg# the compiler configuration to `libtool'.
6764d9dcd5aeSmrgm4_defun([_LT_LANG_C_CONFIG],
6765d9dcd5aeSmrg[m4_require([_LT_DECL_EGREP])dnl
6766d9dcd5aeSmrglt_save_CC="$CC"
6767d9dcd5aeSmrgAC_LANG_PUSH(C)
6768b290cf36Smrg
6769d9dcd5aeSmrg# Source file extension for C test sources.
6770d9dcd5aeSmrgac_ext=c
6771b290cf36Smrg
6772d9dcd5aeSmrg# Object file extension for compiled C test sources.
6773d9dcd5aeSmrgobjext=o
6774d9dcd5aeSmrg_LT_TAGVAR(objext, $1)=$objext
6775b290cf36Smrg
6776d9dcd5aeSmrg# Code to be used in simple compile tests
6777d9dcd5aeSmrglt_simple_compile_test_code="int some_variable = 0;"
6778b290cf36Smrg
6779d9dcd5aeSmrg# Code to be used in simple link tests
6780d9dcd5aeSmrglt_simple_link_test_code='int main(){return(0);}'
6781b290cf36Smrg
6782d9dcd5aeSmrg_LT_TAG_COMPILER
6783d9dcd5aeSmrg# Save the default compiler, since it gets overwritten when the other
6784d9dcd5aeSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6785d9dcd5aeSmrgcompiler_DEFAULT=$CC
6786b290cf36Smrg
6787d9dcd5aeSmrg# save warnings/boilerplate of simple test code
6788d9dcd5aeSmrg_LT_COMPILER_BOILERPLATE
6789d9dcd5aeSmrg_LT_LINKER_BOILERPLATE
6790b290cf36Smrg
6791d9dcd5aeSmrgif test -n "$compiler"; then
6792d9dcd5aeSmrg  _LT_COMPILER_NO_RTTI($1)
6793d9dcd5aeSmrg  _LT_COMPILER_PIC($1)
6794d9dcd5aeSmrg  _LT_COMPILER_C_O($1)
6795d9dcd5aeSmrg  _LT_COMPILER_FILE_LOCKS($1)
6796d9dcd5aeSmrg  _LT_LINKER_SHLIBS($1)
6797d9dcd5aeSmrg  _LT_SYS_DYNAMIC_LINKER($1)
6798d9dcd5aeSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6799d9dcd5aeSmrg  LT_SYS_DLOPEN_SELF
6800d9dcd5aeSmrg  _LT_CMD_STRIPLIB
6801b290cf36Smrg
6802d9dcd5aeSmrg  # Report which library types will actually be built
6803d9dcd5aeSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
6804d9dcd5aeSmrg  AC_MSG_RESULT([$can_build_shared])
6805b290cf36Smrg
6806d9dcd5aeSmrg  AC_MSG_CHECKING([whether to build shared libraries])
6807d9dcd5aeSmrg  test "$can_build_shared" = "no" && enable_shared=no
6808b290cf36Smrg
6809d9dcd5aeSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
6810d9dcd5aeSmrg  # are all built from PIC.
6811d9dcd5aeSmrg  case $host_os in
6812d9dcd5aeSmrg  aix3*)
6813d9dcd5aeSmrg    test "$enable_shared" = yes && enable_static=no
6814d9dcd5aeSmrg    if test -n "$RANLIB"; then
6815d9dcd5aeSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6816d9dcd5aeSmrg      postinstall_cmds='$RANLIB $lib'
6817d9dcd5aeSmrg    fi
6818d9dcd5aeSmrg    ;;
6819b290cf36Smrg
6820d9dcd5aeSmrg  aix[[4-9]]*)
6821d9dcd5aeSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6822d9dcd5aeSmrg      test "$enable_shared" = yes && enable_static=no
6823d9dcd5aeSmrg    fi
6824d9dcd5aeSmrg    ;;
6825d9dcd5aeSmrg  esac
6826d9dcd5aeSmrg  AC_MSG_RESULT([$enable_shared])
6827b290cf36Smrg
6828d9dcd5aeSmrg  AC_MSG_CHECKING([whether to build static libraries])
6829d9dcd5aeSmrg  # Make sure either enable_shared or enable_static is yes.
6830d9dcd5aeSmrg  test "$enable_shared" = yes || enable_static=yes
6831d9dcd5aeSmrg  AC_MSG_RESULT([$enable_static])
6832b290cf36Smrg
6833d9dcd5aeSmrg  _LT_CONFIG($1)
6834d9dcd5aeSmrgfi
6835d9dcd5aeSmrgAC_LANG_POP
6836d9dcd5aeSmrgCC="$lt_save_CC"
6837d9dcd5aeSmrg])# _LT_LANG_C_CONFIG
6838b290cf36Smrg
6839b290cf36Smrg
6840d9dcd5aeSmrg# _LT_LANG_CXX_CONFIG([TAG])
6841d9dcd5aeSmrg# --------------------------
6842d9dcd5aeSmrg# Ensure that the configuration variables for a C++ compiler are suitably
6843d9dcd5aeSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6844d9dcd5aeSmrg# the compiler configuration to `libtool'.
6845d9dcd5aeSmrgm4_defun([_LT_LANG_CXX_CONFIG],
6846d9dcd5aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6847d9dcd5aeSmrgm4_require([_LT_DECL_EGREP])dnl
6848d9dcd5aeSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6849d9dcd5aeSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6850d9dcd5aeSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6851d9dcd5aeSmrg    (test "X$CXX" != "Xg++"))) ; then
6852d9dcd5aeSmrg  AC_PROG_CXXCPP
6853d9dcd5aeSmrgelse
6854d9dcd5aeSmrg  _lt_caught_CXX_error=yes
6855d9dcd5aeSmrgfi
6856b290cf36Smrg
6857d9dcd5aeSmrgAC_LANG_PUSH(C++)
6858d9dcd5aeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6859d9dcd5aeSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6860d9dcd5aeSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6861d9dcd5aeSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6862d9dcd5aeSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
6863d9dcd5aeSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6864d9dcd5aeSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6865d9dcd5aeSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6866d9dcd5aeSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6867d9dcd5aeSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6868d9dcd5aeSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6869d9dcd5aeSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6870d9dcd5aeSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6871d9dcd5aeSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6872d9dcd5aeSmrg_LT_TAGVAR(module_cmds, $1)=
6873d9dcd5aeSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6874d9dcd5aeSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6875d9dcd5aeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6876d9dcd5aeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6877d9dcd5aeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6878d9dcd5aeSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6879d9dcd5aeSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6880d9dcd5aeSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6881b290cf36Smrg
6882d9dcd5aeSmrg# Source file extension for C++ test sources.
6883d9dcd5aeSmrgac_ext=cpp
6884b290cf36Smrg
6885d9dcd5aeSmrg# Object file extension for compiled C++ test sources.
6886d9dcd5aeSmrgobjext=o
6887d9dcd5aeSmrg_LT_TAGVAR(objext, $1)=$objext
6888191cded7Smrg
6889d9dcd5aeSmrg# No sense in running all these tests if we already determined that
6890d9dcd5aeSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
6891d9dcd5aeSmrg# are currently assumed to apply to all compilers on this platform,
6892d9dcd5aeSmrg# and will be corrupted by setting them based on a non-working compiler.
6893d9dcd5aeSmrgif test "$_lt_caught_CXX_error" != yes; then
6894d9dcd5aeSmrg  # Code to be used in simple compile tests
6895d9dcd5aeSmrg  lt_simple_compile_test_code="int some_variable = 0;"
6896b290cf36Smrg
6897d9dcd5aeSmrg  # Code to be used in simple link tests
6898d9dcd5aeSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6899b290cf36Smrg
6900d9dcd5aeSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6901d9dcd5aeSmrg  _LT_TAG_COMPILER
6902b290cf36Smrg
6903d9dcd5aeSmrg  # save warnings/boilerplate of simple test code
6904d9dcd5aeSmrg  _LT_COMPILER_BOILERPLATE
6905d9dcd5aeSmrg  _LT_LINKER_BOILERPLATE
6906b290cf36Smrg
6907d9dcd5aeSmrg  # Allow CC to be a program name with arguments.
6908d9dcd5aeSmrg  lt_save_CC=$CC
6909d9dcd5aeSmrg  lt_save_CFLAGS=$CFLAGS
6910d9dcd5aeSmrg  lt_save_LD=$LD
6911d9dcd5aeSmrg  lt_save_GCC=$GCC
6912d9dcd5aeSmrg  GCC=$GXX
6913d9dcd5aeSmrg  lt_save_with_gnu_ld=$with_gnu_ld
6914d9dcd5aeSmrg  lt_save_path_LD=$lt_cv_path_LD
6915d9dcd5aeSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6916d9dcd5aeSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6917d9dcd5aeSmrg  else
6918d9dcd5aeSmrg    $as_unset lt_cv_prog_gnu_ld
6919d9dcd5aeSmrg  fi
6920d9dcd5aeSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
6921d9dcd5aeSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
6922d9dcd5aeSmrg  else
6923d9dcd5aeSmrg    $as_unset lt_cv_path_LD
6924d9dcd5aeSmrg  fi
6925d9dcd5aeSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
6926d9dcd5aeSmrg  CC=${CXX-"c++"}
6927d9dcd5aeSmrg  CFLAGS=$CXXFLAGS
6928d9dcd5aeSmrg  compiler=$CC
6929d9dcd5aeSmrg  _LT_TAGVAR(compiler, $1)=$CC
6930d9dcd5aeSmrg  _LT_CC_BASENAME([$compiler])
6931191cded7Smrg
6932d9dcd5aeSmrg  if test -n "$compiler"; then
6933d9dcd5aeSmrg    # We don't want -fno-exception when compiling C++ code, so set the
6934d9dcd5aeSmrg    # no_builtin_flag separately
6935d9dcd5aeSmrg    if test "$GXX" = yes; then
6936d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6937d9dcd5aeSmrg    else
6938d9dcd5aeSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6939d9dcd5aeSmrg    fi
6940191cded7Smrg
6941d9dcd5aeSmrg    if test "$GXX" = yes; then
6942d9dcd5aeSmrg      # Set up default GNU C++ configuration
6943191cded7Smrg
6944d9dcd5aeSmrg      LT_PATH_LD
6945191cded7Smrg
6946d9dcd5aeSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6947d9dcd5aeSmrg      # archiving commands below assume that GNU ld is being used.
6948d9dcd5aeSmrg      if test "$with_gnu_ld" = yes; then
6949d9dcd5aeSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6950d9dcd5aeSmrg        _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'
6951191cded7Smrg
6952d9dcd5aeSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6953d9dcd5aeSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6954191cded7Smrg
6955d9dcd5aeSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
6956d9dcd5aeSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6957d9dcd5aeSmrg        #     investigate it a little bit more. (MM)
6958d9dcd5aeSmrg        wlarc='${wl}'
6959d9dcd5aeSmrg
6960d9dcd5aeSmrg        # ancient GNU ld didn't support --whole-archive et. al.
6961d9dcd5aeSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6962d9dcd5aeSmrg	  $GREP 'no-whole-archive' > /dev/null; then
6963d9dcd5aeSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6964d9dcd5aeSmrg        else
6965d9dcd5aeSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6966d9dcd5aeSmrg        fi
6967d9dcd5aeSmrg      else
6968d9dcd5aeSmrg        with_gnu_ld=no
6969d9dcd5aeSmrg        wlarc=
6970ba064abeSmrg
6971d9dcd5aeSmrg        # A generic and very simple default shared library creation
6972d9dcd5aeSmrg        # command for GNU C++ for the case where it uses the native
6973d9dcd5aeSmrg        # linker, instead of GNU ld.  If possible, this setting should
6974d9dcd5aeSmrg        # overridden to take advantage of the native linker features on
6975d9dcd5aeSmrg        # the platform it is being used on.
6976d9dcd5aeSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6977d9dcd5aeSmrg      fi
6978d9dcd5aeSmrg
6979d9dcd5aeSmrg      # Commands to make compiler produce verbose output that lists
6980d9dcd5aeSmrg      # what "hidden" libraries, object files and flags are used when
6981d9dcd5aeSmrg      # linking a shared library.
6982d9dcd5aeSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6983d9dcd5aeSmrg
6984d9dcd5aeSmrg    else
6985d9dcd5aeSmrg      GXX=no
6986ba064abeSmrg      with_gnu_ld=no
6987d9dcd5aeSmrg      wlarc=
6988ba064abeSmrg    fi
6989b290cf36Smrg
6990d9dcd5aeSmrg    # PORTME: fill in a description of your system's C++ link characteristics
6991d9dcd5aeSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6992d9dcd5aeSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
6993ba064abeSmrg    case $host_os in
6994d9dcd5aeSmrg      aix3*)
6995d9dcd5aeSmrg        # FIXME: insert proper C++ library support
6996d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6997d9dcd5aeSmrg        ;;
6998d9dcd5aeSmrg      aix[[4-9]]*)
6999d9dcd5aeSmrg        if test "$host_cpu" = ia64; then
7000d9dcd5aeSmrg          # On IA64, the linker does run time linking by default, so we don't
7001d9dcd5aeSmrg          # have to do anything special.
7002d9dcd5aeSmrg          aix_use_runtimelinking=no
7003d9dcd5aeSmrg          exp_sym_flag='-Bexport'
7004d9dcd5aeSmrg          no_entry_flag=""
7005d9dcd5aeSmrg        else
7006d9dcd5aeSmrg          aix_use_runtimelinking=no
7007d9dcd5aeSmrg
7008d9dcd5aeSmrg          # Test if we are trying to use run time linking or normal
7009d9dcd5aeSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7010d9dcd5aeSmrg          # need to do runtime linking.
7011d9dcd5aeSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7012d9dcd5aeSmrg	    for ld_flag in $LDFLAGS; do
7013d9dcd5aeSmrg	      case $ld_flag in
7014d9dcd5aeSmrg	      *-brtl*)
7015d9dcd5aeSmrg	        aix_use_runtimelinking=yes
7016d9dcd5aeSmrg	        break
7017d9dcd5aeSmrg	        ;;
7018d9dcd5aeSmrg	      esac
7019d9dcd5aeSmrg	    done
7020ba064abeSmrg	    ;;
7021d9dcd5aeSmrg          esac
7022d9dcd5aeSmrg
7023d9dcd5aeSmrg          exp_sym_flag='-bexport'
7024d9dcd5aeSmrg          no_entry_flag='-bnoentry'
7025d9dcd5aeSmrg        fi
7026d9dcd5aeSmrg
7027d9dcd5aeSmrg        # When large executables or shared objects are built, AIX ld can
7028d9dcd5aeSmrg        # have problems creating the table of contents.  If linking a library
7029d9dcd5aeSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
7030d9dcd5aeSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7031d9dcd5aeSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7032d9dcd5aeSmrg
7033d9dcd5aeSmrg        _LT_TAGVAR(archive_cmds, $1)=''
7034d9dcd5aeSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
7035d9dcd5aeSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7036d9dcd5aeSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7037d9dcd5aeSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
7038d9dcd5aeSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7039d9dcd5aeSmrg
7040d9dcd5aeSmrg        if test "$GXX" = yes; then
7041d9dcd5aeSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7042d9dcd5aeSmrg          # We only want to do this on AIX 4.2 and lower, the check
7043d9dcd5aeSmrg          # below for broken collect2 doesn't work under 4.3+
7044d9dcd5aeSmrg	  collect2name=`${CC} -print-prog-name=collect2`
7045d9dcd5aeSmrg	  if test -f "$collect2name" &&
7046d9dcd5aeSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7047d9dcd5aeSmrg	  then
7048d9dcd5aeSmrg	    # We have reworked collect2
7049d9dcd5aeSmrg	    :
7050d9dcd5aeSmrg	  else
7051d9dcd5aeSmrg	    # We have old collect2
7052d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7053d9dcd5aeSmrg	    # It fails to find uninstalled libraries when the uninstalled
7054d9dcd5aeSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
7055d9dcd5aeSmrg	    # to unsupported forces relinking
7056d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7057d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7058d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7059d9dcd5aeSmrg	  fi
7060d9dcd5aeSmrg          esac
7061d9dcd5aeSmrg          shared_flag='-shared'
7062d9dcd5aeSmrg	  if test "$aix_use_runtimelinking" = yes; then
7063d9dcd5aeSmrg	    shared_flag="$shared_flag "'${wl}-G'
7064d9dcd5aeSmrg	  fi
7065d9dcd5aeSmrg        else
7066d9dcd5aeSmrg          # not using gcc
7067d9dcd5aeSmrg          if test "$host_cpu" = ia64; then
7068d9dcd5aeSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7069d9dcd5aeSmrg	  # chokes on -Wl,-G. The following line is correct:
7070d9dcd5aeSmrg	  shared_flag='-G'
7071d9dcd5aeSmrg          else
7072d9dcd5aeSmrg	    if test "$aix_use_runtimelinking" = yes; then
7073d9dcd5aeSmrg	      shared_flag='${wl}-G'
7074d9dcd5aeSmrg	    else
7075d9dcd5aeSmrg	      shared_flag='${wl}-bM:SRE'
7076d9dcd5aeSmrg	    fi
7077d9dcd5aeSmrg          fi
7078d9dcd5aeSmrg        fi
7079d9dcd5aeSmrg
7080d9dcd5aeSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7081d9dcd5aeSmrg        # It seems that -bexpall does not export symbols beginning with
7082d9dcd5aeSmrg        # underscore (_), so it is better to generate a list of symbols to
7083d9dcd5aeSmrg	# export.
7084d9dcd5aeSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
7085d9dcd5aeSmrg        if test "$aix_use_runtimelinking" = yes; then
7086d9dcd5aeSmrg          # Warning - without using the other runtime loading flags (-brtl),
7087d9dcd5aeSmrg          # -berok will link without error, but may produce a broken library.
7088d9dcd5aeSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7089d9dcd5aeSmrg          # Determine the default libpath from the value encoded in an empty
7090d9dcd5aeSmrg          # executable.
7091d9dcd5aeSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
7092d9dcd5aeSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7093d9dcd5aeSmrg
7094d9dcd5aeSmrg          _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"
7095d9dcd5aeSmrg        else
7096d9dcd5aeSmrg          if test "$host_cpu" = ia64; then
7097d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7098d9dcd5aeSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7099d9dcd5aeSmrg	    _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"
7100d9dcd5aeSmrg          else
7101d9dcd5aeSmrg	    # Determine the default libpath from the value encoded in an
7102d9dcd5aeSmrg	    # empty executable.
7103d9dcd5aeSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
7104d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7105d9dcd5aeSmrg	    # Warning - without using the other run time loading flags,
7106d9dcd5aeSmrg	    # -berok will link without error, but may produce a broken library.
7107d9dcd5aeSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7108d9dcd5aeSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7109d9dcd5aeSmrg	    if test "$with_gnu_ld" = yes; then
7110d9dcd5aeSmrg	      # We only use this code for GNU lds that support --whole-archive.
7111d9dcd5aeSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7112d9dcd5aeSmrg	    else
7113d9dcd5aeSmrg	      # Exported symbols can be pulled into shared objects from archives
7114d9dcd5aeSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7115d9dcd5aeSmrg	    fi
7116d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7117d9dcd5aeSmrg	    # This is similar to how AIX traditionally builds its shared
7118d9dcd5aeSmrg	    # libraries.
7119d9dcd5aeSmrg	    _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'
7120d9dcd5aeSmrg          fi
7121d9dcd5aeSmrg        fi
7122d9dcd5aeSmrg        ;;
7123d9dcd5aeSmrg
7124d9dcd5aeSmrg      beos*)
7125d9dcd5aeSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7126d9dcd5aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7127d9dcd5aeSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7128d9dcd5aeSmrg	  # support --undefined.  This deserves some investigation.  FIXME
7129d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7130d9dcd5aeSmrg	else
7131d9dcd5aeSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7132d9dcd5aeSmrg	fi
7133d9dcd5aeSmrg	;;
7134d9dcd5aeSmrg
7135d9dcd5aeSmrg      chorus*)
7136d9dcd5aeSmrg        case $cc_basename in
7137d9dcd5aeSmrg          *)
7138d9dcd5aeSmrg	  # FIXME: insert proper C++ library support
7139d9dcd5aeSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7140d9dcd5aeSmrg	  ;;
7141d9dcd5aeSmrg        esac
7142d9dcd5aeSmrg        ;;
7143d9dcd5aeSmrg
7144d9dcd5aeSmrg      cygwin* | mingw* | pw32* | cegcc*)
7145d9dcd5aeSmrg	case $GXX,$cc_basename in
7146d9dcd5aeSmrg	,cl* | no,cl*)
7147d9dcd5aeSmrg	  # Native MSVC
7148d9dcd5aeSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7149d9dcd5aeSmrg	  # no search path for DLLs.
7150d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7151d9dcd5aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7152d9dcd5aeSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
7153d9dcd5aeSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
7154d9dcd5aeSmrg	  # Tell ltmain to make .lib files, not .a files.
7155d9dcd5aeSmrg	  libext=lib
7156d9dcd5aeSmrg	  # Tell ltmain to make .dll files, not .so files.
7157d9dcd5aeSmrg	  shrext_cmds=".dll"
7158d9dcd5aeSmrg	  # FIXME: Setting linknames here is a bad hack.
7159d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7160d9dcd5aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7161d9dcd5aeSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7162d9dcd5aeSmrg	    else
7163d9dcd5aeSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7164d9dcd5aeSmrg	    fi~
7165d9dcd5aeSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7166d9dcd5aeSmrg	    linknames='
7167d9dcd5aeSmrg	  # The linker will not automatically build a static lib if we build a DLL.
7168d9dcd5aeSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7169d9dcd5aeSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7170d9dcd5aeSmrg	  # Don't use ranlib
7171d9dcd5aeSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7172d9dcd5aeSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7173d9dcd5aeSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7174d9dcd5aeSmrg	    case $lt_outputfile in
7175d9dcd5aeSmrg	      *.exe|*.EXE) ;;
7176d9dcd5aeSmrg	      *)
7177d9dcd5aeSmrg		lt_outputfile="$lt_outputfile.exe"
7178d9dcd5aeSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
7179d9dcd5aeSmrg		;;
7180d9dcd5aeSmrg	    esac~
7181d9dcd5aeSmrg	    func_to_tool_file "$lt_outputfile"~
7182d9dcd5aeSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7183d9dcd5aeSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7184d9dcd5aeSmrg	      $RM "$lt_outputfile.manifest";
7185d9dcd5aeSmrg	    fi'
7186d9dcd5aeSmrg	  ;;
7187d9dcd5aeSmrg	*)
7188d9dcd5aeSmrg	  # g++
7189d9dcd5aeSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7190d9dcd5aeSmrg	  # as there is no search path for DLLs.
7191d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7192d9dcd5aeSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7193d9dcd5aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7194d9dcd5aeSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
7195d9dcd5aeSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7196d9dcd5aeSmrg
7197d9dcd5aeSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7198d9dcd5aeSmrg	    _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'
7199d9dcd5aeSmrg	    # If the export-symbols file already is a .def file (1st line
7200d9dcd5aeSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
7201d9dcd5aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7202d9dcd5aeSmrg	      cp $export_symbols $output_objdir/$soname.def;
7203d9dcd5aeSmrg	    else
7204d9dcd5aeSmrg	      echo EXPORTS > $output_objdir/$soname.def;
7205d9dcd5aeSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
7206d9dcd5aeSmrg	    fi~
7207d9dcd5aeSmrg	    $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'
7208d9dcd5aeSmrg	  else
7209d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7210d9dcd5aeSmrg	  fi
7211d9dcd5aeSmrg	  ;;
7212ba064abeSmrg	esac
7213ba064abeSmrg	;;
7214d9dcd5aeSmrg      darwin* | rhapsody*)
7215d9dcd5aeSmrg        _LT_DARWIN_LINKER_FEATURES($1)
7216ba064abeSmrg	;;
7217b290cf36Smrg
7218d9dcd5aeSmrg      dgux*)
7219d9dcd5aeSmrg        case $cc_basename in
7220d9dcd5aeSmrg          ec++*)
7221d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7222d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7223d9dcd5aeSmrg	    ;;
7224d9dcd5aeSmrg          ghcx*)
7225d9dcd5aeSmrg	    # Green Hills C++ Compiler
7226d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7227d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7228d9dcd5aeSmrg	    ;;
7229d9dcd5aeSmrg          *)
7230d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7231d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7232d9dcd5aeSmrg	    ;;
7233d9dcd5aeSmrg        esac
7234d9dcd5aeSmrg        ;;
7235b290cf36Smrg
7236d9dcd5aeSmrg      freebsd2.*)
7237d9dcd5aeSmrg        # C++ shared libraries reported to be fairly broken before
7238d9dcd5aeSmrg	# switch to ELF
7239d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7240d9dcd5aeSmrg        ;;
7241b290cf36Smrg
7242d9dcd5aeSmrg      freebsd-elf*)
7243d9dcd5aeSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7244d9dcd5aeSmrg        ;;
7245b290cf36Smrg
7246d9dcd5aeSmrg      freebsd* | dragonfly*)
7247d9dcd5aeSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7248d9dcd5aeSmrg        # conventions
7249d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7250d9dcd5aeSmrg        ;;
7251b290cf36Smrg
7252d9dcd5aeSmrg      gnu*)
7253ba064abeSmrg        ;;
7254d9dcd5aeSmrg
7255d9dcd5aeSmrg      haiku*)
7256d9dcd5aeSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7257d9dcd5aeSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
7258ba064abeSmrg        ;;
7259b290cf36Smrg
7260d9dcd5aeSmrg      hpux9*)
7261d9dcd5aeSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7262d9dcd5aeSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7263d9dcd5aeSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7264d9dcd5aeSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
7265d9dcd5aeSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7266d9dcd5aeSmrg				             # but as the default
7267d9dcd5aeSmrg				             # location of the library.
7268b290cf36Smrg
7269d9dcd5aeSmrg        case $cc_basename in
7270d9dcd5aeSmrg          CC*)
7271d9dcd5aeSmrg            # FIXME: insert proper C++ library support
7272d9dcd5aeSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
7273d9dcd5aeSmrg            ;;
7274d9dcd5aeSmrg          aCC*)
7275d9dcd5aeSmrg            _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'
7276d9dcd5aeSmrg            # Commands to make compiler produce verbose output that lists
7277d9dcd5aeSmrg            # what "hidden" libraries, object files and flags are used when
7278d9dcd5aeSmrg            # linking a shared library.
7279d9dcd5aeSmrg            #
7280d9dcd5aeSmrg            # There doesn't appear to be a way to prevent this compiler from
7281d9dcd5aeSmrg            # explicitly linking system object files so we need to strip them
7282d9dcd5aeSmrg            # from the output so that they don't get included in the library
7283d9dcd5aeSmrg            # dependencies.
7284d9dcd5aeSmrg            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"'
7285d9dcd5aeSmrg            ;;
7286d9dcd5aeSmrg          *)
7287d9dcd5aeSmrg            if test "$GXX" = yes; then
7288d9dcd5aeSmrg              _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'
7289d9dcd5aeSmrg            else
7290d9dcd5aeSmrg              # FIXME: insert proper C++ library support
7291d9dcd5aeSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
7292d9dcd5aeSmrg            fi
7293d9dcd5aeSmrg            ;;
7294d9dcd5aeSmrg        esac
7295d9dcd5aeSmrg        ;;
7296b290cf36Smrg
7297d9dcd5aeSmrg      hpux10*|hpux11*)
7298d9dcd5aeSmrg        if test $with_gnu_ld = no; then
7299d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7300d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7301191cded7Smrg
7302d9dcd5aeSmrg          case $host_cpu in
7303d9dcd5aeSmrg            hppa*64*|ia64*)
7304d9dcd5aeSmrg              ;;
7305d9dcd5aeSmrg            *)
7306d9dcd5aeSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7307d9dcd5aeSmrg              ;;
7308d9dcd5aeSmrg          esac
7309d9dcd5aeSmrg        fi
7310d9dcd5aeSmrg        case $host_cpu in
7311d9dcd5aeSmrg          hppa*64*|ia64*)
7312d9dcd5aeSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
7313d9dcd5aeSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7314d9dcd5aeSmrg            ;;
7315d9dcd5aeSmrg          *)
7316d9dcd5aeSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
7317d9dcd5aeSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7318d9dcd5aeSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7319d9dcd5aeSmrg					         # but as the default
7320d9dcd5aeSmrg					         # location of the library.
7321d9dcd5aeSmrg            ;;
7322d9dcd5aeSmrg        esac
7323b290cf36Smrg
7324d9dcd5aeSmrg        case $cc_basename in
7325d9dcd5aeSmrg          CC*)
7326d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7327d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7328d9dcd5aeSmrg	    ;;
7329d9dcd5aeSmrg          aCC*)
7330d9dcd5aeSmrg	    case $host_cpu in
7331d9dcd5aeSmrg	      hppa*64*)
7332d9dcd5aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7333d9dcd5aeSmrg	        ;;
7334d9dcd5aeSmrg	      ia64*)
7335d9dcd5aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7336d9dcd5aeSmrg	        ;;
7337d9dcd5aeSmrg	      *)
7338d9dcd5aeSmrg	        _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'
7339d9dcd5aeSmrg	        ;;
7340d9dcd5aeSmrg	    esac
7341d9dcd5aeSmrg	    # Commands to make compiler produce verbose output that lists
7342d9dcd5aeSmrg	    # what "hidden" libraries, object files and flags are used when
7343d9dcd5aeSmrg	    # linking a shared library.
7344d9dcd5aeSmrg	    #
7345d9dcd5aeSmrg	    # There doesn't appear to be a way to prevent this compiler from
7346d9dcd5aeSmrg	    # explicitly linking system object files so we need to strip them
7347d9dcd5aeSmrg	    # from the output so that they don't get included in the library
7348d9dcd5aeSmrg	    # dependencies.
7349d9dcd5aeSmrg	    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"'
7350d9dcd5aeSmrg	    ;;
7351d9dcd5aeSmrg          *)
7352d9dcd5aeSmrg	    if test "$GXX" = yes; then
7353d9dcd5aeSmrg	      if test $with_gnu_ld = no; then
7354d9dcd5aeSmrg	        case $host_cpu in
7355d9dcd5aeSmrg	          hppa*64*)
7356d9dcd5aeSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7357d9dcd5aeSmrg	            ;;
7358d9dcd5aeSmrg	          ia64*)
7359d9dcd5aeSmrg	            _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'
7360d9dcd5aeSmrg	            ;;
7361d9dcd5aeSmrg	          *)
7362d9dcd5aeSmrg	            _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'
7363d9dcd5aeSmrg	            ;;
7364d9dcd5aeSmrg	        esac
7365d9dcd5aeSmrg	      fi
7366d9dcd5aeSmrg	    else
7367d9dcd5aeSmrg	      # FIXME: insert proper C++ library support
7368d9dcd5aeSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7369d9dcd5aeSmrg	    fi
7370d9dcd5aeSmrg	    ;;
7371d9dcd5aeSmrg        esac
7372d9dcd5aeSmrg        ;;
7373d9dcd5aeSmrg
7374d9dcd5aeSmrg      interix[[3-9]]*)
7375d9dcd5aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
7376d9dcd5aeSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7377d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7378d9dcd5aeSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7379d9dcd5aeSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7380d9dcd5aeSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
7381d9dcd5aeSmrg	# default) and relocated if they conflict, which is a slow very memory
7382d9dcd5aeSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
7383d9dcd5aeSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7384d9dcd5aeSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7385d9dcd5aeSmrg	_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'
7386d9dcd5aeSmrg	_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'
7387d9dcd5aeSmrg	;;
7388d9dcd5aeSmrg      irix5* | irix6*)
7389d9dcd5aeSmrg        case $cc_basename in
7390d9dcd5aeSmrg          CC*)
7391d9dcd5aeSmrg	    # SGI C++
7392d9dcd5aeSmrg	    _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'
7393d9dcd5aeSmrg
7394d9dcd5aeSmrg	    # Archives containing C++ object files must be created using
7395d9dcd5aeSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7396d9dcd5aeSmrg	    # necessary to make sure instantiated templates are included
7397d9dcd5aeSmrg	    # in the archive.
7398d9dcd5aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7399d9dcd5aeSmrg	    ;;
7400d9dcd5aeSmrg          *)
7401d9dcd5aeSmrg	    if test "$GXX" = yes; then
7402d9dcd5aeSmrg	      if test "$with_gnu_ld" = no; then
7403d9dcd5aeSmrg	        _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'
7404d9dcd5aeSmrg	      else
7405d9dcd5aeSmrg	        _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'
7406d9dcd5aeSmrg	      fi
7407d9dcd5aeSmrg	    fi
7408d9dcd5aeSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7409d9dcd5aeSmrg	    ;;
7410d9dcd5aeSmrg        esac
7411d9dcd5aeSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7412d9dcd5aeSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7413d9dcd5aeSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
7414d9dcd5aeSmrg        ;;
7415b290cf36Smrg
7416d9dcd5aeSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7417d9dcd5aeSmrg        case $cc_basename in
7418d9dcd5aeSmrg          KCC*)
7419d9dcd5aeSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7420b290cf36Smrg
7421d9dcd5aeSmrg	    # KCC will only create a shared library if the output file
7422d9dcd5aeSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7423d9dcd5aeSmrg	    # to its proper name (with version) after linking.
7424d9dcd5aeSmrg	    _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'
7425d9dcd5aeSmrg	    _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'
7426d9dcd5aeSmrg	    # Commands to make compiler produce verbose output that lists
7427d9dcd5aeSmrg	    # what "hidden" libraries, object files and flags are used when
7428d9dcd5aeSmrg	    # linking a shared library.
7429d9dcd5aeSmrg	    #
7430d9dcd5aeSmrg	    # There doesn't appear to be a way to prevent this compiler from
7431d9dcd5aeSmrg	    # explicitly linking system object files so we need to strip them
7432d9dcd5aeSmrg	    # from the output so that they don't get included in the library
7433d9dcd5aeSmrg	    # dependencies.
7434d9dcd5aeSmrg	    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"'
7435b290cf36Smrg
7436d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7437d9dcd5aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7438b290cf36Smrg
7439d9dcd5aeSmrg	    # Archives containing C++ object files must be created using
7440d9dcd5aeSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7441d9dcd5aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7442d9dcd5aeSmrg	    ;;
7443d9dcd5aeSmrg	  icpc* | ecpc* )
7444d9dcd5aeSmrg	    # Intel C++
7445d9dcd5aeSmrg	    with_gnu_ld=yes
7446d9dcd5aeSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
7447d9dcd5aeSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7448d9dcd5aeSmrg	    # earlier do not add the objects themselves.
7449d9dcd5aeSmrg	    case `$CC -V 2>&1` in
7450d9dcd5aeSmrg	      *"Version 7."*)
7451d9dcd5aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7452d9dcd5aeSmrg		_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'
7453d9dcd5aeSmrg		;;
7454d9dcd5aeSmrg	      *)  # Version 8.0 or newer
7455d9dcd5aeSmrg	        tmp_idyn=
7456d9dcd5aeSmrg	        case $host_cpu in
7457d9dcd5aeSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
7458d9dcd5aeSmrg		esac
7459d9dcd5aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7460d9dcd5aeSmrg		_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'
7461d9dcd5aeSmrg		;;
7462d9dcd5aeSmrg	    esac
7463d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7464d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7465d9dcd5aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7466d9dcd5aeSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7467d9dcd5aeSmrg	    ;;
7468d9dcd5aeSmrg          pgCC* | pgcpp*)
7469d9dcd5aeSmrg            # Portland Group C++ compiler
7470d9dcd5aeSmrg	    case `$CC -V` in
7471d9dcd5aeSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7472d9dcd5aeSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7473d9dcd5aeSmrg		rm -rf $tpldir~
7474d9dcd5aeSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7475d9dcd5aeSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7476d9dcd5aeSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7477d9dcd5aeSmrg		rm -rf $tpldir~
7478d9dcd5aeSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7479d9dcd5aeSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7480d9dcd5aeSmrg		$RANLIB $oldlib'
7481d9dcd5aeSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7482d9dcd5aeSmrg		rm -rf $tpldir~
7483d9dcd5aeSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7484d9dcd5aeSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7485d9dcd5aeSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7486d9dcd5aeSmrg		rm -rf $tpldir~
7487d9dcd5aeSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7488d9dcd5aeSmrg		$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'
7489d9dcd5aeSmrg	      ;;
7490d9dcd5aeSmrg	    *) # Version 6 and above use weak symbols
7491d9dcd5aeSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7492d9dcd5aeSmrg	      _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'
7493d9dcd5aeSmrg	      ;;
7494d9dcd5aeSmrg	    esac
7495b290cf36Smrg
7496d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7497d9dcd5aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7498d9dcd5aeSmrg	    _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'
7499d9dcd5aeSmrg            ;;
7500d9dcd5aeSmrg	  cxx*)
7501d9dcd5aeSmrg	    # Compaq C++
7502d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7503d9dcd5aeSmrg	    _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'
7504b290cf36Smrg
7505d9dcd5aeSmrg	    runpath_var=LD_RUN_PATH
7506d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7507d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7508b290cf36Smrg
7509d9dcd5aeSmrg	    # Commands to make compiler produce verbose output that lists
7510d9dcd5aeSmrg	    # what "hidden" libraries, object files and flags are used when
7511d9dcd5aeSmrg	    # linking a shared library.
7512d9dcd5aeSmrg	    #
7513d9dcd5aeSmrg	    # There doesn't appear to be a way to prevent this compiler from
7514d9dcd5aeSmrg	    # explicitly linking system object files so we need to strip them
7515d9dcd5aeSmrg	    # from the output so that they don't get included in the library
7516d9dcd5aeSmrg	    # dependencies.
7517d9dcd5aeSmrg	    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'
7518d9dcd5aeSmrg	    ;;
7519d9dcd5aeSmrg	  xl* | mpixl* | bgxl*)
7520d9dcd5aeSmrg	    # IBM XL 8.0 on PPC, with GNU ld
7521d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7522d9dcd5aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7523d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7524d9dcd5aeSmrg	    if test "x$supports_anon_versioning" = xyes; then
7525d9dcd5aeSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7526d9dcd5aeSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7527d9dcd5aeSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
7528d9dcd5aeSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7529d9dcd5aeSmrg	    fi
7530d9dcd5aeSmrg	    ;;
7531d9dcd5aeSmrg	  *)
7532d9dcd5aeSmrg	    case `$CC -V 2>&1 | sed 5q` in
7533d9dcd5aeSmrg	    *Sun\ C*)
7534d9dcd5aeSmrg	      # Sun C++ 5.9
7535d9dcd5aeSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7536d9dcd5aeSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7537d9dcd5aeSmrg	      _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'
7538d9dcd5aeSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7539d9dcd5aeSmrg	      _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'
7540d9dcd5aeSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7541b290cf36Smrg
7542d9dcd5aeSmrg	      # Not sure whether something based on
7543d9dcd5aeSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7544d9dcd5aeSmrg	      # would be better.
7545d9dcd5aeSmrg	      output_verbose_link_cmd='func_echo_all'
7546b290cf36Smrg
7547d9dcd5aeSmrg	      # Archives containing C++ object files must be created using
7548d9dcd5aeSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7549d9dcd5aeSmrg	      # necessary to make sure instantiated templates are included
7550d9dcd5aeSmrg	      # in the archive.
7551d9dcd5aeSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7552d9dcd5aeSmrg	      ;;
7553d9dcd5aeSmrg	    esac
7554d9dcd5aeSmrg	    ;;
7555d9dcd5aeSmrg	esac
7556d9dcd5aeSmrg	;;
7557b290cf36Smrg
7558d9dcd5aeSmrg      lynxos*)
7559d9dcd5aeSmrg        # FIXME: insert proper C++ library support
7560d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7561ba064abeSmrg	;;
7562d9dcd5aeSmrg
7563d9dcd5aeSmrg      m88k*)
7564d9dcd5aeSmrg        # FIXME: insert proper C++ library support
7565d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7566d9dcd5aeSmrg	;;
7567d9dcd5aeSmrg
7568d9dcd5aeSmrg      mvs*)
7569d9dcd5aeSmrg        case $cc_basename in
7570d9dcd5aeSmrg          cxx*)
7571d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7572ba064abeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7573d9dcd5aeSmrg	    ;;
7574d9dcd5aeSmrg	  *)
7575d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7576d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7577d9dcd5aeSmrg	    ;;
7578d9dcd5aeSmrg	esac
7579ba064abeSmrg	;;
7580b290cf36Smrg
7581d9dcd5aeSmrg      netbsd*)
7582d9dcd5aeSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7583d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7584d9dcd5aeSmrg	  wlarc=
7585d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7586d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7587d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7588d9dcd5aeSmrg	fi
7589d9dcd5aeSmrg	# Workaround some broken pre-1.5 toolchains
7590d9dcd5aeSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7591d9dcd5aeSmrg	;;
7592b290cf36Smrg
7593d9dcd5aeSmrg      *nto* | *qnx*)
7594d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7595d9dcd5aeSmrg	;;
7596b290cf36Smrg
7597d9dcd5aeSmrg      openbsd2*)
7598d9dcd5aeSmrg        # C++ shared libraries are fairly broken
7599d9dcd5aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7600d9dcd5aeSmrg	;;
7601b290cf36Smrg
7602d9dcd5aeSmrg      openbsd*)
7603d9dcd5aeSmrg	if test -f /usr/libexec/ld.so; then
7604d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7605d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7606d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7607d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7608d9dcd5aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7609d9dcd5aeSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7610d9dcd5aeSmrg	    _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'
7611d9dcd5aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7612d9dcd5aeSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7613d9dcd5aeSmrg	  fi
7614d9dcd5aeSmrg	  output_verbose_link_cmd=func_echo_all
7615ba064abeSmrg	else
7616d9dcd5aeSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7617ba064abeSmrg	fi
7618d9dcd5aeSmrg	;;
7619b290cf36Smrg
7620d9dcd5aeSmrg      osf3* | osf4* | osf5*)
7621d9dcd5aeSmrg        case $cc_basename in
7622d9dcd5aeSmrg          KCC*)
7623d9dcd5aeSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7624b290cf36Smrg
7625d9dcd5aeSmrg	    # KCC will only create a shared library if the output file
7626d9dcd5aeSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7627d9dcd5aeSmrg	    # to its proper name (with version) after linking.
7628d9dcd5aeSmrg	    _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'
7629b290cf36Smrg
7630d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7631d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7632b290cf36Smrg
7633d9dcd5aeSmrg	    # Archives containing C++ object files must be created using
7634d9dcd5aeSmrg	    # the KAI C++ compiler.
7635d9dcd5aeSmrg	    case $host in
7636d9dcd5aeSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7637d9dcd5aeSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7638d9dcd5aeSmrg	    esac
7639d9dcd5aeSmrg	    ;;
7640d9dcd5aeSmrg          RCC*)
7641d9dcd5aeSmrg	    # Rational C++ 2.4.1
7642d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7643d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7644d9dcd5aeSmrg	    ;;
7645d9dcd5aeSmrg          cxx*)
7646d9dcd5aeSmrg	    case $host in
7647d9dcd5aeSmrg	      osf3*)
7648d9dcd5aeSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7649d9dcd5aeSmrg	        _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'
7650d9dcd5aeSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7651d9dcd5aeSmrg		;;
7652d9dcd5aeSmrg	      *)
7653d9dcd5aeSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7654d9dcd5aeSmrg	        _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'
7655d9dcd5aeSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7656d9dcd5aeSmrg	          echo "-hidden">> $lib.exp~
7657d9dcd5aeSmrg	          $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~
7658d9dcd5aeSmrg	          $RM $lib.exp'
7659d9dcd5aeSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7660d9dcd5aeSmrg		;;
7661d9dcd5aeSmrg	    esac
7662b290cf36Smrg
7663d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7664b290cf36Smrg
7665d9dcd5aeSmrg	    # Commands to make compiler produce verbose output that lists
7666d9dcd5aeSmrg	    # what "hidden" libraries, object files and flags are used when
7667d9dcd5aeSmrg	    # linking a shared library.
7668d9dcd5aeSmrg	    #
7669d9dcd5aeSmrg	    # There doesn't appear to be a way to prevent this compiler from
7670d9dcd5aeSmrg	    # explicitly linking system object files so we need to strip them
7671d9dcd5aeSmrg	    # from the output so that they don't get included in the library
7672d9dcd5aeSmrg	    # dependencies.
7673d9dcd5aeSmrg	    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"'
7674d9dcd5aeSmrg	    ;;
7675d9dcd5aeSmrg	  *)
7676d9dcd5aeSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7677d9dcd5aeSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7678d9dcd5aeSmrg	      case $host in
7679d9dcd5aeSmrg	        osf3*)
7680d9dcd5aeSmrg	          _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'
7681d9dcd5aeSmrg		  ;;
7682d9dcd5aeSmrg	        *)
7683d9dcd5aeSmrg	          _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'
7684d9dcd5aeSmrg		  ;;
7685d9dcd5aeSmrg	      esac
7686b290cf36Smrg
7687d9dcd5aeSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7688d9dcd5aeSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7689d9dcd5aeSmrg
7690d9dcd5aeSmrg	      # Commands to make compiler produce verbose output that lists
7691d9dcd5aeSmrg	      # what "hidden" libraries, object files and flags are used when
7692d9dcd5aeSmrg	      # linking a shared library.
7693d9dcd5aeSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7694d9dcd5aeSmrg
7695d9dcd5aeSmrg	    else
7696d9dcd5aeSmrg	      # FIXME: insert proper C++ library support
7697d9dcd5aeSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7698d9dcd5aeSmrg	    fi
7699d9dcd5aeSmrg	    ;;
7700d9dcd5aeSmrg        esac
7701ba064abeSmrg        ;;
7702b290cf36Smrg
7703d9dcd5aeSmrg      psos*)
7704d9dcd5aeSmrg        # FIXME: insert proper C++ library support
7705d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7706d9dcd5aeSmrg        ;;
7707b290cf36Smrg
7708d9dcd5aeSmrg      sunos4*)
7709d9dcd5aeSmrg        case $cc_basename in
7710d9dcd5aeSmrg          CC*)
7711d9dcd5aeSmrg	    # Sun C++ 4.x
7712d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7713d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7714d9dcd5aeSmrg	    ;;
7715d9dcd5aeSmrg          lcc*)
7716d9dcd5aeSmrg	    # Lucid
7717d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7718d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7719d9dcd5aeSmrg	    ;;
7720d9dcd5aeSmrg          *)
7721d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7722d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7723d9dcd5aeSmrg	    ;;
7724d9dcd5aeSmrg        esac
7725d9dcd5aeSmrg        ;;
7726b290cf36Smrg
7727d9dcd5aeSmrg      solaris*)
7728d9dcd5aeSmrg        case $cc_basename in
7729d9dcd5aeSmrg          CC* | sunCC*)
7730d9dcd5aeSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
7731d9dcd5aeSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7732d9dcd5aeSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7733d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7734d9dcd5aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7735d9dcd5aeSmrg	      $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'
7736b290cf36Smrg
7737d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7738d9dcd5aeSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7739d9dcd5aeSmrg	    case $host_os in
7740d9dcd5aeSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7741d9dcd5aeSmrg	      *)
7742d9dcd5aeSmrg		# The compiler driver will combine and reorder linker options,
7743d9dcd5aeSmrg		# but understands `-z linker_flag'.
7744d9dcd5aeSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7745d9dcd5aeSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7746d9dcd5aeSmrg	        ;;
7747d9dcd5aeSmrg	    esac
7748d9dcd5aeSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7749b290cf36Smrg
7750d9dcd5aeSmrg	    output_verbose_link_cmd='func_echo_all'
7751b290cf36Smrg
7752d9dcd5aeSmrg	    # Archives containing C++ object files must be created using
7753d9dcd5aeSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7754d9dcd5aeSmrg	    # necessary to make sure instantiated templates are included
7755d9dcd5aeSmrg	    # in the archive.
7756d9dcd5aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7757d9dcd5aeSmrg	    ;;
7758d9dcd5aeSmrg          gcx*)
7759d9dcd5aeSmrg	    # Green Hills C++ Compiler
7760d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7761b290cf36Smrg
7762d9dcd5aeSmrg	    # The C++ compiler must be used to create the archive.
7763d9dcd5aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7764d9dcd5aeSmrg	    ;;
7765d9dcd5aeSmrg          *)
7766d9dcd5aeSmrg	    # GNU C++ compiler with Solaris linker
7767d9dcd5aeSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7768d9dcd5aeSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7769d9dcd5aeSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7770d9dcd5aeSmrg	        _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'
7771d9dcd5aeSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7772d9dcd5aeSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7773b290cf36Smrg
7774d9dcd5aeSmrg	        # Commands to make compiler produce verbose output that lists
7775d9dcd5aeSmrg	        # what "hidden" libraries, object files and flags are used when
7776d9dcd5aeSmrg	        # linking a shared library.
7777d9dcd5aeSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7778d9dcd5aeSmrg	      else
7779d9dcd5aeSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7780d9dcd5aeSmrg	        # platform.
7781d9dcd5aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7782d9dcd5aeSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7783d9dcd5aeSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7784b290cf36Smrg
7785d9dcd5aeSmrg	        # Commands to make compiler produce verbose output that lists
7786d9dcd5aeSmrg	        # what "hidden" libraries, object files and flags are used when
7787d9dcd5aeSmrg	        # linking a shared library.
7788d9dcd5aeSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7789d9dcd5aeSmrg	      fi
7790b290cf36Smrg
7791d9dcd5aeSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7792d9dcd5aeSmrg	      case $host_os in
7793d9dcd5aeSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7794d9dcd5aeSmrg		*)
7795d9dcd5aeSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7796d9dcd5aeSmrg		  ;;
7797d9dcd5aeSmrg	      esac
7798d9dcd5aeSmrg	    fi
7799d9dcd5aeSmrg	    ;;
7800d9dcd5aeSmrg        esac
7801d9dcd5aeSmrg        ;;
7802b290cf36Smrg
7803d9dcd5aeSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7804d9dcd5aeSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7805d9dcd5aeSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7806d9dcd5aeSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7807d9dcd5aeSmrg      runpath_var='LD_RUN_PATH'
7808b290cf36Smrg
7809d9dcd5aeSmrg      case $cc_basename in
7810d9dcd5aeSmrg        CC*)
7811d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7812d9dcd5aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7813ba064abeSmrg	  ;;
7814ba064abeSmrg	*)
7815d9dcd5aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7816d9dcd5aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7817ba064abeSmrg	  ;;
7818d9dcd5aeSmrg      esac
7819d9dcd5aeSmrg      ;;
7820b290cf36Smrg
7821d9dcd5aeSmrg      sysv5* | sco3.2v5* | sco5v6*)
7822d9dcd5aeSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
7823d9dcd5aeSmrg	# link with -lc, and that would cause any symbols used from libc to
7824d9dcd5aeSmrg	# always be unresolved, which means just about no library would
7825d9dcd5aeSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
7826d9dcd5aeSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
7827d9dcd5aeSmrg	# as -z defs.
7828d9dcd5aeSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7829d9dcd5aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7830d9dcd5aeSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7831d9dcd5aeSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7832d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7833d9dcd5aeSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7834d9dcd5aeSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7835d9dcd5aeSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7836d9dcd5aeSmrg	runpath_var='LD_RUN_PATH'
7837b290cf36Smrg
7838d9dcd5aeSmrg	case $cc_basename in
7839d9dcd5aeSmrg          CC*)
7840d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7841d9dcd5aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7842d9dcd5aeSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7843d9dcd5aeSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7844d9dcd5aeSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7845d9dcd5aeSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
7846d9dcd5aeSmrg	    ;;
7847d9dcd5aeSmrg	  *)
7848d9dcd5aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7849d9dcd5aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7850d9dcd5aeSmrg	    ;;
7851ba064abeSmrg	esac
7852ba064abeSmrg      ;;
7853b290cf36Smrg
7854d9dcd5aeSmrg      tandem*)
7855d9dcd5aeSmrg        case $cc_basename in
7856d9dcd5aeSmrg          NCC*)
7857d9dcd5aeSmrg	    # NonStop-UX NCC 3.20
7858d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7859d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7860d9dcd5aeSmrg	    ;;
7861d9dcd5aeSmrg          *)
7862d9dcd5aeSmrg	    # FIXME: insert proper C++ library support
7863d9dcd5aeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7864d9dcd5aeSmrg	    ;;
7865d9dcd5aeSmrg        esac
7866d9dcd5aeSmrg        ;;
7867b290cf36Smrg
7868d9dcd5aeSmrg      vxworks*)
7869d9dcd5aeSmrg        # FIXME: insert proper C++ library support
7870d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7871d9dcd5aeSmrg        ;;
7872b290cf36Smrg
7873d9dcd5aeSmrg      *)
7874d9dcd5aeSmrg        # FIXME: insert proper C++ library support
7875d9dcd5aeSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7876d9dcd5aeSmrg        ;;
7877d9dcd5aeSmrg    esac
7878b290cf36Smrg
7879d9dcd5aeSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7880d9dcd5aeSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7881b290cf36Smrg
7882d9dcd5aeSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
7883d9dcd5aeSmrg    _LT_TAGVAR(LD, $1)="$LD"
7884b290cf36Smrg
7885d9dcd5aeSmrg    ## CAVEAT EMPTOR:
7886d9dcd5aeSmrg    ## There is no encapsulation within the following macros, do not change
7887d9dcd5aeSmrg    ## the running order or otherwise move them around unless you know exactly
7888d9dcd5aeSmrg    ## what you are doing...
7889d9dcd5aeSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7890d9dcd5aeSmrg    _LT_COMPILER_PIC($1)
7891d9dcd5aeSmrg    _LT_COMPILER_C_O($1)
7892d9dcd5aeSmrg    _LT_COMPILER_FILE_LOCKS($1)
7893d9dcd5aeSmrg    _LT_LINKER_SHLIBS($1)
7894d9dcd5aeSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7895d9dcd5aeSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7896b290cf36Smrg
7897d9dcd5aeSmrg    _LT_CONFIG($1)
7898d9dcd5aeSmrg  fi # test -n "$compiler"
7899b290cf36Smrg
7900d9dcd5aeSmrg  CC=$lt_save_CC
7901d9dcd5aeSmrg  CFLAGS=$lt_save_CFLAGS
7902d9dcd5aeSmrg  LDCXX=$LD
7903d9dcd5aeSmrg  LD=$lt_save_LD
7904d9dcd5aeSmrg  GCC=$lt_save_GCC
7905d9dcd5aeSmrg  with_gnu_ld=$lt_save_with_gnu_ld
7906d9dcd5aeSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7907d9dcd5aeSmrg  lt_cv_path_LD=$lt_save_path_LD
7908d9dcd5aeSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7909d9dcd5aeSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7910d9dcd5aeSmrgfi # test "$_lt_caught_CXX_error" != yes
7911b290cf36Smrg
7912d9dcd5aeSmrgAC_LANG_POP
7913d9dcd5aeSmrg])# _LT_LANG_CXX_CONFIG
7914b290cf36Smrg
7915b290cf36Smrg
7916d9dcd5aeSmrg# _LT_FUNC_STRIPNAME_CNF
7917d9dcd5aeSmrg# ----------------------
7918d9dcd5aeSmrg# func_stripname_cnf prefix suffix name
7919d9dcd5aeSmrg# strip PREFIX and SUFFIX off of NAME.
7920d9dcd5aeSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7921d9dcd5aeSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7922d9dcd5aeSmrg# dot (in which case that matches only a dot).
7923d9dcd5aeSmrg#
7924d9dcd5aeSmrg# This function is identical to the (non-XSI) version of func_stripname,
7925d9dcd5aeSmrg# except this one can be used by m4 code that may be executed by configure,
7926d9dcd5aeSmrg# rather than the libtool script.
7927d9dcd5aeSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7928d9dcd5aeSmrgAC_REQUIRE([_LT_DECL_SED])
7929d9dcd5aeSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7930d9dcd5aeSmrgfunc_stripname_cnf ()
7931d9dcd5aeSmrg{
7932d9dcd5aeSmrg  case ${2} in
7933d9dcd5aeSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7934d9dcd5aeSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7935d9dcd5aeSmrg  esac
7936d9dcd5aeSmrg} # func_stripname_cnf
7937d9dcd5aeSmrg])# _LT_FUNC_STRIPNAME_CNF
7938b290cf36Smrg
7939d9dcd5aeSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7940d9dcd5aeSmrg# ---------------------------------
7941d9dcd5aeSmrg# Figure out "hidden" library dependencies from verbose
7942d9dcd5aeSmrg# compiler output when linking a shared library.
7943d9dcd5aeSmrg# Parse the compiler output and extract the necessary
7944d9dcd5aeSmrg# objects, libraries and library flags.
7945d9dcd5aeSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7946d9dcd5aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7947d9dcd5aeSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7948d9dcd5aeSmrg# Dependencies to place before and after the object being linked:
7949d9dcd5aeSmrg_LT_TAGVAR(predep_objects, $1)=
7950d9dcd5aeSmrg_LT_TAGVAR(postdep_objects, $1)=
7951d9dcd5aeSmrg_LT_TAGVAR(predeps, $1)=
7952d9dcd5aeSmrg_LT_TAGVAR(postdeps, $1)=
7953d9dcd5aeSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7954b290cf36Smrg
7955d9dcd5aeSmrgdnl we can't use the lt_simple_compile_test_code here,
7956d9dcd5aeSmrgdnl because it contains code intended for an executable,
7957d9dcd5aeSmrgdnl not a library.  It's possible we should let each
7958d9dcd5aeSmrgdnl tag define a new lt_????_link_test_code variable,
7959d9dcd5aeSmrgdnl but it's only used here...
7960d9dcd5aeSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7961d9dcd5aeSmrgint a;
7962d9dcd5aeSmrgvoid foo (void) { a = 0; }
7963d9dcd5aeSmrg_LT_EOF
7964d9dcd5aeSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7965d9dcd5aeSmrgclass Foo
7966d9dcd5aeSmrg{
7967d9dcd5aeSmrgpublic:
7968d9dcd5aeSmrg  Foo (void) { a = 0; }
7969d9dcd5aeSmrgprivate:
7970d9dcd5aeSmrg  int a;
7971d9dcd5aeSmrg};
7972d9dcd5aeSmrg_LT_EOF
7973d9dcd5aeSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7974d9dcd5aeSmrg      subroutine foo
7975d9dcd5aeSmrg      implicit none
7976d9dcd5aeSmrg      integer*4 a
7977d9dcd5aeSmrg      a=0
7978d9dcd5aeSmrg      return
7979d9dcd5aeSmrg      end
7980d9dcd5aeSmrg_LT_EOF
7981d9dcd5aeSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7982d9dcd5aeSmrg      subroutine foo
7983d9dcd5aeSmrg      implicit none
7984d9dcd5aeSmrg      integer a
7985d9dcd5aeSmrg      a=0
7986d9dcd5aeSmrg      return
7987d9dcd5aeSmrg      end
7988d9dcd5aeSmrg_LT_EOF
7989d9dcd5aeSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7990d9dcd5aeSmrgpublic class foo {
7991d9dcd5aeSmrg  private int a;
7992d9dcd5aeSmrg  public void bar (void) {
7993d9dcd5aeSmrg    a = 0;
7994d9dcd5aeSmrg  }
7995d9dcd5aeSmrg};
7996d9dcd5aeSmrg_LT_EOF
7997d9dcd5aeSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7998d9dcd5aeSmrgpackage foo
7999d9dcd5aeSmrgfunc foo() {
8000d9dcd5aeSmrg}
8001d9dcd5aeSmrg_LT_EOF
8002d9dcd5aeSmrg])
8003b290cf36Smrg
8004d9dcd5aeSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
8005d9dcd5aeSmrgcase "$CC $CFLAGS " in #(
8006d9dcd5aeSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8007d9dcd5aeSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8008d9dcd5aeSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8009d9dcd5aeSmrgesac
8010b290cf36Smrg
8011d9dcd5aeSmrgdnl Parse the compiler output and extract the necessary
8012d9dcd5aeSmrgdnl objects, libraries and library flags.
8013d9dcd5aeSmrgif AC_TRY_EVAL(ac_compile); then
8014d9dcd5aeSmrg  # Parse the compiler output and extract the necessary
8015d9dcd5aeSmrg  # objects, libraries and library flags.
8016b290cf36Smrg
8017d9dcd5aeSmrg  # Sentinel used to keep track of whether or not we are before
8018d9dcd5aeSmrg  # the conftest object file.
8019d9dcd5aeSmrg  pre_test_object_deps_done=no
8020b290cf36Smrg
8021d9dcd5aeSmrg  for p in `eval "$output_verbose_link_cmd"`; do
8022d9dcd5aeSmrg    case ${prev}${p} in
8023b290cf36Smrg
8024d9dcd5aeSmrg    -L* | -R* | -l*)
8025d9dcd5aeSmrg       # Some compilers place space between "-{L,R}" and the path.
8026d9dcd5aeSmrg       # Remove the space.
8027d9dcd5aeSmrg       if test $p = "-L" ||
8028d9dcd5aeSmrg          test $p = "-R"; then
8029d9dcd5aeSmrg	 prev=$p
8030d9dcd5aeSmrg	 continue
8031d9dcd5aeSmrg       fi
8032b290cf36Smrg
8033d9dcd5aeSmrg       # Expand the sysroot to ease extracting the directories later.
8034d9dcd5aeSmrg       if test -z "$prev"; then
8035d9dcd5aeSmrg         case $p in
8036d9dcd5aeSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8037d9dcd5aeSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8038d9dcd5aeSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8039d9dcd5aeSmrg         esac
8040d9dcd5aeSmrg       fi
8041d9dcd5aeSmrg       case $p in
8042d9dcd5aeSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8043d9dcd5aeSmrg       esac
8044d9dcd5aeSmrg       if test "$pre_test_object_deps_done" = no; then
8045d9dcd5aeSmrg	 case ${prev} in
8046d9dcd5aeSmrg	 -L | -R)
8047d9dcd5aeSmrg	   # Internal compiler library paths should come after those
8048d9dcd5aeSmrg	   # provided the user.  The postdeps already come after the
8049d9dcd5aeSmrg	   # user supplied libs so there is no need to process them.
8050d9dcd5aeSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8051d9dcd5aeSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8052d9dcd5aeSmrg	   else
8053d9dcd5aeSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8054d9dcd5aeSmrg	   fi
8055d9dcd5aeSmrg	   ;;
8056d9dcd5aeSmrg	 # The "-l" case would never come before the object being
8057d9dcd5aeSmrg	 # linked, so don't bother handling this case.
8058d9dcd5aeSmrg	 esac
8059d9dcd5aeSmrg       else
8060d9dcd5aeSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8061d9dcd5aeSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8062d9dcd5aeSmrg	 else
8063d9dcd5aeSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8064d9dcd5aeSmrg	 fi
8065d9dcd5aeSmrg       fi
8066d9dcd5aeSmrg       prev=
8067d9dcd5aeSmrg       ;;
8068b290cf36Smrg
8069d9dcd5aeSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
8070d9dcd5aeSmrg    *.$objext)
8071d9dcd5aeSmrg       # This assumes that the test object file only shows up
8072d9dcd5aeSmrg       # once in the compiler output.
8073d9dcd5aeSmrg       if test "$p" = "conftest.$objext"; then
8074d9dcd5aeSmrg	 pre_test_object_deps_done=yes
8075d9dcd5aeSmrg	 continue
8076d9dcd5aeSmrg       fi
8077b290cf36Smrg
8078d9dcd5aeSmrg       if test "$pre_test_object_deps_done" = no; then
8079d9dcd5aeSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8080d9dcd5aeSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
8081d9dcd5aeSmrg	 else
8082d9dcd5aeSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8083d9dcd5aeSmrg	 fi
8084d9dcd5aeSmrg       else
8085d9dcd5aeSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8086d9dcd5aeSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
8087d9dcd5aeSmrg	 else
8088d9dcd5aeSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8089d9dcd5aeSmrg	 fi
8090d9dcd5aeSmrg       fi
8091d9dcd5aeSmrg       ;;
8092b290cf36Smrg
8093d9dcd5aeSmrg    *) ;; # Ignore the rest.
8094b290cf36Smrg
8095d9dcd5aeSmrg    esac
8096d9dcd5aeSmrg  done
8097b290cf36Smrg
8098d9dcd5aeSmrg  # Clean up.
8099d9dcd5aeSmrg  rm -f a.out a.exe
8100d9dcd5aeSmrgelse
8101d9dcd5aeSmrg  echo "libtool.m4: error: problem compiling $1 test program"
8102d9dcd5aeSmrgfi
8103b290cf36Smrg
8104d9dcd5aeSmrg$RM -f confest.$objext
8105d9dcd5aeSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
8106ba064abeSmrg
8107d9dcd5aeSmrg# PORTME: override above test on systems where it is broken
8108d9dcd5aeSmrgm4_if([$1], [CXX],
8109d9dcd5aeSmrg[case $host_os in
8110d9dcd5aeSmrginterix[[3-9]]*)
8111d9dcd5aeSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8112d9dcd5aeSmrg  # hack all around it, let's just trust "g++" to DTRT.
8113d9dcd5aeSmrg  _LT_TAGVAR(predep_objects,$1)=
8114d9dcd5aeSmrg  _LT_TAGVAR(postdep_objects,$1)=
8115d9dcd5aeSmrg  _LT_TAGVAR(postdeps,$1)=
8116d9dcd5aeSmrg  ;;
8117d9dcd5aeSmrg
8118d9dcd5aeSmrglinux*)
8119d9dcd5aeSmrg  case `$CC -V 2>&1 | sed 5q` in
8120d9dcd5aeSmrg  *Sun\ C*)
8121d9dcd5aeSmrg    # Sun C++ 5.9
8122d9dcd5aeSmrg
8123d9dcd5aeSmrg    # The more standards-conforming stlport4 library is
8124d9dcd5aeSmrg    # incompatible with the Cstd library. Avoid specifying
8125d9dcd5aeSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
8126d9dcd5aeSmrg    # -library=stlport4 depends on it.
8127d9dcd5aeSmrg    case " $CXX $CXXFLAGS " in
8128d9dcd5aeSmrg    *" -library=stlport4 "*)
8129d9dcd5aeSmrg      solaris_use_stlport4=yes
8130ba064abeSmrg      ;;
8131ba064abeSmrg    esac
8132d9dcd5aeSmrg
8133d9dcd5aeSmrg    if test "$solaris_use_stlport4" != yes; then
8134d9dcd5aeSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8135d9dcd5aeSmrg    fi
8136d9dcd5aeSmrg    ;;
8137d9dcd5aeSmrg  esac
8138d9dcd5aeSmrg  ;;
8139d9dcd5aeSmrg
8140d9dcd5aeSmrgsolaris*)
8141d9dcd5aeSmrg  case $cc_basename in
8142d9dcd5aeSmrg  CC* | sunCC*)
8143d9dcd5aeSmrg    # The more standards-conforming stlport4 library is
8144d9dcd5aeSmrg    # incompatible with the Cstd library. Avoid specifying
8145d9dcd5aeSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
8146d9dcd5aeSmrg    # -library=stlport4 depends on it.
8147d9dcd5aeSmrg    case " $CXX $CXXFLAGS " in
8148d9dcd5aeSmrg    *" -library=stlport4 "*)
8149d9dcd5aeSmrg      solaris_use_stlport4=yes
8150d9dcd5aeSmrg      ;;
8151d9dcd5aeSmrg    esac
8152d9dcd5aeSmrg
8153d9dcd5aeSmrg    # Adding this requires a known-good setup of shared libraries for
8154d9dcd5aeSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
8155d9dcd5aeSmrg    # archive will be linked into the output, leading to subtle bugs.
8156d9dcd5aeSmrg    if test "$solaris_use_stlport4" != yes; then
8157d9dcd5aeSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8158d9dcd5aeSmrg    fi
8159d9dcd5aeSmrg    ;;
8160d9dcd5aeSmrg  esac
8161ba064abeSmrg  ;;
8162ba064abeSmrgesac
8163d9dcd5aeSmrg])
8164b290cf36Smrg
8165d9dcd5aeSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
8166d9dcd5aeSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8167d9dcd5aeSmrgesac
8168d9dcd5aeSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8169d9dcd5aeSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8170d9dcd5aeSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8171d9dcd5aeSmrgfi
8172d9dcd5aeSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8173d9dcd5aeSmrg    [The directories searched by this compiler when creating a shared library])
8174d9dcd5aeSmrg_LT_TAGDECL([], [predep_objects], [1],
8175d9dcd5aeSmrg    [Dependencies to place before and after the objects being linked to
8176d9dcd5aeSmrg    create a shared library])
8177d9dcd5aeSmrg_LT_TAGDECL([], [postdep_objects], [1])
8178d9dcd5aeSmrg_LT_TAGDECL([], [predeps], [1])
8179d9dcd5aeSmrg_LT_TAGDECL([], [postdeps], [1])
8180d9dcd5aeSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
8181d9dcd5aeSmrg    [The library search path used internally by the compiler when linking
8182d9dcd5aeSmrg    a shared library])
8183d9dcd5aeSmrg])# _LT_SYS_HIDDEN_LIBDEPS
8184b290cf36Smrg
8185b290cf36Smrg
8186d9dcd5aeSmrg# _LT_LANG_F77_CONFIG([TAG])
8187d9dcd5aeSmrg# --------------------------
8188d9dcd5aeSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
8189d9dcd5aeSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
8190d9dcd5aeSmrg# to write the compiler configuration to `libtool'.
8191d9dcd5aeSmrgm4_defun([_LT_LANG_F77_CONFIG],
8192d9dcd5aeSmrg[AC_LANG_PUSH(Fortran 77)
8193d9dcd5aeSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
8194d9dcd5aeSmrg  _lt_disable_F77=yes
8195d9dcd5aeSmrgfi
8196b290cf36Smrg
8197d9dcd5aeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8198d9dcd5aeSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
8199d9dcd5aeSmrg_LT_TAGVAR(always_export_symbols, $1)=no
8200d9dcd5aeSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8201d9dcd5aeSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8202d9dcd5aeSmrg_LT_TAGVAR(hardcode_direct, $1)=no
8203d9dcd5aeSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8204d9dcd5aeSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8205d9dcd5aeSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8206d9dcd5aeSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8207d9dcd5aeSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
8208d9dcd5aeSmrg_LT_TAGVAR(inherit_rpath, $1)=no
8209d9dcd5aeSmrg_LT_TAGVAR(module_cmds, $1)=
8210d9dcd5aeSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
8211d9dcd5aeSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8212d9dcd5aeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8213d9dcd5aeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8214d9dcd5aeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8215d9dcd5aeSmrg_LT_TAGVAR(no_undefined_flag, $1)=
8216d9dcd5aeSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8217d9dcd5aeSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8218191cded7Smrg
8219d9dcd5aeSmrg# Source file extension for f77 test sources.
8220d9dcd5aeSmrgac_ext=f
8221d9dcd5aeSmrg
8222d9dcd5aeSmrg# Object file extension for compiled f77 test sources.
8223b290cf36Smrgobjext=o
8224b290cf36Smrg_LT_TAGVAR(objext, $1)=$objext
8225191cded7Smrg
8226d9dcd5aeSmrg# No sense in running all these tests if we already determined that
8227d9dcd5aeSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
8228d9dcd5aeSmrg# are currently assumed to apply to all compilers on this platform,
8229d9dcd5aeSmrg# and will be corrupted by setting them based on a non-working compiler.
8230d9dcd5aeSmrgif test "$_lt_disable_F77" != yes; then
8231d9dcd5aeSmrg  # Code to be used in simple compile tests
8232d9dcd5aeSmrg  lt_simple_compile_test_code="\
8233d9dcd5aeSmrg      subroutine t
8234d9dcd5aeSmrg      return
8235d9dcd5aeSmrg      end
8236d9dcd5aeSmrg"
8237191cded7Smrg
8238d9dcd5aeSmrg  # Code to be used in simple link tests
8239d9dcd5aeSmrg  lt_simple_link_test_code="\
8240d9dcd5aeSmrg      program t
8241d9dcd5aeSmrg      end
8242d9dcd5aeSmrg"
8243191cded7Smrg
8244d9dcd5aeSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8245d9dcd5aeSmrg  _LT_TAG_COMPILER
8246191cded7Smrg
8247d9dcd5aeSmrg  # save warnings/boilerplate of simple test code
8248d9dcd5aeSmrg  _LT_COMPILER_BOILERPLATE
8249d9dcd5aeSmrg  _LT_LINKER_BOILERPLATE
8250191cded7Smrg
8251d9dcd5aeSmrg  # Allow CC to be a program name with arguments.
8252d9dcd5aeSmrg  lt_save_CC="$CC"
8253d9dcd5aeSmrg  lt_save_GCC=$GCC
8254d9dcd5aeSmrg  lt_save_CFLAGS=$CFLAGS
8255d9dcd5aeSmrg  CC=${F77-"f77"}
8256d9dcd5aeSmrg  CFLAGS=$FFLAGS
8257d9dcd5aeSmrg  compiler=$CC
8258d9dcd5aeSmrg  _LT_TAGVAR(compiler, $1)=$CC
8259d9dcd5aeSmrg  _LT_CC_BASENAME([$compiler])
8260d9dcd5aeSmrg  GCC=$G77
8261d9dcd5aeSmrg  if test -n "$compiler"; then
8262d9dcd5aeSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8263d9dcd5aeSmrg    AC_MSG_RESULT([$can_build_shared])
8264b290cf36Smrg
8265d9dcd5aeSmrg    AC_MSG_CHECKING([whether to build shared libraries])
8266d9dcd5aeSmrg    test "$can_build_shared" = "no" && enable_shared=no
8267d9dcd5aeSmrg
8268d9dcd5aeSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
8269d9dcd5aeSmrg    # are all built from PIC.
8270d9dcd5aeSmrg    case $host_os in
8271d9dcd5aeSmrg      aix3*)
8272d9dcd5aeSmrg        test "$enable_shared" = yes && enable_static=no
8273d9dcd5aeSmrg        if test -n "$RANLIB"; then
8274d9dcd5aeSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8275d9dcd5aeSmrg          postinstall_cmds='$RANLIB $lib'
8276d9dcd5aeSmrg        fi
8277d9dcd5aeSmrg        ;;
8278d9dcd5aeSmrg      aix[[4-9]]*)
8279d9dcd5aeSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8280d9dcd5aeSmrg	  test "$enable_shared" = yes && enable_static=no
8281d9dcd5aeSmrg	fi
8282d9dcd5aeSmrg        ;;
8283d9dcd5aeSmrg    esac
8284d9dcd5aeSmrg    AC_MSG_RESULT([$enable_shared])
8285b290cf36Smrg
8286d9dcd5aeSmrg    AC_MSG_CHECKING([whether to build static libraries])
8287d9dcd5aeSmrg    # Make sure either enable_shared or enable_static is yes.
8288d9dcd5aeSmrg    test "$enable_shared" = yes || enable_static=yes
8289d9dcd5aeSmrg    AC_MSG_RESULT([$enable_static])
8290b290cf36Smrg
8291d9dcd5aeSmrg    _LT_TAGVAR(GCC, $1)="$G77"
8292d9dcd5aeSmrg    _LT_TAGVAR(LD, $1)="$LD"
8293b290cf36Smrg
8294d9dcd5aeSmrg    ## CAVEAT EMPTOR:
8295d9dcd5aeSmrg    ## There is no encapsulation within the following macros, do not change
8296d9dcd5aeSmrg    ## the running order or otherwise move them around unless you know exactly
8297d9dcd5aeSmrg    ## what you are doing...
8298d9dcd5aeSmrg    _LT_COMPILER_PIC($1)
8299d9dcd5aeSmrg    _LT_COMPILER_C_O($1)
8300d9dcd5aeSmrg    _LT_COMPILER_FILE_LOCKS($1)
8301d9dcd5aeSmrg    _LT_LINKER_SHLIBS($1)
8302d9dcd5aeSmrg    _LT_SYS_DYNAMIC_LINKER($1)
8303d9dcd5aeSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8304191cded7Smrg
8305d9dcd5aeSmrg    _LT_CONFIG($1)
8306d9dcd5aeSmrg  fi # test -n "$compiler"
8307d9dcd5aeSmrg
8308d9dcd5aeSmrg  GCC=$lt_save_GCC
8309d9dcd5aeSmrg  CC="$lt_save_CC"
8310d9dcd5aeSmrg  CFLAGS="$lt_save_CFLAGS"
8311d9dcd5aeSmrgfi # test "$_lt_disable_F77" != yes
8312191cded7Smrg
8313ba064abeSmrgAC_LANG_POP
8314d9dcd5aeSmrg])# _LT_LANG_F77_CONFIG
8315191cded7Smrg
8316191cded7Smrg
8317d9dcd5aeSmrg# _LT_LANG_FC_CONFIG([TAG])
8318d9dcd5aeSmrg# -------------------------
8319d9dcd5aeSmrg# Ensure that the configuration variables for a Fortran compiler are
8320d9dcd5aeSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
8321d9dcd5aeSmrg# to write the compiler configuration to `libtool'.
8322d9dcd5aeSmrgm4_defun([_LT_LANG_FC_CONFIG],
8323d9dcd5aeSmrg[AC_LANG_PUSH(Fortran)
8324d9dcd5aeSmrg
8325d9dcd5aeSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
8326d9dcd5aeSmrg  _lt_disable_FC=yes
8327ba064abeSmrgfi
8328191cded7Smrg
8329ba064abeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8330ba064abeSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
8331ba064abeSmrg_LT_TAGVAR(always_export_symbols, $1)=no
8332ba064abeSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8333ba064abeSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8334ba064abeSmrg_LT_TAGVAR(hardcode_direct, $1)=no
8335ba064abeSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8336ba064abeSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8337ba064abeSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8338ba064abeSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8339ba064abeSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
8340ba064abeSmrg_LT_TAGVAR(inherit_rpath, $1)=no
8341ba064abeSmrg_LT_TAGVAR(module_cmds, $1)=
8342ba064abeSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
8343ba064abeSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8344ba064abeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8345ba064abeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8346ba064abeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8347ba064abeSmrg_LT_TAGVAR(no_undefined_flag, $1)=
8348ba064abeSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8349ba064abeSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8350191cded7Smrg
8351d9dcd5aeSmrg# Source file extension for fc test sources.
8352d9dcd5aeSmrgac_ext=${ac_fc_srcext-f}
8353191cded7Smrg
8354d9dcd5aeSmrg# Object file extension for compiled fc test sources.
8355ba064abeSmrgobjext=o
8356ba064abeSmrg_LT_TAGVAR(objext, $1)=$objext
8357191cded7Smrg
8358ba064abeSmrg# No sense in running all these tests if we already determined that
8359d9dcd5aeSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
8360ba064abeSmrg# are currently assumed to apply to all compilers on this platform,
8361ba064abeSmrg# and will be corrupted by setting them based on a non-working compiler.
8362d9dcd5aeSmrgif test "$_lt_disable_FC" != yes; then
8363ba064abeSmrg  # Code to be used in simple compile tests
8364d9dcd5aeSmrg  lt_simple_compile_test_code="\
8365d9dcd5aeSmrg      subroutine t
8366d9dcd5aeSmrg      return
8367d9dcd5aeSmrg      end
8368d9dcd5aeSmrg"
8369191cded7Smrg
8370ba064abeSmrg  # Code to be used in simple link tests
8371d9dcd5aeSmrg  lt_simple_link_test_code="\
8372d9dcd5aeSmrg      program t
8373d9dcd5aeSmrg      end
8374d9dcd5aeSmrg"
8375b290cf36Smrg
8376ba064abeSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8377ba064abeSmrg  _LT_TAG_COMPILER
8378191cded7Smrg
8379ba064abeSmrg  # save warnings/boilerplate of simple test code
8380ba064abeSmrg  _LT_COMPILER_BOILERPLATE
8381ba064abeSmrg  _LT_LINKER_BOILERPLATE
8382191cded7Smrg
8383ba064abeSmrg  # Allow CC to be a program name with arguments.
8384d9dcd5aeSmrg  lt_save_CC="$CC"
8385ba064abeSmrg  lt_save_GCC=$GCC
8386d9dcd5aeSmrg  lt_save_CFLAGS=$CFLAGS
8387d9dcd5aeSmrg  CC=${FC-"f95"}
8388d9dcd5aeSmrg  CFLAGS=$FCFLAGS
8389ba064abeSmrg  compiler=$CC
8390d9dcd5aeSmrg  GCC=$ac_cv_fc_compiler_gnu
8391d9dcd5aeSmrg
8392ba064abeSmrg  _LT_TAGVAR(compiler, $1)=$CC
8393ba064abeSmrg  _LT_CC_BASENAME([$compiler])
8394191cded7Smrg
8395ba064abeSmrg  if test -n "$compiler"; then
8396d9dcd5aeSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8397d9dcd5aeSmrg    AC_MSG_RESULT([$can_build_shared])
8398191cded7Smrg
8399d9dcd5aeSmrg    AC_MSG_CHECKING([whether to build shared libraries])
8400d9dcd5aeSmrg    test "$can_build_shared" = "no" && enable_shared=no
8401191cded7Smrg
8402d9dcd5aeSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
8403d9dcd5aeSmrg    # are all built from PIC.
8404d9dcd5aeSmrg    case $host_os in
8405d9dcd5aeSmrg      aix3*)
8406d9dcd5aeSmrg        test "$enable_shared" = yes && enable_static=no
8407d9dcd5aeSmrg        if test -n "$RANLIB"; then
8408d9dcd5aeSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8409d9dcd5aeSmrg          postinstall_cmds='$RANLIB $lib'
8410d9dcd5aeSmrg        fi
8411d9dcd5aeSmrg        ;;
8412d9dcd5aeSmrg      aix[[4-9]]*)
8413d9dcd5aeSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8414d9dcd5aeSmrg	  test "$enable_shared" = yes && enable_static=no
8415d9dcd5aeSmrg	fi
8416d9dcd5aeSmrg        ;;
8417d9dcd5aeSmrg    esac
8418d9dcd5aeSmrg    AC_MSG_RESULT([$enable_shared])
8419191cded7Smrg
8420d9dcd5aeSmrg    AC_MSG_CHECKING([whether to build static libraries])
8421d9dcd5aeSmrg    # Make sure either enable_shared or enable_static is yes.
8422d9dcd5aeSmrg    test "$enable_shared" = yes || enable_static=yes
8423d9dcd5aeSmrg    AC_MSG_RESULT([$enable_static])
8424191cded7Smrg
8425d9dcd5aeSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8426d9dcd5aeSmrg    _LT_TAGVAR(LD, $1)="$LD"
8427b290cf36Smrg
8428d9dcd5aeSmrg    ## CAVEAT EMPTOR:
8429d9dcd5aeSmrg    ## There is no encapsulation within the following macros, do not change
8430d9dcd5aeSmrg    ## the running order or otherwise move them around unless you know exactly
8431d9dcd5aeSmrg    ## what you are doing...
8432d9dcd5aeSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
8433d9dcd5aeSmrg    _LT_COMPILER_PIC($1)
8434d9dcd5aeSmrg    _LT_COMPILER_C_O($1)
8435d9dcd5aeSmrg    _LT_COMPILER_FILE_LOCKS($1)
8436d9dcd5aeSmrg    _LT_LINKER_SHLIBS($1)
8437d9dcd5aeSmrg    _LT_SYS_DYNAMIC_LINKER($1)
8438d9dcd5aeSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8439191cded7Smrg
8440d9dcd5aeSmrg    _LT_CONFIG($1)
8441d9dcd5aeSmrg  fi # test -n "$compiler"
8442191cded7Smrg
8443d9dcd5aeSmrg  GCC=$lt_save_GCC
8444d9dcd5aeSmrg  CC=$lt_save_CC
8445d9dcd5aeSmrg  CFLAGS=$lt_save_CFLAGS
8446d9dcd5aeSmrgfi # test "$_lt_disable_FC" != yes
8447191cded7Smrg
8448d9dcd5aeSmrgAC_LANG_POP
8449d9dcd5aeSmrg])# _LT_LANG_FC_CONFIG
8450191cded7Smrg
8451191cded7Smrg
8452d9dcd5aeSmrg# _LT_LANG_GCJ_CONFIG([TAG])
8453d9dcd5aeSmrg# --------------------------
8454d9dcd5aeSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
8455d9dcd5aeSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8456d9dcd5aeSmrg# to write the compiler configuration to `libtool'.
8457d9dcd5aeSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
8458d9dcd5aeSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
8459d9dcd5aeSmrgAC_LANG_SAVE
8460d9dcd5aeSmrg
8461d9dcd5aeSmrg# Source file extension for Java test sources.
8462d9dcd5aeSmrgac_ext=java
8463d9dcd5aeSmrg
8464d9dcd5aeSmrg# Object file extension for compiled Java test sources.
8465d9dcd5aeSmrgobjext=o
8466d9dcd5aeSmrg_LT_TAGVAR(objext, $1)=$objext
8467d9dcd5aeSmrg
8468d9dcd5aeSmrg# Code to be used in simple compile tests
8469d9dcd5aeSmrglt_simple_compile_test_code="class foo {}"
8470d9dcd5aeSmrg
8471d9dcd5aeSmrg# Code to be used in simple link tests
8472d9dcd5aeSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8473d9dcd5aeSmrg
8474d9dcd5aeSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8475d9dcd5aeSmrg_LT_TAG_COMPILER
8476d9dcd5aeSmrg
8477d9dcd5aeSmrg# save warnings/boilerplate of simple test code
8478d9dcd5aeSmrg_LT_COMPILER_BOILERPLATE
8479d9dcd5aeSmrg_LT_LINKER_BOILERPLATE
8480d9dcd5aeSmrg
8481d9dcd5aeSmrg# Allow CC to be a program name with arguments.
8482d9dcd5aeSmrglt_save_CC=$CC
8483d9dcd5aeSmrglt_save_CFLAGS=$CFLAGS
8484d9dcd5aeSmrglt_save_GCC=$GCC
8485d9dcd5aeSmrgGCC=yes
8486d9dcd5aeSmrgCC=${GCJ-"gcj"}
8487d9dcd5aeSmrgCFLAGS=$GCJFLAGS
8488d9dcd5aeSmrgcompiler=$CC
8489d9dcd5aeSmrg_LT_TAGVAR(compiler, $1)=$CC
8490d9dcd5aeSmrg_LT_TAGVAR(LD, $1)="$LD"
8491d9dcd5aeSmrg_LT_CC_BASENAME([$compiler])
8492191cded7Smrg
8493d9dcd5aeSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
8494d9dcd5aeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8495191cded7Smrg
8496d9dcd5aeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8497d9dcd5aeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8498d9dcd5aeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8499191cded7Smrg
8500d9dcd5aeSmrgif test -n "$compiler"; then
8501d9dcd5aeSmrg  _LT_COMPILER_NO_RTTI($1)
8502d9dcd5aeSmrg  _LT_COMPILER_PIC($1)
8503d9dcd5aeSmrg  _LT_COMPILER_C_O($1)
8504d9dcd5aeSmrg  _LT_COMPILER_FILE_LOCKS($1)
8505d9dcd5aeSmrg  _LT_LINKER_SHLIBS($1)
8506d9dcd5aeSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8507191cded7Smrg
8508d9dcd5aeSmrg  _LT_CONFIG($1)
8509d9dcd5aeSmrgfi
8510191cded7Smrg
8511d9dcd5aeSmrgAC_LANG_RESTORE
8512191cded7Smrg
8513d9dcd5aeSmrgGCC=$lt_save_GCC
8514d9dcd5aeSmrgCC=$lt_save_CC
8515d9dcd5aeSmrgCFLAGS=$lt_save_CFLAGS
8516d9dcd5aeSmrg])# _LT_LANG_GCJ_CONFIG
8517191cded7Smrg
8518b290cf36Smrg
8519d9dcd5aeSmrg# _LT_LANG_GO_CONFIG([TAG])
8520d9dcd5aeSmrg# --------------------------
8521d9dcd5aeSmrg# Ensure that the configuration variables for the GNU Go compiler
8522d9dcd5aeSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8523d9dcd5aeSmrg# to write the compiler configuration to `libtool'.
8524d9dcd5aeSmrgm4_defun([_LT_LANG_GO_CONFIG],
8525d9dcd5aeSmrg[AC_REQUIRE([LT_PROG_GO])dnl
8526d9dcd5aeSmrgAC_LANG_SAVE
8527b290cf36Smrg
8528d9dcd5aeSmrg# Source file extension for Go test sources.
8529d9dcd5aeSmrgac_ext=go
8530191cded7Smrg
8531d9dcd5aeSmrg# Object file extension for compiled Go test sources.
8532d9dcd5aeSmrgobjext=o
8533d9dcd5aeSmrg_LT_TAGVAR(objext, $1)=$objext
8534b290cf36Smrg
8535d9dcd5aeSmrg# Code to be used in simple compile tests
8536d9dcd5aeSmrglt_simple_compile_test_code="package main; func main() { }"
8537b290cf36Smrg
8538d9dcd5aeSmrg# Code to be used in simple link tests
8539d9dcd5aeSmrglt_simple_link_test_code='package main; func main() { }'
8540b290cf36Smrg
8541d9dcd5aeSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8542d9dcd5aeSmrg_LT_TAG_COMPILER
8543b290cf36Smrg
8544d9dcd5aeSmrg# save warnings/boilerplate of simple test code
8545d9dcd5aeSmrg_LT_COMPILER_BOILERPLATE
8546d9dcd5aeSmrg_LT_LINKER_BOILERPLATE
8547191cded7Smrg
8548d9dcd5aeSmrg# Allow CC to be a program name with arguments.
8549d9dcd5aeSmrglt_save_CC=$CC
8550d9dcd5aeSmrglt_save_CFLAGS=$CFLAGS
8551d9dcd5aeSmrglt_save_GCC=$GCC
8552d9dcd5aeSmrgGCC=yes
8553d9dcd5aeSmrgCC=${GOC-"gccgo"}
8554d9dcd5aeSmrgCFLAGS=$GOFLAGS
8555d9dcd5aeSmrgcompiler=$CC
8556d9dcd5aeSmrg_LT_TAGVAR(compiler, $1)=$CC
8557d9dcd5aeSmrg_LT_TAGVAR(LD, $1)="$LD"
8558d9dcd5aeSmrg_LT_CC_BASENAME([$compiler])
8559191cded7Smrg
8560d9dcd5aeSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
8561d9dcd5aeSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8562191cded7Smrg
8563d9dcd5aeSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8564d9dcd5aeSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8565d9dcd5aeSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8566191cded7Smrg
8567d9dcd5aeSmrgif test -n "$compiler"; then
8568d9dcd5aeSmrg  _LT_COMPILER_NO_RTTI($1)
8569d9dcd5aeSmrg  _LT_COMPILER_PIC($1)
8570d9dcd5aeSmrg  _LT_COMPILER_C_O($1)
8571d9dcd5aeSmrg  _LT_COMPILER_FILE_LOCKS($1)
8572d9dcd5aeSmrg  _LT_LINKER_SHLIBS($1)
8573d9dcd5aeSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8574191cded7Smrg
8575d9dcd5aeSmrg  _LT_CONFIG($1)
8576d9dcd5aeSmrgfi
8577191cded7Smrg
8578d9dcd5aeSmrgAC_LANG_RESTORE
8579191cded7Smrg
8580d9dcd5aeSmrgGCC=$lt_save_GCC
8581d9dcd5aeSmrgCC=$lt_save_CC
8582d9dcd5aeSmrgCFLAGS=$lt_save_CFLAGS
8583d9dcd5aeSmrg])# _LT_LANG_GO_CONFIG
8584191cded7Smrg
8585191cded7Smrg
8586d9dcd5aeSmrg# _LT_LANG_RC_CONFIG([TAG])
8587d9dcd5aeSmrg# -------------------------
8588d9dcd5aeSmrg# Ensure that the configuration variables for the Windows resource compiler
8589d9dcd5aeSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8590d9dcd5aeSmrg# to write the compiler configuration to `libtool'.
8591d9dcd5aeSmrgm4_defun([_LT_LANG_RC_CONFIG],
8592d9dcd5aeSmrg[AC_REQUIRE([LT_PROG_RC])dnl
8593d9dcd5aeSmrgAC_LANG_SAVE
8594191cded7Smrg
8595d9dcd5aeSmrg# Source file extension for RC test sources.
8596d9dcd5aeSmrgac_ext=rc
8597191cded7Smrg
8598d9dcd5aeSmrg# Object file extension for compiled RC test sources.
8599d9dcd5aeSmrgobjext=o
8600d9dcd5aeSmrg_LT_TAGVAR(objext, $1)=$objext
8601191cded7Smrg
8602d9dcd5aeSmrg# Code to be used in simple compile tests
8603d9dcd5aeSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8604191cded7Smrg
8605d9dcd5aeSmrg# Code to be used in simple link tests
8606d9dcd5aeSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
8607191cded7Smrg
8608d9dcd5aeSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8609d9dcd5aeSmrg_LT_TAG_COMPILER
8610191cded7Smrg
8611d9dcd5aeSmrg# save warnings/boilerplate of simple test code
8612d9dcd5aeSmrg_LT_COMPILER_BOILERPLATE
8613d9dcd5aeSmrg_LT_LINKER_BOILERPLATE
8614d9dcd5aeSmrg
8615d9dcd5aeSmrg# Allow CC to be a program name with arguments.
8616d9dcd5aeSmrglt_save_CC="$CC"
8617d9dcd5aeSmrglt_save_CFLAGS=$CFLAGS
8618d9dcd5aeSmrglt_save_GCC=$GCC
8619d9dcd5aeSmrgGCC=
8620d9dcd5aeSmrgCC=${RC-"windres"}
8621d9dcd5aeSmrgCFLAGS=
8622d9dcd5aeSmrgcompiler=$CC
8623d9dcd5aeSmrg_LT_TAGVAR(compiler, $1)=$CC
8624d9dcd5aeSmrg_LT_CC_BASENAME([$compiler])
8625d9dcd5aeSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8626d9dcd5aeSmrg
8627d9dcd5aeSmrgif test -n "$compiler"; then
8628d9dcd5aeSmrg  :
8629d9dcd5aeSmrg  _LT_CONFIG($1)
8630d9dcd5aeSmrgfi
8631d9dcd5aeSmrg
8632d9dcd5aeSmrgGCC=$lt_save_GCC
8633d9dcd5aeSmrgAC_LANG_RESTORE
8634d9dcd5aeSmrgCC=$lt_save_CC
8635d9dcd5aeSmrgCFLAGS=$lt_save_CFLAGS
8636d9dcd5aeSmrg])# _LT_LANG_RC_CONFIG
8637d9dcd5aeSmrg
8638d9dcd5aeSmrg
8639d9dcd5aeSmrg# LT_PROG_GCJ
8640d9dcd5aeSmrg# -----------
8641d9dcd5aeSmrgAC_DEFUN([LT_PROG_GCJ],
8642d9dcd5aeSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8643d9dcd5aeSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8644d9dcd5aeSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
8645d9dcd5aeSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8646d9dcd5aeSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
8647d9dcd5aeSmrg])
8648d9dcd5aeSmrg
8649d9dcd5aeSmrg# Old name:
8650d9dcd5aeSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8651d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
8652d9dcd5aeSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8653191cded7Smrg
8654191cded7Smrg
8655d9dcd5aeSmrg# LT_PROG_GO
8656d9dcd5aeSmrg# ----------
8657d9dcd5aeSmrgAC_DEFUN([LT_PROG_GO],
8658d9dcd5aeSmrg[AC_CHECK_TOOL(GOC, gccgo,)
8659d9dcd5aeSmrg])
8660191cded7Smrg
8661191cded7Smrg
8662d9dcd5aeSmrg# LT_PROG_RC
8663d9dcd5aeSmrg# ----------
8664d9dcd5aeSmrgAC_DEFUN([LT_PROG_RC],
8665d9dcd5aeSmrg[AC_CHECK_TOOL(RC, windres,)
8666d9dcd5aeSmrg])
8667191cded7Smrg
8668d9dcd5aeSmrg# Old name:
8669d9dcd5aeSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8670d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
8671d9dcd5aeSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8672191cded7Smrg
8673191cded7Smrg
8674d9dcd5aeSmrg# _LT_DECL_EGREP
8675d9dcd5aeSmrg# --------------
8676d9dcd5aeSmrg# If we don't have a new enough Autoconf to choose the best grep
8677d9dcd5aeSmrg# available, choose the one first in the user's PATH.
8678d9dcd5aeSmrgm4_defun([_LT_DECL_EGREP],
8679d9dcd5aeSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8680d9dcd5aeSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8681d9dcd5aeSmrgtest -z "$GREP" && GREP=grep
8682d9dcd5aeSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8683d9dcd5aeSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8684d9dcd5aeSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8685d9dcd5aeSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8686d9dcd5aeSmrgAC_SUBST([GREP])
8687d9dcd5aeSmrg])
8688191cded7Smrg
8689191cded7Smrg
8690d9dcd5aeSmrg# _LT_DECL_OBJDUMP
8691d9dcd5aeSmrg# --------------
8692d9dcd5aeSmrg# If we don't have a new enough Autoconf to choose the best objdump
8693d9dcd5aeSmrg# available, choose the one first in the user's PATH.
8694d9dcd5aeSmrgm4_defun([_LT_DECL_OBJDUMP],
8695d9dcd5aeSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8696d9dcd5aeSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8697d9dcd5aeSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8698d9dcd5aeSmrgAC_SUBST([OBJDUMP])
8699d9dcd5aeSmrg])
8700191cded7Smrg
8701d9dcd5aeSmrg# _LT_DECL_DLLTOOL
8702d9dcd5aeSmrg# ----------------
8703d9dcd5aeSmrg# Ensure DLLTOOL variable is set.
8704d9dcd5aeSmrgm4_defun([_LT_DECL_DLLTOOL],
8705d9dcd5aeSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8706d9dcd5aeSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8707d9dcd5aeSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8708d9dcd5aeSmrgAC_SUBST([DLLTOOL])
8709d9dcd5aeSmrg])
8710191cded7Smrg
8711d9dcd5aeSmrg# _LT_DECL_SED
8712d9dcd5aeSmrg# ------------
8713d9dcd5aeSmrg# Check for a fully-functional sed program, that truncates
8714d9dcd5aeSmrg# as few characters as possible.  Prefer GNU sed if found.
8715d9dcd5aeSmrgm4_defun([_LT_DECL_SED],
8716d9dcd5aeSmrg[AC_PROG_SED
8717d9dcd5aeSmrgtest -z "$SED" && SED=sed
8718d9dcd5aeSmrgXsed="$SED -e 1s/^X//"
8719d9dcd5aeSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8720d9dcd5aeSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8721d9dcd5aeSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8722d9dcd5aeSmrg])# _LT_DECL_SED
8723191cded7Smrg
8724d9dcd5aeSmrgm4_ifndef([AC_PROG_SED], [
8725d9dcd5aeSmrg# NOTE: This macro has been submitted for inclusion into   #
8726d9dcd5aeSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8727d9dcd5aeSmrg#  a released version of Autoconf we should remove this    #
8728d9dcd5aeSmrg#  macro and use it instead.                               #
8729191cded7Smrg
8730d9dcd5aeSmrgm4_defun([AC_PROG_SED],
8731d9dcd5aeSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8732d9dcd5aeSmrgAC_CACHE_VAL(lt_cv_path_SED,
8733d9dcd5aeSmrg[# Loop through the user's path and test for sed and gsed.
8734d9dcd5aeSmrg# Then use that list of sed's as ones to test for truncation.
8735d9dcd5aeSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8736d9dcd5aeSmrgfor as_dir in $PATH
8737d9dcd5aeSmrgdo
8738d9dcd5aeSmrg  IFS=$as_save_IFS
8739d9dcd5aeSmrg  test -z "$as_dir" && as_dir=.
8740d9dcd5aeSmrg  for lt_ac_prog in sed gsed; do
8741d9dcd5aeSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
8742d9dcd5aeSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8743d9dcd5aeSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8744d9dcd5aeSmrg      fi
8745d9dcd5aeSmrg    done
8746d9dcd5aeSmrg  done
8747d9dcd5aeSmrgdone
8748d9dcd5aeSmrgIFS=$as_save_IFS
8749d9dcd5aeSmrglt_ac_max=0
8750d9dcd5aeSmrglt_ac_count=0
8751d9dcd5aeSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8752d9dcd5aeSmrg# along with /bin/sed that truncates output.
8753d9dcd5aeSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8754d9dcd5aeSmrg  test ! -f $lt_ac_sed && continue
8755d9dcd5aeSmrg  cat /dev/null > conftest.in
8756d9dcd5aeSmrg  lt_ac_count=0
8757d9dcd5aeSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8758d9dcd5aeSmrg  # Check for GNU sed and select it if it is found.
8759d9dcd5aeSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8760d9dcd5aeSmrg    lt_cv_path_SED=$lt_ac_sed
8761d9dcd5aeSmrg    break
8762d9dcd5aeSmrg  fi
8763d9dcd5aeSmrg  while true; do
8764d9dcd5aeSmrg    cat conftest.in conftest.in >conftest.tmp
8765d9dcd5aeSmrg    mv conftest.tmp conftest.in
8766d9dcd5aeSmrg    cp conftest.in conftest.nl
8767d9dcd5aeSmrg    echo >>conftest.nl
8768d9dcd5aeSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8769d9dcd5aeSmrg    cmp -s conftest.out conftest.nl || break
8770d9dcd5aeSmrg    # 10000 chars as input seems more than enough
8771d9dcd5aeSmrg    test $lt_ac_count -gt 10 && break
8772d9dcd5aeSmrg    lt_ac_count=`expr $lt_ac_count + 1`
8773d9dcd5aeSmrg    if test $lt_ac_count -gt $lt_ac_max; then
8774d9dcd5aeSmrg      lt_ac_max=$lt_ac_count
8775d9dcd5aeSmrg      lt_cv_path_SED=$lt_ac_sed
8776d9dcd5aeSmrg    fi
8777d9dcd5aeSmrg  done
8778d9dcd5aeSmrgdone
8779d9dcd5aeSmrg])
8780d9dcd5aeSmrgSED=$lt_cv_path_SED
8781d9dcd5aeSmrgAC_SUBST([SED])
8782d9dcd5aeSmrgAC_MSG_RESULT([$SED])
8783d9dcd5aeSmrg])#AC_PROG_SED
8784d9dcd5aeSmrg])#m4_ifndef
8785191cded7Smrg
8786d9dcd5aeSmrg# Old name:
8787d9dcd5aeSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8788d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
8789d9dcd5aeSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8790191cded7Smrg
8791b290cf36Smrg
8792d9dcd5aeSmrg# _LT_CHECK_SHELL_FEATURES
8793d9dcd5aeSmrg# ------------------------
8794d9dcd5aeSmrg# Find out whether the shell is Bourne or XSI compatible,
8795d9dcd5aeSmrg# or has some other useful features.
8796d9dcd5aeSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8797d9dcd5aeSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8798d9dcd5aeSmrg# Try some XSI features
8799d9dcd5aeSmrgxsi_shell=no
8800d9dcd5aeSmrg( _lt_dummy="a/b/c"
8801d9dcd5aeSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8802d9dcd5aeSmrg      = c,a/b,b/c, \
8803d9dcd5aeSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
8804d9dcd5aeSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8805d9dcd5aeSmrg  && xsi_shell=yes
8806d9dcd5aeSmrgAC_MSG_RESULT([$xsi_shell])
8807d9dcd5aeSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8808191cded7Smrg
8809d9dcd5aeSmrgAC_MSG_CHECKING([whether the shell understands "+="])
8810d9dcd5aeSmrglt_shell_append=no
8811d9dcd5aeSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8812d9dcd5aeSmrg    >/dev/null 2>&1 \
8813d9dcd5aeSmrg  && lt_shell_append=yes
8814d9dcd5aeSmrgAC_MSG_RESULT([$lt_shell_append])
8815d9dcd5aeSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8816191cded7Smrg
8817d9dcd5aeSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8818d9dcd5aeSmrg  lt_unset=unset
8819d9dcd5aeSmrgelse
8820d9dcd5aeSmrg  lt_unset=false
8821d9dcd5aeSmrgfi
8822d9dcd5aeSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8823191cded7Smrg
8824d9dcd5aeSmrg# test EBCDIC or ASCII
8825d9dcd5aeSmrgcase `echo X|tr X '\101'` in
8826d9dcd5aeSmrg A) # ASCII based system
8827d9dcd5aeSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8828d9dcd5aeSmrg  lt_SP2NL='tr \040 \012'
8829d9dcd5aeSmrg  lt_NL2SP='tr \015\012 \040\040'
8830d9dcd5aeSmrg  ;;
8831d9dcd5aeSmrg *) # EBCDIC based system
8832d9dcd5aeSmrg  lt_SP2NL='tr \100 \n'
8833d9dcd5aeSmrg  lt_NL2SP='tr \r\n \100\100'
8834d9dcd5aeSmrg  ;;
8835d9dcd5aeSmrgesac
8836d9dcd5aeSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8837d9dcd5aeSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8838d9dcd5aeSmrg])# _LT_CHECK_SHELL_FEATURES
8839b290cf36Smrg
8840b290cf36Smrg
8841d9dcd5aeSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8842d9dcd5aeSmrg# ------------------------------------------------------
8843d9dcd5aeSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8844d9dcd5aeSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8845d9dcd5aeSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
8846d9dcd5aeSmrg[dnl {
8847d9dcd5aeSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
8848d9dcd5aeSmrg$1 ()\
8849d9dcd5aeSmrg{\
8850d9dcd5aeSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8851d9dcd5aeSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8852d9dcd5aeSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
8853d9dcd5aeSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8854d9dcd5aeSmrgtest 0 -eq $? || _lt_function_replace_fail=:
8855d9dcd5aeSmrg])
8856b290cf36Smrg
8857191cded7Smrg
8858d9dcd5aeSmrg# _LT_PROG_REPLACE_SHELLFNS
8859d9dcd5aeSmrg# -------------------------
8860d9dcd5aeSmrg# Replace existing portable implementations of several shell functions with
8861d9dcd5aeSmrg# equivalent extended shell implementations where those features are available..
8862d9dcd5aeSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
8863d9dcd5aeSmrg[if test x"$xsi_shell" = xyes; then
8864d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8865d9dcd5aeSmrg    case ${1} in
8866d9dcd5aeSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
8867d9dcd5aeSmrg      *  ) func_dirname_result="${3}" ;;
8868d9dcd5aeSmrg    esac])
8869d9dcd5aeSmrg
8870d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8871d9dcd5aeSmrg    func_basename_result="${1##*/}"])
8872d9dcd5aeSmrg
8873d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8874d9dcd5aeSmrg    case ${1} in
8875d9dcd5aeSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
8876d9dcd5aeSmrg      *  ) func_dirname_result="${3}" ;;
8877d9dcd5aeSmrg    esac
8878d9dcd5aeSmrg    func_basename_result="${1##*/}"])
8879191cded7Smrg
8880d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8881d9dcd5aeSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8882d9dcd5aeSmrg    # positional parameters, so assign one to ordinary parameter first.
8883d9dcd5aeSmrg    func_stripname_result=${3}
8884d9dcd5aeSmrg    func_stripname_result=${func_stripname_result#"${1}"}
8885d9dcd5aeSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
8886b290cf36Smrg
8887d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8888d9dcd5aeSmrg    func_split_long_opt_name=${1%%=*}
8889d9dcd5aeSmrg    func_split_long_opt_arg=${1#*=}])
8890b290cf36Smrg
8891d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8892d9dcd5aeSmrg    func_split_short_opt_arg=${1#??}
8893d9dcd5aeSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8894b290cf36Smrg
8895d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8896d9dcd5aeSmrg    case ${1} in
8897d9dcd5aeSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8898d9dcd5aeSmrg      *)    func_lo2o_result=${1} ;;
8899d9dcd5aeSmrg    esac])
8900b290cf36Smrg
8901d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8902b290cf36Smrg
8903d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8904191cded7Smrg
8905d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8906d9dcd5aeSmrgfi
8907191cded7Smrg
8908d9dcd5aeSmrgif test x"$lt_shell_append" = xyes; then
8909d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8910191cded7Smrg
8911d9dcd5aeSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8912d9dcd5aeSmrg    func_quote_for_eval "${2}"
8913d9dcd5aeSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8914d9dcd5aeSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8915b290cf36Smrg
8916d9dcd5aeSmrg  # Save a `func_append' function call where possible by direct use of '+='
8917d9dcd5aeSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8918d9dcd5aeSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
8919d9dcd5aeSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8920d9dcd5aeSmrg  test 0 -eq $? || _lt_function_replace_fail=:
8921d9dcd5aeSmrgelse
8922d9dcd5aeSmrg  # Save a `func_append' function call even when '+=' is not available
8923d9dcd5aeSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8924d9dcd5aeSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
8925d9dcd5aeSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8926d9dcd5aeSmrg  test 0 -eq $? || _lt_function_replace_fail=:
8927d9dcd5aeSmrgfi
8928b290cf36Smrg
8929d9dcd5aeSmrgif test x"$_lt_function_replace_fail" = x":"; then
8930d9dcd5aeSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8931d9dcd5aeSmrgfi
8932d9dcd5aeSmrg])
8933b290cf36Smrg
8934d9dcd5aeSmrg# _LT_PATH_CONVERSION_FUNCTIONS
8935d9dcd5aeSmrg# -----------------------------
8936d9dcd5aeSmrg# Determine which file name conversion functions should be used by
8937d9dcd5aeSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8938d9dcd5aeSmrg# for certain cross-compile configurations and native mingw.
8939d9dcd5aeSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8940d9dcd5aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8941d9dcd5aeSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8942d9dcd5aeSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8943d9dcd5aeSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8944d9dcd5aeSmrg[case $host in
8945d9dcd5aeSmrg  *-*-mingw* )
8946d9dcd5aeSmrg    case $build in
8947d9dcd5aeSmrg      *-*-mingw* ) # actually msys
8948d9dcd5aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8949ba064abeSmrg        ;;
8950d9dcd5aeSmrg      *-*-cygwin* )
8951d9dcd5aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8952d9dcd5aeSmrg        ;;
8953d9dcd5aeSmrg      * ) # otherwise, assume *nix
8954d9dcd5aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8955d9dcd5aeSmrg        ;;
8956d9dcd5aeSmrg    esac
8957d9dcd5aeSmrg    ;;
8958d9dcd5aeSmrg  *-*-cygwin* )
8959d9dcd5aeSmrg    case $build in
8960d9dcd5aeSmrg      *-*-mingw* ) # actually msys
8961d9dcd5aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8962d9dcd5aeSmrg        ;;
8963d9dcd5aeSmrg      *-*-cygwin* )
8964d9dcd5aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8965d9dcd5aeSmrg        ;;
8966d9dcd5aeSmrg      * ) # otherwise, assume *nix
8967d9dcd5aeSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8968d9dcd5aeSmrg        ;;
8969d9dcd5aeSmrg    esac
8970d9dcd5aeSmrg    ;;
8971d9dcd5aeSmrg  * ) # unhandled hosts (and "normal" native builds)
8972d9dcd5aeSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8973d9dcd5aeSmrg    ;;
8974d9dcd5aeSmrgesac
8975d9dcd5aeSmrg])
8976d9dcd5aeSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8977d9dcd5aeSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8978d9dcd5aeSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8979d9dcd5aeSmrg         [0], [convert $build file names to $host format])dnl
8980d9dcd5aeSmrg
8981d9dcd5aeSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8982d9dcd5aeSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8983d9dcd5aeSmrg[#assume ordinary cross tools, or native build.
8984d9dcd5aeSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
8985d9dcd5aeSmrgcase $host in
8986d9dcd5aeSmrg  *-*-mingw* )
8987d9dcd5aeSmrg    case $build in
8988d9dcd5aeSmrg      *-*-mingw* ) # actually msys
8989d9dcd5aeSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8990ba064abeSmrg        ;;
8991ba064abeSmrg    esac
8992d9dcd5aeSmrg    ;;
8993d9dcd5aeSmrgesac
8994d9dcd5aeSmrg])
8995d9dcd5aeSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8996d9dcd5aeSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8997d9dcd5aeSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8998d9dcd5aeSmrg         [0], [convert $build files to toolchain format])dnl
8999d9dcd5aeSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
9000b290cf36Smrg
9001d9dcd5aeSmrg# Helper functions for option handling.                    -*- Autoconf -*-
9002d9dcd5aeSmrg#
9003d9dcd5aeSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9004d9dcd5aeSmrg#   Inc.
9005d9dcd5aeSmrg#   Written by Gary V. Vaughan, 2004
9006d9dcd5aeSmrg#
9007d9dcd5aeSmrg# This file is free software; the Free Software Foundation gives
9008d9dcd5aeSmrg# unlimited permission to copy and/or distribute it, with or without
9009d9dcd5aeSmrg# modifications, as long as this notice is preserved.
9010b290cf36Smrg
9011d9dcd5aeSmrg# serial 7 ltoptions.m4
9012b290cf36Smrg
9013d9dcd5aeSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9014d9dcd5aeSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9015b290cf36Smrg
9016b290cf36Smrg
9017d9dcd5aeSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9018d9dcd5aeSmrg# ------------------------------------------
9019d9dcd5aeSmrgm4_define([_LT_MANGLE_OPTION],
9020d9dcd5aeSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9021b290cf36Smrg
9022b290cf36Smrg
9023d9dcd5aeSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9024d9dcd5aeSmrg# ---------------------------------------
9025d9dcd5aeSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9026d9dcd5aeSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9027d9dcd5aeSmrg# saved as a flag.
9028d9dcd5aeSmrgm4_define([_LT_SET_OPTION],
9029d9dcd5aeSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9030d9dcd5aeSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9031d9dcd5aeSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
9032d9dcd5aeSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
9033d9dcd5aeSmrg])
9034b290cf36Smrg
9035b290cf36Smrg
9036d9dcd5aeSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9037d9dcd5aeSmrg# ------------------------------------------------------------
9038d9dcd5aeSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9039d9dcd5aeSmrgm4_define([_LT_IF_OPTION],
9040d9dcd5aeSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9041b290cf36Smrg
9042b290cf36Smrg
9043d9dcd5aeSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9044d9dcd5aeSmrg# -------------------------------------------------------
9045d9dcd5aeSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9046d9dcd5aeSmrg# are set.
9047d9dcd5aeSmrgm4_define([_LT_UNLESS_OPTIONS],
9048d9dcd5aeSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9049d9dcd5aeSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9050d9dcd5aeSmrg		      [m4_define([$0_found])])])[]dnl
9051d9dcd5aeSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9052d9dcd5aeSmrg])[]dnl
9053d9dcd5aeSmrg])
9054b290cf36Smrg
9055b290cf36Smrg
9056d9dcd5aeSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9057d9dcd5aeSmrg# ----------------------------------------
9058d9dcd5aeSmrg# OPTION-LIST is a space-separated list of Libtool options associated
9059d9dcd5aeSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
9060d9dcd5aeSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9061d9dcd5aeSmrg# the unknown option and exit.
9062d9dcd5aeSmrgm4_defun([_LT_SET_OPTIONS],
9063d9dcd5aeSmrg[# Set options
9064d9dcd5aeSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9065d9dcd5aeSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
9066b290cf36Smrg
9067d9dcd5aeSmrgm4_if([$1],[LT_INIT],[
9068d9dcd5aeSmrg  dnl
9069d9dcd5aeSmrg  dnl Simply set some default values (i.e off) if boolean options were not
9070d9dcd5aeSmrg  dnl specified:
9071d9dcd5aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9072d9dcd5aeSmrg  ])
9073d9dcd5aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9074d9dcd5aeSmrg  ])
9075d9dcd5aeSmrg  dnl
9076d9dcd5aeSmrg  dnl If no reference was made to various pairs of opposing options, then
9077d9dcd5aeSmrg  dnl we run the default mode handler for the pair.  For example, if neither
9078d9dcd5aeSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9079d9dcd5aeSmrg  dnl archives by default:
9080d9dcd5aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9081d9dcd5aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9082d9dcd5aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9083d9dcd5aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9084d9dcd5aeSmrg  		   [_LT_ENABLE_FAST_INSTALL])
9085d9dcd5aeSmrg  ])
9086d9dcd5aeSmrg])# _LT_SET_OPTIONS
9087191cded7Smrg
9088191cded7Smrg
9089191cded7Smrg
9090d9dcd5aeSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9091d9dcd5aeSmrg# -----------------------------------------
9092d9dcd5aeSmrgm4_define([_LT_MANGLE_DEFUN],
9093d9dcd5aeSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9094191cded7Smrg
9095191cded7Smrg
9096d9dcd5aeSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9097d9dcd5aeSmrg# -----------------------------------------------
9098d9dcd5aeSmrgm4_define([LT_OPTION_DEFINE],
9099d9dcd5aeSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9100d9dcd5aeSmrg])# LT_OPTION_DEFINE
9101191cded7Smrg
9102191cded7Smrg
9103d9dcd5aeSmrg# dlopen
9104d9dcd5aeSmrg# ------
9105d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9106d9dcd5aeSmrg])
9107d9dcd5aeSmrg
9108d9dcd5aeSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
9109d9dcd5aeSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
9110d9dcd5aeSmrgAC_DIAGNOSE([obsolete],
9111d9dcd5aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9112d9dcd5aeSmrgput the `dlopen' option into LT_INIT's first parameter.])
9113d9dcd5aeSmrg])
9114191cded7Smrg
9115d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
9116d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9117b290cf36Smrg
9118b290cf36Smrg
9119d9dcd5aeSmrg# win32-dll
9120d9dcd5aeSmrg# ---------
9121d9dcd5aeSmrg# Declare package support for building win32 dll's.
9122d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
9123d9dcd5aeSmrg[enable_win32_dll=yes
9124b290cf36Smrg
9125d9dcd5aeSmrgcase $host in
9126d9dcd5aeSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9127d9dcd5aeSmrg  AC_CHECK_TOOL(AS, as, false)
9128d9dcd5aeSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9129d9dcd5aeSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9130ba064abeSmrg  ;;
9131ba064abeSmrgesac
9132b290cf36Smrg
9133d9dcd5aeSmrgtest -z "$AS" && AS=as
9134d9dcd5aeSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
9135191cded7Smrg
9136d9dcd5aeSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
9137d9dcd5aeSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9138b290cf36Smrg
9139d9dcd5aeSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
9140d9dcd5aeSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9141d9dcd5aeSmrg])# win32-dll
9142b290cf36Smrg
9143d9dcd5aeSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9144d9dcd5aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9145d9dcd5aeSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
9146d9dcd5aeSmrgAC_DIAGNOSE([obsolete],
9147d9dcd5aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9148d9dcd5aeSmrgput the `win32-dll' option into LT_INIT's first parameter.])
9149d9dcd5aeSmrg])
9150b290cf36Smrg
9151d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
9152d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9153b290cf36Smrg
9154191cded7Smrg
9155d9dcd5aeSmrg# _LT_ENABLE_SHARED([DEFAULT])
9156d9dcd5aeSmrg# ----------------------------
9157d9dcd5aeSmrg# implement the --enable-shared flag, and supports the `shared' and
9158d9dcd5aeSmrg# `disable-shared' LT_INIT options.
9159d9dcd5aeSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9160d9dcd5aeSmrgm4_define([_LT_ENABLE_SHARED],
9161d9dcd5aeSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9162d9dcd5aeSmrgAC_ARG_ENABLE([shared],
9163d9dcd5aeSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9164d9dcd5aeSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9165d9dcd5aeSmrg    [p=${PACKAGE-default}
9166d9dcd5aeSmrg    case $enableval in
9167d9dcd5aeSmrg    yes) enable_shared=yes ;;
9168d9dcd5aeSmrg    no) enable_shared=no ;;
9169d9dcd5aeSmrg    *)
9170d9dcd5aeSmrg      enable_shared=no
9171d9dcd5aeSmrg      # Look at the argument we got.  We use all the common list separators.
9172d9dcd5aeSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9173d9dcd5aeSmrg      for pkg in $enableval; do
9174d9dcd5aeSmrg	IFS="$lt_save_ifs"
9175d9dcd5aeSmrg	if test "X$pkg" = "X$p"; then
9176d9dcd5aeSmrg	  enable_shared=yes
9177d9dcd5aeSmrg	fi
9178d9dcd5aeSmrg      done
9179d9dcd5aeSmrg      IFS="$lt_save_ifs"
9180d9dcd5aeSmrg      ;;
9181d9dcd5aeSmrg    esac],
9182d9dcd5aeSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9183ba064abeSmrg
9184d9dcd5aeSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9185d9dcd5aeSmrg	[Whether or not to build shared libraries])
9186d9dcd5aeSmrg])# _LT_ENABLE_SHARED
9187ba064abeSmrg
9188d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9189d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9190ba064abeSmrg
9191d9dcd5aeSmrg# Old names:
9192d9dcd5aeSmrgAC_DEFUN([AC_ENABLE_SHARED],
9193d9dcd5aeSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9194d9dcd5aeSmrg])
9195ba064abeSmrg
9196d9dcd5aeSmrgAC_DEFUN([AC_DISABLE_SHARED],
9197d9dcd5aeSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
9198d9dcd5aeSmrg])
9199191cded7Smrg
9200d9dcd5aeSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9201d9dcd5aeSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9202b290cf36Smrg
9203d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
9204d9dcd5aeSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
9205d9dcd5aeSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
9206b290cf36Smrg
9207b290cf36Smrg
9208b290cf36Smrg
9209d9dcd5aeSmrg# _LT_ENABLE_STATIC([DEFAULT])
9210d9dcd5aeSmrg# ----------------------------
9211d9dcd5aeSmrg# implement the --enable-static flag, and support the `static' and
9212d9dcd5aeSmrg# `disable-static' LT_INIT options.
9213d9dcd5aeSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9214d9dcd5aeSmrgm4_define([_LT_ENABLE_STATIC],
9215d9dcd5aeSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9216d9dcd5aeSmrgAC_ARG_ENABLE([static],
9217d9dcd5aeSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9218d9dcd5aeSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9219d9dcd5aeSmrg    [p=${PACKAGE-default}
9220d9dcd5aeSmrg    case $enableval in
9221d9dcd5aeSmrg    yes) enable_static=yes ;;
9222d9dcd5aeSmrg    no) enable_static=no ;;
9223d9dcd5aeSmrg    *)
9224d9dcd5aeSmrg     enable_static=no
9225d9dcd5aeSmrg      # Look at the argument we got.  We use all the common list separators.
9226d9dcd5aeSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9227d9dcd5aeSmrg      for pkg in $enableval; do
9228d9dcd5aeSmrg	IFS="$lt_save_ifs"
9229d9dcd5aeSmrg	if test "X$pkg" = "X$p"; then
9230d9dcd5aeSmrg	  enable_static=yes
9231d9dcd5aeSmrg	fi
9232d9dcd5aeSmrg      done
9233d9dcd5aeSmrg      IFS="$lt_save_ifs"
9234d9dcd5aeSmrg      ;;
9235d9dcd5aeSmrg    esac],
9236d9dcd5aeSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9237b290cf36Smrg
9238d9dcd5aeSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
9239d9dcd5aeSmrg	[Whether or not to build static libraries])
9240d9dcd5aeSmrg])# _LT_ENABLE_STATIC
9241b290cf36Smrg
9242d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9243d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9244b290cf36Smrg
9245d9dcd5aeSmrg# Old names:
9246d9dcd5aeSmrgAC_DEFUN([AC_ENABLE_STATIC],
9247d9dcd5aeSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9248d9dcd5aeSmrg])
9249b290cf36Smrg
9250d9dcd5aeSmrgAC_DEFUN([AC_DISABLE_STATIC],
9251d9dcd5aeSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
9252d9dcd5aeSmrg])
9253b290cf36Smrg
9254d9dcd5aeSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9255d9dcd5aeSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9256b290cf36Smrg
9257d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
9258d9dcd5aeSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
9259d9dcd5aeSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
9260b290cf36Smrg
9261b290cf36Smrg
9262b290cf36Smrg
9263d9dcd5aeSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9264d9dcd5aeSmrg# ----------------------------------
9265d9dcd5aeSmrg# implement the --enable-fast-install flag, and support the `fast-install'
9266d9dcd5aeSmrg# and `disable-fast-install' LT_INIT options.
9267d9dcd5aeSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9268d9dcd5aeSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
9269d9dcd5aeSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9270d9dcd5aeSmrgAC_ARG_ENABLE([fast-install],
9271d9dcd5aeSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9272d9dcd5aeSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9273d9dcd5aeSmrg    [p=${PACKAGE-default}
9274d9dcd5aeSmrg    case $enableval in
9275d9dcd5aeSmrg    yes) enable_fast_install=yes ;;
9276d9dcd5aeSmrg    no) enable_fast_install=no ;;
9277d9dcd5aeSmrg    *)
9278d9dcd5aeSmrg      enable_fast_install=no
9279d9dcd5aeSmrg      # Look at the argument we got.  We use all the common list separators.
9280d9dcd5aeSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9281d9dcd5aeSmrg      for pkg in $enableval; do
9282d9dcd5aeSmrg	IFS="$lt_save_ifs"
9283d9dcd5aeSmrg	if test "X$pkg" = "X$p"; then
9284d9dcd5aeSmrg	  enable_fast_install=yes
9285d9dcd5aeSmrg	fi
9286d9dcd5aeSmrg      done
9287d9dcd5aeSmrg      IFS="$lt_save_ifs"
9288d9dcd5aeSmrg      ;;
9289d9dcd5aeSmrg    esac],
9290d9dcd5aeSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9291b290cf36Smrg
9292d9dcd5aeSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
9293d9dcd5aeSmrg	 [Whether or not to optimize for fast installation])dnl
9294d9dcd5aeSmrg])# _LT_ENABLE_FAST_INSTALL
9295ba064abeSmrg
9296d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9297d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9298b290cf36Smrg
9299d9dcd5aeSmrg# Old names:
9300d9dcd5aeSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
9301d9dcd5aeSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9302d9dcd5aeSmrgAC_DIAGNOSE([obsolete],
9303d9dcd5aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9304d9dcd5aeSmrgthe `fast-install' option into LT_INIT's first parameter.])
9305d9dcd5aeSmrg])
9306b290cf36Smrg
9307d9dcd5aeSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
9308d9dcd5aeSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9309d9dcd5aeSmrgAC_DIAGNOSE([obsolete],
9310d9dcd5aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9311d9dcd5aeSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
9312d9dcd5aeSmrg])
9313b290cf36Smrg
9314d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
9315d9dcd5aeSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9316d9dcd5aeSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9317b290cf36Smrg
9318b290cf36Smrg
9319d9dcd5aeSmrg# _LT_WITH_PIC([MODE])
9320d9dcd5aeSmrg# --------------------
9321d9dcd5aeSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9322d9dcd5aeSmrg# LT_INIT options.
9323d9dcd5aeSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9324d9dcd5aeSmrgm4_define([_LT_WITH_PIC],
9325d9dcd5aeSmrg[AC_ARG_WITH([pic],
9326d9dcd5aeSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9327d9dcd5aeSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9328d9dcd5aeSmrg    [lt_p=${PACKAGE-default}
9329d9dcd5aeSmrg    case $withval in
9330d9dcd5aeSmrg    yes|no) pic_mode=$withval ;;
9331d9dcd5aeSmrg    *)
9332d9dcd5aeSmrg      pic_mode=default
9333d9dcd5aeSmrg      # Look at the argument we got.  We use all the common list separators.
9334d9dcd5aeSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9335d9dcd5aeSmrg      for lt_pkg in $withval; do
9336d9dcd5aeSmrg	IFS="$lt_save_ifs"
9337d9dcd5aeSmrg	if test "X$lt_pkg" = "X$lt_p"; then
9338d9dcd5aeSmrg	  pic_mode=yes
9339ba064abeSmrg	fi
9340d9dcd5aeSmrg      done
9341d9dcd5aeSmrg      IFS="$lt_save_ifs"
9342d9dcd5aeSmrg      ;;
9343d9dcd5aeSmrg    esac],
9344d9dcd5aeSmrg    [pic_mode=default])
9345b290cf36Smrg
9346d9dcd5aeSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9347b290cf36Smrg
9348d9dcd5aeSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9349d9dcd5aeSmrg])# _LT_WITH_PIC
9350b290cf36Smrg
9351d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9352d9dcd5aeSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9353b290cf36Smrg
9354d9dcd5aeSmrg# Old name:
9355d9dcd5aeSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
9356d9dcd5aeSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
9357d9dcd5aeSmrgAC_DIAGNOSE([obsolete],
9358d9dcd5aeSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9359d9dcd5aeSmrgput the `pic-only' option into LT_INIT's first parameter.])
9360d9dcd5aeSmrg])
9361191cded7Smrg
9362d9dcd5aeSmrgdnl aclocal-1.4 backwards compatibility:
9363d9dcd5aeSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9364191cded7Smrg
9365191cded7Smrg
9366d9dcd5aeSmrgm4_define([_LTDL_MODE], [])
9367d9dcd5aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9368d9dcd5aeSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
9369d9dcd5aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
9370d9dcd5aeSmrg		 [m4_define([_LTDL_MODE], [recursive])])
9371d9dcd5aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
9372d9dcd5aeSmrg		 [m4_define([_LTDL_MODE], [subproject])])
9373191cded7Smrg
9374d9dcd5aeSmrgm4_define([_LTDL_TYPE], [])
9375d9dcd5aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
9376d9dcd5aeSmrg		 [m4_define([_LTDL_TYPE], [installable])])
9377d9dcd5aeSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
9378d9dcd5aeSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
9379191cded7Smrg
9380d9dcd5aeSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9381d9dcd5aeSmrg#
9382d9dcd5aeSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9383d9dcd5aeSmrg# Written by Gary V. Vaughan, 2004
9384d9dcd5aeSmrg#
9385d9dcd5aeSmrg# This file is free software; the Free Software Foundation gives
9386d9dcd5aeSmrg# unlimited permission to copy and/or distribute it, with or without
9387d9dcd5aeSmrg# modifications, as long as this notice is preserved.
9388b290cf36Smrg
9389d9dcd5aeSmrg# serial 6 ltsugar.m4
9390b290cf36Smrg
9391d9dcd5aeSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9392d9dcd5aeSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9393191cded7Smrg
9394191cded7Smrg
9395d9dcd5aeSmrg# lt_join(SEP, ARG1, [ARG2...])
9396d9dcd5aeSmrg# -----------------------------
9397d9dcd5aeSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9398d9dcd5aeSmrg# associated separator.
9399d9dcd5aeSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9400d9dcd5aeSmrg# versions in m4sugar had bugs.
9401d9dcd5aeSmrgm4_define([lt_join],
9402d9dcd5aeSmrg[m4_if([$#], [1], [],
9403d9dcd5aeSmrg       [$#], [2], [[$2]],
9404d9dcd5aeSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9405d9dcd5aeSmrgm4_define([_lt_join],
9406d9dcd5aeSmrg[m4_if([$#$2], [2], [],
9407d9dcd5aeSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9408191cded7Smrg
9409191cded7Smrg
9410d9dcd5aeSmrg# lt_car(LIST)
9411d9dcd5aeSmrg# lt_cdr(LIST)
9412d9dcd5aeSmrg# ------------
9413d9dcd5aeSmrg# Manipulate m4 lists.
9414d9dcd5aeSmrg# These macros are necessary as long as will still need to support
9415d9dcd5aeSmrg# Autoconf-2.59 which quotes differently.
9416d9dcd5aeSmrgm4_define([lt_car], [[$1]])
9417d9dcd5aeSmrgm4_define([lt_cdr],
9418d9dcd5aeSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9419d9dcd5aeSmrg       [$#], 1, [],
9420d9dcd5aeSmrg       [m4_dquote(m4_shift($@))])])
9421d9dcd5aeSmrgm4_define([lt_unquote], $1)
9422191cded7Smrg
9423191cded7Smrg
9424d9dcd5aeSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9425d9dcd5aeSmrg# ------------------------------------------
9426d9dcd5aeSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9427d9dcd5aeSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
9428d9dcd5aeSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9429d9dcd5aeSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9430d9dcd5aeSmrg# than defined and empty).
9431d9dcd5aeSmrg#
9432d9dcd5aeSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
9433d9dcd5aeSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9434d9dcd5aeSmrgm4_define([lt_append],
9435d9dcd5aeSmrg[m4_define([$1],
9436d9dcd5aeSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9437191cded7Smrg
9438191cded7Smrg
9439b290cf36Smrg
9440d9dcd5aeSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9441d9dcd5aeSmrg# ----------------------------------------------------------
9442d9dcd5aeSmrg# Produce a SEP delimited list of all paired combinations of elements of
9443d9dcd5aeSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9444d9dcd5aeSmrg# has the form PREFIXmINFIXSUFFIXn.
9445d9dcd5aeSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
9446d9dcd5aeSmrgm4_define([lt_combine],
9447d9dcd5aeSmrg[m4_if(m4_eval([$# > 3]), [1],
9448d9dcd5aeSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9449d9dcd5aeSmrg[[m4_foreach([_Lt_prefix], [$2],
9450d9dcd5aeSmrg	     [m4_foreach([_Lt_suffix],
9451d9dcd5aeSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9452d9dcd5aeSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9453b290cf36Smrg
9454b290cf36Smrg
9455d9dcd5aeSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9456d9dcd5aeSmrg# -----------------------------------------------------------------------
9457d9dcd5aeSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9458d9dcd5aeSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9459d9dcd5aeSmrgm4_define([lt_if_append_uniq],
9460d9dcd5aeSmrg[m4_ifdef([$1],
9461d9dcd5aeSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9462d9dcd5aeSmrg		 [lt_append([$1], [$2], [$3])$4],
9463d9dcd5aeSmrg		 [$5])],
9464d9dcd5aeSmrg	  [lt_append([$1], [$2], [$3])$4])])
9465191cded7Smrg
9466191cded7Smrg
9467d9dcd5aeSmrg# lt_dict_add(DICT, KEY, VALUE)
9468d9dcd5aeSmrg# -----------------------------
9469d9dcd5aeSmrgm4_define([lt_dict_add],
9470d9dcd5aeSmrg[m4_define([$1($2)], [$3])])
9471191cded7Smrg
9472191cded7Smrg
9473d9dcd5aeSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9474d9dcd5aeSmrg# --------------------------------------------
9475d9dcd5aeSmrgm4_define([lt_dict_add_subkey],
9476d9dcd5aeSmrg[m4_define([$1($2:$3)], [$4])])
9477191cded7Smrg
9478ba064abeSmrg
9479d9dcd5aeSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
9480d9dcd5aeSmrg# ----------------------------------
9481d9dcd5aeSmrgm4_define([lt_dict_fetch],
9482d9dcd5aeSmrg[m4_ifval([$3],
9483d9dcd5aeSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9484d9dcd5aeSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9485ba064abeSmrg
9486ba064abeSmrg
9487d9dcd5aeSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9488d9dcd5aeSmrg# -----------------------------------------------------------------
9489d9dcd5aeSmrgm4_define([lt_if_dict_fetch],
9490d9dcd5aeSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9491d9dcd5aeSmrg	[$5],
9492d9dcd5aeSmrg    [$6])])
9493ba064abeSmrg
9494ba064abeSmrg
9495d9dcd5aeSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9496d9dcd5aeSmrg# --------------------------------------------------------------
9497d9dcd5aeSmrgm4_define([lt_dict_filter],
9498d9dcd5aeSmrg[m4_if([$5], [], [],
9499d9dcd5aeSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9500d9dcd5aeSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9501d9dcd5aeSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9502b290cf36Smrg])
9503191cded7Smrg
9504d9dcd5aeSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
9505d9dcd5aeSmrg#
9506d9dcd5aeSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
9507d9dcd5aeSmrg#   Written by Scott James Remnant, 2004
9508d9dcd5aeSmrg#
9509d9dcd5aeSmrg# This file is free software; the Free Software Foundation gives
9510d9dcd5aeSmrg# unlimited permission to copy and/or distribute it, with or without
9511d9dcd5aeSmrg# modifications, as long as this notice is preserved.
9512191cded7Smrg
9513d9dcd5aeSmrg# @configure_input@
9514191cded7Smrg
9515d9dcd5aeSmrg# serial 3337 ltversion.m4
9516d9dcd5aeSmrg# This file is part of GNU Libtool
9517191cded7Smrg
9518d9dcd5aeSmrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
9519d9dcd5aeSmrgm4_define([LT_PACKAGE_REVISION], [1.3337])
9520191cded7Smrg
9521d9dcd5aeSmrgAC_DEFUN([LTVERSION_VERSION],
9522d9dcd5aeSmrg[macro_version='2.4.2'
9523d9dcd5aeSmrgmacro_revision='1.3337'
9524d9dcd5aeSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9525d9dcd5aeSmrg_LT_DECL(, macro_revision, 0)
9526ba064abeSmrg])
9527191cded7Smrg
9528d9dcd5aeSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9529d9dcd5aeSmrg#
9530d9dcd5aeSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9531d9dcd5aeSmrg#   Written by Scott James Remnant, 2004.
9532d9dcd5aeSmrg#
9533d9dcd5aeSmrg# This file is free software; the Free Software Foundation gives
9534d9dcd5aeSmrg# unlimited permission to copy and/or distribute it, with or without
9535d9dcd5aeSmrg# modifications, as long as this notice is preserved.
9536191cded7Smrg
9537d9dcd5aeSmrg# serial 5 lt~obsolete.m4
9538191cded7Smrg
9539d9dcd5aeSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
9540d9dcd5aeSmrg#
9541d9dcd5aeSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9542d9dcd5aeSmrg# which have later been changed to m4_define as they aren't part of the
9543d9dcd5aeSmrg# exported API, or moved to Autoconf or Automake where they belong.
9544d9dcd5aeSmrg#
9545d9dcd5aeSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9546d9dcd5aeSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9547d9dcd5aeSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
9548d9dcd5aeSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9549d9dcd5aeSmrg# and doesn't know about Autoconf macros at all.)
9550d9dcd5aeSmrg#
9551d9dcd5aeSmrg# So we provide this file, which has a silly filename so it's always
9552d9dcd5aeSmrg# included after everything else.  This provides aclocal with the
9553d9dcd5aeSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9554d9dcd5aeSmrg# because those macros already exist, or will be overwritten later.
9555d9dcd5aeSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9556d9dcd5aeSmrg#
9557d9dcd5aeSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9558d9dcd5aeSmrg# Yes, that means every name once taken will need to remain here until
9559d9dcd5aeSmrg# we give up compatibility with versions before 1.7, at which point
9560d9dcd5aeSmrg# we need to keep only those names which we still refer to.
9561191cded7Smrg
9562d9dcd5aeSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9563d9dcd5aeSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9564191cded7Smrg
9565d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9566d9dcd5aeSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9567d9dcd5aeSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9568d9dcd5aeSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9569d9dcd5aeSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9570d9dcd5aeSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9571d9dcd5aeSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9572d9dcd5aeSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9573d9dcd5aeSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9574d9dcd5aeSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9575d9dcd5aeSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9576d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9577d9dcd5aeSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9578d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9579d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9580d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9581d9dcd5aeSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9582d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9583d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9584d9dcd5aeSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9585d9dcd5aeSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9586d9dcd5aeSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9587d9dcd5aeSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9588d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9589d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9590d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9591d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9592d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9593d9dcd5aeSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9594d9dcd5aeSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9595d9dcd5aeSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9596d9dcd5aeSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9597d9dcd5aeSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9598d9dcd5aeSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9599d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9600d9dcd5aeSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9601d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9602d9dcd5aeSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9603d9dcd5aeSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9604d9dcd5aeSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9605d9dcd5aeSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9606d9dcd5aeSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9607d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9608d9dcd5aeSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9609d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9610d9dcd5aeSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9611d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9612d9dcd5aeSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9613d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9614d9dcd5aeSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9615d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9616d9dcd5aeSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9617d9dcd5aeSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9618d9dcd5aeSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9619d9dcd5aeSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9620d9dcd5aeSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9621d9dcd5aeSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9622d9dcd5aeSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9623d9dcd5aeSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9624d9dcd5aeSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9625d9dcd5aeSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9626191cded7Smrg
9627d9dcd5aeSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9628d9dcd5aeSmrg# 
9629d9dcd5aeSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9630d9dcd5aeSmrg#
9631d9dcd5aeSmrg# This program is free software; you can redistribute it and/or modify
9632d9dcd5aeSmrg# it under the terms of the GNU General Public License as published by
9633d9dcd5aeSmrg# the Free Software Foundation; either version 2 of the License, or
9634d9dcd5aeSmrg# (at your option) any later version.
9635d9dcd5aeSmrg#
9636d9dcd5aeSmrg# This program is distributed in the hope that it will be useful, but
9637d9dcd5aeSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
9638d9dcd5aeSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9639d9dcd5aeSmrg# General Public License for more details.
9640d9dcd5aeSmrg#
9641d9dcd5aeSmrg# You should have received a copy of the GNU General Public License
9642d9dcd5aeSmrg# along with this program; if not, write to the Free Software
9643d9dcd5aeSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9644d9dcd5aeSmrg#
9645d9dcd5aeSmrg# As a special exception to the GNU General Public License, if you
9646d9dcd5aeSmrg# distribute this file as part of a program that contains a
9647d9dcd5aeSmrg# configuration script generated by Autoconf, you may include it under
9648d9dcd5aeSmrg# the same distribution terms that you use for the rest of that program.
9649191cded7Smrg
9650d9dcd5aeSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9651d9dcd5aeSmrg# ----------------------------------
9652d9dcd5aeSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9653d9dcd5aeSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9654d9dcd5aeSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9655d9dcd5aeSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9656d9dcd5aeSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9657d9dcd5aeSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9658d9dcd5aeSmrgfi
9659d9dcd5aeSmrgif test -n "$PKG_CONFIG"; then
9660d9dcd5aeSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
9661d9dcd5aeSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9662d9dcd5aeSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9663d9dcd5aeSmrg		AC_MSG_RESULT([yes])
9664d9dcd5aeSmrg	else
9665d9dcd5aeSmrg		AC_MSG_RESULT([no])
9666d9dcd5aeSmrg		PKG_CONFIG=""
9667d9dcd5aeSmrg	fi
9668d9dcd5aeSmrg		
9669d9dcd5aeSmrgfi[]dnl
9670d9dcd5aeSmrg])# PKG_PROG_PKG_CONFIG
9671191cded7Smrg
9672d9dcd5aeSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9673d9dcd5aeSmrg#
9674d9dcd5aeSmrg# Check to see whether a particular set of modules exists.  Similar
9675d9dcd5aeSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9676d9dcd5aeSmrg#
9677d9dcd5aeSmrg#
9678d9dcd5aeSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
9679d9dcd5aeSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
9680d9dcd5aeSmrg# PKG_CHECK_EXISTS manually
9681d9dcd5aeSmrg# --------------------------------------------------------------
9682d9dcd5aeSmrgAC_DEFUN([PKG_CHECK_EXISTS],
9683d9dcd5aeSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9684d9dcd5aeSmrgif test -n "$PKG_CONFIG" && \
9685d9dcd5aeSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9686d9dcd5aeSmrg  m4_ifval([$2], [$2], [:])
9687d9dcd5aeSmrgm4_ifvaln([$3], [else
9688d9dcd5aeSmrg  $3])dnl
9689d9dcd5aeSmrgfi])
9690191cded7Smrg
9691191cded7Smrg
9692d9dcd5aeSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9693d9dcd5aeSmrg# ---------------------------------------------
9694d9dcd5aeSmrgm4_define([_PKG_CONFIG],
9695d9dcd5aeSmrg[if test -n "$$1"; then
9696d9dcd5aeSmrg    pkg_cv_[]$1="$$1"
9697d9dcd5aeSmrg elif test -n "$PKG_CONFIG"; then
9698d9dcd5aeSmrg    PKG_CHECK_EXISTS([$3],
9699d9dcd5aeSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9700d9dcd5aeSmrg		     [pkg_failed=yes])
9701d9dcd5aeSmrg else
9702d9dcd5aeSmrg    pkg_failed=untried
9703d9dcd5aeSmrgfi[]dnl
9704d9dcd5aeSmrg])# _PKG_CONFIG
9705191cded7Smrg
9706d9dcd5aeSmrg# _PKG_SHORT_ERRORS_SUPPORTED
9707d9dcd5aeSmrg# -----------------------------
9708d9dcd5aeSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9709d9dcd5aeSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9710d9dcd5aeSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9711d9dcd5aeSmrg        _pkg_short_errors_supported=yes
9712ba064abeSmrgelse
9713d9dcd5aeSmrg        _pkg_short_errors_supported=no
9714d9dcd5aeSmrgfi[]dnl
9715d9dcd5aeSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
9716d9dcd5aeSmrg
9717d9dcd5aeSmrg
9718d9dcd5aeSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9719d9dcd5aeSmrg# [ACTION-IF-NOT-FOUND])
9720d9dcd5aeSmrg#
9721d9dcd5aeSmrg#
9722d9dcd5aeSmrg# Note that if there is a possibility the first call to
9723d9dcd5aeSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
9724d9dcd5aeSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9725d9dcd5aeSmrg#
9726d9dcd5aeSmrg#
9727d9dcd5aeSmrg# --------------------------------------------------------------
9728d9dcd5aeSmrgAC_DEFUN([PKG_CHECK_MODULES],
9729d9dcd5aeSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9730d9dcd5aeSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9731d9dcd5aeSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9732191cded7Smrg
9733d9dcd5aeSmrgpkg_failed=no
9734d9dcd5aeSmrgAC_MSG_CHECKING([for $1])
9735191cded7Smrg
9736d9dcd5aeSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9737d9dcd5aeSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9738191cded7Smrg
9739d9dcd5aeSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9740d9dcd5aeSmrgand $1[]_LIBS to avoid the need to call pkg-config.
9741d9dcd5aeSmrgSee the pkg-config man page for more details.])
9742191cded7Smrg
9743d9dcd5aeSmrgif test $pkg_failed = yes; then
9744d9dcd5aeSmrg        _PKG_SHORT_ERRORS_SUPPORTED
9745d9dcd5aeSmrg        if test $_pkg_short_errors_supported = yes; then
9746d9dcd5aeSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9747d9dcd5aeSmrg        else 
9748d9dcd5aeSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9749d9dcd5aeSmrg        fi
9750d9dcd5aeSmrg	# Put the nasty error message in config.log where it belongs
9751d9dcd5aeSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9752191cded7Smrg
9753d9dcd5aeSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
9754d9dcd5aeSmrg[Package requirements ($2) were not met:
9755191cded7Smrg
9756d9dcd5aeSmrg$$1_PKG_ERRORS
9757191cded7Smrg
9758d9dcd5aeSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9759d9dcd5aeSmrginstalled software in a non-standard prefix.
9760191cded7Smrg
9761d9dcd5aeSmrg_PKG_TEXT
9762d9dcd5aeSmrg])],
9763d9dcd5aeSmrg		[AC_MSG_RESULT([no])
9764d9dcd5aeSmrg                $4])
9765d9dcd5aeSmrgelif test $pkg_failed = untried; then
9766d9dcd5aeSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
9767d9dcd5aeSmrg[The pkg-config script could not be found or is too old.  Make sure it
9768d9dcd5aeSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
9769d9dcd5aeSmrgpath to pkg-config.
9770191cded7Smrg
9771d9dcd5aeSmrg_PKG_TEXT
9772191cded7Smrg
9773d9dcd5aeSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9774d9dcd5aeSmrg		[$4])
9775d9dcd5aeSmrgelse
9776d9dcd5aeSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9777d9dcd5aeSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9778d9dcd5aeSmrg        AC_MSG_RESULT([yes])
9779d9dcd5aeSmrg	ifelse([$3], , :, [$3])
9780d9dcd5aeSmrgfi[]dnl
9781d9dcd5aeSmrg])# PKG_CHECK_MODULES
9782191cded7Smrg
9783d9dcd5aeSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9784d9dcd5aeSmrgdnl
9785d9dcd5aeSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9786d9dcd5aeSmrgdnl 
9787d9dcd5aeSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9788d9dcd5aeSmrgdnl copy of this software and associated documentation files (the "Software"),
9789d9dcd5aeSmrgdnl to deal in the Software without restriction, including without limitation
9790d9dcd5aeSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9791d9dcd5aeSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
9792d9dcd5aeSmrgdnl Software is furnished to do so, subject to the following conditions:
9793d9dcd5aeSmrgdnl
9794d9dcd5aeSmrgdnl The above copyright notice and this permission notice (including the next
9795d9dcd5aeSmrgdnl paragraph) shall be included in all copies or substantial portions of the
9796d9dcd5aeSmrgdnl Software.
9797d9dcd5aeSmrgdnl
9798d9dcd5aeSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9799d9dcd5aeSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9800d9dcd5aeSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9801d9dcd5aeSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9802d9dcd5aeSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9803d9dcd5aeSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9804d9dcd5aeSmrgdnl DEALINGS IN THE SOFTWARE.
9805ba064abeSmrg
9806d9dcd5aeSmrg# XORG_MACROS_VERSION(required-version)
9807d9dcd5aeSmrg# -------------------------------------
9808d9dcd5aeSmrg# Minimum version: 1.1.0
9809d9dcd5aeSmrg#
9810d9dcd5aeSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9811d9dcd5aeSmrg# your configure.ac with the minimum required version, such as:
9812d9dcd5aeSmrg# XORG_MACROS_VERSION(1.1)
9813d9dcd5aeSmrg#
9814d9dcd5aeSmrg# To ensure that this macro is defined, also add:
9815d9dcd5aeSmrg# m4_ifndef([XORG_MACROS_VERSION],
9816d9dcd5aeSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9817d9dcd5aeSmrg#
9818d9dcd5aeSmrg#
9819d9dcd5aeSmrg# See the "minimum version" comment for each macro you use to see what 
9820d9dcd5aeSmrg# version you require.
9821d9dcd5aeSmrgm4_defun([XORG_MACROS_VERSION],[
9822d9dcd5aeSmrgm4_define([vers_have], [1.17])
9823d9dcd5aeSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9824d9dcd5aeSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9825d9dcd5aeSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9826d9dcd5aeSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9827d9dcd5aeSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9828d9dcd5aeSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9829d9dcd5aeSmrgm4_undefine([vers_have])
9830d9dcd5aeSmrgm4_undefine([maj_have])
9831d9dcd5aeSmrgm4_undefine([maj_needed])
9832d9dcd5aeSmrg]) # XORG_MACROS_VERSION
9833ba064abeSmrg
9834d9dcd5aeSmrg# XORG_PROG_RAWCPP()
9835d9dcd5aeSmrg# ------------------
9836d9dcd5aeSmrg# Minimum version: 1.0.0
9837d9dcd5aeSmrg#
9838d9dcd5aeSmrg# Find cpp program and necessary flags for use in pre-processing text files
9839d9dcd5aeSmrg# such as man pages and config files
9840d9dcd5aeSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9841d9dcd5aeSmrgAC_REQUIRE([AC_PROG_CPP])
9842d9dcd5aeSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9843d9dcd5aeSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9844191cded7Smrg
9845d9dcd5aeSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9846d9dcd5aeSmrg# which is not the best choice for supporting other OS'es, but covers most
9847d9dcd5aeSmrg# of the ones we need for now.
9848d9dcd5aeSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9849d9dcd5aeSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9850d9dcd5aeSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9851d9dcd5aeSmrg	AC_MSG_RESULT([no])
9852d9dcd5aeSmrgelse
9853d9dcd5aeSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9854d9dcd5aeSmrg		RAWCPPFLAGS=-undef
9855d9dcd5aeSmrg		AC_MSG_RESULT([yes])
9856d9dcd5aeSmrg	# under Cygwin unix is still defined even with -undef
9857d9dcd5aeSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9858d9dcd5aeSmrg		RAWCPPFLAGS="-undef -ansi"
9859d9dcd5aeSmrg		AC_MSG_RESULT([yes, with -ansi])
9860d9dcd5aeSmrg	else
9861d9dcd5aeSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9862d9dcd5aeSmrg	fi
9863d9dcd5aeSmrgfi
9864d9dcd5aeSmrgrm -f conftest.$ac_ext
9865191cded7Smrg
9866d9dcd5aeSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9867d9dcd5aeSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9868d9dcd5aeSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9869d9dcd5aeSmrg	AC_MSG_RESULT([no])
9870d9dcd5aeSmrgelse
9871d9dcd5aeSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9872d9dcd5aeSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9873d9dcd5aeSmrg		AC_MSG_RESULT([yes])
9874d9dcd5aeSmrg	else
9875d9dcd5aeSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9876d9dcd5aeSmrg	fi
9877d9dcd5aeSmrgfi
9878d9dcd5aeSmrgrm -f conftest.$ac_ext
9879d9dcd5aeSmrgAC_SUBST(RAWCPPFLAGS)
9880d9dcd5aeSmrg]) # XORG_PROG_RAWCPP
9881191cded7Smrg
9882d9dcd5aeSmrg# XORG_MANPAGE_SECTIONS()
9883d9dcd5aeSmrg# -----------------------
9884d9dcd5aeSmrg# Minimum version: 1.0.0
9885d9dcd5aeSmrg#
9886d9dcd5aeSmrg# Determine which sections man pages go in for the different man page types
9887d9dcd5aeSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9888d9dcd5aeSmrg# Not sure if there's any better way than just hardcoding by OS name.
9889d9dcd5aeSmrg# Override default settings by setting environment variables
9890d9dcd5aeSmrg# Added MAN_SUBSTS in version 1.8
9891d9dcd5aeSmrg# Added AC_PROG_SED in version 1.8
9892191cded7Smrg
9893d9dcd5aeSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9894d9dcd5aeSmrgAC_REQUIRE([AC_CANONICAL_HOST])
9895d9dcd5aeSmrgAC_REQUIRE([AC_PROG_SED])
9896191cded7Smrg
9897d9dcd5aeSmrgif test x$APP_MAN_SUFFIX = x    ; then
9898d9dcd5aeSmrg    APP_MAN_SUFFIX=1
9899d9dcd5aeSmrgfi
9900d9dcd5aeSmrgif test x$APP_MAN_DIR = x    ; then
9901d9dcd5aeSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9902d9dcd5aeSmrgfi
9903191cded7Smrg
9904d9dcd5aeSmrgif test x$LIB_MAN_SUFFIX = x    ; then
9905d9dcd5aeSmrg    LIB_MAN_SUFFIX=3
9906d9dcd5aeSmrgfi
9907d9dcd5aeSmrgif test x$LIB_MAN_DIR = x    ; then
9908d9dcd5aeSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9909d9dcd5aeSmrgfi
9910ba064abeSmrg
9911d9dcd5aeSmrgif test x$FILE_MAN_SUFFIX = x    ; then
9912d9dcd5aeSmrg    case $host_os in
9913d9dcd5aeSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9914d9dcd5aeSmrg	*)		FILE_MAN_SUFFIX=5  ;;
9915d9dcd5aeSmrg    esac
9916d9dcd5aeSmrgfi
9917d9dcd5aeSmrgif test x$FILE_MAN_DIR = x    ; then
9918d9dcd5aeSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9919d9dcd5aeSmrgfi
9920ba064abeSmrg
9921d9dcd5aeSmrgif test x$MISC_MAN_SUFFIX = x    ; then
9922d9dcd5aeSmrg    case $host_os in
9923d9dcd5aeSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9924d9dcd5aeSmrg	*)		MISC_MAN_SUFFIX=7  ;;
9925d9dcd5aeSmrg    esac
9926d9dcd5aeSmrgfi
9927d9dcd5aeSmrgif test x$MISC_MAN_DIR = x    ; then
9928d9dcd5aeSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9929d9dcd5aeSmrgfi
9930ba064abeSmrg
9931d9dcd5aeSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9932d9dcd5aeSmrg    case $host_os in
9933d9dcd5aeSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9934d9dcd5aeSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9935d9dcd5aeSmrg    esac
9936d9dcd5aeSmrgfi
9937d9dcd5aeSmrgif test x$DRIVER_MAN_DIR = x    ; then
9938d9dcd5aeSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9939d9dcd5aeSmrgfi
9940ba064abeSmrg
9941d9dcd5aeSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9942d9dcd5aeSmrg    case $host_os in
9943d9dcd5aeSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9944d9dcd5aeSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9945d9dcd5aeSmrg    esac
9946d9dcd5aeSmrgfi
9947d9dcd5aeSmrgif test x$ADMIN_MAN_DIR = x    ; then
9948d9dcd5aeSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9949d9dcd5aeSmrgfi
9950ba064abeSmrg
9951ba064abeSmrg
9952d9dcd5aeSmrgAC_SUBST([APP_MAN_SUFFIX])
9953d9dcd5aeSmrgAC_SUBST([LIB_MAN_SUFFIX])
9954d9dcd5aeSmrgAC_SUBST([FILE_MAN_SUFFIX])
9955d9dcd5aeSmrgAC_SUBST([MISC_MAN_SUFFIX])
9956d9dcd5aeSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9957d9dcd5aeSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9958d9dcd5aeSmrgAC_SUBST([APP_MAN_DIR])
9959d9dcd5aeSmrgAC_SUBST([LIB_MAN_DIR])
9960d9dcd5aeSmrgAC_SUBST([FILE_MAN_DIR])
9961d9dcd5aeSmrgAC_SUBST([MISC_MAN_DIR])
9962d9dcd5aeSmrgAC_SUBST([DRIVER_MAN_DIR])
9963d9dcd5aeSmrgAC_SUBST([ADMIN_MAN_DIR])
9964ba064abeSmrg
9965d9dcd5aeSmrgXORG_MAN_PAGE="X Version 11"
9966d9dcd5aeSmrgAC_SUBST([XORG_MAN_PAGE])
9967d9dcd5aeSmrgMAN_SUBSTS="\
9968d9dcd5aeSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9969d9dcd5aeSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9970d9dcd5aeSmrg	-e 's|__xservername__|Xorg|g' \
9971d9dcd5aeSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
9972d9dcd5aeSmrg	-e 's|__projectroot__|\$(prefix)|g' \
9973d9dcd5aeSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9974d9dcd5aeSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9975d9dcd5aeSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9976d9dcd5aeSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9977d9dcd5aeSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9978d9dcd5aeSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9979d9dcd5aeSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9980d9dcd5aeSmrgAC_SUBST([MAN_SUBSTS])
9981ba064abeSmrg
9982d9dcd5aeSmrg]) # XORG_MANPAGE_SECTIONS
9983b290cf36Smrg
9984d9dcd5aeSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9985d9dcd5aeSmrg# ------------------------
9986d9dcd5aeSmrg# Minimum version: 1.7.0
9987ba064abeSmrg#
9988d9dcd5aeSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9989d9dcd5aeSmrg# provided by xorg-sgml-doctools, if installed.
9990d9dcd5aeSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9991d9dcd5aeSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9992d9dcd5aeSmrgXORG_SGML_PATH=
9993d9dcd5aeSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9994d9dcd5aeSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9995d9dcd5aeSmrg    [m4_ifval([$1],[:],
9996d9dcd5aeSmrg        [if test x"$cross_compiling" != x"yes" ; then
9997d9dcd5aeSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9998d9dcd5aeSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9999d9dcd5aeSmrg         fi])
10000d9dcd5aeSmrg    ])
10001191cded7Smrg
10002d9dcd5aeSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10003d9dcd5aeSmrg# the path and the name of the doc stylesheet
10004d9dcd5aeSmrgif test "x$XORG_SGML_PATH" != "x" ; then
10005d9dcd5aeSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
10006d9dcd5aeSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10007d9dcd5aeSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10008d9dcd5aeSmrgelse
10009d9dcd5aeSmrg   AC_MSG_RESULT([no])
10010d9dcd5aeSmrgfi
10011191cded7Smrg
10012d9dcd5aeSmrgAC_SUBST(XORG_SGML_PATH)
10013d9dcd5aeSmrgAC_SUBST(STYLESHEET_SRCDIR)
10014d9dcd5aeSmrgAC_SUBST(XSL_STYLESHEET)
10015d9dcd5aeSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10016d9dcd5aeSmrg]) # XORG_CHECK_SGML_DOCTOOLS
10017191cded7Smrg
10018d9dcd5aeSmrg# XORG_CHECK_LINUXDOC
10019d9dcd5aeSmrg# -------------------
10020d9dcd5aeSmrg# Minimum version: 1.0.0
10021d9dcd5aeSmrg#
10022d9dcd5aeSmrg# Defines the variable MAKE_TEXT if the necessary tools and
10023d9dcd5aeSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10024d9dcd5aeSmrg# Whether or not the necessary tools and files are found can be checked
10025d9dcd5aeSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10026d9dcd5aeSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
10027d9dcd5aeSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10028d9dcd5aeSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
10029191cded7Smrg
10030d9dcd5aeSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
10031191cded7Smrg
10032d9dcd5aeSmrgAC_MSG_CHECKING([whether to build documentation])
10033b290cf36Smrg
10034d9dcd5aeSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10035d9dcd5aeSmrg   BUILDDOC=yes
10036d9dcd5aeSmrgelse
10037d9dcd5aeSmrg   BUILDDOC=no
10038d9dcd5aeSmrgfi
10039191cded7Smrg
10040d9dcd5aeSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10041191cded7Smrg
10042d9dcd5aeSmrgAC_MSG_RESULT([$BUILDDOC])
10043b290cf36Smrg
10044d9dcd5aeSmrgAC_MSG_CHECKING([whether to build pdf documentation])
10045b290cf36Smrg
10046d9dcd5aeSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10047d9dcd5aeSmrg   BUILDPDFDOC=yes
10048d9dcd5aeSmrgelse
10049d9dcd5aeSmrg   BUILDPDFDOC=no
10050d9dcd5aeSmrgfi
10051191cded7Smrg
10052d9dcd5aeSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10053191cded7Smrg
10054d9dcd5aeSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10055191cded7Smrg
10056d9dcd5aeSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10057d9dcd5aeSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10058d9dcd5aeSmrgMAKE_PDF="$PS2PDF"
10059d9dcd5aeSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10060191cded7Smrg
10061d9dcd5aeSmrgAC_SUBST(MAKE_TEXT)
10062d9dcd5aeSmrgAC_SUBST(MAKE_PS)
10063d9dcd5aeSmrgAC_SUBST(MAKE_PDF)
10064d9dcd5aeSmrgAC_SUBST(MAKE_HTML)
10065d9dcd5aeSmrg]) # XORG_CHECK_LINUXDOC
10066191cded7Smrg
10067d9dcd5aeSmrg# XORG_CHECK_DOCBOOK
10068d9dcd5aeSmrg# -------------------
10069d9dcd5aeSmrg# Minimum version: 1.0.0
10070d9dcd5aeSmrg#
10071d9dcd5aeSmrg# Checks for the ability to build output formats from SGML DocBook source.
10072d9dcd5aeSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10073d9dcd5aeSmrg# indicates whether the necessary tools and files are found and, if set,
10074d9dcd5aeSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10075d9dcd5aeSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
10076d9dcd5aeSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10077191cded7Smrg
10078d9dcd5aeSmrgBUILDTXTDOC=no
10079d9dcd5aeSmrgBUILDPDFDOC=no
10080d9dcd5aeSmrgBUILDPSDOC=no
10081d9dcd5aeSmrgBUILDHTMLDOC=no
10082191cded7Smrg
10083d9dcd5aeSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
10084d9dcd5aeSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10085d9dcd5aeSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
10086d9dcd5aeSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10087b290cf36Smrg
10088d9dcd5aeSmrgAC_MSG_CHECKING([whether to build text documentation])
10089d9dcd5aeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10090d9dcd5aeSmrg   test x$BUILD_TXTDOC != xno; then
10091d9dcd5aeSmrg	BUILDTXTDOC=yes
10092d9dcd5aeSmrgfi
10093d9dcd5aeSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10094d9dcd5aeSmrgAC_MSG_RESULT([$BUILDTXTDOC])
10095ba064abeSmrg
10096d9dcd5aeSmrgAC_MSG_CHECKING([whether to build PDF documentation])
10097d9dcd5aeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10098d9dcd5aeSmrg   test x$BUILD_PDFDOC != xno; then
10099d9dcd5aeSmrg	BUILDPDFDOC=yes
10100d9dcd5aeSmrgfi
10101d9dcd5aeSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10102d9dcd5aeSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10103ba064abeSmrg
10104d9dcd5aeSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
10105d9dcd5aeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10106d9dcd5aeSmrg   test x$BUILD_PSDOC != xno; then
10107d9dcd5aeSmrg	BUILDPSDOC=yes
10108d9dcd5aeSmrgfi
10109d9dcd5aeSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10110d9dcd5aeSmrgAC_MSG_RESULT([$BUILDPSDOC])
10111191cded7Smrg
10112d9dcd5aeSmrgAC_MSG_CHECKING([whether to build HTML documentation])
10113d9dcd5aeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10114d9dcd5aeSmrg   test x$BUILD_HTMLDOC != xno; then
10115d9dcd5aeSmrg	BUILDHTMLDOC=yes
10116d9dcd5aeSmrgfi
10117d9dcd5aeSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10118d9dcd5aeSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10119191cded7Smrg
10120d9dcd5aeSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10121d9dcd5aeSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10122d9dcd5aeSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10123d9dcd5aeSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10124191cded7Smrg
10125d9dcd5aeSmrgAC_SUBST(MAKE_TEXT)
10126d9dcd5aeSmrgAC_SUBST(MAKE_PS)
10127d9dcd5aeSmrgAC_SUBST(MAKE_PDF)
10128d9dcd5aeSmrgAC_SUBST(MAKE_HTML)
10129d9dcd5aeSmrg]) # XORG_CHECK_DOCBOOK
10130191cded7Smrg
10131d9dcd5aeSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10132d9dcd5aeSmrg# ----------------
10133d9dcd5aeSmrg# Minimum version: 1.5.0
10134d9dcd5aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10135d9dcd5aeSmrg#
10136d9dcd5aeSmrg# Documentation tools are not always available on all platforms and sometimes
10137d9dcd5aeSmrg# not at the appropriate level. This macro enables a module to test for the
10138d9dcd5aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10139d9dcd5aeSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
10140d9dcd5aeSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
10141d9dcd5aeSmrg# --with-xmlto assumes 'auto'.
10142d9dcd5aeSmrg#
10143d9dcd5aeSmrg# Interface to module:
10144d9dcd5aeSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10145d9dcd5aeSmrg# XMLTO:	returns the path of the xmlto program found
10146d9dcd5aeSmrg#		returns the path set by the user in the environment
10147d9dcd5aeSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
10148d9dcd5aeSmrg#		'no' user instructs the module not to use xmlto
10149d9dcd5aeSmrg#
10150d9dcd5aeSmrg# Added in version 1.10.0
10151d9dcd5aeSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10152d9dcd5aeSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
10153d9dcd5aeSmrg#
10154d9dcd5aeSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10155d9dcd5aeSmrg#
10156d9dcd5aeSmrgAC_DEFUN([XORG_WITH_XMLTO],[
10157d9dcd5aeSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
10158d9dcd5aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
10159d9dcd5aeSmrgAC_ARG_WITH(xmlto,
10160d9dcd5aeSmrg	AS_HELP_STRING([--with-xmlto],
10161d9dcd5aeSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10162d9dcd5aeSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10163d9dcd5aeSmrgm4_undefine([_defopt])
10164191cded7Smrg
10165d9dcd5aeSmrgif test "x$use_xmlto" = x"auto"; then
10166d9dcd5aeSmrg   AC_PATH_PROG([XMLTO], [xmlto])
10167d9dcd5aeSmrg   if test "x$XMLTO" = "x"; then
10168d9dcd5aeSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10169d9dcd5aeSmrg	have_xmlto=no
10170d9dcd5aeSmrg   else
10171d9dcd5aeSmrg        have_xmlto=yes
10172d9dcd5aeSmrg   fi
10173d9dcd5aeSmrgelif test "x$use_xmlto" = x"yes" ; then
10174d9dcd5aeSmrg   AC_PATH_PROG([XMLTO], [xmlto])
10175d9dcd5aeSmrg   if test "x$XMLTO" = "x"; then
10176d9dcd5aeSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10177d9dcd5aeSmrg   fi
10178d9dcd5aeSmrg   have_xmlto=yes
10179d9dcd5aeSmrgelif test "x$use_xmlto" = x"no" ; then
10180d9dcd5aeSmrg   if test "x$XMLTO" != "x"; then
10181d9dcd5aeSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10182d9dcd5aeSmrg   fi
10183d9dcd5aeSmrg   have_xmlto=no
10184d9dcd5aeSmrgelse
10185d9dcd5aeSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10186d9dcd5aeSmrgfi
10187191cded7Smrg
10188d9dcd5aeSmrg# Test for a minimum version of xmlto, if provided.
10189d9dcd5aeSmrgm4_ifval([$1],
10190d9dcd5aeSmrg[if test "$have_xmlto" = yes; then
10191d9dcd5aeSmrg    # scrape the xmlto version
10192d9dcd5aeSmrg    AC_MSG_CHECKING([the xmlto version])
10193d9dcd5aeSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10194d9dcd5aeSmrg    AC_MSG_RESULT([$xmlto_version])
10195d9dcd5aeSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
10196d9dcd5aeSmrg        [if test "x$use_xmlto" = xauto; then
10197d9dcd5aeSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10198d9dcd5aeSmrg            have_xmlto=no
10199d9dcd5aeSmrg        else
10200d9dcd5aeSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10201d9dcd5aeSmrg        fi])
10202d9dcd5aeSmrgfi])
10203191cded7Smrg
10204d9dcd5aeSmrg# Test for the ability of xmlto to generate a text target
10205d9dcd5aeSmrghave_xmlto_text=no
10206d9dcd5aeSmrgcat > conftest.xml << "EOF"
10207d9dcd5aeSmrgEOF
10208d9dcd5aeSmrgAS_IF([test "$have_xmlto" = yes],
10209d9dcd5aeSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10210d9dcd5aeSmrg             [have_xmlto_text=yes],
10211d9dcd5aeSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10212d9dcd5aeSmrgrm -f conftest.xml
10213d9dcd5aeSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10214d9dcd5aeSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10215d9dcd5aeSmrg]) # XORG_WITH_XMLTO
10216191cded7Smrg
10217d9dcd5aeSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10218d9dcd5aeSmrg# --------------------------------------------
10219d9dcd5aeSmrg# Minimum version: 1.12.0
10220d9dcd5aeSmrg# Minimum version for optional DEFAULT argument: 1.12.0
10221d9dcd5aeSmrg#
10222d9dcd5aeSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10223d9dcd5aeSmrg# XML-based language used for the transformation of XML documents.
10224d9dcd5aeSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10225d9dcd5aeSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
10226d9dcd5aeSmrg# The XSLT processor is often used as a standalone tool for transformations.
10227d9dcd5aeSmrg# It should not be assumed that this tool is used only to work with documnetation.
10228d9dcd5aeSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10229d9dcd5aeSmrg#
10230d9dcd5aeSmrg# Interface to module:
10231d9dcd5aeSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10232d9dcd5aeSmrg# XSLTPROC:	 returns the path of the xsltproc program found
10233d9dcd5aeSmrg#		 returns the path set by the user in the environment
10234d9dcd5aeSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10235d9dcd5aeSmrg#		  'no' user instructs the module not to use xsltproc
10236d9dcd5aeSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
10237d9dcd5aeSmrg#
10238d9dcd5aeSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10239d9dcd5aeSmrg#
10240d9dcd5aeSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
10241d9dcd5aeSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10242d9dcd5aeSmrg# Preserves the interface, should it be implemented later
10243d9dcd5aeSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10244d9dcd5aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
10245d9dcd5aeSmrgAC_ARG_WITH(xsltproc,
10246d9dcd5aeSmrg	AS_HELP_STRING([--with-xsltproc],
10247d9dcd5aeSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10248d9dcd5aeSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10249d9dcd5aeSmrgm4_undefine([_defopt])
10250191cded7Smrg
10251d9dcd5aeSmrgif test "x$use_xsltproc" = x"auto"; then
10252d9dcd5aeSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10253d9dcd5aeSmrg   if test "x$XSLTPROC" = "x"; then
10254d9dcd5aeSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10255d9dcd5aeSmrg	have_xsltproc=no
10256d9dcd5aeSmrg   else
10257d9dcd5aeSmrg        have_xsltproc=yes
10258d9dcd5aeSmrg   fi
10259d9dcd5aeSmrgelif test "x$use_xsltproc" = x"yes" ; then
10260d9dcd5aeSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10261d9dcd5aeSmrg   if test "x$XSLTPROC" = "x"; then
10262d9dcd5aeSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10263d9dcd5aeSmrg   fi
10264d9dcd5aeSmrg   have_xsltproc=yes
10265d9dcd5aeSmrgelif test "x$use_xsltproc" = x"no" ; then
10266d9dcd5aeSmrg   if test "x$XSLTPROC" != "x"; then
10267d9dcd5aeSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10268d9dcd5aeSmrg   fi
10269d9dcd5aeSmrg   have_xsltproc=no
10270d9dcd5aeSmrgelse
10271d9dcd5aeSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10272d9dcd5aeSmrgfi
10273191cded7Smrg
10274d9dcd5aeSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10275d9dcd5aeSmrg]) # XORG_WITH_XSLTPROC
10276191cded7Smrg
10277d9dcd5aeSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10278d9dcd5aeSmrg# ----------------------------------------
10279d9dcd5aeSmrg# Minimum version: 1.15.0
10280d9dcd5aeSmrg#
10281d9dcd5aeSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
10282d9dcd5aeSmrg# scanning arbitrary text files, extracting information from those text files,
10283d9dcd5aeSmrg# and printing reports based on that information.
10284d9dcd5aeSmrg#
10285d9dcd5aeSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
10286d9dcd5aeSmrg#
10287d9dcd5aeSmrg# Interface to module:
10288d9dcd5aeSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
10289d9dcd5aeSmrg# PERL:	     returns the path of the perl program found
10290d9dcd5aeSmrg#	     returns the path set by the user in the environment
10291d9dcd5aeSmrg# --with-perl: 'yes' user instructs the module to use perl
10292d9dcd5aeSmrg#	       'no' user instructs the module not to use perl
10293d9dcd5aeSmrg# have_perl: returns yes if perl found in PATH or no
10294d9dcd5aeSmrg#
10295d9dcd5aeSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10296d9dcd5aeSmrg#
10297d9dcd5aeSmrgAC_DEFUN([XORG_WITH_PERL],[
10298d9dcd5aeSmrgAC_ARG_VAR([PERL], [Path to perl command])
10299d9dcd5aeSmrg# Preserves the interface, should it be implemented later
10300d9dcd5aeSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10301d9dcd5aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
10302d9dcd5aeSmrgAC_ARG_WITH(perl,
10303d9dcd5aeSmrg	AS_HELP_STRING([--with-perl],
10304d9dcd5aeSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
10305d9dcd5aeSmrg	   [use_perl=$withval], [use_perl=]_defopt)
10306d9dcd5aeSmrgm4_undefine([_defopt])
10307191cded7Smrg
10308d9dcd5aeSmrgif test "x$use_perl" = x"auto"; then
10309d9dcd5aeSmrg   AC_PATH_PROG([PERL], [perl])
10310d9dcd5aeSmrg   if test "x$PERL" = "x"; then
10311d9dcd5aeSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
10312d9dcd5aeSmrg	have_perl=no
10313d9dcd5aeSmrg   else
10314d9dcd5aeSmrg        have_perl=yes
10315d9dcd5aeSmrg   fi
10316d9dcd5aeSmrgelif test "x$use_perl" = x"yes" ; then
10317d9dcd5aeSmrg   AC_PATH_PROG([PERL], [perl])
10318d9dcd5aeSmrg   if test "x$PERL" = "x"; then
10319d9dcd5aeSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10320d9dcd5aeSmrg   fi
10321d9dcd5aeSmrg   have_perl=yes
10322d9dcd5aeSmrgelif test "x$use_perl" = x"no" ; then
10323d9dcd5aeSmrg   if test "x$PERL" != "x"; then
10324d9dcd5aeSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10325d9dcd5aeSmrg   fi
10326d9dcd5aeSmrg   have_perl=no
10327d9dcd5aeSmrgelse
10328d9dcd5aeSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10329d9dcd5aeSmrgfi
10330ba064abeSmrg
10331d9dcd5aeSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10332d9dcd5aeSmrg]) # XORG_WITH_PERL
10333ba064abeSmrg
10334d9dcd5aeSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10335d9dcd5aeSmrg# ----------------
10336d9dcd5aeSmrg# Minimum version: 1.5.0
10337d9dcd5aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10338d9dcd5aeSmrg#
10339d9dcd5aeSmrg# Documentation tools are not always available on all platforms and sometimes
10340d9dcd5aeSmrg# not at the appropriate level. This macro enables a module to test for the
10341d9dcd5aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10342d9dcd5aeSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10343d9dcd5aeSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10344d9dcd5aeSmrg# --with-asciidoc assumes 'auto'.
10345d9dcd5aeSmrg#
10346d9dcd5aeSmrg# Interface to module:
10347d9dcd5aeSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10348d9dcd5aeSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
10349d9dcd5aeSmrg#		 returns the path set by the user in the environment
10350d9dcd5aeSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10351d9dcd5aeSmrg#		  'no' user instructs the module not to use asciidoc
10352d9dcd5aeSmrg#
10353d9dcd5aeSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10354d9dcd5aeSmrg#
10355d9dcd5aeSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
10356d9dcd5aeSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10357d9dcd5aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
10358d9dcd5aeSmrgAC_ARG_WITH(asciidoc,
10359d9dcd5aeSmrg	AS_HELP_STRING([--with-asciidoc],
10360d9dcd5aeSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10361d9dcd5aeSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10362d9dcd5aeSmrgm4_undefine([_defopt])
10363ba064abeSmrg
10364d9dcd5aeSmrgif test "x$use_asciidoc" = x"auto"; then
10365d9dcd5aeSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10366d9dcd5aeSmrg   if test "x$ASCIIDOC" = "x"; then
10367d9dcd5aeSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10368d9dcd5aeSmrg	have_asciidoc=no
10369d9dcd5aeSmrg   else
10370d9dcd5aeSmrg        have_asciidoc=yes
10371d9dcd5aeSmrg   fi
10372d9dcd5aeSmrgelif test "x$use_asciidoc" = x"yes" ; then
10373d9dcd5aeSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10374d9dcd5aeSmrg   if test "x$ASCIIDOC" = "x"; then
10375d9dcd5aeSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10376d9dcd5aeSmrg   fi
10377d9dcd5aeSmrg   have_asciidoc=yes
10378d9dcd5aeSmrgelif test "x$use_asciidoc" = x"no" ; then
10379d9dcd5aeSmrg   if test "x$ASCIIDOC" != "x"; then
10380d9dcd5aeSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10381d9dcd5aeSmrg   fi
10382d9dcd5aeSmrg   have_asciidoc=no
10383d9dcd5aeSmrgelse
10384d9dcd5aeSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10385d9dcd5aeSmrgfi
10386d9dcd5aeSmrgm4_ifval([$1],
10387d9dcd5aeSmrg[if test "$have_asciidoc" = yes; then
10388d9dcd5aeSmrg    # scrape the asciidoc version
10389d9dcd5aeSmrg    AC_MSG_CHECKING([the asciidoc version])
10390d9dcd5aeSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10391d9dcd5aeSmrg    AC_MSG_RESULT([$asciidoc_version])
10392d9dcd5aeSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10393d9dcd5aeSmrg        [if test "x$use_asciidoc" = xauto; then
10394d9dcd5aeSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10395d9dcd5aeSmrg            have_asciidoc=no
10396d9dcd5aeSmrg        else
10397d9dcd5aeSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10398d9dcd5aeSmrg        fi])
10399d9dcd5aeSmrgfi])
10400d9dcd5aeSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10401d9dcd5aeSmrg]) # XORG_WITH_ASCIIDOC
10402b290cf36Smrg
10403d9dcd5aeSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10404d9dcd5aeSmrg# --------------------------------
10405d9dcd5aeSmrg# Minimum version: 1.5.0
10406d9dcd5aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10407d9dcd5aeSmrg#
10408d9dcd5aeSmrg# Documentation tools are not always available on all platforms and sometimes
10409d9dcd5aeSmrg# not at the appropriate level. This macro enables a module to test for the
10410d9dcd5aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10411d9dcd5aeSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
10412d9dcd5aeSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
10413d9dcd5aeSmrg# --with-doxygen assumes 'auto'.
10414d9dcd5aeSmrg#
10415d9dcd5aeSmrg# Interface to module:
10416d9dcd5aeSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10417d9dcd5aeSmrg# DOXYGEN:	 returns the path of the doxygen program found
10418d9dcd5aeSmrg#		 returns the path set by the user in the environment
10419d9dcd5aeSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
10420d9dcd5aeSmrg#		  'no' user instructs the module not to use doxygen
10421d9dcd5aeSmrg#
10422d9dcd5aeSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10423d9dcd5aeSmrg#
10424d9dcd5aeSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
10425d9dcd5aeSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10426d9dcd5aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
10427d9dcd5aeSmrgAC_ARG_WITH(doxygen,
10428d9dcd5aeSmrg	AS_HELP_STRING([--with-doxygen],
10429d9dcd5aeSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10430d9dcd5aeSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10431d9dcd5aeSmrgm4_undefine([_defopt])
10432b290cf36Smrg
10433d9dcd5aeSmrgif test "x$use_doxygen" = x"auto"; then
10434d9dcd5aeSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10435d9dcd5aeSmrg   if test "x$DOXYGEN" = "x"; then
10436d9dcd5aeSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10437d9dcd5aeSmrg	have_doxygen=no
10438d9dcd5aeSmrg   else
10439d9dcd5aeSmrg        have_doxygen=yes
10440d9dcd5aeSmrg   fi
10441d9dcd5aeSmrgelif test "x$use_doxygen" = x"yes" ; then
10442d9dcd5aeSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10443d9dcd5aeSmrg   if test "x$DOXYGEN" = "x"; then
10444d9dcd5aeSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10445d9dcd5aeSmrg   fi
10446d9dcd5aeSmrg   have_doxygen=yes
10447d9dcd5aeSmrgelif test "x$use_doxygen" = x"no" ; then
10448d9dcd5aeSmrg   if test "x$DOXYGEN" != "x"; then
10449d9dcd5aeSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10450d9dcd5aeSmrg   fi
10451d9dcd5aeSmrg   have_doxygen=no
10452d9dcd5aeSmrgelse
10453d9dcd5aeSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10454d9dcd5aeSmrgfi
10455d9dcd5aeSmrgm4_ifval([$1],
10456d9dcd5aeSmrg[if test "$have_doxygen" = yes; then
10457d9dcd5aeSmrg    # scrape the doxygen version
10458d9dcd5aeSmrg    AC_MSG_CHECKING([the doxygen version])
10459d9dcd5aeSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10460d9dcd5aeSmrg    AC_MSG_RESULT([$doxygen_version])
10461d9dcd5aeSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
10462d9dcd5aeSmrg        [if test "x$use_doxygen" = xauto; then
10463d9dcd5aeSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10464d9dcd5aeSmrg            have_doxygen=no
10465d9dcd5aeSmrg        else
10466d9dcd5aeSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10467d9dcd5aeSmrg        fi])
10468d9dcd5aeSmrgfi])
10469d9dcd5aeSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10470d9dcd5aeSmrg]) # XORG_WITH_DOXYGEN
10471b290cf36Smrg
10472d9dcd5aeSmrg# XORG_WITH_GROFF([DEFAULT])
10473d9dcd5aeSmrg# ----------------
10474d9dcd5aeSmrg# Minimum version: 1.6.0
10475d9dcd5aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10476d9dcd5aeSmrg#
10477d9dcd5aeSmrg# Documentation tools are not always available on all platforms and sometimes
10478d9dcd5aeSmrg# not at the appropriate level. This macro enables a module to test for the
10479d9dcd5aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10480d9dcd5aeSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
10481d9dcd5aeSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
10482d9dcd5aeSmrg# --with-groff assumes 'auto'.
10483d9dcd5aeSmrg#
10484d9dcd5aeSmrg# Interface to module:
10485d9dcd5aeSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10486d9dcd5aeSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10487d9dcd5aeSmrg# HAVE_GROFF_MS: the -ms macros package
10488d9dcd5aeSmrg# GROFF:	 returns the path of the groff program found
10489d9dcd5aeSmrg#		 returns the path set by the user in the environment
10490d9dcd5aeSmrg# --with-groff:	 'yes' user instructs the module to use groff
10491d9dcd5aeSmrg#		 'no' user instructs the module not to use groff
10492d9dcd5aeSmrg#
10493d9dcd5aeSmrg# Added in version 1.9.0:
10494d9dcd5aeSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10495d9dcd5aeSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10496d9dcd5aeSmrg#		   psselect from the psutils package.
10497d9dcd5aeSmrg#		   the ghostcript package. Refer to the grohtml man pages
10498d9dcd5aeSmrg#
10499d9dcd5aeSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10500d9dcd5aeSmrg#
10501d9dcd5aeSmrg# OS and distros often splits groff in a basic and full package, the former
10502d9dcd5aeSmrg# having the groff program and the later having devices, fonts and macros
10503d9dcd5aeSmrg# Checking for the groff executable is not enough.
10504d9dcd5aeSmrg#
10505d9dcd5aeSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
10506d9dcd5aeSmrg# unset HAVE_GROFF or GROFF env variables.
10507d9dcd5aeSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10508d9dcd5aeSmrg#
10509d9dcd5aeSmrgAC_DEFUN([XORG_WITH_GROFF],[
10510d9dcd5aeSmrgAC_ARG_VAR([GROFF], [Path to groff command])
10511d9dcd5aeSmrgm4_define([_defopt], m4_default([$1], [auto]))
10512d9dcd5aeSmrgAC_ARG_WITH(groff,
10513d9dcd5aeSmrg	AS_HELP_STRING([--with-groff],
10514d9dcd5aeSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10515d9dcd5aeSmrg	   [use_groff=$withval], [use_groff=]_defopt)
10516d9dcd5aeSmrgm4_undefine([_defopt])
10517191cded7Smrg
10518d9dcd5aeSmrgif test "x$use_groff" = x"auto"; then
10519d9dcd5aeSmrg   AC_PATH_PROG([GROFF], [groff])
10520d9dcd5aeSmrg   if test "x$GROFF" = "x"; then
10521d9dcd5aeSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10522d9dcd5aeSmrg	have_groff=no
10523d9dcd5aeSmrg   else
10524d9dcd5aeSmrg        have_groff=yes
10525d9dcd5aeSmrg   fi
10526d9dcd5aeSmrgelif test "x$use_groff" = x"yes" ; then
10527d9dcd5aeSmrg   AC_PATH_PROG([GROFF], [groff])
10528d9dcd5aeSmrg   if test "x$GROFF" = "x"; then
10529d9dcd5aeSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10530d9dcd5aeSmrg   fi
10531d9dcd5aeSmrg   have_groff=yes
10532d9dcd5aeSmrgelif test "x$use_groff" = x"no" ; then
10533d9dcd5aeSmrg   if test "x$GROFF" != "x"; then
10534d9dcd5aeSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10535d9dcd5aeSmrg   fi
10536d9dcd5aeSmrg   have_groff=no
10537d9dcd5aeSmrgelse
10538d9dcd5aeSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10539d9dcd5aeSmrgfi
10540191cded7Smrg
10541d9dcd5aeSmrg# We have groff, test for the presence of the macro packages
10542d9dcd5aeSmrgif test "x$have_groff" = x"yes"; then
10543d9dcd5aeSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10544d9dcd5aeSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10545d9dcd5aeSmrg        groff_ms_works=yes
10546d9dcd5aeSmrg    else
10547d9dcd5aeSmrg        groff_ms_works=no
10548d9dcd5aeSmrg    fi
10549d9dcd5aeSmrg    AC_MSG_RESULT([$groff_ms_works])
10550d9dcd5aeSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10551d9dcd5aeSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10552d9dcd5aeSmrg        groff_mm_works=yes
10553d9dcd5aeSmrg    else
10554d9dcd5aeSmrg        groff_mm_works=no
10555d9dcd5aeSmrg    fi
10556d9dcd5aeSmrg    AC_MSG_RESULT([$groff_mm_works])
10557d9dcd5aeSmrgfi
10558191cded7Smrg
10559d9dcd5aeSmrg# We have groff, test for HTML dependencies, one command per package
10560d9dcd5aeSmrgif test "x$have_groff" = x"yes"; then
10561d9dcd5aeSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10562d9dcd5aeSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10563d9dcd5aeSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10564d9dcd5aeSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10565d9dcd5aeSmrg      have_groff_html=yes
10566d9dcd5aeSmrg   else
10567d9dcd5aeSmrg      have_groff_html=no
10568d9dcd5aeSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10569d9dcd5aeSmrg   fi
10570d9dcd5aeSmrgfi
10571191cded7Smrg
10572d9dcd5aeSmrg# Set Automake conditionals for Makefiles
10573d9dcd5aeSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10574d9dcd5aeSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10575d9dcd5aeSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10576d9dcd5aeSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10577d9dcd5aeSmrg]) # XORG_WITH_GROFF
10578b290cf36Smrg
10579d9dcd5aeSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10580d9dcd5aeSmrg# ---------------------------------------
10581d9dcd5aeSmrg# Minimum version: 1.6.0
10582d9dcd5aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10583d9dcd5aeSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10584d9dcd5aeSmrg#
10585d9dcd5aeSmrg# Documentation tools are not always available on all platforms and sometimes
10586d9dcd5aeSmrg# not at the appropriate level. This macro enables a module to test for the
10587d9dcd5aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10588d9dcd5aeSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
10589d9dcd5aeSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
10590d9dcd5aeSmrg# --with-fop assumes 'auto'.
10591d9dcd5aeSmrg#
10592d9dcd5aeSmrg# Interface to module:
10593d9dcd5aeSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10594d9dcd5aeSmrg# FOP:	 	returns the path of the fop program found
10595d9dcd5aeSmrg#		returns the path set by the user in the environment
10596d9dcd5aeSmrg# --with-fop: 	'yes' user instructs the module to use fop
10597d9dcd5aeSmrg#		'no' user instructs the module not to use fop
10598d9dcd5aeSmrg#
10599d9dcd5aeSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10600d9dcd5aeSmrg#
10601d9dcd5aeSmrgAC_DEFUN([XORG_WITH_FOP],[
10602d9dcd5aeSmrgAC_ARG_VAR([FOP], [Path to fop command])
10603d9dcd5aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
10604d9dcd5aeSmrgAC_ARG_WITH(fop,
10605d9dcd5aeSmrg	AS_HELP_STRING([--with-fop],
10606d9dcd5aeSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10607d9dcd5aeSmrg	   [use_fop=$withval], [use_fop=]_defopt)
10608d9dcd5aeSmrgm4_undefine([_defopt])
10609b290cf36Smrg
10610d9dcd5aeSmrgif test "x$use_fop" = x"auto"; then
10611d9dcd5aeSmrg   AC_PATH_PROG([FOP], [fop])
10612d9dcd5aeSmrg   if test "x$FOP" = "x"; then
10613d9dcd5aeSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10614d9dcd5aeSmrg	have_fop=no
10615d9dcd5aeSmrg   else
10616d9dcd5aeSmrg        have_fop=yes
10617d9dcd5aeSmrg   fi
10618d9dcd5aeSmrgelif test "x$use_fop" = x"yes" ; then
10619d9dcd5aeSmrg   AC_PATH_PROG([FOP], [fop])
10620d9dcd5aeSmrg   if test "x$FOP" = "x"; then
10621d9dcd5aeSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10622d9dcd5aeSmrg   fi
10623d9dcd5aeSmrg   have_fop=yes
10624d9dcd5aeSmrgelif test "x$use_fop" = x"no" ; then
10625d9dcd5aeSmrg   if test "x$FOP" != "x"; then
10626d9dcd5aeSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10627d9dcd5aeSmrg   fi
10628d9dcd5aeSmrg   have_fop=no
10629d9dcd5aeSmrgelse
10630d9dcd5aeSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10631d9dcd5aeSmrgfi
10632191cded7Smrg
10633d9dcd5aeSmrg# Test for a minimum version of fop, if provided.
10634d9dcd5aeSmrgm4_ifval([$1],
10635d9dcd5aeSmrg[if test "$have_fop" = yes; then
10636d9dcd5aeSmrg    # scrape the fop version
10637d9dcd5aeSmrg    AC_MSG_CHECKING([for fop minimum version])
10638d9dcd5aeSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10639d9dcd5aeSmrg    AC_MSG_RESULT([$fop_version])
10640d9dcd5aeSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
10641d9dcd5aeSmrg        [if test "x$use_fop" = xauto; then
10642d9dcd5aeSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10643d9dcd5aeSmrg            have_fop=no
10644d9dcd5aeSmrg        else
10645d9dcd5aeSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10646d9dcd5aeSmrg        fi])
10647d9dcd5aeSmrgfi])
10648d9dcd5aeSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10649d9dcd5aeSmrg]) # XORG_WITH_FOP
10650191cded7Smrg
10651d9dcd5aeSmrg# XORG_WITH_PS2PDF([DEFAULT])
10652d9dcd5aeSmrg# ----------------
10653d9dcd5aeSmrg# Minimum version: 1.6.0
10654d9dcd5aeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10655d9dcd5aeSmrg#
10656d9dcd5aeSmrg# Documentation tools are not always available on all platforms and sometimes
10657d9dcd5aeSmrg# not at the appropriate level. This macro enables a module to test for the
10658d9dcd5aeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10659d9dcd5aeSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10660d9dcd5aeSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10661d9dcd5aeSmrg# --with-ps2pdf assumes 'auto'.
10662d9dcd5aeSmrg#
10663d9dcd5aeSmrg# Interface to module:
10664d9dcd5aeSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10665d9dcd5aeSmrg# PS2PDF:	returns the path of the ps2pdf program found
10666d9dcd5aeSmrg#		returns the path set by the user in the environment
10667d9dcd5aeSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10668d9dcd5aeSmrg#		 'no' user instructs the module not to use ps2pdf
10669d9dcd5aeSmrg#
10670d9dcd5aeSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10671d9dcd5aeSmrg#
10672d9dcd5aeSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10673d9dcd5aeSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10674d9dcd5aeSmrgm4_define([_defopt], m4_default([$1], [auto]))
10675d9dcd5aeSmrgAC_ARG_WITH(ps2pdf,
10676d9dcd5aeSmrg	AS_HELP_STRING([--with-ps2pdf],
10677d9dcd5aeSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10678d9dcd5aeSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10679d9dcd5aeSmrgm4_undefine([_defopt])
10680b290cf36Smrg
10681d9dcd5aeSmrgif test "x$use_ps2pdf" = x"auto"; then
10682d9dcd5aeSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10683d9dcd5aeSmrg   if test "x$PS2PDF" = "x"; then
10684d9dcd5aeSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10685d9dcd5aeSmrg	have_ps2pdf=no
10686d9dcd5aeSmrg   else
10687d9dcd5aeSmrg        have_ps2pdf=yes
10688d9dcd5aeSmrg   fi
10689d9dcd5aeSmrgelif test "x$use_ps2pdf" = x"yes" ; then
10690d9dcd5aeSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10691d9dcd5aeSmrg   if test "x$PS2PDF" = "x"; then
10692d9dcd5aeSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10693d9dcd5aeSmrg   fi
10694d9dcd5aeSmrg   have_ps2pdf=yes
10695d9dcd5aeSmrgelif test "x$use_ps2pdf" = x"no" ; then
10696d9dcd5aeSmrg   if test "x$PS2PDF" != "x"; then
10697d9dcd5aeSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10698d9dcd5aeSmrg   fi
10699d9dcd5aeSmrg   have_ps2pdf=no
10700d9dcd5aeSmrgelse
10701d9dcd5aeSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10702d9dcd5aeSmrgfi
10703d9dcd5aeSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10704d9dcd5aeSmrg]) # XORG_WITH_PS2PDF
10705191cded7Smrg
10706d9dcd5aeSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
10707d9dcd5aeSmrg# ----------------
10708d9dcd5aeSmrg# Minimum version: 1.6.0
10709d9dcd5aeSmrg#
10710d9dcd5aeSmrg# Documentation tools are not always available on all platforms and sometimes
10711d9dcd5aeSmrg# not at the appropriate level. This macro enables a builder to skip all
10712d9dcd5aeSmrg# documentation targets except traditional man pages.
10713d9dcd5aeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10714d9dcd5aeSmrg# maximum flexibilty in controlling documentation building.
10715d9dcd5aeSmrg# Refer to:
10716d9dcd5aeSmrg# XORG_WITH_XMLTO         --with-xmlto
10717d9dcd5aeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10718d9dcd5aeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10719d9dcd5aeSmrg# XORG_WITH_FOP           --with-fop
10720d9dcd5aeSmrg# XORG_WITH_GROFF         --with-groff
10721d9dcd5aeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10722d9dcd5aeSmrg#
10723d9dcd5aeSmrg# Interface to module:
10724d9dcd5aeSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10725d9dcd5aeSmrg# --enable-docs: 'yes' user instructs the module to generate docs
10726d9dcd5aeSmrg#		 'no' user instructs the module not to generate docs
10727d9dcd5aeSmrg# parm1:	specify the default value, yes or no.
10728d9dcd5aeSmrg#
10729d9dcd5aeSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10730d9dcd5aeSmrgm4_define([docs_default], m4_default([$1], [yes]))
10731d9dcd5aeSmrgAC_ARG_ENABLE(docs,
10732d9dcd5aeSmrg	AS_HELP_STRING([--enable-docs],
10733d9dcd5aeSmrg	   [Enable building the documentation (default: ]docs_default[)]),
10734d9dcd5aeSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
10735d9dcd5aeSmrgm4_undefine([docs_default])
10736d9dcd5aeSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10737d9dcd5aeSmrgAC_MSG_CHECKING([whether to build documentation])
10738d9dcd5aeSmrgAC_MSG_RESULT([$build_docs])
10739d9dcd5aeSmrg]) # XORG_ENABLE_DOCS
10740191cded7Smrg
10741d9dcd5aeSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10742d9dcd5aeSmrg# ----------------
10743d9dcd5aeSmrg# Minimum version: 1.6.0
10744d9dcd5aeSmrg#
10745d9dcd5aeSmrg# This macro enables a builder to skip all developer documentation.
10746d9dcd5aeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10747d9dcd5aeSmrg# maximum flexibilty in controlling documentation building.
10748d9dcd5aeSmrg# Refer to:
10749d9dcd5aeSmrg# XORG_WITH_XMLTO         --with-xmlto
10750d9dcd5aeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10751d9dcd5aeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10752d9dcd5aeSmrg# XORG_WITH_FOP           --with-fop
10753d9dcd5aeSmrg# XORG_WITH_GROFF         --with-groff
10754d9dcd5aeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10755d9dcd5aeSmrg#
10756d9dcd5aeSmrg# Interface to module:
10757d9dcd5aeSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10758d9dcd5aeSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10759d9dcd5aeSmrg#			'no' user instructs the module not to generate developer docs
10760d9dcd5aeSmrg# parm1:		specify the default value, yes or no.
10761d9dcd5aeSmrg#
10762d9dcd5aeSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10763d9dcd5aeSmrgm4_define([devel_default], m4_default([$1], [yes]))
10764d9dcd5aeSmrgAC_ARG_ENABLE(devel-docs,
10765d9dcd5aeSmrg	AS_HELP_STRING([--enable-devel-docs],
10766d9dcd5aeSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10767d9dcd5aeSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10768d9dcd5aeSmrgm4_undefine([devel_default])
10769d9dcd5aeSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10770d9dcd5aeSmrgAC_MSG_CHECKING([whether to build developer documentation])
10771d9dcd5aeSmrgAC_MSG_RESULT([$build_devel_docs])
10772d9dcd5aeSmrg]) # XORG_ENABLE_DEVEL_DOCS
10773191cded7Smrg
10774d9dcd5aeSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
10775d9dcd5aeSmrg# ----------------
10776d9dcd5aeSmrg# Minimum version: 1.6.0
10777d9dcd5aeSmrg#
10778d9dcd5aeSmrg# This macro enables a builder to skip all functional specification targets.
10779d9dcd5aeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10780d9dcd5aeSmrg# maximum flexibilty in controlling documentation building.
10781d9dcd5aeSmrg# Refer to:
10782d9dcd5aeSmrg# XORG_WITH_XMLTO         --with-xmlto
10783d9dcd5aeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10784d9dcd5aeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10785d9dcd5aeSmrg# XORG_WITH_FOP           --with-fop
10786d9dcd5aeSmrg# XORG_WITH_GROFF         --with-groff
10787d9dcd5aeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10788d9dcd5aeSmrg#
10789d9dcd5aeSmrg# Interface to module:
10790d9dcd5aeSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10791d9dcd5aeSmrg# --enable-specs:	'yes' user instructs the module to generate specs
10792d9dcd5aeSmrg#			'no' user instructs the module not to generate specs
10793d9dcd5aeSmrg# parm1:		specify the default value, yes or no.
10794d9dcd5aeSmrg#
10795d9dcd5aeSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10796d9dcd5aeSmrgm4_define([spec_default], m4_default([$1], [yes]))
10797d9dcd5aeSmrgAC_ARG_ENABLE(specs,
10798d9dcd5aeSmrg	AS_HELP_STRING([--enable-specs],
10799d9dcd5aeSmrg	   [Enable building the specs (default: ]spec_default[)]),
10800d9dcd5aeSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
10801d9dcd5aeSmrgm4_undefine([spec_default])
10802d9dcd5aeSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10803d9dcd5aeSmrgAC_MSG_CHECKING([whether to build functional specifications])
10804d9dcd5aeSmrgAC_MSG_RESULT([$build_specs])
10805d9dcd5aeSmrg]) # XORG_ENABLE_SPECS
10806ba064abeSmrg
10807d9dcd5aeSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10808d9dcd5aeSmrg# ----------------------------------------------
10809d9dcd5aeSmrg# Minimum version: 1.13.0
10810d9dcd5aeSmrg#
10811d9dcd5aeSmrg# This macro enables a builder to enable/disable unit testing
10812d9dcd5aeSmrg# It makes no assumption about the test cases implementation
10813d9dcd5aeSmrg# Test cases may or may not use Automake "Support for test suites"
10814d9dcd5aeSmrg# They may or may not use the software utility library GLib
10815d9dcd5aeSmrg#
10816d9dcd5aeSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10817d9dcd5aeSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10818d9dcd5aeSmrg# The variable enable_unit_tests is used by other macros in this file.
10819d9dcd5aeSmrg#
10820d9dcd5aeSmrg# Interface to module:
10821d9dcd5aeSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10822d9dcd5aeSmrg# enable_unit_tests:    used in configure.ac for additional configuration
10823d9dcd5aeSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10824d9dcd5aeSmrg#			'no' user instructs the module not to build tests
10825d9dcd5aeSmrg# parm1:		specify the default value, yes or no.
10826d9dcd5aeSmrg#
10827d9dcd5aeSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10828d9dcd5aeSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10829d9dcd5aeSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10830d9dcd5aeSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10831d9dcd5aeSmrgm4_define([_defopt], m4_default([$1], [auto]))
10832d9dcd5aeSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10833d9dcd5aeSmrg	[Enable building unit test cases (default: ]_defopt[)]),
10834d9dcd5aeSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10835d9dcd5aeSmrgm4_undefine([_defopt])
10836d9dcd5aeSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10837d9dcd5aeSmrgAC_MSG_CHECKING([whether to build unit test cases])
10838d9dcd5aeSmrgAC_MSG_RESULT([$enable_unit_tests])
10839d9dcd5aeSmrg]) # XORG_ENABLE_UNIT_TESTS
10840191cded7Smrg
10841d9dcd5aeSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10842d9dcd5aeSmrg# ------------------------------------------------------
10843d9dcd5aeSmrg# Minimum version: 1.17.0
10844d9dcd5aeSmrg#
10845d9dcd5aeSmrg# This macro enables a builder to enable/disable integration testing
10846d9dcd5aeSmrg# It makes no assumption about the test cases' implementation
10847d9dcd5aeSmrg# Test cases may or may not use Automake "Support for test suites"
10848d9dcd5aeSmrg#
10849d9dcd5aeSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10850d9dcd5aeSmrg# usually requires less dependencies and may be built and run under less
10851d9dcd5aeSmrg# stringent environments than integration tests.
10852d9dcd5aeSmrg#
10853d9dcd5aeSmrg# Interface to module:
10854d9dcd5aeSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10855d9dcd5aeSmrg# enable_integration_tests:   used in configure.ac for additional configuration
10856d9dcd5aeSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10857d9dcd5aeSmrg#                             'no' user instructs the module not to build tests
10858d9dcd5aeSmrg# parm1:                      specify the default value, yes or no.
10859d9dcd5aeSmrg#
10860d9dcd5aeSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10861d9dcd5aeSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10862d9dcd5aeSmrgm4_define([_defopt], m4_default([$1], [auto]))
10863d9dcd5aeSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10864d9dcd5aeSmrg	[Enable building integration test cases (default: ]_defopt[)]),
10865d9dcd5aeSmrg	[enable_integration_tests=$enableval],
10866d9dcd5aeSmrg	[enable_integration_tests=]_defopt)
10867d9dcd5aeSmrgm4_undefine([_defopt])
10868d9dcd5aeSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10869d9dcd5aeSmrg	[test "x$enable_integration_tests" != xno])
10870d9dcd5aeSmrgAC_MSG_CHECKING([whether to build unit test cases])
10871d9dcd5aeSmrgAC_MSG_RESULT([$enable_integration_tests])
10872d9dcd5aeSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
10873191cded7Smrg
10874d9dcd5aeSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10875d9dcd5aeSmrg# ----------------------------------------
10876d9dcd5aeSmrg# Minimum version: 1.13.0
10877d9dcd5aeSmrg#
10878d9dcd5aeSmrg# GLib is a library which provides advanced data structures and functions.
10879d9dcd5aeSmrg# This macro enables a module to test for the presence of Glib.
10880d9dcd5aeSmrg#
10881d9dcd5aeSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10882d9dcd5aeSmrg# Otherwise the value of $enable_unit_tests is blank.
10883d9dcd5aeSmrg#
10884d9dcd5aeSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10885d9dcd5aeSmrg# test support usually requires less dependencies and may be built and run under
10886d9dcd5aeSmrg# less stringent environments than integration tests.
10887d9dcd5aeSmrg#
10888d9dcd5aeSmrg# Interface to module:
10889d9dcd5aeSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
10890d9dcd5aeSmrg# with_glib: used in configure.ac to know if GLib has been found
10891d9dcd5aeSmrg# --with-glib:	'yes' user instructs the module to use glib
10892d9dcd5aeSmrg#		'no' user instructs the module not to use glib
10893d9dcd5aeSmrg#
10894d9dcd5aeSmrgAC_DEFUN([XORG_WITH_GLIB],[
10895d9dcd5aeSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10896d9dcd5aeSmrgm4_define([_defopt], m4_default([$2], [auto]))
10897d9dcd5aeSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10898d9dcd5aeSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10899d9dcd5aeSmrg	[with_glib=$withval], [with_glib=]_defopt)
10900d9dcd5aeSmrgm4_undefine([_defopt])
10901191cded7Smrg
10902d9dcd5aeSmrghave_glib=no
10903d9dcd5aeSmrg# Do not probe GLib if user explicitly disabled unit testing
10904d9dcd5aeSmrgif test "x$enable_unit_tests" != x"no"; then
10905d9dcd5aeSmrg  # Do not probe GLib if user explicitly disabled it
10906d9dcd5aeSmrg  if test "x$with_glib" != x"no"; then
10907d9dcd5aeSmrg    m4_ifval(
10908d9dcd5aeSmrg      [$1],
10909d9dcd5aeSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10910d9dcd5aeSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10911d9dcd5aeSmrg    )
10912d9dcd5aeSmrg  fi
10913d9dcd5aeSmrgfi
10914191cded7Smrg
10915d9dcd5aeSmrg# Not having GLib when unit testing has been explicitly requested is an error
10916d9dcd5aeSmrgif test "x$enable_unit_tests" = x"yes"; then
10917d9dcd5aeSmrg  if test "x$have_glib" = x"no"; then
10918d9dcd5aeSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10919d9dcd5aeSmrg  fi
10920d9dcd5aeSmrgfi
10921191cded7Smrg
10922d9dcd5aeSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
10923d9dcd5aeSmrgif test "x$enable_unit_tests" = x"no"; then
10924d9dcd5aeSmrg  if test "x$with_glib" = x"yes"; then
10925d9dcd5aeSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10926d9dcd5aeSmrg  fi
10927d9dcd5aeSmrgfi
10928191cded7Smrg
10929d9dcd5aeSmrg# Not having GLib when it has been explicitly requested is an error
10930d9dcd5aeSmrgif test "x$with_glib" = x"yes"; then
10931d9dcd5aeSmrg  if test "x$have_glib" = x"no"; then
10932d9dcd5aeSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10933d9dcd5aeSmrg  fi
10934d9dcd5aeSmrgfi
10935191cded7Smrg
10936d9dcd5aeSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10937d9dcd5aeSmrg]) # XORG_WITH_GLIB
10938191cded7Smrg
10939d9dcd5aeSmrg# XORG_LD_WRAP([required|optional])
10940d9dcd5aeSmrg# ---------------------------------
10941d9dcd5aeSmrg# Minimum version: 1.13.0
10942d9dcd5aeSmrg#
10943d9dcd5aeSmrg# Check if linker supports -wrap, passed via compiler flags
10944d9dcd5aeSmrg#
10945d9dcd5aeSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10946d9dcd5aeSmrg# Otherwise the value of $enable_unit_tests is blank.
10947d9dcd5aeSmrg#
10948d9dcd5aeSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
10949d9dcd5aeSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10950d9dcd5aeSmrg# available, an argument of "optional" allows use when some unit tests require
10951d9dcd5aeSmrg# ld -wrap and others do not.
10952d9dcd5aeSmrg#
10953d9dcd5aeSmrgAC_DEFUN([XORG_LD_WRAP],[
10954d9dcd5aeSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10955d9dcd5aeSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
10956d9dcd5aeSmrg                      void __wrap_exit(int status) { return; }],
10957d9dcd5aeSmrg                     [exit(0);])])
10958d9dcd5aeSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
10959d9dcd5aeSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10960d9dcd5aeSmrg  if test "x$have_ld_wrap" = x"no"; then
10961d9dcd5aeSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10962d9dcd5aeSmrg  fi
10963d9dcd5aeSmrgfi
10964d9dcd5aeSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10965d9dcd5aeSmrg#
10966d9dcd5aeSmrg]) # XORG_LD_WRAP
10967191cded7Smrg
10968d9dcd5aeSmrg# XORG_CHECK_LINKER_FLAGS
10969d9dcd5aeSmrg# -----------------------
10970d9dcd5aeSmrg# SYNOPSIS
10971d9dcd5aeSmrg#
10972d9dcd5aeSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10973d9dcd5aeSmrg#
10974d9dcd5aeSmrg# DESCRIPTION
10975d9dcd5aeSmrg#
10976d9dcd5aeSmrg#   Check whether the given linker FLAGS work with the current language's
10977d9dcd5aeSmrg#   linker, or whether they give an error.
10978d9dcd5aeSmrg#
10979d9dcd5aeSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10980d9dcd5aeSmrg#   success/failure.
10981d9dcd5aeSmrg#
10982d9dcd5aeSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
10983d9dcd5aeSmrg#
10984d9dcd5aeSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10985d9dcd5aeSmrg#
10986d9dcd5aeSmrg# LICENSE
10987d9dcd5aeSmrg#
10988d9dcd5aeSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10989d9dcd5aeSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10990d9dcd5aeSmrg#   Copyright (c) 2009 Matteo Frigo
10991d9dcd5aeSmrg#
10992d9dcd5aeSmrg#   This program is free software: you can redistribute it and/or modify it
10993d9dcd5aeSmrg#   under the terms of the GNU General Public License as published by the
10994d9dcd5aeSmrg#   Free Software Foundation, either version 3 of the License, or (at your
10995d9dcd5aeSmrg#   option) any later version.
10996d9dcd5aeSmrg#
10997d9dcd5aeSmrg#   This program is distributed in the hope that it will be useful, but
10998d9dcd5aeSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
10999d9dcd5aeSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11000d9dcd5aeSmrg#   Public License for more details.
11001d9dcd5aeSmrg#
11002d9dcd5aeSmrg#   You should have received a copy of the GNU General Public License along
11003d9dcd5aeSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
11004d9dcd5aeSmrg#
11005d9dcd5aeSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
11006d9dcd5aeSmrg#   gives unlimited permission to copy, distribute and modify the configure
11007d9dcd5aeSmrg#   scripts that are the output of Autoconf when processing the Macro. You
11008d9dcd5aeSmrg#   need not follow the terms of the GNU General Public License when using
11009d9dcd5aeSmrg#   or distributing such scripts, even though portions of the text of the
11010d9dcd5aeSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
11011d9dcd5aeSmrg#   all other use of the material that constitutes the Autoconf Macro.
11012d9dcd5aeSmrg#
11013d9dcd5aeSmrg#   This special exception to the GPL applies to versions of the Autoconf
11014d9dcd5aeSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
11015d9dcd5aeSmrg#   modified version of the Autoconf Macro, you may extend this special
11016d9dcd5aeSmrg#   exception to the GPL to apply to your modified version as well.#
11017d9dcd5aeSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11018d9dcd5aeSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
11019d9dcd5aeSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11020d9dcd5aeSmrgAS_LITERAL_IF([$1],
11021d9dcd5aeSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11022d9dcd5aeSmrg      ax_save_FLAGS=$LDFLAGS
11023d9dcd5aeSmrg      LDFLAGS="$1"
11024d9dcd5aeSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11025d9dcd5aeSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11026d9dcd5aeSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11027d9dcd5aeSmrg      LDFLAGS=$ax_save_FLAGS])],
11028d9dcd5aeSmrg  [ax_save_FLAGS=$LDFLAGS
11029d9dcd5aeSmrg   LDFLAGS="$1"
11030d9dcd5aeSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11031d9dcd5aeSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11032d9dcd5aeSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11033d9dcd5aeSmrg   LDFLAGS=$ax_save_FLAGS])
11034d9dcd5aeSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11035d9dcd5aeSmrgAC_MSG_RESULT($xorg_check_linker_flags)
11036d9dcd5aeSmrgif test "x$xorg_check_linker_flags" = xyes; then
11037d9dcd5aeSmrg	m4_default([$2], :)
11038d9dcd5aeSmrgelse
11039d9dcd5aeSmrg	m4_default([$3], :)
11040d9dcd5aeSmrgfi
11041d9dcd5aeSmrg]) # XORG_CHECK_LINKER_FLAGS
11042191cded7Smrg
11043d9dcd5aeSmrg# XORG_MEMORY_CHECK_FLAGS
11044d9dcd5aeSmrg# -----------------------
11045d9dcd5aeSmrg# Minimum version: 1.16.0
11046d9dcd5aeSmrg#
11047d9dcd5aeSmrg# This macro attempts to find appropriate memory checking functionality
11048d9dcd5aeSmrg# for various platforms which unit testing code may use to catch various
11049d9dcd5aeSmrg# forms of memory allocation and access errors in testing.
11050d9dcd5aeSmrg#
11051d9dcd5aeSmrg# Interface to module:
11052d9dcd5aeSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11053d9dcd5aeSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11054d9dcd5aeSmrg#
11055d9dcd5aeSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11056d9dcd5aeSmrg#
11057d9dcd5aeSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11058191cded7Smrg
11059d9dcd5aeSmrgAC_REQUIRE([AC_CANONICAL_HOST])
11060d9dcd5aeSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11061d9dcd5aeSmrg           [Environment variables to enable memory checking in tests])
11062191cded7Smrg
11063d9dcd5aeSmrg# Check for different types of support on different platforms
11064d9dcd5aeSmrgcase $host_os in
11065d9dcd5aeSmrg    solaris*)
11066d9dcd5aeSmrg        AC_CHECK_LIB([umem], [umem_alloc],
11067d9dcd5aeSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11068d9dcd5aeSmrg        ;;
11069d9dcd5aeSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11070d9dcd5aeSmrg        # both directly and inverted, so should not be 0 or 255.
11071d9dcd5aeSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
11072d9dcd5aeSmrg        ;;
11073d9dcd5aeSmrg    darwin*)
11074d9dcd5aeSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11075d9dcd5aeSmrg        ;;
11076d9dcd5aeSmrg    *bsd*)
11077d9dcd5aeSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11078d9dcd5aeSmrg        ;;
11079d9dcd5aeSmrgesac
11080191cded7Smrg
11081d9dcd5aeSmrg# User supplied flags override default flags
11082d9dcd5aeSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11083d9dcd5aeSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11084d9dcd5aeSmrgfi
11085191cded7Smrg
11086d9dcd5aeSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11087d9dcd5aeSmrg]) # XORG_WITH_LINT
11088191cded7Smrg
11089d9dcd5aeSmrg# XORG_CHECK_MALLOC_ZERO
11090d9dcd5aeSmrg# ----------------------
11091d9dcd5aeSmrg# Minimum version: 1.0.0
11092ba064abeSmrg#
11093d9dcd5aeSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11094d9dcd5aeSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
11095d9dcd5aeSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11096d9dcd5aeSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11097d9dcd5aeSmrgAC_ARG_ENABLE(malloc0returnsnull,
11098d9dcd5aeSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
11099d9dcd5aeSmrg		       [malloc(0) returns NULL (default: auto)]),
11100d9dcd5aeSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11101d9dcd5aeSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11102b290cf36Smrg
11103d9dcd5aeSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
11104d9dcd5aeSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11105d9dcd5aeSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
11106d9dcd5aeSmrg#include <stdlib.h>
11107d9dcd5aeSmrg],[
11108d9dcd5aeSmrg    char *m0, *r0, *c0, *p;
11109d9dcd5aeSmrg    m0 = malloc(0);
11110d9dcd5aeSmrg    p = malloc(10);
11111d9dcd5aeSmrg    r0 = realloc(p,0);
11112d9dcd5aeSmrg    c0 = calloc(0,10);
11113d9dcd5aeSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11114d9dcd5aeSmrg])],
11115d9dcd5aeSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
11116d9dcd5aeSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
11117d9dcd5aeSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
11118d9dcd5aeSmrgfi
11119d9dcd5aeSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11120b290cf36Smrg
11121d9dcd5aeSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11122d9dcd5aeSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11123d9dcd5aeSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11124d9dcd5aeSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11125d9dcd5aeSmrgelse
11126d9dcd5aeSmrg	MALLOC_ZERO_CFLAGS=""
11127d9dcd5aeSmrg	XMALLOC_ZERO_CFLAGS=""
11128d9dcd5aeSmrg	XTMALLOC_ZERO_CFLAGS=""
11129d9dcd5aeSmrgfi
11130191cded7Smrg
11131d9dcd5aeSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
11132d9dcd5aeSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
11133d9dcd5aeSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
11134d9dcd5aeSmrg]) # XORG_CHECK_MALLOC_ZERO
11135191cded7Smrg
11136d9dcd5aeSmrg# XORG_WITH_LINT()
11137d9dcd5aeSmrg# ----------------
11138d9dcd5aeSmrg# Minimum version: 1.1.0
11139d9dcd5aeSmrg#
11140d9dcd5aeSmrg# This macro enables the use of a tool that flags some suspicious and
11141d9dcd5aeSmrg# non-portable constructs (likely to be bugs) in C language source code.
11142d9dcd5aeSmrg# It will attempt to locate the tool and use appropriate options.
11143d9dcd5aeSmrg# There are various lint type tools on different platforms.
11144d9dcd5aeSmrg#
11145d9dcd5aeSmrg# Interface to module:
11146d9dcd5aeSmrg# LINT:		returns the path to the tool found on the platform
11147d9dcd5aeSmrg#		or the value set to LINT on the configure cmd line
11148d9dcd5aeSmrg#		also an Automake conditional
11149d9dcd5aeSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
11150d9dcd5aeSmrg#
11151d9dcd5aeSmrg# --with-lint:	'yes' user instructs the module to use lint
11152d9dcd5aeSmrg#		'no' user instructs the module not to use lint (default)
11153d9dcd5aeSmrg#
11154d9dcd5aeSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11155d9dcd5aeSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
11156d9dcd5aeSmrg#
11157d9dcd5aeSmrgAC_DEFUN([XORG_WITH_LINT],[
11158191cded7Smrg
11159d9dcd5aeSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
11160d9dcd5aeSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11161d9dcd5aeSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11162d9dcd5aeSmrg		[Use a lint-style source code checker (default: disabled)])],
11163d9dcd5aeSmrg		[use_lint=$withval], [use_lint=no])
11164191cded7Smrg
11165d9dcd5aeSmrg# Obtain platform specific info like program name and options
11166d9dcd5aeSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11167d9dcd5aeSmrgcase $host_os in
11168d9dcd5aeSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11169d9dcd5aeSmrg	lint_name=splint
11170d9dcd5aeSmrg	lint_options="-badflag"
11171d9dcd5aeSmrg	;;
11172d9dcd5aeSmrg  *freebsd* | *netbsd*)
11173d9dcd5aeSmrg	lint_name=lint
11174d9dcd5aeSmrg	lint_options="-u -b"
11175d9dcd5aeSmrg	;;
11176d9dcd5aeSmrg  *solaris*)
11177d9dcd5aeSmrg	lint_name=lint
11178d9dcd5aeSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11179d9dcd5aeSmrg	;;
11180d9dcd5aeSmrgesac
11181191cded7Smrg
11182d9dcd5aeSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
11183d9dcd5aeSmrgif test "x$use_lint" = x"yes" ; then
11184d9dcd5aeSmrg   AC_PATH_PROG([LINT], [$lint_name])
11185d9dcd5aeSmrg   if test "x$LINT" = "x"; then
11186d9dcd5aeSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11187d9dcd5aeSmrg   fi
11188d9dcd5aeSmrgelif test "x$use_lint" = x"no" ; then
11189d9dcd5aeSmrg   if test "x$LINT" != "x"; then
11190d9dcd5aeSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11191d9dcd5aeSmrg   fi
11192d9dcd5aeSmrgelse
11193d9dcd5aeSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11194d9dcd5aeSmrgfi
11195191cded7Smrg
11196d9dcd5aeSmrg# User supplied flags override default flags
11197d9dcd5aeSmrgif test "x$LINT_FLAGS" != "x"; then
11198d9dcd5aeSmrg   lint_options=$LINT_FLAGS
11199d9dcd5aeSmrgfi
11200191cded7Smrg
11201d9dcd5aeSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
11202d9dcd5aeSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
11203b290cf36Smrg
11204d9dcd5aeSmrg]) # XORG_WITH_LINT
11205191cded7Smrg
11206d9dcd5aeSmrg# XORG_LINT_LIBRARY(LIBNAME)
11207d9dcd5aeSmrg# --------------------------
11208d9dcd5aeSmrg# Minimum version: 1.1.0
11209d9dcd5aeSmrg#
11210d9dcd5aeSmrg# Sets up flags for building lint libraries for checking programs that call
11211d9dcd5aeSmrg# functions in the library.
11212d9dcd5aeSmrg#
11213d9dcd5aeSmrg# Interface to module:
11214d9dcd5aeSmrg# LINTLIB		- Automake variable with the name of lint library file to make
11215d9dcd5aeSmrg# MAKE_LINT_LIB		- Automake conditional
11216d9dcd5aeSmrg#
11217d9dcd5aeSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11218d9dcd5aeSmrg#			  - 'no' user instructs the module not to create a lint library (default)
11219191cded7Smrg
11220d9dcd5aeSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
11221d9dcd5aeSmrgAC_REQUIRE([XORG_WITH_LINT])
11222d9dcd5aeSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11223d9dcd5aeSmrg	[Create lint library (default: disabled)])],
11224d9dcd5aeSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11225b290cf36Smrg
11226d9dcd5aeSmrgif test "x$make_lint_lib" = x"yes" ; then
11227d9dcd5aeSmrg   LINTLIB=llib-l$1.ln
11228d9dcd5aeSmrg   if test "x$LINT" = "x"; then
11229d9dcd5aeSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11230d9dcd5aeSmrg   fi
11231d9dcd5aeSmrgelif test "x$make_lint_lib" != x"no" ; then
11232d9dcd5aeSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11233d9dcd5aeSmrgfi
11234ba064abeSmrg
11235d9dcd5aeSmrgAC_SUBST(LINTLIB)
11236d9dcd5aeSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11237ba064abeSmrg
11238d9dcd5aeSmrg]) # XORG_LINT_LIBRARY
11239d9dcd5aeSmrg
11240d9dcd5aeSmrg# XORG_COMPILER_BRAND
11241d9dcd5aeSmrg# -------------------
11242d9dcd5aeSmrg# Minimum version: 1.14.0
11243d9dcd5aeSmrg#
11244d9dcd5aeSmrg# Checks for various brands of compilers and sets flags as appropriate:
11245d9dcd5aeSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11246d9dcd5aeSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11247d9dcd5aeSmrg#   clang compiler - sets CLANGCC to "yes"
11248d9dcd5aeSmrg#   Intel compiler - sets INTELCC to "yes"
11249d9dcd5aeSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11250d9dcd5aeSmrg#
11251d9dcd5aeSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
11252d9dcd5aeSmrgAC_LANG_CASE(
11253d9dcd5aeSmrg	[C], [
11254d9dcd5aeSmrg		AC_REQUIRE([AC_PROG_CC_C99])
11255d9dcd5aeSmrg	],
11256d9dcd5aeSmrg	[C++], [
11257d9dcd5aeSmrg		AC_REQUIRE([AC_PROG_CXX])
11258d9dcd5aeSmrg	]
11259d9dcd5aeSmrg)
11260d9dcd5aeSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11261d9dcd5aeSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11262d9dcd5aeSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11263d9dcd5aeSmrg]) # XORG_COMPILER_BRAND
11264ba064abeSmrg
11265d9dcd5aeSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11266d9dcd5aeSmrg# ---------------
11267d9dcd5aeSmrg# Minimum version: 1.16.0
11268d9dcd5aeSmrg#
11269d9dcd5aeSmrg# Test if the compiler works when passed the given flag as a command line argument.
11270d9dcd5aeSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11271d9dcd5aeSmrg# next flag in the list until there are no more options.
11272d9dcd5aeSmrg#
11273d9dcd5aeSmrg# Note that this does not guarantee that the compiler supports the flag as some
11274d9dcd5aeSmrg# compilers will simply ignore arguments that they do not understand, but we do
11275d9dcd5aeSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
11276d9dcd5aeSmrg# -Werror=unused-command-line-argument
11277d9dcd5aeSmrg#
11278d9dcd5aeSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
11279d9dcd5aeSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11280d9dcd5aeSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11281d9dcd5aeSmrg
11282d9dcd5aeSmrgAC_LANG_COMPILER_REQUIRE
11283d9dcd5aeSmrg
11284d9dcd5aeSmrgAC_LANG_CASE(
11285d9dcd5aeSmrg	[C], [
11286d9dcd5aeSmrg		AC_REQUIRE([AC_PROG_CC_C99])
11287d9dcd5aeSmrg		define([PREFIX], [C])
11288d9dcd5aeSmrg		define([CACHE_PREFIX], [cc])
11289d9dcd5aeSmrg		define([COMPILER], [$CC])
11290d9dcd5aeSmrg	],
11291d9dcd5aeSmrg	[C++], [
11292d9dcd5aeSmrg		define([PREFIX], [CXX])
11293d9dcd5aeSmrg		define([CACHE_PREFIX], [cxx])
11294d9dcd5aeSmrg		define([COMPILER], [$CXX])
11295d9dcd5aeSmrg	]
11296d9dcd5aeSmrg)
11297191cded7Smrg
11298d9dcd5aeSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11299d9dcd5aeSmrg
11300d9dcd5aeSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11301d9dcd5aeSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11302d9dcd5aeSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11303d9dcd5aeSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11304d9dcd5aeSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11305d9dcd5aeSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11306d9dcd5aeSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11307d9dcd5aeSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11308d9dcd5aeSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11309d9dcd5aeSmrgfi
11310191cded7Smrg
11311d9dcd5aeSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11312d9dcd5aeSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11313d9dcd5aeSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11314d9dcd5aeSmrg	fi
11315d9dcd5aeSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11316d9dcd5aeSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11317d9dcd5aeSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11318d9dcd5aeSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11319d9dcd5aeSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11320d9dcd5aeSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11321d9dcd5aeSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11322d9dcd5aeSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11323d9dcd5aeSmrgfi
11324191cded7Smrg
11325d9dcd5aeSmrgfound="no"
11326d9dcd5aeSmrgm4_foreach([flag], m4_cdr($@), [
11327d9dcd5aeSmrg	if test $found = "no" ; then
11328d9dcd5aeSmrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11329d9dcd5aeSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11330d9dcd5aeSmrg		fi
11331d9dcd5aeSmrg
11332d9dcd5aeSmrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11333d9dcd5aeSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11334d9dcd5aeSmrg		fi
11335d9dcd5aeSmrg
11336d9dcd5aeSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11337d9dcd5aeSmrg
11338d9dcd5aeSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11339d9dcd5aeSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11340d9dcd5aeSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11341d9dcd5aeSmrg		AC_CACHE_VAL($cacheid,
11342d9dcd5aeSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11343d9dcd5aeSmrg					     [eval $cacheid=yes],
11344d9dcd5aeSmrg					     [eval $cacheid=no])])
11345d9dcd5aeSmrg
11346d9dcd5aeSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11347d9dcd5aeSmrg
11348d9dcd5aeSmrg		eval supported=\$$cacheid
11349d9dcd5aeSmrg		AC_MSG_RESULT([$supported])
11350d9dcd5aeSmrg		if test "$supported" = "yes" ; then
11351d9dcd5aeSmrg			$1="$$1 ]flag["
11352d9dcd5aeSmrg			found="yes"
11353d9dcd5aeSmrg		fi
11354d9dcd5aeSmrg	fi
11355d9dcd5aeSmrg])
11356d9dcd5aeSmrg]) # XORG_TESTSET_CFLAG
11357191cded7Smrg
11358d9dcd5aeSmrg# XORG_COMPILER_FLAGS
11359d9dcd5aeSmrg# ---------------
11360d9dcd5aeSmrg# Minimum version: 1.16.0
11361d9dcd5aeSmrg#
11362d9dcd5aeSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11363d9dcd5aeSmrg# arguments supported by the selected compiler which do NOT alter the generated
11364d9dcd5aeSmrg# code.  These arguments will cause the compiler to print various warnings
11365d9dcd5aeSmrg# during compilation AND turn a conservative set of warnings into errors.
11366d9dcd5aeSmrg#
11367d9dcd5aeSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11368d9dcd5aeSmrg# future versions of util-macros as options are added to new compilers.
11369d9dcd5aeSmrg#
11370d9dcd5aeSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
11371d9dcd5aeSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11372d9dcd5aeSmrg
11373d9dcd5aeSmrgAC_ARG_ENABLE(selective-werror,
11374d9dcd5aeSmrg              AS_HELP_STRING([--disable-selective-werror],
11375d9dcd5aeSmrg                             [Turn off selective compiler errors. (default: enabled)]),
11376d9dcd5aeSmrg              [SELECTIVE_WERROR=$enableval],
11377d9dcd5aeSmrg              [SELECTIVE_WERROR=yes])
11378d9dcd5aeSmrg
11379d9dcd5aeSmrgAC_LANG_CASE(
11380d9dcd5aeSmrg        [C], [
11381d9dcd5aeSmrg                define([PREFIX], [C])
11382d9dcd5aeSmrg        ],
11383d9dcd5aeSmrg        [C++], [
11384d9dcd5aeSmrg                define([PREFIX], [CXX])
11385d9dcd5aeSmrg        ]
11386d9dcd5aeSmrg)
11387d9dcd5aeSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
11388d9dcd5aeSmrgif test "x$SUNCC" = "xyes"; then
11389d9dcd5aeSmrg    [BASE_]PREFIX[FLAGS]="-v"
11390d9dcd5aeSmrgelse
11391d9dcd5aeSmrg    [BASE_]PREFIX[FLAGS]=""
11392d9dcd5aeSmrgfi
11393191cded7Smrg
11394d9dcd5aeSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11395d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11396d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11397d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11398d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11399d9dcd5aeSmrg
11400d9dcd5aeSmrgAC_LANG_CASE(
11401d9dcd5aeSmrg	[C], [
11402d9dcd5aeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11403d9dcd5aeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11404d9dcd5aeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11405d9dcd5aeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11406d9dcd5aeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11407d9dcd5aeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11408d9dcd5aeSmrg	]
11409d9dcd5aeSmrg)
11410191cded7Smrg
11411d9dcd5aeSmrg# This chunk adds additional warnings that could catch undesired effects.
11412d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11413d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11414d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11415d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11416d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11417d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11418d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11419d9dcd5aeSmrg
11420d9dcd5aeSmrg# These are currently disabled because they are noisy.  They will be enabled
11421d9dcd5aeSmrg# in the future once the codebase is sufficiently modernized to silence
11422d9dcd5aeSmrg# them.  For now, I don't want them to drown out the other warnings.
11423d9dcd5aeSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11424d9dcd5aeSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11425d9dcd5aeSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11426d9dcd5aeSmrg
11427d9dcd5aeSmrg# Turn some warnings into errors, so we don't accidently get successful builds
11428d9dcd5aeSmrg# when there are problems that should be fixed.
11429d9dcd5aeSmrg
11430d9dcd5aeSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
11431d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11432d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11433d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11434d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11435d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11436d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11437d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11438d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11439d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11440d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11441d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11442d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11443d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11444d9dcd5aeSmrgelse
11445d9dcd5aeSmrgAC_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])
11446d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11447d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11448d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11449d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11450d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11451d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11452d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11453d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11454d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11455d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11456d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11457d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11458d9dcd5aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11459d9dcd5aeSmrgfi
11460ba064abeSmrg
11461d9dcd5aeSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11462d9dcd5aeSmrg]) # XORG_COMPILER_FLAGS
11463ba064abeSmrg
11464d9dcd5aeSmrg# XORG_CWARNFLAGS
11465d9dcd5aeSmrg# ---------------
11466d9dcd5aeSmrg# Minimum version: 1.2.0
11467d9dcd5aeSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11468b290cf36Smrg#
11469d9dcd5aeSmrg# Defines CWARNFLAGS to enable C compiler warnings.
11470b290cf36Smrg#
11471d9dcd5aeSmrg# This function is deprecated because it defines -fno-strict-aliasing
11472d9dcd5aeSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11473d9dcd5aeSmrg# is needed, then it should be added explicitly in the module when
11474d9dcd5aeSmrg# it is updated to use BASE_CFLAGS.
11475d9dcd5aeSmrg#
11476d9dcd5aeSmrgAC_DEFUN([XORG_CWARNFLAGS], [
11477d9dcd5aeSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11478d9dcd5aeSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11479d9dcd5aeSmrgAC_LANG_CASE(
11480d9dcd5aeSmrg	[C], [
11481d9dcd5aeSmrg		CWARNFLAGS="$BASE_CFLAGS"
11482d9dcd5aeSmrg		if  test "x$GCC" = xyes ; then
11483d9dcd5aeSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11484d9dcd5aeSmrg		fi
11485d9dcd5aeSmrg		AC_SUBST(CWARNFLAGS)
11486d9dcd5aeSmrg	]
11487d9dcd5aeSmrg)
11488d9dcd5aeSmrg]) # XORG_CWARNFLAGS
11489191cded7Smrg
11490d9dcd5aeSmrg# XORG_STRICT_OPTION
11491d9dcd5aeSmrg# -----------------------
11492d9dcd5aeSmrg# Minimum version: 1.3.0
11493d9dcd5aeSmrg#
11494d9dcd5aeSmrg# Add configure option to enable strict compilation flags, such as treating
11495d9dcd5aeSmrg# warnings as fatal errors.
11496d9dcd5aeSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11497d9dcd5aeSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11498d9dcd5aeSmrg#
11499d9dcd5aeSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11500d9dcd5aeSmrg# when strict compilation is unconditionally desired.
11501d9dcd5aeSmrgAC_DEFUN([XORG_STRICT_OPTION], [
11502d9dcd5aeSmrgAC_REQUIRE([XORG_CWARNFLAGS])
11503d9dcd5aeSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11504b290cf36Smrg
11505d9dcd5aeSmrgAC_ARG_ENABLE(strict-compilation,
11506d9dcd5aeSmrg			  AS_HELP_STRING([--enable-strict-compilation],
11507d9dcd5aeSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11508d9dcd5aeSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11509191cded7Smrg
11510d9dcd5aeSmrgAC_LANG_CASE(
11511d9dcd5aeSmrg        [C], [
11512d9dcd5aeSmrg                define([PREFIX], [C])
11513d9dcd5aeSmrg        ],
11514d9dcd5aeSmrg        [C++], [
11515d9dcd5aeSmrg                define([PREFIX], [CXX])
11516d9dcd5aeSmrg        ]
11517d9dcd5aeSmrg)
11518ba064abeSmrg
11519d9dcd5aeSmrg[STRICT_]PREFIX[FLAGS]=""
11520d9dcd5aeSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11521d9dcd5aeSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11522ba064abeSmrg
11523d9dcd5aeSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11524d9dcd5aeSmrg# activate it with -Werror, so we add it here explicitly.
11525d9dcd5aeSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11526191cded7Smrg
11527d9dcd5aeSmrgif test "x$STRICT_COMPILE" = "xyes"; then
11528d9dcd5aeSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11529d9dcd5aeSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11530d9dcd5aeSmrgfi
11531d9dcd5aeSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11532d9dcd5aeSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11533d9dcd5aeSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11534d9dcd5aeSmrg]) # XORG_STRICT_OPTION
11535191cded7Smrg
11536d9dcd5aeSmrg# XORG_DEFAULT_OPTIONS
11537d9dcd5aeSmrg# --------------------
11538d9dcd5aeSmrg# Minimum version: 1.3.0
11539b290cf36Smrg#
11540d9dcd5aeSmrg# Defines default options for X.Org modules.
11541b290cf36Smrg#
11542d9dcd5aeSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11543d9dcd5aeSmrgAC_REQUIRE([AC_PROG_INSTALL])
11544d9dcd5aeSmrgXORG_COMPILER_FLAGS
11545d9dcd5aeSmrgXORG_CWARNFLAGS
11546d9dcd5aeSmrgXORG_STRICT_OPTION
11547d9dcd5aeSmrgXORG_RELEASE_VERSION
11548d9dcd5aeSmrgXORG_CHANGELOG
11549d9dcd5aeSmrgXORG_INSTALL
11550d9dcd5aeSmrgXORG_MANPAGE_SECTIONS
11551d9dcd5aeSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11552d9dcd5aeSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11553d9dcd5aeSmrg]) # XORG_DEFAULT_OPTIONS
11554d9dcd5aeSmrg
11555d9dcd5aeSmrg# XORG_INSTALL()
11556d9dcd5aeSmrg# ----------------
11557d9dcd5aeSmrg# Minimum version: 1.4.0
11558b290cf36Smrg#
11559d9dcd5aeSmrg# Defines the variable INSTALL_CMD as the command to copy
11560d9dcd5aeSmrg# INSTALL from $prefix/share/util-macros.
11561ba064abeSmrg#
11562d9dcd5aeSmrgAC_DEFUN([XORG_INSTALL], [
11563d9dcd5aeSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11564d9dcd5aeSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11565d9dcd5aeSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11566d9dcd5aeSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11567d9dcd5aeSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11568d9dcd5aeSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11569d9dcd5aeSmrgAC_SUBST([INSTALL_CMD])
11570d9dcd5aeSmrg]) # XORG_INSTALL
11571d9dcd5aeSmrgdnl Copyright 2005 Red Hat, Inc
11572d9dcd5aeSmrgdnl
11573d9dcd5aeSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11574d9dcd5aeSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11575d9dcd5aeSmrgdnl the above copyright notice appear in all copies and that both that
11576d9dcd5aeSmrgdnl copyright notice and this permission notice appear in supporting
11577d9dcd5aeSmrgdnl documentation.
11578d9dcd5aeSmrgdnl
11579d9dcd5aeSmrgdnl The above copyright notice and this permission notice shall be included
11580d9dcd5aeSmrgdnl in all copies or substantial portions of the Software.
11581d9dcd5aeSmrgdnl
11582d9dcd5aeSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11583d9dcd5aeSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11584d9dcd5aeSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11585d9dcd5aeSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11586d9dcd5aeSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11587d9dcd5aeSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11588d9dcd5aeSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11589d9dcd5aeSmrgdnl
11590d9dcd5aeSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11591d9dcd5aeSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11592d9dcd5aeSmrgdnl other dealings in this Software without prior written authorization
11593d9dcd5aeSmrgdnl from the copyright holders.
11594d9dcd5aeSmrgdnl
11595ba064abeSmrg
11596d9dcd5aeSmrg# XORG_RELEASE_VERSION
11597d9dcd5aeSmrg# --------------------
11598d9dcd5aeSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11599d9dcd5aeSmrg 
11600d9dcd5aeSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11601d9dcd5aeSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11602d9dcd5aeSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11603d9dcd5aeSmrg		[Major version of this package])
11604d9dcd5aeSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11605d9dcd5aeSmrg	if test "x$PVM" = "x"; then
11606d9dcd5aeSmrg		PVM="0"
11607d9dcd5aeSmrg	fi
11608d9dcd5aeSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11609d9dcd5aeSmrg		[$PVM],
11610d9dcd5aeSmrg		[Minor version of this package])
11611d9dcd5aeSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11612d9dcd5aeSmrg	if test "x$PVP" = "x"; then
11613d9dcd5aeSmrg		PVP="0"
11614d9dcd5aeSmrg	fi
11615d9dcd5aeSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11616d9dcd5aeSmrg		[$PVP],
11617d9dcd5aeSmrg		[Patch version of this package])
11618d9dcd5aeSmrg])
11619ba064abeSmrg
11620d9dcd5aeSmrg# XORG_CHANGELOG()
11621d9dcd5aeSmrg# ----------------
11622d9dcd5aeSmrg# Minimum version: 1.2.0
11623d9dcd5aeSmrg#
11624d9dcd5aeSmrg# Defines the variable CHANGELOG_CMD as the command to generate
11625d9dcd5aeSmrg# ChangeLog from git.
11626d9dcd5aeSmrg#
11627d9dcd5aeSmrg#
11628d9dcd5aeSmrgAC_DEFUN([XORG_CHANGELOG], [
11629d9dcd5aeSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11630d9dcd5aeSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11631d9dcd5aeSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11632d9dcd5aeSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11633d9dcd5aeSmrgAC_SUBST([CHANGELOG_CMD])
11634d9dcd5aeSmrg]) # XORG_CHANGELOG
11635191cded7Smrg
11636