aclocal.m4 revision b425557e
1b425557eSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2ee3138f1Smrg
3ee3138f1Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
434977a2fSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5ee3138f1Smrg# This file is free software; the Free Software Foundation
6ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8ee3138f1Smrg
9ee3138f1Smrg# This program is distributed in the hope that it will be useful,
10ee3138f1Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ee3138f1Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ee3138f1Smrg# PARTICULAR PURPOSE.
13ee3138f1Smrg
14ee3138f1Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15ee3138f1Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b425557eSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17b425557eSmrg[m4_warning([this file was generated for autoconf 2.68.
18ee3138f1SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19ee3138f1SmrgIf you have problems, you may need to regenerate the build system entirely.
20ee3138f1SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21ee3138f1Smrg
22b425557eSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2334977a2fSmrg#
24b425557eSmrg# This file is free software; the Free Software Foundation
25b425557eSmrg# gives unlimited permission to copy and/or distribute it,
26b425557eSmrg# with or without modifications, as long as this notice is preserved.
27b425557eSmrg
28b425557eSmrg# AM_AUTOMAKE_VERSION(VERSION)
29b425557eSmrg# ----------------------------
30b425557eSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31b425557eSmrg# generated from the m4 files accompanying Automake X.Y.
32b425557eSmrg# (This private macro should not be called outside this file.)
33b425557eSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34b425557eSmrg[am__api_version='1.11'
35b425557eSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36b425557eSmrgdnl require some minimum version.  Point them to the right macro.
37b425557eSmrgm4_if([$1], [1.11.1], [],
38b425557eSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39b425557eSmrg])
40b425557eSmrg
41b425557eSmrg# _AM_AUTOCONF_VERSION(VERSION)
42b425557eSmrg# -----------------------------
43b425557eSmrg# aclocal traces this macro to find the Autoconf version.
44b425557eSmrg# This is a private macro too.  Using m4_define simplifies
45b425557eSmrg# the logic in aclocal, which can simply ignore this definition.
46b425557eSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47b425557eSmrg
48b425557eSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49b425557eSmrg# -------------------------------
50b425557eSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51b425557eSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52b425557eSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53b425557eSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54b425557eSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55b425557eSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56b425557eSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57b425557eSmrg
58b425557eSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59b425557eSmrg
60b425557eSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6134977a2fSmrg#
62b425557eSmrg# This file is free software; the Free Software Foundation
63b425557eSmrg# gives unlimited permission to copy and/or distribute it,
64b425557eSmrg# with or without modifications, as long as this notice is preserved.
6534977a2fSmrg
66b425557eSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67b425557eSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68b425557eSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6934977a2fSmrg#
70b425557eSmrg# Of course, Automake must honor this variable whenever it calls a
71b425557eSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72b425557eSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73b425557eSmrg# depending on how configure is run.  This is pretty annoying, since
74b425557eSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75b425557eSmrg# source directory, any form will work fine, but in subdirectories a
76b425557eSmrg# relative path needs to be adjusted first.
7734977a2fSmrg#
78b425557eSmrg# $ac_aux_dir/missing
79b425557eSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80b425557eSmrg# $top_srcdir/$ac_aux_dir/missing
81b425557eSmrg#    fails if $ac_aux_dir is absolute,
82b425557eSmrg#    fails when called from a subdirectory in a VPATH build with
83b425557eSmrg#          a relative $ac_aux_dir
8434977a2fSmrg#
85b425557eSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86b425557eSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
87b425557eSmrg# harmless because $srcdir is `.', but things will broke when you
88b425557eSmrg# start a VPATH build or use an absolute $srcdir.
8934977a2fSmrg#
90b425557eSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91b425557eSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92b425557eSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93b425557eSmrg# and then we would define $MISSING as
94b425557eSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95b425557eSmrg# This will work as long as MISSING is not called from configure, because
96b425557eSmrg# unfortunately $(top_srcdir) has no meaning in configure.
97b425557eSmrg# However there are other variables, like CC, which are often used in
98b425557eSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9934977a2fSmrg#
100b425557eSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
101b425557eSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
102b425557eSmrg# configured tree to be moved without reconfiguration.
103ee3138f1Smrg
104b425557eSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105b425557eSmrg[dnl Rely on autoconf to set up CDPATH properly.
106b425557eSmrgAC_PREREQ([2.50])dnl
107b425557eSmrg# expand $ac_aux_dir to an absolute path
108b425557eSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
10934977a2fSmrg])
11034977a2fSmrg
111b425557eSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11234977a2fSmrg
113b425557eSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114b425557eSmrg# Free Software Foundation, Inc.
115b425557eSmrg#
116b425557eSmrg# This file is free software; the Free Software Foundation
117b425557eSmrg# gives unlimited permission to copy and/or distribute it,
118b425557eSmrg# with or without modifications, as long as this notice is preserved.
119ee3138f1Smrg
120b425557eSmrg# serial 9
121ee3138f1Smrg
122b425557eSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123b425557eSmrg# -------------------------------------
124b425557eSmrg# Define a conditional.
125b425557eSmrgAC_DEFUN([AM_CONDITIONAL],
126b425557eSmrg[AC_PREREQ(2.52)dnl
127b425557eSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128b425557eSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129b425557eSmrgAC_SUBST([$1_TRUE])dnl
130b425557eSmrgAC_SUBST([$1_FALSE])dnl
131b425557eSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132b425557eSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133b425557eSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134b425557eSmrgif $2; then
135b425557eSmrg  $1_TRUE=
136b425557eSmrg  $1_FALSE='#'
137b425557eSmrgelse
138b425557eSmrg  $1_TRUE='#'
139b425557eSmrg  $1_FALSE=
140b425557eSmrgfi
141b425557eSmrgAC_CONFIG_COMMANDS_PRE(
142b425557eSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143b425557eSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144b425557eSmrgUsually this means the macro was only invoked conditionally.]])
145b425557eSmrgfi])])
146ee3138f1Smrg
147b425557eSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148b425557eSmrg# Free Software Foundation, Inc.
149b425557eSmrg#
150b425557eSmrg# This file is free software; the Free Software Foundation
151b425557eSmrg# gives unlimited permission to copy and/or distribute it,
152b425557eSmrg# with or without modifications, as long as this notice is preserved.
15334977a2fSmrg
154b425557eSmrg# serial 10
15534977a2fSmrg
156b425557eSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157b425557eSmrg# written in clear, in which case automake, when reading aclocal.m4,
158b425557eSmrg# will think it sees a *use*, and therefore will trigger all it's
159b425557eSmrg# C support machinery.  Also note that it means that autoscan, seeing
160b425557eSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
16134977a2fSmrg
16234977a2fSmrg
163b425557eSmrg# _AM_DEPENDENCIES(NAME)
16434977a2fSmrg# ----------------------
165b425557eSmrg# See how the compiler implements dependency checking.
166b425557eSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167b425557eSmrg# We try a few techniques and use that to set a single cache variable.
168b425557eSmrg#
169b425557eSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170b425557eSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171b425557eSmrg# dependency, and given that the user is not expected to run this macro,
172b425557eSmrg# just rely on AC_PROG_CC.
173b425557eSmrgAC_DEFUN([_AM_DEPENDENCIES],
174b425557eSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175b425557eSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176b425557eSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177b425557eSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17834977a2fSmrg
179b425557eSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180b425557eSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181b425557eSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182b425557eSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183b425557eSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184b425557eSmrg                   [depcc="$$1"   am_compiler_list=])
18534977a2fSmrg
186b425557eSmrgAC_CACHE_CHECK([dependency style of $depcc],
187b425557eSmrg               [am_cv_$1_dependencies_compiler_type],
188b425557eSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189b425557eSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
190b425557eSmrg  # making bogus files that we don't know about and never remove.  For
191b425557eSmrg  # instance it was reported that on HP-UX the gcc test will end up
192b425557eSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
193b425557eSmrg  # in D'.
194b425557eSmrg  mkdir conftest.dir
195b425557eSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196b425557eSmrg  # using a relative directory.
197b425557eSmrg  cp "$am_depcomp" conftest.dir
198b425557eSmrg  cd conftest.dir
199b425557eSmrg  # We will build objects and dependencies in a subdirectory because
200b425557eSmrg  # it helps to detect inapplicable dependency modes.  For instance
201b425557eSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202b425557eSmrg  # side effect of compilation, but ICC will put the dependencies in
203b425557eSmrg  # the current directory while Tru64 will put them in the object
204b425557eSmrg  # directory.
205b425557eSmrg  mkdir sub
206ee3138f1Smrg
207b425557eSmrg  am_cv_$1_dependencies_compiler_type=none
208b425557eSmrg  if test "$am_compiler_list" = ""; then
209b425557eSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210ee3138f1Smrg  fi
211b425557eSmrg  am__universal=false
212b425557eSmrg  m4_case([$1], [CC],
213b425557eSmrg    [case " $depcc " in #(
214b425557eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215b425557eSmrg     esac],
216b425557eSmrg    [CXX],
217b425557eSmrg    [case " $depcc " in #(
218b425557eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219b425557eSmrg     esac])
220ee3138f1Smrg
221b425557eSmrg  for depmode in $am_compiler_list; do
222b425557eSmrg    # Setup a source with many dependencies, because some compilers
223b425557eSmrg    # like to wrap large dependency lists on column 80 (with \), and
224b425557eSmrg    # we should not choose a depcomp mode which is confused by this.
225b425557eSmrg    #
226b425557eSmrg    # We need to recreate these files for each test, as the compiler may
227b425557eSmrg    # overwrite some of them when testing with obscure command lines.
228b425557eSmrg    # This happens at least with the AIX C compiler.
229b425557eSmrg    : > sub/conftest.c
230b425557eSmrg    for i in 1 2 3 4 5 6; do
231b425557eSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232b425557eSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233b425557eSmrg      # Solaris 8's {/usr,}/bin/sh.
234b425557eSmrg      touch sub/conftst$i.h
235b425557eSmrg    done
236b425557eSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237ee3138f1Smrg
238b425557eSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239b425557eSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240b425557eSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241b425557eSmrg    # versions had trouble with output in subdirs
242b425557eSmrg    am__obj=sub/conftest.${OBJEXT-o}
243b425557eSmrg    am__minus_obj="-o $am__obj"
244b425557eSmrg    case $depmode in
245b425557eSmrg    gcc)
246b425557eSmrg      # This depmode causes a compiler race in universal mode.
247b425557eSmrg      test "$am__universal" = false || continue
248b425557eSmrg      ;;
249b425557eSmrg    nosideeffect)
250b425557eSmrg      # after this tag, mechanisms are not by side-effect, so they'll
251b425557eSmrg      # only be used when explicitly requested
252b425557eSmrg      if test "x$enable_dependency_tracking" = xyes; then
253b425557eSmrg	continue
254b425557eSmrg      else
255b425557eSmrg	break
256b425557eSmrg      fi
257b425557eSmrg      ;;
258b425557eSmrg    msvisualcpp | msvcmsys)
259b425557eSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260b425557eSmrg      # not run yet.  These depmodes are late enough in the game, and
261b425557eSmrg      # so weak that their functioning should not be impacted.
262b425557eSmrg      am__obj=conftest.${OBJEXT-o}
263b425557eSmrg      am__minus_obj=
264b425557eSmrg      ;;
265b425557eSmrg    none) break ;;
266b425557eSmrg    esac
267b425557eSmrg    if depmode=$depmode \
268b425557eSmrg       source=sub/conftest.c object=$am__obj \
269b425557eSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270b425557eSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271b425557eSmrg         >/dev/null 2>conftest.err &&
272b425557eSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273b425557eSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274b425557eSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275b425557eSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276b425557eSmrg      # icc doesn't choke on unknown options, it will just issue warnings
277b425557eSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
278b425557eSmrg      # that says an option was ignored or not supported.
279b425557eSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280b425557eSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281b425557eSmrg      # The diagnosis changed in icc 8.0:
282b425557eSmrg      #   icc: Command line remark: option '-MP' not supported
283b425557eSmrg      if (grep 'ignoring option' conftest.err ||
284b425557eSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285b425557eSmrg        am_cv_$1_dependencies_compiler_type=$depmode
286b425557eSmrg        break
287b425557eSmrg      fi
288b425557eSmrg    fi
289b425557eSmrg  done
290ee3138f1Smrg
291b425557eSmrg  cd ..
292b425557eSmrg  rm -rf conftest.dir
293b425557eSmrgelse
294b425557eSmrg  am_cv_$1_dependencies_compiler_type=none
295b425557eSmrgfi
296b425557eSmrg])
297b425557eSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298b425557eSmrgAM_CONDITIONAL([am__fastdep$1], [
299b425557eSmrg  test "x$enable_dependency_tracking" != xno \
300b425557eSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301b425557eSmrg])
302ee3138f1Smrg
30379a8a9c6Smrg
304b425557eSmrg# AM_SET_DEPDIR
305b425557eSmrg# -------------
306b425557eSmrg# Choose a directory name for dependency files.
307b425557eSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308b425557eSmrgAC_DEFUN([AM_SET_DEPDIR],
309b425557eSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310b425557eSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311b425557eSmrg])
312ee3138f1Smrg
313ee3138f1Smrg
314b425557eSmrg# AM_DEP_TRACK
315b425557eSmrg# ------------
316b425557eSmrgAC_DEFUN([AM_DEP_TRACK],
317b425557eSmrg[AC_ARG_ENABLE(dependency-tracking,
318b425557eSmrg[  --disable-dependency-tracking  speeds up one-time build
319b425557eSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320b425557eSmrgif test "x$enable_dependency_tracking" != xno; then
321b425557eSmrg  am_depcomp="$ac_aux_dir/depcomp"
322b425557eSmrg  AMDEPBACKSLASH='\'
323b425557eSmrgfi
324b425557eSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325b425557eSmrgAC_SUBST([AMDEPBACKSLASH])dnl
326b425557eSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327b425557eSmrg])
328ee3138f1Smrg
329b425557eSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33034977a2fSmrg
331b425557eSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332b425557eSmrg# Free Software Foundation, Inc.
333b425557eSmrg#
334b425557eSmrg# This file is free software; the Free Software Foundation
335b425557eSmrg# gives unlimited permission to copy and/or distribute it,
336b425557eSmrg# with or without modifications, as long as this notice is preserved.
33734977a2fSmrg
338b425557eSmrg#serial 5
33934977a2fSmrg
340b425557eSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34134977a2fSmrg# ------------------------------
342b425557eSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343b425557eSmrg[{
344b425557eSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345b425557eSmrg  # are listed without --file.  Let's play safe and only enable the eval
346b425557eSmrg  # if we detect the quoting.
347b425557eSmrg  case $CONFIG_FILES in
348b425557eSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349b425557eSmrg  *)   set x $CONFIG_FILES ;;
350b425557eSmrg  esac
351b425557eSmrg  shift
352b425557eSmrg  for mf
353b425557eSmrg  do
354b425557eSmrg    # Strip MF so we end up with the name of the file.
355b425557eSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356b425557eSmrg    # Check whether this is an Automake generated Makefile or not.
357b425557eSmrg    # We used to match only the files named `Makefile.in', but
358b425557eSmrg    # some people rename them; so instead we look at the file content.
359b425557eSmrg    # Grep'ing the first line is not enough: some people post-process
360b425557eSmrg    # each Makefile.in and add a new line on top of each file to say so.
361b425557eSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362b425557eSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363b425557eSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364b425557eSmrg      dirpart=`AS_DIRNAME("$mf")`
365b425557eSmrg    else
366b425557eSmrg      continue
367b425557eSmrg    fi
368b425557eSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369b425557eSmrg    # from the Makefile without running `make'.
370b425557eSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371b425557eSmrg    test -z "$DEPDIR" && continue
372b425557eSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373b425557eSmrg    test -z "am__include" && continue
374b425557eSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375b425557eSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376b425557eSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377b425557eSmrg    # Find all dependency output files, they are included files with
378b425557eSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379b425557eSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380b425557eSmrg    # expansion.
381b425557eSmrg    for file in `sed -n "
382b425557eSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383b425557eSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384b425557eSmrg      # Make sure the directory exists.
385b425557eSmrg      test -f "$dirpart/$file" && continue
386b425557eSmrg      fdir=`AS_DIRNAME(["$file"])`
387b425557eSmrg      AS_MKDIR_P([$dirpart/$fdir])
388b425557eSmrg      # echo "creating $dirpart/$file"
389b425557eSmrg      echo '# dummy' > "$dirpart/$file"
390b425557eSmrg    done
391b425557eSmrg  done
392b425557eSmrg}
393b425557eSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
39434977a2fSmrg
39534977a2fSmrg
396b425557eSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39734977a2fSmrg# -----------------------------
398b425557eSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
399b425557eSmrg#
400b425557eSmrg# This code is only required when automatic dependency tracking
401b425557eSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
402b425557eSmrg# need in order to bootstrap the dependency handling code.
403b425557eSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404b425557eSmrg[AC_CONFIG_COMMANDS([depfiles],
405b425557eSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406b425557eSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407b425557eSmrg])
40834977a2fSmrg
409b425557eSmrg# Do all the work for Automake.                             -*- Autoconf -*-
41034977a2fSmrg
411b425557eSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412b425557eSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413b425557eSmrg#
414b425557eSmrg# This file is free software; the Free Software Foundation
415b425557eSmrg# gives unlimited permission to copy and/or distribute it,
416b425557eSmrg# with or without modifications, as long as this notice is preserved.
41734977a2fSmrg
418b425557eSmrg# serial 16
41934977a2fSmrg
420b425557eSmrg# This macro actually does too much.  Some checks are only needed if
421b425557eSmrg# your package does certain things.  But this isn't really a big deal.
42234977a2fSmrg
423b425557eSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424b425557eSmrg# AM_INIT_AUTOMAKE([OPTIONS])
425b425557eSmrg# -----------------------------------------------
426b425557eSmrg# The call with PACKAGE and VERSION arguments is the old style
427b425557eSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428b425557eSmrg# and VERSION should now be passed to AC_INIT and removed from
429b425557eSmrg# the call to AM_INIT_AUTOMAKE.
430b425557eSmrg# We support both call styles for the transition.  After
431b425557eSmrg# the next Automake release, Autoconf can make the AC_INIT
432b425557eSmrg# arguments mandatory, and then we can depend on a new Autoconf
433b425557eSmrg# release and drop the old call support.
434b425557eSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435b425557eSmrg[AC_PREREQ([2.62])dnl
436b425557eSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437b425557eSmrgdnl the ones we care about.
438b425557eSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439b425557eSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440b425557eSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441b425557eSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442b425557eSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443b425557eSmrg  # is not polluted with repeated "-I."
444b425557eSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445b425557eSmrg  # test to see if srcdir already configured
446b425557eSmrg  if test -f $srcdir/config.status; then
447b425557eSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448b425557eSmrg  fi
449b425557eSmrgfi
45034977a2fSmrg
451b425557eSmrg# test whether we have cygpath
452b425557eSmrgif test -z "$CYGPATH_W"; then
453b425557eSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454b425557eSmrg    CYGPATH_W='cygpath -w'
455b425557eSmrg  else
456b425557eSmrg    CYGPATH_W=echo
457b425557eSmrg  fi
458b425557eSmrgfi
459b425557eSmrgAC_SUBST([CYGPATH_W])
46034977a2fSmrg
461b425557eSmrg# Define the identity of the package.
462b425557eSmrgdnl Distinguish between old-style and new-style calls.
463b425557eSmrgm4_ifval([$2],
464b425557eSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465b425557eSmrg AC_SUBST([PACKAGE], [$1])dnl
466b425557eSmrg AC_SUBST([VERSION], [$2])],
467b425557eSmrg[_AM_SET_OPTIONS([$1])dnl
468b425557eSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469b425557eSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470b425557eSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471b425557eSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472b425557eSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
47334977a2fSmrg
474b425557eSmrg_AM_IF_OPTION([no-define],,
475b425557eSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476b425557eSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
47734977a2fSmrg
478b425557eSmrg# Some tools Automake needs.
479b425557eSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480b425557eSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481b425557eSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482b425557eSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483b425557eSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484b425557eSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485b425557eSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486b425557eSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487b425557eSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488b425557eSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489b425557eSmrg# We need awk for the "check" target.  The system "awk" is bad on
490b425557eSmrg# some platforms.
491b425557eSmrgAC_REQUIRE([AC_PROG_AWK])dnl
492b425557eSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493b425557eSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494b425557eSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495b425557eSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496b425557eSmrg			     [_AM_PROG_TAR([v7])])])
497b425557eSmrg_AM_IF_OPTION([no-dependencies],,
498b425557eSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499b425557eSmrg		  [_AM_DEPENDENCIES(CC)],
500b425557eSmrg		  [define([AC_PROG_CC],
501b425557eSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502b425557eSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503b425557eSmrg		  [_AM_DEPENDENCIES(CXX)],
504b425557eSmrg		  [define([AC_PROG_CXX],
505b425557eSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506b425557eSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507b425557eSmrg		  [_AM_DEPENDENCIES(OBJC)],
508b425557eSmrg		  [define([AC_PROG_OBJC],
509b425557eSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510b425557eSmrg])
511b425557eSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512b425557eSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513b425557eSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514b425557eSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515b425557eSmrgAC_CONFIG_COMMANDS_PRE(dnl
516b425557eSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517b425557eSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
51834977a2fSmrg])
51934977a2fSmrg
520b425557eSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521b425557eSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522b425557eSmrgdnl mangled by Autoconf and run in a shell conditional statement.
523b425557eSmrgm4_define([_AC_COMPILER_EXEEXT],
524b425557eSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
52534977a2fSmrg
52634977a2fSmrg
527b425557eSmrg# When config.status generates a header, we must update the stamp-h file.
528b425557eSmrg# This file resides in the same directory as the config header
529b425557eSmrg# that is generated.  The stamp files are numbered to have different names.
53034977a2fSmrg
531b425557eSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532b425557eSmrg# loop where config.status creates the headers, so we can generate
533b425557eSmrg# our stamp files there.
534b425557eSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535b425557eSmrg[# Compute $1's index in $config_headers.
536b425557eSmrg_am_arg=$1
537b425557eSmrg_am_stamp_count=1
538b425557eSmrgfor _am_header in $config_headers :; do
539b425557eSmrg  case $_am_header in
540b425557eSmrg    $_am_arg | $_am_arg:* )
541b425557eSmrg      break ;;
542b425557eSmrg    * )
543b425557eSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544b425557eSmrg  esac
545b425557eSmrgdone
546b425557eSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
54734977a2fSmrg
548b425557eSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549b425557eSmrg#
550b425557eSmrg# This file is free software; the Free Software Foundation
551b425557eSmrg# gives unlimited permission to copy and/or distribute it,
552b425557eSmrg# with or without modifications, as long as this notice is preserved.
55334977a2fSmrg
554b425557eSmrg# AM_PROG_INSTALL_SH
555b425557eSmrg# ------------------
556b425557eSmrg# Define $install_sh.
557b425557eSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558b425557eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559b425557eSmrgif test x"${install_sh}" != xset; then
560b425557eSmrg  case $am_aux_dir in
561b425557eSmrg  *\ * | *\	*)
562b425557eSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563b425557eSmrg  *)
564b425557eSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565b425557eSmrg  esac
566b425557eSmrgfi
567b425557eSmrgAC_SUBST(install_sh)])
56834977a2fSmrg
569b425557eSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
57034977a2fSmrg#
571b425557eSmrg# This file is free software; the Free Software Foundation
572b425557eSmrg# gives unlimited permission to copy and/or distribute it,
573b425557eSmrg# with or without modifications, as long as this notice is preserved.
574ee3138f1Smrg
575b425557eSmrg# serial 2
576ee3138f1Smrg
577b425557eSmrg# Check whether the underlying file-system supports filenames
578b425557eSmrg# with a leading dot.  For instance MS-DOS doesn't.
579b425557eSmrgAC_DEFUN([AM_SET_LEADING_DOT],
580b425557eSmrg[rm -rf .tst 2>/dev/null
581b425557eSmrgmkdir .tst 2>/dev/null
582b425557eSmrgif test -d .tst; then
583b425557eSmrg  am__leading_dot=.
584b425557eSmrgelse
585b425557eSmrg  am__leading_dot=_
586b425557eSmrgfi
587b425557eSmrgrmdir .tst 2>/dev/null
588b425557eSmrgAC_SUBST([am__leading_dot])])
58934977a2fSmrg
590b425557eSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591b425557eSmrg# From Jim Meyering
59234977a2fSmrg
593b425557eSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594b425557eSmrg# Free Software Foundation, Inc.
59534977a2fSmrg#
596b425557eSmrg# This file is free software; the Free Software Foundation
597b425557eSmrg# gives unlimited permission to copy and/or distribute it,
598b425557eSmrg# with or without modifications, as long as this notice is preserved.
59934977a2fSmrg
600b425557eSmrg# serial 5
60134977a2fSmrg
602b425557eSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
603b425557eSmrg# ----------------------------------
604b425557eSmrg# Control maintainer-specific portions of Makefiles.
605b425557eSmrg# Default is to disable them, unless `enable' is passed literally.
606b425557eSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
607b425557eSmrg# can override the default with the --enable/--disable switch.
608b425557eSmrgAC_DEFUN([AM_MAINTAINER_MODE],
609b425557eSmrg[m4_case(m4_default([$1], [disable]),
610b425557eSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
611b425557eSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
612b425557eSmrg       [m4_define([am_maintainer_other], [enable])
613b425557eSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614b425557eSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615b425557eSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616b425557eSmrg  AC_ARG_ENABLE([maintainer-mode],
617b425557eSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618b425557eSmrg			  (and sometimes confusing) to the casual installer],
619b425557eSmrg      [USE_MAINTAINER_MODE=$enableval],
620b425557eSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621b425557eSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622b425557eSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623b425557eSmrg  MAINT=$MAINTAINER_MODE_TRUE
624b425557eSmrg  AC_SUBST([MAINT])dnl
625b425557eSmrg]
626b425557eSmrg)
62734977a2fSmrg
628b425557eSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
62934977a2fSmrg
630b425557eSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
63134977a2fSmrg
632b425557eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633b425557eSmrg#
634b425557eSmrg# This file is free software; the Free Software Foundation
635b425557eSmrg# gives unlimited permission to copy and/or distribute it,
636b425557eSmrg# with or without modifications, as long as this notice is preserved.
63734977a2fSmrg
638b425557eSmrg# serial 4
63934977a2fSmrg
640b425557eSmrg# AM_MAKE_INCLUDE()
641b425557eSmrg# -----------------
642b425557eSmrg# Check to see how make treats includes.
643b425557eSmrgAC_DEFUN([AM_MAKE_INCLUDE],
644b425557eSmrg[am_make=${MAKE-make}
645b425557eSmrgcat > confinc << 'END'
646b425557eSmrgam__doit:
647b425557eSmrg	@echo this is the am__doit target
648b425557eSmrg.PHONY: am__doit
649b425557eSmrgEND
650b425557eSmrg# If we don't find an include directive, just comment out the code.
651b425557eSmrgAC_MSG_CHECKING([for style of include used by $am_make])
652b425557eSmrgam__include="#"
653b425557eSmrgam__quote=
654b425557eSmrg_am_result=none
655b425557eSmrg# First try GNU make style include.
656b425557eSmrgecho "include confinc" > confmf
657b425557eSmrg# Ignore all kinds of additional output from `make'.
658b425557eSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
659b425557eSmrg*the\ am__doit\ target*)
660b425557eSmrg  am__include=include
661b425557eSmrg  am__quote=
662b425557eSmrg  _am_result=GNU
663b425557eSmrg  ;;
664b425557eSmrgesac
665b425557eSmrg# Now try BSD make style include.
666b425557eSmrgif test "$am__include" = "#"; then
667b425557eSmrg   echo '.include "confinc"' > confmf
668b425557eSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
669b425557eSmrg   *the\ am__doit\ target*)
670b425557eSmrg     am__include=.include
671b425557eSmrg     am__quote="\""
672b425557eSmrg     _am_result=BSD
673b425557eSmrg     ;;
674b425557eSmrg   esac
675b425557eSmrgfi
676b425557eSmrgAC_SUBST([am__include])
677b425557eSmrgAC_SUBST([am__quote])
678b425557eSmrgAC_MSG_RESULT([$_am_result])
679b425557eSmrgrm -f confinc confmf
680b425557eSmrg])
68134977a2fSmrg
682b425557eSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
68334977a2fSmrg
684b425557eSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685b425557eSmrg# Free Software Foundation, Inc.
686b425557eSmrg#
687b425557eSmrg# This file is free software; the Free Software Foundation
688b425557eSmrg# gives unlimited permission to copy and/or distribute it,
689b425557eSmrg# with or without modifications, as long as this notice is preserved.
69034977a2fSmrg
691b425557eSmrg# serial 6
69234977a2fSmrg
693b425557eSmrg# AM_MISSING_PROG(NAME, PROGRAM)
694b425557eSmrg# ------------------------------
695b425557eSmrgAC_DEFUN([AM_MISSING_PROG],
696b425557eSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697b425557eSmrg$1=${$1-"${am_missing_run}$2"}
698b425557eSmrgAC_SUBST($1)])
69934977a2fSmrg
70034977a2fSmrg
701b425557eSmrg# AM_MISSING_HAS_RUN
702b425557eSmrg# ------------------
703b425557eSmrg# Define MISSING if not defined so far and test if it supports --run.
704b425557eSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705b425557eSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706b425557eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707b425557eSmrgAC_REQUIRE_AUX_FILE([missing])dnl
708b425557eSmrgif test x"${MISSING+set}" != xset; then
709b425557eSmrg  case $am_aux_dir in
710b425557eSmrg  *\ * | *\	*)
711b425557eSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712b425557eSmrg  *)
713b425557eSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714b425557eSmrg  esac
715b425557eSmrgfi
716b425557eSmrg# Use eval to expand $SHELL
717b425557eSmrgif eval "$MISSING --run true"; then
718b425557eSmrg  am_missing_run="$MISSING --run "
719b425557eSmrgelse
720b425557eSmrg  am_missing_run=
721b425557eSmrg  AC_MSG_WARN([`missing' script is too old or missing])
722b425557eSmrgfi
723b425557eSmrg])
72434977a2fSmrg
725b425557eSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726b425557eSmrg#
727b425557eSmrg# This file is free software; the Free Software Foundation
728b425557eSmrg# gives unlimited permission to copy and/or distribute it,
729b425557eSmrg# with or without modifications, as long as this notice is preserved.
73034977a2fSmrg
731b425557eSmrg# AM_PROG_MKDIR_P
732b425557eSmrg# ---------------
733b425557eSmrg# Check for `mkdir -p'.
734b425557eSmrgAC_DEFUN([AM_PROG_MKDIR_P],
735b425557eSmrg[AC_PREREQ([2.60])dnl
736b425557eSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737b425557eSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738b425557eSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
739b425557eSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740b425557eSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741b425557eSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742b425557eSmrgdnl adjustment using top_builddir (which is defined more often than
743b425557eSmrgdnl MKDIR_P).
744b425557eSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745b425557eSmrgcase $mkdir_p in
746b425557eSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747b425557eSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
74834977a2fSmrgesac
74934977a2fSmrg])
75034977a2fSmrg
751b425557eSmrg# Helper functions for option handling.                     -*- Autoconf -*-
75234977a2fSmrg
753b425557eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754b425557eSmrg#
755b425557eSmrg# This file is free software; the Free Software Foundation
756b425557eSmrg# gives unlimited permission to copy and/or distribute it,
757b425557eSmrg# with or without modifications, as long as this notice is preserved.
75834977a2fSmrg
759b425557eSmrg# serial 4
76034977a2fSmrg
761b425557eSmrg# _AM_MANGLE_OPTION(NAME)
762b425557eSmrg# -----------------------
763b425557eSmrgAC_DEFUN([_AM_MANGLE_OPTION],
764b425557eSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
76534977a2fSmrg
766b425557eSmrg# _AM_SET_OPTION(NAME)
767b425557eSmrg# ------------------------------
768b425557eSmrg# Set option NAME.  Presently that only means defining a flag for this option.
769b425557eSmrgAC_DEFUN([_AM_SET_OPTION],
770b425557eSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
77134977a2fSmrg
772b425557eSmrg# _AM_SET_OPTIONS(OPTIONS)
773b425557eSmrg# ----------------------------------
774b425557eSmrg# OPTIONS is a space-separated list of Automake options.
775b425557eSmrgAC_DEFUN([_AM_SET_OPTIONS],
776b425557eSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
77734977a2fSmrg
778b425557eSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779b425557eSmrg# -------------------------------------------
780b425557eSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781b425557eSmrgAC_DEFUN([_AM_IF_OPTION],
782b425557eSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
78334977a2fSmrg
784b425557eSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
78534977a2fSmrg
786b425557eSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787b425557eSmrg# Free Software Foundation, Inc.
788b425557eSmrg#
789b425557eSmrg# This file is free software; the Free Software Foundation
790b425557eSmrg# gives unlimited permission to copy and/or distribute it,
791b425557eSmrg# with or without modifications, as long as this notice is preserved.
79234977a2fSmrg
793b425557eSmrg# serial 5
79434977a2fSmrg
795b425557eSmrg# AM_SANITY_CHECK
796b425557eSmrg# ---------------
797b425557eSmrgAC_DEFUN([AM_SANITY_CHECK],
798b425557eSmrg[AC_MSG_CHECKING([whether build environment is sane])
799b425557eSmrg# Just in case
800b425557eSmrgsleep 1
801b425557eSmrgecho timestamp > conftest.file
802b425557eSmrg# Reject unsafe characters in $srcdir or the absolute working directory
803b425557eSmrg# name.  Accept space and tab only in the latter.
804b425557eSmrgam_lf='
805b425557eSmrg'
806b425557eSmrgcase `pwd` in
807b425557eSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808b425557eSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809b425557eSmrgesac
810b425557eSmrgcase $srcdir in
811b425557eSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812b425557eSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813b425557eSmrgesac
81434977a2fSmrg
815b425557eSmrg# Do `set' in a subshell so we don't clobber the current shell's
816b425557eSmrg# arguments.  Must try -L first in case configure is actually a
817b425557eSmrg# symlink; some systems play weird games with the mod time of symlinks
818b425557eSmrg# (eg FreeBSD returns the mod time of the symlink's containing
819b425557eSmrg# directory).
820b425557eSmrgif (
821b425557eSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822b425557eSmrg   if test "$[*]" = "X"; then
823b425557eSmrg      # -L didn't work.
824b425557eSmrg      set X `ls -t "$srcdir/configure" conftest.file`
825b425557eSmrg   fi
826b425557eSmrg   rm -f conftest.file
827b425557eSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828b425557eSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
82934977a2fSmrg
830b425557eSmrg      # If neither matched, then we have a broken ls.  This can happen
831b425557eSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832b425557eSmrg      # broken ls alias from the environment.  This has actually
833b425557eSmrg      # happened.  Such a system could not be considered "sane".
834b425557eSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835b425557eSmrgalias in your environment])
836b425557eSmrg   fi
83734977a2fSmrg
838b425557eSmrg   test "$[2]" = conftest.file
839b425557eSmrg   )
840b425557eSmrgthen
841b425557eSmrg   # Ok.
842b425557eSmrg   :
843b425557eSmrgelse
844b425557eSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
845b425557eSmrgCheck your system clock])
84634977a2fSmrgfi
847b425557eSmrgAC_MSG_RESULT(yes)])
84834977a2fSmrg
849b425557eSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
850b425557eSmrg#
851b425557eSmrg# This file is free software; the Free Software Foundation
852b425557eSmrg# gives unlimited permission to copy and/or distribute it,
853b425557eSmrg# with or without modifications, as long as this notice is preserved.
85434977a2fSmrg
855b425557eSmrg# serial 1
85634977a2fSmrg
857b425557eSmrg# AM_SILENT_RULES([DEFAULT])
858b425557eSmrg# --------------------------
859b425557eSmrg# Enable less verbose build rules; with the default set to DEFAULT
860b425557eSmrg# (`yes' being less verbose, `no' or empty being verbose).
861b425557eSmrgAC_DEFUN([AM_SILENT_RULES],
862b425557eSmrg[AC_ARG_ENABLE([silent-rules],
863b425557eSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864b425557eSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
865b425557eSmrgcase $enable_silent_rules in
866b425557eSmrgyes) AM_DEFAULT_VERBOSITY=0;;
867b425557eSmrgno)  AM_DEFAULT_VERBOSITY=1;;
868b425557eSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869b425557eSmrgesac
870b425557eSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871b425557eSmrgAM_BACKSLASH='\'
872b425557eSmrgAC_SUBST([AM_BACKSLASH])dnl
873b425557eSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874b425557eSmrg])
87534977a2fSmrg
876b425557eSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
87734977a2fSmrg#
878b425557eSmrg# This file is free software; the Free Software Foundation
879b425557eSmrg# gives unlimited permission to copy and/or distribute it,
880b425557eSmrg# with or without modifications, as long as this notice is preserved.
88134977a2fSmrg
882b425557eSmrg# AM_PROG_INSTALL_STRIP
883b425557eSmrg# ---------------------
884b425557eSmrg# One issue with vendor `install' (even GNU) is that you can't
885b425557eSmrg# specify the program used to strip binaries.  This is especially
886b425557eSmrg# annoying in cross-compiling environments, where the build's strip
887b425557eSmrg# is unlikely to handle the host's binaries.
888b425557eSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889b425557eSmrg# always use install-sh in `make install-strip', and initialize
890b425557eSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
891b425557eSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892b425557eSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893b425557eSmrg# Installed binaries are usually stripped using `strip' when the user
894b425557eSmrg# run `make install-strip'.  However `strip' might not be the right
895b425557eSmrg# tool to use in cross-compilation environments, therefore Automake
896b425557eSmrg# will honor the `STRIP' environment variable to overrule this program.
897b425557eSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898b425557eSmrgif test "$cross_compiling" != no; then
899b425557eSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
90034977a2fSmrgfi
901b425557eSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902b425557eSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
90334977a2fSmrg
904b425557eSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905b425557eSmrg#
906b425557eSmrg# This file is free software; the Free Software Foundation
907b425557eSmrg# gives unlimited permission to copy and/or distribute it,
908b425557eSmrg# with or without modifications, as long as this notice is preserved.
90934977a2fSmrg
910b425557eSmrg# serial 2
91134977a2fSmrg
912b425557eSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
913b425557eSmrg# ---------------------------
914b425557eSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915b425557eSmrg# This macro is traced by Automake.
916b425557eSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
91734977a2fSmrg
918b425557eSmrg# AM_SUBST_NOTMAKE(VARIABLE)
919b425557eSmrg# ---------------------------
920b425557eSmrg# Public sister of _AM_SUBST_NOTMAKE.
921b425557eSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
92234977a2fSmrg
923b425557eSmrg# Check how to create a tarball.                            -*- Autoconf -*-
92434977a2fSmrg
925b425557eSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926b425557eSmrg#
927b425557eSmrg# This file is free software; the Free Software Foundation
928b425557eSmrg# gives unlimited permission to copy and/or distribute it,
929b425557eSmrg# with or without modifications, as long as this notice is preserved.
93034977a2fSmrg
931b425557eSmrg# serial 2
93234977a2fSmrg
933b425557eSmrg# _AM_PROG_TAR(FORMAT)
934b425557eSmrg# --------------------
935b425557eSmrg# Check how to create a tarball in format FORMAT.
936b425557eSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
937b425557eSmrg#
938b425557eSmrg# Substitute a variable $(am__tar) that is a command
939b425557eSmrg# writing to stdout a FORMAT-tarball containing the directory
940b425557eSmrg# $tardir.
941b425557eSmrg#     tardir=directory && $(am__tar) > result.tar
942b425557eSmrg#
943b425557eSmrg# Substitute a variable $(am__untar) that extract such
944b425557eSmrg# a tarball read from stdin.
945b425557eSmrg#     $(am__untar) < result.tar
946b425557eSmrgAC_DEFUN([_AM_PROG_TAR],
947b425557eSmrg[# Always define AMTAR for backward compatibility.
948b425557eSmrgAM_MISSING_PROG([AMTAR], [tar])
949b425557eSmrgm4_if([$1], [v7],
950b425557eSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951b425557eSmrg     [m4_case([$1], [ustar],, [pax],,
952b425557eSmrg              [m4_fatal([Unknown tar format])])
953b425557eSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
954b425557eSmrg# Loop over all known methods to create a tar archive until one works.
955b425557eSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956b425557eSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957b425557eSmrg# Do not fold the above two line into one, because Tru64 sh and
958b425557eSmrg# Solaris sh will not grok spaces in the rhs of `-'.
959b425557eSmrgfor _am_tool in $_am_tools
960b425557eSmrgdo
961b425557eSmrg  case $_am_tool in
962b425557eSmrg  gnutar)
963b425557eSmrg    for _am_tar in tar gnutar gtar;
964b425557eSmrg    do
965b425557eSmrg      AM_RUN_LOG([$_am_tar --version]) && break
966b425557eSmrg    done
967b425557eSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968b425557eSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969b425557eSmrg    am__untar="$_am_tar -xf -"
970b425557eSmrg    ;;
971b425557eSmrg  plaintar)
972b425557eSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
973b425557eSmrg    # ustar tarball either.
974b425557eSmrg    (tar --version) >/dev/null 2>&1 && continue
975b425557eSmrg    am__tar='tar chf - "$$tardir"'
976b425557eSmrg    am__tar_='tar chf - "$tardir"'
977b425557eSmrg    am__untar='tar xf -'
978b425557eSmrg    ;;
979b425557eSmrg  pax)
980b425557eSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
981b425557eSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
982b425557eSmrg    am__untar='pax -r'
983b425557eSmrg    ;;
984b425557eSmrg  cpio)
985b425557eSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986b425557eSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987b425557eSmrg    am__untar='cpio -i -H $1 -d'
988b425557eSmrg    ;;
989b425557eSmrg  none)
990b425557eSmrg    am__tar=false
991b425557eSmrg    am__tar_=false
992b425557eSmrg    am__untar=false
993b425557eSmrg    ;;
994b425557eSmrg  esac
99534977a2fSmrg
996b425557eSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
997b425557eSmrg  # and am__untar set.
998b425557eSmrg  test -n "${am_cv_prog_tar_$1}" && break
99934977a2fSmrg
1000b425557eSmrg  # tar/untar a dummy directory, and stop if the command works
1001b425557eSmrg  rm -rf conftest.dir
1002b425557eSmrg  mkdir conftest.dir
1003b425557eSmrg  echo GrepMe > conftest.dir/file
1004b425557eSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005b425557eSmrg  rm -rf conftest.dir
1006b425557eSmrg  if test -s conftest.tar; then
1007b425557eSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1008b425557eSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009b425557eSmrg  fi
1010b425557eSmrgdone
1011b425557eSmrgrm -rf conftest.dir
101234977a2fSmrg
1013b425557eSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014b425557eSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015b425557eSmrgAC_SUBST([am__tar])
1016b425557eSmrgAC_SUBST([am__untar])
1017b425557eSmrg]) # _AM_PROG_TAR
101834977a2fSmrg
1019b425557eSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1020b425557eSmrgdnl
1021b425557eSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1022b425557eSmrgdnl 
1023b425557eSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1024b425557eSmrgdnl copy of this software and associated documentation files (the "Software"),
1025b425557eSmrgdnl to deal in the Software without restriction, including without limitation
1026b425557eSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1027b425557eSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
1028b425557eSmrgdnl Software is furnished to do so, subject to the following conditions:
1029b425557eSmrgdnl
1030b425557eSmrgdnl The above copyright notice and this permission notice (including the next
1031b425557eSmrgdnl paragraph) shall be included in all copies or substantial portions of the
1032b425557eSmrgdnl Software.
1033b425557eSmrgdnl
1034b425557eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1035b425557eSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1036b425557eSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1037b425557eSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1038b425557eSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1039b425557eSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1040b425557eSmrgdnl DEALINGS IN THE SOFTWARE.
104134977a2fSmrg
1042b425557eSmrg# XORG_MACROS_VERSION(required-version)
1043b425557eSmrg# -------------------------------------
1044b425557eSmrg# Minimum version: 1.1.0
1045b425557eSmrg#
1046b425557eSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1047b425557eSmrg# your configure.ac with the minimum required version, such as:
1048b425557eSmrg# XORG_MACROS_VERSION(1.1)
1049b425557eSmrg#
1050b425557eSmrg# To ensure that this macro is defined, also add:
1051b425557eSmrg# m4_ifndef([XORG_MACROS_VERSION],
1052b425557eSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1053b425557eSmrg#
1054b425557eSmrg#
1055b425557eSmrg# See the "minimum version" comment for each macro you use to see what 
1056b425557eSmrg# version you require.
1057b425557eSmrgm4_defun([XORG_MACROS_VERSION],[
1058b425557eSmrgm4_define([vers_have], [1.11.0])
1059b425557eSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1060b425557eSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1061b425557eSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1062b425557eSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1063b425557eSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1064b425557eSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1065b425557eSmrgm4_undefine([vers_have])
1066b425557eSmrgm4_undefine([maj_have])
1067b425557eSmrgm4_undefine([maj_needed])
1068b425557eSmrg]) # XORG_MACROS_VERSION
106934977a2fSmrg
1070b425557eSmrg# XORG_PROG_RAWCPP()
1071b425557eSmrg# ------------------
1072b425557eSmrg# Minimum version: 1.0.0
1073b425557eSmrg#
1074b425557eSmrg# Find cpp program and necessary flags for use in pre-processing text files
1075b425557eSmrg# such as man pages and config files
1076b425557eSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1077b425557eSmrgAC_REQUIRE([AC_PROG_CPP])
1078b425557eSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1079b425557eSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
108034977a2fSmrg
1081b425557eSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1082b425557eSmrg# which is not the best choice for supporting other OS'es, but covers most
1083b425557eSmrg# of the ones we need for now.
1084b425557eSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1085b425557eSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1086b425557eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1087b425557eSmrg	AC_MSG_RESULT([no])
1088b425557eSmrgelse
1089b425557eSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1090b425557eSmrg		RAWCPPFLAGS=-undef
1091b425557eSmrg		AC_MSG_RESULT([yes])
1092b425557eSmrg	# under Cygwin unix is still defined even with -undef
1093b425557eSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1094b425557eSmrg		RAWCPPFLAGS="-undef -ansi"
1095b425557eSmrg		AC_MSG_RESULT([yes, with -ansi])
1096b425557eSmrg	else
1097b425557eSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1098b425557eSmrg	fi
1099b425557eSmrgfi
1100b425557eSmrgrm -f conftest.$ac_ext
110134977a2fSmrg
1102b425557eSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1103b425557eSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1104b425557eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1105b425557eSmrg	AC_MSG_RESULT([no])
1106b425557eSmrgelse
1107b425557eSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1108b425557eSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1109b425557eSmrg		AC_MSG_RESULT([yes])
1110b425557eSmrg	else
1111b425557eSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1112b425557eSmrg	fi
1113b425557eSmrgfi
1114b425557eSmrgrm -f conftest.$ac_ext
1115b425557eSmrgAC_SUBST(RAWCPPFLAGS)
1116b425557eSmrg]) # XORG_PROG_RAWCPP
111734977a2fSmrg
1118b425557eSmrg# XORG_MANPAGE_SECTIONS()
1119b425557eSmrg# -----------------------
1120b425557eSmrg# Minimum version: 1.0.0
1121b425557eSmrg#
1122b425557eSmrg# Determine which sections man pages go in for the different man page types
1123b425557eSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1124b425557eSmrg# Not sure if there's any better way than just hardcoding by OS name.
1125b425557eSmrg# Override default settings by setting environment variables
1126b425557eSmrg# Added MAN_SUBSTS in version 1.8
1127b425557eSmrg# Added AC_PROG_SED in version 1.8
112834977a2fSmrg
1129b425557eSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1130b425557eSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1131b425557eSmrgAC_REQUIRE([AC_PROG_SED])
113234977a2fSmrg
1133b425557eSmrgif test x$APP_MAN_SUFFIX = x    ; then
1134b425557eSmrg    APP_MAN_SUFFIX=1
1135b425557eSmrgfi
1136b425557eSmrgif test x$APP_MAN_DIR = x    ; then
1137b425557eSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1138b425557eSmrgfi
113934977a2fSmrg
1140b425557eSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1141b425557eSmrg    LIB_MAN_SUFFIX=3
1142b425557eSmrgfi
1143b425557eSmrgif test x$LIB_MAN_DIR = x    ; then
1144b425557eSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1145b425557eSmrgfi
1146ee3138f1Smrg
1147b425557eSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1148b425557eSmrg    case $host_os in
1149b425557eSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1150b425557eSmrg	*)		FILE_MAN_SUFFIX=5  ;;
1151b425557eSmrg    esac
1152b425557eSmrgfi
1153b425557eSmrgif test x$FILE_MAN_DIR = x    ; then
1154b425557eSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1155b425557eSmrgfi
115634977a2fSmrg
1157b425557eSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1158b425557eSmrg    case $host_os in
1159b425557eSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1160b425557eSmrg	*)		MISC_MAN_SUFFIX=7  ;;
1161b425557eSmrg    esac
1162b425557eSmrgfi
1163b425557eSmrgif test x$MISC_MAN_DIR = x    ; then
1164b425557eSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1165b425557eSmrgfi
1166ee3138f1Smrg
1167b425557eSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1168b425557eSmrg    case $host_os in
1169b425557eSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1170b425557eSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1171b425557eSmrg    esac
1172b425557eSmrgfi
1173b425557eSmrgif test x$DRIVER_MAN_DIR = x    ; then
1174b425557eSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1175b425557eSmrgfi
1176ee3138f1Smrg
1177b425557eSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1178b425557eSmrg    case $host_os in
1179b425557eSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1180b425557eSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1181b425557eSmrg    esac
1182b425557eSmrgfi
1183b425557eSmrgif test x$ADMIN_MAN_DIR = x    ; then
1184b425557eSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1185b425557eSmrgfi
1186ee3138f1Smrg
1187ee3138f1Smrg
1188b425557eSmrgAC_SUBST([APP_MAN_SUFFIX])
1189b425557eSmrgAC_SUBST([LIB_MAN_SUFFIX])
1190b425557eSmrgAC_SUBST([FILE_MAN_SUFFIX])
1191b425557eSmrgAC_SUBST([MISC_MAN_SUFFIX])
1192b425557eSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1193b425557eSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1194b425557eSmrgAC_SUBST([APP_MAN_DIR])
1195b425557eSmrgAC_SUBST([LIB_MAN_DIR])
1196b425557eSmrgAC_SUBST([FILE_MAN_DIR])
1197b425557eSmrgAC_SUBST([MISC_MAN_DIR])
1198b425557eSmrgAC_SUBST([DRIVER_MAN_DIR])
1199b425557eSmrgAC_SUBST([ADMIN_MAN_DIR])
1200b425557eSmrg
1201b425557eSmrgXORG_MAN_PAGE="X Version 11"
1202b425557eSmrgAC_SUBST([XORG_MAN_PAGE])
1203b425557eSmrgMAN_SUBSTS="\
1204b425557eSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1205b425557eSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1206b425557eSmrg	-e 's|__xservername__|Xorg|g' \
1207b425557eSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
1208b425557eSmrg	-e 's|__projectroot__|\$(prefix)|g' \
1209b425557eSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1210b425557eSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1211b425557eSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1212b425557eSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1213b425557eSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1214b425557eSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1215b425557eSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1216b425557eSmrgAC_SUBST([MAN_SUBSTS])
1217b425557eSmrg
1218b425557eSmrg]) # XORG_MANPAGE_SECTIONS
1219b425557eSmrg
1220b425557eSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1221ee3138f1Smrg# ------------------------
1222b425557eSmrg# Minimum version: 1.7.0
1223b425557eSmrg#
1224b425557eSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1225b425557eSmrg# provided by xorg-sgml-doctools, if installed.
1226b425557eSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1227b425557eSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1228b425557eSmrgXORG_SGML_PATH=
1229b425557eSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1230b425557eSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1231b425557eSmrg    [m4_ifval([$1],[:],
1232b425557eSmrg        [if test x"$cross_compiling" != x"yes" ; then
1233b425557eSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1234b425557eSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1235b425557eSmrg         fi])
1236b425557eSmrg    ])
1237ee3138f1Smrg
1238b425557eSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1239b425557eSmrg# the path and the name of the doc stylesheet
1240b425557eSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1241b425557eSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1242b425557eSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1243b425557eSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1244b425557eSmrgelse
1245b425557eSmrg   AC_MSG_RESULT([no])
1246b425557eSmrgfi
1247ee3138f1Smrg
1248b425557eSmrgAC_SUBST(XORG_SGML_PATH)
1249b425557eSmrgAC_SUBST(STYLESHEET_SRCDIR)
1250b425557eSmrgAC_SUBST(XSL_STYLESHEET)
1251b425557eSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1252b425557eSmrg]) # XORG_CHECK_SGML_DOCTOOLS
1253ee3138f1Smrg
1254b425557eSmrg# XORG_CHECK_LINUXDOC
1255b425557eSmrg# -------------------
1256b425557eSmrg# Minimum version: 1.0.0
1257b425557eSmrg#
1258b425557eSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1259b425557eSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1260b425557eSmrg# Whether or not the necessary tools and files are found can be checked
1261b425557eSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1262b425557eSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1263b425557eSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1264b425557eSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
126579a8a9c6Smrg
1266b425557eSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
126734977a2fSmrg
1268b425557eSmrgAC_MSG_CHECKING([whether to build documentation])
1269ee3138f1Smrg
1270b425557eSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1271b425557eSmrg   BUILDDOC=yes
1272b425557eSmrgelse
1273b425557eSmrg   BUILDDOC=no
1274b425557eSmrgfi
1275ee3138f1Smrg
1276b425557eSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1277ee3138f1Smrg
1278b425557eSmrgAC_MSG_RESULT([$BUILDDOC])
1279ee3138f1Smrg
1280b425557eSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1281ee3138f1Smrg
1282b425557eSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1283b425557eSmrg   BUILDPDFDOC=yes
1284ee3138f1Smrgelse
1285b425557eSmrg   BUILDPDFDOC=no
1286ee3138f1Smrgfi
1287ee3138f1Smrg
1288b425557eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1289ee3138f1Smrg
1290b425557eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1291ee3138f1Smrg
1292b425557eSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1293b425557eSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1294b425557eSmrgMAKE_PDF="$PS2PDF"
1295b425557eSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1296ee3138f1Smrg
1297b425557eSmrgAC_SUBST(MAKE_TEXT)
1298b425557eSmrgAC_SUBST(MAKE_PS)
1299b425557eSmrgAC_SUBST(MAKE_PDF)
1300b425557eSmrgAC_SUBST(MAKE_HTML)
1301b425557eSmrg]) # XORG_CHECK_LINUXDOC
1302ee3138f1Smrg
1303b425557eSmrg# XORG_CHECK_DOCBOOK
1304b425557eSmrg# -------------------
1305b425557eSmrg# Minimum version: 1.0.0
1306b425557eSmrg#
1307b425557eSmrg# Checks for the ability to build output formats from SGML DocBook source.
1308b425557eSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1309b425557eSmrg# indicates whether the necessary tools and files are found and, if set,
1310b425557eSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1311b425557eSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1312b425557eSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1313ee3138f1Smrg
1314b425557eSmrgBUILDTXTDOC=no
1315b425557eSmrgBUILDPDFDOC=no
1316b425557eSmrgBUILDPSDOC=no
1317b425557eSmrgBUILDHTMLDOC=no
1318ee3138f1Smrg
1319b425557eSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1320b425557eSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1321b425557eSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1322b425557eSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1323ee3138f1Smrg
1324b425557eSmrgAC_MSG_CHECKING([whether to build text documentation])
1325b425557eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1326b425557eSmrg   test x$BUILD_TXTDOC != xno; then
1327b425557eSmrg	BUILDTXTDOC=yes
1328ee3138f1Smrgfi
1329b425557eSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1330b425557eSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1331ee3138f1Smrg
1332b425557eSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1333b425557eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1334b425557eSmrg   test x$BUILD_PDFDOC != xno; then
1335b425557eSmrg	BUILDPDFDOC=yes
1336ee3138f1Smrgfi
1337b425557eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1338b425557eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1339ee3138f1Smrg
1340b425557eSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1341b425557eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1342b425557eSmrg   test x$BUILD_PSDOC != xno; then
1343b425557eSmrg	BUILDPSDOC=yes
1344b425557eSmrgfi
1345b425557eSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1346b425557eSmrgAC_MSG_RESULT([$BUILDPSDOC])
1347ee3138f1Smrg
1348b425557eSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1349b425557eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1350b425557eSmrg   test x$BUILD_HTMLDOC != xno; then
1351b425557eSmrg	BUILDHTMLDOC=yes
1352b425557eSmrgfi
1353b425557eSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1354b425557eSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1355ee3138f1Smrg
1356b425557eSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1357b425557eSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1358b425557eSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1359b425557eSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1360ee3138f1Smrg
1361b425557eSmrgAC_SUBST(MAKE_TEXT)
1362b425557eSmrgAC_SUBST(MAKE_PS)
1363b425557eSmrgAC_SUBST(MAKE_PDF)
1364b425557eSmrgAC_SUBST(MAKE_HTML)
1365b425557eSmrg]) # XORG_CHECK_DOCBOOK
1366ee3138f1Smrg
1367b425557eSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1368b425557eSmrg# ----------------
1369b425557eSmrg# Minimum version: 1.5.0
1370b425557eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1371b425557eSmrg#
1372b425557eSmrg# Documentation tools are not always available on all platforms and sometimes
1373b425557eSmrg# not at the appropriate level. This macro enables a module to test for the
1374b425557eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1375b425557eSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1376b425557eSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1377b425557eSmrg# --with-xmlto assumes 'auto'.
1378b425557eSmrg#
1379b425557eSmrg# Interface to module:
1380b425557eSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1381b425557eSmrg# XMLTO:	returns the path of the xmlto program found
1382b425557eSmrg#		returns the path set by the user in the environment
1383b425557eSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1384b425557eSmrg#		'no' user instructs the module not to use xmlto
1385b425557eSmrg#
1386b425557eSmrg# Added in version 1.10.0
1387b425557eSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1388b425557eSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1389b425557eSmrg#
1390b425557eSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1391b425557eSmrg#
1392b425557eSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1393b425557eSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1394b425557eSmrgm4_define([_defopt], m4_default([$2], [auto]))
1395b425557eSmrgAC_ARG_WITH(xmlto,
1396b425557eSmrg	AS_HELP_STRING([--with-xmlto],
1397b425557eSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1398b425557eSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1399b425557eSmrgm4_undefine([_defopt])
1400b425557eSmrg
1401b425557eSmrgif test "x$use_xmlto" = x"auto"; then
1402b425557eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1403b425557eSmrg   if test "x$XMLTO" = "x"; then
1404b425557eSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1405b425557eSmrg	have_xmlto=no
1406b425557eSmrg   else
1407b425557eSmrg        have_xmlto=yes
1408b425557eSmrg   fi
1409b425557eSmrgelif test "x$use_xmlto" = x"yes" ; then
1410b425557eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1411b425557eSmrg   if test "x$XMLTO" = "x"; then
1412b425557eSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1413b425557eSmrg   fi
1414b425557eSmrg   have_xmlto=yes
1415b425557eSmrgelif test "x$use_xmlto" = x"no" ; then
1416b425557eSmrg   if test "x$XMLTO" != "x"; then
1417b425557eSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1418b425557eSmrg   fi
1419b425557eSmrg   have_xmlto=no
1420b425557eSmrgelse
1421b425557eSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1422b425557eSmrgfi
142334977a2fSmrg
1424b425557eSmrg# Test for a minimum version of xmlto, if provided.
1425b425557eSmrgm4_ifval([$1],
1426b425557eSmrg[if test "$have_xmlto" = yes; then
1427b425557eSmrg    # scrape the xmlto version
1428b425557eSmrg    AC_MSG_CHECKING([the xmlto version])
1429b425557eSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1430b425557eSmrg    AC_MSG_RESULT([$xmlto_version])
1431b425557eSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1432b425557eSmrg        [if test "x$use_xmlto" = xauto; then
1433b425557eSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1434b425557eSmrg            have_xmlto=no
1435b425557eSmrg        else
1436b425557eSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1437b425557eSmrg        fi])
1438b425557eSmrgfi])
143934977a2fSmrg
1440b425557eSmrg# Test for the ability of xmlto to generate a text target
1441b425557eSmrghave_xmlto_text=no
1442b425557eSmrgcat > conftest.xml << "EOF"
1443b425557eSmrgEOF
1444b425557eSmrgAS_IF([test "$have_xmlto" = yes],
1445b425557eSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1446b425557eSmrg             [have_xmlto_text=yes],
1447b425557eSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1448b425557eSmrgrm -f conftest.xml
1449b425557eSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1450b425557eSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1451b425557eSmrg]) # XORG_WITH_XMLTO
1452b425557eSmrg
1453b425557eSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1454b425557eSmrg# ----------------
1455b425557eSmrg# Minimum version: 1.5.0
1456b425557eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1457b425557eSmrg#
1458b425557eSmrg# Documentation tools are not always available on all platforms and sometimes
1459b425557eSmrg# not at the appropriate level. This macro enables a module to test for the
1460b425557eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1461b425557eSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1462b425557eSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1463b425557eSmrg# --with-asciidoc assumes 'auto'.
1464b425557eSmrg#
1465b425557eSmrg# Interface to module:
1466b425557eSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1467b425557eSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
1468b425557eSmrg#		 returns the path set by the user in the environment
1469b425557eSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1470b425557eSmrg#		  'no' user instructs the module not to use asciidoc
1471b425557eSmrg#
1472b425557eSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1473b425557eSmrg#
1474b425557eSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1475b425557eSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1476b425557eSmrgm4_define([_defopt], m4_default([$2], [auto]))
1477b425557eSmrgAC_ARG_WITH(asciidoc,
1478b425557eSmrg	AS_HELP_STRING([--with-asciidoc],
1479b425557eSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1480b425557eSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1481b425557eSmrgm4_undefine([_defopt])
1482b425557eSmrg
1483b425557eSmrgif test "x$use_asciidoc" = x"auto"; then
1484b425557eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1485b425557eSmrg   if test "x$ASCIIDOC" = "x"; then
1486b425557eSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1487b425557eSmrg	have_asciidoc=no
1488b425557eSmrg   else
1489b425557eSmrg        have_asciidoc=yes
1490b425557eSmrg   fi
1491b425557eSmrgelif test "x$use_asciidoc" = x"yes" ; then
1492b425557eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1493b425557eSmrg   if test "x$ASCIIDOC" = "x"; then
1494b425557eSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1495b425557eSmrg   fi
1496b425557eSmrg   have_asciidoc=yes
1497b425557eSmrgelif test "x$use_asciidoc" = x"no" ; then
1498b425557eSmrg   if test "x$ASCIIDOC" != "x"; then
1499b425557eSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1500b425557eSmrg   fi
1501b425557eSmrg   have_asciidoc=no
1502b425557eSmrgelse
1503b425557eSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1504b425557eSmrgfi
1505b425557eSmrgm4_ifval([$1],
1506b425557eSmrg[if test "$have_asciidoc" = yes; then
1507b425557eSmrg    # scrape the asciidoc version
1508b425557eSmrg    AC_MSG_CHECKING([the asciidoc version])
1509b425557eSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1510b425557eSmrg    AC_MSG_RESULT([$asciidoc_version])
1511b425557eSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1512b425557eSmrg        [if test "x$use_asciidoc" = xauto; then
1513b425557eSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1514b425557eSmrg            have_asciidoc=no
1515b425557eSmrg        else
1516b425557eSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1517b425557eSmrg        fi])
1518b425557eSmrgfi])
1519b425557eSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1520b425557eSmrg]) # XORG_WITH_ASCIIDOC
152134977a2fSmrg
1522b425557eSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1523b425557eSmrg# --------------------------------
1524b425557eSmrg# Minimum version: 1.5.0
1525b425557eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1526b425557eSmrg#
1527b425557eSmrg# Documentation tools are not always available on all platforms and sometimes
1528b425557eSmrg# not at the appropriate level. This macro enables a module to test for the
1529b425557eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1530b425557eSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1531b425557eSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1532b425557eSmrg# --with-doxygen assumes 'auto'.
1533b425557eSmrg#
1534b425557eSmrg# Interface to module:
1535b425557eSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1536b425557eSmrg# DOXYGEN:	 returns the path of the doxygen program found
1537b425557eSmrg#		 returns the path set by the user in the environment
1538b425557eSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1539b425557eSmrg#		  'no' user instructs the module not to use doxygen
1540b425557eSmrg#
1541b425557eSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1542b425557eSmrg#
1543b425557eSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1544b425557eSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1545b425557eSmrgm4_define([_defopt], m4_default([$2], [auto]))
1546b425557eSmrgAC_ARG_WITH(doxygen,
1547b425557eSmrg	AS_HELP_STRING([--with-doxygen],
1548b425557eSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1549b425557eSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1550b425557eSmrgm4_undefine([_defopt])
1551b425557eSmrg
1552b425557eSmrgif test "x$use_doxygen" = x"auto"; then
1553b425557eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1554b425557eSmrg   if test "x$DOXYGEN" = "x"; then
1555b425557eSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1556b425557eSmrg	have_doxygen=no
1557b425557eSmrg   else
1558b425557eSmrg        have_doxygen=yes
1559b425557eSmrg   fi
1560b425557eSmrgelif test "x$use_doxygen" = x"yes" ; then
1561b425557eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1562b425557eSmrg   if test "x$DOXYGEN" = "x"; then
1563b425557eSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1564b425557eSmrg   fi
1565b425557eSmrg   have_doxygen=yes
1566b425557eSmrgelif test "x$use_doxygen" = x"no" ; then
1567b425557eSmrg   if test "x$DOXYGEN" != "x"; then
1568b425557eSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1569b425557eSmrg   fi
1570b425557eSmrg   have_doxygen=no
1571b425557eSmrgelse
1572b425557eSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1573b425557eSmrgfi
1574b425557eSmrgm4_ifval([$1],
1575b425557eSmrg[if test "$have_doxygen" = yes; then
1576b425557eSmrg    # scrape the doxygen version
1577b425557eSmrg    AC_MSG_CHECKING([the doxygen version])
1578b425557eSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1579b425557eSmrg    AC_MSG_RESULT([$doxygen_version])
1580b425557eSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1581b425557eSmrg        [if test "x$use_doxygen" = xauto; then
1582b425557eSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1583b425557eSmrg            have_doxygen=no
1584b425557eSmrg        else
1585b425557eSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1586b425557eSmrg        fi])
1587b425557eSmrgfi])
1588b425557eSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1589b425557eSmrg]) # XORG_WITH_DOXYGEN
159034977a2fSmrg
1591b425557eSmrg# XORG_WITH_GROFF([DEFAULT])
1592b425557eSmrg# ----------------
1593b425557eSmrg# Minimum version: 1.6.0
1594b425557eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1595b425557eSmrg#
1596b425557eSmrg# Documentation tools are not always available on all platforms and sometimes
1597b425557eSmrg# not at the appropriate level. This macro enables a module to test for the
1598b425557eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1599b425557eSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
1600b425557eSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
1601b425557eSmrg# --with-groff assumes 'auto'.
1602b425557eSmrg#
1603b425557eSmrg# Interface to module:
1604b425557eSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1605b425557eSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1606b425557eSmrg# HAVE_GROFF_MS: the -ms macros package
1607b425557eSmrg# GROFF:	 returns the path of the groff program found
1608b425557eSmrg#		 returns the path set by the user in the environment
1609b425557eSmrg# --with-groff:	 'yes' user instructs the module to use groff
1610b425557eSmrg#		 'no' user instructs the module not to use groff
1611b425557eSmrg#
1612b425557eSmrg# Added in version 1.9.0:
1613b425557eSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1614b425557eSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1615b425557eSmrg#		   psselect from the psutils package.
1616b425557eSmrg#		   the ghostcript package. Refer to the grohtml man pages
1617b425557eSmrg#
1618b425557eSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1619b425557eSmrg#
1620b425557eSmrg# OS and distros often splits groff in a basic and full package, the former
1621b425557eSmrg# having the groff program and the later having devices, fonts and macros
1622b425557eSmrg# Checking for the groff executable is not enough.
1623b425557eSmrg#
1624b425557eSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
1625b425557eSmrg# unset HAVE_GROFF or GROFF env variables.
1626b425557eSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1627b425557eSmrg#
1628b425557eSmrgAC_DEFUN([XORG_WITH_GROFF],[
1629b425557eSmrgAC_ARG_VAR([GROFF], [Path to groff command])
1630b425557eSmrgm4_define([_defopt], m4_default([$1], [auto]))
1631b425557eSmrgAC_ARG_WITH(groff,
1632b425557eSmrg	AS_HELP_STRING([--with-groff],
1633b425557eSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1634b425557eSmrg	   [use_groff=$withval], [use_groff=]_defopt)
1635b425557eSmrgm4_undefine([_defopt])
1636b425557eSmrg
1637b425557eSmrgif test "x$use_groff" = x"auto"; then
1638b425557eSmrg   AC_PATH_PROG([GROFF], [groff])
1639b425557eSmrg   if test "x$GROFF" = "x"; then
1640b425557eSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1641b425557eSmrg	have_groff=no
1642b425557eSmrg   else
1643b425557eSmrg        have_groff=yes
1644b425557eSmrg   fi
1645b425557eSmrgelif test "x$use_groff" = x"yes" ; then
1646b425557eSmrg   AC_PATH_PROG([GROFF], [groff])
1647b425557eSmrg   if test "x$GROFF" = "x"; then
1648b425557eSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1649b425557eSmrg   fi
1650b425557eSmrg   have_groff=yes
1651b425557eSmrgelif test "x$use_groff" = x"no" ; then
1652b425557eSmrg   if test "x$GROFF" != "x"; then
1653b425557eSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1654b425557eSmrg   fi
1655b425557eSmrg   have_groff=no
1656b425557eSmrgelse
1657b425557eSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1658b425557eSmrgfi
165934977a2fSmrg
1660b425557eSmrg# We have groff, test for the presence of the macro packages
1661b425557eSmrgif test "x$have_groff" = x"yes"; then
1662b425557eSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1663b425557eSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1664b425557eSmrg        groff_ms_works=yes
1665b425557eSmrg    else
1666b425557eSmrg        groff_ms_works=no
1667b425557eSmrg    fi
1668b425557eSmrg    AC_MSG_RESULT([$groff_ms_works])
1669b425557eSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1670b425557eSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1671b425557eSmrg        groff_mm_works=yes
1672b425557eSmrg    else
1673b425557eSmrg        groff_mm_works=no
1674b425557eSmrg    fi
1675b425557eSmrg    AC_MSG_RESULT([$groff_mm_works])
1676b425557eSmrgfi
1677ee3138f1Smrg
1678b425557eSmrg# We have groff, test for HTML dependencies, one command per package
1679b425557eSmrgif test "x$have_groff" = x"yes"; then
1680b425557eSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1681b425557eSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1682b425557eSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1683b425557eSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1684b425557eSmrg      have_groff_html=yes
1685b425557eSmrg   else
1686b425557eSmrg      have_groff_html=no
1687b425557eSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1688b425557eSmrg   fi
168934977a2fSmrgfi
1690ee3138f1Smrg
1691b425557eSmrg# Set Automake conditionals for Makefiles
1692b425557eSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1693b425557eSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1694b425557eSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1695b425557eSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1696b425557eSmrg]) # XORG_WITH_GROFF
1697ee3138f1Smrg
1698b425557eSmrg# XORG_WITH_FOP([DEFAULT])
1699b425557eSmrg# ----------------
1700b425557eSmrg# Minimum version: 1.6.0
1701b425557eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1702b425557eSmrg#
1703b425557eSmrg# Documentation tools are not always available on all platforms and sometimes
1704b425557eSmrg# not at the appropriate level. This macro enables a module to test for the
1705b425557eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1706b425557eSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
1707b425557eSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
1708b425557eSmrg# --with-fop assumes 'auto'.
1709b425557eSmrg#
1710b425557eSmrg# Interface to module:
1711b425557eSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1712b425557eSmrg# FOP:	 	returns the path of the fop program found
1713b425557eSmrg#		returns the path set by the user in the environment
1714b425557eSmrg# --with-fop: 	'yes' user instructs the module to use fop
1715b425557eSmrg#		'no' user instructs the module not to use fop
1716b425557eSmrg#
1717b425557eSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1718b425557eSmrg#
1719b425557eSmrgAC_DEFUN([XORG_WITH_FOP],[
1720b425557eSmrgAC_ARG_VAR([FOP], [Path to fop command])
1721b425557eSmrgm4_define([_defopt], m4_default([$1], [auto]))
1722b425557eSmrgAC_ARG_WITH(fop,
1723b425557eSmrg	AS_HELP_STRING([--with-fop],
1724b425557eSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1725b425557eSmrg	   [use_fop=$withval], [use_fop=]_defopt)
1726b425557eSmrgm4_undefine([_defopt])
1727b425557eSmrg
1728b425557eSmrgif test "x$use_fop" = x"auto"; then
1729b425557eSmrg   AC_PATH_PROG([FOP], [fop])
1730b425557eSmrg   if test "x$FOP" = "x"; then
1731b425557eSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1732b425557eSmrg	have_fop=no
1733b425557eSmrg   else
1734b425557eSmrg        have_fop=yes
1735ee3138f1Smrg   fi
1736b425557eSmrgelif test "x$use_fop" = x"yes" ; then
1737b425557eSmrg   AC_PATH_PROG([FOP], [fop])
1738b425557eSmrg   if test "x$FOP" = "x"; then
1739b425557eSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1740b425557eSmrg   fi
1741b425557eSmrg   have_fop=yes
1742b425557eSmrgelif test "x$use_fop" = x"no" ; then
1743b425557eSmrg   if test "x$FOP" != "x"; then
1744b425557eSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1745b425557eSmrg   fi
1746b425557eSmrg   have_fop=no
1747ee3138f1Smrgelse
1748b425557eSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1749ee3138f1Smrgfi
1750b425557eSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1751b425557eSmrg]) # XORG_WITH_FOP
1752ee3138f1Smrg
1753b425557eSmrg# XORG_WITH_PS2PDF([DEFAULT])
1754b425557eSmrg# ----------------
1755b425557eSmrg# Minimum version: 1.6.0
1756b425557eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1757b425557eSmrg#
1758b425557eSmrg# Documentation tools are not always available on all platforms and sometimes
1759b425557eSmrg# not at the appropriate level. This macro enables a module to test for the
1760b425557eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1761b425557eSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1762b425557eSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1763b425557eSmrg# --with-ps2pdf assumes 'auto'.
1764b425557eSmrg#
1765b425557eSmrg# Interface to module:
1766b425557eSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1767b425557eSmrg# PS2PDF:	returns the path of the ps2pdf program found
1768b425557eSmrg#		returns the path set by the user in the environment
1769b425557eSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1770b425557eSmrg#		 'no' user instructs the module not to use ps2pdf
1771b425557eSmrg#
1772b425557eSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1773b425557eSmrg#
1774b425557eSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1775b425557eSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1776b425557eSmrgm4_define([_defopt], m4_default([$1], [auto]))
1777b425557eSmrgAC_ARG_WITH(ps2pdf,
1778b425557eSmrg	AS_HELP_STRING([--with-ps2pdf],
1779b425557eSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1780b425557eSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1781b425557eSmrgm4_undefine([_defopt])
1782b425557eSmrg
1783b425557eSmrgif test "x$use_ps2pdf" = x"auto"; then
1784b425557eSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1785b425557eSmrg   if test "x$PS2PDF" = "x"; then
1786b425557eSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1787b425557eSmrg	have_ps2pdf=no
1788b425557eSmrg   else
1789b425557eSmrg        have_ps2pdf=yes
1790ee3138f1Smrg   fi
1791b425557eSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1792b425557eSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1793b425557eSmrg   if test "x$PS2PDF" = "x"; then
1794b425557eSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1795b425557eSmrg   fi
1796b425557eSmrg   have_ps2pdf=yes
1797b425557eSmrgelif test "x$use_ps2pdf" = x"no" ; then
1798b425557eSmrg   if test "x$PS2PDF" != "x"; then
1799b425557eSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1800b425557eSmrg   fi
1801b425557eSmrg   have_ps2pdf=no
1802ee3138f1Smrgelse
1803b425557eSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1804ee3138f1Smrgfi
1805b425557eSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1806b425557eSmrg]) # XORG_WITH_PS2PDF
1807ee3138f1Smrg
1808b425557eSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1809b425557eSmrg# ----------------
1810b425557eSmrg# Minimum version: 1.6.0
1811b425557eSmrg#
1812b425557eSmrg# Documentation tools are not always available on all platforms and sometimes
1813b425557eSmrg# not at the appropriate level. This macro enables a builder to skip all
1814b425557eSmrg# documentation targets except traditional man pages.
1815b425557eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1816b425557eSmrg# maximum flexibilty in controlling documentation building.
1817b425557eSmrg# Refer to:
1818b425557eSmrg# XORG_WITH_XMLTO         --with-xmlto
1819b425557eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1820b425557eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1821b425557eSmrg# XORG_WITH_FOP           --with-fop
1822b425557eSmrg# XORG_WITH_GROFF         --with-groff
1823b425557eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1824b425557eSmrg#
1825b425557eSmrg# Interface to module:
1826b425557eSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1827b425557eSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1828b425557eSmrg#		 'no' user instructs the module not to generate docs
1829b425557eSmrg# parm1:	specify the default value, yes or no.
1830b425557eSmrg#
1831b425557eSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1832b425557eSmrgm4_define([default], m4_default([$1], [yes]))
1833b425557eSmrgAC_ARG_ENABLE(docs,
1834b425557eSmrg	AS_HELP_STRING([--enable-docs],
1835b425557eSmrg	   [Enable building the documentation (default: ]default[)]),
1836b425557eSmrg	   [build_docs=$enableval], [build_docs=]default)
1837b425557eSmrgm4_undefine([default])
1838b425557eSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1839b425557eSmrgAC_MSG_CHECKING([whether to build documentation])
1840b425557eSmrgAC_MSG_RESULT([$build_docs])
1841b425557eSmrg]) # XORG_ENABLE_DOCS
1842b425557eSmrg
1843b425557eSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1844b425557eSmrg# ----------------
1845b425557eSmrg# Minimum version: 1.6.0
1846b425557eSmrg#
1847b425557eSmrg# This macro enables a builder to skip all developer documentation.
1848b425557eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1849b425557eSmrg# maximum flexibilty in controlling documentation building.
1850b425557eSmrg# Refer to:
1851b425557eSmrg# XORG_WITH_XMLTO         --with-xmlto
1852b425557eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1853b425557eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1854b425557eSmrg# XORG_WITH_FOP           --with-fop
1855b425557eSmrg# XORG_WITH_GROFF         --with-groff
1856b425557eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1857b425557eSmrg#
1858b425557eSmrg# Interface to module:
1859b425557eSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1860b425557eSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1861b425557eSmrg#			'no' user instructs the module not to generate developer docs
1862b425557eSmrg# parm1:		specify the default value, yes or no.
1863b425557eSmrg#
1864b425557eSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1865b425557eSmrgm4_define([devel_default], m4_default([$1], [yes]))
1866b425557eSmrgAC_ARG_ENABLE(devel-docs,
1867b425557eSmrg	AS_HELP_STRING([--enable-devel-docs],
1868b425557eSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1869b425557eSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1870b425557eSmrgm4_undefine([devel_default])
1871b425557eSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1872b425557eSmrgAC_MSG_CHECKING([whether to build developer documentation])
1873b425557eSmrgAC_MSG_RESULT([$build_devel_docs])
1874b425557eSmrg]) # XORG_ENABLE_DEVEL_DOCS
1875b425557eSmrg
1876b425557eSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1877b425557eSmrg# ----------------
1878b425557eSmrg# Minimum version: 1.6.0
1879b425557eSmrg#
1880b425557eSmrg# This macro enables a builder to skip all functional specification targets.
1881b425557eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1882b425557eSmrg# maximum flexibilty in controlling documentation building.
1883b425557eSmrg# Refer to:
1884b425557eSmrg# XORG_WITH_XMLTO         --with-xmlto
1885b425557eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1886b425557eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1887b425557eSmrg# XORG_WITH_FOP           --with-fop
1888b425557eSmrg# XORG_WITH_GROFF         --with-groff
1889b425557eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1890b425557eSmrg#
1891b425557eSmrg# Interface to module:
1892b425557eSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1893b425557eSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1894b425557eSmrg#			'no' user instructs the module not to generate specs
1895b425557eSmrg# parm1:		specify the default value, yes or no.
1896b425557eSmrg#
1897b425557eSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1898b425557eSmrgm4_define([spec_default], m4_default([$1], [yes]))
1899b425557eSmrgAC_ARG_ENABLE(specs,
1900b425557eSmrg	AS_HELP_STRING([--enable-specs],
1901b425557eSmrg	   [Enable building the specs (default: ]spec_default[)]),
1902b425557eSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
1903b425557eSmrgm4_undefine([spec_default])
1904b425557eSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1905b425557eSmrgAC_MSG_CHECKING([whether to build functional specifications])
1906b425557eSmrgAC_MSG_RESULT([$build_specs])
1907b425557eSmrg]) # XORG_ENABLE_SPECS
190834977a2fSmrg
1909b425557eSmrg# XORG_CHECK_MALLOC_ZERO
1910b425557eSmrg# ----------------------
1911b425557eSmrg# Minimum version: 1.0.0
1912b425557eSmrg#
1913b425557eSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1914b425557eSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1915b425557eSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1916b425557eSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1917b425557eSmrgAC_ARG_ENABLE(malloc0returnsnull,
1918b425557eSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1919b425557eSmrg		       [malloc(0) returns NULL (default: auto)]),
1920b425557eSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1921b425557eSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1922ee3138f1Smrg
1923b425557eSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1924b425557eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1925b425557eSmrg	AC_RUN_IFELSE([
1926b425557eSmrgchar *malloc();
1927b425557eSmrgchar *realloc();
1928b425557eSmrgchar *calloc();
1929b425557eSmrgmain() {
1930b425557eSmrg    char *m0, *r0, *c0, *p;
1931b425557eSmrg    m0 = malloc(0);
1932b425557eSmrg    p = malloc(10);
1933b425557eSmrg    r0 = realloc(p,0);
1934b425557eSmrg    c0 = calloc(0);
1935b425557eSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1936b425557eSmrg}],
1937b425557eSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1938b425557eSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
1939b425557eSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1940b425557eSmrgfi
1941b425557eSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1942ee3138f1Smrg
1943b425557eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1944b425557eSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1945b425557eSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1946b425557eSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1947b425557eSmrgelse
1948b425557eSmrg	MALLOC_ZERO_CFLAGS=""
1949b425557eSmrg	XMALLOC_ZERO_CFLAGS=""
1950b425557eSmrg	XTMALLOC_ZERO_CFLAGS=""
1951b425557eSmrgfi
1952ee3138f1Smrg
1953b425557eSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1954b425557eSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1955b425557eSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1956b425557eSmrg]) # XORG_CHECK_MALLOC_ZERO
1957ee3138f1Smrg
1958b425557eSmrg# XORG_WITH_LINT()
1959b425557eSmrg# ----------------
1960b425557eSmrg# Minimum version: 1.1.0
1961b425557eSmrg#
1962b425557eSmrg# This macro enables the use of a tool that flags some suspicious and
1963b425557eSmrg# non-portable constructs (likely to be bugs) in C language source code.
1964b425557eSmrg# It will attempt to locate the tool and use appropriate options.
1965b425557eSmrg# There are various lint type tools on different platforms.
1966b425557eSmrg#
1967b425557eSmrg# Interface to module:
1968b425557eSmrg# LINT:		returns the path to the tool found on the platform
1969b425557eSmrg#		or the value set to LINT on the configure cmd line
1970b425557eSmrg#		also an Automake conditional
1971b425557eSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1972b425557eSmrg#
1973b425557eSmrg# --with-lint:	'yes' user instructs the module to use lint
1974b425557eSmrg#		'no' user instructs the module not to use lint (default)
1975b425557eSmrg#
1976b425557eSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1977b425557eSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1978b425557eSmrg#
1979b425557eSmrgAC_DEFUN([XORG_WITH_LINT],[
1980ee3138f1Smrg
1981b425557eSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1982b425557eSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1983b425557eSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1984b425557eSmrg		[Use a lint-style source code checker (default: disabled)])],
1985b425557eSmrg		[use_lint=$withval], [use_lint=no])
1986ee3138f1Smrg
1987b425557eSmrg# Obtain platform specific info like program name and options
1988b425557eSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1989b425557eSmrgcase $host_os in
1990b425557eSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1991b425557eSmrg	lint_name=splint
1992b425557eSmrg	lint_options="-badflag"
1993b425557eSmrg	;;
1994b425557eSmrg  *freebsd* | *netbsd*)
1995b425557eSmrg	lint_name=lint
1996b425557eSmrg	lint_options="-u -b"
1997b425557eSmrg	;;
1998b425557eSmrg  *solaris*)
1999b425557eSmrg	lint_name=lint
2000b425557eSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2001b425557eSmrg	;;
2002b425557eSmrgesac
2003ee3138f1Smrg
2004b425557eSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2005b425557eSmrgif test "x$use_lint" = x"yes" ; then
2006b425557eSmrg   AC_PATH_PROG([LINT], [$lint_name])
2007b425557eSmrg   if test "x$LINT" = "x"; then
2008b425557eSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2009b425557eSmrg   fi
2010b425557eSmrgelif test "x$use_lint" = x"no" ; then
2011b425557eSmrg   if test "x$LINT" != "x"; then
2012b425557eSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2013b425557eSmrg   fi
2014ee3138f1Smrgelse
2015b425557eSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2016ee3138f1Smrgfi
2017ee3138f1Smrg
2018b425557eSmrg# User supplied flags override default flags
2019b425557eSmrgif test "x$LINT_FLAGS" != "x"; then
2020b425557eSmrg   lint_options=$LINT_FLAGS
2021b425557eSmrgfi
2022ee3138f1Smrg
2023b425557eSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2024b425557eSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
202534977a2fSmrg
2026b425557eSmrg]) # XORG_WITH_LINT
2027ee3138f1Smrg
2028b425557eSmrg# XORG_LINT_LIBRARY(LIBNAME)
2029b425557eSmrg# --------------------------
2030b425557eSmrg# Minimum version: 1.1.0
2031b425557eSmrg#
2032b425557eSmrg# Sets up flags for building lint libraries for checking programs that call
2033b425557eSmrg# functions in the library.
2034b425557eSmrg#
2035b425557eSmrg# Interface to module:
2036b425557eSmrg# LINTLIB		- Automake variable with the name of lint library file to make
2037b425557eSmrg# MAKE_LINT_LIB		- Automake conditional
2038b425557eSmrg#
2039b425557eSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2040b425557eSmrg#			  - 'no' user instructs the module not to create a lint library (default)
2041ee3138f1Smrg
2042b425557eSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2043b425557eSmrgAC_REQUIRE([XORG_WITH_LINT])
2044b425557eSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2045b425557eSmrg	[Create lint library (default: disabled)])],
2046b425557eSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2047ee3138f1Smrg
2048b425557eSmrgif test "x$make_lint_lib" = x"yes" ; then
2049b425557eSmrg   LINTLIB=llib-l$1.ln
2050b425557eSmrg   if test "x$LINT" = "x"; then
2051b425557eSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2052b425557eSmrg   fi
2053b425557eSmrgelif test "x$make_lint_lib" != x"no" ; then
2054b425557eSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2055b425557eSmrgfi
2056ee3138f1Smrg
2057b425557eSmrgAC_SUBST(LINTLIB)
2058b425557eSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2059ee3138f1Smrg
2060b425557eSmrg]) # XORG_LINT_LIBRARY
2061ee3138f1Smrg
2062b425557eSmrg# XORG_CWARNFLAGS
2063b425557eSmrg# ---------------
2064b425557eSmrg# Minimum version: 1.2.0
2065b425557eSmrg#
2066b425557eSmrg# Defines CWARNFLAGS to enable C compiler warnings.
2067b425557eSmrg#
2068b425557eSmrgAC_DEFUN([XORG_CWARNFLAGS], [
2069b425557eSmrgAC_REQUIRE([AC_PROG_CC_C99])
2070b425557eSmrgif  test "x$GCC" = xyes ; then
2071b425557eSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2072b425557eSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2073b425557eSmrg-Wbad-function-cast -Wformat=2"
2074b425557eSmrg    case `$CC -dumpversion` in
2075b425557eSmrg    3.4.* | 4.*)
2076b425557eSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2077b425557eSmrg	;;
2078ee3138f1Smrg    esac
2079b425557eSmrgelse
2080b425557eSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2081b425557eSmrg    if test "x$SUNCC" = "xyes"; then
2082b425557eSmrg	CWARNFLAGS="-v"
2083b425557eSmrg    fi
2084ee3138f1Smrgfi
2085b425557eSmrgAC_SUBST(CWARNFLAGS)
2086b425557eSmrg]) # XORG_CWARNFLAGS
2087ee3138f1Smrg
2088b425557eSmrg# XORG_STRICT_OPTION
2089b425557eSmrg# -----------------------
2090b425557eSmrg# Minimum version: 1.3.0
2091b425557eSmrg#
2092b425557eSmrg# Add configure option to enable strict compilation
2093b425557eSmrgAC_DEFUN([XORG_STRICT_OPTION], [
2094b425557eSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2095b425557eSmrgAC_REQUIRE([AC_PROG_CC_C99])
2096b425557eSmrgAC_REQUIRE([XORG_CWARNFLAGS])
2097ee3138f1Smrg
2098b425557eSmrgAC_ARG_ENABLE(strict-compilation,
2099b425557eSmrg			  AS_HELP_STRING([--enable-strict-compilation],
2100b425557eSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2101b425557eSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2102b425557eSmrgif test "x$STRICT_COMPILE" = "xyes"; then
2103b425557eSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2104b425557eSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2105b425557eSmrg	if test "x$GCC" = xyes ; then
2106b425557eSmrg		STRICT_CFLAGS="-pedantic -Werror"
2107b425557eSmrg	elif test "x$SUNCC" = "xyes"; then
2108b425557eSmrg		STRICT_CFLAGS="-errwarn"
2109b425557eSmrg    elif test "x$INTELCC" = "xyes"; then
2110b425557eSmrg		STRICT_CFLAGS="-Werror"
2111b425557eSmrg	fi
2112b425557eSmrgfi
2113b425557eSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2114b425557eSmrgAC_SUBST([CWARNFLAGS])
2115b425557eSmrg]) # XORG_STRICT_OPTION
2116ee3138f1Smrg
2117b425557eSmrg# XORG_DEFAULT_OPTIONS
2118b425557eSmrg# --------------------
2119b425557eSmrg# Minimum version: 1.3.0
2120b425557eSmrg#
2121b425557eSmrg# Defines default options for X.Org modules.
2122b425557eSmrg#
2123b425557eSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2124b425557eSmrgAC_REQUIRE([AC_PROG_INSTALL])
2125b425557eSmrgXORG_CWARNFLAGS
2126b425557eSmrgXORG_STRICT_OPTION
2127b425557eSmrgXORG_RELEASE_VERSION
2128b425557eSmrgXORG_CHANGELOG
2129b425557eSmrgXORG_INSTALL
2130b425557eSmrgXORG_MANPAGE_SECTIONS
2131b425557eSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2132b425557eSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2133b425557eSmrg]) # XORG_DEFAULT_OPTIONS
2134ee3138f1Smrg
2135b425557eSmrg# XORG_INSTALL()
2136b425557eSmrg# ----------------
2137b425557eSmrg# Minimum version: 1.4.0
2138b425557eSmrg#
2139b425557eSmrg# Defines the variable INSTALL_CMD as the command to copy
2140b425557eSmrg# INSTALL from $prefix/share/util-macros.
2141b425557eSmrg#
2142b425557eSmrgAC_DEFUN([XORG_INSTALL], [
2143b425557eSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2144b425557eSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2145b425557eSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2146b425557eSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2147b425557eSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2148b425557eSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2149b425557eSmrgAC_SUBST([INSTALL_CMD])
2150b425557eSmrg]) # XORG_INSTALL
2151b425557eSmrgdnl Copyright 2005 Red Hat, Inc
2152b425557eSmrgdnl
2153b425557eSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2154b425557eSmrgdnl documentation for any purpose is hereby granted without fee, provided that
2155b425557eSmrgdnl the above copyright notice appear in all copies and that both that
2156b425557eSmrgdnl copyright notice and this permission notice appear in supporting
2157b425557eSmrgdnl documentation.
2158b425557eSmrgdnl
2159b425557eSmrgdnl The above copyright notice and this permission notice shall be included
2160b425557eSmrgdnl in all copies or substantial portions of the Software.
2161b425557eSmrgdnl
2162b425557eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2163b425557eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2164b425557eSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2165b425557eSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2166b425557eSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2167b425557eSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2168b425557eSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
2169b425557eSmrgdnl
2170b425557eSmrgdnl Except as contained in this notice, the name of the copyright holders shall
2171b425557eSmrgdnl not be used in advertising or otherwise to promote the sale, use or
2172b425557eSmrgdnl other dealings in this Software without prior written authorization
2173b425557eSmrgdnl from the copyright holders.
2174b425557eSmrgdnl
2175ee3138f1Smrg
2176b425557eSmrg# XORG_RELEASE_VERSION
2177b425557eSmrg# --------------------
2178b425557eSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2179b425557eSmrg 
2180b425557eSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2181b425557eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2182b425557eSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2183b425557eSmrg		[Major version of this package])
2184b425557eSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2185b425557eSmrg	if test "x$PVM" = "x"; then
2186b425557eSmrg		PVM="0"
2187b425557eSmrg	fi
2188b425557eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2189b425557eSmrg		[$PVM],
2190b425557eSmrg		[Minor version of this package])
2191b425557eSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2192b425557eSmrg	if test "x$PVP" = "x"; then
2193b425557eSmrg		PVP="0"
2194b425557eSmrg	fi
2195b425557eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2196b425557eSmrg		[$PVP],
2197b425557eSmrg		[Patch version of this package])
2198b425557eSmrg])
2199ee3138f1Smrg
2200b425557eSmrg# XORG_CHANGELOG()
2201b425557eSmrg# ----------------
2202b425557eSmrg# Minimum version: 1.2.0
2203b425557eSmrg#
2204b425557eSmrg# Defines the variable CHANGELOG_CMD as the command to generate
2205b425557eSmrg# ChangeLog from git.
2206b425557eSmrg#
2207b425557eSmrg#
2208b425557eSmrgAC_DEFUN([XORG_CHANGELOG], [
2209b425557eSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2210b425557eSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2211b425557eSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2212b425557eSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2213b425557eSmrgAC_SUBST([CHANGELOG_CMD])
2214b425557eSmrg]) # XORG_CHANGELOG
2215ee3138f1Smrg
2216b425557eSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2217b425557eSmrg# 
2218b425557eSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2219b425557eSmrg#
2220b425557eSmrg# This program is free software; you can redistribute it and/or modify
2221b425557eSmrg# it under the terms of the GNU General Public License as published by
2222b425557eSmrg# the Free Software Foundation; either version 2 of the License, or
2223b425557eSmrg# (at your option) any later version.
2224b425557eSmrg#
2225b425557eSmrg# This program is distributed in the hope that it will be useful, but
2226b425557eSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2227b425557eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2228b425557eSmrg# General Public License for more details.
2229b425557eSmrg#
2230b425557eSmrg# You should have received a copy of the GNU General Public License
2231b425557eSmrg# along with this program; if not, write to the Free Software
2232b425557eSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2233b425557eSmrg#
2234b425557eSmrg# As a special exception to the GNU General Public License, if you
2235b425557eSmrg# distribute this file as part of a program that contains a
2236b425557eSmrg# configuration script generated by Autoconf, you may include it under
2237b425557eSmrg# the same distribution terms that you use for the rest of that program.
2238ee3138f1Smrg
2239b425557eSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2240b425557eSmrg# ----------------------------------
2241b425557eSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2242b425557eSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2243b425557eSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2244b425557eSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2245b425557eSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2246b425557eSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2247b425557eSmrgfi
2248b425557eSmrgif test -n "$PKG_CONFIG"; then
2249b425557eSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
2250b425557eSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2251b425557eSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2252b425557eSmrg		AC_MSG_RESULT([yes])
2253b425557eSmrg	else
2254b425557eSmrg		AC_MSG_RESULT([no])
2255b425557eSmrg		PKG_CONFIG=""
2256b425557eSmrg	fi
2257b425557eSmrg		
2258b425557eSmrgfi[]dnl
2259b425557eSmrg])# PKG_PROG_PKG_CONFIG
2260ee3138f1Smrg
2261b425557eSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2262b425557eSmrg#
2263b425557eSmrg# Check to see whether a particular set of modules exists.  Similar
2264b425557eSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2265b425557eSmrg#
2266b425557eSmrg#
2267b425557eSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2268b425557eSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
2269b425557eSmrg# PKG_CHECK_EXISTS manually
2270b425557eSmrg# --------------------------------------------------------------
2271b425557eSmrgAC_DEFUN([PKG_CHECK_EXISTS],
2272b425557eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2273b425557eSmrgif test -n "$PKG_CONFIG" && \
2274b425557eSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2275b425557eSmrg  m4_ifval([$2], [$2], [:])
2276b425557eSmrgm4_ifvaln([$3], [else
2277b425557eSmrg  $3])dnl
2278b425557eSmrgfi])
2279ee3138f1Smrg
2280ee3138f1Smrg
2281b425557eSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2282b425557eSmrg# ---------------------------------------------
2283b425557eSmrgm4_define([_PKG_CONFIG],
2284b425557eSmrg[if test -n "$$1"; then
2285b425557eSmrg    pkg_cv_[]$1="$$1"
2286b425557eSmrg elif test -n "$PKG_CONFIG"; then
2287b425557eSmrg    PKG_CHECK_EXISTS([$3],
2288b425557eSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2289b425557eSmrg		     [pkg_failed=yes])
2290b425557eSmrg else
2291b425557eSmrg    pkg_failed=untried
2292b425557eSmrgfi[]dnl
2293b425557eSmrg])# _PKG_CONFIG
2294ee3138f1Smrg
2295b425557eSmrg# _PKG_SHORT_ERRORS_SUPPORTED
2296b425557eSmrg# -----------------------------
2297b425557eSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2298b425557eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2299b425557eSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2300b425557eSmrg        _pkg_short_errors_supported=yes
2301b425557eSmrgelse
2302b425557eSmrg        _pkg_short_errors_supported=no
2303b425557eSmrgfi[]dnl
2304b425557eSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
2305ee3138f1Smrg
2306ee3138f1Smrg
2307b425557eSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2308b425557eSmrg# [ACTION-IF-NOT-FOUND])
2309b425557eSmrg#
2310b425557eSmrg#
2311b425557eSmrg# Note that if there is a possibility the first call to
2312b425557eSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2313b425557eSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2314b425557eSmrg#
2315b425557eSmrg#
2316b425557eSmrg# --------------------------------------------------------------
2317b425557eSmrgAC_DEFUN([PKG_CHECK_MODULES],
2318b425557eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2319b425557eSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2320b425557eSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2321ee3138f1Smrg
2322b425557eSmrgpkg_failed=no
2323b425557eSmrgAC_MSG_CHECKING([for $1])
2324ee3138f1Smrg
2325b425557eSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2326b425557eSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2327ee3138f1Smrg
2328b425557eSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2329b425557eSmrgand $1[]_LIBS to avoid the need to call pkg-config.
2330b425557eSmrgSee the pkg-config man page for more details.])
2331ee3138f1Smrg
2332b425557eSmrgif test $pkg_failed = yes; then
2333b425557eSmrg        _PKG_SHORT_ERRORS_SUPPORTED
2334b425557eSmrg        if test $_pkg_short_errors_supported = yes; then
2335b425557eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2336b425557eSmrg        else 
2337b425557eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2338b425557eSmrg        fi
2339b425557eSmrg	# Put the nasty error message in config.log where it belongs
2340b425557eSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
234134977a2fSmrg
2342b425557eSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2343b425557eSmrg[Package requirements ($2) were not met:
2344ee3138f1Smrg
2345b425557eSmrg$$1_PKG_ERRORS
2346ee3138f1Smrg
2347b425557eSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2348b425557eSmrginstalled software in a non-standard prefix.
2349ee3138f1Smrg
2350b425557eSmrg_PKG_TEXT
2351b425557eSmrg])],
2352b425557eSmrg		[AC_MSG_RESULT([no])
2353b425557eSmrg                $4])
2354b425557eSmrgelif test $pkg_failed = untried; then
2355b425557eSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2356b425557eSmrg[The pkg-config script could not be found or is too old.  Make sure it
2357b425557eSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
2358b425557eSmrgpath to pkg-config.
2359ee3138f1Smrg
2360b425557eSmrg_PKG_TEXT
2361b425557eSmrg
2362b425557eSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2363b425557eSmrg		[$4])
2364ee3138f1Smrgelse
2365b425557eSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2366b425557eSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2367b425557eSmrg        AC_MSG_RESULT([yes])
2368b425557eSmrg	ifelse([$3], , :, [$3])
2369b425557eSmrgfi[]dnl
2370b425557eSmrg])# PKG_CHECK_MODULES
2371ee3138f1Smrg
2372b425557eSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2373b425557eSmrg#
2374b425557eSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2375b425557eSmrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
2376b425557eSmrg#                 Inc.
2377b425557eSmrg#   Written by Gordon Matzigkeit, 1996
2378b425557eSmrg#
2379b425557eSmrg# This file is free software; the Free Software Foundation gives
2380b425557eSmrg# unlimited permission to copy and/or distribute it, with or without
2381b425557eSmrg# modifications, as long as this notice is preserved.
2382ee3138f1Smrg
2383b425557eSmrgm4_define([_LT_COPYING], [dnl
2384b425557eSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2385b425557eSmrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
2386b425557eSmrg#                 Inc.
2387b425557eSmrg#   Written by Gordon Matzigkeit, 1996
2388b425557eSmrg#
2389b425557eSmrg#   This file is part of GNU Libtool.
2390b425557eSmrg#
2391b425557eSmrg# GNU Libtool is free software; you can redistribute it and/or
2392b425557eSmrg# modify it under the terms of the GNU General Public License as
2393b425557eSmrg# published by the Free Software Foundation; either version 2 of
2394b425557eSmrg# the License, or (at your option) any later version.
2395b425557eSmrg#
2396b425557eSmrg# As a special exception to the GNU General Public License,
2397b425557eSmrg# if you distribute this file as part of a program or library that
2398b425557eSmrg# is built using GNU Libtool, you may include this file under the
2399b425557eSmrg# same distribution terms that you use for the rest of that program.
2400b425557eSmrg#
2401b425557eSmrg# GNU Libtool is distributed in the hope that it will be useful,
2402b425557eSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
2403b425557eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2404b425557eSmrg# GNU General Public License for more details.
2405b425557eSmrg#
2406b425557eSmrg# You should have received a copy of the GNU General Public License
2407b425557eSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
2408b425557eSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
2409b425557eSmrg# obtained by writing to the Free Software Foundation, Inc.,
2410b425557eSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2411b425557eSmrg])
2412ee3138f1Smrg
2413b425557eSmrg# serial 57 LT_INIT
2414ee3138f1Smrg
2415ee3138f1Smrg
2416b425557eSmrg# LT_PREREQ(VERSION)
2417b425557eSmrg# ------------------
2418b425557eSmrg# Complain and exit if this libtool version is less that VERSION.
2419b425557eSmrgm4_defun([LT_PREREQ],
2420b425557eSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
2421b425557eSmrg       [m4_default([$3],
2422b425557eSmrg		   [m4_fatal([Libtool version $1 or higher is required],
2423b425557eSmrg		             63)])],
2424b425557eSmrg       [$2])])
2425ee3138f1Smrg
2426ee3138f1Smrg
2427b425557eSmrg# _LT_CHECK_BUILDDIR
2428b425557eSmrg# ------------------
2429b425557eSmrg# Complain if the absolute build directory name contains unusual characters
2430b425557eSmrgm4_defun([_LT_CHECK_BUILDDIR],
2431b425557eSmrg[case `pwd` in
2432b425557eSmrg  *\ * | *\	*)
2433b425557eSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
2434b425557eSmrgesac
2435b425557eSmrg])
2436ee3138f1Smrg
2437b425557eSmrg
2438b425557eSmrg# LT_INIT([OPTIONS])
2439b425557eSmrg# ------------------
2440b425557eSmrgAC_DEFUN([LT_INIT],
2441b425557eSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
2442b425557eSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
2443b425557eSmrgAC_BEFORE([$0], [LT_LANG])dnl
2444b425557eSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
2445b425557eSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
2446b425557eSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
2447b425557eSmrg
2448b425557eSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
2449b425557eSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
2450b425557eSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
2451b425557eSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
2452b425557eSmrgdnl unless we require an AC_DEFUNed macro:
2453b425557eSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
2454b425557eSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
2455b425557eSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
2456b425557eSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
2457b425557eSmrgm4_require([_LT_PROG_LTMAIN])dnl
2458b425557eSmrg
2459b425557eSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
2460b425557eSmrg
2461b425557eSmrgdnl Parse OPTIONS
2462b425557eSmrg_LT_SET_OPTIONS([$0], [$1])
2463b425557eSmrg
2464b425557eSmrg# This can be used to rebuild libtool when needed
2465b425557eSmrgLIBTOOL_DEPS="$ltmain"
2466b425557eSmrg
2467b425557eSmrg# Always use our own libtool.
2468b425557eSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
2469b425557eSmrgAC_SUBST(LIBTOOL)dnl
2470b425557eSmrg
2471b425557eSmrg_LT_SETUP
2472b425557eSmrg
2473b425557eSmrg# Only expand once:
2474b425557eSmrgm4_define([LT_INIT])
2475b425557eSmrg])# LT_INIT
2476b425557eSmrg
2477b425557eSmrg# Old names:
2478b425557eSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
2479b425557eSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
2480b425557eSmrgdnl aclocal-1.4 backwards compatibility:
2481b425557eSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
2482b425557eSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
2483b425557eSmrg
2484b425557eSmrg
2485b425557eSmrg# _LT_CC_BASENAME(CC)
2486b425557eSmrg# -------------------
2487b425557eSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
2488b425557eSmrgm4_defun([_LT_CC_BASENAME],
2489b425557eSmrg[for cc_temp in $1""; do
2490b425557eSmrg  case $cc_temp in
2491b425557eSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
2492b425557eSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
2493b425557eSmrg    \-*) ;;
2494b425557eSmrg    *) break;;
2495ee3138f1Smrg  esac
2496b425557eSmrgdone
2497b425557eSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
2498b425557eSmrg])
2499ee3138f1Smrg
2500ee3138f1Smrg
2501b425557eSmrg# _LT_FILEUTILS_DEFAULTS
2502b425557eSmrg# ----------------------
2503b425557eSmrg# It is okay to use these file commands and assume they have been set
2504b425557eSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
2505b425557eSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
2506b425557eSmrg[: ${CP="cp -f"}
2507b425557eSmrg: ${MV="mv -f"}
2508b425557eSmrg: ${RM="rm -f"}
2509b425557eSmrg])# _LT_FILEUTILS_DEFAULTS
2510b425557eSmrg
2511b425557eSmrg
2512b425557eSmrg# _LT_SETUP
2513b425557eSmrg# ---------
2514b425557eSmrgm4_defun([_LT_SETUP],
251534977a2fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2516b425557eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2517b425557eSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
2518b425557eSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
2519b425557eSmrg
2520b425557eSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
2521b425557eSmrg_LT_DECL([], [host], [0])dnl
2522b425557eSmrg_LT_DECL([], [host_os], [0])dnl
2523b425557eSmrgdnl
2524b425557eSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
2525b425557eSmrg_LT_DECL([], [build], [0])dnl
2526b425557eSmrg_LT_DECL([], [build_os], [0])dnl
2527b425557eSmrgdnl
2528b425557eSmrgAC_REQUIRE([AC_PROG_CC])dnl
2529b425557eSmrgAC_REQUIRE([LT_PATH_LD])dnl
2530b425557eSmrgAC_REQUIRE([LT_PATH_NM])dnl
2531b425557eSmrgdnl
2532b425557eSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
2533b425557eSmrgtest -z "$LN_S" && LN_S="ln -s"
2534b425557eSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
2535b425557eSmrgdnl
2536b425557eSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
2537b425557eSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
2538b425557eSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
2539b425557eSmrgdnl
254034977a2fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2541b425557eSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2542b425557eSmrgm4_require([_LT_CMD_RELOAD])dnl
2543b425557eSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
2544b425557eSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
2545b425557eSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
2546ee3138f1Smrg
2547b425557eSmrg_LT_CONFIG_LIBTOOL_INIT([
2548b425557eSmrg# See if we are running on zsh, and set the options which allow our
2549b425557eSmrg# commands through without removal of \ escapes INIT.
2550b425557eSmrgif test -n "\${ZSH_VERSION+set}" ; then
2551b425557eSmrg   setopt NO_GLOB_SUBST
2552b425557eSmrgfi
2553b425557eSmrg])
2554b425557eSmrgif test -n "${ZSH_VERSION+set}" ; then
2555b425557eSmrg   setopt NO_GLOB_SUBST
2556b425557eSmrgfi
2557ee3138f1Smrg
2558b425557eSmrg_LT_CHECK_OBJDIR
2559ee3138f1Smrg
2560b425557eSmrgm4_require([_LT_TAG_COMPILER])dnl
2561ee3138f1Smrg
2562b425557eSmrgcase $host_os in
2563b425557eSmrgaix3*)
2564b425557eSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2565b425557eSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2566b425557eSmrg  # vanish in a puff of smoke.
2567b425557eSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
2568b425557eSmrg    COLLECT_NAMES=
2569b425557eSmrg    export COLLECT_NAMES
2570ee3138f1Smrg  fi
2571ee3138f1Smrg  ;;
2572b425557eSmrgesac
2573ee3138f1Smrg
2574b425557eSmrg# Global variables:
2575b425557eSmrgofile=libtool
2576b425557eSmrgcan_build_shared=yes
2577ee3138f1Smrg
2578b425557eSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
2579b425557eSmrg# which needs '.lib').
2580b425557eSmrglibext=a
2581ee3138f1Smrg
2582b425557eSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
2583ee3138f1Smrg
2584b425557eSmrgold_CC="$CC"
2585b425557eSmrgold_CFLAGS="$CFLAGS"
2586ee3138f1Smrg
2587b425557eSmrg# Set sane defaults for various variables
2588b425557eSmrgtest -z "$CC" && CC=cc
2589b425557eSmrgtest -z "$LTCC" && LTCC=$CC
2590b425557eSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2591b425557eSmrgtest -z "$LD" && LD=ld
2592b425557eSmrgtest -z "$ac_objext" && ac_objext=o
2593ee3138f1Smrg
2594b425557eSmrg_LT_CC_BASENAME([$compiler])
2595ee3138f1Smrg
2596b425557eSmrg# Only perform the check for file, if the check method requires it
2597b425557eSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2598b425557eSmrgcase $deplibs_check_method in
2599b425557eSmrgfile_magic*)
2600b425557eSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2601b425557eSmrg    _LT_PATH_MAGIC
2602b425557eSmrg  fi
2603ee3138f1Smrg  ;;
2604b425557eSmrgesac
2605ee3138f1Smrg
2606b425557eSmrg# Use C for the default configuration in the libtool script
2607b425557eSmrgLT_SUPPORTED_TAG([CC])
2608b425557eSmrg_LT_LANG_C_CONFIG
2609b425557eSmrg_LT_LANG_DEFAULT_CONFIG
2610b425557eSmrg_LT_CONFIG_COMMANDS
2611b425557eSmrg])# _LT_SETUP
2612ee3138f1Smrg
2613ee3138f1Smrg
2614b425557eSmrg# _LT_PREPARE_SED_QUOTE_VARS
2615b425557eSmrg# --------------------------
2616b425557eSmrg# Define a few sed substitution that help us do robust quoting.
2617b425557eSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
2618b425557eSmrg[# Backslashify metacharacters that are still active within
2619b425557eSmrg# double-quoted strings.
2620b425557eSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2621ee3138f1Smrg
2622b425557eSmrg# Same as above, but do not quote variable references.
2623b425557eSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2624ee3138f1Smrg
2625b425557eSmrg# Sed substitution to delay expansion of an escaped shell variable in a
2626b425557eSmrg# double_quote_subst'ed string.
2627b425557eSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2628ee3138f1Smrg
2629b425557eSmrg# Sed substitution to delay expansion of an escaped single quote.
2630b425557eSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2631ee3138f1Smrg
2632b425557eSmrg# Sed substitution to avoid accidental globbing in evaled expressions
2633b425557eSmrgno_glob_subst='s/\*/\\\*/g'
2634b425557eSmrg])
2635ee3138f1Smrg
2636b425557eSmrg# _LT_PROG_LTMAIN
2637b425557eSmrg# ---------------
2638b425557eSmrg# Note that this code is called both from `configure', and `config.status'
2639b425557eSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
2640b425557eSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
2641b425557eSmrg# so we pass a copy along to make sure it has a sensible value anyway.
2642b425557eSmrgm4_defun([_LT_PROG_LTMAIN],
2643b425557eSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
2644b425557eSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
2645b425557eSmrgltmain="$ac_aux_dir/ltmain.sh"
2646b425557eSmrg])# _LT_PROG_LTMAIN
2647ee3138f1Smrg
264834977a2fSmrg
264979a8a9c6Smrg
2650b425557eSmrg# So that we can recreate a full libtool script including additional
2651b425557eSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
2652b425557eSmrg# in macros and then make a single call at the end using the `libtool'
2653b425557eSmrg# label.
2654ee3138f1Smrg
2655ee3138f1Smrg
2656b425557eSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
2657b425557eSmrg# ----------------------------------------
2658b425557eSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
2659b425557eSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
2660b425557eSmrg[m4_ifval([$1],
2661b425557eSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
2662b425557eSmrg                     [$1
2663b425557eSmrg])])])
2664ee3138f1Smrg
2665b425557eSmrg# Initialize.
2666b425557eSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
2667ee3138f1Smrg
2668ee3138f1Smrg
2669b425557eSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
2670b425557eSmrg# ------------------------------
2671b425557eSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
2672b425557eSmrgm4_define([_LT_CONFIG_LIBTOOL],
2673b425557eSmrg[m4_ifval([$1],
2674b425557eSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
2675b425557eSmrg                     [$1
2676b425557eSmrg])])])
2677ee3138f1Smrg
2678b425557eSmrg# Initialize.
2679b425557eSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
2680ee3138f1Smrg
2681ee3138f1Smrg
2682b425557eSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
2683b425557eSmrg# -----------------------------------------------------
2684b425557eSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
2685b425557eSmrg[_LT_CONFIG_LIBTOOL([$1])
2686b425557eSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
2687b425557eSmrg])
2688ee3138f1Smrg
2689ee3138f1Smrg
2690b425557eSmrg# _LT_FORMAT_COMMENT([COMMENT])
2691b425557eSmrg# -----------------------------
2692b425557eSmrg# Add leading comment marks to the start of each line, and a trailing
2693b425557eSmrg# full-stop to the whole comment if one is not present already.
2694b425557eSmrgm4_define([_LT_FORMAT_COMMENT],
2695b425557eSmrg[m4_ifval([$1], [
2696b425557eSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
2697b425557eSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
2698b425557eSmrg)])
2699ee3138f1Smrg
2700ee3138f1Smrg
2701ee3138f1Smrg
2702ee3138f1Smrg
2703ee3138f1Smrg
2704b425557eSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
2705b425557eSmrg# -------------------------------------------------------------------
2706b425557eSmrg# CONFIGNAME is the name given to the value in the libtool script.
2707b425557eSmrg# VARNAME is the (base) name used in the configure script.
2708b425557eSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
2709b425557eSmrg# VARNAME.  Any other value will be used directly.
2710b425557eSmrgm4_define([_LT_DECL],
2711b425557eSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
2712b425557eSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
2713b425557eSmrg	[m4_ifval([$1], [$1], [$2])])
2714b425557eSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
2715b425557eSmrg    m4_ifval([$4],
2716b425557eSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
2717b425557eSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
2718b425557eSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
2719b425557eSmrg])
272034977a2fSmrg
2721ee3138f1Smrg
2722b425557eSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
2723b425557eSmrg# --------------------------------------------------------
2724b425557eSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
2725ee3138f1Smrg
2726ee3138f1Smrg
2727b425557eSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
2728b425557eSmrg# ------------------------------------------------
2729b425557eSmrgm4_define([lt_decl_tag_varnames],
2730b425557eSmrg[_lt_decl_filter([tagged?], [yes], $@)])
2731ee3138f1Smrg
273234977a2fSmrg
2733b425557eSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
2734b425557eSmrg# ---------------------------------------------------------
2735b425557eSmrgm4_define([_lt_decl_filter],
2736b425557eSmrg[m4_case([$#],
2737b425557eSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
2738b425557eSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
2739b425557eSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
2740b425557eSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
2741b425557eSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
2742b425557eSmrg])
274334977a2fSmrg
2744ee3138f1Smrg
2745b425557eSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
2746b425557eSmrg# --------------------------------------------------
2747b425557eSmrgm4_define([lt_decl_quote_varnames],
2748b425557eSmrg[_lt_decl_filter([value], [1], $@)])
2749ee3138f1Smrg
2750ee3138f1Smrg
2751b425557eSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
2752b425557eSmrg# ---------------------------------------------------
2753b425557eSmrgm4_define([lt_decl_dquote_varnames],
2754b425557eSmrg[_lt_decl_filter([value], [2], $@)])
275534977a2fSmrg
2756ee3138f1Smrg
2757b425557eSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
2758b425557eSmrg# ---------------------------------------------------
2759b425557eSmrgm4_define([lt_decl_varnames_tagged],
2760b425557eSmrg[m4_assert([$# <= 2])dnl
2761b425557eSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
2762b425557eSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
2763b425557eSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
2764b425557eSmrgm4_define([_lt_decl_varnames_tagged],
2765b425557eSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
2766ee3138f1Smrg
276734977a2fSmrg
2768b425557eSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
2769b425557eSmrg# ------------------------------------------------
2770b425557eSmrgm4_define([lt_decl_all_varnames],
2771b425557eSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
2772b425557eSmrg     m4_if([$2], [],
2773b425557eSmrg	   m4_quote(lt_decl_varnames),
2774b425557eSmrg	m4_quote(m4_shift($@))))[]dnl
2775b425557eSmrg])
2776b425557eSmrgm4_define([_lt_decl_all_varnames],
2777b425557eSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
2778b425557eSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
2779b425557eSmrg])
278034977a2fSmrg
2781ee3138f1Smrg
2782b425557eSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
2783b425557eSmrg# ------------------------------------
2784b425557eSmrg# Quote a variable value, and forward it to `config.status' so that its
2785b425557eSmrg# declaration there will have the same value as in `configure'.  VARNAME
2786b425557eSmrg# must have a single quote delimited value for this to work.
2787b425557eSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
2788b425557eSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
2789ee3138f1Smrg
279034977a2fSmrg
2791b425557eSmrg# _LT_CONFIG_STATUS_DECLARATIONS
2792b425557eSmrg# ------------------------------
2793b425557eSmrg# We delimit libtool config variables with single quotes, so when
2794b425557eSmrg# we write them to config.status, we have to be sure to quote all
2795b425557eSmrg# embedded single quotes properly.  In configure, this macro expands
2796b425557eSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
2797b425557eSmrg#
2798b425557eSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
2799b425557eSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
2800b425557eSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
2801b425557eSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
280234977a2fSmrg
2803ee3138f1Smrg
2804b425557eSmrg# _LT_LIBTOOL_TAGS
2805b425557eSmrg# ----------------
2806b425557eSmrg# Output comment and list of tags supported by the script
2807b425557eSmrgm4_defun([_LT_LIBTOOL_TAGS],
2808b425557eSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
2809b425557eSmrgavailable_tags="_LT_TAGS"dnl
2810b425557eSmrg])
2811ee3138f1Smrg
2812ee3138f1Smrg
2813b425557eSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
2814b425557eSmrg# -----------------------------------
2815b425557eSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
2816b425557eSmrg# expand to a commented shell variable setting:
2817b425557eSmrg#
2818b425557eSmrg#    # Some comment about what VAR is for.
2819b425557eSmrg#    visible_name=$lt_internal_name
2820b425557eSmrgm4_define([_LT_LIBTOOL_DECLARE],
2821b425557eSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
2822b425557eSmrg					   [description])))[]dnl
2823b425557eSmrgm4_pushdef([_libtool_name],
2824b425557eSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
2825b425557eSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
2826b425557eSmrg    [0], [_libtool_name=[$]$1],
2827b425557eSmrg    [1], [_libtool_name=$lt_[]$1],
2828b425557eSmrg    [2], [_libtool_name=$lt_[]$1],
2829b425557eSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
2830b425557eSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
2831b425557eSmrg])
2832ee3138f1Smrg
2833ee3138f1Smrg
2834b425557eSmrg# _LT_LIBTOOL_CONFIG_VARS
2835b425557eSmrg# -----------------------
2836b425557eSmrg# Produce commented declarations of non-tagged libtool config variables
2837b425557eSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
2838b425557eSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
2839b425557eSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
2840b425557eSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
2841b425557eSmrg[m4_foreach([_lt_var],
2842b425557eSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
2843b425557eSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
2844ee3138f1Smrg
2845ee3138f1Smrg
2846b425557eSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
2847b425557eSmrg# -------------------------
2848b425557eSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
2849b425557eSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
2850b425557eSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
2851ee3138f1Smrg
2852ee3138f1Smrg
2853b425557eSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
2854b425557eSmrg# ------------------------------
2855b425557eSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
2856ee3138f1Smrg
285734977a2fSmrg
2858b425557eSmrg# _LT_CONFIG_COMMANDS
2859b425557eSmrg# -------------------
2860b425557eSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
2861b425557eSmrg# variables for single and double quote escaping we saved from calls
2862b425557eSmrg# to _LT_DECL, we can put quote escaped variables declarations
2863b425557eSmrg# into `config.status', and then the shell code to quote escape them in
2864b425557eSmrg# for loops in `config.status'.  Finally, any additional code accumulated
2865b425557eSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
2866b425557eSmrgm4_defun([_LT_CONFIG_COMMANDS],
2867b425557eSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
2868b425557eSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
2869b425557eSmrg	dnl instead of duplicating it all over again into config.status,
2870b425557eSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
2871b425557eSmrg	dnl needs to know what name is stored there:
2872b425557eSmrg        [AC_CONFIG_COMMANDS([libtool],
2873b425557eSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
2874b425557eSmrg    dnl If the libtool generation code is destined for config.status,
2875b425557eSmrg    dnl expand the accumulated commands and init code now:
2876b425557eSmrg    [AC_CONFIG_COMMANDS([libtool],
2877b425557eSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
2878b425557eSmrg])#_LT_CONFIG_COMMANDS
2879ee3138f1Smrg
2880ee3138f1Smrg
2881b425557eSmrg# Initialize.
2882b425557eSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
2883b425557eSmrg[
2884ee3138f1Smrg
2885b425557eSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
2886b425557eSmrg# if CDPATH is set.
2887b425557eSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2888ee3138f1Smrg
2889b425557eSmrgsed_quote_subst='$sed_quote_subst'
2890b425557eSmrgdouble_quote_subst='$double_quote_subst'
2891b425557eSmrgdelay_variable_subst='$delay_variable_subst'
2892b425557eSmrg_LT_CONFIG_STATUS_DECLARATIONS
2893b425557eSmrgLTCC='$LTCC'
2894b425557eSmrgLTCFLAGS='$LTCFLAGS'
2895b425557eSmrgcompiler='$compiler_DEFAULT'
2896ee3138f1Smrg
2897b425557eSmrg# A function that is used when there is no print builtin or printf.
2898b425557eSmrgfunc_fallback_echo ()
2899b425557eSmrg{
2900b425557eSmrg  eval 'cat <<_LTECHO_EOF
2901b425557eSmrg\$[]1
2902b425557eSmrg_LTECHO_EOF'
2903b425557eSmrg}
2904ee3138f1Smrg
2905b425557eSmrg# Quote evaled strings.
2906b425557eSmrgfor var in lt_decl_all_varnames([[ \
2907b425557eSmrg]], lt_decl_quote_varnames); do
2908b425557eSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
2909b425557eSmrg    *[[\\\\\\\`\\"\\\$]]*)
2910b425557eSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
2911b425557eSmrg      ;;
2912b425557eSmrg    *)
2913b425557eSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
2914b425557eSmrg      ;;
2915b425557eSmrg    esac
2916b425557eSmrgdone
2917ee3138f1Smrg
2918b425557eSmrg# Double-quote double-evaled strings.
2919b425557eSmrgfor var in lt_decl_all_varnames([[ \
2920b425557eSmrg]], lt_decl_dquote_varnames); do
2921b425557eSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
2922b425557eSmrg    *[[\\\\\\\`\\"\\\$]]*)
2923b425557eSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
2924b425557eSmrg      ;;
2925b425557eSmrg    *)
2926b425557eSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
2927b425557eSmrg      ;;
2928b425557eSmrg    esac
2929b425557eSmrgdone
2930ee3138f1Smrg
2931b425557eSmrg_LT_OUTPUT_LIBTOOL_INIT
2932b425557eSmrg])
2933ee3138f1Smrg
2934b425557eSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
2935b425557eSmrg# ------------------------------------
2936b425557eSmrg# Generate a child script FILE with all initialization necessary to
2937b425557eSmrg# reuse the environment learned by the parent script, and make the
2938b425557eSmrg# file executable.  If COMMENT is supplied, it is inserted after the
2939b425557eSmrg# `#!' sequence but before initialization text begins.  After this
2940b425557eSmrg# macro, additional text can be appended to FILE to form the body of
2941b425557eSmrg# the child script.  The macro ends with non-zero status if the
2942b425557eSmrg# file could not be fully written (such as if the disk is full).
2943b425557eSmrgm4_ifdef([AS_INIT_GENERATED],
2944b425557eSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
2945b425557eSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
2946b425557eSmrg[m4_require([AS_PREPARE])]dnl
2947b425557eSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
2948b425557eSmrg[lt_write_fail=0
2949b425557eSmrgcat >$1 <<_ASEOF || lt_write_fail=1
2950b425557eSmrg#! $SHELL
2951b425557eSmrg# Generated by $as_me.
2952b425557eSmrg$2
2953b425557eSmrgSHELL=\${CONFIG_SHELL-$SHELL}
2954b425557eSmrgexport SHELL
2955b425557eSmrg_ASEOF
2956b425557eSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
2957b425557eSmrgAS_SHELL_SANITIZE
2958b425557eSmrg_AS_PREPARE
2959b425557eSmrgexec AS_MESSAGE_FD>&1
2960b425557eSmrg_ASEOF
2961b425557eSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
2962b425557eSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
2963ee3138f1Smrg
2964b425557eSmrg# LT_OUTPUT
2965b425557eSmrg# ---------
2966b425557eSmrg# This macro allows early generation of the libtool script (before
2967b425557eSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
2968b425557eSmrg# tests.
2969b425557eSmrgAC_DEFUN([LT_OUTPUT],
2970b425557eSmrg[: ${CONFIG_LT=./config.lt}
2971b425557eSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
2972b425557eSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
2973b425557eSmrg[# Run this file to recreate a libtool stub with the current configuration.])
2974ee3138f1Smrg
2975b425557eSmrgcat >>"$CONFIG_LT" <<\_LTEOF
2976b425557eSmrglt_cl_silent=false
2977b425557eSmrgexec AS_MESSAGE_LOG_FD>>config.log
2978b425557eSmrg{
2979b425557eSmrg  echo
2980b425557eSmrg  AS_BOX([Running $as_me.])
2981b425557eSmrg} >&AS_MESSAGE_LOG_FD
2982ee3138f1Smrg
2983b425557eSmrglt_cl_help="\
2984b425557eSmrg\`$as_me' creates a local libtool stub from the current configuration,
2985b425557eSmrgfor use in further configure time tests before the real libtool is
2986b425557eSmrggenerated.
2987ee3138f1Smrg
2988b425557eSmrgUsage: $[0] [[OPTIONS]]
2989ee3138f1Smrg
2990b425557eSmrg  -h, --help      print this help, then exit
2991b425557eSmrg  -V, --version   print version number, then exit
2992b425557eSmrg  -q, --quiet     do not print progress messages
2993b425557eSmrg  -d, --debug     don't remove temporary files
299434977a2fSmrg
2995b425557eSmrgReport bugs to <bug-libtool@gnu.org>."
2996ee3138f1Smrg
2997b425557eSmrglt_cl_version="\
2998b425557eSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
2999b425557eSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
3000b425557eSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
3001ee3138f1Smrg
3002b425557eSmrgCopyright (C) 2010 Free Software Foundation, Inc.
3003b425557eSmrgThis config.lt script is free software; the Free Software Foundation
3004b425557eSmrggives unlimited permision to copy, distribute and modify it."
3005b425557eSmrg
3006b425557eSmrgwhile test $[#] != 0
3007b425557eSmrgdo
3008b425557eSmrg  case $[1] in
3009b425557eSmrg    --version | --v* | -V )
3010b425557eSmrg      echo "$lt_cl_version"; exit 0 ;;
3011b425557eSmrg    --help | --h* | -h )
3012b425557eSmrg      echo "$lt_cl_help"; exit 0 ;;
3013b425557eSmrg    --debug | --d* | -d )
3014b425557eSmrg      debug=: ;;
3015b425557eSmrg    --quiet | --q* | --silent | --s* | -q )
3016b425557eSmrg      lt_cl_silent=: ;;
3017ee3138f1Smrg
3018b425557eSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
3019b425557eSmrgTry \`$[0] --help' for more information.]) ;;
302034977a2fSmrg
3021b425557eSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
3022b425557eSmrgTry \`$[0] --help' for more information.]) ;;
3023b425557eSmrg  esac
3024b425557eSmrg  shift
3025b425557eSmrgdone
3026b425557eSmrg
3027b425557eSmrgif $lt_cl_silent; then
3028b425557eSmrg  exec AS_MESSAGE_FD>/dev/null
302934977a2fSmrgfi
3030b425557eSmrg_LTEOF
303134977a2fSmrg
3032b425557eSmrgcat >>"$CONFIG_LT" <<_LTEOF
3033b425557eSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
3034b425557eSmrg_LTEOF
3035ee3138f1Smrg
3036b425557eSmrgcat >>"$CONFIG_LT" <<\_LTEOF
3037b425557eSmrgAC_MSG_NOTICE([creating $ofile])
3038b425557eSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
3039b425557eSmrgAS_EXIT(0)
3040b425557eSmrg_LTEOF
3041b425557eSmrgchmod +x "$CONFIG_LT"
3042ee3138f1Smrg
3043b425557eSmrg# configure is writing to config.log, but config.lt does its own redirection,
3044b425557eSmrg# appending to config.log, which fails on DOS, as config.log is still kept
3045b425557eSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
3046b425557eSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
3047b425557eSmrglt_cl_success=:
3048b425557eSmrgtest "$silent" = yes &&
3049b425557eSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
3050b425557eSmrgexec AS_MESSAGE_LOG_FD>/dev/null
3051b425557eSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
3052b425557eSmrgexec AS_MESSAGE_LOG_FD>>config.log
3053b425557eSmrg$lt_cl_success || AS_EXIT(1)
3054b425557eSmrg])# LT_OUTPUT
305534977a2fSmrg
3056ee3138f1Smrg
3057b425557eSmrg# _LT_CONFIG(TAG)
3058b425557eSmrg# ---------------
3059b425557eSmrg# If TAG is the built-in tag, create an initial libtool script with a
3060b425557eSmrg# default configuration from the untagged config vars.  Otherwise add code
3061b425557eSmrg# to config.status for appending the configuration named by TAG from the
3062b425557eSmrg# matching tagged config vars.
3063b425557eSmrgm4_defun([_LT_CONFIG],
3064b425557eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3065b425557eSmrg_LT_CONFIG_SAVE_COMMANDS([
3066b425557eSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
3067b425557eSmrg  m4_if(_LT_TAG, [C], [
3068b425557eSmrg    # See if we are running on zsh, and set the options which allow our
3069b425557eSmrg    # commands through without removal of \ escapes.
3070b425557eSmrg    if test -n "${ZSH_VERSION+set}" ; then
3071b425557eSmrg      setopt NO_GLOB_SUBST
3072b425557eSmrg    fi
3073ee3138f1Smrg
3074b425557eSmrg    cfgfile="${ofile}T"
3075b425557eSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
3076b425557eSmrg    $RM "$cfgfile"
3077ee3138f1Smrg
3078b425557eSmrg    cat <<_LT_EOF >> "$cfgfile"
3079b425557eSmrg#! $SHELL
3080ee3138f1Smrg
3081b425557eSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
3082b425557eSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
3083b425557eSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3084b425557eSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
3085b425557eSmrg#
3086b425557eSmrg_LT_COPYING
3087b425557eSmrg_LT_LIBTOOL_TAGS
3088ee3138f1Smrg
3089b425557eSmrg# ### BEGIN LIBTOOL CONFIG
3090b425557eSmrg_LT_LIBTOOL_CONFIG_VARS
3091b425557eSmrg_LT_LIBTOOL_TAG_VARS
3092b425557eSmrg# ### END LIBTOOL CONFIG
3093ee3138f1Smrg
3094b425557eSmrg_LT_EOF
3095b425557eSmrg
3096b425557eSmrg  case $host_os in
3097b425557eSmrg  aix3*)
3098b425557eSmrg    cat <<\_LT_EOF >> "$cfgfile"
3099b425557eSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
3100b425557eSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
3101b425557eSmrg# vanish in a puff of smoke.
3102b425557eSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
3103b425557eSmrg  COLLECT_NAMES=
3104b425557eSmrg  export COLLECT_NAMES
310534977a2fSmrgfi
3106b425557eSmrg_LT_EOF
3107b425557eSmrg    ;;
3108b425557eSmrg  esac
3109ee3138f1Smrg
3110b425557eSmrg  _LT_PROG_LTMAIN
3111ee3138f1Smrg
3112b425557eSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
3113b425557eSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3114b425557eSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
3115b425557eSmrg  # is reportedly fixed, but why not run on old versions too?
3116b425557eSmrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
3117b425557eSmrg    || (rm -f "$cfgfile"; exit 1)
3118ee3138f1Smrg
3119b425557eSmrg  _LT_PROG_XSI_SHELLFNS
3120ee3138f1Smrg
3121b425557eSmrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
3122b425557eSmrg    || (rm -f "$cfgfile"; exit 1)
3123ee3138f1Smrg
3124b425557eSmrg  mv -f "$cfgfile" "$ofile" ||
3125b425557eSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
3126b425557eSmrg  chmod +x "$ofile"
3127b425557eSmrg],
3128b425557eSmrg[cat <<_LT_EOF >> "$ofile"
3129ee3138f1Smrg
3130b425557eSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
3131b425557eSmrgdnl in a comment (ie after a #).
3132b425557eSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
3133b425557eSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
3134b425557eSmrg# ### END LIBTOOL TAG CONFIG: $1
3135b425557eSmrg_LT_EOF
3136b425557eSmrg])dnl /m4_if
3137b425557eSmrg],
3138b425557eSmrg[m4_if([$1], [], [
3139b425557eSmrg    PACKAGE='$PACKAGE'
3140b425557eSmrg    VERSION='$VERSION'
3141b425557eSmrg    TIMESTAMP='$TIMESTAMP'
3142b425557eSmrg    RM='$RM'
3143b425557eSmrg    ofile='$ofile'], [])
3144b425557eSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
3145b425557eSmrg])# _LT_CONFIG
3146ee3138f1Smrg
3147ee3138f1Smrg
3148b425557eSmrg# LT_SUPPORTED_TAG(TAG)
3149b425557eSmrg# ---------------------
3150b425557eSmrg# Trace this macro to discover what tags are supported by the libtool
3151b425557eSmrg# --tag option, using:
3152b425557eSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
3153b425557eSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
3154ee3138f1Smrg
3155ee3138f1Smrg
3156b425557eSmrg# C support is built-in for now
3157b425557eSmrgm4_define([_LT_LANG_C_enabled], [])
3158b425557eSmrgm4_define([_LT_TAGS], [])
3159ee3138f1Smrg
3160ee3138f1Smrg
3161b425557eSmrg# LT_LANG(LANG)
3162b425557eSmrg# -------------
3163b425557eSmrg# Enable libtool support for the given language if not already enabled.
3164b425557eSmrgAC_DEFUN([LT_LANG],
3165b425557eSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
3166b425557eSmrgm4_case([$1],
3167b425557eSmrg  [C],			[_LT_LANG(C)],
3168b425557eSmrg  [C++],		[_LT_LANG(CXX)],
3169b425557eSmrg  [Java],		[_LT_LANG(GCJ)],
3170b425557eSmrg  [Fortran 77],		[_LT_LANG(F77)],
3171b425557eSmrg  [Fortran],		[_LT_LANG(FC)],
3172b425557eSmrg  [Windows Resource],	[_LT_LANG(RC)],
3173b425557eSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
3174b425557eSmrg    [_LT_LANG($1)],
3175b425557eSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
3176b425557eSmrg])# LT_LANG
3177ee3138f1Smrg
3178ee3138f1Smrg
3179b425557eSmrg# _LT_LANG(LANGNAME)
3180b425557eSmrg# ------------------
3181b425557eSmrgm4_defun([_LT_LANG],
3182b425557eSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
3183b425557eSmrg  [LT_SUPPORTED_TAG([$1])dnl
3184b425557eSmrg  m4_append([_LT_TAGS], [$1 ])dnl
3185b425557eSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
3186b425557eSmrg  _LT_LANG_$1_CONFIG($1)])dnl
3187b425557eSmrg])# _LT_LANG
3188ee3138f1Smrg
3189ee3138f1Smrg
3190b425557eSmrg# _LT_LANG_DEFAULT_CONFIG
3191b425557eSmrg# -----------------------
3192b425557eSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
3193b425557eSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
3194b425557eSmrg  [LT_LANG(CXX)],
3195b425557eSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
3196ee3138f1Smrg
3197b425557eSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
3198b425557eSmrg  [LT_LANG(F77)],
3199b425557eSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
3200ee3138f1Smrg
3201b425557eSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
3202b425557eSmrg  [LT_LANG(FC)],
3203b425557eSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
3204ee3138f1Smrg
3205b425557eSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
3206b425557eSmrgdnl pulling things in needlessly.
3207b425557eSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
3208b425557eSmrg  [LT_LANG(GCJ)],
3209b425557eSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
3210b425557eSmrg    [LT_LANG(GCJ)],
3211b425557eSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
3212b425557eSmrg      [LT_LANG(GCJ)],
3213b425557eSmrg      [m4_ifdef([AC_PROG_GCJ],
3214b425557eSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
3215b425557eSmrg       m4_ifdef([A][M_PROG_GCJ],
3216b425557eSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
3217b425557eSmrg       m4_ifdef([LT_PROG_GCJ],
3218b425557eSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
3219ee3138f1Smrg
3220b425557eSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
3221b425557eSmrg  [LT_LANG(RC)],
3222b425557eSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
3223b425557eSmrg])# _LT_LANG_DEFAULT_CONFIG
3224ee3138f1Smrg
3225b425557eSmrg# Obsolete macros:
3226b425557eSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
3227b425557eSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
3228b425557eSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
3229b425557eSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
3230b425557eSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
3231b425557eSmrgdnl aclocal-1.4 backwards compatibility:
3232b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
3233b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
3234b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
3235b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
3236b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
3237ee3138f1Smrg
3238b425557eSmrg
3239b425557eSmrg# _LT_TAG_COMPILER
3240b425557eSmrg# ----------------
3241b425557eSmrgm4_defun([_LT_TAG_COMPILER],
3242b425557eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3243b425557eSmrg
3244b425557eSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
3245b425557eSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
3246b425557eSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
3247b425557eSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
3248b425557eSmrg
3249b425557eSmrg# If no C compiler was specified, use CC.
3250b425557eSmrgLTCC=${LTCC-"$CC"}
3251b425557eSmrg
3252b425557eSmrg# If no C compiler flags were specified, use CFLAGS.
3253b425557eSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
3254b425557eSmrg
3255b425557eSmrg# Allow CC to be a program name with arguments.
3256b425557eSmrgcompiler=$CC
3257b425557eSmrg])# _LT_TAG_COMPILER
3258b425557eSmrg
3259b425557eSmrg
3260b425557eSmrg# _LT_COMPILER_BOILERPLATE
3261b425557eSmrg# ------------------------
3262b425557eSmrg# Check for compiler boilerplate output or warnings with
3263b425557eSmrg# the simple compiler test code.
3264b425557eSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
3265b425557eSmrg[m4_require([_LT_DECL_SED])dnl
3266b425557eSmrgac_outfile=conftest.$ac_objext
3267b425557eSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
3268b425557eSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
3269b425557eSmrg_lt_compiler_boilerplate=`cat conftest.err`
3270b425557eSmrg$RM conftest*
3271b425557eSmrg])# _LT_COMPILER_BOILERPLATE
3272b425557eSmrg
3273b425557eSmrg
3274b425557eSmrg# _LT_LINKER_BOILERPLATE
3275b425557eSmrg# ----------------------
3276b425557eSmrg# Check for linker boilerplate output or warnings with
3277b425557eSmrg# the simple link test code.
3278b425557eSmrgm4_defun([_LT_LINKER_BOILERPLATE],
3279b425557eSmrg[m4_require([_LT_DECL_SED])dnl
3280b425557eSmrgac_outfile=conftest.$ac_objext
3281b425557eSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
3282b425557eSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
3283b425557eSmrg_lt_linker_boilerplate=`cat conftest.err`
3284b425557eSmrg$RM -r conftest*
3285b425557eSmrg])# _LT_LINKER_BOILERPLATE
3286b425557eSmrg
3287b425557eSmrg# _LT_REQUIRED_DARWIN_CHECKS
3288b425557eSmrg# -------------------------
3289b425557eSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
3290b425557eSmrg  case $host_os in
3291b425557eSmrg    rhapsody* | darwin*)
3292b425557eSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
3293b425557eSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
3294b425557eSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
3295b425557eSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
3296b425557eSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
3297b425557eSmrg    _LT_DECL([], [DSYMUTIL], [1],
3298b425557eSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
3299b425557eSmrg    _LT_DECL([], [NMEDIT], [1],
3300b425557eSmrg      [Tool to change global to local symbols on Mac OS X])
3301b425557eSmrg    _LT_DECL([], [LIPO], [1],
3302b425557eSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
3303b425557eSmrg    _LT_DECL([], [OTOOL], [1],
3304b425557eSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
3305b425557eSmrg    _LT_DECL([], [OTOOL64], [1],
3306b425557eSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
3307b425557eSmrg
3308b425557eSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
3309b425557eSmrg      [lt_cv_apple_cc_single_mod=no
3310b425557eSmrg      if test -z "${LT_MULTI_MODULE}"; then
3311b425557eSmrg	# By default we will add the -single_module flag. You can override
3312b425557eSmrg	# by either setting the environment variable LT_MULTI_MODULE
3313b425557eSmrg	# non-empty at configure time, or by adding -multi_module to the
3314b425557eSmrg	# link flags.
3315b425557eSmrg	rm -rf libconftest.dylib*
3316b425557eSmrg	echo "int foo(void){return 1;}" > conftest.c
3317b425557eSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
3318b425557eSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
3319b425557eSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
3320b425557eSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
3321b425557eSmrg        _lt_result=$?
3322b425557eSmrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
3323b425557eSmrg	  lt_cv_apple_cc_single_mod=yes
332434977a2fSmrg	else
3325b425557eSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
332634977a2fSmrg	fi
3327b425557eSmrg	rm -rf libconftest.dylib*
3328b425557eSmrg	rm -f conftest.*
3329b425557eSmrg      fi])
3330b425557eSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
3331b425557eSmrg      [lt_cv_ld_exported_symbols_list],
3332b425557eSmrg      [lt_cv_ld_exported_symbols_list=no
3333b425557eSmrg      save_LDFLAGS=$LDFLAGS
3334b425557eSmrg      echo "_main" > conftest.sym
3335b425557eSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
3336b425557eSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3337b425557eSmrg	[lt_cv_ld_exported_symbols_list=yes],
3338b425557eSmrg	[lt_cv_ld_exported_symbols_list=no])
3339b425557eSmrg	LDFLAGS="$save_LDFLAGS"
3340b425557eSmrg    ])
3341b425557eSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
3342b425557eSmrg      [lt_cv_ld_force_load=no
3343b425557eSmrg      cat > conftest.c << _LT_EOF
3344b425557eSmrgint forced_loaded() { return 2;}
3345b425557eSmrg_LT_EOF
3346b425557eSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
3347b425557eSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
3348b425557eSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
3349b425557eSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
3350b425557eSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
3351b425557eSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
3352b425557eSmrg      cat > conftest.c << _LT_EOF
3353b425557eSmrgint main() { return 0;}
3354b425557eSmrg_LT_EOF
3355b425557eSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
3356b425557eSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
3357b425557eSmrg      _lt_result=$?
3358b425557eSmrg      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
3359b425557eSmrg	lt_cv_ld_force_load=yes
336034977a2fSmrg      else
3361b425557eSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
336234977a2fSmrg      fi
3363b425557eSmrg        rm -f conftest.err libconftest.a conftest conftest.c
3364b425557eSmrg        rm -rf conftest.dSYM
3365b425557eSmrg    ])
3366b425557eSmrg    case $host_os in
3367b425557eSmrg    rhapsody* | darwin1.[[012]])
3368b425557eSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
3369b425557eSmrg    darwin1.*)
3370b425557eSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
3371b425557eSmrg    darwin*) # darwin 5.x on
3372b425557eSmrg      # if running on 10.5 or later, the deployment target defaults
3373b425557eSmrg      # to the OS version, if on x86, and 10.4, the deployment
3374b425557eSmrg      # target defaults to 10.4. Don't you love it?
3375b425557eSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
3376b425557eSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
3377b425557eSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
3378b425557eSmrg	10.[[012]]*)
3379b425557eSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
3380b425557eSmrg	10.*)
3381b425557eSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
3382b425557eSmrg      esac
3383b425557eSmrg    ;;
3384b425557eSmrg  esac
3385b425557eSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
3386b425557eSmrg      _lt_dar_single_mod='$single_module'
3387b425557eSmrg    fi
3388b425557eSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
3389b425557eSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
3390ee3138f1Smrg    else
3391b425557eSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
3392b425557eSmrg    fi
3393b425557eSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
3394b425557eSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
3395b425557eSmrg    else
3396b425557eSmrg      _lt_dsymutil=
3397ee3138f1Smrg    fi
3398b425557eSmrg    ;;
3399b425557eSmrg  esac
3400b425557eSmrg])
3401b425557eSmrg
3402b425557eSmrg
3403b425557eSmrg# _LT_DARWIN_LINKER_FEATURES
3404b425557eSmrg# --------------------------
3405b425557eSmrg# Checks for linker and compiler features on darwin
3406b425557eSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
3407b425557eSmrg[
3408b425557eSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
3409b425557eSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
3410b425557eSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
3411b425557eSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
3412b425557eSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3413b425557eSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
3414b425557eSmrg    _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\"`'
3415ee3138f1Smrg  else
3416b425557eSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
3417ee3138f1Smrg  fi
3418b425557eSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
3419b425557eSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
3420b425557eSmrg  case $cc_basename in
3421b425557eSmrg     ifort*) _lt_dar_can_shared=yes ;;
3422b425557eSmrg     *) _lt_dar_can_shared=$GCC ;;
3423b425557eSmrg  esac
3424b425557eSmrg  if test "$_lt_dar_can_shared" = "yes"; then
3425b425557eSmrg    output_verbose_link_cmd=func_echo_all
3426b425557eSmrg    _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}"
3427b425557eSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
3428b425557eSmrg    _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}"
3429b425557eSmrg    _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}"
3430b425557eSmrg    m4_if([$1], [CXX],
3431b425557eSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
3432b425557eSmrg      _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}"
3433b425557eSmrg      _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}"
3434b425557eSmrg    fi
3435b425557eSmrg],[])
343634977a2fSmrg  else
3437b425557eSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
343834977a2fSmrg  fi
343934977a2fSmrg])
3440ee3138f1Smrg
3441b425557eSmrg# _LT_SYS_MODULE_PATH_AIX
3442b425557eSmrg# -----------------------
3443b425557eSmrg# Links a minimal program and checks the executable
3444b425557eSmrg# for the system default hardcoded library path. In most cases,
3445b425557eSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
3446b425557eSmrg# the location of the communication and MPI libs are included too.
3447b425557eSmrg# If we don't find anything, use the default library path according
3448b425557eSmrg# to the aix ld manual.
3449b425557eSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
3450b425557eSmrg[m4_require([_LT_DECL_SED])dnl
3451b425557eSmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
3452b425557eSmrglt_aix_libpath_sed='
3453b425557eSmrg    /Import File Strings/,/^$/ {
3454b425557eSmrg	/^0/ {
3455b425557eSmrg	    s/^0  *\(.*\)$/\1/
3456b425557eSmrg	    p
3457b425557eSmrg	}
3458b425557eSmrg    }'
3459b425557eSmrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
3460b425557eSmrg# Check for a 64-bit object if we didn't find anything.
3461b425557eSmrgif test -z "$aix_libpath"; then
3462b425557eSmrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
3463b425557eSmrgfi],[])
3464b425557eSmrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
3465b425557eSmrg])# _LT_SYS_MODULE_PATH_AIX
3466ee3138f1Smrg
3467ee3138f1Smrg
3468b425557eSmrg# _LT_SHELL_INIT(ARG)
3469b425557eSmrg# -------------------
3470b425557eSmrgm4_define([_LT_SHELL_INIT],
3471b425557eSmrg[m4_divert_text([M4SH-INIT], [$1
3472b425557eSmrg])])# _LT_SHELL_INIT
3473ee3138f1Smrg
3474ee3138f1Smrg
3475ee3138f1Smrg
3476b425557eSmrg# _LT_PROG_ECHO_BACKSLASH
3477b425557eSmrg# -----------------------
3478b425557eSmrg# Find how we can fake an echo command that does not interpret backslash.
3479b425557eSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
3480b425557eSmrg# of the generated configure script which will find a shell with a builtin
3481b425557eSmrg# printf (which we can use as an echo command).
3482b425557eSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
3483b425557eSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
3484b425557eSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
3485b425557eSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
3486b425557eSmrg
3487b425557eSmrgAC_MSG_CHECKING([how to print strings])
3488b425557eSmrg# Test print first, because it will be a builtin if present.
3489b425557eSmrgif test "X`print -r -- -n 2>/dev/null`" = X-n && \
3490b425557eSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
3491b425557eSmrg  ECHO='print -r --'
3492b425557eSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
3493b425557eSmrg  ECHO='printf %s\n'
3494b425557eSmrgelse
3495b425557eSmrg  # Use this function as a fallback that always works.
3496b425557eSmrg  func_fallback_echo ()
3497b425557eSmrg  {
3498b425557eSmrg    eval 'cat <<_LTECHO_EOF
3499b425557eSmrg$[]1
3500b425557eSmrg_LTECHO_EOF'
3501b425557eSmrg  }
3502b425557eSmrg  ECHO='func_fallback_echo'
3503b425557eSmrgfi
3504ee3138f1Smrg
3505b425557eSmrg# func_echo_all arg...
3506b425557eSmrg# Invoke $ECHO with all args, space-separated.
3507b425557eSmrgfunc_echo_all ()
3508b425557eSmrg{
3509b425557eSmrg    $ECHO "$*" 
3510b425557eSmrg}
3511b425557eSmrg
3512b425557eSmrgcase "$ECHO" in
3513b425557eSmrg  printf*) AC_MSG_RESULT([printf]) ;;
3514b425557eSmrg  print*) AC_MSG_RESULT([print -r]) ;;
3515b425557eSmrg  *) AC_MSG_RESULT([cat]) ;;
3516b425557eSmrgesac
3517b425557eSmrg
3518b425557eSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
3519b425557eSmrg[_AS_DETECT_SUGGESTED([
3520b425557eSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
3521b425557eSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
3522b425557eSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
3523b425557eSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
3524b425557eSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
3525b425557eSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
3526b425557eSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
3527b425557eSmrg
3528b425557eSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
3529b425557eSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
3530b425557eSmrg])# _LT_PROG_ECHO_BACKSLASH
3531b425557eSmrg
3532b425557eSmrg
3533b425557eSmrg# _LT_ENABLE_LOCK
3534b425557eSmrg# ---------------
3535b425557eSmrgm4_defun([_LT_ENABLE_LOCK],
3536b425557eSmrg[AC_ARG_ENABLE([libtool-lock],
3537b425557eSmrg  [AS_HELP_STRING([--disable-libtool-lock],
3538b425557eSmrg    [avoid locking (might break parallel builds)])])
3539b425557eSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
3540b425557eSmrg
3541b425557eSmrg# Some flags need to be propagated to the compiler or linker for good
3542b425557eSmrg# libtool support.
3543b425557eSmrgcase $host in
3544b425557eSmrgia64-*-hpux*)
3545b425557eSmrg  # Find out which ABI we are using.
3546b425557eSmrg  echo 'int i;' > conftest.$ac_ext
3547b425557eSmrg  if AC_TRY_EVAL(ac_compile); then
3548b425557eSmrg    case `/usr/bin/file conftest.$ac_objext` in
3549b425557eSmrg      *ELF-32*)
3550b425557eSmrg	HPUX_IA64_MODE="32"
3551ee3138f1Smrg	;;
3552b425557eSmrg      *ELF-64*)
3553b425557eSmrg	HPUX_IA64_MODE="64"
3554ee3138f1Smrg	;;
3555ee3138f1Smrg    esac
3556b425557eSmrg  fi
3557b425557eSmrg  rm -rf conftest*
3558b425557eSmrg  ;;
3559b425557eSmrg*-*-irix6*)
3560b425557eSmrg  # Find out which ABI we are using.
3561b425557eSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
3562b425557eSmrg  if AC_TRY_EVAL(ac_compile); then
3563b425557eSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
3564b425557eSmrg      case `/usr/bin/file conftest.$ac_objext` in
3565b425557eSmrg	*32-bit*)
3566b425557eSmrg	  LD="${LD-ld} -melf32bsmip"
3567ee3138f1Smrg	  ;;
3568b425557eSmrg	*N32*)
3569b425557eSmrg	  LD="${LD-ld} -melf32bmipn32"
3570b425557eSmrg	  ;;
3571b425557eSmrg	*64-bit*)
3572b425557eSmrg	  LD="${LD-ld} -melf64bmip"
3573ee3138f1Smrg	;;
3574b425557eSmrg      esac
3575b425557eSmrg    else
3576b425557eSmrg      case `/usr/bin/file conftest.$ac_objext` in
3577b425557eSmrg	*32-bit*)
3578b425557eSmrg	  LD="${LD-ld} -32"
3579b425557eSmrg	  ;;
3580b425557eSmrg	*N32*)
3581b425557eSmrg	  LD="${LD-ld} -n32"
3582b425557eSmrg	  ;;
3583b425557eSmrg	*64-bit*)
3584b425557eSmrg	  LD="${LD-ld} -64"
3585b425557eSmrg	  ;;
3586b425557eSmrg      esac
3587b425557eSmrg    fi
3588b425557eSmrg  fi
3589b425557eSmrg  rm -rf conftest*
3590b425557eSmrg  ;;
3591b425557eSmrg
3592b425557eSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
3593b425557eSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
3594b425557eSmrg  # Find out which ABI we are using.
3595b425557eSmrg  echo 'int i;' > conftest.$ac_ext
3596b425557eSmrg  if AC_TRY_EVAL(ac_compile); then
3597b425557eSmrg    case `/usr/bin/file conftest.o` in
3598b425557eSmrg      *32-bit*)
3599b425557eSmrg	case $host in
3600b425557eSmrg	  x86_64-*kfreebsd*-gnu)
3601b425557eSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
360234977a2fSmrg	    ;;
3603b425557eSmrg	  x86_64-*linux*)
3604b425557eSmrg	    LD="${LD-ld} -m elf_i386"
360534977a2fSmrg	    ;;
3606b425557eSmrg	  ppc64-*linux*|powerpc64-*linux*)
3607b425557eSmrg	    LD="${LD-ld} -m elf32ppclinux"
360834977a2fSmrg	    ;;
3609b425557eSmrg	  s390x-*linux*)
3610b425557eSmrg	    LD="${LD-ld} -m elf_s390"
361134977a2fSmrg	    ;;
3612b425557eSmrg	  sparc64-*linux*)
3613b425557eSmrg	    LD="${LD-ld} -m elf32_sparc"
361434977a2fSmrg	    ;;
361534977a2fSmrg	esac
3616ee3138f1Smrg	;;
3617b425557eSmrg      *64-bit*)
3618b425557eSmrg	case $host in
3619b425557eSmrg	  x86_64-*kfreebsd*-gnu)
3620b425557eSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
362134977a2fSmrg	    ;;
3622b425557eSmrg	  x86_64-*linux*)
3623b425557eSmrg	    LD="${LD-ld} -m elf_x86_64"
362434977a2fSmrg	    ;;
3625b425557eSmrg	  ppc*-*linux*|powerpc*-*linux*)
3626b425557eSmrg	    LD="${LD-ld} -m elf64ppc"
362734977a2fSmrg	    ;;
3628b425557eSmrg	  s390*-*linux*|s390*-*tpf*)
3629b425557eSmrg	    LD="${LD-ld} -m elf64_s390"
363034977a2fSmrg	    ;;
3631b425557eSmrg	  sparc*-*linux*)
3632b425557eSmrg	    LD="${LD-ld} -m elf64_sparc"
3633ee3138f1Smrg	    ;;
3634ee3138f1Smrg	esac
3635ee3138f1Smrg	;;
363634977a2fSmrg    esac
363734977a2fSmrg  fi
3638b425557eSmrg  rm -rf conftest*
3639b425557eSmrg  ;;
364034977a2fSmrg
3641b425557eSmrg*-*-sco3.2v5*)
3642b425557eSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3643b425557eSmrg  SAVE_CFLAGS="$CFLAGS"
3644b425557eSmrg  CFLAGS="$CFLAGS -belf"
3645b425557eSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
3646b425557eSmrg    [AC_LANG_PUSH(C)
3647b425557eSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
3648b425557eSmrg     AC_LANG_POP])
3649b425557eSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3650b425557eSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3651b425557eSmrg    CFLAGS="$SAVE_CFLAGS"
3652b425557eSmrg  fi
3653b425557eSmrg  ;;
3654b425557eSmrgsparc*-*solaris*)
3655b425557eSmrg  # Find out which ABI we are using.
3656b425557eSmrg  echo 'int i;' > conftest.$ac_ext
3657b425557eSmrg  if AC_TRY_EVAL(ac_compile); then
3658b425557eSmrg    case `/usr/bin/file conftest.o` in
3659b425557eSmrg    *64-bit*)
3660b425557eSmrg      case $lt_cv_prog_gnu_ld in
3661b425557eSmrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
3662ee3138f1Smrg      *)
3663b425557eSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
3664b425557eSmrg	  LD="${LD-ld} -64"
3665b425557eSmrg	fi
3666ee3138f1Smrg	;;
366734977a2fSmrg      esac
366834977a2fSmrg      ;;
3669b425557eSmrg    esac
3670b425557eSmrg  fi
3671b425557eSmrg  rm -rf conftest*
3672b425557eSmrg  ;;
3673b425557eSmrgesac
367434977a2fSmrg
3675b425557eSmrgneed_locks="$enable_libtool_lock"
3676b425557eSmrg])# _LT_ENABLE_LOCK
367734977a2fSmrg
367834977a2fSmrg
3679b425557eSmrg# _LT_CMD_OLD_ARCHIVE
3680b425557eSmrg# -------------------
3681b425557eSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
3682b425557eSmrg[AC_CHECK_TOOL(AR, ar, false)
3683b425557eSmrgtest -z "$AR" && AR=ar
3684b425557eSmrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
3685b425557eSmrg_LT_DECL([], [AR], [1], [The archiver])
3686b425557eSmrg_LT_DECL([], [AR_FLAGS], [1])
368734977a2fSmrg
3688b425557eSmrgAC_CHECK_TOOL(STRIP, strip, :)
3689b425557eSmrgtest -z "$STRIP" && STRIP=:
3690b425557eSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
369134977a2fSmrg
3692b425557eSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
3693b425557eSmrgtest -z "$RANLIB" && RANLIB=:
3694b425557eSmrg_LT_DECL([], [RANLIB], [1],
3695b425557eSmrg    [Commands used to install an old-style archive])
369634977a2fSmrg
3697b425557eSmrg# Determine commands to create old-style static archives.
3698b425557eSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
3699b425557eSmrgold_postinstall_cmds='chmod 644 $oldlib'
3700b425557eSmrgold_postuninstall_cmds=
370134977a2fSmrg
3702b425557eSmrgif test -n "$RANLIB"; then
3703b425557eSmrg  case $host_os in
3704b425557eSmrg  openbsd*)
3705b425557eSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
3706b425557eSmrg    ;;
3707b425557eSmrg  *)
3708b425557eSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
3709b425557eSmrg    ;;
3710b425557eSmrg  esac
3711b425557eSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
3712b425557eSmrgfi
371334977a2fSmrg
3714b425557eSmrgcase $host_os in
3715b425557eSmrg  darwin*)
3716b425557eSmrg    lock_old_archive_extraction=yes ;;
3717b425557eSmrg  *)
3718b425557eSmrg    lock_old_archive_extraction=no ;;
3719b425557eSmrgesac
3720b425557eSmrg_LT_DECL([], [old_postinstall_cmds], [2])
3721b425557eSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
3722b425557eSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
3723b425557eSmrg    [Commands used to build an old-style archive])
3724b425557eSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
3725b425557eSmrg    [Whether to use a lock for old archive extraction])
3726b425557eSmrg])# _LT_CMD_OLD_ARCHIVE
3727ee3138f1Smrg
3728ee3138f1Smrg
3729b425557eSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
3730b425557eSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
3731b425557eSmrg# ----------------------------------------------------------------
3732b425557eSmrg# Check whether the given compiler option works
3733b425557eSmrgAC_DEFUN([_LT_COMPILER_OPTION],
3734b425557eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3735b425557eSmrgm4_require([_LT_DECL_SED])dnl
3736b425557eSmrgAC_CACHE_CHECK([$1], [$2],
3737b425557eSmrg  [$2=no
3738b425557eSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
3739b425557eSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3740b425557eSmrg   lt_compiler_flag="$3"
3741b425557eSmrg   # Insert the option either (1) after the last *FLAGS variable, or
3742b425557eSmrg   # (2) before a word containing "conftest.", or (3) at the end.
3743b425557eSmrg   # Note that $ac_compile itself does not contain backslashes and begins
3744b425557eSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
3745b425557eSmrg   # The option is referenced via a variable to avoid confusing sed.
3746b425557eSmrg   lt_compile=`echo "$ac_compile" | $SED \
3747b425557eSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3748b425557eSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3749b425557eSmrg   -e 's:$: $lt_compiler_flag:'`
3750b425557eSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3751b425557eSmrg   (eval "$lt_compile" 2>conftest.err)
3752b425557eSmrg   ac_status=$?
3753b425557eSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
3754b425557eSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3755b425557eSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
3756b425557eSmrg     # The compiler can only warn and ignore the option if not recognized
3757b425557eSmrg     # So say no if there are warnings other than the usual output.
3758b425557eSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
3759b425557eSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
3760b425557eSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
3761b425557eSmrg       $2=yes
3762b425557eSmrg     fi
3763b425557eSmrg   fi
3764b425557eSmrg   $RM conftest*
3765b425557eSmrg])
3766ee3138f1Smrg
3767b425557eSmrgif test x"[$]$2" = xyes; then
3768b425557eSmrg    m4_if([$5], , :, [$5])
3769b425557eSmrgelse
3770b425557eSmrg    m4_if([$6], , :, [$6])
3771b425557eSmrgfi
3772b425557eSmrg])# _LT_COMPILER_OPTION
3773ee3138f1Smrg
3774b425557eSmrg# Old name:
3775b425557eSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
3776b425557eSmrgdnl aclocal-1.4 backwards compatibility:
3777b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
3778ee3138f1Smrg
3779ee3138f1Smrg
3780b425557eSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
3781b425557eSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
3782b425557eSmrg# ----------------------------------------------------
3783b425557eSmrg# Check whether the given linker option works
3784b425557eSmrgAC_DEFUN([_LT_LINKER_OPTION],
3785b425557eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3786b425557eSmrgm4_require([_LT_DECL_SED])dnl
3787b425557eSmrgAC_CACHE_CHECK([$1], [$2],
3788b425557eSmrg  [$2=no
3789b425557eSmrg   save_LDFLAGS="$LDFLAGS"
3790b425557eSmrg   LDFLAGS="$LDFLAGS $3"
3791b425557eSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
3792b425557eSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
3793b425557eSmrg     # The linker can only warn and ignore the option if not recognized
3794b425557eSmrg     # So say no if there are warnings
3795b425557eSmrg     if test -s conftest.err; then
3796b425557eSmrg       # Append any errors to the config.log.
3797b425557eSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
3798b425557eSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
3799b425557eSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
3800b425557eSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
3801b425557eSmrg         $2=yes
3802b425557eSmrg       fi
3803b425557eSmrg     else
3804b425557eSmrg       $2=yes
3805b425557eSmrg     fi
3806b425557eSmrg   fi
3807b425557eSmrg   $RM -r conftest*
3808b425557eSmrg   LDFLAGS="$save_LDFLAGS"
3809b425557eSmrg])
3810ee3138f1Smrg
3811b425557eSmrgif test x"[$]$2" = xyes; then
3812b425557eSmrg    m4_if([$4], , :, [$4])
3813b425557eSmrgelse
3814b425557eSmrg    m4_if([$5], , :, [$5])
3815b425557eSmrgfi
3816b425557eSmrg])# _LT_LINKER_OPTION
3817ee3138f1Smrg
3818b425557eSmrg# Old name:
3819b425557eSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
3820b425557eSmrgdnl aclocal-1.4 backwards compatibility:
3821b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
3822ee3138f1Smrg
3823ee3138f1Smrg
3824b425557eSmrg# LT_CMD_MAX_LEN
3825b425557eSmrg#---------------
3826b425557eSmrgAC_DEFUN([LT_CMD_MAX_LEN],
3827b425557eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3828b425557eSmrg# find the maximum length of command line arguments
3829b425557eSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
3830b425557eSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
3831b425557eSmrg  i=0
3832b425557eSmrg  teststring="ABCD"
3833ee3138f1Smrg
3834b425557eSmrg  case $build_os in
3835b425557eSmrg  msdosdjgpp*)
3836b425557eSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
3837b425557eSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
3838b425557eSmrg    # during glob expansion).  Even if it were fixed, the result of this
3839b425557eSmrg    # check would be larger than it should be.
3840b425557eSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
3841b425557eSmrg    ;;
3842ee3138f1Smrg
3843b425557eSmrg  gnu*)
3844b425557eSmrg    # Under GNU Hurd, this test is not required because there is
3845b425557eSmrg    # no limit to the length of command line arguments.
3846b425557eSmrg    # Libtool will interpret -1 as no limit whatsoever
3847b425557eSmrg    lt_cv_sys_max_cmd_len=-1;
384834977a2fSmrg    ;;
3849ee3138f1Smrg
3850b425557eSmrg  cygwin* | mingw* | cegcc*)
3851b425557eSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
3852b425557eSmrg    # about 5 minutes as the teststring grows exponentially.
3853b425557eSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
3854b425557eSmrg    # you end up with a "frozen" computer, even though with patience
3855b425557eSmrg    # the test eventually succeeds (with a max line length of 256k).
3856b425557eSmrg    # Instead, let's just punt: use the minimum linelength reported by
3857b425557eSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
3858b425557eSmrg    lt_cv_sys_max_cmd_len=8192;
3859b425557eSmrg    ;;
3860ee3138f1Smrg
3861b425557eSmrg  mint*)
3862b425557eSmrg    # On MiNT this can take a long time and run out of memory.
3863b425557eSmrg    lt_cv_sys_max_cmd_len=8192;
3864b425557eSmrg    ;;
386579a8a9c6Smrg
3866b425557eSmrg  amigaos*)
3867b425557eSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
3868b425557eSmrg    # So we just punt and use a minimum line length of 8192.
3869b425557eSmrg    lt_cv_sys_max_cmd_len=8192;
3870b425557eSmrg    ;;
3871ee3138f1Smrg
3872b425557eSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
3873b425557eSmrg    # This has been around since 386BSD, at least.  Likely further.
3874b425557eSmrg    if test -x /sbin/sysctl; then
3875b425557eSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
3876b425557eSmrg    elif test -x /usr/sbin/sysctl; then
3877b425557eSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
387834977a2fSmrg    else
3879b425557eSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
3880ee3138f1Smrg    fi
3881b425557eSmrg    # And add a safety zone
3882b425557eSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
3883b425557eSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
3884ee3138f1Smrg    ;;
3885ee3138f1Smrg
3886b425557eSmrg  interix*)
3887b425557eSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
3888b425557eSmrg    lt_cv_sys_max_cmd_len=196608
3889b425557eSmrg    ;;
3890b425557eSmrg
3891b425557eSmrg  osf*)
3892b425557eSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
3893b425557eSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
3894b425557eSmrg    # nice to cause kernel panics so lets avoid the loop below.
3895b425557eSmrg    # First set a reasonable default.
3896b425557eSmrg    lt_cv_sys_max_cmd_len=16384
3897b425557eSmrg    #
3898b425557eSmrg    if test -x /sbin/sysconfig; then
3899b425557eSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
3900b425557eSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
3901b425557eSmrg      esac
3902ee3138f1Smrg    fi
3903ee3138f1Smrg    ;;
3904b425557eSmrg  sco3.2v5*)
3905b425557eSmrg    lt_cv_sys_max_cmd_len=102400
390634977a2fSmrg    ;;
3907b425557eSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
3908b425557eSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
3909b425557eSmrg    if test -n "$kargmax"; then
3910b425557eSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
3911b425557eSmrg    else
3912b425557eSmrg      lt_cv_sys_max_cmd_len=32768
3913b425557eSmrg    fi
3914b425557eSmrg    ;;
3915b425557eSmrg  *)
3916b425557eSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
3917b425557eSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
3918b425557eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
3919b425557eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
3920b425557eSmrg    else
3921b425557eSmrg      # Make teststring a little bigger before we do anything with it.
3922b425557eSmrg      # a 1K string should be a reasonable start.
3923b425557eSmrg      for i in 1 2 3 4 5 6 7 8 ; do
3924b425557eSmrg        teststring=$teststring$teststring
3925b425557eSmrg      done
3926b425557eSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
3927b425557eSmrg      # If test is not a shell built-in, we'll probably end up computing a
3928b425557eSmrg      # maximum length that is only half of the actual maximum length, but
3929b425557eSmrg      # we can't tell.
3930b425557eSmrg      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
3931b425557eSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
3932b425557eSmrg	      test $i != 17 # 1/2 MB should be enough
3933b425557eSmrg      do
3934b425557eSmrg        i=`expr $i + 1`
3935b425557eSmrg        teststring=$teststring$teststring
3936b425557eSmrg      done
3937b425557eSmrg      # Only check the string length outside the loop.
3938b425557eSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
3939b425557eSmrg      teststring=
3940b425557eSmrg      # Add a significant safety factor because C++ compilers can tack on
3941b425557eSmrg      # massive amounts of additional arguments before passing them to the
3942b425557eSmrg      # linker.  It appears as though 1/2 is a usable value.
3943b425557eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
3944b425557eSmrg    fi
394534977a2fSmrg    ;;
3946ee3138f1Smrg  esac
3947b425557eSmrg])
3948b425557eSmrgif test -n $lt_cv_sys_max_cmd_len ; then
3949b425557eSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
3950b425557eSmrgelse
3951b425557eSmrg  AC_MSG_RESULT(none)
3952b425557eSmrgfi
3953b425557eSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
3954b425557eSmrg_LT_DECL([], [max_cmd_len], [0],
3955b425557eSmrg    [What is the maximum length of a command?])
3956b425557eSmrg])# LT_CMD_MAX_LEN
3957ee3138f1Smrg
3958b425557eSmrg# Old name:
3959b425557eSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
3960b425557eSmrgdnl aclocal-1.4 backwards compatibility:
3961b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
3962ee3138f1Smrg
3963ee3138f1Smrg
3964b425557eSmrg# _LT_HEADER_DLFCN
3965b425557eSmrg# ----------------
3966b425557eSmrgm4_defun([_LT_HEADER_DLFCN],
3967b425557eSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
3968b425557eSmrg])# _LT_HEADER_DLFCN
3969ee3138f1Smrg
3970ee3138f1Smrg
3971b425557eSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
3972b425557eSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
3973b425557eSmrg# ----------------------------------------------------------------
3974b425557eSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
3975b425557eSmrg[m4_require([_LT_HEADER_DLFCN])dnl
3976b425557eSmrgif test "$cross_compiling" = yes; then :
3977b425557eSmrg  [$4]
3978b425557eSmrgelse
3979b425557eSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
3980b425557eSmrg  lt_status=$lt_dlunknown
3981b425557eSmrg  cat > conftest.$ac_ext <<_LT_EOF
3982b425557eSmrg[#line $LINENO "configure"
3983b425557eSmrg#include "confdefs.h"
3984ee3138f1Smrg
3985b425557eSmrg#if HAVE_DLFCN_H
3986b425557eSmrg#include <dlfcn.h>
3987b425557eSmrg#endif
3988ee3138f1Smrg
3989b425557eSmrg#include <stdio.h>
399034977a2fSmrg
3991b425557eSmrg#ifdef RTLD_GLOBAL
3992b425557eSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
3993b425557eSmrg#else
3994b425557eSmrg#  ifdef DL_GLOBAL
3995b425557eSmrg#    define LT_DLGLOBAL		DL_GLOBAL
3996b425557eSmrg#  else
3997b425557eSmrg#    define LT_DLGLOBAL		0
3998b425557eSmrg#  endif
3999b425557eSmrg#endif
4000ee3138f1Smrg
4001b425557eSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
4002b425557eSmrg   find out it does not work in some platform. */
4003b425557eSmrg#ifndef LT_DLLAZY_OR_NOW
4004b425557eSmrg#  ifdef RTLD_LAZY
4005b425557eSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
4006b425557eSmrg#  else
4007b425557eSmrg#    ifdef DL_LAZY
4008b425557eSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
4009b425557eSmrg#    else
4010b425557eSmrg#      ifdef RTLD_NOW
4011b425557eSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
4012b425557eSmrg#      else
4013b425557eSmrg#        ifdef DL_NOW
4014b425557eSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
4015b425557eSmrg#        else
4016b425557eSmrg#          define LT_DLLAZY_OR_NOW	0
4017b425557eSmrg#        endif
4018b425557eSmrg#      endif
4019b425557eSmrg#    endif
4020b425557eSmrg#  endif
4021b425557eSmrg#endif
4022ee3138f1Smrg
4023b425557eSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
4024b425557eSmrg   correspondingly for the symbols needed.  */
4025b425557eSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
4026b425557eSmrgvoid fnord () __attribute__((visibility("default")));
4027b425557eSmrg#endif
4028ee3138f1Smrg
4029b425557eSmrgvoid fnord () { int i=42; }
4030b425557eSmrgint main ()
4031b425557eSmrg{
4032b425557eSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
4033b425557eSmrg  int status = $lt_dlunknown;
4034ee3138f1Smrg
4035b425557eSmrg  if (self)
4036b425557eSmrg    {
4037b425557eSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
403834977a2fSmrg      else
4039b425557eSmrg        {
4040b425557eSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
4041b425557eSmrg          else puts (dlerror ());
4042b425557eSmrg	}
4043b425557eSmrg      /* dlclose (self); */
4044b425557eSmrg    }
4045b425557eSmrg  else
4046b425557eSmrg    puts (dlerror ());
4047ee3138f1Smrg
4048b425557eSmrg  return status;
4049b425557eSmrg}]
4050b425557eSmrg_LT_EOF
4051b425557eSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
4052b425557eSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
4053b425557eSmrg    lt_status=$?
4054b425557eSmrg    case x$lt_status in
4055b425557eSmrg      x$lt_dlno_uscore) $1 ;;
4056b425557eSmrg      x$lt_dlneed_uscore) $2 ;;
4057b425557eSmrg      x$lt_dlunknown|x*) $3 ;;
4058b425557eSmrg    esac
4059b425557eSmrg  else :
4060b425557eSmrg    # compilation failed
4061b425557eSmrg    $3
4062b425557eSmrg  fi
4063b425557eSmrgfi
4064b425557eSmrgrm -fr conftest*
4065b425557eSmrg])# _LT_TRY_DLOPEN_SELF
4066ee3138f1Smrg
4067ee3138f1Smrg
4068b425557eSmrg# LT_SYS_DLOPEN_SELF
4069b425557eSmrg# ------------------
4070b425557eSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
4071b425557eSmrg[m4_require([_LT_HEADER_DLFCN])dnl
4072b425557eSmrgif test "x$enable_dlopen" != xyes; then
4073b425557eSmrg  enable_dlopen=unknown
4074b425557eSmrg  enable_dlopen_self=unknown
4075b425557eSmrg  enable_dlopen_self_static=unknown
4076b425557eSmrgelse
4077b425557eSmrg  lt_cv_dlopen=no
4078b425557eSmrg  lt_cv_dlopen_libs=
4079ee3138f1Smrg
4080b425557eSmrg  case $host_os in
4081b425557eSmrg  beos*)
4082b425557eSmrg    lt_cv_dlopen="load_add_on"
4083b425557eSmrg    lt_cv_dlopen_libs=
4084b425557eSmrg    lt_cv_dlopen_self=yes
4085b425557eSmrg    ;;
4086ee3138f1Smrg
4087b425557eSmrg  mingw* | pw32* | cegcc*)
4088b425557eSmrg    lt_cv_dlopen="LoadLibrary"
4089b425557eSmrg    lt_cv_dlopen_libs=
4090b425557eSmrg    ;;
4091ee3138f1Smrg
4092b425557eSmrg  cygwin*)
4093b425557eSmrg    lt_cv_dlopen="dlopen"
4094b425557eSmrg    lt_cv_dlopen_libs=
4095b425557eSmrg    ;;
4096ee3138f1Smrg
4097b425557eSmrg  darwin*)
4098b425557eSmrg  # if libdl is installed we need to link against it
4099b425557eSmrg    AC_CHECK_LIB([dl], [dlopen],
4100b425557eSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
4101b425557eSmrg    lt_cv_dlopen="dyld"
4102b425557eSmrg    lt_cv_dlopen_libs=
4103b425557eSmrg    lt_cv_dlopen_self=yes
4104b425557eSmrg    ])
4105b425557eSmrg    ;;
4106ee3138f1Smrg
4107b425557eSmrg  *)
4108b425557eSmrg    AC_CHECK_FUNC([shl_load],
4109b425557eSmrg	  [lt_cv_dlopen="shl_load"],
4110b425557eSmrg      [AC_CHECK_LIB([dld], [shl_load],
4111b425557eSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
4112b425557eSmrg	[AC_CHECK_FUNC([dlopen],
4113b425557eSmrg	      [lt_cv_dlopen="dlopen"],
4114b425557eSmrg	  [AC_CHECK_LIB([dl], [dlopen],
4115b425557eSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
4116b425557eSmrg	    [AC_CHECK_LIB([svld], [dlopen],
4117b425557eSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
4118b425557eSmrg	      [AC_CHECK_LIB([dld], [dld_link],
4119b425557eSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
4120b425557eSmrg	      ])
4121b425557eSmrg	    ])
4122b425557eSmrg	  ])
4123b425557eSmrg	])
4124b425557eSmrg      ])
4125b425557eSmrg    ;;
4126b425557eSmrg  esac
4127ee3138f1Smrg
4128b425557eSmrg  if test "x$lt_cv_dlopen" != xno; then
4129b425557eSmrg    enable_dlopen=yes
413034977a2fSmrg  else
4131b425557eSmrg    enable_dlopen=no
4132b425557eSmrg  fi
4133ee3138f1Smrg
4134b425557eSmrg  case $lt_cv_dlopen in
4135b425557eSmrg  dlopen)
4136b425557eSmrg    save_CPPFLAGS="$CPPFLAGS"
4137b425557eSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
4138ee3138f1Smrg
4139b425557eSmrg    save_LDFLAGS="$LDFLAGS"
4140b425557eSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
4141ee3138f1Smrg
4142b425557eSmrg    save_LIBS="$LIBS"
4143b425557eSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
414434977a2fSmrg
4145b425557eSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
4146b425557eSmrg	  lt_cv_dlopen_self, [dnl
4147b425557eSmrg	  _LT_TRY_DLOPEN_SELF(
4148b425557eSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
4149b425557eSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
4150b425557eSmrg    ])
4151ee3138f1Smrg
4152b425557eSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
4153b425557eSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
4154b425557eSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
4155b425557eSmrg	  lt_cv_dlopen_self_static, [dnl
4156b425557eSmrg	  _LT_TRY_DLOPEN_SELF(
4157b425557eSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
4158b425557eSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
4159b425557eSmrg      ])
4160b425557eSmrg    fi
4161ee3138f1Smrg
4162b425557eSmrg    CPPFLAGS="$save_CPPFLAGS"
4163b425557eSmrg    LDFLAGS="$save_LDFLAGS"
4164b425557eSmrg    LIBS="$save_LIBS"
4165b425557eSmrg    ;;
4166b425557eSmrg  esac
4167ee3138f1Smrg
4168b425557eSmrg  case $lt_cv_dlopen_self in
4169b425557eSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
4170b425557eSmrg  *) enable_dlopen_self=unknown ;;
4171b425557eSmrg  esac
4172ee3138f1Smrg
4173b425557eSmrg  case $lt_cv_dlopen_self_static in
4174b425557eSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
4175b425557eSmrg  *) enable_dlopen_self_static=unknown ;;
4176b425557eSmrg  esac
4177b425557eSmrgfi
4178b425557eSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
4179b425557eSmrg	 [Whether dlopen is supported])
4180b425557eSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
4181b425557eSmrg	 [Whether dlopen of programs is supported])
4182b425557eSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
4183b425557eSmrg	 [Whether dlopen of statically linked programs is supported])
4184b425557eSmrg])# LT_SYS_DLOPEN_SELF
4185ee3138f1Smrg
4186b425557eSmrg# Old name:
4187b425557eSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
4188b425557eSmrgdnl aclocal-1.4 backwards compatibility:
4189b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
4190ee3138f1Smrg
4191ee3138f1Smrg
4192b425557eSmrg# _LT_COMPILER_C_O([TAGNAME])
4193b425557eSmrg# ---------------------------
4194b425557eSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
4195b425557eSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
4196b425557eSmrgm4_defun([_LT_COMPILER_C_O],
4197b425557eSmrg[m4_require([_LT_DECL_SED])dnl
4198b425557eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4199b425557eSmrgm4_require([_LT_TAG_COMPILER])dnl
4200b425557eSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
4201b425557eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
4202b425557eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
4203b425557eSmrg   $RM -r conftest 2>/dev/null
4204b425557eSmrg   mkdir conftest
4205b425557eSmrg   cd conftest
4206b425557eSmrg   mkdir out
4207b425557eSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
4208ee3138f1Smrg
4209b425557eSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
4210b425557eSmrg   # Insert the option either (1) after the last *FLAGS variable, or
4211b425557eSmrg   # (2) before a word containing "conftest.", or (3) at the end.
4212b425557eSmrg   # Note that $ac_compile itself does not contain backslashes and begins
4213b425557eSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
4214b425557eSmrg   lt_compile=`echo "$ac_compile" | $SED \
4215b425557eSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
4216b425557eSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
4217b425557eSmrg   -e 's:$: $lt_compiler_flag:'`
4218b425557eSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
4219b425557eSmrg   (eval "$lt_compile" 2>out/conftest.err)
4220b425557eSmrg   ac_status=$?
4221b425557eSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
4222b425557eSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
4223b425557eSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
4224b425557eSmrg   then
4225b425557eSmrg     # The compiler can only warn and ignore the option if not recognized
4226b425557eSmrg     # So say no if there are warnings
4227b425557eSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
4228b425557eSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
4229b425557eSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
4230b425557eSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
4231b425557eSmrg     fi
4232b425557eSmrg   fi
4233b425557eSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
4234b425557eSmrg   $RM conftest*
4235b425557eSmrg   # SGI C++ compiler will create directory out/ii_files/ for
4236b425557eSmrg   # template instantiation
4237b425557eSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
4238b425557eSmrg   $RM out/* && rmdir out
4239b425557eSmrg   cd ..
4240b425557eSmrg   $RM -r conftest
4241b425557eSmrg   $RM conftest*
4242b425557eSmrg])
4243b425557eSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
4244b425557eSmrg	[Does compiler simultaneously support -c and -o options?])
4245b425557eSmrg])# _LT_COMPILER_C_O
4246ee3138f1Smrg
4247ee3138f1Smrg
4248b425557eSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
4249b425557eSmrg# ----------------------------------
4250b425557eSmrg# Check to see if we can do hard links to lock some files if needed
4251b425557eSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
4252b425557eSmrg[m4_require([_LT_ENABLE_LOCK])dnl
4253b425557eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4254b425557eSmrg_LT_COMPILER_C_O([$1])
4255ee3138f1Smrg
4256b425557eSmrghard_links="nottested"
4257b425557eSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
4258b425557eSmrg  # do not overwrite the value of need_locks provided by the user
4259b425557eSmrg  AC_MSG_CHECKING([if we can lock with hard links])
4260b425557eSmrg  hard_links=yes
4261b425557eSmrg  $RM conftest*
4262b425557eSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
4263b425557eSmrg  touch conftest.a
4264b425557eSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
4265b425557eSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
4266b425557eSmrg  AC_MSG_RESULT([$hard_links])
4267b425557eSmrg  if test "$hard_links" = no; then
4268b425557eSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
4269b425557eSmrg    need_locks=warn
4270b425557eSmrg  fi
4271b425557eSmrgelse
4272b425557eSmrg  need_locks=no
4273b425557eSmrgfi
4274b425557eSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
4275b425557eSmrg])# _LT_COMPILER_FILE_LOCKS
4276ee3138f1Smrg
4277ee3138f1Smrg
4278b425557eSmrg# _LT_CHECK_OBJDIR
4279b425557eSmrg# ----------------
4280b425557eSmrgm4_defun([_LT_CHECK_OBJDIR],
4281b425557eSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
4282b425557eSmrg[rm -f .libs 2>/dev/null
4283b425557eSmrgmkdir .libs 2>/dev/null
4284b425557eSmrgif test -d .libs; then
4285b425557eSmrg  lt_cv_objdir=.libs
4286b425557eSmrgelse
4287b425557eSmrg  # MS-DOS does not allow filenames that begin with a dot.
4288b425557eSmrg  lt_cv_objdir=_libs
4289b425557eSmrgfi
4290b425557eSmrgrmdir .libs 2>/dev/null])
4291b425557eSmrgobjdir=$lt_cv_objdir
4292b425557eSmrg_LT_DECL([], [objdir], [0],
4293b425557eSmrg         [The name of the directory that contains temporary libtool files])dnl
4294b425557eSmrgm4_pattern_allow([LT_OBJDIR])dnl
4295b425557eSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
4296b425557eSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
4297b425557eSmrg])# _LT_CHECK_OBJDIR
4298ee3138f1Smrg
4299ee3138f1Smrg
4300b425557eSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
4301b425557eSmrg# --------------------------------------
4302b425557eSmrg# Check hardcoding attributes.
4303b425557eSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
4304b425557eSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
4305b425557eSmrg_LT_TAGVAR(hardcode_action, $1)=
4306b425557eSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
4307b425557eSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
4308b425557eSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
430934977a2fSmrg
4310b425557eSmrg  # We can hardcode non-existent directories.
4311b425557eSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
4312b425557eSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
4313b425557eSmrg     # have to relink, otherwise we might link with an installed library
4314b425557eSmrg     # when we should be linking with a yet-to-be-installed one
4315b425557eSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
4316b425557eSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
4317b425557eSmrg    # Linking always hardcodes the temporary library directory.
4318b425557eSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
4319b425557eSmrg  else
4320b425557eSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
4321b425557eSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
4322b425557eSmrg  fi
4323b425557eSmrgelse
4324b425557eSmrg  # We cannot hardcode anything, or else we can only hardcode existing
4325b425557eSmrg  # directories.
4326b425557eSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
4327b425557eSmrgfi
4328b425557eSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
432934977a2fSmrg
4330b425557eSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
4331b425557eSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
4332b425557eSmrg  # Fast installation is not supported
4333b425557eSmrg  enable_fast_install=no
4334b425557eSmrgelif test "$shlibpath_overrides_runpath" = yes ||
4335b425557eSmrg     test "$enable_shared" = no; then
4336b425557eSmrg  # Fast installation is not necessary
4337b425557eSmrg  enable_fast_install=needless
4338b425557eSmrgfi
4339b425557eSmrg_LT_TAGDECL([], [hardcode_action], [0],
4340b425557eSmrg    [How to hardcode a shared library path into an executable])
4341b425557eSmrg])# _LT_LINKER_HARDCODE_LIBPATH
4342ee3138f1Smrg
4343ee3138f1Smrg
4344b425557eSmrg# _LT_CMD_STRIPLIB
4345b425557eSmrg# ----------------
4346b425557eSmrgm4_defun([_LT_CMD_STRIPLIB],
4347b425557eSmrg[m4_require([_LT_DECL_EGREP])
4348b425557eSmrgstriplib=
4349b425557eSmrgold_striplib=
4350b425557eSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
4351b425557eSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
4352b425557eSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
4353b425557eSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
4354b425557eSmrg  AC_MSG_RESULT([yes])
4355b425557eSmrgelse
4356b425557eSmrg# FIXME - insert some real tests, host_os isn't really good enough
4357b425557eSmrg  case $host_os in
4358b425557eSmrg  darwin*)
4359b425557eSmrg    if test -n "$STRIP" ; then
4360b425557eSmrg      striplib="$STRIP -x"
4361b425557eSmrg      old_striplib="$STRIP -S"
4362b425557eSmrg      AC_MSG_RESULT([yes])
4363b425557eSmrg    else
4364b425557eSmrg      AC_MSG_RESULT([no])
4365b425557eSmrg    fi
4366b425557eSmrg    ;;
4367b425557eSmrg  *)
4368b425557eSmrg    AC_MSG_RESULT([no])
4369b425557eSmrg    ;;
4370b425557eSmrg  esac
4371b425557eSmrgfi
4372b425557eSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
4373b425557eSmrg_LT_DECL([], [striplib], [1])
4374b425557eSmrg])# _LT_CMD_STRIPLIB
4375ee3138f1Smrg
4376ee3138f1Smrg
4377b425557eSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
4378b425557eSmrg# -----------------------------
4379b425557eSmrg# PORTME Fill in your ld.so characteristics
4380b425557eSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
4381b425557eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4382b425557eSmrgm4_require([_LT_DECL_EGREP])dnl
4383b425557eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4384b425557eSmrgm4_require([_LT_DECL_OBJDUMP])dnl
4385b425557eSmrgm4_require([_LT_DECL_SED])dnl
4386b425557eSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
4387b425557eSmrgAC_MSG_CHECKING([dynamic linker characteristics])
4388b425557eSmrgm4_if([$1],
4389b425557eSmrg	[], [
4390b425557eSmrgif test "$GCC" = yes; then
4391b425557eSmrg  case $host_os in
4392b425557eSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
4393b425557eSmrg    *) lt_awk_arg="/^libraries:/" ;;
4394b425557eSmrg  esac
4395b425557eSmrg  case $host_os in
4396b425557eSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
4397b425557eSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
4398b425557eSmrg  esac
4399b425557eSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
4400b425557eSmrg  case $lt_search_path_spec in
4401b425557eSmrg  *\;*)
4402b425557eSmrg    # if the path contains ";" then we assume it to be the separator
4403b425557eSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
4404b425557eSmrg    # assumed that no part of a normal pathname contains ";" but that should
4405b425557eSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
4406b425557eSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
4407b425557eSmrg    ;;
4408b425557eSmrg  *)
4409b425557eSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
4410b425557eSmrg    ;;
4411b425557eSmrg  esac
4412b425557eSmrg  # Ok, now we have the path, separated by spaces, we can step through it
4413b425557eSmrg  # and add multilib dir if necessary.
4414b425557eSmrg  lt_tmp_lt_search_path_spec=
4415b425557eSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
4416b425557eSmrg  for lt_sys_path in $lt_search_path_spec; do
4417b425557eSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
4418b425557eSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
4419b425557eSmrg    else
4420b425557eSmrg      test -d "$lt_sys_path" && \
4421b425557eSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
4422b425557eSmrg    fi
4423b425557eSmrg  done
4424b425557eSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
4425b425557eSmrgBEGIN {RS=" "; FS="/|\n";} {
4426b425557eSmrg  lt_foo="";
4427b425557eSmrg  lt_count=0;
4428b425557eSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
4429b425557eSmrg    if ($lt_i != "" && $lt_i != ".") {
4430b425557eSmrg      if ($lt_i == "..") {
4431b425557eSmrg        lt_count++;
4432b425557eSmrg      } else {
4433b425557eSmrg        if (lt_count == 0) {
4434b425557eSmrg          lt_foo="/" $lt_i lt_foo;
4435b425557eSmrg        } else {
4436b425557eSmrg          lt_count--;
4437b425557eSmrg        }
4438b425557eSmrg      }
4439b425557eSmrg    }
4440b425557eSmrg  }
4441b425557eSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
4442b425557eSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
4443b425557eSmrg}'`
4444b425557eSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
4445b425557eSmrg  # for these hosts.
4446b425557eSmrg  case $host_os in
4447b425557eSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
4448b425557eSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
4449b425557eSmrg  esac
4450b425557eSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
4451b425557eSmrgelse
4452b425557eSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
4453b425557eSmrgfi])
4454b425557eSmrglibrary_names_spec=
4455b425557eSmrglibname_spec='lib$name'
4456b425557eSmrgsoname_spec=
4457b425557eSmrgshrext_cmds=".so"
4458b425557eSmrgpostinstall_cmds=
4459b425557eSmrgpostuninstall_cmds=
4460b425557eSmrgfinish_cmds=
4461b425557eSmrgfinish_eval=
4462b425557eSmrgshlibpath_var=
4463b425557eSmrgshlibpath_overrides_runpath=unknown
4464b425557eSmrgversion_type=none
4465b425557eSmrgdynamic_linker="$host_os ld.so"
4466b425557eSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
4467b425557eSmrgneed_lib_prefix=unknown
4468b425557eSmrghardcode_into_libs=no
4469ee3138f1Smrg
4470b425557eSmrg# when you set need_version to no, make sure it does not cause -set_version
4471b425557eSmrg# flags to be left without arguments
4472b425557eSmrgneed_version=unknown
4473ee3138f1Smrg
4474b425557eSmrgcase $host_os in
4475b425557eSmrgaix3*)
4476b425557eSmrg  version_type=linux
4477b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
4478b425557eSmrg  shlibpath_var=LIBPATH
4479b425557eSmrg
4480b425557eSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
4481b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4482b425557eSmrg  ;;
4483b425557eSmrg
4484b425557eSmrgaix[[4-9]]*)
4485b425557eSmrg  version_type=linux
4486b425557eSmrg  need_lib_prefix=no
4487b425557eSmrg  need_version=no
4488b425557eSmrg  hardcode_into_libs=yes
4489b425557eSmrg  if test "$host_cpu" = ia64; then
4490b425557eSmrg    # AIX 5 supports IA64
4491b425557eSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
4492b425557eSmrg    shlibpath_var=LD_LIBRARY_PATH
4493b425557eSmrg  else
4494b425557eSmrg    # With GCC up to 2.95.x, collect2 would create an import file
4495b425557eSmrg    # for dependence libraries.  The import file would start with
4496b425557eSmrg    # the line `#! .'.  This would cause the generated library to
4497b425557eSmrg    # depend on `.', always an invalid library.  This was fixed in
4498b425557eSmrg    # development snapshots of GCC prior to 3.0.
4499b425557eSmrg    case $host_os in
4500b425557eSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
4501b425557eSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
4502b425557eSmrg	   echo ' yes '
4503b425557eSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
4504b425557eSmrg	:
450534977a2fSmrg      else
4506b425557eSmrg	can_build_shared=no
450734977a2fSmrg      fi
450834977a2fSmrg      ;;
4509b425557eSmrg    esac
4510b425557eSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
4511b425557eSmrg    # soname into executable. Probably we can add versioning support to
4512b425557eSmrg    # collect2, so additional links can be useful in future.
4513b425557eSmrg    if test "$aix_use_runtimelinking" = yes; then
4514b425557eSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
4515b425557eSmrg      # instead of lib<name>.a to let people know that these are not
4516b425557eSmrg      # typical AIX shared libraries.
4517b425557eSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4518b425557eSmrg    else
4519b425557eSmrg      # We preserve .a as extension for shared libraries through AIX4.2
4520b425557eSmrg      # and later when we are not doing run time linking.
4521b425557eSmrg      library_names_spec='${libname}${release}.a $libname.a'
4522b425557eSmrg      soname_spec='${libname}${release}${shared_ext}$major'
4523b425557eSmrg    fi
4524b425557eSmrg    shlibpath_var=LIBPATH
4525b425557eSmrg  fi
4526b425557eSmrg  ;;
4527b425557eSmrg
4528b425557eSmrgamigaos*)
4529b425557eSmrg  case $host_cpu in
4530b425557eSmrg  powerpc)
4531b425557eSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
4532b425557eSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
4533b425557eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4534b425557eSmrg    ;;
4535b425557eSmrg  m68k)
4536b425557eSmrg    library_names_spec='$libname.ixlibrary $libname.a'
4537b425557eSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
4538b425557eSmrg    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'
4539b425557eSmrg    ;;
4540b425557eSmrg  esac
4541b425557eSmrg  ;;
4542b425557eSmrg
4543b425557eSmrgbeos*)
4544b425557eSmrg  library_names_spec='${libname}${shared_ext}'
4545b425557eSmrg  dynamic_linker="$host_os ld.so"
4546b425557eSmrg  shlibpath_var=LIBRARY_PATH
4547b425557eSmrg  ;;
4548b425557eSmrg
4549b425557eSmrgbsdi[[45]]*)
4550b425557eSmrg  version_type=linux
4551b425557eSmrg  need_version=no
4552b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4553b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4554b425557eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
4555b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4556b425557eSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
4557b425557eSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
4558b425557eSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
4559b425557eSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
4560b425557eSmrg  # libtool to hard-code these into programs
4561b425557eSmrg  ;;
4562b425557eSmrg
4563b425557eSmrgcygwin* | mingw* | pw32* | cegcc*)
4564b425557eSmrg  version_type=windows
4565b425557eSmrg  shrext_cmds=".dll"
4566b425557eSmrg  need_version=no
4567b425557eSmrg  need_lib_prefix=no
4568b425557eSmrg
4569b425557eSmrg  case $GCC,$host_os in
4570b425557eSmrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
4571b425557eSmrg    library_names_spec='$libname.dll.a'
4572b425557eSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
4573b425557eSmrg    postinstall_cmds='base_file=`basename \${file}`~
4574b425557eSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
4575b425557eSmrg      dldir=$destdir/`dirname \$dlpath`~
4576b425557eSmrg      test -d \$dldir || mkdir -p \$dldir~
4577b425557eSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
4578b425557eSmrg      chmod a+x \$dldir/$dlname~
4579b425557eSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
4580b425557eSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
4581b425557eSmrg      fi'
4582b425557eSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
4583b425557eSmrg      dlpath=$dir/\$dldll~
4584b425557eSmrg       $RM \$dlpath'
4585b425557eSmrg    shlibpath_overrides_runpath=yes
4586b425557eSmrg
4587b425557eSmrg    case $host_os in
4588b425557eSmrg    cygwin*)
4589b425557eSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
4590b425557eSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4591b425557eSmrgm4_if([$1], [],[
4592b425557eSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
4593b425557eSmrg      ;;
4594b425557eSmrg    mingw* | cegcc*)
4595b425557eSmrg      # MinGW DLLs use traditional 'lib' prefix
4596b425557eSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4597b425557eSmrg      ;;
4598b425557eSmrg    pw32*)
4599b425557eSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
4600b425557eSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4601b425557eSmrg      ;;
4602b425557eSmrg    esac
4603b425557eSmrg    ;;
4604b425557eSmrg
4605b425557eSmrg  *)
4606b425557eSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
4607b425557eSmrg    ;;
4608b425557eSmrg  esac
4609b425557eSmrg  dynamic_linker='Win32 ld.exe'
4610b425557eSmrg  # FIXME: first we should search . and the directory the executable is in
4611b425557eSmrg  shlibpath_var=PATH
4612b425557eSmrg  ;;
4613b425557eSmrg
4614b425557eSmrgdarwin* | rhapsody*)
4615b425557eSmrg  dynamic_linker="$host_os dyld"
4616b425557eSmrg  version_type=darwin
4617b425557eSmrg  need_lib_prefix=no
4618b425557eSmrg  need_version=no
4619b425557eSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
4620b425557eSmrg  soname_spec='${libname}${release}${major}$shared_ext'
4621b425557eSmrg  shlibpath_overrides_runpath=yes
4622b425557eSmrg  shlibpath_var=DYLD_LIBRARY_PATH
4623b425557eSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
4624b425557eSmrgm4_if([$1], [],[
4625b425557eSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
4626b425557eSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
4627b425557eSmrg  ;;
4628b425557eSmrg
4629b425557eSmrgdgux*)
4630b425557eSmrg  version_type=linux
4631b425557eSmrg  need_lib_prefix=no
4632b425557eSmrg  need_version=no
4633b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
4634b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4635b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4636b425557eSmrg  ;;
4637b425557eSmrg
4638b425557eSmrgfreebsd1*)
4639b425557eSmrg  dynamic_linker=no
4640b425557eSmrg  ;;
4641b425557eSmrg
4642b425557eSmrgfreebsd* | dragonfly*)
4643b425557eSmrg  # DragonFly does not have aout.  When/if they implement a new
4644b425557eSmrg  # versioning mechanism, adjust this.
4645b425557eSmrg  if test -x /usr/bin/objformat; then
4646b425557eSmrg    objformat=`/usr/bin/objformat`
4647b425557eSmrg  else
4648b425557eSmrg    case $host_os in
4649b425557eSmrg    freebsd[[123]]*) objformat=aout ;;
4650b425557eSmrg    *) objformat=elf ;;
4651b425557eSmrg    esac
4652b425557eSmrg  fi
4653b425557eSmrg  version_type=freebsd-$objformat
4654b425557eSmrg  case $version_type in
4655b425557eSmrg    freebsd-elf*)
4656b425557eSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
4657b425557eSmrg      need_version=no
4658b425557eSmrg      need_lib_prefix=no
4659b425557eSmrg      ;;
4660b425557eSmrg    freebsd-*)
4661b425557eSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
4662b425557eSmrg      need_version=yes
4663b425557eSmrg      ;;
4664b425557eSmrg  esac
4665b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4666b425557eSmrg  case $host_os in
4667b425557eSmrg  freebsd2*)
4668b425557eSmrg    shlibpath_overrides_runpath=yes
4669b425557eSmrg    ;;
4670b425557eSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
4671b425557eSmrg    shlibpath_overrides_runpath=yes
4672b425557eSmrg    hardcode_into_libs=yes
4673b425557eSmrg    ;;
4674b425557eSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
4675b425557eSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
4676b425557eSmrg    shlibpath_overrides_runpath=no
4677b425557eSmrg    hardcode_into_libs=yes
4678b425557eSmrg    ;;
4679b425557eSmrg  *) # from 4.6 on, and DragonFly
4680b425557eSmrg    shlibpath_overrides_runpath=yes
4681b425557eSmrg    hardcode_into_libs=yes
4682b425557eSmrg    ;;
4683b425557eSmrg  esac
4684b425557eSmrg  ;;
4685b425557eSmrg
4686b425557eSmrggnu*)
4687b425557eSmrg  version_type=linux
4688b425557eSmrg  need_lib_prefix=no
4689b425557eSmrg  need_version=no
4690b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
4691b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4692b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4693b425557eSmrg  hardcode_into_libs=yes
4694b425557eSmrg  ;;
4695b425557eSmrg
4696b425557eSmrghaiku*)
4697b425557eSmrg  version_type=linux
4698b425557eSmrg  need_lib_prefix=no
4699b425557eSmrg  need_version=no
4700b425557eSmrg  dynamic_linker="$host_os runtime_loader"
4701b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
4702b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4703b425557eSmrg  shlibpath_var=LIBRARY_PATH
4704b425557eSmrg  shlibpath_overrides_runpath=yes
4705b425557eSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
4706b425557eSmrg  hardcode_into_libs=yes
4707b425557eSmrg  ;;
4708b425557eSmrg
4709b425557eSmrghpux9* | hpux10* | hpux11*)
4710b425557eSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
4711b425557eSmrg  # link against other versions.
4712b425557eSmrg  version_type=sunos
4713b425557eSmrg  need_lib_prefix=no
4714b425557eSmrg  need_version=no
4715b425557eSmrg  case $host_cpu in
4716b425557eSmrg  ia64*)
4717b425557eSmrg    shrext_cmds='.so'
4718b425557eSmrg    hardcode_into_libs=yes
4719b425557eSmrg    dynamic_linker="$host_os dld.so"
4720b425557eSmrg    shlibpath_var=LD_LIBRARY_PATH
4721b425557eSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
4722b425557eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4723b425557eSmrg    soname_spec='${libname}${release}${shared_ext}$major'
4724b425557eSmrg    if test "X$HPUX_IA64_MODE" = X32; then
4725b425557eSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
4726b425557eSmrg    else
4727b425557eSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
4728b425557eSmrg    fi
4729b425557eSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
4730b425557eSmrg    ;;
4731b425557eSmrg  hppa*64*)
4732b425557eSmrg    shrext_cmds='.sl'
4733b425557eSmrg    hardcode_into_libs=yes
4734b425557eSmrg    dynamic_linker="$host_os dld.sl"
4735b425557eSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
4736b425557eSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
4737b425557eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4738b425557eSmrg    soname_spec='${libname}${release}${shared_ext}$major'
4739b425557eSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
4740b425557eSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
4741b425557eSmrg    ;;
4742b425557eSmrg  *)
4743b425557eSmrg    shrext_cmds='.sl'
4744b425557eSmrg    dynamic_linker="$host_os dld.sl"
4745b425557eSmrg    shlibpath_var=SHLIB_PATH
4746b425557eSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
4747b425557eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4748b425557eSmrg    soname_spec='${libname}${release}${shared_ext}$major'
4749b425557eSmrg    ;;
4750b425557eSmrg  esac
4751b425557eSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
4752b425557eSmrg  postinstall_cmds='chmod 555 $lib'
4753b425557eSmrg  # or fails outright, so override atomically:
4754b425557eSmrg  install_override_mode=555
4755b425557eSmrg  ;;
4756b425557eSmrg
4757b425557eSmrginterix[[3-9]]*)
4758b425557eSmrg  version_type=linux
4759b425557eSmrg  need_lib_prefix=no
4760b425557eSmrg  need_version=no
4761b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
4762b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4763b425557eSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
4764b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4765b425557eSmrg  shlibpath_overrides_runpath=no
4766b425557eSmrg  hardcode_into_libs=yes
4767b425557eSmrg  ;;
4768b425557eSmrg
4769b425557eSmrgirix5* | irix6* | nonstopux*)
4770b425557eSmrg  case $host_os in
4771b425557eSmrg    nonstopux*) version_type=nonstopux ;;
4772b425557eSmrg    *)
4773b425557eSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
4774b425557eSmrg		version_type=linux
4775b425557eSmrg	else
4776b425557eSmrg		version_type=irix
4777b425557eSmrg	fi ;;
4778b425557eSmrg  esac
4779b425557eSmrg  need_lib_prefix=no
4780b425557eSmrg  need_version=no
4781b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4782b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
4783b425557eSmrg  case $host_os in
4784b425557eSmrg  irix5* | nonstopux*)
4785b425557eSmrg    libsuff= shlibsuff=
4786b425557eSmrg    ;;
4787b425557eSmrg  *)
4788b425557eSmrg    case $LD in # libtool.m4 will add one of these switches to LD
4789b425557eSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
4790b425557eSmrg      libsuff= shlibsuff= libmagic=32-bit;;
4791b425557eSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
4792b425557eSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
4793b425557eSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
4794b425557eSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
4795b425557eSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
4796b425557eSmrg    esac
4797b425557eSmrg    ;;
4798b425557eSmrg  esac
4799b425557eSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
4800b425557eSmrg  shlibpath_overrides_runpath=no
4801b425557eSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
4802b425557eSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
4803b425557eSmrg  hardcode_into_libs=yes
4804b425557eSmrg  ;;
4805b425557eSmrg
4806b425557eSmrg# No shared lib support for Linux oldld, aout, or coff.
4807b425557eSmrglinux*oldld* | linux*aout* | linux*coff*)
4808b425557eSmrg  dynamic_linker=no
4809b425557eSmrg  ;;
4810b425557eSmrg
4811b425557eSmrg# This must be Linux ELF.
4812b425557eSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
4813b425557eSmrg  version_type=linux
4814b425557eSmrg  need_lib_prefix=no
4815b425557eSmrg  need_version=no
4816b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4817b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4818b425557eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
4819b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4820b425557eSmrg  shlibpath_overrides_runpath=no
4821b425557eSmrg
4822b425557eSmrg  # Some binutils ld are patched to set DT_RUNPATH
4823b425557eSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
4824b425557eSmrg    [lt_cv_shlibpath_overrides_runpath=no
4825b425557eSmrg    save_LDFLAGS=$LDFLAGS
4826b425557eSmrg    save_libdir=$libdir
4827b425557eSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
4828b425557eSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
4829b425557eSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
4830b425557eSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
4831b425557eSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
4832b425557eSmrg    LDFLAGS=$save_LDFLAGS
4833b425557eSmrg    libdir=$save_libdir
4834b425557eSmrg    ])
4835b425557eSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
4836b425557eSmrg
4837b425557eSmrg  # This implies no fast_install, which is unacceptable.
4838b425557eSmrg  # Some rework will be needed to allow for fast_install
4839b425557eSmrg  # before this can be enabled.
4840b425557eSmrg  hardcode_into_libs=yes
4841b425557eSmrg
4842b425557eSmrg  # Append ld.so.conf contents to the search path
4843b425557eSmrg  if test -f /etc/ld.so.conf; then
4844b425557eSmrg    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' ' '`
4845b425557eSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
4846b425557eSmrg  fi
4847b425557eSmrg
4848b425557eSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
4849b425557eSmrg  # powerpc, because MkLinux only supported shared libraries with the
4850b425557eSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
4851b425557eSmrg  # most powerpc-linux boxes support dynamic linking these days and
4852b425557eSmrg  # people can always --disable-shared, the test was removed, and we
4853b425557eSmrg  # assume the GNU/Linux dynamic linker is in use.
4854b425557eSmrg  dynamic_linker='GNU/Linux ld.so'
4855b425557eSmrg  ;;
4856b425557eSmrg
4857b425557eSmrgnetbsd*)
4858b425557eSmrg  version_type=sunos
4859b425557eSmrg  need_lib_prefix=no
4860b425557eSmrg  need_version=no
4861b425557eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4862b425557eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
4863b425557eSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
4864b425557eSmrg    dynamic_linker='NetBSD (a.out) ld.so'
4865b425557eSmrg  else
4866b425557eSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
4867b425557eSmrg    soname_spec='${libname}${release}${shared_ext}$major'
4868b425557eSmrg    dynamic_linker='NetBSD ld.elf_so'
4869b425557eSmrg  fi
4870b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4871b425557eSmrg  shlibpath_overrides_runpath=yes
4872b425557eSmrg  hardcode_into_libs=yes
4873b425557eSmrg  ;;
4874b425557eSmrg
4875b425557eSmrgnewsos6)
4876b425557eSmrg  version_type=linux
4877b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4878b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4879b425557eSmrg  shlibpath_overrides_runpath=yes
4880b425557eSmrg  ;;
4881b425557eSmrg
4882b425557eSmrg*nto* | *qnx*)
4883b425557eSmrg  version_type=qnx
4884b425557eSmrg  need_lib_prefix=no
4885b425557eSmrg  need_version=no
4886b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4887b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4888b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4889b425557eSmrg  shlibpath_overrides_runpath=no
4890b425557eSmrg  hardcode_into_libs=yes
4891b425557eSmrg  dynamic_linker='ldqnx.so'
4892b425557eSmrg  ;;
4893b425557eSmrg
4894b425557eSmrgopenbsd*)
4895b425557eSmrg  version_type=sunos
4896b425557eSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
4897b425557eSmrg  need_lib_prefix=no
4898b425557eSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
4899b425557eSmrg  case $host_os in
4900b425557eSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
4901b425557eSmrg    *)				need_version=no  ;;
4902b425557eSmrg  esac
4903b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
4904b425557eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
4905b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4906b425557eSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4907b425557eSmrg    case $host_os in
4908b425557eSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
4909b425557eSmrg	shlibpath_overrides_runpath=no
4910b425557eSmrg	;;
4911b425557eSmrg      *)
4912b425557eSmrg	shlibpath_overrides_runpath=yes
4913b425557eSmrg	;;
4914b425557eSmrg      esac
4915b425557eSmrg  else
4916b425557eSmrg    shlibpath_overrides_runpath=yes
4917b425557eSmrg  fi
4918b425557eSmrg  ;;
4919b425557eSmrg
4920b425557eSmrgos2*)
4921b425557eSmrg  libname_spec='$name'
4922b425557eSmrg  shrext_cmds=".dll"
4923b425557eSmrg  need_lib_prefix=no
4924b425557eSmrg  library_names_spec='$libname${shared_ext} $libname.a'
4925b425557eSmrg  dynamic_linker='OS/2 ld.exe'
4926b425557eSmrg  shlibpath_var=LIBPATH
4927b425557eSmrg  ;;
4928b425557eSmrg
4929b425557eSmrgosf3* | osf4* | osf5*)
4930b425557eSmrg  version_type=osf
4931b425557eSmrg  need_lib_prefix=no
4932b425557eSmrg  need_version=no
4933b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4934b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4935b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4936b425557eSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
4937b425557eSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
4938b425557eSmrg  ;;
4939b425557eSmrg
4940b425557eSmrgrdos*)
4941b425557eSmrg  dynamic_linker=no
4942b425557eSmrg  ;;
4943b425557eSmrg
4944b425557eSmrgsolaris*)
4945b425557eSmrg  version_type=linux
4946b425557eSmrg  need_lib_prefix=no
4947b425557eSmrg  need_version=no
4948b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4949b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4950b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4951b425557eSmrg  shlibpath_overrides_runpath=yes
4952b425557eSmrg  hardcode_into_libs=yes
4953b425557eSmrg  # ldd complains unless libraries are executable
4954b425557eSmrg  postinstall_cmds='chmod +x $lib'
4955b425557eSmrg  ;;
4956b425557eSmrg
4957b425557eSmrgsunos4*)
4958b425557eSmrg  version_type=sunos
4959b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
4960b425557eSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
4961b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4962b425557eSmrg  shlibpath_overrides_runpath=yes
4963b425557eSmrg  if test "$with_gnu_ld" = yes; then
4964b425557eSmrg    need_lib_prefix=no
4965b425557eSmrg  fi
4966b425557eSmrg  need_version=yes
4967b425557eSmrg  ;;
4968b425557eSmrg
4969b425557eSmrgsysv4 | sysv4.3*)
4970b425557eSmrg  version_type=linux
4971b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4972b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
4973b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
4974b425557eSmrg  case $host_vendor in
4975b425557eSmrg    sni)
4976b425557eSmrg      shlibpath_overrides_runpath=no
4977b425557eSmrg      need_lib_prefix=no
4978b425557eSmrg      runpath_var=LD_RUN_PATH
4979b425557eSmrg      ;;
4980b425557eSmrg    siemens)
4981b425557eSmrg      need_lib_prefix=no
4982b425557eSmrg      ;;
4983b425557eSmrg    motorola)
4984b425557eSmrg      need_lib_prefix=no
4985b425557eSmrg      need_version=no
4986b425557eSmrg      shlibpath_overrides_runpath=no
4987b425557eSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
4988b425557eSmrg      ;;
4989b425557eSmrg  esac
4990b425557eSmrg  ;;
4991b425557eSmrg
4992b425557eSmrgsysv4*MP*)
4993b425557eSmrg  if test -d /usr/nec ;then
4994b425557eSmrg    version_type=linux
4995b425557eSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
4996b425557eSmrg    soname_spec='$libname${shared_ext}.$major'
4997b425557eSmrg    shlibpath_var=LD_LIBRARY_PATH
4998b425557eSmrg  fi
4999b425557eSmrg  ;;
5000b425557eSmrg
5001b425557eSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5002b425557eSmrg  version_type=freebsd-elf
5003b425557eSmrg  need_lib_prefix=no
5004b425557eSmrg  need_version=no
5005b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
5006b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
5007b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
5008b425557eSmrg  shlibpath_overrides_runpath=yes
5009b425557eSmrg  hardcode_into_libs=yes
5010b425557eSmrg  if test "$with_gnu_ld" = yes; then
5011b425557eSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
5012b425557eSmrg  else
5013b425557eSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
5014b425557eSmrg    case $host_os in
5015b425557eSmrg      sco3.2v5*)
5016b425557eSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
5017b425557eSmrg	;;
5018b425557eSmrg    esac
5019b425557eSmrg  fi
5020b425557eSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
5021b425557eSmrg  ;;
5022b425557eSmrg
5023b425557eSmrgtpf*)
5024b425557eSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
5025b425557eSmrg  version_type=linux
5026b425557eSmrg  need_lib_prefix=no
5027b425557eSmrg  need_version=no
5028b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5029b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
5030b425557eSmrg  shlibpath_overrides_runpath=no
5031b425557eSmrg  hardcode_into_libs=yes
5032b425557eSmrg  ;;
5033b425557eSmrg
5034b425557eSmrguts4*)
5035b425557eSmrg  version_type=linux
5036b425557eSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5037b425557eSmrg  soname_spec='${libname}${release}${shared_ext}$major'
5038b425557eSmrg  shlibpath_var=LD_LIBRARY_PATH
5039b425557eSmrg  ;;
5040b425557eSmrg
5041b425557eSmrg*)
5042b425557eSmrg  dynamic_linker=no
5043b425557eSmrg  ;;
5044b425557eSmrgesac
5045b425557eSmrgAC_MSG_RESULT([$dynamic_linker])
5046b425557eSmrgtest "$dynamic_linker" = no && can_build_shared=no
5047b425557eSmrg
5048b425557eSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
5049b425557eSmrgif test "$GCC" = yes; then
5050b425557eSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
5051b425557eSmrgfi
5052b425557eSmrg
5053b425557eSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
5054b425557eSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
5055b425557eSmrgfi
5056b425557eSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
5057b425557eSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
5058b425557eSmrgfi
5059b425557eSmrg
5060b425557eSmrg_LT_DECL([], [variables_saved_for_relink], [1],
5061b425557eSmrg    [Variables whose values should be saved in libtool wrapper scripts and
5062b425557eSmrg    restored at link time])
5063b425557eSmrg_LT_DECL([], [need_lib_prefix], [0],
5064b425557eSmrg    [Do we need the "lib" prefix for modules?])
5065b425557eSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
5066b425557eSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
5067b425557eSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
5068b425557eSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
5069b425557eSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
5070b425557eSmrg    [Is shlibpath searched before the hard-coded library search path?])
5071b425557eSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
5072b425557eSmrg_LT_DECL([], [library_names_spec], [1],
5073b425557eSmrg    [[List of archive names.  First name is the real one, the rest are links.
5074b425557eSmrg    The last name is the one that the linker finds with -lNAME]])
5075b425557eSmrg_LT_DECL([], [soname_spec], [1],
5076b425557eSmrg    [[The coded name of the library, if different from the real name]])
5077b425557eSmrg_LT_DECL([], [install_override_mode], [1],
5078b425557eSmrg    [Permission mode override for installation of shared libraries])
5079b425557eSmrg_LT_DECL([], [postinstall_cmds], [2],
5080b425557eSmrg    [Command to use after installation of a shared archive])
5081b425557eSmrg_LT_DECL([], [postuninstall_cmds], [2],
5082b425557eSmrg    [Command to use after uninstallation of a shared archive])
5083b425557eSmrg_LT_DECL([], [finish_cmds], [2],
5084b425557eSmrg    [Commands used to finish a libtool library installation in a directory])
5085b425557eSmrg_LT_DECL([], [finish_eval], [1],
5086b425557eSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
5087b425557eSmrg    not shown]])
5088b425557eSmrg_LT_DECL([], [hardcode_into_libs], [0],
5089b425557eSmrg    [Whether we should hardcode library paths into libraries])
5090b425557eSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
5091b425557eSmrg    [Compile-time system search path for libraries])
5092b425557eSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
5093b425557eSmrg    [Run-time system search path for libraries])
5094b425557eSmrg])# _LT_SYS_DYNAMIC_LINKER
5095b425557eSmrg
5096b425557eSmrg
5097b425557eSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
5098b425557eSmrg# --------------------------
5099b425557eSmrg# find a file program which can recognize shared library
5100b425557eSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
5101b425557eSmrg[m4_require([_LT_DECL_EGREP])dnl
5102b425557eSmrgAC_MSG_CHECKING([for $1])
5103b425557eSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
5104b425557eSmrg[case $MAGIC_CMD in
5105b425557eSmrg[[\\/*] |  ?:[\\/]*])
5106b425557eSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
5107b425557eSmrg  ;;
5108b425557eSmrg*)
5109b425557eSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
5110b425557eSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5111b425557eSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
5112b425557eSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
5113b425557eSmrgdnl not every word.  This closes a longstanding sh security hole.
5114b425557eSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
5115b425557eSmrg  for ac_dir in $ac_dummy; do
5116b425557eSmrg    IFS="$lt_save_ifs"
5117b425557eSmrg    test -z "$ac_dir" && ac_dir=.
5118b425557eSmrg    if test -f $ac_dir/$1; then
5119b425557eSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
5120b425557eSmrg      if test -n "$file_magic_test_file"; then
5121b425557eSmrg	case $deplibs_check_method in
5122b425557eSmrg	"file_magic "*)
5123b425557eSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
5124b425557eSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5125b425557eSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
5126b425557eSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
5127b425557eSmrg	    :
5128b425557eSmrg	  else
5129b425557eSmrg	    cat <<_LT_EOF 1>&2
5130b425557eSmrg
5131b425557eSmrg*** Warning: the command libtool uses to detect shared libraries,
5132b425557eSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
5133b425557eSmrg*** The result is that libtool may fail to recognize shared libraries
5134b425557eSmrg*** as such.  This will affect the creation of libtool libraries that
5135b425557eSmrg*** depend on shared libraries, but programs linked with such libtool
5136b425557eSmrg*** libraries will work regardless of this problem.  Nevertheless, you
5137b425557eSmrg*** may want to report the problem to your system manager and/or to
5138b425557eSmrg*** bug-libtool@gnu.org
5139b425557eSmrg
5140b425557eSmrg_LT_EOF
5141b425557eSmrg	  fi ;;
5142b425557eSmrg	esac
5143b425557eSmrg      fi
5144b425557eSmrg      break
5145b425557eSmrg    fi
5146b425557eSmrg  done
5147b425557eSmrg  IFS="$lt_save_ifs"
5148b425557eSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
5149b425557eSmrg  ;;
5150b425557eSmrgesac])
5151b425557eSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5152b425557eSmrgif test -n "$MAGIC_CMD"; then
5153b425557eSmrg  AC_MSG_RESULT($MAGIC_CMD)
5154b425557eSmrgelse
5155b425557eSmrg  AC_MSG_RESULT(no)
5156b425557eSmrgfi
5157b425557eSmrg_LT_DECL([], [MAGIC_CMD], [0],
5158b425557eSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
5159b425557eSmrg])# _LT_PATH_TOOL_PREFIX
5160b425557eSmrg
5161b425557eSmrg# Old name:
5162b425557eSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
5163b425557eSmrgdnl aclocal-1.4 backwards compatibility:
5164b425557eSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
5165b425557eSmrg
5166b425557eSmrg
5167b425557eSmrg# _LT_PATH_MAGIC
5168b425557eSmrg# --------------
5169b425557eSmrg# find a file program which can recognize a shared library
5170b425557eSmrgm4_defun([_LT_PATH_MAGIC],
5171b425557eSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
5172b425557eSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
5173b425557eSmrg  if test -n "$ac_tool_prefix"; then
5174b425557eSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
5175b425557eSmrg  else
5176b425557eSmrg    MAGIC_CMD=:
5177b425557eSmrg  fi
5178b425557eSmrgfi
5179b425557eSmrg])# _LT_PATH_MAGIC
5180b425557eSmrg
5181b425557eSmrg
5182b425557eSmrg# LT_PATH_LD
5183b425557eSmrg# ----------
5184b425557eSmrg# find the pathname to the GNU or non-GNU linker
5185b425557eSmrgAC_DEFUN([LT_PATH_LD],
5186b425557eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
5187b425557eSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
5188b425557eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
5189b425557eSmrgm4_require([_LT_DECL_SED])dnl
5190b425557eSmrgm4_require([_LT_DECL_EGREP])dnl
5191b425557eSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
5192b425557eSmrg
5193b425557eSmrgAC_ARG_WITH([gnu-ld],
5194b425557eSmrg    [AS_HELP_STRING([--with-gnu-ld],
5195b425557eSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
5196b425557eSmrg    [test "$withval" = no || with_gnu_ld=yes],
5197b425557eSmrg    [with_gnu_ld=no])dnl
5198b425557eSmrg
5199b425557eSmrgac_prog=ld
5200b425557eSmrgif test "$GCC" = yes; then
5201b425557eSmrg  # Check if gcc -print-prog-name=ld gives a path.
5202b425557eSmrg  AC_MSG_CHECKING([for ld used by $CC])
5203b425557eSmrg  case $host in
5204b425557eSmrg  *-*-mingw*)
5205b425557eSmrg    # gcc leaves a trailing carriage return which upsets mingw
5206b425557eSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5207b425557eSmrg  *)
5208b425557eSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5209b425557eSmrg  esac
5210b425557eSmrg  case $ac_prog in
5211b425557eSmrg    # Accept absolute paths.
5212b425557eSmrg    [[\\/]]* | ?:[[\\/]]*)
5213b425557eSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
5214b425557eSmrg      # Canonicalize the pathname of ld
5215b425557eSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
5216b425557eSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
5217b425557eSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
5218b425557eSmrg      done
5219b425557eSmrg      test -z "$LD" && LD="$ac_prog"
5220b425557eSmrg      ;;
5221b425557eSmrg  "")
5222b425557eSmrg    # If it fails, then pretend we aren't using GCC.
5223b425557eSmrg    ac_prog=ld
5224b425557eSmrg    ;;
5225b425557eSmrg  *)
5226b425557eSmrg    # If it is relative, then search for the first ld in PATH.
5227b425557eSmrg    with_gnu_ld=unknown
5228b425557eSmrg    ;;
5229b425557eSmrg  esac
5230b425557eSmrgelif test "$with_gnu_ld" = yes; then
5231b425557eSmrg  AC_MSG_CHECKING([for GNU ld])
5232b425557eSmrgelse
5233b425557eSmrg  AC_MSG_CHECKING([for non-GNU ld])
5234b425557eSmrgfi
5235b425557eSmrgAC_CACHE_VAL(lt_cv_path_LD,
5236b425557eSmrg[if test -z "$LD"; then
5237b425557eSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5238b425557eSmrg  for ac_dir in $PATH; do
5239b425557eSmrg    IFS="$lt_save_ifs"
5240b425557eSmrg    test -z "$ac_dir" && ac_dir=.
5241b425557eSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5242b425557eSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
5243b425557eSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
5244b425557eSmrg      # but apparently some variants of GNU ld only accept -v.
5245b425557eSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
5246b425557eSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
5247b425557eSmrg      *GNU* | *'with BFD'*)
5248b425557eSmrg	test "$with_gnu_ld" != no && break
5249b425557eSmrg	;;
5250b425557eSmrg      *)
5251b425557eSmrg	test "$with_gnu_ld" != yes && break
5252b425557eSmrg	;;
5253b425557eSmrg      esac
5254b425557eSmrg    fi
5255b425557eSmrg  done
5256b425557eSmrg  IFS="$lt_save_ifs"
5257b425557eSmrgelse
5258b425557eSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
5259b425557eSmrgfi])
5260b425557eSmrgLD="$lt_cv_path_LD"
5261b425557eSmrgif test -n "$LD"; then
5262b425557eSmrg  AC_MSG_RESULT($LD)
5263b425557eSmrgelse
5264b425557eSmrg  AC_MSG_RESULT(no)
5265b425557eSmrgfi
5266b425557eSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5267b425557eSmrg_LT_PATH_LD_GNU
5268b425557eSmrgAC_SUBST([LD])
5269b425557eSmrg
5270b425557eSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
5271b425557eSmrg])# LT_PATH_LD
5272b425557eSmrg
5273b425557eSmrg# Old names:
5274b425557eSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
5275b425557eSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
5276b425557eSmrgdnl aclocal-1.4 backwards compatibility:
5277b425557eSmrgdnl AC_DEFUN([AM_PROG_LD], [])
5278b425557eSmrgdnl AC_DEFUN([AC_PROG_LD], [])
5279b425557eSmrg
5280b425557eSmrg
5281b425557eSmrg# _LT_PATH_LD_GNU
5282b425557eSmrg#- --------------
5283b425557eSmrgm4_defun([_LT_PATH_LD_GNU],
5284b425557eSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
5285b425557eSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
5286b425557eSmrgcase `$LD -v 2>&1 </dev/null` in
5287b425557eSmrg*GNU* | *'with BFD'*)
5288b425557eSmrg  lt_cv_prog_gnu_ld=yes
5289b425557eSmrg  ;;
5290b425557eSmrg*)
5291b425557eSmrg  lt_cv_prog_gnu_ld=no
5292b425557eSmrg  ;;
5293b425557eSmrgesac])
5294b425557eSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
5295b425557eSmrg])# _LT_PATH_LD_GNU
5296b425557eSmrg
5297b425557eSmrg
5298b425557eSmrg# _LT_CMD_RELOAD
5299b425557eSmrg# --------------
5300b425557eSmrg# find reload flag for linker
5301b425557eSmrg#   -- PORTME Some linkers may need a different reload flag.
5302b425557eSmrgm4_defun([_LT_CMD_RELOAD],
5303b425557eSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
5304b425557eSmrg  lt_cv_ld_reload_flag,
5305b425557eSmrg  [lt_cv_ld_reload_flag='-r'])
5306b425557eSmrgreload_flag=$lt_cv_ld_reload_flag
5307b425557eSmrgcase $reload_flag in
5308b425557eSmrg"" | " "*) ;;
5309b425557eSmrg*) reload_flag=" $reload_flag" ;;
5310b425557eSmrgesac
5311b425557eSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
5312b425557eSmrgcase $host_os in
5313b425557eSmrg  darwin*)
5314b425557eSmrg    if test "$GCC" = yes; then
5315b425557eSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
5316b425557eSmrg    else
5317b425557eSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
5318b425557eSmrg    fi
5319b425557eSmrg    ;;
5320b425557eSmrgesac
5321b425557eSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
5322b425557eSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
5323b425557eSmrg])# _LT_CMD_RELOAD
5324b425557eSmrg
5325b425557eSmrg
5326b425557eSmrg# _LT_CHECK_MAGIC_METHOD
5327b425557eSmrg# ----------------------
5328b425557eSmrg# how to check for library dependencies
5329b425557eSmrg#  -- PORTME fill in with the dynamic library characteristics
5330b425557eSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
5331b425557eSmrg[m4_require([_LT_DECL_EGREP])
5332b425557eSmrgm4_require([_LT_DECL_OBJDUMP])
5333b425557eSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
5334b425557eSmrglt_cv_deplibs_check_method,
5335b425557eSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
5336b425557eSmrglt_cv_file_magic_test_file=
5337b425557eSmrglt_cv_deplibs_check_method='unknown'
5338b425557eSmrg# Need to set the preceding variable on all platforms that support
5339b425557eSmrg# interlibrary dependencies.
5340b425557eSmrg# 'none' -- dependencies not supported.
5341b425557eSmrg# `unknown' -- same as none, but documents that we really don't know.
5342b425557eSmrg# 'pass_all' -- all dependencies passed with no checks.
5343b425557eSmrg# 'test_compile' -- check by making test program.
5344b425557eSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
5345b425557eSmrg# which responds to the $file_magic_cmd with a given extended regex.
5346b425557eSmrg# If you have `file' or equivalent on your system and you're not sure
5347b425557eSmrg# whether `pass_all' will *always* work, you probably want this one.
5348b425557eSmrg
5349b425557eSmrgcase $host_os in
5350b425557eSmrgaix[[4-9]]*)
5351b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5352b425557eSmrg  ;;
5353b425557eSmrg
5354b425557eSmrgbeos*)
5355b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5356b425557eSmrg  ;;
5357b425557eSmrg
5358b425557eSmrgbsdi[[45]]*)
5359b425557eSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
5360b425557eSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
5361b425557eSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
5362b425557eSmrg  ;;
5363b425557eSmrg
5364b425557eSmrgcygwin*)
5365b425557eSmrg  # func_win32_libid is a shell function defined in ltmain.sh
5366b425557eSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5367b425557eSmrg  lt_cv_file_magic_cmd='func_win32_libid'
5368b425557eSmrg  ;;
5369b425557eSmrg
5370b425557eSmrgmingw* | pw32*)
5371b425557eSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
5372b425557eSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
5373b425557eSmrg  # unless we find 'file', for example because we are cross-compiling.
5374b425557eSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
5375b425557eSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
5376b425557eSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5377b425557eSmrg    lt_cv_file_magic_cmd='func_win32_libid'
5378b425557eSmrg  else
5379b425557eSmrg    # Keep this pattern in sync with the one in func_win32_libid.
5380b425557eSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
5381b425557eSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
5382b425557eSmrg  fi
5383b425557eSmrg  ;;
5384b425557eSmrg
5385b425557eSmrgcegcc*)
5386b425557eSmrg  # use the weaker test based on 'objdump'. See mingw*.
5387b425557eSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5388b425557eSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
5389b425557eSmrg  ;;
5390b425557eSmrg
5391b425557eSmrgdarwin* | rhapsody*)
5392b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5393b425557eSmrg  ;;
5394b425557eSmrg
5395b425557eSmrgfreebsd* | dragonfly*)
5396b425557eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5397b425557eSmrg    case $host_cpu in
5398b425557eSmrg    i*86 )
5399b425557eSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
5400b425557eSmrg      # Let's accept both of them until this is cleared up.
5401b425557eSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
5402b425557eSmrg      lt_cv_file_magic_cmd=/usr/bin/file
5403b425557eSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5404b425557eSmrg      ;;
5405b425557eSmrg    esac
5406b425557eSmrg  else
5407b425557eSmrg    lt_cv_deplibs_check_method=pass_all
5408b425557eSmrg  fi
5409b425557eSmrg  ;;
5410b425557eSmrg
5411b425557eSmrggnu*)
5412b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5413b425557eSmrg  ;;
5414b425557eSmrg
5415b425557eSmrghaiku*)
5416b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5417b425557eSmrg  ;;
5418b425557eSmrg
5419b425557eSmrghpux10.20* | hpux11*)
5420b425557eSmrg  lt_cv_file_magic_cmd=/usr/bin/file
5421b425557eSmrg  case $host_cpu in
5422b425557eSmrg  ia64*)
5423b425557eSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
5424b425557eSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5425b425557eSmrg    ;;
5426b425557eSmrg  hppa*64*)
5427b425557eSmrg    [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]']
5428b425557eSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5429b425557eSmrg    ;;
5430b425557eSmrg  *)
5431b425557eSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
5432b425557eSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
5433b425557eSmrg    ;;
5434b425557eSmrg  esac
5435b425557eSmrg  ;;
5436b425557eSmrg
5437b425557eSmrginterix[[3-9]]*)
5438b425557eSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5439b425557eSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
5440b425557eSmrg  ;;
5441b425557eSmrg
5442b425557eSmrgirix5* | irix6* | nonstopux*)
5443b425557eSmrg  case $LD in
5444b425557eSmrg  *-32|*"-32 ") libmagic=32-bit;;
5445b425557eSmrg  *-n32|*"-n32 ") libmagic=N32;;
5446b425557eSmrg  *-64|*"-64 ") libmagic=64-bit;;
5447b425557eSmrg  *) libmagic=never-match;;
5448b425557eSmrg  esac
5449b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5450b425557eSmrg  ;;
5451b425557eSmrg
5452b425557eSmrg# This must be Linux ELF.
5453b425557eSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
5454b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5455b425557eSmrg  ;;
5456b425557eSmrg
5457b425557eSmrgnetbsd*)
5458b425557eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5459b425557eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
5460b425557eSmrg  else
5461b425557eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
5462b425557eSmrg  fi
5463b425557eSmrg  ;;
5464b425557eSmrg
5465b425557eSmrgnewos6*)
5466b425557eSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
5467b425557eSmrg  lt_cv_file_magic_cmd=/usr/bin/file
5468b425557eSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
5469b425557eSmrg  ;;
5470ee3138f1Smrg
5471b425557eSmrg*nto* | *qnx*)
5472b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5473b425557eSmrg  ;;
5474ee3138f1Smrg
5475b425557eSmrgopenbsd*)
5476b425557eSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5477b425557eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
5478b425557eSmrg  else
5479b425557eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
5480b425557eSmrg  fi
5481b425557eSmrg  ;;
5482ee3138f1Smrg
5483b425557eSmrgosf3* | osf4* | osf5*)
5484b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5485b425557eSmrg  ;;
5486ee3138f1Smrg
5487b425557eSmrgrdos*)
5488b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5489b425557eSmrg  ;;
5490ee3138f1Smrg
5491b425557eSmrgsolaris*)
5492b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5493b425557eSmrg  ;;
5494ee3138f1Smrg
5495b425557eSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5496b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5497b425557eSmrg  ;;
5498ee3138f1Smrg
5499b425557eSmrgsysv4 | sysv4.3*)
5500b425557eSmrg  case $host_vendor in
5501b425557eSmrg  motorola)
5502b425557eSmrg    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]]'
5503b425557eSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5504b425557eSmrg    ;;
5505b425557eSmrg  ncr)
5506b425557eSmrg    lt_cv_deplibs_check_method=pass_all
5507b425557eSmrg    ;;
5508b425557eSmrg  sequent)
5509b425557eSmrg    lt_cv_file_magic_cmd='/bin/file'
5510b425557eSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
5511b425557eSmrg    ;;
5512b425557eSmrg  sni)
5513b425557eSmrg    lt_cv_file_magic_cmd='/bin/file'
5514b425557eSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
5515b425557eSmrg    lt_cv_file_magic_test_file=/lib/libc.so
5516b425557eSmrg    ;;
5517b425557eSmrg  siemens)
5518b425557eSmrg    lt_cv_deplibs_check_method=pass_all
5519b425557eSmrg    ;;
5520b425557eSmrg  pc)
5521b425557eSmrg    lt_cv_deplibs_check_method=pass_all
5522b425557eSmrg    ;;
5523b425557eSmrg  esac
5524b425557eSmrg  ;;
5525ee3138f1Smrg
5526b425557eSmrgtpf*)
5527b425557eSmrg  lt_cv_deplibs_check_method=pass_all
5528b425557eSmrg  ;;
5529b425557eSmrgesac
5530b425557eSmrg])
5531b425557eSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
5532b425557eSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
5533b425557eSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
5534ee3138f1Smrg
5535b425557eSmrg_LT_DECL([], [deplibs_check_method], [1],
5536b425557eSmrg    [Method to check whether dependent libraries are shared objects])
5537b425557eSmrg_LT_DECL([], [file_magic_cmd], [1],
5538b425557eSmrg    [Command to use when deplibs_check_method == "file_magic"])
5539b425557eSmrg])# _LT_CHECK_MAGIC_METHOD
5540ee3138f1Smrg
5541ee3138f1Smrg
5542b425557eSmrg# LT_PATH_NM
5543b425557eSmrg# ----------
5544b425557eSmrg# find the pathname to a BSD- or MS-compatible name lister
5545b425557eSmrgAC_DEFUN([LT_PATH_NM],
5546b425557eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
5547b425557eSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
5548b425557eSmrg[if test -n "$NM"; then
5549b425557eSmrg  # Let the user override the test.
5550b425557eSmrg  lt_cv_path_NM="$NM"
5551b425557eSmrgelse
5552b425557eSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
5553b425557eSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
5554b425557eSmrg    lt_nm_to_check="$lt_nm_to_check nm"
5555b425557eSmrg  fi
5556b425557eSmrg  for lt_tmp_nm in $lt_nm_to_check; do
5557b425557eSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5558b425557eSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
5559b425557eSmrg      IFS="$lt_save_ifs"
5560b425557eSmrg      test -z "$ac_dir" && ac_dir=.
5561b425557eSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
5562b425557eSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
5563b425557eSmrg	# Check to see if the nm accepts a BSD-compat flag.
5564b425557eSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
5565b425557eSmrg	#   nm: unknown option "B" ignored
5566b425557eSmrg	# Tru64's nm complains that /dev/null is an invalid object file
5567b425557eSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
5568b425557eSmrg	*/dev/null* | *'Invalid file or object type'*)
5569b425557eSmrg	  lt_cv_path_NM="$tmp_nm -B"
5570b425557eSmrg	  break
5571b425557eSmrg	  ;;
5572b425557eSmrg	*)
5573b425557eSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
5574b425557eSmrg	  */dev/null*)
5575b425557eSmrg	    lt_cv_path_NM="$tmp_nm -p"
5576b425557eSmrg	    break
5577b425557eSmrg	    ;;
5578b425557eSmrg	  *)
5579b425557eSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
5580b425557eSmrg	    continue # so that we can try to find one that supports BSD flags
5581b425557eSmrg	    ;;
5582b425557eSmrg	  esac
5583b425557eSmrg	  ;;
5584b425557eSmrg	esac
558534977a2fSmrg      fi
5586b425557eSmrg    done
5587b425557eSmrg    IFS="$lt_save_ifs"
5588b425557eSmrg  done
5589b425557eSmrg  : ${lt_cv_path_NM=no}
5590b425557eSmrgfi])
5591b425557eSmrgif test "$lt_cv_path_NM" != "no"; then
5592b425557eSmrg  NM="$lt_cv_path_NM"
5593b425557eSmrgelse
5594b425557eSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
5595b425557eSmrg  if test -n "$DUMPBIN"; then :
5596b425557eSmrg    # Let the user override the test.
5597b425557eSmrg  else
5598b425557eSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
5599b425557eSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
5600b425557eSmrg    *COFF*)
5601b425557eSmrg      DUMPBIN="$DUMPBIN -symbols"
560234977a2fSmrg      ;;
560334977a2fSmrg    *)
5604b425557eSmrg      DUMPBIN=:
560534977a2fSmrg      ;;
560634977a2fSmrg    esac
560734977a2fSmrg  fi
5608b425557eSmrg  AC_SUBST([DUMPBIN])
5609b425557eSmrg  if test "$DUMPBIN" != ":"; then
5610b425557eSmrg    NM="$DUMPBIN"
5611b425557eSmrg  fi
5612b425557eSmrgfi
5613b425557eSmrgtest -z "$NM" && NM=nm
5614b425557eSmrgAC_SUBST([NM])
5615b425557eSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
5616ee3138f1Smrg
5617b425557eSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
5618b425557eSmrg  [lt_cv_nm_interface="BSD nm"
5619b425557eSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
5620b425557eSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
5621b425557eSmrg  (eval "$ac_compile" 2>conftest.err)
5622b425557eSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
5623b425557eSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
5624b425557eSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
5625b425557eSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
5626b425557eSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
5627b425557eSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
5628b425557eSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
5629b425557eSmrg    lt_cv_nm_interface="MS dumpbin"
5630b425557eSmrg  fi
5631b425557eSmrg  rm -f conftest*])
5632b425557eSmrg])# LT_PATH_NM
5633ee3138f1Smrg
5634b425557eSmrg# Old names:
5635b425557eSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
5636b425557eSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
5637b425557eSmrgdnl aclocal-1.4 backwards compatibility:
5638b425557eSmrgdnl AC_DEFUN([AM_PROG_NM], [])
5639b425557eSmrgdnl AC_DEFUN([AC_PROG_NM], [])
5640ee3138f1Smrg
5641ee3138f1Smrg
5642b425557eSmrg# LT_LIB_M
5643b425557eSmrg# --------
5644b425557eSmrg# check for math library
5645b425557eSmrgAC_DEFUN([LT_LIB_M],
5646b425557eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5647b425557eSmrgLIBM=
5648b425557eSmrgcase $host in
5649b425557eSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
5650b425557eSmrg  # These system don't have libm, or don't need it
5651b425557eSmrg  ;;
5652b425557eSmrg*-ncr-sysv4.3*)
5653b425557eSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
5654b425557eSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
5655b425557eSmrg  ;;
5656b425557eSmrg*)
5657b425557eSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
565834977a2fSmrg  ;;
565934977a2fSmrgesac
5660b425557eSmrgAC_SUBST([LIBM])
5661b425557eSmrg])# LT_LIB_M
5662ee3138f1Smrg
5663b425557eSmrg# Old name:
5664b425557eSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
5665b425557eSmrgdnl aclocal-1.4 backwards compatibility:
5666b425557eSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
566734977a2fSmrg
566834977a2fSmrg
5669b425557eSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
5670b425557eSmrg# -------------------------------
5671b425557eSmrgm4_defun([_LT_COMPILER_NO_RTTI],
5672b425557eSmrg[m4_require([_LT_TAG_COMPILER])dnl
567334977a2fSmrg
5674b425557eSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5675ee3138f1Smrg
5676b425557eSmrgif test "$GCC" = yes; then
5677b425557eSmrg  case $cc_basename in
5678b425557eSmrg  nvcc*)
5679b425557eSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
5680b425557eSmrg  *)
5681b425557eSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
568234977a2fSmrg  esac
5683ee3138f1Smrg
5684b425557eSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
5685b425557eSmrg    lt_cv_prog_compiler_rtti_exceptions,
5686b425557eSmrg    [-fno-rtti -fno-exceptions], [],
5687b425557eSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
568834977a2fSmrgfi
5689b425557eSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
5690b425557eSmrg	[Compiler flag to turn off builtin functions])
5691b425557eSmrg])# _LT_COMPILER_NO_RTTI
5692ee3138f1Smrg
5693ee3138f1Smrg
5694b425557eSmrg# _LT_CMD_GLOBAL_SYMBOLS
5695b425557eSmrg# ----------------------
5696b425557eSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
5697b425557eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5698b425557eSmrgAC_REQUIRE([AC_PROG_CC])dnl
5699b425557eSmrgAC_REQUIRE([AC_PROG_AWK])dnl
5700b425557eSmrgAC_REQUIRE([LT_PATH_NM])dnl
5701b425557eSmrgAC_REQUIRE([LT_PATH_LD])dnl
5702b425557eSmrgm4_require([_LT_DECL_SED])dnl
5703b425557eSmrgm4_require([_LT_DECL_EGREP])dnl
5704b425557eSmrgm4_require([_LT_TAG_COMPILER])dnl
5705ee3138f1Smrg
5706b425557eSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
5707b425557eSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
5708b425557eSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
5709b425557eSmrg[
5710b425557eSmrg# These are sane defaults that work on at least a few old systems.
5711b425557eSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
5712ee3138f1Smrg
5713b425557eSmrg# Character class describing NM global symbol codes.
5714b425557eSmrgsymcode='[[BCDEGRST]]'
5715ee3138f1Smrg
5716b425557eSmrg# Regexp to match symbols that can be accessed directly from C.
5717b425557eSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
571834977a2fSmrg
5719b425557eSmrg# Define system-specific variables.
5720b425557eSmrgcase $host_os in
5721b425557eSmrgaix*)
5722b425557eSmrg  symcode='[[BCDT]]'
5723b425557eSmrg  ;;
5724b425557eSmrgcygwin* | mingw* | pw32* | cegcc*)
5725b425557eSmrg  symcode='[[ABCDGISTW]]'
5726b425557eSmrg  ;;
5727b425557eSmrghpux*)
5728b425557eSmrg  if test "$host_cpu" = ia64; then
5729b425557eSmrg    symcode='[[ABCDEGRST]]'
5730b425557eSmrg  fi
5731b425557eSmrg  ;;
5732b425557eSmrgirix* | nonstopux*)
5733b425557eSmrg  symcode='[[BCDEGRST]]'
5734b425557eSmrg  ;;
5735b425557eSmrgosf*)
5736b425557eSmrg  symcode='[[BCDEGQRST]]'
5737b425557eSmrg  ;;
5738b425557eSmrgsolaris*)
5739b425557eSmrg  symcode='[[BDRT]]'
5740b425557eSmrg  ;;
5741b425557eSmrgsco3.2v5*)
5742b425557eSmrg  symcode='[[DT]]'
5743b425557eSmrg  ;;
5744b425557eSmrgsysv4.2uw2*)
5745b425557eSmrg  symcode='[[DT]]'
5746b425557eSmrg  ;;
5747b425557eSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
5748b425557eSmrg  symcode='[[ABDT]]'
5749b425557eSmrg  ;;
5750b425557eSmrgsysv4)
5751b425557eSmrg  symcode='[[DFNSTU]]'
5752b425557eSmrg  ;;
5753b425557eSmrgesac
5754ee3138f1Smrg
5755b425557eSmrg# If we're using GNU nm, then use its standard symbol codes.
5756b425557eSmrgcase `$NM -V 2>&1` in
5757b425557eSmrg*GNU* | *'with BFD'*)
5758b425557eSmrg  symcode='[[ABCDGIRSTW]]' ;;
5759b425557eSmrgesac
5760ee3138f1Smrg
5761b425557eSmrg# Transform an extracted symbol line into a proper C declaration.
5762b425557eSmrg# Some systems (esp. on ia64) link data and code symbols differently,
5763b425557eSmrg# so use this general approach.
5764b425557eSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
576534977a2fSmrg
5766b425557eSmrg# Transform an extracted symbol line into symbol name and symbol address
5767b425557eSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
5768b425557eSmrglt_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'"
576934977a2fSmrg
5770b425557eSmrg# Handle CRLF in mingw tool chain
5771b425557eSmrgopt_cr=
5772b425557eSmrgcase $build_os in
5773b425557eSmrgmingw*)
5774b425557eSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
5775b425557eSmrg  ;;
5776b425557eSmrgesac
577734977a2fSmrg
5778b425557eSmrg# Try without a prefix underscore, then with it.
5779b425557eSmrgfor ac_symprfx in "" "_"; do
578034977a2fSmrg
5781b425557eSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
5782b425557eSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
578334977a2fSmrg
5784b425557eSmrg  # Write the raw and C identifiers.
5785b425557eSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
5786b425557eSmrg    # Fake it for dumpbin and say T for any non-static function
5787b425557eSmrg    # and D for any global variable.
5788b425557eSmrg    # Also find C++ and __fastcall symbols from MSVC++,
5789b425557eSmrg    # which start with @ or ?.
5790b425557eSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
5791b425557eSmrg"     {last_section=section; section=\$ 3};"\
5792b425557eSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
5793b425557eSmrg"     \$ 0!~/External *\|/{next};"\
5794b425557eSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
5795b425557eSmrg"     {if(hide[section]) next};"\
5796b425557eSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
5797b425557eSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
5798b425557eSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
5799b425557eSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
5800b425557eSmrg"     ' prfx=^$ac_symprfx]"
580134977a2fSmrg  else
5802b425557eSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
580334977a2fSmrg  fi
5804ee3138f1Smrg
5805b425557eSmrg  # Check to see that the pipe works correctly.
5806b425557eSmrg  pipe_works=no
5807ee3138f1Smrg
5808b425557eSmrg  rm -f conftest*
5809b425557eSmrg  cat > conftest.$ac_ext <<_LT_EOF
5810b425557eSmrg#ifdef __cplusplus
5811b425557eSmrgextern "C" {
5812b425557eSmrg#endif
5813b425557eSmrgchar nm_test_var;
5814b425557eSmrgvoid nm_test_func(void);
5815b425557eSmrgvoid nm_test_func(void){}
5816b425557eSmrg#ifdef __cplusplus
5817b425557eSmrg}
5818b425557eSmrg#endif
5819b425557eSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
5820b425557eSmrg_LT_EOF
5821ee3138f1Smrg
5822b425557eSmrg  if AC_TRY_EVAL(ac_compile); then
5823b425557eSmrg    # Now try to grab the symbols.
5824b425557eSmrg    nlist=conftest.nm
5825b425557eSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
5826b425557eSmrg      # Try sorting and uniquifying the output.
5827b425557eSmrg      if sort "$nlist" | uniq > "$nlist"T; then
5828b425557eSmrg	mv -f "$nlist"T "$nlist"
5829b425557eSmrg      else
5830b425557eSmrg	rm -f "$nlist"T
5831b425557eSmrg      fi
5832ee3138f1Smrg
5833b425557eSmrg      # Make sure that we snagged all the symbols we need.
5834b425557eSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
5835b425557eSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
5836b425557eSmrg	  cat <<_LT_EOF > conftest.$ac_ext
5837b425557eSmrg#ifdef __cplusplus
5838b425557eSmrgextern "C" {
5839b425557eSmrg#endif
5840ee3138f1Smrg
5841b425557eSmrg_LT_EOF
5842b425557eSmrg	  # Now generate the symbol file.
5843b425557eSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
5844ee3138f1Smrg
5845b425557eSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
5846b425557eSmrg
5847b425557eSmrg/* The mapping between symbol names and symbols.  */
5848b425557eSmrgconst struct {
5849b425557eSmrg  const char *name;
5850b425557eSmrg  void       *address;
5851b425557eSmrg}
5852b425557eSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
5853b425557eSmrg{
5854b425557eSmrg  { "@PROGRAM@", (void *) 0 },
5855b425557eSmrg_LT_EOF
5856b425557eSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
5857b425557eSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
5858b425557eSmrg  {0, (void *) 0}
5859b425557eSmrg};
5860b425557eSmrg
5861b425557eSmrg/* This works around a problem in FreeBSD linker */
5862b425557eSmrg#ifdef FREEBSD_WORKAROUND
5863b425557eSmrgstatic const void *lt_preloaded_setup() {
5864b425557eSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
5865b425557eSmrg}
5866b425557eSmrg#endif
5867ee3138f1Smrg
5868b425557eSmrg#ifdef __cplusplus
5869b425557eSmrg}
5870b425557eSmrg#endif
5871b425557eSmrg_LT_EOF
5872b425557eSmrg	  # Now try linking the two files.
5873b425557eSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
5874b425557eSmrg	  lt_save_LIBS="$LIBS"
5875b425557eSmrg	  lt_save_CFLAGS="$CFLAGS"
5876b425557eSmrg	  LIBS="conftstm.$ac_objext"
5877b425557eSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
5878b425557eSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
5879b425557eSmrg	    pipe_works=yes
5880b425557eSmrg	  fi
5881b425557eSmrg	  LIBS="$lt_save_LIBS"
5882b425557eSmrg	  CFLAGS="$lt_save_CFLAGS"
5883b425557eSmrg	else
5884b425557eSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
5885b425557eSmrg	fi
588634977a2fSmrg      else
5887b425557eSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
588834977a2fSmrg      fi
588934977a2fSmrg    else
5890b425557eSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
589134977a2fSmrg    fi
5892b425557eSmrg  else
5893b425557eSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
5894b425557eSmrg    cat conftest.$ac_ext >&5
5895b425557eSmrg  fi
5896b425557eSmrg  rm -rf conftest* conftst*
5897ee3138f1Smrg
5898b425557eSmrg  # Do not use the global_symbol_pipe unless it works.
5899b425557eSmrg  if test "$pipe_works" = yes; then
5900b425557eSmrg    break
5901b425557eSmrg  else
5902b425557eSmrg    lt_cv_sys_global_symbol_pipe=
5903b425557eSmrg  fi
5904b425557eSmrgdone
5905b425557eSmrg])
5906b425557eSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
5907b425557eSmrg  lt_cv_sys_global_symbol_to_cdecl=
5908b425557eSmrgfi
5909b425557eSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5910b425557eSmrg  AC_MSG_RESULT(failed)
5911b425557eSmrgelse
5912b425557eSmrg  AC_MSG_RESULT(ok)
5913b425557eSmrgfi
5914ee3138f1Smrg
5915b425557eSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
5916b425557eSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
5917b425557eSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
5918b425557eSmrg    [Transform the output of nm in a proper C declaration])
5919b425557eSmrg_LT_DECL([global_symbol_to_c_name_address],
5920b425557eSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
5921b425557eSmrg    [Transform the output of nm in a C name address pair])
5922b425557eSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
5923b425557eSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
5924b425557eSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
5925b425557eSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
5926ee3138f1Smrg
592734977a2fSmrg
5928b425557eSmrg# _LT_COMPILER_PIC([TAGNAME])
5929b425557eSmrg# ---------------------------
5930b425557eSmrgm4_defun([_LT_COMPILER_PIC],
5931b425557eSmrg[m4_require([_LT_TAG_COMPILER])dnl
5932b425557eSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
5933b425557eSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5934b425557eSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
593534977a2fSmrg
5936b425557eSmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
5937b425557eSmrgm4_if([$1], [CXX], [
5938b425557eSmrg  # C++ specific cases for pic, static, wl, etc.
5939b425557eSmrg  if test "$GXX" = yes; then
5940b425557eSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5941b425557eSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5942ee3138f1Smrg
5943b425557eSmrg    case $host_os in
5944b425557eSmrg    aix*)
5945b425557eSmrg      # All AIX code is PIC.
5946b425557eSmrg      if test "$host_cpu" = ia64; then
5947b425557eSmrg	# AIX 5 now supports IA64 processor
5948b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5949b425557eSmrg      fi
5950b425557eSmrg      ;;
595134977a2fSmrg
5952b425557eSmrg    amigaos*)
5953b425557eSmrg      case $host_cpu in
5954b425557eSmrg      powerpc)
5955b425557eSmrg            # see comment about AmigaOS4 .so support
5956b425557eSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
595734977a2fSmrg        ;;
5958b425557eSmrg      m68k)
5959b425557eSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
5960b425557eSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
5961b425557eSmrg            # like `-m68040'.
5962b425557eSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5963b425557eSmrg        ;;
5964b425557eSmrg      esac
5965b425557eSmrg      ;;
5966ee3138f1Smrg
5967b425557eSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5968b425557eSmrg      # PIC is the default for these OSes.
5969b425557eSmrg      ;;
5970b425557eSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
5971b425557eSmrg      # This hack is so that the source file can tell whether it is being
5972b425557eSmrg      # built for inclusion in a dll (and should export symbols for example).
5973b425557eSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5974b425557eSmrg      # (--disable-auto-import) libraries
5975b425557eSmrg      m4_if([$1], [GCJ], [],
5976b425557eSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5977b425557eSmrg      ;;
5978b425557eSmrg    darwin* | rhapsody*)
5979b425557eSmrg      # PIC is the default on this platform
5980b425557eSmrg      # Common symbols not allowed in MH_DYLIB files
5981b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5982b425557eSmrg      ;;
5983b425557eSmrg    *djgpp*)
5984b425557eSmrg      # DJGPP does not support shared libraries at all
5985b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5986b425557eSmrg      ;;
5987b425557eSmrg    haiku*)
5988b425557eSmrg      # PIC is the default for Haiku.
5989b425557eSmrg      # The "-static" flag exists, but is broken.
5990b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5991b425557eSmrg      ;;
5992b425557eSmrg    interix[[3-9]]*)
5993b425557eSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5994b425557eSmrg      # Instead, we relocate shared libraries at runtime.
5995b425557eSmrg      ;;
5996b425557eSmrg    sysv4*MP*)
5997b425557eSmrg      if test -d /usr/nec; then
5998b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5999b425557eSmrg      fi
6000b425557eSmrg      ;;
6001b425557eSmrg    hpux*)
6002b425557eSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
6003b425557eSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
6004b425557eSmrg      # sets the default TLS model and affects inlining.
6005b425557eSmrg      case $host_cpu in
6006b425557eSmrg      hppa*64*)
6007b425557eSmrg	;;
6008b425557eSmrg      *)
6009b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6010b425557eSmrg	;;
6011b425557eSmrg      esac
6012b425557eSmrg      ;;
6013b425557eSmrg    *qnx* | *nto*)
6014b425557eSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
6015b425557eSmrg      # it will coredump.
6016b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
6017b425557eSmrg      ;;
6018b425557eSmrg    *)
6019b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6020b425557eSmrg      ;;
6021b425557eSmrg    esac
6022b425557eSmrg  else
6023b425557eSmrg    case $host_os in
6024b425557eSmrg      aix[[4-9]]*)
6025b425557eSmrg	# All AIX code is PIC.
6026b425557eSmrg	if test "$host_cpu" = ia64; then
6027b425557eSmrg	  # AIX 5 now supports IA64 processor
6028b425557eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
602934977a2fSmrg	else
6030b425557eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
603134977a2fSmrg	fi
603234977a2fSmrg	;;
603334977a2fSmrg      chorus*)
6034b425557eSmrg	case $cc_basename in
6035b425557eSmrg	cxch68*)
6036b425557eSmrg	  # Green Hills C++ Compiler
6037b425557eSmrg	  # _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"
603834977a2fSmrg	  ;;
6039b425557eSmrg	esac
604034977a2fSmrg	;;
604134977a2fSmrg      dgux*)
6042b425557eSmrg	case $cc_basename in
6043b425557eSmrg	  ec++*)
6044b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
604534977a2fSmrg	    ;;
6046b425557eSmrg	  ghcx*)
604734977a2fSmrg	    # Green Hills C++ Compiler
6048b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
604934977a2fSmrg	    ;;
6050b425557eSmrg	  *)
605134977a2fSmrg	    ;;
6052b425557eSmrg	esac
6053b425557eSmrg	;;
605434977a2fSmrg      freebsd* | dragonfly*)
6055b425557eSmrg	# FreeBSD uses GNU C++
6056b425557eSmrg	;;
6057b425557eSmrg      hpux9* | hpux10* | hpux11*)
6058b425557eSmrg	case $cc_basename in
6059b425557eSmrg	  CC*)
6060b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6061b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6062b425557eSmrg	    if test "$host_cpu" != ia64; then
6063b425557eSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6064b425557eSmrg	    fi
606534977a2fSmrg	    ;;
6066b425557eSmrg	  aCC*)
6067b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6068b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
606934977a2fSmrg	    case $host_cpu in
6070b425557eSmrg	    hppa*64*|ia64*)
6071b425557eSmrg	      # +Z the default
6072b425557eSmrg	      ;;
6073b425557eSmrg	    *)
6074b425557eSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6075b425557eSmrg	      ;;
607634977a2fSmrg	    esac
607734977a2fSmrg	    ;;
6078b425557eSmrg	  *)
6079b425557eSmrg	    ;;
6080b425557eSmrg	esac
6081b425557eSmrg	;;
6082b425557eSmrg      interix*)
6083b425557eSmrg	# This is c89, which is MS Visual C++ (no shared libs)
6084b425557eSmrg	# Anyone wants to do a port?
6085b425557eSmrg	;;
6086b425557eSmrg      irix5* | irix6* | nonstopux*)
6087b425557eSmrg	case $cc_basename in
6088b425557eSmrg	  CC*)
6089b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6090b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6091b425557eSmrg	    # CC pic flag -KPIC is the default.
609234977a2fSmrg	    ;;
6093b425557eSmrg	  *)
6094b425557eSmrg	    ;;
6095b425557eSmrg	esac
609634977a2fSmrg	;;
6097b425557eSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
6098b425557eSmrg	case $cc_basename in
6099b425557eSmrg	  KCC*)
6100b425557eSmrg	    # KAI C++ Compiler
6101b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6102b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
610334977a2fSmrg	    ;;
6104b425557eSmrg	  ecpc* )
6105b425557eSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
6106b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6107b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6108b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
610934977a2fSmrg	    ;;
6110b425557eSmrg	  icpc* )
6111b425557eSmrg	    # Intel C++, used to be incompatible with GCC.
6112b425557eSmrg	    # ICC 10 doesn't accept -KPIC any more.
6113b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6114b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6115b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
611634977a2fSmrg	    ;;
6117b425557eSmrg	  pgCC* | pgcpp*)
6118b425557eSmrg	    # Portland Group C++ compiler
6119b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6120b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
6121b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
612234977a2fSmrg	    ;;
612334977a2fSmrg	  cxx*)
612434977a2fSmrg	    # Compaq C++
6125b425557eSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
6126b425557eSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
6127b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
6128b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
612934977a2fSmrg	    ;;
6130b425557eSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
6131b425557eSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
6132b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6133b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
6134b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
613534977a2fSmrg	    ;;
613634977a2fSmrg	  *)
613734977a2fSmrg	    case `$CC -V 2>&1 | sed 5q` in
613834977a2fSmrg	    *Sun\ C*)
613934977a2fSmrg	      # Sun C++ 5.9
6140b425557eSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6141b425557eSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6142b425557eSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
614334977a2fSmrg	      ;;
614434977a2fSmrg	    esac
614534977a2fSmrg	    ;;
614634977a2fSmrg	esac
614734977a2fSmrg	;;
6148b425557eSmrg      lynxos*)
6149b425557eSmrg	;;
6150b425557eSmrg      m88k*)
6151b425557eSmrg	;;
6152b425557eSmrg      mvs*)
6153b425557eSmrg	case $cc_basename in
6154b425557eSmrg	  cxx*)
6155b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
6156b425557eSmrg	    ;;
6157b425557eSmrg	  *)
6158b425557eSmrg	    ;;
6159b425557eSmrg	esac
6160b425557eSmrg	;;
6161b425557eSmrg      netbsd*)
6162b425557eSmrg	;;
6163b425557eSmrg      *qnx* | *nto*)
6164b425557eSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
6165b425557eSmrg        # it will coredump.
6166b425557eSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
6167b425557eSmrg        ;;
6168b425557eSmrg      osf3* | osf4* | osf5*)
6169b425557eSmrg	case $cc_basename in
6170b425557eSmrg	  KCC*)
6171b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6172b425557eSmrg	    ;;
6173b425557eSmrg	  RCC*)
6174b425557eSmrg	    # Rational C++ 2.4.1
6175b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6176b425557eSmrg	    ;;
6177b425557eSmrg	  cxx*)
6178b425557eSmrg	    # Digital/Compaq C++
6179b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6180b425557eSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
6181b425557eSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
6182b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
6183b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6184b425557eSmrg	    ;;
6185b425557eSmrg	  *)
6186b425557eSmrg	    ;;
6187b425557eSmrg	esac
6188b425557eSmrg	;;
6189b425557eSmrg      psos*)
6190b425557eSmrg	;;
6191b425557eSmrg      solaris*)
6192b425557eSmrg	case $cc_basename in
6193b425557eSmrg	  CC* | sunCC*)
6194b425557eSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
6195b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6196b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6197b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6198b425557eSmrg	    ;;
6199b425557eSmrg	  gcx*)
6200b425557eSmrg	    # Green Hills C++ Compiler
6201b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
6202b425557eSmrg	    ;;
6203b425557eSmrg	  *)
6204b425557eSmrg	    ;;
6205b425557eSmrg	esac
6206b425557eSmrg	;;
6207b425557eSmrg      sunos4*)
6208b425557eSmrg	case $cc_basename in
6209b425557eSmrg	  CC*)
6210b425557eSmrg	    # Sun C++ 4.x
6211b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6212b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6213b425557eSmrg	    ;;
6214b425557eSmrg	  lcc*)
6215b425557eSmrg	    # Lucid
6216b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6217b425557eSmrg	    ;;
6218b425557eSmrg	  *)
6219b425557eSmrg	    ;;
6220b425557eSmrg	esac
6221b425557eSmrg	;;
6222b425557eSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
6223b425557eSmrg	case $cc_basename in
6224b425557eSmrg	  CC*)
6225b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6226b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6227b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6228b425557eSmrg	    ;;
6229b425557eSmrg	esac
623034977a2fSmrg	;;
6231b425557eSmrg      tandem*)
6232b425557eSmrg	case $cc_basename in
6233b425557eSmrg	  NCC*)
6234b425557eSmrg	    # NonStop-UX NCC 3.20
6235b425557eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
623634977a2fSmrg	    ;;
623734977a2fSmrg	  *)
623834977a2fSmrg	    ;;
623934977a2fSmrg	esac
624034977a2fSmrg	;;
6241b425557eSmrg      vxworks*)
624234977a2fSmrg	;;
6243b425557eSmrg      *)
6244b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
624534977a2fSmrg	;;
6246b425557eSmrg    esac
6247b425557eSmrg  fi
6248b425557eSmrg],
6249b425557eSmrg[
6250b425557eSmrg  if test "$GCC" = yes; then
6251b425557eSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6252b425557eSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
6253ee3138f1Smrg
6254b425557eSmrg    case $host_os in
6255b425557eSmrg      aix*)
6256b425557eSmrg      # All AIX code is PIC.
6257b425557eSmrg      if test "$host_cpu" = ia64; then
6258b425557eSmrg	# AIX 5 now supports IA64 processor
6259b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6260b425557eSmrg      fi
6261b425557eSmrg      ;;
6262ee3138f1Smrg
6263b425557eSmrg    amigaos*)
6264b425557eSmrg      case $host_cpu in
6265b425557eSmrg      powerpc)
6266b425557eSmrg            # see comment about AmigaOS4 .so support
6267b425557eSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6268b425557eSmrg        ;;
6269b425557eSmrg      m68k)
6270b425557eSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
6271b425557eSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
6272b425557eSmrg            # like `-m68040'.
6273b425557eSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
6274b425557eSmrg        ;;
6275b425557eSmrg      esac
6276b425557eSmrg      ;;
627734977a2fSmrg
6278b425557eSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
6279b425557eSmrg      # PIC is the default for these OSes.
6280b425557eSmrg      ;;
628134977a2fSmrg
6282b425557eSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
6283b425557eSmrg      # This hack is so that the source file can tell whether it is being
6284b425557eSmrg      # built for inclusion in a dll (and should export symbols for example).
6285b425557eSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
6286b425557eSmrg      # (--disable-auto-import) libraries
6287b425557eSmrg      m4_if([$1], [GCJ], [],
6288b425557eSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
6289b425557eSmrg      ;;
629034977a2fSmrg
6291b425557eSmrg    darwin* | rhapsody*)
6292b425557eSmrg      # PIC is the default on this platform
6293b425557eSmrg      # Common symbols not allowed in MH_DYLIB files
6294b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
6295b425557eSmrg      ;;
6296ee3138f1Smrg
6297b425557eSmrg    haiku*)
6298b425557eSmrg      # PIC is the default for Haiku.
6299b425557eSmrg      # The "-static" flag exists, but is broken.
6300b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
6301b425557eSmrg      ;;
6302ee3138f1Smrg
6303b425557eSmrg    hpux*)
6304b425557eSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
6305b425557eSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
6306b425557eSmrg      # sets the default TLS model and affects inlining.
6307b425557eSmrg      case $host_cpu in
6308b425557eSmrg      hppa*64*)
6309b425557eSmrg	# +Z the default
6310b425557eSmrg	;;
6311b425557eSmrg      *)
6312b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6313b425557eSmrg	;;
6314b425557eSmrg      esac
6315b425557eSmrg      ;;
6316ee3138f1Smrg
6317b425557eSmrg    interix[[3-9]]*)
6318b425557eSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
6319b425557eSmrg      # Instead, we relocate shared libraries at runtime.
6320b425557eSmrg      ;;
632134977a2fSmrg
6322b425557eSmrg    msdosdjgpp*)
6323b425557eSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
6324b425557eSmrg      # on systems that don't support them.
6325b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6326b425557eSmrg      enable_shared=no
6327b425557eSmrg      ;;
6328ee3138f1Smrg
6329b425557eSmrg    *nto* | *qnx*)
6330b425557eSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
6331b425557eSmrg      # it will coredump.
6332b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
6333b425557eSmrg      ;;
6334ee3138f1Smrg
6335b425557eSmrg    sysv4*MP*)
6336b425557eSmrg      if test -d /usr/nec; then
6337b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
6338b425557eSmrg      fi
6339b425557eSmrg      ;;
6340ee3138f1Smrg
6341b425557eSmrg    *)
6342b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6343b425557eSmrg      ;;
6344b425557eSmrg    esac
634534977a2fSmrg
6346b425557eSmrg    case $cc_basename in
6347b425557eSmrg    nvcc*) # Cuda Compiler Driver 2.2
6348b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
6349b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
6350b425557eSmrg      ;;
6351b425557eSmrg    esac
6352b425557eSmrg  else
6353b425557eSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
6354b425557eSmrg    case $host_os in
6355b425557eSmrg    aix*)
6356b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6357b425557eSmrg      if test "$host_cpu" = ia64; then
6358b425557eSmrg	# AIX 5 now supports IA64 processor
6359b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6360b425557eSmrg      else
6361b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
6362b425557eSmrg      fi
6363b425557eSmrg      ;;
636434977a2fSmrg
6365b425557eSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
6366b425557eSmrg      # This hack is so that the source file can tell whether it is being
6367b425557eSmrg      # built for inclusion in a dll (and should export symbols for example).
6368b425557eSmrg      m4_if([$1], [GCJ], [],
6369b425557eSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
6370b425557eSmrg      ;;
637134977a2fSmrg
6372b425557eSmrg    hpux9* | hpux10* | hpux11*)
6373b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6374b425557eSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
6375b425557eSmrg      # not for PA HP-UX.
6376b425557eSmrg      case $host_cpu in
6377b425557eSmrg      hppa*64*|ia64*)
6378b425557eSmrg	# +Z the default
6379b425557eSmrg	;;
6380b425557eSmrg      *)
6381b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6382b425557eSmrg	;;
6383b425557eSmrg      esac
6384b425557eSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
6385b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6386b425557eSmrg      ;;
6387ee3138f1Smrg
6388b425557eSmrg    irix5* | irix6* | nonstopux*)
6389b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6390b425557eSmrg      # PIC (with -KPIC) is the default.
6391b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6392b425557eSmrg      ;;
6393ee3138f1Smrg
6394b425557eSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
639534977a2fSmrg      case $cc_basename in
6396b425557eSmrg      # old Intel for x86_64 which still supported -KPIC.
6397b425557eSmrg      ecc*)
6398b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6399b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6400b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
6401b425557eSmrg        ;;
6402b425557eSmrg      # icc used to be incompatible with GCC.
6403b425557eSmrg      # ICC 10 doesn't accept -KPIC any more.
6404b425557eSmrg      icc* | ifort*)
6405b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6406b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6407b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
6408b425557eSmrg        ;;
6409b425557eSmrg      # Lahey Fortran 8.1.
6410b425557eSmrg      lf95*)
6411b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6412b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
6413b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
6414b425557eSmrg	;;
6415b425557eSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
6416b425557eSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
6417b425557eSmrg	# which looks to be a dead project)
6418b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6419b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
6420b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6421b425557eSmrg        ;;
6422b425557eSmrg      ccc*)
6423b425557eSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6424b425557eSmrg        # All Alpha code is PIC.
6425b425557eSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6426b425557eSmrg        ;;
6427b425557eSmrg      xl* | bgxl* | bgf* | mpixl*)
6428b425557eSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
6429b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6430b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
6431b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
6432b425557eSmrg	;;
6433b425557eSmrg      *)
6434b425557eSmrg	case `$CC -V 2>&1 | sed 5q` in
6435b425557eSmrg	*Sun\ F* | *Sun*Fortran*)
6436b425557eSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
6437b425557eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6438b425557eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6439b425557eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
644034977a2fSmrg	  ;;
6441b425557eSmrg	*Sun\ C*)
6442b425557eSmrg	  # Sun C 5.9
6443b425557eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6444b425557eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6445b425557eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
644634977a2fSmrg	  ;;
6447b425557eSmrg	esac
6448b425557eSmrg	;;
644934977a2fSmrg      esac
645034977a2fSmrg      ;;
6451ee3138f1Smrg
6452b425557eSmrg    newsos6)
6453b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6454b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6455b425557eSmrg      ;;
6456ee3138f1Smrg
6457b425557eSmrg    *nto* | *qnx*)
6458b425557eSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
6459b425557eSmrg      # it will coredump.
6460b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
646134977a2fSmrg      ;;
6462ee3138f1Smrg
6463b425557eSmrg    osf3* | osf4* | osf5*)
6464b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6465b425557eSmrg      # All OSF/1 code is PIC.
6466b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6467b425557eSmrg      ;;
6468ee3138f1Smrg
6469b425557eSmrg    rdos*)
6470b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6471b425557eSmrg      ;;
6472b425557eSmrg
6473b425557eSmrg    solaris*)
6474b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6475b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6476b425557eSmrg      case $cc_basename in
6477b425557eSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
6478b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
6479b425557eSmrg      *)
6480b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
6481b425557eSmrg      esac
6482b425557eSmrg      ;;
6483b425557eSmrg
6484b425557eSmrg    sunos4*)
6485b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6486b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
6487b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6488b425557eSmrg      ;;
6489b425557eSmrg
6490b425557eSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
6491b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6492b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6493b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6494b425557eSmrg      ;;
6495b425557eSmrg
6496b425557eSmrg    sysv4*MP*)
6497b425557eSmrg      if test -d /usr/nec ;then
6498b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
6499b425557eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6500b425557eSmrg      fi
6501b425557eSmrg      ;;
6502b425557eSmrg
6503b425557eSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
6504b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6505b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6506b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6507b425557eSmrg      ;;
6508b425557eSmrg
6509b425557eSmrg    unicos*)
6510b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6511b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6512b425557eSmrg      ;;
6513b425557eSmrg
6514b425557eSmrg    uts4*)
6515b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6516b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6517b425557eSmrg      ;;
6518ee3138f1Smrg
6519b425557eSmrg    *)
6520b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6521b425557eSmrg      ;;
652234977a2fSmrg    esac
6523b425557eSmrg  fi
6524b425557eSmrg])
6525b425557eSmrgcase $host_os in
6526b425557eSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
6527b425557eSmrg  *djgpp*)
6528b425557eSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
6529b425557eSmrg    ;;
6530b425557eSmrg  *)
6531b425557eSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
6532b425557eSmrg    ;;
6533b425557eSmrgesac
6534b425557eSmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
6535b425557eSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
6536b425557eSmrg	[How to pass a linker flag through the compiler])
6537ee3138f1Smrg
6538b425557eSmrg#
6539b425557eSmrg# Check to make sure the PIC flag actually works.
6540b425557eSmrg#
6541b425557eSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
6542b425557eSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
6543b425557eSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
6544b425557eSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
6545b425557eSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
6546b425557eSmrg     "" | " "*) ;;
6547b425557eSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
6548b425557eSmrg     esac],
6549b425557eSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
6550b425557eSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
6551b425557eSmrgfi
6552b425557eSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
6553b425557eSmrg	[Additional compiler flags for building library objects])
655434977a2fSmrg
6555b425557eSmrg#
6556b425557eSmrg# Check to make sure the static flag actually works.
6557b425557eSmrg#
6558b425557eSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
6559b425557eSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
6560b425557eSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
6561b425557eSmrg  $lt_tmp_static_flag,
6562b425557eSmrg  [],
6563b425557eSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
6564b425557eSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
6565b425557eSmrg	[Compiler flag to prevent dynamic linking])
6566b425557eSmrg])# _LT_COMPILER_PIC
656734977a2fSmrg
656834977a2fSmrg
6569b425557eSmrg# _LT_LINKER_SHLIBS([TAGNAME])
6570b425557eSmrg# ----------------------------
6571b425557eSmrg# See if the linker supports building shared libraries.
6572b425557eSmrgm4_defun([_LT_LINKER_SHLIBS],
6573b425557eSmrg[AC_REQUIRE([LT_PATH_LD])dnl
6574b425557eSmrgAC_REQUIRE([LT_PATH_NM])dnl
6575b425557eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
6576b425557eSmrgm4_require([_LT_DECL_EGREP])dnl
6577b425557eSmrgm4_require([_LT_DECL_SED])dnl
6578b425557eSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
6579b425557eSmrgm4_require([_LT_TAG_COMPILER])dnl
6580b425557eSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6581b425557eSmrgm4_if([$1], [CXX], [
6582b425557eSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6583b425557eSmrg  case $host_os in
6584b425557eSmrg  aix[[4-9]]*)
6585b425557eSmrg    # If we're using GNU nm, then we don't want the "-C" option.
6586b425557eSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
6587b425557eSmrg    # Also, AIX nm treats weak defined symbols like other global defined
6588b425557eSmrg    # symbols, whereas GNU nm marks them as "W".
6589b425557eSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6590b425557eSmrg      _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'
6591b425557eSmrg    else
6592b425557eSmrg      _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'
6593b425557eSmrg    fi
6594b425557eSmrg    ;;
6595b425557eSmrg  pw32*)
6596b425557eSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
6597b425557eSmrg  ;;
6598b425557eSmrg  cygwin* | mingw* | cegcc*)
6599b425557eSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
6600b425557eSmrg  ;;
6601b425557eSmrg  *)
6602b425557eSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6603b425557eSmrg  ;;
6604b425557eSmrg  esac
6605b425557eSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
6606b425557eSmrg], [
6607b425557eSmrg  runpath_var=
6608b425557eSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
6609b425557eSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
6610b425557eSmrg  _LT_TAGVAR(archive_cmds, $1)=
6611b425557eSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
6612b425557eSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
6613b425557eSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6614b425557eSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6615b425557eSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6616b425557eSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
6617b425557eSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
6618b425557eSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6619b425557eSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6620b425557eSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6621b425557eSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6622b425557eSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
6623b425557eSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6624b425557eSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
6625b425557eSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
6626b425557eSmrg  _LT_TAGVAR(module_cmds, $1)=
6627b425557eSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
6628b425557eSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
6629b425557eSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
6630b425557eSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
6631b425557eSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
6632b425557eSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
6633b425557eSmrg  # included in the symbol list
6634b425557eSmrg  _LT_TAGVAR(include_expsyms, $1)=
6635b425557eSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
6636b425557eSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
6637b425557eSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
6638b425557eSmrg  # as well as any symbol that contains `d'.
6639b425557eSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
6640b425557eSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
6641b425557eSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
6642b425557eSmrg  # the symbol is explicitly referenced.  Since portable code cannot
6643b425557eSmrg  # rely on this symbol name, it's probably fine to never include it in
6644b425557eSmrg  # preloaded symbol tables.
6645b425557eSmrg  # Exclude shared library initialization/finalization symbols.
6646b425557eSmrgdnl Note also adjust exclude_expsyms for C++ above.
6647b425557eSmrg  extract_expsyms_cmds=
6648ee3138f1Smrg
6649b425557eSmrg  case $host_os in
6650b425557eSmrg  cygwin* | mingw* | pw32* | cegcc*)
6651b425557eSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
6652b425557eSmrg    # When not using gcc, we currently assume that we are using
6653b425557eSmrg    # Microsoft Visual C++.
6654b425557eSmrg    if test "$GCC" != yes; then
6655b425557eSmrg      with_gnu_ld=no
6656b425557eSmrg    fi
6657b425557eSmrg    ;;
6658b425557eSmrg  interix*)
6659b425557eSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
6660b425557eSmrg    with_gnu_ld=yes
6661b425557eSmrg    ;;
6662b425557eSmrg  openbsd*)
6663b425557eSmrg    with_gnu_ld=no
6664b425557eSmrg    ;;
6665b425557eSmrg  esac
6666ee3138f1Smrg
6667b425557eSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
6668ee3138f1Smrg
6669b425557eSmrg  # On some targets, GNU ld is compatible enough with the native linker
6670b425557eSmrg  # that we're better off using the native interface for both.
6671b425557eSmrg  lt_use_gnu_ld_interface=no
6672b425557eSmrg  if test "$with_gnu_ld" = yes; then
6673b425557eSmrg    case $host_os in
6674b425557eSmrg      aix*)
6675b425557eSmrg	# The AIX port of GNU ld has always aspired to compatibility
6676b425557eSmrg	# with the native linker.  However, as the warning in the GNU ld
6677b425557eSmrg	# block says, versions before 2.19.5* couldn't really create working
6678b425557eSmrg	# shared libraries, regardless of the interface used.
6679b425557eSmrg	case `$LD -v 2>&1` in
6680b425557eSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
6681b425557eSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
6682b425557eSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
6683b425557eSmrg	  *)
6684b425557eSmrg	    lt_use_gnu_ld_interface=yes
6685b425557eSmrg	    ;;
6686b425557eSmrg	esac
6687b425557eSmrg	;;
6688b425557eSmrg      *)
6689b425557eSmrg	lt_use_gnu_ld_interface=yes
6690b425557eSmrg	;;
6691b425557eSmrg    esac
6692b425557eSmrg  fi
6693ee3138f1Smrg
6694b425557eSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
6695b425557eSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
6696b425557eSmrg    wlarc='${wl}'
6697ee3138f1Smrg
6698b425557eSmrg    # Set some defaults for GNU ld with shared library support. These
6699b425557eSmrg    # are reset later if shared libraries are not supported. Putting them
6700b425557eSmrg    # here allows them to be overridden if necessary.
6701b425557eSmrg    runpath_var=LD_RUN_PATH
6702b425557eSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6703b425557eSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6704b425557eSmrg    # ancient GNU ld didn't support --whole-archive et. al.
6705b425557eSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
6706b425557eSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6707b425557eSmrg    else
6708b425557eSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
6709b425557eSmrg    fi
6710b425557eSmrg    supports_anon_versioning=no
6711b425557eSmrg    case `$LD -v 2>&1` in
6712b425557eSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
6713b425557eSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
6714b425557eSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
6715b425557eSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
6716b425557eSmrg      *\ 2.11.*) ;; # other 2.11 versions
6717b425557eSmrg      *) supports_anon_versioning=yes ;;
6718b425557eSmrg    esac
6719ee3138f1Smrg
6720b425557eSmrg    # See if GNU ld supports shared libraries.
6721b425557eSmrg    case $host_os in
6722b425557eSmrg    aix[[3-9]]*)
6723b425557eSmrg      # On AIX/PPC, the GNU linker is very broken
6724b425557eSmrg      if test "$host_cpu" != ia64; then
6725b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6726b425557eSmrg	cat <<_LT_EOF 1>&2
6727ee3138f1Smrg
6728b425557eSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
6729b425557eSmrg*** to be unable to reliably create shared libraries on AIX.
6730b425557eSmrg*** Therefore, libtool is disabling shared libraries support.  If you
6731b425557eSmrg*** really care for shared libraries, you may want to install binutils
6732b425557eSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
6733b425557eSmrg*** You will then need to restart the configuration process.
6734ee3138f1Smrg
6735b425557eSmrg_LT_EOF
6736b425557eSmrg      fi
6737b425557eSmrg      ;;
6738ee3138f1Smrg
6739b425557eSmrg    amigaos*)
6740b425557eSmrg      case $host_cpu in
6741b425557eSmrg      powerpc)
6742b425557eSmrg            # see comment about AmigaOS4 .so support
6743b425557eSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6744b425557eSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6745b425557eSmrg        ;;
6746b425557eSmrg      m68k)
6747b425557eSmrg            _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)'
6748b425557eSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6749b425557eSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6750b425557eSmrg        ;;
6751b425557eSmrg      esac
6752b425557eSmrg      ;;
6753ee3138f1Smrg
6754b425557eSmrg    beos*)
6755b425557eSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6756b425557eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6757b425557eSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6758b425557eSmrg	# support --undefined.  This deserves some investigation.  FIXME
6759b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6760b425557eSmrg      else
6761b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6762b425557eSmrg      fi
6763b425557eSmrg      ;;
6764ee3138f1Smrg
6765b425557eSmrg    cygwin* | mingw* | pw32* | cegcc*)
6766b425557eSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6767b425557eSmrg      # as there is no search path for DLLs.
6768b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6769b425557eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6770b425557eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6771b425557eSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
6772b425557eSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6773b425557eSmrg      _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'
6774ee3138f1Smrg
6775b425557eSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6776b425557eSmrg        _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'
6777b425557eSmrg	# If the export-symbols file already is a .def file (1st line
6778b425557eSmrg	# is EXPORTS), use it as is; otherwise, prepend...
6779b425557eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6780b425557eSmrg	  cp $export_symbols $output_objdir/$soname.def;
6781b425557eSmrg	else
6782b425557eSmrg	  echo EXPORTS > $output_objdir/$soname.def;
6783b425557eSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
6784b425557eSmrg	fi~
6785b425557eSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6786b425557eSmrg      else
6787b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6788b425557eSmrg      fi
6789b425557eSmrg      ;;
6790ee3138f1Smrg
6791b425557eSmrg    haiku*)
6792b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6793b425557eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6794b425557eSmrg      ;;
6795ee3138f1Smrg
6796b425557eSmrg    interix[[3-9]]*)
6797b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
6798b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6799b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6800b425557eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6801b425557eSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6802b425557eSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
6803b425557eSmrg      # default) and relocated if they conflict, which is a slow very memory
6804b425557eSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
6805b425557eSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6806b425557eSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6807b425557eSmrg      _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'
6808b425557eSmrg      _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'
6809b425557eSmrg      ;;
6810ee3138f1Smrg
6811b425557eSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
6812b425557eSmrg      tmp_diet=no
6813b425557eSmrg      if test "$host_os" = linux-dietlibc; then
6814b425557eSmrg	case $cc_basename in
6815b425557eSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
6816b425557eSmrg	esac
6817b425557eSmrg      fi
6818b425557eSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
6819b425557eSmrg	 && test "$tmp_diet" = no
6820b425557eSmrg      then
6821b425557eSmrg	tmp_addflag=
6822b425557eSmrg	tmp_sharedflag='-shared'
6823b425557eSmrg	case $cc_basename,$host_cpu in
6824b425557eSmrg        pgcc*)				# Portland Group C compiler
6825b425557eSmrg	  _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'
6826b425557eSmrg	  tmp_addflag=' $pic_flag'
6827b425557eSmrg	  ;;
6828b425557eSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
6829b425557eSmrg					# Portland Group f77 and f90 compilers
6830b425557eSmrg	  _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'
6831b425557eSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
6832b425557eSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
6833b425557eSmrg	  tmp_addflag=' -i_dynamic' ;;
6834b425557eSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
6835b425557eSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
6836b425557eSmrg	ifc* | ifort*)			# Intel Fortran compiler
6837b425557eSmrg	  tmp_addflag=' -nofor_main' ;;
6838b425557eSmrg	lf95*)				# Lahey Fortran 8.1
6839b425557eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
6840b425557eSmrg	  tmp_sharedflag='--shared' ;;
6841b425557eSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
6842b425557eSmrg	  tmp_sharedflag='-qmkshrobj'
6843b425557eSmrg	  tmp_addflag= ;;
6844b425557eSmrg	nvcc*)	# Cuda Compiler Driver 2.2
6845b425557eSmrg	  _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'
6846b425557eSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
6847b425557eSmrg	  ;;
6848b425557eSmrg	esac
6849b425557eSmrg	case `$CC -V 2>&1 | sed 5q` in
6850b425557eSmrg	*Sun\ C*)			# Sun C 5.9
6851b425557eSmrg	  _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'
6852b425557eSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
6853b425557eSmrg	  tmp_sharedflag='-G' ;;
6854b425557eSmrg	*Sun\ F*)			# Sun Fortran 8.3
6855b425557eSmrg	  tmp_sharedflag='-G' ;;
6856b425557eSmrg	esac
6857b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6858ee3138f1Smrg
6859b425557eSmrg        if test "x$supports_anon_versioning" = xyes; then
6860b425557eSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6861b425557eSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6862b425557eSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
6863b425557eSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6864b425557eSmrg        fi
6865ee3138f1Smrg
6866b425557eSmrg	case $cc_basename in
6867b425557eSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
6868b425557eSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
6869b425557eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
6870b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6871b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
6872b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
6873b425557eSmrg	  if test "x$supports_anon_versioning" = xyes; then
6874b425557eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6875b425557eSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6876b425557eSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
6877b425557eSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
6878b425557eSmrg	  fi
6879b425557eSmrg	  ;;
6880b425557eSmrg	esac
6881b425557eSmrg      else
6882b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6883b425557eSmrg      fi
688434977a2fSmrg      ;;
6885ee3138f1Smrg
6886b425557eSmrg    netbsd*)
6887b425557eSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6888b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6889b425557eSmrg	wlarc=
6890b425557eSmrg      else
6891b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6892b425557eSmrg	_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'
6893b425557eSmrg      fi
689434977a2fSmrg      ;;
6895ee3138f1Smrg
6896b425557eSmrg    solaris*)
6897b425557eSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
6898b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6899b425557eSmrg	cat <<_LT_EOF 1>&2
6900ee3138f1Smrg
6901b425557eSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
6902b425557eSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
6903b425557eSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
6904b425557eSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
6905b425557eSmrg*** your PATH or compiler configuration so that the native linker is
6906b425557eSmrg*** used, and then restart.
690734977a2fSmrg
6908b425557eSmrg_LT_EOF
6909b425557eSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6910b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6911b425557eSmrg	_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'
6912b425557eSmrg      else
6913b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6914b425557eSmrg      fi
6915b425557eSmrg      ;;
691634977a2fSmrg
6917b425557eSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
6918b425557eSmrg      case `$LD -v 2>&1` in
6919b425557eSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
6920b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6921b425557eSmrg	cat <<_LT_EOF 1>&2
6922ee3138f1Smrg
6923b425557eSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
6924b425557eSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
6925b425557eSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
6926b425557eSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
6927b425557eSmrg*** your PATH or compiler configuration so that the native linker is
6928b425557eSmrg*** used, and then restart.
6929ee3138f1Smrg
6930b425557eSmrg_LT_EOF
6931b425557eSmrg	;;
6932b425557eSmrg	*)
6933b425557eSmrg	  # For security reasons, it is highly recommended that you always
6934b425557eSmrg	  # use absolute paths for naming shared libraries, and exclude the
6935b425557eSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
6936b425557eSmrg	  # requires that you compile everything twice, which is a pain.
6937b425557eSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6938b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6939b425557eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6940b425557eSmrg	    _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'
6941b425557eSmrg	  else
6942b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6943b425557eSmrg	  fi
6944b425557eSmrg	;;
6945b425557eSmrg      esac
6946b425557eSmrg      ;;
6947ee3138f1Smrg
6948b425557eSmrg    sunos4*)
6949b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6950b425557eSmrg      wlarc=
6951b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6952b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6953b425557eSmrg      ;;
6954ee3138f1Smrg
6955b425557eSmrg    *)
6956b425557eSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6957b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6958b425557eSmrg	_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'
6959b425557eSmrg      else
6960b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6961b425557eSmrg      fi
6962b425557eSmrg      ;;
6963b425557eSmrg    esac
6964ee3138f1Smrg
6965b425557eSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
6966b425557eSmrg      runpath_var=
6967b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6968b425557eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6969b425557eSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
6970b425557eSmrg    fi
6971b425557eSmrg  else
6972b425557eSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
6973b425557eSmrg    case $host_os in
6974b425557eSmrg    aix3*)
6975b425557eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6976b425557eSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
6977b425557eSmrg      _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'
6978b425557eSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
6979b425557eSmrg      # are no directories specified by -L.
6980b425557eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6981b425557eSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6982b425557eSmrg	# Neither direct hardcoding nor static linking is supported with a
6983b425557eSmrg	# broken collect2.
6984b425557eSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
6985b425557eSmrg      fi
6986b425557eSmrg      ;;
6987ee3138f1Smrg
6988b425557eSmrg    aix[[4-9]]*)
6989b425557eSmrg      if test "$host_cpu" = ia64; then
6990b425557eSmrg	# On IA64, the linker does run time linking by default, so we don't
6991b425557eSmrg	# have to do anything special.
6992b425557eSmrg	aix_use_runtimelinking=no
6993b425557eSmrg	exp_sym_flag='-Bexport'
6994b425557eSmrg	no_entry_flag=""
6995b425557eSmrg      else
6996b425557eSmrg	# If we're using GNU nm, then we don't want the "-C" option.
6997b425557eSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6998b425557eSmrg	# Also, AIX nm treats weak defined symbols like other global
6999b425557eSmrg	# defined symbols, whereas GNU nm marks them as "W".
7000b425557eSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
7001b425557eSmrg	  _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'
7002b425557eSmrg	else
7003b425557eSmrg	  _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'
7004b425557eSmrg	fi
7005b425557eSmrg	aix_use_runtimelinking=no
700634977a2fSmrg
7007b425557eSmrg	# Test if we are trying to use run time linking or normal
7008b425557eSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
7009b425557eSmrg	# need to do runtime linking.
7010b425557eSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7011b425557eSmrg	  for ld_flag in $LDFLAGS; do
7012b425557eSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
7013b425557eSmrg	    aix_use_runtimelinking=yes
7014b425557eSmrg	    break
7015b425557eSmrg	  fi
7016b425557eSmrg	  done
7017b425557eSmrg	  ;;
7018b425557eSmrg	esac
7019ee3138f1Smrg
7020b425557eSmrg	exp_sym_flag='-bexport'
7021b425557eSmrg	no_entry_flag='-bnoentry'
7022b425557eSmrg      fi
7023ee3138f1Smrg
7024b425557eSmrg      # When large executables or shared objects are built, AIX ld can
7025b425557eSmrg      # have problems creating the table of contents.  If linking a library
7026b425557eSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
7027b425557eSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7028b425557eSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7029ee3138f1Smrg
7030b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)=''
7031b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7032b425557eSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7033b425557eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7034b425557eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
7035b425557eSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7036ee3138f1Smrg
7037b425557eSmrg      if test "$GCC" = yes; then
7038b425557eSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
7039b425557eSmrg	# We only want to do this on AIX 4.2 and lower, the check
7040b425557eSmrg	# below for broken collect2 doesn't work under 4.3+
7041b425557eSmrg	  collect2name=`${CC} -print-prog-name=collect2`
7042b425557eSmrg	  if test -f "$collect2name" &&
7043b425557eSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7044b425557eSmrg	  then
7045b425557eSmrg	  # We have reworked collect2
7046b425557eSmrg	  :
7047b425557eSmrg	  else
7048b425557eSmrg	  # We have old collect2
7049b425557eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
7050b425557eSmrg	  # It fails to find uninstalled libraries when the uninstalled
7051b425557eSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
7052b425557eSmrg	  # to unsupported forces relinking
7053b425557eSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
7054b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7055b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
7056b425557eSmrg	  fi
7057b425557eSmrg	  ;;
7058b425557eSmrg	esac
7059b425557eSmrg	shared_flag='-shared'
7060b425557eSmrg	if test "$aix_use_runtimelinking" = yes; then
7061b425557eSmrg	  shared_flag="$shared_flag "'${wl}-G'
7062b425557eSmrg	fi
7063b425557eSmrg      else
7064b425557eSmrg	# not using gcc
7065b425557eSmrg	if test "$host_cpu" = ia64; then
7066b425557eSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7067b425557eSmrg	# chokes on -Wl,-G. The following line is correct:
7068b425557eSmrg	  shared_flag='-G'
7069b425557eSmrg	else
7070b425557eSmrg	  if test "$aix_use_runtimelinking" = yes; then
7071b425557eSmrg	    shared_flag='${wl}-G'
7072b425557eSmrg	  else
7073b425557eSmrg	    shared_flag='${wl}-bM:SRE'
7074b425557eSmrg	  fi
7075b425557eSmrg	fi
7076b425557eSmrg      fi
7077ee3138f1Smrg
7078b425557eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7079b425557eSmrg      # It seems that -bexpall does not export symbols beginning with
7080b425557eSmrg      # underscore (_), so it is better to generate a list of symbols to export.
7081b425557eSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
7082b425557eSmrg      if test "$aix_use_runtimelinking" = yes; then
7083b425557eSmrg	# Warning - without using the other runtime loading flags (-brtl),
7084b425557eSmrg	# -berok will link without error, but may produce a broken library.
7085b425557eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7086b425557eSmrg        # Determine the default libpath from the value encoded in an
7087b425557eSmrg        # empty executable.
7088b425557eSmrg        _LT_SYS_MODULE_PATH_AIX
7089b425557eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7090b425557eSmrg        _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"
7091b425557eSmrg      else
7092b425557eSmrg	if test "$host_cpu" = ia64; then
7093b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7094b425557eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7095b425557eSmrg	  _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"
7096b425557eSmrg	else
7097b425557eSmrg	 # Determine the default libpath from the value encoded in an
7098b425557eSmrg	 # empty executable.
7099b425557eSmrg	 _LT_SYS_MODULE_PATH_AIX
7100b425557eSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7101b425557eSmrg	  # Warning - without using the other run time loading flags,
7102b425557eSmrg	  # -berok will link without error, but may produce a broken library.
7103b425557eSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7104b425557eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7105b425557eSmrg	  if test "$with_gnu_ld" = yes; then
7106b425557eSmrg	    # We only use this code for GNU lds that support --whole-archive.
7107b425557eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7108b425557eSmrg	  else
7109b425557eSmrg	    # Exported symbols can be pulled into shared objects from archives
7110b425557eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7111b425557eSmrg	  fi
7112b425557eSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7113b425557eSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
7114b425557eSmrg	  _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'
7115b425557eSmrg	fi
7116b425557eSmrg      fi
7117b425557eSmrg      ;;
7118ee3138f1Smrg
7119b425557eSmrg    amigaos*)
7120b425557eSmrg      case $host_cpu in
7121b425557eSmrg      powerpc)
7122b425557eSmrg            # see comment about AmigaOS4 .so support
7123b425557eSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7124b425557eSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
712534977a2fSmrg        ;;
7126b425557eSmrg      m68k)
7127b425557eSmrg            _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)'
7128b425557eSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7129b425557eSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
713034977a2fSmrg        ;;
7131b425557eSmrg      esac
7132b425557eSmrg      ;;
713334977a2fSmrg
7134b425557eSmrg    bsdi[[45]]*)
7135b425557eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
7136b425557eSmrg      ;;
7137ee3138f1Smrg
7138b425557eSmrg    cygwin* | mingw* | pw32* | cegcc*)
7139b425557eSmrg      # When not using gcc, we currently assume that we are using
7140b425557eSmrg      # Microsoft Visual C++.
7141b425557eSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
7142b425557eSmrg      # no search path for DLLs.
7143b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7144b425557eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7145b425557eSmrg      # Tell ltmain to make .lib files, not .a files.
7146b425557eSmrg      libext=lib
7147b425557eSmrg      # Tell ltmain to make .dll files, not .so files.
7148b425557eSmrg      shrext_cmds=".dll"
7149b425557eSmrg      # FIXME: Setting linknames here is a bad hack.
7150b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
7151b425557eSmrg      # The linker will automatically build a .lib file if we build a DLL.
7152b425557eSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7153b425557eSmrg      # FIXME: Should let the user specify the lib program.
7154b425557eSmrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
7155b425557eSmrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
7156b425557eSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7157b425557eSmrg      ;;
7158ee3138f1Smrg
7159b425557eSmrg    darwin* | rhapsody*)
7160b425557eSmrg      _LT_DARWIN_LINKER_FEATURES($1)
7161b425557eSmrg      ;;
7162ee3138f1Smrg
7163b425557eSmrg    dgux*)
7164b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7165b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7166b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7167b425557eSmrg      ;;
7168ee3138f1Smrg
7169b425557eSmrg    freebsd1*)
7170b425557eSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
7171b425557eSmrg      ;;
7172ee3138f1Smrg
7173b425557eSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
7174b425557eSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
7175b425557eSmrg    # does not break anything, and helps significantly (at the cost of a little
7176b425557eSmrg    # extra space).
7177b425557eSmrg    freebsd2.2*)
7178b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
7179b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7180b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7181b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7182b425557eSmrg      ;;
7183ee3138f1Smrg
7184b425557eSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
7185b425557eSmrg    freebsd2*)
7186b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7187b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7188b425557eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
7189b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7190b425557eSmrg      ;;
719134977a2fSmrg
7192b425557eSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
7193b425557eSmrg    freebsd* | dragonfly*)
7194b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
7195b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7196b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7197b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7198b425557eSmrg      ;;
719934977a2fSmrg
7200b425557eSmrg    hpux9*)
7201b425557eSmrg      if test "$GCC" = yes; then
7202b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
7203b425557eSmrg      else
7204b425557eSmrg	_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'
7205b425557eSmrg      fi
7206b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7207b425557eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7208b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
720934977a2fSmrg
7210b425557eSmrg      # hardcode_minus_L: Not really in the search PATH,
7211b425557eSmrg      # but as the default location of the library.
7212b425557eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
7213b425557eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7214b425557eSmrg      ;;
721534977a2fSmrg
7216b425557eSmrg    hpux10*)
7217b425557eSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
7218b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7219b425557eSmrg      else
7220b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
7221b425557eSmrg      fi
7222b425557eSmrg      if test "$with_gnu_ld" = no; then
7223b425557eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7224b425557eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
7225b425557eSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
7226b425557eSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
7227b425557eSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7228b425557eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7229b425557eSmrg	# hardcode_minus_L: Not really in the search PATH,
7230b425557eSmrg	# but as the default location of the library.
7231b425557eSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
7232b425557eSmrg      fi
7233b425557eSmrg      ;;
7234ee3138f1Smrg
7235b425557eSmrg    hpux11*)
7236b425557eSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
7237b425557eSmrg	case $host_cpu in
7238b425557eSmrg	hppa*64*)
7239b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7240b425557eSmrg	  ;;
7241b425557eSmrg	ia64*)
7242b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
7243b425557eSmrg	  ;;
7244b425557eSmrg	*)
7245b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7246b425557eSmrg	  ;;
7247b425557eSmrg	esac
7248b425557eSmrg      else
7249b425557eSmrg	case $host_cpu in
7250b425557eSmrg	hppa*64*)
7251b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7252b425557eSmrg	  ;;
7253b425557eSmrg	ia64*)
7254b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
7255b425557eSmrg	  ;;
7256b425557eSmrg	*)
7257b425557eSmrg	m4_if($1, [], [
7258b425557eSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
7259b425557eSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
7260b425557eSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
7261b425557eSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
7262b425557eSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
7263b425557eSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
7264b425557eSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
7265b425557eSmrg	  ;;
7266b425557eSmrg	esac
7267b425557eSmrg      fi
7268b425557eSmrg      if test "$with_gnu_ld" = no; then
7269b425557eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7270b425557eSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
7271ee3138f1Smrg
7272b425557eSmrg	case $host_cpu in
7273b425557eSmrg	hppa*64*|ia64*)
7274b425557eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
7275b425557eSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7276b425557eSmrg	  ;;
7277b425557eSmrg	*)
7278b425557eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7279b425557eSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7280b425557eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7281ee3138f1Smrg
7282b425557eSmrg	  # hardcode_minus_L: Not really in the search PATH,
7283b425557eSmrg	  # but as the default location of the library.
7284b425557eSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
7285b425557eSmrg	  ;;
7286b425557eSmrg	esac
7287b425557eSmrg      fi
7288b425557eSmrg      ;;
7289ee3138f1Smrg
7290b425557eSmrg    irix5* | irix6* | nonstopux*)
7291b425557eSmrg      if test "$GCC" = yes; then
7292b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $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'
7293b425557eSmrg	# Try to use the -exported_symbol ld option, if it does not
7294b425557eSmrg	# work, assume that -exports_file does not work either and
7295b425557eSmrg	# implicitly export all symbols.
7296b425557eSmrg        save_LDFLAGS="$LDFLAGS"
7297b425557eSmrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
7298b425557eSmrg        AC_LINK_IFELSE(int foo(void) {},
7299b425557eSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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'
7300b425557eSmrg        )
7301b425557eSmrg        LDFLAGS="$save_LDFLAGS"
7302b425557eSmrg      else
7303b425557eSmrg	_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'
7304b425557eSmrg	_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'
7305b425557eSmrg      fi
7306b425557eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
7307b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7308b425557eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7309b425557eSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
7310b425557eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
7311b425557eSmrg      ;;
731234977a2fSmrg
7313b425557eSmrg    netbsd*)
7314b425557eSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7315b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
7316b425557eSmrg      else
7317b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
7318b425557eSmrg      fi
7319b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7320b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7321b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7322b425557eSmrg      ;;
732334977a2fSmrg
7324b425557eSmrg    newsos6)
7325b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7326b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7327b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7328b425557eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7329b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7330b425557eSmrg      ;;
7331ee3138f1Smrg
7332b425557eSmrg    *nto* | *qnx*)
7333b425557eSmrg      ;;
733434977a2fSmrg
7335b425557eSmrg    openbsd*)
7336b425557eSmrg      if test -f /usr/libexec/ld.so; then
7337b425557eSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
7338b425557eSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7339b425557eSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7340b425557eSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7341b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
7342b425557eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
7343b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7344b425557eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7345b425557eSmrg	else
7346b425557eSmrg	  case $host_os in
7347b425557eSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
7348b425557eSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7349b425557eSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7350b425557eSmrg	     ;;
7351b425557eSmrg	   *)
7352b425557eSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
7353b425557eSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7354b425557eSmrg	     ;;
7355b425557eSmrg	  esac
7356ee3138f1Smrg	fi
7357b425557eSmrg      else
7358b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7359b425557eSmrg      fi
7360b425557eSmrg      ;;
736134977a2fSmrg
7362b425557eSmrg    os2*)
7363b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7364b425557eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
7365b425557eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7366b425557eSmrg      _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'
7367b425557eSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
7368b425557eSmrg      ;;
736934977a2fSmrg
7370b425557eSmrg    osf3*)
7371b425557eSmrg      if test "$GCC" = yes; then
7372b425557eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7373b425557eSmrg	_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'
7374b425557eSmrg      else
7375b425557eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7376b425557eSmrg	_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'
7377b425557eSmrg      fi
7378b425557eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
7379b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7380b425557eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7381b425557eSmrg      ;;
738234977a2fSmrg
7383b425557eSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
7384b425557eSmrg      if test "$GCC" = yes; then
7385b425557eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7386b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_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'
7387b425557eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7388b425557eSmrg      else
7389b425557eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7390b425557eSmrg	_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'
7391b425557eSmrg	_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~
7392b425557eSmrg	$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'
739334977a2fSmrg
7394b425557eSmrg	# Both c and cxx compiler support -rpath directly
7395b425557eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7396b425557eSmrg      fi
7397b425557eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
7398b425557eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7399b425557eSmrg      ;;
740034977a2fSmrg
7401b425557eSmrg    solaris*)
7402b425557eSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
7403b425557eSmrg      if test "$GCC" = yes; then
7404b425557eSmrg	wlarc='${wl}'
7405b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7406b425557eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7407b425557eSmrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
7408b425557eSmrg      else
7409b425557eSmrg	case `$CC -V 2>&1` in
7410b425557eSmrg	*"Compilers 5.0"*)
7411b425557eSmrg	  wlarc=''
7412b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
7413b425557eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7414b425557eSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
7415b425557eSmrg	  ;;
7416b425557eSmrg	*)
7417b425557eSmrg	  wlarc='${wl}'
7418b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
7419b425557eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7420b425557eSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
7421b425557eSmrg	  ;;
7422b425557eSmrg	esac
7423b425557eSmrg      fi
7424b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7425b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7426b425557eSmrg      case $host_os in
7427b425557eSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7428b425557eSmrg      *)
7429b425557eSmrg	# The compiler driver will combine and reorder linker options,
7430b425557eSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
7431b425557eSmrg	# but is careful enough not to reorder.
7432b425557eSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
7433b425557eSmrg	if test "$GCC" = yes; then
7434b425557eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7435b425557eSmrg	else
7436b425557eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7437b425557eSmrg	fi
7438b425557eSmrg	;;
7439b425557eSmrg      esac
7440b425557eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
7441b425557eSmrg      ;;
7442ee3138f1Smrg
7443b425557eSmrg    sunos4*)
7444b425557eSmrg      if test "x$host_vendor" = xsequent; then
7445b425557eSmrg	# Use $CC to link under sequent, because it throws in some extra .o
7446b425557eSmrg	# files that make .init and .fini sections work.
7447b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
7448b425557eSmrg      else
7449b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
7450b425557eSmrg      fi
7451b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7452b425557eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7453b425557eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
7454b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7455b425557eSmrg      ;;
7456ee3138f1Smrg
7457b425557eSmrg    sysv4)
7458b425557eSmrg      case $host_vendor in
7459b425557eSmrg	sni)
7460b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7461b425557eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
7462b425557eSmrg	;;
7463b425557eSmrg	siemens)
7464b425557eSmrg	  ## LD is ld it makes a PLAMLIB
7465b425557eSmrg	  ## CC just makes a GrossModule.
7466b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
7467b425557eSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
7468b425557eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
7469b425557eSmrg        ;;
7470b425557eSmrg	motorola)
7471b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7472b425557eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
7473b425557eSmrg	;;
7474b425557eSmrg      esac
7475b425557eSmrg      runpath_var='LD_RUN_PATH'
7476b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7477b425557eSmrg      ;;
7478ee3138f1Smrg
7479b425557eSmrg    sysv4.3*)
7480b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7481b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7482b425557eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
7483b425557eSmrg      ;;
7484ee3138f1Smrg
7485b425557eSmrg    sysv4*MP*)
7486b425557eSmrg      if test -d /usr/nec; then
7487b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7488b425557eSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7489b425557eSmrg	runpath_var=LD_RUN_PATH
7490b425557eSmrg	hardcode_runpath_var=yes
7491b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
7492b425557eSmrg      fi
7493b425557eSmrg      ;;
7494ee3138f1Smrg
7495b425557eSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7496b425557eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7497b425557eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7498b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7499b425557eSmrg      runpath_var='LD_RUN_PATH'
7500ee3138f1Smrg
7501b425557eSmrg      if test "$GCC" = yes; then
7502b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7503b425557eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7504b425557eSmrg      else
7505b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7506b425557eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7507b425557eSmrg      fi
7508b425557eSmrg      ;;
7509ee3138f1Smrg
7510b425557eSmrg    sysv5* | sco3.2v5* | sco5v6*)
7511b425557eSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
7512b425557eSmrg      # link with -lc, and that would cause any symbols used from libc to
7513b425557eSmrg      # always be unresolved, which means just about no library would
7514b425557eSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
7515b425557eSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
7516b425557eSmrg      # as -z defs.
7517b425557eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7518b425557eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7519b425557eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7520b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7521b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7522b425557eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7523b425557eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
7524b425557eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7525b425557eSmrg      runpath_var='LD_RUN_PATH'
7526ee3138f1Smrg
7527b425557eSmrg      if test "$GCC" = yes; then
7528b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7529b425557eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7530b425557eSmrg      else
7531b425557eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7532b425557eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7533b425557eSmrg      fi
7534b425557eSmrg      ;;
753534977a2fSmrg
7536b425557eSmrg    uts4*)
7537b425557eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7538b425557eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7539b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7540b425557eSmrg      ;;
754134977a2fSmrg
7542b425557eSmrg    *)
7543b425557eSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
7544b425557eSmrg      ;;
7545b425557eSmrg    esac
754634977a2fSmrg
7547b425557eSmrg    if test x$host_vendor = xsni; then
7548b425557eSmrg      case $host in
7549b425557eSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7550b425557eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
7551b425557eSmrg	;;
7552b425557eSmrg      esac
7553b425557eSmrg    fi
7554b425557eSmrg  fi
7555b425557eSmrg])
7556b425557eSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7557b425557eSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
755834977a2fSmrg
7559b425557eSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
756034977a2fSmrg
7561b425557eSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
7562b425557eSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
7563b425557eSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
7564b425557eSmrg    [The commands to extract the exported symbol list from a shared archive])
756534977a2fSmrg
7566b425557eSmrg#
7567b425557eSmrg# Do we need to explicitly link libc?
7568b425557eSmrg#
7569b425557eSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
7570b425557eSmrgx|xyes)
7571b425557eSmrg  # Assume -lc should be added
7572b425557eSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
757334977a2fSmrg
7574b425557eSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
7575b425557eSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
7576b425557eSmrg    *'~'*)
7577b425557eSmrg      # FIXME: we may have to deal with multi-command sequences.
7578b425557eSmrg      ;;
7579b425557eSmrg    '$CC '*)
7580b425557eSmrg      # Test whether the compiler implicitly links with -lc since on some
7581b425557eSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
7582b425557eSmrg      # to ld, don't add -lc before -lgcc.
7583b425557eSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
7584b425557eSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
7585b425557eSmrg	[$RM conftest*
7586b425557eSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7587b425557eSmrg
7588b425557eSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
7589b425557eSmrg	  soname=conftest
7590b425557eSmrg	  lib=conftest
7591b425557eSmrg	  libobjs=conftest.$ac_objext
7592b425557eSmrg	  deplibs=
7593b425557eSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
7594b425557eSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
7595b425557eSmrg	  compiler_flags=-v
7596b425557eSmrg	  linker_flags=-v
7597b425557eSmrg	  verstring=
7598b425557eSmrg	  output_objdir=.
7599b425557eSmrg	  libname=conftest
7600b425557eSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
7601b425557eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
7602b425557eSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
7603b425557eSmrg	  then
7604b425557eSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7605b425557eSmrg	  else
7606b425557eSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7607b425557eSmrg	  fi
7608b425557eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
7609b425557eSmrg	else
7610b425557eSmrg	  cat conftest.err 1>&5
7611b425557eSmrg	fi
7612b425557eSmrg	$RM conftest*
7613b425557eSmrg	])
7614b425557eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
7615b425557eSmrg      ;;
7616b425557eSmrg    esac
7617b425557eSmrg  fi
7618b425557eSmrg  ;;
7619b425557eSmrgesac
762034977a2fSmrg
7621b425557eSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
7622b425557eSmrg    [Whether or not to add -lc for building shared libraries])
7623b425557eSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
7624b425557eSmrg    [enable_shared_with_static_runtimes], [0],
7625b425557eSmrg    [Whether or not to disallow shared libs when runtime libs are static])
7626b425557eSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
7627b425557eSmrg    [Compiler flag to allow reflexive dlopens])
7628b425557eSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
7629b425557eSmrg    [Compiler flag to generate shared objects directly from archives])
7630b425557eSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
7631b425557eSmrg    [Whether the compiler copes with passing no objects directly])
7632b425557eSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
7633b425557eSmrg    [Create an old-style archive from a shared archive])
7634b425557eSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
7635b425557eSmrg    [Create a temporary old-style archive to link instead of a shared archive])
7636b425557eSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
7637b425557eSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
7638b425557eSmrg_LT_TAGDECL([], [module_cmds], [2],
7639b425557eSmrg    [Commands used to build a loadable module if different from building
7640b425557eSmrg    a shared archive.])
7641b425557eSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
7642b425557eSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
7643b425557eSmrg    [Whether we are building with GNU ld or not])
7644b425557eSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
7645b425557eSmrg    [Flag that allows shared libraries with undefined symbols to be built])
7646b425557eSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
7647b425557eSmrg    [Flag that enforces no undefined symbols])
7648b425557eSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
7649b425557eSmrg    [Flag to hardcode $libdir into a binary during linking.
7650b425557eSmrg    This must work even if $libdir does not exist])
7651b425557eSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
7652b425557eSmrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
7653b425557eSmrg    during linking.  This must work even if $libdir does not exist]])
7654b425557eSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
7655b425557eSmrg    [Whether we need a single "-rpath" flag with a separated argument])
7656b425557eSmrg_LT_TAGDECL([], [hardcode_direct], [0],
7657b425557eSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
7658b425557eSmrg    DIR into the resulting binary])
7659b425557eSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
7660b425557eSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
7661b425557eSmrg    DIR into the resulting binary and the resulting library dependency is
7662b425557eSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
7663b425557eSmrg    library is relocated])
7664b425557eSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
7665b425557eSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
7666b425557eSmrg    into the resulting binary])
7667b425557eSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
7668b425557eSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
7669b425557eSmrg    into the resulting binary])
7670b425557eSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
7671b425557eSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
7672b425557eSmrg    into the library and all subsequent libraries and executables linked
7673b425557eSmrg    against it])
7674b425557eSmrg_LT_TAGDECL([], [inherit_rpath], [0],
7675b425557eSmrg    [Set to yes if linker adds runtime paths of dependent libraries
7676b425557eSmrg    to runtime path list])
7677b425557eSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
7678b425557eSmrg    [Whether libtool must link a program against all its dependency libraries])
7679b425557eSmrg_LT_TAGDECL([], [fix_srcfile_path], [1],
7680b425557eSmrg    [Fix the shell variable $srcfile for the compiler])
7681b425557eSmrg_LT_TAGDECL([], [always_export_symbols], [0],
7682b425557eSmrg    [Set to "yes" if exported symbols are required])
7683b425557eSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
7684b425557eSmrg    [The commands to list exported symbols])
7685b425557eSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
7686b425557eSmrg    [Symbols that should not be listed in the preloaded symbols])
7687b425557eSmrg_LT_TAGDECL([], [include_expsyms], [1],
7688b425557eSmrg    [Symbols that must always be exported])
7689b425557eSmrg_LT_TAGDECL([], [prelink_cmds], [2],
7690b425557eSmrg    [Commands necessary for linking programs (against libraries) with templates])
7691b425557eSmrg_LT_TAGDECL([], [file_list_spec], [1],
7692b425557eSmrg    [Specify filename containing input files])
7693b425557eSmrgdnl FIXME: Not yet implemented
7694b425557eSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
7695b425557eSmrgdnl    [Compiler flag to generate thread safe objects])
7696b425557eSmrg])# _LT_LINKER_SHLIBS
7697ee3138f1Smrg
7698ee3138f1Smrg
7699b425557eSmrg# _LT_LANG_C_CONFIG([TAG])
7700b425557eSmrg# ------------------------
7701b425557eSmrg# Ensure that the configuration variables for a C compiler are suitably
7702b425557eSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
7703b425557eSmrg# the compiler configuration to `libtool'.
7704b425557eSmrgm4_defun([_LT_LANG_C_CONFIG],
7705b425557eSmrg[m4_require([_LT_DECL_EGREP])dnl
7706b425557eSmrglt_save_CC="$CC"
7707b425557eSmrgAC_LANG_PUSH(C)
7708ee3138f1Smrg
7709b425557eSmrg# Source file extension for C test sources.
7710b425557eSmrgac_ext=c
7711ee3138f1Smrg
7712b425557eSmrg# Object file extension for compiled C test sources.
771334977a2fSmrgobjext=o
771434977a2fSmrg_LT_TAGVAR(objext, $1)=$objext
7715ee3138f1Smrg
771634977a2fSmrg# Code to be used in simple compile tests
7717b425557eSmrglt_simple_compile_test_code="int some_variable = 0;"
7718ee3138f1Smrg
771934977a2fSmrg# Code to be used in simple link tests
7720b425557eSmrglt_simple_link_test_code='int main(){return(0);}'
7721ee3138f1Smrg
772234977a2fSmrg_LT_TAG_COMPILER
7723b425557eSmrg# Save the default compiler, since it gets overwritten when the other
7724b425557eSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
7725b425557eSmrgcompiler_DEFAULT=$CC
7726ee3138f1Smrg
772734977a2fSmrg# save warnings/boilerplate of simple test code
772834977a2fSmrg_LT_COMPILER_BOILERPLATE
772934977a2fSmrg_LT_LINKER_BOILERPLATE
7730ee3138f1Smrg
773134977a2fSmrgif test -n "$compiler"; then
7732b425557eSmrg  _LT_COMPILER_NO_RTTI($1)
7733b425557eSmrg  _LT_COMPILER_PIC($1)
7734b425557eSmrg  _LT_COMPILER_C_O($1)
7735b425557eSmrg  _LT_COMPILER_FILE_LOCKS($1)
7736b425557eSmrg  _LT_LINKER_SHLIBS($1)
7737b425557eSmrg  _LT_SYS_DYNAMIC_LINKER($1)
7738b425557eSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7739b425557eSmrg  LT_SYS_DLOPEN_SELF
7740b425557eSmrg  _LT_CMD_STRIPLIB
7741ee3138f1Smrg
7742b425557eSmrg  # Report which library types will actually be built
7743b425557eSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
7744b425557eSmrg  AC_MSG_RESULT([$can_build_shared])
774534977a2fSmrg
7746b425557eSmrg  AC_MSG_CHECKING([whether to build shared libraries])
7747b425557eSmrg  test "$can_build_shared" = "no" && enable_shared=no
774834977a2fSmrg
7749b425557eSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
7750b425557eSmrg  # are all built from PIC.
7751b425557eSmrg  case $host_os in
7752b425557eSmrg  aix3*)
7753b425557eSmrg    test "$enable_shared" = yes && enable_static=no
7754b425557eSmrg    if test -n "$RANLIB"; then
7755b425557eSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
7756b425557eSmrg      postinstall_cmds='$RANLIB $lib'
7757ee3138f1Smrg    fi
7758b425557eSmrg    ;;
775934977a2fSmrg
7760b425557eSmrg  aix[[4-9]]*)
7761b425557eSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7762b425557eSmrg      test "$enable_shared" = yes && enable_static=no
7763b425557eSmrg    fi
7764b425557eSmrg    ;;
7765ee3138f1Smrg  esac
7766b425557eSmrg  AC_MSG_RESULT([$enable_shared])
7767b425557eSmrg
7768b425557eSmrg  AC_MSG_CHECKING([whether to build static libraries])
7769b425557eSmrg  # Make sure either enable_shared or enable_static is yes.
7770b425557eSmrg  test "$enable_shared" = yes || enable_static=yes
7771b425557eSmrg  AC_MSG_RESULT([$enable_static])
7772ee3138f1Smrg
7773b425557eSmrg  _LT_CONFIG($1)
7774b425557eSmrgfi
7775b425557eSmrgAC_LANG_POP
7776b425557eSmrgCC="$lt_save_CC"
7777b425557eSmrg])# _LT_LANG_C_CONFIG
7778ee3138f1Smrg
7779ee3138f1Smrg
7780b425557eSmrg# _LT_LANG_CXX_CONFIG([TAG])
7781b425557eSmrg# --------------------------
7782b425557eSmrg# Ensure that the configuration variables for a C++ compiler are suitably
7783b425557eSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
7784b425557eSmrg# the compiler configuration to `libtool'.
7785b425557eSmrgm4_defun([_LT_LANG_CXX_CONFIG],
7786b425557eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7787b425557eSmrgm4_require([_LT_DECL_EGREP])dnl
7788b425557eSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
7789b425557eSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
7790b425557eSmrg    (test "X$CXX" != "Xg++"))) ; then
7791b425557eSmrg  AC_PROG_CXXCPP
7792b425557eSmrgelse
7793b425557eSmrg  _lt_caught_CXX_error=yes
7794b425557eSmrgfi
7795ee3138f1Smrg
7796b425557eSmrgAC_LANG_PUSH(C++)
7797b425557eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7798b425557eSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7799b425557eSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7800b425557eSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7801b425557eSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
7802b425557eSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7803b425557eSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7804b425557eSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7805b425557eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7806b425557eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
7807b425557eSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7808b425557eSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7809b425557eSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
7810b425557eSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7811b425557eSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7812b425557eSmrg_LT_TAGVAR(module_cmds, $1)=
7813b425557eSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7814b425557eSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7815b425557eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7816b425557eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7817b425557eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7818b425557eSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7819b425557eSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7820b425557eSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7821ee3138f1Smrg
7822b425557eSmrg# Source file extension for C++ test sources.
7823b425557eSmrgac_ext=cpp
7824ee3138f1Smrg
7825b425557eSmrg# Object file extension for compiled C++ test sources.
7826b425557eSmrgobjext=o
7827b425557eSmrg_LT_TAGVAR(objext, $1)=$objext
7828ee3138f1Smrg
7829b425557eSmrg# No sense in running all these tests if we already determined that
7830b425557eSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
7831b425557eSmrg# are currently assumed to apply to all compilers on this platform,
7832b425557eSmrg# and will be corrupted by setting them based on a non-working compiler.
7833b425557eSmrgif test "$_lt_caught_CXX_error" != yes; then
7834b425557eSmrg  # Code to be used in simple compile tests
7835b425557eSmrg  lt_simple_compile_test_code="int some_variable = 0;"
7836ee3138f1Smrg
7837b425557eSmrg  # Code to be used in simple link tests
7838b425557eSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
7839ee3138f1Smrg
7840b425557eSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7841b425557eSmrg  _LT_TAG_COMPILER
7842ee3138f1Smrg
7843b425557eSmrg  # save warnings/boilerplate of simple test code
7844b425557eSmrg  _LT_COMPILER_BOILERPLATE
7845b425557eSmrg  _LT_LINKER_BOILERPLATE
7846b425557eSmrg
7847b425557eSmrg  # Allow CC to be a program name with arguments.
7848b425557eSmrg  lt_save_CC=$CC
7849b425557eSmrg  lt_save_LD=$LD
7850b425557eSmrg  lt_save_GCC=$GCC
7851b425557eSmrg  GCC=$GXX
7852b425557eSmrg  lt_save_with_gnu_ld=$with_gnu_ld
7853b425557eSmrg  lt_save_path_LD=$lt_cv_path_LD
7854b425557eSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
7855b425557eSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
785634977a2fSmrg  else
7857b425557eSmrg    $as_unset lt_cv_prog_gnu_ld
785834977a2fSmrg  fi
7859b425557eSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
7860b425557eSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
7861b425557eSmrg  else
7862b425557eSmrg    $as_unset lt_cv_path_LD
7863b425557eSmrg  fi
7864b425557eSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
7865b425557eSmrg  CC=${CXX-"c++"}
7866b425557eSmrg  compiler=$CC
7867b425557eSmrg  _LT_TAGVAR(compiler, $1)=$CC
7868b425557eSmrg  _LT_CC_BASENAME([$compiler])
7869ee3138f1Smrg
7870b425557eSmrg  if test -n "$compiler"; then
7871b425557eSmrg    # We don't want -fno-exception when compiling C++ code, so set the
7872b425557eSmrg    # no_builtin_flag separately
7873b425557eSmrg    if test "$GXX" = yes; then
7874b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7875b425557eSmrg    else
7876b425557eSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7877b425557eSmrg    fi
7878ee3138f1Smrg
7879b425557eSmrg    if test "$GXX" = yes; then
7880b425557eSmrg      # Set up default GNU C++ configuration
788134977a2fSmrg
7882b425557eSmrg      LT_PATH_LD
7883ee3138f1Smrg
7884b425557eSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
7885b425557eSmrg      # archiving commands below assume that GNU ld is being used.
7886b425557eSmrg      if test "$with_gnu_ld" = yes; then
7887b425557eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7888b425557eSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7889ee3138f1Smrg
7890b425557eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7891b425557eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7892ee3138f1Smrg
7893b425557eSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
7894b425557eSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
7895b425557eSmrg        #     investigate it a little bit more. (MM)
7896b425557eSmrg        wlarc='${wl}'
7897ee3138f1Smrg
7898b425557eSmrg        # ancient GNU ld didn't support --whole-archive et. al.
7899b425557eSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
7900b425557eSmrg	  $GREP 'no-whole-archive' > /dev/null; then
7901b425557eSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7902b425557eSmrg        else
7903b425557eSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
7904b425557eSmrg        fi
7905b425557eSmrg      else
7906b425557eSmrg        with_gnu_ld=no
7907b425557eSmrg        wlarc=
7908ee3138f1Smrg
7909b425557eSmrg        # A generic and very simple default shared library creation
7910b425557eSmrg        # command for GNU C++ for the case where it uses the native
7911b425557eSmrg        # linker, instead of GNU ld.  If possible, this setting should
7912b425557eSmrg        # overridden to take advantage of the native linker features on
7913b425557eSmrg        # the platform it is being used on.
7914b425557eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7915b425557eSmrg      fi
7916ee3138f1Smrg
7917b425557eSmrg      # Commands to make compiler produce verbose output that lists
7918b425557eSmrg      # what "hidden" libraries, object files and flags are used when
7919b425557eSmrg      # linking a shared library.
7920b425557eSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7921b425557eSmrg
7922b425557eSmrg    else
7923b425557eSmrg      GXX=no
7924b425557eSmrg      with_gnu_ld=no
7925b425557eSmrg      wlarc=
7926b425557eSmrg    fi
7927ee3138f1Smrg
7928b425557eSmrg    # PORTME: fill in a description of your system's C++ link characteristics
7929b425557eSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7930b425557eSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
7931b425557eSmrg    case $host_os in
7932b425557eSmrg      aix3*)
7933b425557eSmrg        # FIXME: insert proper C++ library support
7934b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7935b425557eSmrg        ;;
7936b425557eSmrg      aix[[4-9]]*)
7937b425557eSmrg        if test "$host_cpu" = ia64; then
7938b425557eSmrg          # On IA64, the linker does run time linking by default, so we don't
7939b425557eSmrg          # have to do anything special.
7940b425557eSmrg          aix_use_runtimelinking=no
7941b425557eSmrg          exp_sym_flag='-Bexport'
7942b425557eSmrg          no_entry_flag=""
7943b425557eSmrg        else
7944b425557eSmrg          aix_use_runtimelinking=no
7945ee3138f1Smrg
7946b425557eSmrg          # Test if we are trying to use run time linking or normal
7947b425557eSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7948b425557eSmrg          # need to do runtime linking.
7949b425557eSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7950b425557eSmrg	    for ld_flag in $LDFLAGS; do
7951b425557eSmrg	      case $ld_flag in
7952b425557eSmrg	      *-brtl*)
7953b425557eSmrg	        aix_use_runtimelinking=yes
7954b425557eSmrg	        break
7955b425557eSmrg	        ;;
7956b425557eSmrg	      esac
7957b425557eSmrg	    done
7958b425557eSmrg	    ;;
7959b425557eSmrg          esac
7960ee3138f1Smrg
7961b425557eSmrg          exp_sym_flag='-bexport'
7962b425557eSmrg          no_entry_flag='-bnoentry'
7963b425557eSmrg        fi
7964ee3138f1Smrg
7965b425557eSmrg        # When large executables or shared objects are built, AIX ld can
7966b425557eSmrg        # have problems creating the table of contents.  If linking a library
7967b425557eSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
7968b425557eSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7969b425557eSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7970ee3138f1Smrg
7971b425557eSmrg        _LT_TAGVAR(archive_cmds, $1)=''
7972b425557eSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
7973b425557eSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7974b425557eSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7975b425557eSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
7976b425557eSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7977ee3138f1Smrg
7978b425557eSmrg        if test "$GXX" = yes; then
7979b425557eSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7980b425557eSmrg          # We only want to do this on AIX 4.2 and lower, the check
7981b425557eSmrg          # below for broken collect2 doesn't work under 4.3+
7982b425557eSmrg	  collect2name=`${CC} -print-prog-name=collect2`
7983b425557eSmrg	  if test -f "$collect2name" &&
7984b425557eSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7985b425557eSmrg	  then
7986b425557eSmrg	    # We have reworked collect2
7987b425557eSmrg	    :
7988b425557eSmrg	  else
7989b425557eSmrg	    # We have old collect2
7990b425557eSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7991b425557eSmrg	    # It fails to find uninstalled libraries when the uninstalled
7992b425557eSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
7993b425557eSmrg	    # to unsupported forces relinking
7994b425557eSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7995b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7996b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7997b425557eSmrg	  fi
7998b425557eSmrg          esac
7999b425557eSmrg          shared_flag='-shared'
8000b425557eSmrg	  if test "$aix_use_runtimelinking" = yes; then
8001b425557eSmrg	    shared_flag="$shared_flag "'${wl}-G'
8002b425557eSmrg	  fi
8003b425557eSmrg        else
8004b425557eSmrg          # not using gcc
8005b425557eSmrg          if test "$host_cpu" = ia64; then
8006b425557eSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8007b425557eSmrg	  # chokes on -Wl,-G. The following line is correct:
8008b425557eSmrg	  shared_flag='-G'
8009b425557eSmrg          else
8010b425557eSmrg	    if test "$aix_use_runtimelinking" = yes; then
8011b425557eSmrg	      shared_flag='${wl}-G'
8012b425557eSmrg	    else
8013b425557eSmrg	      shared_flag='${wl}-bM:SRE'
8014b425557eSmrg	    fi
8015b425557eSmrg          fi
8016b425557eSmrg        fi
8017ee3138f1Smrg
8018b425557eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
8019b425557eSmrg        # It seems that -bexpall does not export symbols beginning with
8020b425557eSmrg        # underscore (_), so it is better to generate a list of symbols to
8021b425557eSmrg	# export.
8022b425557eSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
8023b425557eSmrg        if test "$aix_use_runtimelinking" = yes; then
8024b425557eSmrg          # Warning - without using the other runtime loading flags (-brtl),
8025b425557eSmrg          # -berok will link without error, but may produce a broken library.
8026b425557eSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
8027b425557eSmrg          # Determine the default libpath from the value encoded in an empty
8028b425557eSmrg          # executable.
8029b425557eSmrg          _LT_SYS_MODULE_PATH_AIX
8030b425557eSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8031ee3138f1Smrg
8032b425557eSmrg          _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"
8033b425557eSmrg        else
8034b425557eSmrg          if test "$host_cpu" = ia64; then
8035b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
8036b425557eSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8037b425557eSmrg	    _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"
8038b425557eSmrg          else
8039b425557eSmrg	    # Determine the default libpath from the value encoded in an
8040b425557eSmrg	    # empty executable.
8041b425557eSmrg	    _LT_SYS_MODULE_PATH_AIX
8042b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8043b425557eSmrg	    # Warning - without using the other run time loading flags,
8044b425557eSmrg	    # -berok will link without error, but may produce a broken library.
8045b425557eSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
8046b425557eSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
8047b425557eSmrg	    if test "$with_gnu_ld" = yes; then
8048b425557eSmrg	      # We only use this code for GNU lds that support --whole-archive.
8049b425557eSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
8050b425557eSmrg	    else
8051b425557eSmrg	      # Exported symbols can be pulled into shared objects from archives
8052b425557eSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
8053b425557eSmrg	    fi
8054b425557eSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
8055b425557eSmrg	    # This is similar to how AIX traditionally builds its shared
8056b425557eSmrg	    # libraries.
8057b425557eSmrg	    _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'
8058b425557eSmrg          fi
8059b425557eSmrg        fi
8060b425557eSmrg        ;;
8061ee3138f1Smrg
8062b425557eSmrg      beos*)
8063b425557eSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8064b425557eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8065b425557eSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8066b425557eSmrg	  # support --undefined.  This deserves some investigation.  FIXME
8067b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8068b425557eSmrg	else
8069b425557eSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
8070b425557eSmrg	fi
8071b425557eSmrg	;;
8072ee3138f1Smrg
8073b425557eSmrg      chorus*)
8074b425557eSmrg        case $cc_basename in
8075b425557eSmrg          *)
8076b425557eSmrg	  # FIXME: insert proper C++ library support
8077b425557eSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
8078b425557eSmrg	  ;;
8079b425557eSmrg        esac
8080b425557eSmrg        ;;
8081ee3138f1Smrg
8082b425557eSmrg      cygwin* | mingw* | pw32* | cegcc*)
8083b425557eSmrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
8084b425557eSmrg        # as there is no search path for DLLs.
8085b425557eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8086b425557eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
8087b425557eSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8088b425557eSmrg        _LT_TAGVAR(always_export_symbols, $1)=no
8089b425557eSmrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8090ee3138f1Smrg
8091b425557eSmrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8092b425557eSmrg          _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'
8093b425557eSmrg          # If the export-symbols file already is a .def file (1st line
8094b425557eSmrg          # is EXPORTS), use it as is; otherwise, prepend...
8095b425557eSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8096b425557eSmrg	    cp $export_symbols $output_objdir/$soname.def;
8097b425557eSmrg          else
8098b425557eSmrg	    echo EXPORTS > $output_objdir/$soname.def;
8099b425557eSmrg	    cat $export_symbols >> $output_objdir/$soname.def;
8100b425557eSmrg          fi~
8101b425557eSmrg          $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'
8102b425557eSmrg        else
8103b425557eSmrg          _LT_TAGVAR(ld_shlibs, $1)=no
8104b425557eSmrg        fi
8105b425557eSmrg        ;;
8106b425557eSmrg      darwin* | rhapsody*)
8107b425557eSmrg        _LT_DARWIN_LINKER_FEATURES($1)
8108b425557eSmrg	;;
8109ee3138f1Smrg
8110b425557eSmrg      dgux*)
8111b425557eSmrg        case $cc_basename in
8112b425557eSmrg          ec++*)
8113b425557eSmrg	    # FIXME: insert proper C++ library support
8114b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8115b425557eSmrg	    ;;
8116b425557eSmrg          ghcx*)
8117b425557eSmrg	    # Green Hills C++ Compiler
8118b425557eSmrg	    # FIXME: insert proper C++ library support
8119b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8120b425557eSmrg	    ;;
8121b425557eSmrg          *)
8122b425557eSmrg	    # FIXME: insert proper C++ library support
8123b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8124b425557eSmrg	    ;;
8125b425557eSmrg        esac
8126b425557eSmrg        ;;
8127ee3138f1Smrg
8128b425557eSmrg      freebsd[[12]]*)
8129b425557eSmrg        # C++ shared libraries reported to be fairly broken before
8130b425557eSmrg	# switch to ELF
8131b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
8132b425557eSmrg        ;;
813334977a2fSmrg
8134b425557eSmrg      freebsd-elf*)
8135b425557eSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8136b425557eSmrg        ;;
813734977a2fSmrg
8138b425557eSmrg      freebsd* | dragonfly*)
8139b425557eSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
8140b425557eSmrg        # conventions
8141b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
8142b425557eSmrg        ;;
8143ee3138f1Smrg
8144b425557eSmrg      gnu*)
8145b425557eSmrg        ;;
8146ee3138f1Smrg
8147b425557eSmrg      haiku*)
8148b425557eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8149b425557eSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
8150b425557eSmrg        ;;
815134977a2fSmrg
8152b425557eSmrg      hpux9*)
8153b425557eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8154b425557eSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8155b425557eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8156b425557eSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
8157b425557eSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8158b425557eSmrg				             # but as the default
8159b425557eSmrg				             # location of the library.
8160ee3138f1Smrg
8161b425557eSmrg        case $cc_basename in
8162b425557eSmrg          CC*)
8163b425557eSmrg            # FIXME: insert proper C++ library support
8164b425557eSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
8165b425557eSmrg            ;;
8166b425557eSmrg          aCC*)
8167b425557eSmrg            _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'
8168b425557eSmrg            # Commands to make compiler produce verbose output that lists
8169b425557eSmrg            # what "hidden" libraries, object files and flags are used when
8170b425557eSmrg            # linking a shared library.
8171b425557eSmrg            #
8172b425557eSmrg            # There doesn't appear to be a way to prevent this compiler from
8173b425557eSmrg            # explicitly linking system object files so we need to strip them
8174b425557eSmrg            # from the output so that they don't get included in the library
8175b425557eSmrg            # dependencies.
8176b425557eSmrg            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"'
8177b425557eSmrg            ;;
8178b425557eSmrg          *)
8179b425557eSmrg            if test "$GXX" = yes; then
8180b425557eSmrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8181b425557eSmrg            else
8182b425557eSmrg              # FIXME: insert proper C++ library support
8183b425557eSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
8184b425557eSmrg            fi
8185b425557eSmrg            ;;
8186b425557eSmrg        esac
8187b425557eSmrg        ;;
8188ee3138f1Smrg
8189b425557eSmrg      hpux10*|hpux11*)
8190b425557eSmrg        if test $with_gnu_ld = no; then
8191b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8192b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8193ee3138f1Smrg
8194b425557eSmrg          case $host_cpu in
8195b425557eSmrg            hppa*64*|ia64*)
8196b425557eSmrg              ;;
8197b425557eSmrg            *)
8198b425557eSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8199b425557eSmrg              ;;
8200b425557eSmrg          esac
8201b425557eSmrg        fi
8202b425557eSmrg        case $host_cpu in
8203b425557eSmrg          hppa*64*|ia64*)
8204b425557eSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
8205b425557eSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8206b425557eSmrg            ;;
8207b425557eSmrg          *)
8208b425557eSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
8209b425557eSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8210b425557eSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8211b425557eSmrg					         # but as the default
8212b425557eSmrg					         # location of the library.
8213b425557eSmrg            ;;
8214b425557eSmrg        esac
8215ee3138f1Smrg
8216b425557eSmrg        case $cc_basename in
8217b425557eSmrg          CC*)
8218b425557eSmrg	    # FIXME: insert proper C++ library support
8219b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8220b425557eSmrg	    ;;
8221b425557eSmrg          aCC*)
8222b425557eSmrg	    case $host_cpu in
8223b425557eSmrg	      hppa*64*)
8224b425557eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8225b425557eSmrg	        ;;
8226b425557eSmrg	      ia64*)
8227b425557eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8228b425557eSmrg	        ;;
8229b425557eSmrg	      *)
8230b425557eSmrg	        _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'
8231b425557eSmrg	        ;;
8232b425557eSmrg	    esac
8233b425557eSmrg	    # Commands to make compiler produce verbose output that lists
8234b425557eSmrg	    # what "hidden" libraries, object files and flags are used when
8235b425557eSmrg	    # linking a shared library.
8236b425557eSmrg	    #
8237b425557eSmrg	    # There doesn't appear to be a way to prevent this compiler from
8238b425557eSmrg	    # explicitly linking system object files so we need to strip them
8239b425557eSmrg	    # from the output so that they don't get included in the library
8240b425557eSmrg	    # dependencies.
8241b425557eSmrg	    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"'
8242b425557eSmrg	    ;;
8243b425557eSmrg          *)
8244b425557eSmrg	    if test "$GXX" = yes; then
8245b425557eSmrg	      if test $with_gnu_ld = no; then
8246b425557eSmrg	        case $host_cpu in
8247b425557eSmrg	          hppa*64*)
8248b425557eSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8249b425557eSmrg	            ;;
8250b425557eSmrg	          ia64*)
8251b425557eSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8252b425557eSmrg	            ;;
8253b425557eSmrg	          *)
8254b425557eSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8255b425557eSmrg	            ;;
8256b425557eSmrg	        esac
8257b425557eSmrg	      fi
8258b425557eSmrg	    else
8259b425557eSmrg	      # FIXME: insert proper C++ library support
8260b425557eSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
8261b425557eSmrg	    fi
8262b425557eSmrg	    ;;
8263b425557eSmrg        esac
8264b425557eSmrg        ;;
8265ee3138f1Smrg
8266b425557eSmrg      interix[[3-9]]*)
8267b425557eSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
8268b425557eSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8269b425557eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8270b425557eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8271b425557eSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8272b425557eSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
8273b425557eSmrg	# default) and relocated if they conflict, which is a slow very memory
8274b425557eSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
8275b425557eSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8276b425557eSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
8277b425557eSmrg	_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'
8278b425557eSmrg	_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'
8279b425557eSmrg	;;
8280b425557eSmrg      irix5* | irix6*)
8281b425557eSmrg        case $cc_basename in
8282b425557eSmrg          CC*)
8283b425557eSmrg	    # SGI C++
8284b425557eSmrg	    _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'
8285ee3138f1Smrg
8286b425557eSmrg	    # Archives containing C++ object files must be created using
8287b425557eSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
8288b425557eSmrg	    # necessary to make sure instantiated templates are included
8289b425557eSmrg	    # in the archive.
8290b425557eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
8291b425557eSmrg	    ;;
8292b425557eSmrg          *)
8293b425557eSmrg	    if test "$GXX" = yes; then
8294b425557eSmrg	      if test "$with_gnu_ld" = no; then
8295b425557eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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'
8296b425557eSmrg	      else
8297b425557eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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'
8298b425557eSmrg	      fi
8299b425557eSmrg	    fi
8300b425557eSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
8301b425557eSmrg	    ;;
8302b425557eSmrg        esac
8303b425557eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8304b425557eSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8305b425557eSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
8306b425557eSmrg        ;;
8307ee3138f1Smrg
8308b425557eSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
8309b425557eSmrg        case $cc_basename in
8310b425557eSmrg          KCC*)
8311b425557eSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
8312ee3138f1Smrg
8313b425557eSmrg	    # KCC will only create a shared library if the output file
8314b425557eSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
8315b425557eSmrg	    # to its proper name (with version) after linking.
8316b425557eSmrg	    _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'
8317b425557eSmrg	    _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'
8318b425557eSmrg	    # Commands to make compiler produce verbose output that lists
8319b425557eSmrg	    # what "hidden" libraries, object files and flags are used when
8320b425557eSmrg	    # linking a shared library.
8321b425557eSmrg	    #
8322b425557eSmrg	    # There doesn't appear to be a way to prevent this compiler from
8323b425557eSmrg	    # explicitly linking system object files so we need to strip them
8324b425557eSmrg	    # from the output so that they don't get included in the library
8325b425557eSmrg	    # dependencies.
8326b425557eSmrg	    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"'
8327ee3138f1Smrg
8328b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8329b425557eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8330ee3138f1Smrg
8331b425557eSmrg	    # Archives containing C++ object files must be created using
8332b425557eSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
8333b425557eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
8334b425557eSmrg	    ;;
8335b425557eSmrg	  icpc* | ecpc* )
8336b425557eSmrg	    # Intel C++
8337b425557eSmrg	    with_gnu_ld=yes
8338b425557eSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
8339b425557eSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
8340b425557eSmrg	    # earlier do not add the objects themselves.
8341b425557eSmrg	    case `$CC -V 2>&1` in
8342b425557eSmrg	      *"Version 7."*)
8343b425557eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
8344b425557eSmrg		_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'
8345b425557eSmrg		;;
8346b425557eSmrg	      *)  # Version 8.0 or newer
8347b425557eSmrg	        tmp_idyn=
8348b425557eSmrg	        case $host_cpu in
8349b425557eSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
8350b425557eSmrg		esac
8351b425557eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8352b425557eSmrg		_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'
8353b425557eSmrg		;;
8354b425557eSmrg	    esac
8355b425557eSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8356b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8357b425557eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8358b425557eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
8359b425557eSmrg	    ;;
8360b425557eSmrg          pgCC* | pgcpp*)
8361b425557eSmrg            # Portland Group C++ compiler
8362b425557eSmrg	    case `$CC -V` in
8363b425557eSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
8364b425557eSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
8365b425557eSmrg		rm -rf $tpldir~
8366b425557eSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
8367b425557eSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
8368b425557eSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
8369b425557eSmrg		rm -rf $tpldir~
8370b425557eSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
8371b425557eSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
8372b425557eSmrg		$RANLIB $oldlib'
8373b425557eSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
8374b425557eSmrg		rm -rf $tpldir~
8375b425557eSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
8376b425557eSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
8377b425557eSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
8378b425557eSmrg		rm -rf $tpldir~
8379b425557eSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
8380b425557eSmrg		$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'
8381b425557eSmrg	      ;;
8382b425557eSmrg	    *) # Version 6 and above use weak symbols
8383b425557eSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
8384b425557eSmrg	      _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'
8385b425557eSmrg	      ;;
8386b425557eSmrg	    esac
8387ee3138f1Smrg
8388b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
8389b425557eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8390b425557eSmrg	    _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'
8391b425557eSmrg            ;;
8392b425557eSmrg	  cxx*)
8393b425557eSmrg	    # Compaq C++
8394b425557eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
8395b425557eSmrg	    _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'
8396ee3138f1Smrg
8397b425557eSmrg	    runpath_var=LD_RUN_PATH
8398b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8399b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8400ee3138f1Smrg
8401b425557eSmrg	    # Commands to make compiler produce verbose output that lists
8402b425557eSmrg	    # what "hidden" libraries, object files and flags are used when
8403b425557eSmrg	    # linking a shared library.
8404b425557eSmrg	    #
8405b425557eSmrg	    # There doesn't appear to be a way to prevent this compiler from
8406b425557eSmrg	    # explicitly linking system object files so we need to strip them
8407b425557eSmrg	    # from the output so that they don't get included in the library
8408b425557eSmrg	    # dependencies.
8409b425557eSmrg	    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'
8410b425557eSmrg	    ;;
8411b425557eSmrg	  xl* | mpixl* | bgxl*)
8412b425557eSmrg	    # IBM XL 8.0 on PPC, with GNU ld
8413b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8414b425557eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8415b425557eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8416b425557eSmrg	    if test "x$supports_anon_versioning" = xyes; then
8417b425557eSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8418b425557eSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8419b425557eSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
8420b425557eSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8421b425557eSmrg	    fi
8422b425557eSmrg	    ;;
8423b425557eSmrg	  *)
8424b425557eSmrg	    case `$CC -V 2>&1 | sed 5q` in
8425b425557eSmrg	    *Sun\ C*)
8426b425557eSmrg	      # Sun C++ 5.9
8427b425557eSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
8428b425557eSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8429b425557eSmrg	      _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'
8430b425557eSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8431b425557eSmrg	      _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'
8432b425557eSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
8433ee3138f1Smrg
8434b425557eSmrg	      # Not sure whether something based on
8435b425557eSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
8436b425557eSmrg	      # would be better.
8437b425557eSmrg	      output_verbose_link_cmd='func_echo_all'
8438ee3138f1Smrg
8439b425557eSmrg	      # Archives containing C++ object files must be created using
8440b425557eSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
8441b425557eSmrg	      # necessary to make sure instantiated templates are included
8442b425557eSmrg	      # in the archive.
8443b425557eSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
8444b425557eSmrg	      ;;
8445b425557eSmrg	    esac
8446b425557eSmrg	    ;;
8447b425557eSmrg	esac
8448b425557eSmrg	;;
8449ee3138f1Smrg
8450b425557eSmrg      lynxos*)
8451b425557eSmrg        # FIXME: insert proper C++ library support
8452b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8453b425557eSmrg	;;
8454ee3138f1Smrg
8455b425557eSmrg      m88k*)
8456b425557eSmrg        # FIXME: insert proper C++ library support
8457b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
8458b425557eSmrg	;;
8459ee3138f1Smrg
8460b425557eSmrg      mvs*)
8461b425557eSmrg        case $cc_basename in
8462b425557eSmrg          cxx*)
8463b425557eSmrg	    # FIXME: insert proper C++ library support
8464b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8465b425557eSmrg	    ;;
8466b425557eSmrg	  *)
8467b425557eSmrg	    # FIXME: insert proper C++ library support
8468b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8469b425557eSmrg	    ;;
8470b425557eSmrg	esac
8471b425557eSmrg	;;
8472ee3138f1Smrg
8473b425557eSmrg      netbsd*)
8474b425557eSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8475b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
8476b425557eSmrg	  wlarc=
8477b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8478b425557eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
8479b425557eSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
848034977a2fSmrg	fi
8481b425557eSmrg	# Workaround some broken pre-1.5 toolchains
8482b425557eSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
8483b425557eSmrg	;;
848434977a2fSmrg
8485b425557eSmrg      *nto* | *qnx*)
8486b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
8487b425557eSmrg	;;
848834977a2fSmrg
8489b425557eSmrg      openbsd2*)
8490b425557eSmrg        # C++ shared libraries are fairly broken
8491b425557eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8492b425557eSmrg	;;
849334977a2fSmrg
8494b425557eSmrg      openbsd*)
8495b425557eSmrg	if test -f /usr/libexec/ld.so; then
8496b425557eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
8497b425557eSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8498b425557eSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8499b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
8500b425557eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8501b425557eSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8502b425557eSmrg	    _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'
8503b425557eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8504b425557eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8505b425557eSmrg	  fi
8506b425557eSmrg	  output_verbose_link_cmd=func_echo_all
8507b425557eSmrg	else
8508b425557eSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
8509b425557eSmrg	fi
8510b425557eSmrg	;;
851134977a2fSmrg
8512b425557eSmrg      osf3* | osf4* | osf5*)
8513b425557eSmrg        case $cc_basename in
8514b425557eSmrg          KCC*)
8515b425557eSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
851634977a2fSmrg
8517b425557eSmrg	    # KCC will only create a shared library if the output file
8518b425557eSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
8519b425557eSmrg	    # to its proper name (with version) after linking.
8520b425557eSmrg	    _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'
852134977a2fSmrg
8522b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8523b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8524ee3138f1Smrg
8525b425557eSmrg	    # Archives containing C++ object files must be created using
8526b425557eSmrg	    # the KAI C++ compiler.
8527b425557eSmrg	    case $host in
8528b425557eSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
8529b425557eSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
8530b425557eSmrg	    esac
8531b425557eSmrg	    ;;
8532b425557eSmrg          RCC*)
8533b425557eSmrg	    # Rational C++ 2.4.1
8534b425557eSmrg	    # FIXME: insert proper C++ library support
8535b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8536b425557eSmrg	    ;;
8537b425557eSmrg          cxx*)
8538b425557eSmrg	    case $host in
8539b425557eSmrg	      osf3*)
8540b425557eSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8541b425557eSmrg	        _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'
8542b425557eSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8543b425557eSmrg		;;
8544b425557eSmrg	      *)
8545b425557eSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8546b425557eSmrg	        _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'
8547b425557eSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
8548b425557eSmrg	          echo "-hidden">> $lib.exp~
8549b425557eSmrg	          $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~
8550b425557eSmrg	          $RM $lib.exp'
8551b425557eSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8552b425557eSmrg		;;
8553b425557eSmrg	    esac
855434977a2fSmrg
8555b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
855634977a2fSmrg
8557b425557eSmrg	    # Commands to make compiler produce verbose output that lists
8558b425557eSmrg	    # what "hidden" libraries, object files and flags are used when
8559b425557eSmrg	    # linking a shared library.
8560b425557eSmrg	    #
8561b425557eSmrg	    # There doesn't appear to be a way to prevent this compiler from
8562b425557eSmrg	    # explicitly linking system object files so we need to strip them
8563b425557eSmrg	    # from the output so that they don't get included in the library
8564b425557eSmrg	    # dependencies.
8565b425557eSmrg	    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"'
8566b425557eSmrg	    ;;
8567b425557eSmrg	  *)
8568b425557eSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8569b425557eSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8570b425557eSmrg	      case $host in
8571b425557eSmrg	        osf3*)
8572b425557eSmrg	          _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'
8573b425557eSmrg		  ;;
8574b425557eSmrg	        *)
8575b425557eSmrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8576b425557eSmrg		  ;;
8577b425557eSmrg	      esac
857834977a2fSmrg
8579b425557eSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8580b425557eSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
858134977a2fSmrg
8582b425557eSmrg	      # Commands to make compiler produce verbose output that lists
8583b425557eSmrg	      # what "hidden" libraries, object files and flags are used when
8584b425557eSmrg	      # linking a shared library.
8585b425557eSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
858634977a2fSmrg
8587b425557eSmrg	    else
8588b425557eSmrg	      # FIXME: insert proper C++ library support
8589b425557eSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
8590b425557eSmrg	    fi
8591b425557eSmrg	    ;;
8592b425557eSmrg        esac
8593b425557eSmrg        ;;
859434977a2fSmrg
8595b425557eSmrg      psos*)
8596b425557eSmrg        # FIXME: insert proper C++ library support
8597b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
8598b425557eSmrg        ;;
859934977a2fSmrg
8600b425557eSmrg      sunos4*)
8601b425557eSmrg        case $cc_basename in
8602b425557eSmrg          CC*)
8603b425557eSmrg	    # Sun C++ 4.x
8604b425557eSmrg	    # FIXME: insert proper C++ library support
8605b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8606b425557eSmrg	    ;;
8607b425557eSmrg          lcc*)
8608b425557eSmrg	    # Lucid
8609b425557eSmrg	    # FIXME: insert proper C++ library support
8610b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8611b425557eSmrg	    ;;
8612b425557eSmrg          *)
8613b425557eSmrg	    # FIXME: insert proper C++ library support
8614b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8615b425557eSmrg	    ;;
8616b425557eSmrg        esac
8617b425557eSmrg        ;;
861834977a2fSmrg
8619b425557eSmrg      solaris*)
8620b425557eSmrg        case $cc_basename in
8621b425557eSmrg          CC* | sunCC*)
8622b425557eSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
8623b425557eSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
8624b425557eSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
8625b425557eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8626b425557eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8627b425557eSmrg	      $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'
8628ee3138f1Smrg
8629b425557eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8630b425557eSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8631b425557eSmrg	    case $host_os in
8632b425557eSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
8633b425557eSmrg	      *)
8634b425557eSmrg		# The compiler driver will combine and reorder linker options,
8635b425557eSmrg		# but understands `-z linker_flag'.
8636b425557eSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
8637b425557eSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
8638b425557eSmrg	        ;;
8639b425557eSmrg	    esac
8640b425557eSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
8641ee3138f1Smrg
8642b425557eSmrg	    output_verbose_link_cmd='func_echo_all'
8643ee3138f1Smrg
8644b425557eSmrg	    # Archives containing C++ object files must be created using
8645b425557eSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
8646b425557eSmrg	    # necessary to make sure instantiated templates are included
8647b425557eSmrg	    # in the archive.
8648b425557eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
8649b425557eSmrg	    ;;
8650b425557eSmrg          gcx*)
8651b425557eSmrg	    # Green Hills C++ Compiler
8652b425557eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
8653ee3138f1Smrg
8654b425557eSmrg	    # The C++ compiler must be used to create the archive.
8655b425557eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
8656b425557eSmrg	    ;;
8657b425557eSmrg          *)
8658b425557eSmrg	    # GNU C++ compiler with Solaris linker
8659b425557eSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8660b425557eSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
8661b425557eSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
8662b425557eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
8663b425557eSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8664b425557eSmrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
8665ee3138f1Smrg
8666b425557eSmrg	        # Commands to make compiler produce verbose output that lists
8667b425557eSmrg	        # what "hidden" libraries, object files and flags are used when
8668b425557eSmrg	        # linking a shared library.
8669b425557eSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
8670b425557eSmrg	      else
8671b425557eSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
8672b425557eSmrg	        # platform.
8673b425557eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
8674b425557eSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8675b425557eSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
8676ee3138f1Smrg
8677b425557eSmrg	        # Commands to make compiler produce verbose output that lists
8678b425557eSmrg	        # what "hidden" libraries, object files and flags are used when
8679b425557eSmrg	        # linking a shared library.
8680b425557eSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
8681b425557eSmrg	      fi
8682ee3138f1Smrg
8683b425557eSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
8684b425557eSmrg	      case $host_os in
8685b425557eSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
8686b425557eSmrg		*)
8687b425557eSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
8688b425557eSmrg		  ;;
8689b425557eSmrg	      esac
8690b425557eSmrg	    fi
8691b425557eSmrg	    ;;
8692b425557eSmrg        esac
8693b425557eSmrg        ;;
8694ee3138f1Smrg
8695b425557eSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
8696b425557eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
8697b425557eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8698b425557eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8699b425557eSmrg      runpath_var='LD_RUN_PATH'
8700ee3138f1Smrg
8701b425557eSmrg      case $cc_basename in
8702b425557eSmrg        CC*)
8703b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8704b425557eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8705b425557eSmrg	  ;;
8706b425557eSmrg	*)
8707b425557eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8708b425557eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8709b425557eSmrg	  ;;
8710b425557eSmrg      esac
8711b425557eSmrg      ;;
871234977a2fSmrg
8713b425557eSmrg      sysv5* | sco3.2v5* | sco5v6*)
8714b425557eSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
8715b425557eSmrg	# link with -lc, and that would cause any symbols used from libc to
8716b425557eSmrg	# always be unresolved, which means just about no library would
8717b425557eSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
8718b425557eSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
8719b425557eSmrg	# as -z defs.
8720b425557eSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
8721b425557eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
8722b425557eSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8723b425557eSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8724b425557eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
8725b425557eSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
8726b425557eSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
8727b425557eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
8728b425557eSmrg	runpath_var='LD_RUN_PATH'
872934977a2fSmrg
8730b425557eSmrg	case $cc_basename in
8731b425557eSmrg          CC*)
8732b425557eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8733b425557eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8734b425557eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
8735b425557eSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
8736b425557eSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
8737b425557eSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
8738b425557eSmrg	    ;;
8739b425557eSmrg	  *)
8740b425557eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8741b425557eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8742b425557eSmrg	    ;;
8743b425557eSmrg	esac
8744b425557eSmrg      ;;
8745ee3138f1Smrg
8746b425557eSmrg      tandem*)
8747b425557eSmrg        case $cc_basename in
8748b425557eSmrg          NCC*)
8749b425557eSmrg	    # NonStop-UX NCC 3.20
8750b425557eSmrg	    # FIXME: insert proper C++ library support
8751b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8752b425557eSmrg	    ;;
8753b425557eSmrg          *)
8754b425557eSmrg	    # FIXME: insert proper C++ library support
8755b425557eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8756b425557eSmrg	    ;;
8757b425557eSmrg        esac
8758b425557eSmrg        ;;
8759ee3138f1Smrg
8760b425557eSmrg      vxworks*)
8761b425557eSmrg        # FIXME: insert proper C++ library support
8762b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
8763b425557eSmrg        ;;
8764ee3138f1Smrg
8765b425557eSmrg      *)
8766b425557eSmrg        # FIXME: insert proper C++ library support
8767b425557eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
8768b425557eSmrg        ;;
8769b425557eSmrg    esac
8770ee3138f1Smrg
8771b425557eSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
8772b425557eSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
8773ee3138f1Smrg
8774b425557eSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
8775b425557eSmrg    _LT_TAGVAR(LD, $1)="$LD"
877634977a2fSmrg
8777b425557eSmrg    ## CAVEAT EMPTOR:
8778b425557eSmrg    ## There is no encapsulation within the following macros, do not change
8779b425557eSmrg    ## the running order or otherwise move them around unless you know exactly
8780b425557eSmrg    ## what you are doing...
8781b425557eSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
8782b425557eSmrg    _LT_COMPILER_PIC($1)
8783b425557eSmrg    _LT_COMPILER_C_O($1)
8784b425557eSmrg    _LT_COMPILER_FILE_LOCKS($1)
8785b425557eSmrg    _LT_LINKER_SHLIBS($1)
8786b425557eSmrg    _LT_SYS_DYNAMIC_LINKER($1)
8787b425557eSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
878834977a2fSmrg
8789b425557eSmrg    _LT_CONFIG($1)
8790b425557eSmrg  fi # test -n "$compiler"
879134977a2fSmrg
8792b425557eSmrg  CC=$lt_save_CC
8793b425557eSmrg  LDCXX=$LD
8794b425557eSmrg  LD=$lt_save_LD
8795b425557eSmrg  GCC=$lt_save_GCC
8796b425557eSmrg  with_gnu_ld=$lt_save_with_gnu_ld
8797b425557eSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
8798b425557eSmrg  lt_cv_path_LD=$lt_save_path_LD
8799b425557eSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
8800b425557eSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
8801b425557eSmrgfi # test "$_lt_caught_CXX_error" != yes
880234977a2fSmrg
8803b425557eSmrgAC_LANG_POP
8804b425557eSmrg])# _LT_LANG_CXX_CONFIG
880534977a2fSmrg
880634977a2fSmrg
8807b425557eSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
8808b425557eSmrg# ---------------------------------
8809b425557eSmrg# Figure out "hidden" library dependencies from verbose
8810b425557eSmrg# compiler output when linking a shared library.
8811b425557eSmrg# Parse the compiler output and extract the necessary
8812b425557eSmrg# objects, libraries and library flags.
8813b425557eSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
8814b425557eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
8815b425557eSmrg# Dependencies to place before and after the object being linked:
8816b425557eSmrg_LT_TAGVAR(predep_objects, $1)=
8817b425557eSmrg_LT_TAGVAR(postdep_objects, $1)=
8818b425557eSmrg_LT_TAGVAR(predeps, $1)=
8819b425557eSmrg_LT_TAGVAR(postdeps, $1)=
8820b425557eSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
882134977a2fSmrg
8822b425557eSmrgdnl we can't use the lt_simple_compile_test_code here,
8823b425557eSmrgdnl because it contains code intended for an executable,
8824b425557eSmrgdnl not a library.  It's possible we should let each
8825b425557eSmrgdnl tag define a new lt_????_link_test_code variable,
8826b425557eSmrgdnl but it's only used here...
8827b425557eSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
8828b425557eSmrgint a;
8829b425557eSmrgvoid foo (void) { a = 0; }
8830b425557eSmrg_LT_EOF
8831b425557eSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
8832b425557eSmrgclass Foo
8833b425557eSmrg{
8834b425557eSmrgpublic:
8835b425557eSmrg  Foo (void) { a = 0; }
8836b425557eSmrgprivate:
8837b425557eSmrg  int a;
8838b425557eSmrg};
8839b425557eSmrg_LT_EOF
8840b425557eSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
8841b425557eSmrg      subroutine foo
8842b425557eSmrg      implicit none
8843b425557eSmrg      integer*4 a
8844b425557eSmrg      a=0
8845b425557eSmrg      return
8846b425557eSmrg      end
8847b425557eSmrg_LT_EOF
8848b425557eSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
8849b425557eSmrg      subroutine foo
8850b425557eSmrg      implicit none
8851b425557eSmrg      integer a
8852b425557eSmrg      a=0
8853b425557eSmrg      return
8854b425557eSmrg      end
8855b425557eSmrg_LT_EOF
8856b425557eSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
8857b425557eSmrgpublic class foo {
8858b425557eSmrg  private int a;
8859b425557eSmrg  public void bar (void) {
8860b425557eSmrg    a = 0;
8861b425557eSmrg  }
8862b425557eSmrg};
8863b425557eSmrg_LT_EOF
8864b425557eSmrg])
8865b425557eSmrgdnl Parse the compiler output and extract the necessary
8866b425557eSmrgdnl objects, libraries and library flags.
8867b425557eSmrgif AC_TRY_EVAL(ac_compile); then
8868b425557eSmrg  # Parse the compiler output and extract the necessary
8869b425557eSmrg  # objects, libraries and library flags.
887034977a2fSmrg
8871b425557eSmrg  # Sentinel used to keep track of whether or not we are before
8872b425557eSmrg  # the conftest object file.
8873b425557eSmrg  pre_test_object_deps_done=no
887434977a2fSmrg
8875b425557eSmrg  for p in `eval "$output_verbose_link_cmd"`; do
8876b425557eSmrg    case $p in
887734977a2fSmrg
8878b425557eSmrg    -L* | -R* | -l*)
8879b425557eSmrg       # Some compilers place space between "-{L,R}" and the path.
8880b425557eSmrg       # Remove the space.
8881b425557eSmrg       if test $p = "-L" ||
8882b425557eSmrg          test $p = "-R"; then
8883b425557eSmrg	 prev=$p
8884b425557eSmrg	 continue
8885b425557eSmrg       else
8886b425557eSmrg	 prev=
8887b425557eSmrg       fi
888834977a2fSmrg
8889b425557eSmrg       if test "$pre_test_object_deps_done" = no; then
8890b425557eSmrg	 case $p in
8891b425557eSmrg	 -L* | -R*)
8892b425557eSmrg	   # Internal compiler library paths should come after those
8893b425557eSmrg	   # provided the user.  The postdeps already come after the
8894b425557eSmrg	   # user supplied libs so there is no need to process them.
8895b425557eSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8896b425557eSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8897b425557eSmrg	   else
8898b425557eSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8899b425557eSmrg	   fi
8900b425557eSmrg	   ;;
8901b425557eSmrg	 # The "-l" case would never come before the object being
8902b425557eSmrg	 # linked, so don't bother handling this case.
8903b425557eSmrg	 esac
8904b425557eSmrg       else
8905b425557eSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8906b425557eSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8907b425557eSmrg	 else
8908b425557eSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8909b425557eSmrg	 fi
8910b425557eSmrg       fi
8911b425557eSmrg       ;;
891234977a2fSmrg
8913b425557eSmrg    *.$objext)
8914b425557eSmrg       # This assumes that the test object file only shows up
8915b425557eSmrg       # once in the compiler output.
8916b425557eSmrg       if test "$p" = "conftest.$objext"; then
8917b425557eSmrg	 pre_test_object_deps_done=yes
8918b425557eSmrg	 continue
8919b425557eSmrg       fi
892034977a2fSmrg
8921b425557eSmrg       if test "$pre_test_object_deps_done" = no; then
8922b425557eSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8923b425557eSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
8924b425557eSmrg	 else
8925b425557eSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8926b425557eSmrg	 fi
8927b425557eSmrg       else
8928b425557eSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8929b425557eSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
8930b425557eSmrg	 else
8931b425557eSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8932b425557eSmrg	 fi
8933b425557eSmrg       fi
8934b425557eSmrg       ;;
893534977a2fSmrg
8936b425557eSmrg    *) ;; # Ignore the rest.
893734977a2fSmrg
8938b425557eSmrg    esac
8939b425557eSmrg  done
8940ee3138f1Smrg
8941b425557eSmrg  # Clean up.
8942b425557eSmrg  rm -f a.out a.exe
8943b425557eSmrgelse
8944b425557eSmrg  echo "libtool.m4: error: problem compiling $1 test program"
8945b425557eSmrgfi
8946ee3138f1Smrg
8947b425557eSmrg$RM -f confest.$objext
8948ee3138f1Smrg
8949b425557eSmrg# PORTME: override above test on systems where it is broken
8950b425557eSmrgm4_if([$1], [CXX],
8951b425557eSmrg[case $host_os in
8952b425557eSmrginterix[[3-9]]*)
8953b425557eSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8954b425557eSmrg  # hack all around it, let's just trust "g++" to DTRT.
8955b425557eSmrg  _LT_TAGVAR(predep_objects,$1)=
8956b425557eSmrg  _LT_TAGVAR(postdep_objects,$1)=
8957b425557eSmrg  _LT_TAGVAR(postdeps,$1)=
8958b425557eSmrg  ;;
8959ee3138f1Smrg
8960b425557eSmrglinux*)
8961b425557eSmrg  case `$CC -V 2>&1 | sed 5q` in
8962b425557eSmrg  *Sun\ C*)
8963b425557eSmrg    # Sun C++ 5.9
8964ee3138f1Smrg
8965b425557eSmrg    # The more standards-conforming stlport4 library is
8966b425557eSmrg    # incompatible with the Cstd library. Avoid specifying
8967b425557eSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
8968b425557eSmrg    # -library=stlport4 depends on it.
8969b425557eSmrg    case " $CXX $CXXFLAGS " in
8970b425557eSmrg    *" -library=stlport4 "*)
8971b425557eSmrg      solaris_use_stlport4=yes
8972b425557eSmrg      ;;
8973b425557eSmrg    esac
8974ee3138f1Smrg
8975b425557eSmrg    if test "$solaris_use_stlport4" != yes; then
8976b425557eSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8977b425557eSmrg    fi
8978b425557eSmrg    ;;
8979b425557eSmrg  esac
8980b425557eSmrg  ;;
8981ee3138f1Smrg
8982b425557eSmrgsolaris*)
8983b425557eSmrg  case $cc_basename in
8984b425557eSmrg  CC* | sunCC*)
8985b425557eSmrg    # The more standards-conforming stlport4 library is
8986b425557eSmrg    # incompatible with the Cstd library. Avoid specifying
8987b425557eSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
8988b425557eSmrg    # -library=stlport4 depends on it.
8989b425557eSmrg    case " $CXX $CXXFLAGS " in
8990b425557eSmrg    *" -library=stlport4 "*)
8991b425557eSmrg      solaris_use_stlport4=yes
8992b425557eSmrg      ;;
8993b425557eSmrg    esac
899434977a2fSmrg
8995b425557eSmrg    # Adding this requires a known-good setup of shared libraries for
8996b425557eSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
8997b425557eSmrg    # archive will be linked into the output, leading to subtle bugs.
8998b425557eSmrg    if test "$solaris_use_stlport4" != yes; then
8999b425557eSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
9000b425557eSmrg    fi
9001b425557eSmrg    ;;
9002b425557eSmrg  esac
9003b425557eSmrg  ;;
9004b425557eSmrgesac
9005ee3138f1Smrg])
9006ee3138f1Smrg
9007b425557eSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
9008b425557eSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
9009b425557eSmrgesac
9010b425557eSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
9011b425557eSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
9012b425557eSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
9013b425557eSmrgfi
9014b425557eSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
9015b425557eSmrg    [The directories searched by this compiler when creating a shared library])
9016b425557eSmrg_LT_TAGDECL([], [predep_objects], [1],
9017b425557eSmrg    [Dependencies to place before and after the objects being linked to
9018b425557eSmrg    create a shared library])
9019b425557eSmrg_LT_TAGDECL([], [postdep_objects], [1])
9020b425557eSmrg_LT_TAGDECL([], [predeps], [1])
9021b425557eSmrg_LT_TAGDECL([], [postdeps], [1])
9022b425557eSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
9023b425557eSmrg    [The library search path used internally by the compiler when linking
9024b425557eSmrg    a shared library])
9025b425557eSmrg])# _LT_SYS_HIDDEN_LIBDEPS
9026ee3138f1Smrg
9027ee3138f1Smrg
9028b425557eSmrg# _LT_LANG_F77_CONFIG([TAG])
9029b425557eSmrg# --------------------------
9030b425557eSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
9031b425557eSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
9032b425557eSmrg# to write the compiler configuration to `libtool'.
9033b425557eSmrgm4_defun([_LT_LANG_F77_CONFIG],
9034b425557eSmrg[AC_LANG_PUSH(Fortran 77)
9035b425557eSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
9036b425557eSmrg  _lt_disable_F77=yes
9037b425557eSmrgfi
9038b425557eSmrg
9039b425557eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9040b425557eSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
9041b425557eSmrg_LT_TAGVAR(always_export_symbols, $1)=no
9042b425557eSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
9043b425557eSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
9044b425557eSmrg_LT_TAGVAR(hardcode_direct, $1)=no
9045b425557eSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
9046b425557eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9047b425557eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
9048b425557eSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
9049b425557eSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
9050b425557eSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
9051b425557eSmrg_LT_TAGVAR(inherit_rpath, $1)=no
9052b425557eSmrg_LT_TAGVAR(module_cmds, $1)=
9053b425557eSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
9054b425557eSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
9055b425557eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9056b425557eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
9057b425557eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
9058b425557eSmrg_LT_TAGVAR(no_undefined_flag, $1)=
9059b425557eSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
9060b425557eSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9061ee3138f1Smrg
9062b425557eSmrg# Source file extension for f77 test sources.
9063b425557eSmrgac_ext=f
9064ee3138f1Smrg
9065b425557eSmrg# Object file extension for compiled f77 test sources.
9066b425557eSmrgobjext=o
9067b425557eSmrg_LT_TAGVAR(objext, $1)=$objext
9068ee3138f1Smrg
9069b425557eSmrg# No sense in running all these tests if we already determined that
9070b425557eSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
9071b425557eSmrg# are currently assumed to apply to all compilers on this platform,
9072b425557eSmrg# and will be corrupted by setting them based on a non-working compiler.
9073b425557eSmrgif test "$_lt_disable_F77" != yes; then
9074b425557eSmrg  # Code to be used in simple compile tests
9075b425557eSmrg  lt_simple_compile_test_code="\
9076b425557eSmrg      subroutine t
9077b425557eSmrg      return
9078b425557eSmrg      end
9079b425557eSmrg"
908034977a2fSmrg
9081b425557eSmrg  # Code to be used in simple link tests
9082b425557eSmrg  lt_simple_link_test_code="\
9083b425557eSmrg      program t
9084b425557eSmrg      end
9085b425557eSmrg"
908634977a2fSmrg
9087b425557eSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9088b425557eSmrg  _LT_TAG_COMPILER
908934977a2fSmrg
9090b425557eSmrg  # save warnings/boilerplate of simple test code
9091b425557eSmrg  _LT_COMPILER_BOILERPLATE
9092b425557eSmrg  _LT_LINKER_BOILERPLATE
909334977a2fSmrg
9094b425557eSmrg  # Allow CC to be a program name with arguments.
9095b425557eSmrg  lt_save_CC="$CC"
9096b425557eSmrg  lt_save_GCC=$GCC
9097b425557eSmrg  CC=${F77-"f77"}
9098b425557eSmrg  compiler=$CC
9099b425557eSmrg  _LT_TAGVAR(compiler, $1)=$CC
9100b425557eSmrg  _LT_CC_BASENAME([$compiler])
9101b425557eSmrg  GCC=$G77
9102b425557eSmrg  if test -n "$compiler"; then
9103b425557eSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
9104b425557eSmrg    AC_MSG_RESULT([$can_build_shared])
910534977a2fSmrg
9106b425557eSmrg    AC_MSG_CHECKING([whether to build shared libraries])
9107b425557eSmrg    test "$can_build_shared" = "no" && enable_shared=no
9108ee3138f1Smrg
9109b425557eSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
9110b425557eSmrg    # are all built from PIC.
9111b425557eSmrg    case $host_os in
9112b425557eSmrg      aix3*)
9113b425557eSmrg        test "$enable_shared" = yes && enable_static=no
9114b425557eSmrg        if test -n "$RANLIB"; then
9115b425557eSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
9116b425557eSmrg          postinstall_cmds='$RANLIB $lib'
9117b425557eSmrg        fi
9118b425557eSmrg        ;;
9119b425557eSmrg      aix[[4-9]]*)
9120b425557eSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
9121b425557eSmrg	  test "$enable_shared" = yes && enable_static=no
9122ee3138f1Smrg	fi
9123b425557eSmrg        ;;
9124b425557eSmrg    esac
9125b425557eSmrg    AC_MSG_RESULT([$enable_shared])
9126ee3138f1Smrg
9127b425557eSmrg    AC_MSG_CHECKING([whether to build static libraries])
9128b425557eSmrg    # Make sure either enable_shared or enable_static is yes.
9129b425557eSmrg    test "$enable_shared" = yes || enable_static=yes
9130b425557eSmrg    AC_MSG_RESULT([$enable_static])
9131ee3138f1Smrg
9132b425557eSmrg    _LT_TAGVAR(GCC, $1)="$G77"
9133b425557eSmrg    _LT_TAGVAR(LD, $1)="$LD"
9134ee3138f1Smrg
9135b425557eSmrg    ## CAVEAT EMPTOR:
9136b425557eSmrg    ## There is no encapsulation within the following macros, do not change
9137b425557eSmrg    ## the running order or otherwise move them around unless you know exactly
9138b425557eSmrg    ## what you are doing...
9139b425557eSmrg    _LT_COMPILER_PIC($1)
9140b425557eSmrg    _LT_COMPILER_C_O($1)
9141b425557eSmrg    _LT_COMPILER_FILE_LOCKS($1)
9142b425557eSmrg    _LT_LINKER_SHLIBS($1)
9143b425557eSmrg    _LT_SYS_DYNAMIC_LINKER($1)
9144b425557eSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
9145ee3138f1Smrg
9146b425557eSmrg    _LT_CONFIG($1)
9147b425557eSmrg  fi # test -n "$compiler"
9148ee3138f1Smrg
9149b425557eSmrg  GCC=$lt_save_GCC
9150b425557eSmrg  CC="$lt_save_CC"
9151b425557eSmrgfi # test "$_lt_disable_F77" != yes
9152ee3138f1Smrg
9153b425557eSmrgAC_LANG_POP
9154b425557eSmrg])# _LT_LANG_F77_CONFIG
9155ee3138f1Smrg
9156ee3138f1Smrg
9157b425557eSmrg# _LT_LANG_FC_CONFIG([TAG])
9158b425557eSmrg# -------------------------
9159b425557eSmrg# Ensure that the configuration variables for a Fortran compiler are
9160b425557eSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
9161b425557eSmrg# to write the compiler configuration to `libtool'.
9162b425557eSmrgm4_defun([_LT_LANG_FC_CONFIG],
9163b425557eSmrg[AC_LANG_PUSH(Fortran)
9164ee3138f1Smrg
9165b425557eSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
9166b425557eSmrg  _lt_disable_FC=yes
9167b425557eSmrgfi
9168ee3138f1Smrg
9169b425557eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9170b425557eSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
9171b425557eSmrg_LT_TAGVAR(always_export_symbols, $1)=no
9172b425557eSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
9173b425557eSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
9174b425557eSmrg_LT_TAGVAR(hardcode_direct, $1)=no
9175b425557eSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
9176b425557eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9177b425557eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
9178b425557eSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
9179b425557eSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
9180b425557eSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
9181b425557eSmrg_LT_TAGVAR(inherit_rpath, $1)=no
9182b425557eSmrg_LT_TAGVAR(module_cmds, $1)=
9183b425557eSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
9184b425557eSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
9185b425557eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9186b425557eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
9187b425557eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
9188b425557eSmrg_LT_TAGVAR(no_undefined_flag, $1)=
9189b425557eSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
9190b425557eSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9191ee3138f1Smrg
9192b425557eSmrg# Source file extension for fc test sources.
9193b425557eSmrgac_ext=${ac_fc_srcext-f}
9194ee3138f1Smrg
9195b425557eSmrg# Object file extension for compiled fc test sources.
9196b425557eSmrgobjext=o
9197b425557eSmrg_LT_TAGVAR(objext, $1)=$objext
9198ee3138f1Smrg
9199b425557eSmrg# No sense in running all these tests if we already determined that
9200b425557eSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
9201b425557eSmrg# are currently assumed to apply to all compilers on this platform,
9202b425557eSmrg# and will be corrupted by setting them based on a non-working compiler.
9203b425557eSmrgif test "$_lt_disable_FC" != yes; then
9204b425557eSmrg  # Code to be used in simple compile tests
9205b425557eSmrg  lt_simple_compile_test_code="\
9206b425557eSmrg      subroutine t
9207b425557eSmrg      return
9208b425557eSmrg      end
9209b425557eSmrg"
9210ee3138f1Smrg
9211b425557eSmrg  # Code to be used in simple link tests
9212b425557eSmrg  lt_simple_link_test_code="\
9213b425557eSmrg      program t
9214b425557eSmrg      end
9215b425557eSmrg"
9216b425557eSmrg
9217b425557eSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9218b425557eSmrg  _LT_TAG_COMPILER
9219b425557eSmrg
9220b425557eSmrg  # save warnings/boilerplate of simple test code
9221b425557eSmrg  _LT_COMPILER_BOILERPLATE
9222b425557eSmrg  _LT_LINKER_BOILERPLATE
9223b425557eSmrg
9224b425557eSmrg  # Allow CC to be a program name with arguments.
9225b425557eSmrg  lt_save_CC="$CC"
9226b425557eSmrg  lt_save_GCC=$GCC
9227b425557eSmrg  CC=${FC-"f95"}
9228b425557eSmrg  compiler=$CC
9229b425557eSmrg  GCC=$ac_cv_fc_compiler_gnu
9230b425557eSmrg
9231b425557eSmrg  _LT_TAGVAR(compiler, $1)=$CC
9232b425557eSmrg  _LT_CC_BASENAME([$compiler])
9233b425557eSmrg
9234b425557eSmrg  if test -n "$compiler"; then
9235b425557eSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
9236b425557eSmrg    AC_MSG_RESULT([$can_build_shared])
9237b425557eSmrg
9238b425557eSmrg    AC_MSG_CHECKING([whether to build shared libraries])
9239b425557eSmrg    test "$can_build_shared" = "no" && enable_shared=no
9240b425557eSmrg
9241b425557eSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
9242b425557eSmrg    # are all built from PIC.
9243b425557eSmrg    case $host_os in
9244b425557eSmrg      aix3*)
9245b425557eSmrg        test "$enable_shared" = yes && enable_static=no
9246b425557eSmrg        if test -n "$RANLIB"; then
9247b425557eSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
9248b425557eSmrg          postinstall_cmds='$RANLIB $lib'
9249b425557eSmrg        fi
9250b425557eSmrg        ;;
9251b425557eSmrg      aix[[4-9]]*)
9252b425557eSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
9253b425557eSmrg	  test "$enable_shared" = yes && enable_static=no
9254b425557eSmrg	fi
9255b425557eSmrg        ;;
9256b425557eSmrg    esac
9257b425557eSmrg    AC_MSG_RESULT([$enable_shared])
9258ee3138f1Smrg
9259b425557eSmrg    AC_MSG_CHECKING([whether to build static libraries])
9260b425557eSmrg    # Make sure either enable_shared or enable_static is yes.
9261b425557eSmrg    test "$enable_shared" = yes || enable_static=yes
9262b425557eSmrg    AC_MSG_RESULT([$enable_static])
9263ee3138f1Smrg
9264b425557eSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
9265b425557eSmrg    _LT_TAGVAR(LD, $1)="$LD"
9266ee3138f1Smrg
9267b425557eSmrg    ## CAVEAT EMPTOR:
9268b425557eSmrg    ## There is no encapsulation within the following macros, do not change
9269b425557eSmrg    ## the running order or otherwise move them around unless you know exactly
9270b425557eSmrg    ## what you are doing...
9271b425557eSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
9272b425557eSmrg    _LT_COMPILER_PIC($1)
9273b425557eSmrg    _LT_COMPILER_C_O($1)
9274b425557eSmrg    _LT_COMPILER_FILE_LOCKS($1)
9275b425557eSmrg    _LT_LINKER_SHLIBS($1)
9276b425557eSmrg    _LT_SYS_DYNAMIC_LINKER($1)
9277b425557eSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
9278ee3138f1Smrg
9279b425557eSmrg    _LT_CONFIG($1)
9280b425557eSmrg  fi # test -n "$compiler"
928134977a2fSmrg
9282b425557eSmrg  GCC=$lt_save_GCC
9283b425557eSmrg  CC="$lt_save_CC"
9284b425557eSmrgfi # test "$_lt_disable_FC" != yes
928534977a2fSmrg
9286b425557eSmrgAC_LANG_POP
9287b425557eSmrg])# _LT_LANG_FC_CONFIG
928834977a2fSmrg
928934977a2fSmrg
9290b425557eSmrg# _LT_LANG_GCJ_CONFIG([TAG])
9291b425557eSmrg# --------------------------
9292b425557eSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
9293b425557eSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
9294b425557eSmrg# to write the compiler configuration to `libtool'.
9295b425557eSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
9296b425557eSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
9297b425557eSmrgAC_LANG_SAVE
929834977a2fSmrg
9299b425557eSmrg# Source file extension for Java test sources.
9300b425557eSmrgac_ext=java
9301ee3138f1Smrg
9302b425557eSmrg# Object file extension for compiled Java test sources.
9303b425557eSmrgobjext=o
9304b425557eSmrg_LT_TAGVAR(objext, $1)=$objext
9305ee3138f1Smrg
9306b425557eSmrg# Code to be used in simple compile tests
9307b425557eSmrglt_simple_compile_test_code="class foo {}"
9308ee3138f1Smrg
9309b425557eSmrg# Code to be used in simple link tests
9310b425557eSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
9311ee3138f1Smrg
9312b425557eSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
9313b425557eSmrg_LT_TAG_COMPILER
9314ee3138f1Smrg
9315b425557eSmrg# save warnings/boilerplate of simple test code
9316b425557eSmrg_LT_COMPILER_BOILERPLATE
9317b425557eSmrg_LT_LINKER_BOILERPLATE
9318ee3138f1Smrg
9319b425557eSmrg# Allow CC to be a program name with arguments.
9320b425557eSmrglt_save_CC="$CC"
9321b425557eSmrglt_save_GCC=$GCC
9322b425557eSmrgGCC=yes
9323b425557eSmrgCC=${GCJ-"gcj"}
9324b425557eSmrgcompiler=$CC
9325b425557eSmrg_LT_TAGVAR(compiler, $1)=$CC
9326b425557eSmrg_LT_TAGVAR(LD, $1)="$LD"
9327b425557eSmrg_LT_CC_BASENAME([$compiler])
9328ee3138f1Smrg
9329b425557eSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
9330b425557eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9331ee3138f1Smrg
9332b425557eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9333b425557eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
9334b425557eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
9335ee3138f1Smrg
9336b425557eSmrgif test -n "$compiler"; then
9337b425557eSmrg  _LT_COMPILER_NO_RTTI($1)
9338b425557eSmrg  _LT_COMPILER_PIC($1)
9339b425557eSmrg  _LT_COMPILER_C_O($1)
9340b425557eSmrg  _LT_COMPILER_FILE_LOCKS($1)
9341b425557eSmrg  _LT_LINKER_SHLIBS($1)
9342b425557eSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
9343ee3138f1Smrg
9344b425557eSmrg  _LT_CONFIG($1)
9345b425557eSmrgfi
9346ee3138f1Smrg
9347b425557eSmrgAC_LANG_RESTORE
9348ee3138f1Smrg
9349b425557eSmrgGCC=$lt_save_GCC
9350b425557eSmrgCC="$lt_save_CC"
9351b425557eSmrg])# _LT_LANG_GCJ_CONFIG
9352ee3138f1Smrg
9353ee3138f1Smrg
9354b425557eSmrg# _LT_LANG_RC_CONFIG([TAG])
9355b425557eSmrg# -------------------------
9356b425557eSmrg# Ensure that the configuration variables for the Windows resource compiler
9357b425557eSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
9358b425557eSmrg# to write the compiler configuration to `libtool'.
9359b425557eSmrgm4_defun([_LT_LANG_RC_CONFIG],
9360b425557eSmrg[AC_REQUIRE([LT_PROG_RC])dnl
9361b425557eSmrgAC_LANG_SAVE
9362ee3138f1Smrg
9363b425557eSmrg# Source file extension for RC test sources.
9364b425557eSmrgac_ext=rc
9365ee3138f1Smrg
9366b425557eSmrg# Object file extension for compiled RC test sources.
9367b425557eSmrgobjext=o
9368b425557eSmrg_LT_TAGVAR(objext, $1)=$objext
9369ee3138f1Smrg
9370b425557eSmrg# Code to be used in simple compile tests
9371b425557eSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
9372ee3138f1Smrg
9373b425557eSmrg# Code to be used in simple link tests
9374b425557eSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
9375ee3138f1Smrg
9376b425557eSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
9377b425557eSmrg_LT_TAG_COMPILER
9378ee3138f1Smrg
9379b425557eSmrg# save warnings/boilerplate of simple test code
9380b425557eSmrg_LT_COMPILER_BOILERPLATE
9381b425557eSmrg_LT_LINKER_BOILERPLATE
9382b425557eSmrg
9383b425557eSmrg# Allow CC to be a program name with arguments.
9384b425557eSmrglt_save_CC="$CC"
9385b425557eSmrglt_save_GCC=$GCC
9386b425557eSmrgGCC=
9387b425557eSmrgCC=${RC-"windres"}
9388b425557eSmrgcompiler=$CC
9389b425557eSmrg_LT_TAGVAR(compiler, $1)=$CC
9390b425557eSmrg_LT_CC_BASENAME([$compiler])
9391b425557eSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
9392b425557eSmrg
9393b425557eSmrgif test -n "$compiler"; then
9394b425557eSmrg  :
9395b425557eSmrg  _LT_CONFIG($1)
9396ee3138f1Smrgfi
9397ee3138f1Smrg
9398b425557eSmrgGCC=$lt_save_GCC
9399b425557eSmrgAC_LANG_RESTORE
9400b425557eSmrgCC="$lt_save_CC"
9401b425557eSmrg])# _LT_LANG_RC_CONFIG
9402ee3138f1Smrg
9403ee3138f1Smrg
9404b425557eSmrg# LT_PROG_GCJ
9405b425557eSmrg# -----------
9406b425557eSmrgAC_DEFUN([LT_PROG_GCJ],
9407b425557eSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
9408b425557eSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
9409b425557eSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
9410b425557eSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
9411b425557eSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
9412b425557eSmrg])
9413ee3138f1Smrg
9414b425557eSmrg# Old name:
9415b425557eSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
9416b425557eSmrgdnl aclocal-1.4 backwards compatibility:
9417b425557eSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
9418ee3138f1Smrg
9419ee3138f1Smrg
9420b425557eSmrg# LT_PROG_RC
9421b425557eSmrg# ----------
9422b425557eSmrgAC_DEFUN([LT_PROG_RC],
9423b425557eSmrg[AC_CHECK_TOOL(RC, windres,)
942434977a2fSmrg])
9425ee3138f1Smrg
9426b425557eSmrg# Old name:
9427b425557eSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
9428b425557eSmrgdnl aclocal-1.4 backwards compatibility:
9429b425557eSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
9430b425557eSmrg
9431ee3138f1Smrg
9432b425557eSmrg# _LT_DECL_EGREP
9433b425557eSmrg# --------------
9434b425557eSmrg# If we don't have a new enough Autoconf to choose the best grep
9435b425557eSmrg# available, choose the one first in the user's PATH.
9436b425557eSmrgm4_defun([_LT_DECL_EGREP],
9437b425557eSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
9438b425557eSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
9439b425557eSmrgtest -z "$GREP" && GREP=grep
9440b425557eSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
9441b425557eSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
9442b425557eSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
9443b425557eSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
9444b425557eSmrgAC_SUBST([GREP])
9445b425557eSmrg])
9446ee3138f1Smrg
9447ee3138f1Smrg
9448b425557eSmrg# _LT_DECL_OBJDUMP
9449b425557eSmrg# --------------
9450b425557eSmrg# If we don't have a new enough Autoconf to choose the best objdump
9451b425557eSmrg# available, choose the one first in the user's PATH.
9452b425557eSmrgm4_defun([_LT_DECL_OBJDUMP],
9453b425557eSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
9454b425557eSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
9455b425557eSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
9456b425557eSmrgAC_SUBST([OBJDUMP])
9457b425557eSmrg])
9458ee3138f1Smrg
9459ee3138f1Smrg
9460b425557eSmrg# _LT_DECL_SED
9461b425557eSmrg# ------------
9462b425557eSmrg# Check for a fully-functional sed program, that truncates
9463b425557eSmrg# as few characters as possible.  Prefer GNU sed if found.
9464b425557eSmrgm4_defun([_LT_DECL_SED],
9465b425557eSmrg[AC_PROG_SED
9466b425557eSmrgtest -z "$SED" && SED=sed
9467b425557eSmrgXsed="$SED -e 1s/^X//"
9468b425557eSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
9469b425557eSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
9470b425557eSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
9471b425557eSmrg])# _LT_DECL_SED
947234977a2fSmrg
9473b425557eSmrgm4_ifndef([AC_PROG_SED], [
9474b425557eSmrg# NOTE: This macro has been submitted for inclusion into   #
9475b425557eSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
9476b425557eSmrg#  a released version of Autoconf we should remove this    #
9477b425557eSmrg#  macro and use it instead.                               #
947834977a2fSmrg
9479b425557eSmrgm4_defun([AC_PROG_SED],
9480b425557eSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
9481b425557eSmrgAC_CACHE_VAL(lt_cv_path_SED,
9482b425557eSmrg[# Loop through the user's path and test for sed and gsed.
9483b425557eSmrg# Then use that list of sed's as ones to test for truncation.
9484b425557eSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9485b425557eSmrgfor as_dir in $PATH
9486b425557eSmrgdo
9487b425557eSmrg  IFS=$as_save_IFS
9488b425557eSmrg  test -z "$as_dir" && as_dir=.
9489b425557eSmrg  for lt_ac_prog in sed gsed; do
9490b425557eSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
9491b425557eSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
9492b425557eSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
9493b425557eSmrg      fi
9494b425557eSmrg    done
9495b425557eSmrg  done
9496b425557eSmrgdone
9497b425557eSmrgIFS=$as_save_IFS
9498b425557eSmrglt_ac_max=0
9499b425557eSmrglt_ac_count=0
9500b425557eSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
9501b425557eSmrg# along with /bin/sed that truncates output.
9502b425557eSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
9503b425557eSmrg  test ! -f $lt_ac_sed && continue
9504b425557eSmrg  cat /dev/null > conftest.in
9505b425557eSmrg  lt_ac_count=0
9506b425557eSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
9507b425557eSmrg  # Check for GNU sed and select it if it is found.
9508b425557eSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
9509b425557eSmrg    lt_cv_path_SED=$lt_ac_sed
9510b425557eSmrg    break
951134977a2fSmrg  fi
9512b425557eSmrg  while true; do
9513b425557eSmrg    cat conftest.in conftest.in >conftest.tmp
9514b425557eSmrg    mv conftest.tmp conftest.in
9515b425557eSmrg    cp conftest.in conftest.nl
9516b425557eSmrg    echo >>conftest.nl
9517b425557eSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
9518b425557eSmrg    cmp -s conftest.out conftest.nl || break
9519b425557eSmrg    # 10000 chars as input seems more than enough
9520b425557eSmrg    test $lt_ac_count -gt 10 && break
9521b425557eSmrg    lt_ac_count=`expr $lt_ac_count + 1`
9522b425557eSmrg    if test $lt_ac_count -gt $lt_ac_max; then
9523b425557eSmrg      lt_ac_max=$lt_ac_count
9524b425557eSmrg      lt_cv_path_SED=$lt_ac_sed
9525b425557eSmrg    fi
9526b425557eSmrg  done
9527b425557eSmrgdone
9528b425557eSmrg])
9529b425557eSmrgSED=$lt_cv_path_SED
9530b425557eSmrgAC_SUBST([SED])
9531b425557eSmrgAC_MSG_RESULT([$SED])
9532b425557eSmrg])#AC_PROG_SED
9533b425557eSmrg])#m4_ifndef
9534ee3138f1Smrg
9535b425557eSmrg# Old name:
9536b425557eSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
9537b425557eSmrgdnl aclocal-1.4 backwards compatibility:
9538b425557eSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
9539ee3138f1Smrg
9540ee3138f1Smrg
9541b425557eSmrg# _LT_CHECK_SHELL_FEATURES
9542b425557eSmrg# ------------------------
9543b425557eSmrg# Find out whether the shell is Bourne or XSI compatible,
9544b425557eSmrg# or has some other useful features.
9545b425557eSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
9546b425557eSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
9547b425557eSmrg# Try some XSI features
9548b425557eSmrgxsi_shell=no
9549b425557eSmrg( _lt_dummy="a/b/c"
9550b425557eSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
9551b425557eSmrg      = c,a/b,, \
9552b425557eSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
9553b425557eSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
9554b425557eSmrg  && xsi_shell=yes
9555b425557eSmrgAC_MSG_RESULT([$xsi_shell])
9556b425557eSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
9557ee3138f1Smrg
9558b425557eSmrgAC_MSG_CHECKING([whether the shell understands "+="])
9559b425557eSmrglt_shell_append=no
9560b425557eSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
9561b425557eSmrg    >/dev/null 2>&1 \
9562b425557eSmrg  && lt_shell_append=yes
9563b425557eSmrgAC_MSG_RESULT([$lt_shell_append])
9564b425557eSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
9565ee3138f1Smrg
9566b425557eSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
9567b425557eSmrg  lt_unset=unset
9568b425557eSmrgelse
9569b425557eSmrg  lt_unset=false
9570b425557eSmrgfi
9571b425557eSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
9572b425557eSmrg
9573b425557eSmrg# test EBCDIC or ASCII
9574b425557eSmrgcase `echo X|tr X '\101'` in
9575b425557eSmrg A) # ASCII based system
9576b425557eSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
9577b425557eSmrg  lt_SP2NL='tr \040 \012'
9578b425557eSmrg  lt_NL2SP='tr \015\012 \040\040'
9579b425557eSmrg  ;;
9580b425557eSmrg *) # EBCDIC based system
9581b425557eSmrg  lt_SP2NL='tr \100 \n'
9582b425557eSmrg  lt_NL2SP='tr \r\n \100\100'
9583b425557eSmrg  ;;
9584b425557eSmrgesac
9585b425557eSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
9586b425557eSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
9587b425557eSmrg])# _LT_CHECK_SHELL_FEATURES
9588ee3138f1Smrg
9589ee3138f1Smrg
9590b425557eSmrg# _LT_PROG_XSI_SHELLFNS
9591b425557eSmrg# ---------------------
9592b425557eSmrg# Bourne and XSI compatible variants of some useful shell functions.
9593b425557eSmrgm4_defun([_LT_PROG_XSI_SHELLFNS],
9594b425557eSmrg[case $xsi_shell in
9595b425557eSmrg  yes)
9596b425557eSmrg    cat << \_LT_EOF >> "$cfgfile"
9597ee3138f1Smrg
9598b425557eSmrg# func_dirname file append nondir_replacement
9599b425557eSmrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
9600b425557eSmrg# otherwise set result to NONDIR_REPLACEMENT.
9601b425557eSmrgfunc_dirname ()
9602b425557eSmrg{
9603b425557eSmrg  case ${1} in
9604b425557eSmrg    */*) func_dirname_result="${1%/*}${2}" ;;
9605b425557eSmrg    *  ) func_dirname_result="${3}" ;;
960634977a2fSmrg  esac
9607b425557eSmrg}
9608ee3138f1Smrg
9609b425557eSmrg# func_basename file
9610b425557eSmrgfunc_basename ()
9611b425557eSmrg{
9612b425557eSmrg  func_basename_result="${1##*/}"
9613b425557eSmrg}
9614ee3138f1Smrg
9615b425557eSmrg# func_dirname_and_basename file append nondir_replacement
9616b425557eSmrg# perform func_basename and func_dirname in a single function
9617b425557eSmrg# call:
9618b425557eSmrg#   dirname:  Compute the dirname of FILE.  If nonempty,
9619b425557eSmrg#             add APPEND to the result, otherwise set result
9620b425557eSmrg#             to NONDIR_REPLACEMENT.
9621b425557eSmrg#             value returned in "$func_dirname_result"
9622b425557eSmrg#   basename: Compute filename of FILE.
9623b425557eSmrg#             value retuned in "$func_basename_result"
9624b425557eSmrg# Implementation must be kept synchronized with func_dirname
9625b425557eSmrg# and func_basename. For efficiency, we do not delegate to
9626b425557eSmrg# those functions but instead duplicate the functionality here.
9627b425557eSmrgfunc_dirname_and_basename ()
9628b425557eSmrg{
9629b425557eSmrg  case ${1} in
9630b425557eSmrg    */*) func_dirname_result="${1%/*}${2}" ;;
9631b425557eSmrg    *  ) func_dirname_result="${3}" ;;
963234977a2fSmrg  esac
9633b425557eSmrg  func_basename_result="${1##*/}"
9634b425557eSmrg}
9635ee3138f1Smrg
9636b425557eSmrg# func_stripname prefix suffix name
9637b425557eSmrg# strip PREFIX and SUFFIX off of NAME.
9638b425557eSmrg# PREFIX and SUFFIX must not contain globbing or regex special
9639b425557eSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
9640b425557eSmrg# dot (in which case that matches only a dot).
9641b425557eSmrgfunc_stripname ()
9642b425557eSmrg{
9643b425557eSmrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
9644b425557eSmrg  # positional parameters, so assign one to ordinary parameter first.
9645b425557eSmrg  func_stripname_result=${3}
9646b425557eSmrg  func_stripname_result=${func_stripname_result#"${1}"}
9647b425557eSmrg  func_stripname_result=${func_stripname_result%"${2}"}
9648b425557eSmrg}
964979a8a9c6Smrg
9650b425557eSmrg# func_opt_split
9651b425557eSmrgfunc_opt_split ()
9652b425557eSmrg{
9653b425557eSmrg  func_opt_split_opt=${1%%=*}
9654b425557eSmrg  func_opt_split_arg=${1#*=}
9655b425557eSmrg}
965679a8a9c6Smrg
9657b425557eSmrg# func_lo2o object
9658b425557eSmrgfunc_lo2o ()
9659b425557eSmrg{
9660b425557eSmrg  case ${1} in
9661b425557eSmrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
9662b425557eSmrg    *)    func_lo2o_result=${1} ;;
9663b425557eSmrg  esac
9664b425557eSmrg}
966579a8a9c6Smrg
9666b425557eSmrg# func_xform libobj-or-source
9667b425557eSmrgfunc_xform ()
9668b425557eSmrg{
9669b425557eSmrg  func_xform_result=${1%.*}.lo
9670b425557eSmrg}
967179a8a9c6Smrg
9672b425557eSmrg# func_arith arithmetic-term...
9673b425557eSmrgfunc_arith ()
9674b425557eSmrg{
9675b425557eSmrg  func_arith_result=$(( $[*] ))
9676b425557eSmrg}
9677ee3138f1Smrg
9678b425557eSmrg# func_len string
9679b425557eSmrg# STRING may not start with a hyphen.
9680b425557eSmrgfunc_len ()
9681b425557eSmrg{
9682b425557eSmrg  func_len_result=${#1}
9683b425557eSmrg}
9684ee3138f1Smrg
9685b425557eSmrg_LT_EOF
9686b425557eSmrg    ;;
9687b425557eSmrg  *) # Bourne compatible functions.
9688b425557eSmrg    cat << \_LT_EOF >> "$cfgfile"
9689ee3138f1Smrg
9690b425557eSmrg# func_dirname file append nondir_replacement
9691b425557eSmrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
9692b425557eSmrg# otherwise set result to NONDIR_REPLACEMENT.
9693b425557eSmrgfunc_dirname ()
9694b425557eSmrg{
9695b425557eSmrg  # Extract subdirectory from the argument.
9696b425557eSmrg  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
9697b425557eSmrg  if test "X$func_dirname_result" = "X${1}"; then
9698b425557eSmrg    func_dirname_result="${3}"
9699b425557eSmrg  else
9700b425557eSmrg    func_dirname_result="$func_dirname_result${2}"
9701b425557eSmrg  fi
9702b425557eSmrg}
9703ee3138f1Smrg
9704b425557eSmrg# func_basename file
9705b425557eSmrgfunc_basename ()
9706b425557eSmrg{
9707b425557eSmrg  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
9708b425557eSmrg}
9709ee3138f1Smrg
9710b425557eSmrgdnl func_dirname_and_basename
9711b425557eSmrgdnl A portable version of this function is already defined in general.m4sh
9712b425557eSmrgdnl so there is no need for it here.
9713ee3138f1Smrg
9714b425557eSmrg# func_stripname prefix suffix name
9715b425557eSmrg# strip PREFIX and SUFFIX off of NAME.
9716b425557eSmrg# PREFIX and SUFFIX must not contain globbing or regex special
9717b425557eSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
9718b425557eSmrg# dot (in which case that matches only a dot).
9719b425557eSmrg# func_strip_suffix prefix name
9720b425557eSmrgfunc_stripname ()
9721b425557eSmrg{
9722b425557eSmrg  case ${2} in
9723b425557eSmrg    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
9724b425557eSmrg    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
9725b425557eSmrg  esac
9726b425557eSmrg}
972734977a2fSmrg
9728b425557eSmrg# sed scripts:
9729b425557eSmrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
9730b425557eSmrgmy_sed_long_arg='1s/^-[[^=]]*=//'
9731b425557eSmrg
9732b425557eSmrg# func_opt_split
9733b425557eSmrgfunc_opt_split ()
9734b425557eSmrg{
9735b425557eSmrg  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
9736b425557eSmrg  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
9737b425557eSmrg}
973834977a2fSmrg
9739b425557eSmrg# func_lo2o object
9740b425557eSmrgfunc_lo2o ()
9741b425557eSmrg{
9742b425557eSmrg  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
9743b425557eSmrg}
974434977a2fSmrg
9745b425557eSmrg# func_xform libobj-or-source
9746b425557eSmrgfunc_xform ()
9747b425557eSmrg{
9748b425557eSmrg  func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
9749b425557eSmrg}
975034977a2fSmrg
9751b425557eSmrg# func_arith arithmetic-term...
9752b425557eSmrgfunc_arith ()
9753b425557eSmrg{
9754b425557eSmrg  func_arith_result=`expr "$[@]"`
9755b425557eSmrg}
975634977a2fSmrg
9757b425557eSmrg# func_len string
9758b425557eSmrg# STRING may not start with a hyphen.
9759b425557eSmrgfunc_len ()
9760b425557eSmrg{
9761b425557eSmrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
9762b425557eSmrg}
976334977a2fSmrg
9764b425557eSmrg_LT_EOF
9765b425557eSmrgesac
976634977a2fSmrg
9767b425557eSmrgcase $lt_shell_append in
9768b425557eSmrg  yes)
9769b425557eSmrg    cat << \_LT_EOF >> "$cfgfile"
9770b425557eSmrg
9771b425557eSmrg# func_append var value
9772b425557eSmrg# Append VALUE to the end of shell variable VAR.
9773b425557eSmrgfunc_append ()
9774b425557eSmrg{
9775b425557eSmrg  eval "$[1]+=\$[2]"
9776b425557eSmrg}
9777b425557eSmrg_LT_EOF
9778b425557eSmrg    ;;
977934977a2fSmrg  *)
9780b425557eSmrg    cat << \_LT_EOF >> "$cfgfile"
9781b425557eSmrg
9782b425557eSmrg# func_append var value
9783b425557eSmrg# Append VALUE to the end of shell variable VAR.
9784b425557eSmrgfunc_append ()
9785b425557eSmrg{
9786b425557eSmrg  eval "$[1]=\$$[1]\$[2]"
9787b425557eSmrg}
9788b425557eSmrg
9789b425557eSmrg_LT_EOF
9790b425557eSmrg    ;;
979134977a2fSmrg  esac
979234977a2fSmrg])
979334977a2fSmrg
9794b425557eSmrg# Helper functions for option handling.                    -*- Autoconf -*-
9795ee3138f1Smrg#
9796b425557eSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9797b425557eSmrg#   Inc.
9798b425557eSmrg#   Written by Gary V. Vaughan, 2004
9799b425557eSmrg#
9800b425557eSmrg# This file is free software; the Free Software Foundation gives
9801b425557eSmrg# unlimited permission to copy and/or distribute it, with or without
9802b425557eSmrg# modifications, as long as this notice is preserved.
980334977a2fSmrg
9804b425557eSmrg# serial 7 ltoptions.m4
980534977a2fSmrg
9806b425557eSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9807b425557eSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
980834977a2fSmrg
980934977a2fSmrg
9810b425557eSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9811b425557eSmrg# ------------------------------------------
9812b425557eSmrgm4_define([_LT_MANGLE_OPTION],
9813b425557eSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
981434977a2fSmrg
981534977a2fSmrg
9816b425557eSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9817b425557eSmrg# ---------------------------------------
9818b425557eSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9819b425557eSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9820b425557eSmrg# saved as a flag.
9821b425557eSmrgm4_define([_LT_SET_OPTION],
9822b425557eSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9823b425557eSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9824b425557eSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
9825b425557eSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
9826b425557eSmrg])
982734977a2fSmrg
9828ee3138f1Smrg
9829b425557eSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9830b425557eSmrg# ------------------------------------------------------------
983134977a2fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9832b425557eSmrgm4_define([_LT_IF_OPTION],
9833b425557eSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9834ee3138f1Smrg
9835ee3138f1Smrg
9836b425557eSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9837b425557eSmrg# -------------------------------------------------------
9838b425557eSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9839b425557eSmrg# are set.
9840b425557eSmrgm4_define([_LT_UNLESS_OPTIONS],
9841b425557eSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9842b425557eSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9843b425557eSmrg		      [m4_define([$0_found])])])[]dnl
9844b425557eSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9845b425557eSmrg])[]dnl
9846b425557eSmrg])
9847ee3138f1Smrg
9848ee3138f1Smrg
9849b425557eSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9850b425557eSmrg# ----------------------------------------
9851b425557eSmrg# OPTION-LIST is a space-separated list of Libtool options associated
9852b425557eSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
9853b425557eSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9854b425557eSmrg# the unknown option and exit.
9855b425557eSmrgm4_defun([_LT_SET_OPTIONS],
9856b425557eSmrg[# Set options
9857b425557eSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9858b425557eSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
985934977a2fSmrg
9860b425557eSmrgm4_if([$1],[LT_INIT],[
9861b425557eSmrg  dnl
9862b425557eSmrg  dnl Simply set some default values (i.e off) if boolean options were not
9863b425557eSmrg  dnl specified:
9864b425557eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9865b425557eSmrg  ])
9866b425557eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9867b425557eSmrg  ])
9868b425557eSmrg  dnl
9869b425557eSmrg  dnl If no reference was made to various pairs of opposing options, then
9870b425557eSmrg  dnl we run the default mode handler for the pair.  For example, if neither
9871b425557eSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9872b425557eSmrg  dnl archives by default:
9873b425557eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9874b425557eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9875b425557eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9876b425557eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9877b425557eSmrg  		   [_LT_ENABLE_FAST_INSTALL])
9878b425557eSmrg  ])
9879b425557eSmrg])# _LT_SET_OPTIONS
9880b425557eSmrg
9881b425557eSmrg
9882b425557eSmrg
9883b425557eSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9884b425557eSmrg# -----------------------------------------
9885b425557eSmrgm4_define([_LT_MANGLE_DEFUN],
9886b425557eSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9887b425557eSmrg
9888b425557eSmrg
9889b425557eSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9890b425557eSmrg# -----------------------------------------------
9891b425557eSmrgm4_define([LT_OPTION_DEFINE],
9892b425557eSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9893b425557eSmrg])# LT_OPTION_DEFINE
989434977a2fSmrg
989534977a2fSmrg
9896b425557eSmrg# dlopen
9897b425557eSmrg# ------
9898b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9899b425557eSmrg])
9900ee3138f1Smrg
9901b425557eSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
9902b425557eSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
9903b425557eSmrgAC_DIAGNOSE([obsolete],
9904b425557eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9905b425557eSmrgput the `dlopen' option into LT_INIT's first parameter.])
9906b425557eSmrg])
9907ee3138f1Smrg
9908b425557eSmrgdnl aclocal-1.4 backwards compatibility:
9909b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9910ee3138f1Smrg
9911b425557eSmrg
9912b425557eSmrg# win32-dll
9913b425557eSmrg# ---------
9914b425557eSmrg# Declare package support for building win32 dll's.
9915b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
9916b425557eSmrg[enable_win32_dll=yes
9917b425557eSmrg
9918b425557eSmrgcase $host in
9919b425557eSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9920b425557eSmrg  AC_CHECK_TOOL(AS, as, false)
9921b425557eSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9922b425557eSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9923b425557eSmrg  ;;
992434977a2fSmrgesac
9925ee3138f1Smrg
9926b425557eSmrgtest -z "$AS" && AS=as
9927b425557eSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
9928ee3138f1Smrg
9929b425557eSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
9930b425557eSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9931ee3138f1Smrg
9932b425557eSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
9933b425557eSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9934b425557eSmrg])# win32-dll
9935ee3138f1Smrg
9936b425557eSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9937b425557eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9938b425557eSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
9939b425557eSmrgAC_DIAGNOSE([obsolete],
9940b425557eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9941b425557eSmrgput the `win32-dll' option into LT_INIT's first parameter.])
9942b425557eSmrg])
9943ee3138f1Smrg
9944b425557eSmrgdnl aclocal-1.4 backwards compatibility:
9945b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9946ee3138f1Smrg
9947ee3138f1Smrg
9948b425557eSmrg# _LT_ENABLE_SHARED([DEFAULT])
9949b425557eSmrg# ----------------------------
9950b425557eSmrg# implement the --enable-shared flag, and supports the `shared' and
9951b425557eSmrg# `disable-shared' LT_INIT options.
9952b425557eSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9953b425557eSmrgm4_define([_LT_ENABLE_SHARED],
9954b425557eSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9955b425557eSmrgAC_ARG_ENABLE([shared],
9956b425557eSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9957b425557eSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9958b425557eSmrg    [p=${PACKAGE-default}
9959b425557eSmrg    case $enableval in
9960b425557eSmrg    yes) enable_shared=yes ;;
9961b425557eSmrg    no) enable_shared=no ;;
9962b425557eSmrg    *)
9963b425557eSmrg      enable_shared=no
9964b425557eSmrg      # Look at the argument we got.  We use all the common list separators.
9965b425557eSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9966b425557eSmrg      for pkg in $enableval; do
9967b425557eSmrg	IFS="$lt_save_ifs"
9968b425557eSmrg	if test "X$pkg" = "X$p"; then
9969b425557eSmrg	  enable_shared=yes
9970b425557eSmrg	fi
9971b425557eSmrg      done
9972b425557eSmrg      IFS="$lt_save_ifs"
9973b425557eSmrg      ;;
9974b425557eSmrg    esac],
9975b425557eSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9976ee3138f1Smrg
9977b425557eSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9978b425557eSmrg	[Whether or not to build shared libraries])
9979b425557eSmrg])# _LT_ENABLE_SHARED
9980ee3138f1Smrg
9981b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9982b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9983ee3138f1Smrg
9984b425557eSmrg# Old names:
9985b425557eSmrgAC_DEFUN([AC_ENABLE_SHARED],
9986b425557eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9987b425557eSmrg])
998834977a2fSmrg
9989b425557eSmrgAC_DEFUN([AC_DISABLE_SHARED],
9990b425557eSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
9991b425557eSmrg])
999234977a2fSmrg
9993b425557eSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9994b425557eSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9995ee3138f1Smrg
9996b425557eSmrgdnl aclocal-1.4 backwards compatibility:
9997b425557eSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
9998b425557eSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
9999b425557eSmrg
10000b425557eSmrg
10001b425557eSmrg
10002b425557eSmrg# _LT_ENABLE_STATIC([DEFAULT])
10003b425557eSmrg# ----------------------------
10004b425557eSmrg# implement the --enable-static flag, and support the `static' and
10005b425557eSmrg# `disable-static' LT_INIT options.
10006b425557eSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
10007b425557eSmrgm4_define([_LT_ENABLE_STATIC],
10008b425557eSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
10009b425557eSmrgAC_ARG_ENABLE([static],
10010b425557eSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
10011b425557eSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
10012b425557eSmrg    [p=${PACKAGE-default}
10013b425557eSmrg    case $enableval in
10014b425557eSmrg    yes) enable_static=yes ;;
10015b425557eSmrg    no) enable_static=no ;;
10016b425557eSmrg    *)
10017b425557eSmrg     enable_static=no
10018b425557eSmrg      # Look at the argument we got.  We use all the common list separators.
10019b425557eSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
10020b425557eSmrg      for pkg in $enableval; do
10021b425557eSmrg	IFS="$lt_save_ifs"
10022b425557eSmrg	if test "X$pkg" = "X$p"; then
10023b425557eSmrg	  enable_static=yes
10024b425557eSmrg	fi
10025b425557eSmrg      done
10026b425557eSmrg      IFS="$lt_save_ifs"
10027b425557eSmrg      ;;
10028b425557eSmrg    esac],
10029b425557eSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
10030ee3138f1Smrg
10031b425557eSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
10032b425557eSmrg	[Whether or not to build static libraries])
10033b425557eSmrg])# _LT_ENABLE_STATIC
10034ee3138f1Smrg
10035b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
10036b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
10037ee3138f1Smrg
10038b425557eSmrg# Old names:
10039b425557eSmrgAC_DEFUN([AC_ENABLE_STATIC],
10040b425557eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
10041b425557eSmrg])
10042ee3138f1Smrg
10043b425557eSmrgAC_DEFUN([AC_DISABLE_STATIC],
10044b425557eSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
10045b425557eSmrg])
10046ee3138f1Smrg
10047b425557eSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
10048b425557eSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
10049ee3138f1Smrg
10050b425557eSmrgdnl aclocal-1.4 backwards compatibility:
10051b425557eSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
10052b425557eSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
10053ee3138f1Smrg
10054ee3138f1Smrg
10055ee3138f1Smrg
10056b425557eSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
10057b425557eSmrg# ----------------------------------
10058b425557eSmrg# implement the --enable-fast-install flag, and support the `fast-install'
10059b425557eSmrg# and `disable-fast-install' LT_INIT options.
10060b425557eSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
10061b425557eSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
10062b425557eSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
10063b425557eSmrgAC_ARG_ENABLE([fast-install],
10064b425557eSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
10065b425557eSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
10066b425557eSmrg    [p=${PACKAGE-default}
10067b425557eSmrg    case $enableval in
10068b425557eSmrg    yes) enable_fast_install=yes ;;
10069b425557eSmrg    no) enable_fast_install=no ;;
10070b425557eSmrg    *)
10071b425557eSmrg      enable_fast_install=no
10072b425557eSmrg      # Look at the argument we got.  We use all the common list separators.
10073b425557eSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
10074b425557eSmrg      for pkg in $enableval; do
10075b425557eSmrg	IFS="$lt_save_ifs"
10076b425557eSmrg	if test "X$pkg" = "X$p"; then
10077b425557eSmrg	  enable_fast_install=yes
10078b425557eSmrg	fi
10079b425557eSmrg      done
10080b425557eSmrg      IFS="$lt_save_ifs"
10081b425557eSmrg      ;;
10082b425557eSmrg    esac],
10083b425557eSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
10084ee3138f1Smrg
10085b425557eSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
10086b425557eSmrg	 [Whether or not to optimize for fast installation])dnl
10087b425557eSmrg])# _LT_ENABLE_FAST_INSTALL
10088ee3138f1Smrg
10089b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
10090b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
10091ee3138f1Smrg
10092b425557eSmrg# Old names:
10093b425557eSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
10094b425557eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
10095b425557eSmrgAC_DIAGNOSE([obsolete],
10096b425557eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
10097b425557eSmrgthe `fast-install' option into LT_INIT's first parameter.])
10098b425557eSmrg])
10099ee3138f1Smrg
10100b425557eSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
10101b425557eSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
10102b425557eSmrgAC_DIAGNOSE([obsolete],
10103b425557eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
10104b425557eSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
10105b425557eSmrg])
10106ee3138f1Smrg
10107b425557eSmrgdnl aclocal-1.4 backwards compatibility:
10108b425557eSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
10109b425557eSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
10110ee3138f1Smrg
10111ee3138f1Smrg
10112b425557eSmrg# _LT_WITH_PIC([MODE])
10113b425557eSmrg# --------------------
10114b425557eSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
10115b425557eSmrg# LT_INIT options.
10116b425557eSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
10117b425557eSmrgm4_define([_LT_WITH_PIC],
10118b425557eSmrg[AC_ARG_WITH([pic],
10119b425557eSmrg    [AS_HELP_STRING([--with-pic],
10120b425557eSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
10121b425557eSmrg    [pic_mode="$withval"],
10122b425557eSmrg    [pic_mode=default])
10123ee3138f1Smrg
10124b425557eSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
10125ee3138f1Smrg
10126b425557eSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
10127b425557eSmrg])# _LT_WITH_PIC
10128ee3138f1Smrg
10129b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
10130b425557eSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
10131ee3138f1Smrg
10132b425557eSmrg# Old name:
10133b425557eSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
10134b425557eSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
10135b425557eSmrgAC_DIAGNOSE([obsolete],
10136b425557eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
10137b425557eSmrgput the `pic-only' option into LT_INIT's first parameter.])
10138b425557eSmrg])
10139ee3138f1Smrg
10140b425557eSmrgdnl aclocal-1.4 backwards compatibility:
10141b425557eSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
10142ee3138f1Smrg
10143ee3138f1Smrg
10144b425557eSmrgm4_define([_LTDL_MODE], [])
10145b425557eSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
10146b425557eSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
10147b425557eSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
10148b425557eSmrg		 [m4_define([_LTDL_MODE], [recursive])])
10149b425557eSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
10150b425557eSmrg		 [m4_define([_LTDL_MODE], [subproject])])
10151ee3138f1Smrg
10152b425557eSmrgm4_define([_LTDL_TYPE], [])
10153b425557eSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
10154b425557eSmrg		 [m4_define([_LTDL_TYPE], [installable])])
10155b425557eSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
10156b425557eSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
10157ee3138f1Smrg
10158b425557eSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
10159b425557eSmrg#
10160b425557eSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
10161b425557eSmrg# Written by Gary V. Vaughan, 2004
10162b425557eSmrg#
10163b425557eSmrg# This file is free software; the Free Software Foundation gives
10164b425557eSmrg# unlimited permission to copy and/or distribute it, with or without
10165b425557eSmrg# modifications, as long as this notice is preserved.
10166ee3138f1Smrg
10167b425557eSmrg# serial 6 ltsugar.m4
10168ee3138f1Smrg
10169b425557eSmrg# This is to help aclocal find these macros, as it can't see m4_define.
10170b425557eSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
10171ee3138f1Smrg
10172ee3138f1Smrg
10173b425557eSmrg# lt_join(SEP, ARG1, [ARG2...])
10174b425557eSmrg# -----------------------------
10175b425557eSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
10176b425557eSmrg# associated separator.
10177b425557eSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
10178b425557eSmrg# versions in m4sugar had bugs.
10179b425557eSmrgm4_define([lt_join],
10180b425557eSmrg[m4_if([$#], [1], [],
10181b425557eSmrg       [$#], [2], [[$2]],
10182b425557eSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
10183b425557eSmrgm4_define([_lt_join],
10184b425557eSmrg[m4_if([$#$2], [2], [],
10185b425557eSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
10186ee3138f1Smrg
10187ee3138f1Smrg
10188b425557eSmrg# lt_car(LIST)
10189b425557eSmrg# lt_cdr(LIST)
10190b425557eSmrg# ------------
10191b425557eSmrg# Manipulate m4 lists.
10192b425557eSmrg# These macros are necessary as long as will still need to support
10193b425557eSmrg# Autoconf-2.59 which quotes differently.
10194b425557eSmrgm4_define([lt_car], [[$1]])
10195b425557eSmrgm4_define([lt_cdr],
10196b425557eSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
10197b425557eSmrg       [$#], 1, [],
10198b425557eSmrg       [m4_dquote(m4_shift($@))])])
10199b425557eSmrgm4_define([lt_unquote], $1)
10200ee3138f1Smrg
10201ee3138f1Smrg
10202b425557eSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
10203b425557eSmrg# ------------------------------------------
10204b425557eSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
10205b425557eSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
10206b425557eSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
10207b425557eSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
10208b425557eSmrg# than defined and empty).
10209b425557eSmrg#
10210b425557eSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
10211b425557eSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
10212b425557eSmrgm4_define([lt_append],
10213b425557eSmrg[m4_define([$1],
10214b425557eSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
10215ee3138f1Smrg
10216ee3138f1Smrg
10217ee3138f1Smrg
10218b425557eSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
10219b425557eSmrg# ----------------------------------------------------------
10220b425557eSmrg# Produce a SEP delimited list of all paired combinations of elements of
10221b425557eSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
10222b425557eSmrg# has the form PREFIXmINFIXSUFFIXn.
10223b425557eSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
10224b425557eSmrgm4_define([lt_combine],
10225b425557eSmrg[m4_if(m4_eval([$# > 3]), [1],
10226b425557eSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
10227b425557eSmrg[[m4_foreach([_Lt_prefix], [$2],
10228b425557eSmrg	     [m4_foreach([_Lt_suffix],
10229b425557eSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
10230b425557eSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
10231ee3138f1Smrg
10232ee3138f1Smrg
10233b425557eSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
10234b425557eSmrg# -----------------------------------------------------------------------
10235b425557eSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
10236b425557eSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
10237b425557eSmrgm4_define([lt_if_append_uniq],
10238b425557eSmrg[m4_ifdef([$1],
10239b425557eSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
10240b425557eSmrg		 [lt_append([$1], [$2], [$3])$4],
10241b425557eSmrg		 [$5])],
10242b425557eSmrg	  [lt_append([$1], [$2], [$3])$4])])
10243ee3138f1Smrg
10244ee3138f1Smrg
10245b425557eSmrg# lt_dict_add(DICT, KEY, VALUE)
10246b425557eSmrg# -----------------------------
10247b425557eSmrgm4_define([lt_dict_add],
10248b425557eSmrg[m4_define([$1($2)], [$3])])
10249ee3138f1Smrg
10250ee3138f1Smrg
10251b425557eSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
10252b425557eSmrg# --------------------------------------------
10253b425557eSmrgm4_define([lt_dict_add_subkey],
10254b425557eSmrg[m4_define([$1($2:$3)], [$4])])
10255ee3138f1Smrg
10256ee3138f1Smrg
10257b425557eSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
10258b425557eSmrg# ----------------------------------
10259b425557eSmrgm4_define([lt_dict_fetch],
10260b425557eSmrg[m4_ifval([$3],
10261b425557eSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
10262b425557eSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
10263ee3138f1Smrg
10264ee3138f1Smrg
10265b425557eSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
10266b425557eSmrg# -----------------------------------------------------------------
10267b425557eSmrgm4_define([lt_if_dict_fetch],
10268b425557eSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
10269b425557eSmrg	[$5],
10270b425557eSmrg    [$6])])
10271ee3138f1Smrg
10272ee3138f1Smrg
10273b425557eSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
10274b425557eSmrg# --------------------------------------------------------------
10275b425557eSmrgm4_define([lt_dict_filter],
10276b425557eSmrg[m4_if([$5], [], [],
10277b425557eSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
10278b425557eSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
10279b425557eSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
10280b425557eSmrg])
10281ee3138f1Smrg
10282b425557eSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
1028334977a2fSmrg#
10284b425557eSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
10285b425557eSmrg#   Written by Scott James Remnant, 2004
1028634977a2fSmrg#
10287b425557eSmrg# This file is free software; the Free Software Foundation gives
10288b425557eSmrg# unlimited permission to copy and/or distribute it, with or without
10289b425557eSmrg# modifications, as long as this notice is preserved.
10290ee3138f1Smrg
10291b425557eSmrg# Generated from ltversion.in.
1029234977a2fSmrg
10293b425557eSmrg# serial 3175 ltversion.m4
10294b425557eSmrg# This file is part of GNU Libtool
10295ee3138f1Smrg
10296b425557eSmrgm4_define([LT_PACKAGE_VERSION], [2.2.10])
10297b425557eSmrgm4_define([LT_PACKAGE_REVISION], [1.3175])
10298b425557eSmrg
10299b425557eSmrgAC_DEFUN([LTVERSION_VERSION],
10300b425557eSmrg[macro_version='2.2.10'
10301b425557eSmrgmacro_revision='1.3175'
10302b425557eSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
10303b425557eSmrg_LT_DECL(, macro_revision, 0)
10304b425557eSmrg])
10305b425557eSmrg
10306b425557eSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
10307ee3138f1Smrg#
10308b425557eSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
10309b425557eSmrg#   Written by Scott James Remnant, 2004.
10310ee3138f1Smrg#
10311b425557eSmrg# This file is free software; the Free Software Foundation gives
10312b425557eSmrg# unlimited permission to copy and/or distribute it, with or without
10313b425557eSmrg# modifications, as long as this notice is preserved.
10314ee3138f1Smrg
10315b425557eSmrg# serial 5 lt~obsolete.m4
1031634977a2fSmrg
10317b425557eSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
10318ee3138f1Smrg#
10319b425557eSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
10320b425557eSmrg# which have later been changed to m4_define as they aren't part of the
10321b425557eSmrg# exported API, or moved to Autoconf or Automake where they belong.
10322ee3138f1Smrg#
10323b425557eSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
10324b425557eSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
10325b425557eSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
10326b425557eSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
10327b425557eSmrg# and doesn't know about Autoconf macros at all.)
1032834977a2fSmrg#
10329b425557eSmrg# So we provide this file, which has a silly filename so it's always
10330b425557eSmrg# included after everything else.  This provides aclocal with the
10331b425557eSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
10332b425557eSmrg# because those macros already exist, or will be overwritten later.
10333b425557eSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
10334b425557eSmrg#
10335b425557eSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
10336b425557eSmrg# Yes, that means every name once taken will need to remain here until
10337b425557eSmrg# we give up compatibility with versions before 1.7, at which point
10338b425557eSmrg# we need to keep only those names which we still refer to.
10339ee3138f1Smrg
10340b425557eSmrg# This is to help aclocal find these macros, as it can't see m4_define.
10341b425557eSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
10342ee3138f1Smrg
10343b425557eSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
10344b425557eSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
10345b425557eSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
10346b425557eSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
10347b425557eSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
10348b425557eSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
10349b425557eSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
10350b425557eSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
10351b425557eSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
10352b425557eSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
10353b425557eSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
10354b425557eSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
10355b425557eSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
10356b425557eSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
10357b425557eSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
10358b425557eSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
10359b425557eSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
10360b425557eSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
10361b425557eSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
10362b425557eSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
10363b425557eSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
10364b425557eSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
10365b425557eSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
10366b425557eSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
10367b425557eSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
10368b425557eSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
10369b425557eSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
10370b425557eSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
10371b425557eSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
10372b425557eSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
10373b425557eSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
10374b425557eSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
10375b425557eSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
10376b425557eSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
10377b425557eSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
10378b425557eSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
10379b425557eSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
10380b425557eSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
10381b425557eSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
10382b425557eSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
10383b425557eSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
10384b425557eSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
10385b425557eSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
10386b425557eSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
10387b425557eSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
10388b425557eSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
10389b425557eSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
10390b425557eSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
10391b425557eSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
10392b425557eSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
10393b425557eSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
10394b425557eSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
10395b425557eSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
10396b425557eSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
10397b425557eSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
10398b425557eSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
10399b425557eSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
10400b425557eSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
10401b425557eSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
10402b425557eSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
10403b425557eSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
10404ee3138f1Smrg
10405