aclocal.m4 revision b73be646
1b73be646Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2659607e0Smrg
3659607e0Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4fc27e79cSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5659607e0Smrg# This file is free software; the Free Software Foundation
6659607e0Smrg# gives unlimited permission to copy and/or distribute it,
7659607e0Smrg# with or without modifications, as long as this notice is preserved.
8659607e0Smrg
9659607e0Smrg# This program is distributed in the hope that it will be useful,
10659607e0Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11659607e0Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12659607e0Smrg# PARTICULAR PURPOSE.
13659607e0Smrg
14fc27e79cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15fc27e79cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b73be646Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
17b73be646Smrg[m4_warning([this file was generated for autoconf 2.65.
18fc27e79cSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19fc27e79cSmrgIf you have problems, you may need to regenerate the build system entirely.
20fc27e79cSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21659607e0Smrg
22b73be646Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
236aab59a7Smrg#
24b73be646Smrg# This file is free software; the Free Software Foundation
25b73be646Smrg# gives unlimited permission to copy and/or distribute it,
26b73be646Smrg# with or without modifications, as long as this notice is preserved.
27b73be646Smrg
28b73be646Smrg# AM_AUTOMAKE_VERSION(VERSION)
29b73be646Smrg# ----------------------------
30b73be646Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31b73be646Smrg# generated from the m4 files accompanying Automake X.Y.
32b73be646Smrg# (This private macro should not be called outside this file.)
33b73be646SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34b73be646Smrg[am__api_version='1.11'
35b73be646Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36b73be646Smrgdnl require some minimum version.  Point them to the right macro.
37b73be646Smrgm4_if([$1], [1.11.1], [],
38b73be646Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39b73be646Smrg])
40b73be646Smrg
41b73be646Smrg# _AM_AUTOCONF_VERSION(VERSION)
42b73be646Smrg# -----------------------------
43b73be646Smrg# aclocal traces this macro to find the Autoconf version.
44b73be646Smrg# This is a private macro too.  Using m4_define simplifies
45b73be646Smrg# the logic in aclocal, which can simply ignore this definition.
46b73be646Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47b73be646Smrg
48b73be646Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49b73be646Smrg# -------------------------------
50b73be646Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51b73be646Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52b73be646SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53b73be646Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54b73be646Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55b73be646Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56b73be646Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57b73be646Smrg
58b73be646Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59b73be646Smrg
60b73be646Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
616aab59a7Smrg#
62b73be646Smrg# This file is free software; the Free Software Foundation
63b73be646Smrg# gives unlimited permission to copy and/or distribute it,
64b73be646Smrg# with or without modifications, as long as this notice is preserved.
65fc27e79cSmrg
66b73be646Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67b73be646Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68b73be646Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
696aab59a7Smrg#
70b73be646Smrg# Of course, Automake must honor this variable whenever it calls a
71b73be646Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72b73be646Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73b73be646Smrg# depending on how configure is run.  This is pretty annoying, since
74b73be646Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75b73be646Smrg# source directory, any form will work fine, but in subdirectories a
76b73be646Smrg# relative path needs to be adjusted first.
776aab59a7Smrg#
78b73be646Smrg# $ac_aux_dir/missing
79b73be646Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80b73be646Smrg# $top_srcdir/$ac_aux_dir/missing
81b73be646Smrg#    fails if $ac_aux_dir is absolute,
82b73be646Smrg#    fails when called from a subdirectory in a VPATH build with
83b73be646Smrg#          a relative $ac_aux_dir
846aab59a7Smrg#
85b73be646Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86b73be646Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87b73be646Smrg# harmless because $srcdir is `.', but things will broke when you
88b73be646Smrg# start a VPATH build or use an absolute $srcdir.
896aab59a7Smrg#
90b73be646Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91b73be646Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92b73be646Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93b73be646Smrg# and then we would define $MISSING as
94b73be646Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95b73be646Smrg# This will work as long as MISSING is not called from configure, because
96b73be646Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97b73be646Smrg# However there are other variables, like CC, which are often used in
98b73be646Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
996aab59a7Smrg#
100b73be646Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101b73be646Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102b73be646Smrg# configured tree to be moved without reconfiguration.
103659607e0Smrg
104b73be646SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105b73be646Smrg[dnl Rely on autoconf to set up CDPATH properly.
106b73be646SmrgAC_PREREQ([2.50])dnl
107b73be646Smrg# expand $ac_aux_dir to an absolute path
108b73be646Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109fc27e79cSmrg])
110659607e0Smrg
111b73be646Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112659607e0Smrg
113b73be646Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114b73be646Smrg# Free Software Foundation, Inc.
115b73be646Smrg#
116b73be646Smrg# This file is free software; the Free Software Foundation
117b73be646Smrg# gives unlimited permission to copy and/or distribute it,
118b73be646Smrg# with or without modifications, as long as this notice is preserved.
119659607e0Smrg
120b73be646Smrg# serial 9
121659607e0Smrg
122b73be646Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123b73be646Smrg# -------------------------------------
124b73be646Smrg# Define a conditional.
125b73be646SmrgAC_DEFUN([AM_CONDITIONAL],
126b73be646Smrg[AC_PREREQ(2.52)dnl
127b73be646Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128b73be646Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129b73be646SmrgAC_SUBST([$1_TRUE])dnl
130b73be646SmrgAC_SUBST([$1_FALSE])dnl
131b73be646Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132b73be646Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133b73be646Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134b73be646Smrgif $2; then
135b73be646Smrg  $1_TRUE=
136b73be646Smrg  $1_FALSE='#'
137b73be646Smrgelse
138b73be646Smrg  $1_TRUE='#'
139b73be646Smrg  $1_FALSE=
140b73be646Smrgfi
141b73be646SmrgAC_CONFIG_COMMANDS_PRE(
142b73be646Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143b73be646Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144b73be646SmrgUsually this means the macro was only invoked conditionally.]])
145b73be646Smrgfi])])
146659607e0Smrg
147b73be646Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148b73be646Smrg# Free Software Foundation, Inc.
149b73be646Smrg#
150b73be646Smrg# This file is free software; the Free Software Foundation
151b73be646Smrg# gives unlimited permission to copy and/or distribute it,
152b73be646Smrg# with or without modifications, as long as this notice is preserved.
153659607e0Smrg
154b73be646Smrg# serial 10
155659607e0Smrg
156b73be646Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157b73be646Smrg# written in clear, in which case automake, when reading aclocal.m4,
158b73be646Smrg# will think it sees a *use*, and therefore will trigger all it's
159b73be646Smrg# C support machinery.  Also note that it means that autoscan, seeing
160b73be646Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161fc27e79cSmrg
162fc27e79cSmrg
163b73be646Smrg# _AM_DEPENDENCIES(NAME)
164fc27e79cSmrg# ----------------------
165b73be646Smrg# See how the compiler implements dependency checking.
166b73be646Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167b73be646Smrg# We try a few techniques and use that to set a single cache variable.
168b73be646Smrg#
169b73be646Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170b73be646Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171b73be646Smrg# dependency, and given that the user is not expected to run this macro,
172b73be646Smrg# just rely on AC_PROG_CC.
173b73be646SmrgAC_DEFUN([_AM_DEPENDENCIES],
174b73be646Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175b73be646SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176b73be646SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177b73be646SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178fc27e79cSmrg
179b73be646Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180b73be646Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181b73be646Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182b73be646Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183b73be646Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184b73be646Smrg                   [depcc="$$1"   am_compiler_list=])
185fc27e79cSmrg
186b73be646SmrgAC_CACHE_CHECK([dependency style of $depcc],
187b73be646Smrg               [am_cv_$1_dependencies_compiler_type],
188b73be646Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189b73be646Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190b73be646Smrg  # making bogus files that we don't know about and never remove.  For
191b73be646Smrg  # instance it was reported that on HP-UX the gcc test will end up
192b73be646Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193b73be646Smrg  # in D'.
194b73be646Smrg  mkdir conftest.dir
195b73be646Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196b73be646Smrg  # using a relative directory.
197b73be646Smrg  cp "$am_depcomp" conftest.dir
198b73be646Smrg  cd conftest.dir
199b73be646Smrg  # We will build objects and dependencies in a subdirectory because
200b73be646Smrg  # it helps to detect inapplicable dependency modes.  For instance
201b73be646Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202b73be646Smrg  # side effect of compilation, but ICC will put the dependencies in
203b73be646Smrg  # the current directory while Tru64 will put them in the object
204b73be646Smrg  # directory.
205b73be646Smrg  mkdir sub
206659607e0Smrg
207b73be646Smrg  am_cv_$1_dependencies_compiler_type=none
208b73be646Smrg  if test "$am_compiler_list" = ""; then
209b73be646Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210fc27e79cSmrg  fi
211b73be646Smrg  am__universal=false
212b73be646Smrg  m4_case([$1], [CC],
213b73be646Smrg    [case " $depcc " in #(
214b73be646Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215b73be646Smrg     esac],
216b73be646Smrg    [CXX],
217b73be646Smrg    [case " $depcc " in #(
218b73be646Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219b73be646Smrg     esac])
220659607e0Smrg
221b73be646Smrg  for depmode in $am_compiler_list; do
222b73be646Smrg    # Setup a source with many dependencies, because some compilers
223b73be646Smrg    # like to wrap large dependency lists on column 80 (with \), and
224b73be646Smrg    # we should not choose a depcomp mode which is confused by this.
225b73be646Smrg    #
226b73be646Smrg    # We need to recreate these files for each test, as the compiler may
227b73be646Smrg    # overwrite some of them when testing with obscure command lines.
228b73be646Smrg    # This happens at least with the AIX C compiler.
229b73be646Smrg    : > sub/conftest.c
230b73be646Smrg    for i in 1 2 3 4 5 6; do
231b73be646Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232b73be646Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233b73be646Smrg      # Solaris 8's {/usr,}/bin/sh.
234b73be646Smrg      touch sub/conftst$i.h
235b73be646Smrg    done
236b73be646Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237659607e0Smrg
238b73be646Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239b73be646Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240b73be646Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241b73be646Smrg    # versions had trouble with output in subdirs
242b73be646Smrg    am__obj=sub/conftest.${OBJEXT-o}
243b73be646Smrg    am__minus_obj="-o $am__obj"
244b73be646Smrg    case $depmode in
245b73be646Smrg    gcc)
246b73be646Smrg      # This depmode causes a compiler race in universal mode.
247b73be646Smrg      test "$am__universal" = false || continue
248b73be646Smrg      ;;
249b73be646Smrg    nosideeffect)
250b73be646Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251b73be646Smrg      # only be used when explicitly requested
252b73be646Smrg      if test "x$enable_dependency_tracking" = xyes; then
253b73be646Smrg	continue
254b73be646Smrg      else
255b73be646Smrg	break
256b73be646Smrg      fi
257b73be646Smrg      ;;
258b73be646Smrg    msvisualcpp | msvcmsys)
259b73be646Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
260b73be646Smrg      # not run yet.  These depmodes are late enough in the game, and
261b73be646Smrg      # so weak that their functioning should not be impacted.
262b73be646Smrg      am__obj=conftest.${OBJEXT-o}
263b73be646Smrg      am__minus_obj=
264b73be646Smrg      ;;
265b73be646Smrg    none) break ;;
266b73be646Smrg    esac
267b73be646Smrg    if depmode=$depmode \
268b73be646Smrg       source=sub/conftest.c object=$am__obj \
269b73be646Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270b73be646Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271b73be646Smrg         >/dev/null 2>conftest.err &&
272b73be646Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273b73be646Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274b73be646Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275b73be646Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276b73be646Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277b73be646Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278b73be646Smrg      # that says an option was ignored or not supported.
279b73be646Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280b73be646Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281b73be646Smrg      # The diagnosis changed in icc 8.0:
282b73be646Smrg      #   icc: Command line remark: option '-MP' not supported
283b73be646Smrg      if (grep 'ignoring option' conftest.err ||
284b73be646Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285b73be646Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286b73be646Smrg        break
287b73be646Smrg      fi
288b73be646Smrg    fi
289b73be646Smrg  done
290659607e0Smrg
291b73be646Smrg  cd ..
292b73be646Smrg  rm -rf conftest.dir
293b73be646Smrgelse
294b73be646Smrg  am_cv_$1_dependencies_compiler_type=none
295b73be646Smrgfi
296b73be646Smrg])
297b73be646SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298b73be646SmrgAM_CONDITIONAL([am__fastdep$1], [
299b73be646Smrg  test "x$enable_dependency_tracking" != xno \
300b73be646Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301b73be646Smrg])
302659607e0Smrg
303659607e0Smrg
304b73be646Smrg# AM_SET_DEPDIR
305b73be646Smrg# -------------
306b73be646Smrg# Choose a directory name for dependency files.
307b73be646Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308b73be646SmrgAC_DEFUN([AM_SET_DEPDIR],
309b73be646Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310b73be646SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311b73be646Smrg])
312659607e0Smrg
313659607e0Smrg
314b73be646Smrg# AM_DEP_TRACK
315b73be646Smrg# ------------
316b73be646SmrgAC_DEFUN([AM_DEP_TRACK],
317b73be646Smrg[AC_ARG_ENABLE(dependency-tracking,
318b73be646Smrg[  --disable-dependency-tracking  speeds up one-time build
319b73be646Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320b73be646Smrgif test "x$enable_dependency_tracking" != xno; then
321b73be646Smrg  am_depcomp="$ac_aux_dir/depcomp"
322b73be646Smrg  AMDEPBACKSLASH='\'
323b73be646Smrgfi
324b73be646SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325b73be646SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326b73be646Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327b73be646Smrg])
328659607e0Smrg
329b73be646Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330659607e0Smrg
331b73be646Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332b73be646Smrg# Free Software Foundation, Inc.
333b73be646Smrg#
334b73be646Smrg# This file is free software; the Free Software Foundation
335b73be646Smrg# gives unlimited permission to copy and/or distribute it,
336b73be646Smrg# with or without modifications, as long as this notice is preserved.
337659607e0Smrg
338b73be646Smrg#serial 5
339659607e0Smrg
340b73be646Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341fc27e79cSmrg# ------------------------------
342b73be646SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343b73be646Smrg[{
344b73be646Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345b73be646Smrg  # are listed without --file.  Let's play safe and only enable the eval
346b73be646Smrg  # if we detect the quoting.
347b73be646Smrg  case $CONFIG_FILES in
348b73be646Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
349b73be646Smrg  *)   set x $CONFIG_FILES ;;
350b73be646Smrg  esac
351b73be646Smrg  shift
352b73be646Smrg  for mf
353b73be646Smrg  do
354b73be646Smrg    # Strip MF so we end up with the name of the file.
355b73be646Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356b73be646Smrg    # Check whether this is an Automake generated Makefile or not.
357b73be646Smrg    # We used to match only the files named `Makefile.in', but
358b73be646Smrg    # some people rename them; so instead we look at the file content.
359b73be646Smrg    # Grep'ing the first line is not enough: some people post-process
360b73be646Smrg    # each Makefile.in and add a new line on top of each file to say so.
361b73be646Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
362b73be646Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
363b73be646Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364b73be646Smrg      dirpart=`AS_DIRNAME("$mf")`
365b73be646Smrg    else
366b73be646Smrg      continue
367b73be646Smrg    fi
368b73be646Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
369b73be646Smrg    # from the Makefile without running `make'.
370b73be646Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371b73be646Smrg    test -z "$DEPDIR" && continue
372b73be646Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373b73be646Smrg    test -z "am__include" && continue
374b73be646Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375b73be646Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
376b73be646Smrg    U=`sed -n 's/^U = //p' < "$mf"`
377b73be646Smrg    # Find all dependency output files, they are included files with
378b73be646Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379b73be646Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380b73be646Smrg    # expansion.
381b73be646Smrg    for file in `sed -n "
382b73be646Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383b73be646Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384b73be646Smrg      # Make sure the directory exists.
385b73be646Smrg      test -f "$dirpart/$file" && continue
386b73be646Smrg      fdir=`AS_DIRNAME(["$file"])`
387b73be646Smrg      AS_MKDIR_P([$dirpart/$fdir])
388b73be646Smrg      # echo "creating $dirpart/$file"
389b73be646Smrg      echo '# dummy' > "$dirpart/$file"
390b73be646Smrg    done
391b73be646Smrg  done
392b73be646Smrg}
393b73be646Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394fc27e79cSmrg
395fc27e79cSmrg
396b73be646Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397fc27e79cSmrg# -----------------------------
398b73be646Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399b73be646Smrg#
400b73be646Smrg# This code is only required when automatic dependency tracking
401b73be646Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402b73be646Smrg# need in order to bootstrap the dependency handling code.
403b73be646SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404b73be646Smrg[AC_CONFIG_COMMANDS([depfiles],
405b73be646Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406b73be646Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407b73be646Smrg])
408fc27e79cSmrg
409b73be646Smrg# Do all the work for Automake.                             -*- Autoconf -*-
410fc27e79cSmrg
411b73be646Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412b73be646Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413b73be646Smrg#
414b73be646Smrg# This file is free software; the Free Software Foundation
415b73be646Smrg# gives unlimited permission to copy and/or distribute it,
416b73be646Smrg# with or without modifications, as long as this notice is preserved.
417fc27e79cSmrg
418b73be646Smrg# serial 16
419659607e0Smrg
420b73be646Smrg# This macro actually does too much.  Some checks are only needed if
421b73be646Smrg# your package does certain things.  But this isn't really a big deal.
422659607e0Smrg
423b73be646Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424b73be646Smrg# AM_INIT_AUTOMAKE([OPTIONS])
425b73be646Smrg# -----------------------------------------------
426b73be646Smrg# The call with PACKAGE and VERSION arguments is the old style
427b73be646Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428b73be646Smrg# and VERSION should now be passed to AC_INIT and removed from
429b73be646Smrg# the call to AM_INIT_AUTOMAKE.
430b73be646Smrg# We support both call styles for the transition.  After
431b73be646Smrg# the next Automake release, Autoconf can make the AC_INIT
432b73be646Smrg# arguments mandatory, and then we can depend on a new Autoconf
433b73be646Smrg# release and drop the old call support.
434b73be646SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435b73be646Smrg[AC_PREREQ([2.62])dnl
436b73be646Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437b73be646Smrgdnl the ones we care about.
438b73be646Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439b73be646SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440b73be646SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441b73be646Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442b73be646Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443b73be646Smrg  # is not polluted with repeated "-I."
444b73be646Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445b73be646Smrg  # test to see if srcdir already configured
446b73be646Smrg  if test -f $srcdir/config.status; then
447b73be646Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448b73be646Smrg  fi
449b73be646Smrgfi
450659607e0Smrg
451b73be646Smrg# test whether we have cygpath
452b73be646Smrgif test -z "$CYGPATH_W"; then
453b73be646Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454b73be646Smrg    CYGPATH_W='cygpath -w'
455b73be646Smrg  else
456b73be646Smrg    CYGPATH_W=echo
457b73be646Smrg  fi
458b73be646Smrgfi
459b73be646SmrgAC_SUBST([CYGPATH_W])
460659607e0Smrg
461b73be646Smrg# Define the identity of the package.
462b73be646Smrgdnl Distinguish between old-style and new-style calls.
463b73be646Smrgm4_ifval([$2],
464b73be646Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465b73be646Smrg AC_SUBST([PACKAGE], [$1])dnl
466b73be646Smrg AC_SUBST([VERSION], [$2])],
467b73be646Smrg[_AM_SET_OPTIONS([$1])dnl
468b73be646Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469b73be646Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470b73be646Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471b73be646Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472b73be646Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473659607e0Smrg
474b73be646Smrg_AM_IF_OPTION([no-define],,
475b73be646Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476b73be646Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477659607e0Smrg
478b73be646Smrg# Some tools Automake needs.
479b73be646SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480b73be646SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481b73be646SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482b73be646SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483b73be646SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484b73be646SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485b73be646SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486b73be646SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487b73be646SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488b73be646SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489b73be646Smrg# We need awk for the "check" target.  The system "awk" is bad on
490b73be646Smrg# some platforms.
491b73be646SmrgAC_REQUIRE([AC_PROG_AWK])dnl
492b73be646SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493b73be646SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494b73be646Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495b73be646Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496b73be646Smrg			     [_AM_PROG_TAR([v7])])])
497b73be646Smrg_AM_IF_OPTION([no-dependencies],,
498b73be646Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499b73be646Smrg		  [_AM_DEPENDENCIES(CC)],
500b73be646Smrg		  [define([AC_PROG_CC],
501b73be646Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502b73be646SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503b73be646Smrg		  [_AM_DEPENDENCIES(CXX)],
504b73be646Smrg		  [define([AC_PROG_CXX],
505b73be646Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506b73be646SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507b73be646Smrg		  [_AM_DEPENDENCIES(OBJC)],
508b73be646Smrg		  [define([AC_PROG_OBJC],
509b73be646Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510b73be646Smrg])
511b73be646Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512b73be646Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513b73be646Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514b73be646Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515b73be646SmrgAC_CONFIG_COMMANDS_PRE(dnl
516b73be646Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517b73be646Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518fc27e79cSmrg])
519659607e0Smrg
520b73be646Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521b73be646Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522b73be646Smrgdnl mangled by Autoconf and run in a shell conditional statement.
523b73be646Smrgm4_define([_AC_COMPILER_EXEEXT],
524b73be646Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525659607e0Smrg
526659607e0Smrg
527b73be646Smrg# When config.status generates a header, we must update the stamp-h file.
528b73be646Smrg# This file resides in the same directory as the config header
529b73be646Smrg# that is generated.  The stamp files are numbered to have different names.
530659607e0Smrg
531b73be646Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532b73be646Smrg# loop where config.status creates the headers, so we can generate
533b73be646Smrg# our stamp files there.
534b73be646SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535b73be646Smrg[# Compute $1's index in $config_headers.
536b73be646Smrg_am_arg=$1
537b73be646Smrg_am_stamp_count=1
538b73be646Smrgfor _am_header in $config_headers :; do
539b73be646Smrg  case $_am_header in
540b73be646Smrg    $_am_arg | $_am_arg:* )
541b73be646Smrg      break ;;
542b73be646Smrg    * )
543b73be646Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544b73be646Smrg  esac
545b73be646Smrgdone
546b73be646Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547659607e0Smrg
548b73be646Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549b73be646Smrg#
550b73be646Smrg# This file is free software; the Free Software Foundation
551b73be646Smrg# gives unlimited permission to copy and/or distribute it,
552b73be646Smrg# with or without modifications, as long as this notice is preserved.
553659607e0Smrg
554b73be646Smrg# AM_PROG_INSTALL_SH
555b73be646Smrg# ------------------
556b73be646Smrg# Define $install_sh.
557b73be646SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558b73be646Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559b73be646Smrgif test x"${install_sh}" != xset; then
560b73be646Smrg  case $am_aux_dir in
561b73be646Smrg  *\ * | *\	*)
562b73be646Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563b73be646Smrg  *)
564b73be646Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565b73be646Smrg  esac
566b73be646Smrgfi
567b73be646SmrgAC_SUBST(install_sh)])
568659607e0Smrg
569b73be646Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570b73be646Smrg#
571b73be646Smrg# This file is free software; the Free Software Foundation
572b73be646Smrg# gives unlimited permission to copy and/or distribute it,
573b73be646Smrg# with or without modifications, as long as this notice is preserved.
574659607e0Smrg
575b73be646Smrg# serial 2
576659607e0Smrg
577b73be646Smrg# Check whether the underlying file-system supports filenames
578b73be646Smrg# with a leading dot.  For instance MS-DOS doesn't.
579b73be646SmrgAC_DEFUN([AM_SET_LEADING_DOT],
580b73be646Smrg[rm -rf .tst 2>/dev/null
581b73be646Smrgmkdir .tst 2>/dev/null
582b73be646Smrgif test -d .tst; then
583b73be646Smrg  am__leading_dot=.
584b73be646Smrgelse
585b73be646Smrg  am__leading_dot=_
586b73be646Smrgfi
587b73be646Smrgrmdir .tst 2>/dev/null
588b73be646SmrgAC_SUBST([am__leading_dot])])
589659607e0Smrg
590b73be646Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591b73be646Smrg# From Jim Meyering
592fc27e79cSmrg
593b73be646Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594b73be646Smrg# Free Software Foundation, Inc.
595fc27e79cSmrg#
596b73be646Smrg# This file is free software; the Free Software Foundation
597b73be646Smrg# gives unlimited permission to copy and/or distribute it,
598b73be646Smrg# with or without modifications, as long as this notice is preserved.
599fc27e79cSmrg
600b73be646Smrg# serial 5
601fc27e79cSmrg
602b73be646Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
603b73be646Smrg# ----------------------------------
604b73be646Smrg# Control maintainer-specific portions of Makefiles.
605b73be646Smrg# Default is to disable them, unless `enable' is passed literally.
606b73be646Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
607b73be646Smrg# can override the default with the --enable/--disable switch.
608b73be646SmrgAC_DEFUN([AM_MAINTAINER_MODE],
609b73be646Smrg[m4_case(m4_default([$1], [disable]),
610b73be646Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
611b73be646Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
612b73be646Smrg       [m4_define([am_maintainer_other], [enable])
613b73be646Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614b73be646SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615b73be646Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616b73be646Smrg  AC_ARG_ENABLE([maintainer-mode],
617b73be646Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618b73be646Smrg			  (and sometimes confusing) to the casual installer],
619b73be646Smrg      [USE_MAINTAINER_MODE=$enableval],
620b73be646Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621b73be646Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622b73be646Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623b73be646Smrg  MAINT=$MAINTAINER_MODE_TRUE
624b73be646Smrg  AC_SUBST([MAINT])dnl
625b73be646Smrg]
626b73be646Smrg)
627659607e0Smrg
628b73be646SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629659607e0Smrg
630b73be646Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631b73be646Smrg
632b73be646Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6336aab59a7Smrg#
634b73be646Smrg# This file is free software; the Free Software Foundation
635b73be646Smrg# gives unlimited permission to copy and/or distribute it,
636b73be646Smrg# with or without modifications, as long as this notice is preserved.
637659607e0Smrg
638b73be646Smrg# serial 4
639659607e0Smrg
640b73be646Smrg# AM_MAKE_INCLUDE()
641b73be646Smrg# -----------------
642b73be646Smrg# Check to see how make treats includes.
643b73be646SmrgAC_DEFUN([AM_MAKE_INCLUDE],
644b73be646Smrg[am_make=${MAKE-make}
645b73be646Smrgcat > confinc << 'END'
646b73be646Smrgam__doit:
647b73be646Smrg	@echo this is the am__doit target
648b73be646Smrg.PHONY: am__doit
649b73be646SmrgEND
650b73be646Smrg# If we don't find an include directive, just comment out the code.
651b73be646SmrgAC_MSG_CHECKING([for style of include used by $am_make])
652b73be646Smrgam__include="#"
653b73be646Smrgam__quote=
654b73be646Smrg_am_result=none
655b73be646Smrg# First try GNU make style include.
656b73be646Smrgecho "include confinc" > confmf
657b73be646Smrg# Ignore all kinds of additional output from `make'.
658b73be646Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
659b73be646Smrg*the\ am__doit\ target*)
660b73be646Smrg  am__include=include
661b73be646Smrg  am__quote=
662b73be646Smrg  _am_result=GNU
663b73be646Smrg  ;;
664b73be646Smrgesac
665b73be646Smrg# Now try BSD make style include.
666b73be646Smrgif test "$am__include" = "#"; then
667b73be646Smrg   echo '.include "confinc"' > confmf
668b73be646Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
669b73be646Smrg   *the\ am__doit\ target*)
670b73be646Smrg     am__include=.include
671b73be646Smrg     am__quote="\""
672b73be646Smrg     _am_result=BSD
673b73be646Smrg     ;;
674b73be646Smrg   esac
675b73be646Smrgfi
676b73be646SmrgAC_SUBST([am__include])
677b73be646SmrgAC_SUBST([am__quote])
678b73be646SmrgAC_MSG_RESULT([$_am_result])
679b73be646Smrgrm -f confinc confmf
680b73be646Smrg])
681fc27e79cSmrg
682b73be646Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683fc27e79cSmrg
684b73be646Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685b73be646Smrg# Free Software Foundation, Inc.
686b73be646Smrg#
687b73be646Smrg# This file is free software; the Free Software Foundation
688b73be646Smrg# gives unlimited permission to copy and/or distribute it,
689b73be646Smrg# with or without modifications, as long as this notice is preserved.
690fc27e79cSmrg
691b73be646Smrg# serial 6
692fc27e79cSmrg
693b73be646Smrg# AM_MISSING_PROG(NAME, PROGRAM)
6946aab59a7Smrg# ------------------------------
695b73be646SmrgAC_DEFUN([AM_MISSING_PROG],
696b73be646Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697b73be646Smrg$1=${$1-"${am_missing_run}$2"}
698b73be646SmrgAC_SUBST($1)])
699fc27e79cSmrg
700fc27e79cSmrg
701b73be646Smrg# AM_MISSING_HAS_RUN
702b73be646Smrg# ------------------
703b73be646Smrg# Define MISSING if not defined so far and test if it supports --run.
704b73be646Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705b73be646SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706b73be646Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707b73be646SmrgAC_REQUIRE_AUX_FILE([missing])dnl
708b73be646Smrgif test x"${MISSING+set}" != xset; then
709b73be646Smrg  case $am_aux_dir in
710b73be646Smrg  *\ * | *\	*)
711b73be646Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712b73be646Smrg  *)
713b73be646Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714b73be646Smrg  esac
715b73be646Smrgfi
716b73be646Smrg# Use eval to expand $SHELL
717b73be646Smrgif eval "$MISSING --run true"; then
718b73be646Smrg  am_missing_run="$MISSING --run "
719b73be646Smrgelse
720b73be646Smrg  am_missing_run=
721b73be646Smrg  AC_MSG_WARN([`missing' script is too old or missing])
722b73be646Smrgfi
723b73be646Smrg])
724fc27e79cSmrg
725b73be646Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726b73be646Smrg#
727b73be646Smrg# This file is free software; the Free Software Foundation
728b73be646Smrg# gives unlimited permission to copy and/or distribute it,
729b73be646Smrg# with or without modifications, as long as this notice is preserved.
730fc27e79cSmrg
731b73be646Smrg# AM_PROG_MKDIR_P
732b73be646Smrg# ---------------
733b73be646Smrg# Check for `mkdir -p'.
734b73be646SmrgAC_DEFUN([AM_PROG_MKDIR_P],
735b73be646Smrg[AC_PREREQ([2.60])dnl
736b73be646SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737b73be646Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738b73be646Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
739b73be646Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740b73be646Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741b73be646Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742b73be646Smrgdnl adjustment using top_builddir (which is defined more often than
743b73be646Smrgdnl MKDIR_P).
744b73be646SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745b73be646Smrgcase $mkdir_p in
746b73be646Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747b73be646Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7486aab59a7Smrgesac
749659607e0Smrg])
750659607e0Smrg
751b73be646Smrg# Helper functions for option handling.                     -*- Autoconf -*-
752659607e0Smrg
753b73be646Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754b73be646Smrg#
755b73be646Smrg# This file is free software; the Free Software Foundation
756b73be646Smrg# gives unlimited permission to copy and/or distribute it,
757b73be646Smrg# with or without modifications, as long as this notice is preserved.
758fc27e79cSmrg
759b73be646Smrg# serial 4
760fc27e79cSmrg
761b73be646Smrg# _AM_MANGLE_OPTION(NAME)
762b73be646Smrg# -----------------------
763b73be646SmrgAC_DEFUN([_AM_MANGLE_OPTION],
764b73be646Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765659607e0Smrg
766b73be646Smrg# _AM_SET_OPTION(NAME)
767b73be646Smrg# ------------------------------
768b73be646Smrg# Set option NAME.  Presently that only means defining a flag for this option.
769b73be646SmrgAC_DEFUN([_AM_SET_OPTION],
770b73be646Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771659607e0Smrg
772b73be646Smrg# _AM_SET_OPTIONS(OPTIONS)
773b73be646Smrg# ----------------------------------
774b73be646Smrg# OPTIONS is a space-separated list of Automake options.
775b73be646SmrgAC_DEFUN([_AM_SET_OPTIONS],
776b73be646Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777659607e0Smrg
778b73be646Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779b73be646Smrg# -------------------------------------------
780b73be646Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781b73be646SmrgAC_DEFUN([_AM_IF_OPTION],
782b73be646Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783659607e0Smrg
784b73be646Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785659607e0Smrg
786b73be646Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787b73be646Smrg# Free Software Foundation, Inc.
788b73be646Smrg#
789b73be646Smrg# This file is free software; the Free Software Foundation
790b73be646Smrg# gives unlimited permission to copy and/or distribute it,
791b73be646Smrg# with or without modifications, as long as this notice is preserved.
792659607e0Smrg
793b73be646Smrg# serial 5
794659607e0Smrg
795b73be646Smrg# AM_SANITY_CHECK
796b73be646Smrg# ---------------
797b73be646SmrgAC_DEFUN([AM_SANITY_CHECK],
798b73be646Smrg[AC_MSG_CHECKING([whether build environment is sane])
799b73be646Smrg# Just in case
800b73be646Smrgsleep 1
801b73be646Smrgecho timestamp > conftest.file
802b73be646Smrg# Reject unsafe characters in $srcdir or the absolute working directory
803b73be646Smrg# name.  Accept space and tab only in the latter.
804b73be646Smrgam_lf='
805b73be646Smrg'
806b73be646Smrgcase `pwd` in
807b73be646Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808b73be646Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809b73be646Smrgesac
810b73be646Smrgcase $srcdir in
811b73be646Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812b73be646Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813b73be646Smrgesac
814fc27e79cSmrg
815b73be646Smrg# Do `set' in a subshell so we don't clobber the current shell's
816b73be646Smrg# arguments.  Must try -L first in case configure is actually a
817b73be646Smrg# symlink; some systems play weird games with the mod time of symlinks
818b73be646Smrg# (eg FreeBSD returns the mod time of the symlink's containing
819b73be646Smrg# directory).
820b73be646Smrgif (
821b73be646Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822b73be646Smrg   if test "$[*]" = "X"; then
823b73be646Smrg      # -L didn't work.
824b73be646Smrg      set X `ls -t "$srcdir/configure" conftest.file`
825b73be646Smrg   fi
826b73be646Smrg   rm -f conftest.file
827b73be646Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828b73be646Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829fc27e79cSmrg
830b73be646Smrg      # If neither matched, then we have a broken ls.  This can happen
831b73be646Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832b73be646Smrg      # broken ls alias from the environment.  This has actually
833b73be646Smrg      # happened.  Such a system could not be considered "sane".
834b73be646Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835b73be646Smrgalias in your environment])
836b73be646Smrg   fi
837659607e0Smrg
838b73be646Smrg   test "$[2]" = conftest.file
839b73be646Smrg   )
840b73be646Smrgthen
841b73be646Smrg   # Ok.
842b73be646Smrg   :
843b73be646Smrgelse
844b73be646Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
845b73be646SmrgCheck your system clock])
846fc27e79cSmrgfi
847b73be646SmrgAC_MSG_RESULT(yes)])
848fc27e79cSmrg
849b73be646Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
850b73be646Smrg#
851b73be646Smrg# This file is free software; the Free Software Foundation
852b73be646Smrg# gives unlimited permission to copy and/or distribute it,
853b73be646Smrg# with or without modifications, as long as this notice is preserved.
854fc27e79cSmrg
855b73be646Smrg# serial 1
856fc27e79cSmrg
857b73be646Smrg# AM_SILENT_RULES([DEFAULT])
858b73be646Smrg# --------------------------
859b73be646Smrg# Enable less verbose build rules; with the default set to DEFAULT
860b73be646Smrg# (`yes' being less verbose, `no' or empty being verbose).
861b73be646SmrgAC_DEFUN([AM_SILENT_RULES],
862b73be646Smrg[AC_ARG_ENABLE([silent-rules],
863b73be646Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864b73be646Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
865b73be646Smrgcase $enable_silent_rules in
866b73be646Smrgyes) AM_DEFAULT_VERBOSITY=0;;
867b73be646Smrgno)  AM_DEFAULT_VERBOSITY=1;;
868b73be646Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869b73be646Smrgesac
870b73be646SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871b73be646SmrgAM_BACKSLASH='\'
872b73be646SmrgAC_SUBST([AM_BACKSLASH])dnl
873b73be646Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874b73be646Smrg])
875b73be646Smrg
876b73be646Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877b73be646Smrg#
878b73be646Smrg# This file is free software; the Free Software Foundation
879b73be646Smrg# gives unlimited permission to copy and/or distribute it,
880b73be646Smrg# with or without modifications, as long as this notice is preserved.
881b73be646Smrg
882b73be646Smrg# AM_PROG_INSTALL_STRIP
883b73be646Smrg# ---------------------
884b73be646Smrg# One issue with vendor `install' (even GNU) is that you can't
885b73be646Smrg# specify the program used to strip binaries.  This is especially
886b73be646Smrg# annoying in cross-compiling environments, where the build's strip
887b73be646Smrg# is unlikely to handle the host's binaries.
888b73be646Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889b73be646Smrg# always use install-sh in `make install-strip', and initialize
890b73be646Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
891b73be646SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892b73be646Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893b73be646Smrg# Installed binaries are usually stripped using `strip' when the user
894b73be646Smrg# run `make install-strip'.  However `strip' might not be the right
895b73be646Smrg# tool to use in cross-compilation environments, therefore Automake
896b73be646Smrg# will honor the `STRIP' environment variable to overrule this program.
897b73be646Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898b73be646Smrgif test "$cross_compiling" != no; then
899b73be646Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
900fc27e79cSmrgfi
901b73be646SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902b73be646SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903659607e0Smrg
904b73be646Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905b73be646Smrg#
906b73be646Smrg# This file is free software; the Free Software Foundation
907b73be646Smrg# gives unlimited permission to copy and/or distribute it,
908b73be646Smrg# with or without modifications, as long as this notice is preserved.
909fc27e79cSmrg
910b73be646Smrg# serial 2
911659607e0Smrg
912b73be646Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
913b73be646Smrg# ---------------------------
914b73be646Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915b73be646Smrg# This macro is traced by Automake.
916b73be646SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917659607e0Smrg
918b73be646Smrg# AM_SUBST_NOTMAKE(VARIABLE)
919b73be646Smrg# ---------------------------
920b73be646Smrg# Public sister of _AM_SUBST_NOTMAKE.
921b73be646SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922659607e0Smrg
923b73be646Smrg# Check how to create a tarball.                            -*- Autoconf -*-
924659607e0Smrg
925b73be646Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926b73be646Smrg#
927b73be646Smrg# This file is free software; the Free Software Foundation
928b73be646Smrg# gives unlimited permission to copy and/or distribute it,
929b73be646Smrg# with or without modifications, as long as this notice is preserved.
930fc27e79cSmrg
931b73be646Smrg# serial 2
932fc27e79cSmrg
933b73be646Smrg# _AM_PROG_TAR(FORMAT)
934b73be646Smrg# --------------------
935b73be646Smrg# Check how to create a tarball in format FORMAT.
936b73be646Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
937b73be646Smrg#
938b73be646Smrg# Substitute a variable $(am__tar) that is a command
939b73be646Smrg# writing to stdout a FORMAT-tarball containing the directory
940b73be646Smrg# $tardir.
941b73be646Smrg#     tardir=directory && $(am__tar) > result.tar
942b73be646Smrg#
943b73be646Smrg# Substitute a variable $(am__untar) that extract such
944b73be646Smrg# a tarball read from stdin.
945b73be646Smrg#     $(am__untar) < result.tar
946b73be646SmrgAC_DEFUN([_AM_PROG_TAR],
947b73be646Smrg[# Always define AMTAR for backward compatibility.
948b73be646SmrgAM_MISSING_PROG([AMTAR], [tar])
949b73be646Smrgm4_if([$1], [v7],
950b73be646Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951b73be646Smrg     [m4_case([$1], [ustar],, [pax],,
952b73be646Smrg              [m4_fatal([Unknown tar format])])
953b73be646SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
954b73be646Smrg# Loop over all known methods to create a tar archive until one works.
955b73be646Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956b73be646Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957b73be646Smrg# Do not fold the above two line into one, because Tru64 sh and
958b73be646Smrg# Solaris sh will not grok spaces in the rhs of `-'.
959b73be646Smrgfor _am_tool in $_am_tools
960b73be646Smrgdo
961b73be646Smrg  case $_am_tool in
962b73be646Smrg  gnutar)
963b73be646Smrg    for _am_tar in tar gnutar gtar;
964b73be646Smrg    do
965b73be646Smrg      AM_RUN_LOG([$_am_tar --version]) && break
966b73be646Smrg    done
967b73be646Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968b73be646Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969b73be646Smrg    am__untar="$_am_tar -xf -"
970b73be646Smrg    ;;
971b73be646Smrg  plaintar)
972b73be646Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
973b73be646Smrg    # ustar tarball either.
974b73be646Smrg    (tar --version) >/dev/null 2>&1 && continue
975b73be646Smrg    am__tar='tar chf - "$$tardir"'
976b73be646Smrg    am__tar_='tar chf - "$tardir"'
977b73be646Smrg    am__untar='tar xf -'
978b73be646Smrg    ;;
979b73be646Smrg  pax)
980b73be646Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
981b73be646Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
982b73be646Smrg    am__untar='pax -r'
983b73be646Smrg    ;;
984b73be646Smrg  cpio)
985b73be646Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986b73be646Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987b73be646Smrg    am__untar='cpio -i -H $1 -d'
988b73be646Smrg    ;;
989b73be646Smrg  none)
990b73be646Smrg    am__tar=false
991b73be646Smrg    am__tar_=false
992b73be646Smrg    am__untar=false
993fc27e79cSmrg    ;;
994fc27e79cSmrg  esac
995659607e0Smrg
996b73be646Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
997b73be646Smrg  # and am__untar set.
998b73be646Smrg  test -n "${am_cv_prog_tar_$1}" && break
999659607e0Smrg
1000b73be646Smrg  # tar/untar a dummy directory, and stop if the command works
1001b73be646Smrg  rm -rf conftest.dir
1002b73be646Smrg  mkdir conftest.dir
1003b73be646Smrg  echo GrepMe > conftest.dir/file
1004b73be646Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005b73be646Smrg  rm -rf conftest.dir
1006b73be646Smrg  if test -s conftest.tar; then
1007b73be646Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1008b73be646Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009b73be646Smrg  fi
1010b73be646Smrgdone
1011b73be646Smrgrm -rf conftest.dir
1012659607e0Smrg
1013b73be646SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014b73be646SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015b73be646SmrgAC_SUBST([am__tar])
1016b73be646SmrgAC_SUBST([am__untar])
1017b73be646Smrg]) # _AM_PROG_TAR
1018659607e0Smrg
1019b73be646Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1020b73be646Smrgdnl
1021b73be646Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1022b73be646Smrgdnl 
1023b73be646Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1024b73be646Smrgdnl copy of this software and associated documentation files (the "Software"),
1025b73be646Smrgdnl to deal in the Software without restriction, including without limitation
1026b73be646Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1027b73be646Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1028b73be646Smrgdnl Software is furnished to do so, subject to the following conditions:
1029b73be646Smrgdnl
1030b73be646Smrgdnl The above copyright notice and this permission notice (including the next
1031b73be646Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1032b73be646Smrgdnl Software.
1033b73be646Smrgdnl
1034b73be646Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1035b73be646Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1036b73be646Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1037b73be646Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1038b73be646Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1039b73be646Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1040b73be646Smrgdnl DEALINGS IN THE SOFTWARE.
1041659607e0Smrg
1042b73be646Smrg# XORG_MACROS_VERSION(required-version)
1043b73be646Smrg# -------------------------------------
1044b73be646Smrg# Minimum version: 1.1.0
1045b73be646Smrg#
1046b73be646Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1047b73be646Smrg# your configure.ac with the minimum required version, such as:
1048b73be646Smrg# XORG_MACROS_VERSION(1.1)
1049b73be646Smrg#
1050b73be646Smrg# To ensure that this macro is defined, also add:
1051b73be646Smrg# m4_ifndef([XORG_MACROS_VERSION],
1052b73be646Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1053b73be646Smrg#
1054b73be646Smrg#
1055b73be646Smrg# See the "minimum version" comment for each macro you use to see what 
1056b73be646Smrg# version you require.
1057b73be646Smrgm4_defun([XORG_MACROS_VERSION],[
1058b73be646Smrgm4_define([vers_have], [1.10.0])
1059b73be646Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1060b73be646Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1061b73be646Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1062b73be646Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1063b73be646Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1064b73be646Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1065b73be646Smrgm4_undefine([vers_have])
1066b73be646Smrgm4_undefine([maj_have])
1067b73be646Smrgm4_undefine([maj_needed])
1068b73be646Smrg]) # XORG_MACROS_VERSION
1069659607e0Smrg
1070b73be646Smrg# XORG_PROG_RAWCPP()
1071b73be646Smrg# ------------------
1072b73be646Smrg# Minimum version: 1.0.0
1073b73be646Smrg#
1074b73be646Smrg# Find cpp program and necessary flags for use in pre-processing text files
1075b73be646Smrg# such as man pages and config files
1076b73be646SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1077b73be646SmrgAC_REQUIRE([AC_PROG_CPP])
1078b73be646SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1079b73be646Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1080659607e0Smrg
1081b73be646Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1082b73be646Smrg# which is not the best choice for supporting other OS'es, but covers most
1083b73be646Smrg# of the ones we need for now.
1084b73be646SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1085b73be646SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1086b73be646Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1087b73be646Smrg	AC_MSG_RESULT([no])
1088b73be646Smrgelse
1089b73be646Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1090b73be646Smrg		RAWCPPFLAGS=-undef
1091b73be646Smrg		AC_MSG_RESULT([yes])
1092b73be646Smrg	# under Cygwin unix is still defined even with -undef
1093b73be646Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1094b73be646Smrg		RAWCPPFLAGS="-undef -ansi"
1095b73be646Smrg		AC_MSG_RESULT([yes, with -ansi])
1096b73be646Smrg	else
1097b73be646Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1098b73be646Smrg	fi
1099b73be646Smrgfi
1100b73be646Smrgrm -f conftest.$ac_ext
11016aab59a7Smrg
1102b73be646SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1103b73be646SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1104b73be646Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1105b73be646Smrg	AC_MSG_RESULT([no])
1106b73be646Smrgelse
1107b73be646Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1108b73be646Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1109b73be646Smrg		AC_MSG_RESULT([yes])
1110b73be646Smrg	else
1111b73be646Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1112b73be646Smrg	fi
1113b73be646Smrgfi
1114b73be646Smrgrm -f conftest.$ac_ext
1115b73be646SmrgAC_SUBST(RAWCPPFLAGS)
1116b73be646Smrg]) # XORG_PROG_RAWCPP
1117659607e0Smrg
1118b73be646Smrg# XORG_MANPAGE_SECTIONS()
1119b73be646Smrg# -----------------------
1120b73be646Smrg# Minimum version: 1.0.0
1121b73be646Smrg#
1122b73be646Smrg# Determine which sections man pages go in for the different man page types
1123b73be646Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1124b73be646Smrg# Not sure if there's any better way than just hardcoding by OS name.
1125b73be646Smrg# Override default settings by setting environment variables
1126b73be646Smrg# Added MAN_SUBSTS in version 1.8
1127b73be646Smrg# Added AC_PROG_SED in version 1.8
1128659607e0Smrg
1129b73be646SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1130b73be646SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1131b73be646SmrgAC_REQUIRE([AC_PROG_SED])
1132659607e0Smrg
1133b73be646Smrgif test x$APP_MAN_SUFFIX = x    ; then
1134b73be646Smrg    APP_MAN_SUFFIX=1
1135b73be646Smrgfi
1136b73be646Smrgif test x$APP_MAN_DIR = x    ; then
1137b73be646Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1138b73be646Smrgfi
1139659607e0Smrg
1140b73be646Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1141b73be646Smrg    LIB_MAN_SUFFIX=3
1142b73be646Smrgfi
1143b73be646Smrgif test x$LIB_MAN_DIR = x    ; then
1144b73be646Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1145b73be646Smrgfi
1146fc27e79cSmrg
1147b73be646Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1148b73be646Smrg    case $host_os in
1149b73be646Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1150b73be646Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1151b73be646Smrg    esac
1152b73be646Smrgfi
1153b73be646Smrgif test x$FILE_MAN_DIR = x    ; then
1154b73be646Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1155b73be646Smrgfi
1156fc27e79cSmrg
1157b73be646Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1158b73be646Smrg    case $host_os in
1159b73be646Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1160b73be646Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1161b73be646Smrg    esac
1162b73be646Smrgfi
1163b73be646Smrgif test x$MISC_MAN_DIR = x    ; then
1164b73be646Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1165b73be646Smrgfi
1166659607e0Smrg
1167b73be646Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1168b73be646Smrg    case $host_os in
1169b73be646Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1170b73be646Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1171b73be646Smrg    esac
1172b73be646Smrgfi
1173b73be646Smrgif test x$DRIVER_MAN_DIR = x    ; then
1174b73be646Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1175b73be646Smrgfi
1176659607e0Smrg
1177b73be646Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1178b73be646Smrg    case $host_os in
1179b73be646Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1180b73be646Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1181b73be646Smrg    esac
1182b73be646Smrgfi
1183b73be646Smrgif test x$ADMIN_MAN_DIR = x    ; then
1184b73be646Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1185b73be646Smrgfi
1186fc27e79cSmrg
1187fc27e79cSmrg
1188b73be646SmrgAC_SUBST([APP_MAN_SUFFIX])
1189b73be646SmrgAC_SUBST([LIB_MAN_SUFFIX])
1190b73be646SmrgAC_SUBST([FILE_MAN_SUFFIX])
1191b73be646SmrgAC_SUBST([MISC_MAN_SUFFIX])
1192b73be646SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1193b73be646SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1194b73be646SmrgAC_SUBST([APP_MAN_DIR])
1195b73be646SmrgAC_SUBST([LIB_MAN_DIR])
1196b73be646SmrgAC_SUBST([FILE_MAN_DIR])
1197b73be646SmrgAC_SUBST([MISC_MAN_DIR])
1198b73be646SmrgAC_SUBST([DRIVER_MAN_DIR])
1199b73be646SmrgAC_SUBST([ADMIN_MAN_DIR])
1200fc27e79cSmrg
1201b73be646SmrgXORG_MAN_PAGE="X Version 11"
1202b73be646SmrgAC_SUBST([XORG_MAN_PAGE])
1203b73be646SmrgMAN_SUBSTS="\
1204b73be646Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1205b73be646Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1206b73be646Smrg	-e 's|__xservername__|Xorg|g' \
1207b73be646Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1208b73be646Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1209b73be646Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1210b73be646Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1211b73be646Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1212b73be646Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1213b73be646Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1214b73be646Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1215b73be646SmrgAC_SUBST([MAN_SUBSTS])
1216fc27e79cSmrg
1217b73be646Smrg]) # XORG_MANPAGE_SECTIONS
1218fc27e79cSmrg
1219b73be646Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1220b73be646Smrg# ------------------------
1221b73be646Smrg# Minimum version: 1.7.0
1222b73be646Smrg#
1223b73be646Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1224b73be646Smrg# provided by xorg-sgml-doctools, if installed.
1225b73be646SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1226b73be646SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1227b73be646SmrgXORG_SGML_PATH=
1228b73be646SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1229b73be646Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1230b73be646Smrg    [m4_ifval([$1],[:],
1231b73be646Smrg        [if test x"$cross_compiling" != x"yes" ; then
1232b73be646Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1233b73be646Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1234b73be646Smrg         fi])
1235b73be646Smrg    ])
1236fc27e79cSmrg
1237b73be646Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1238b73be646Smrg# the path and the name of the doc stylesheet
1239b73be646Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1240b73be646Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1241b73be646Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1242b73be646Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1243b73be646Smrgelse
1244b73be646Smrg   AC_MSG_RESULT([no])
1245b73be646Smrgfi
1246fc27e79cSmrg
1247b73be646SmrgAC_SUBST(XORG_SGML_PATH)
1248b73be646SmrgAC_SUBST(STYLESHEET_SRCDIR)
1249b73be646SmrgAC_SUBST(XSL_STYLESHEET)
1250b73be646SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1251b73be646Smrg]) # XORG_CHECK_SGML_DOCTOOLS
12526aab59a7Smrg
1253b73be646Smrg# XORG_CHECK_LINUXDOC
1254b73be646Smrg# -------------------
1255b73be646Smrg# Minimum version: 1.0.0
1256b73be646Smrg#
1257b73be646Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1258b73be646Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1259b73be646Smrg# Whether or not the necessary tools and files are found can be checked
1260b73be646Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1261b73be646SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1262b73be646SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1263b73be646SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1264659607e0Smrg
1265b73be646SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1266659607e0Smrg
1267b73be646SmrgAC_MSG_CHECKING([whether to build documentation])
1268659607e0Smrg
1269b73be646Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1270b73be646Smrg   BUILDDOC=yes
1271b73be646Smrgelse
1272b73be646Smrg   BUILDDOC=no
1273b73be646Smrgfi
1274659607e0Smrg
1275b73be646SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1276659607e0Smrg
1277b73be646SmrgAC_MSG_RESULT([$BUILDDOC])
1278659607e0Smrg
1279b73be646SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1280659607e0Smrg
1281b73be646Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1282b73be646Smrg   BUILDPDFDOC=yes
1283b73be646Smrgelse
1284b73be646Smrg   BUILDPDFDOC=no
1285b73be646Smrgfi
12866aab59a7Smrg
1287b73be646SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1288659607e0Smrg
1289b73be646SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1290659607e0Smrg
1291b73be646SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1292b73be646SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1293b73be646SmrgMAKE_PDF="$PS2PDF"
1294b73be646SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1295659607e0Smrg
1296b73be646SmrgAC_SUBST(MAKE_TEXT)
1297b73be646SmrgAC_SUBST(MAKE_PS)
1298b73be646SmrgAC_SUBST(MAKE_PDF)
1299b73be646SmrgAC_SUBST(MAKE_HTML)
1300b73be646Smrg]) # XORG_CHECK_LINUXDOC
1301659607e0Smrg
1302b73be646Smrg# XORG_CHECK_DOCBOOK
1303fc27e79cSmrg# -------------------
1304b73be646Smrg# Minimum version: 1.0.0
1305b73be646Smrg#
1306b73be646Smrg# Checks for the ability to build output formats from SGML DocBook source.
1307b73be646Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1308b73be646Smrg# indicates whether the necessary tools and files are found and, if set,
1309b73be646Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1310b73be646SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1311b73be646SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1312659607e0Smrg
1313b73be646SmrgBUILDTXTDOC=no
1314b73be646SmrgBUILDPDFDOC=no
1315b73be646SmrgBUILDPSDOC=no
1316b73be646SmrgBUILDHTMLDOC=no
1317659607e0Smrg
1318b73be646SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1319b73be646SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1320b73be646SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1321b73be646SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
13226aab59a7Smrg
1323b73be646SmrgAC_MSG_CHECKING([whether to build text documentation])
1324b73be646Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1325b73be646Smrg   test x$BUILD_TXTDOC != xno; then
1326b73be646Smrg	BUILDTXTDOC=yes
1327b73be646Smrgfi
1328b73be646SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1329b73be646SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1330fc27e79cSmrg
1331b73be646SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1332b73be646Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1333b73be646Smrg   test x$BUILD_PDFDOC != xno; then
1334b73be646Smrg	BUILDPDFDOC=yes
1335659607e0Smrgfi
1336b73be646SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1337b73be646SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1338659607e0Smrg
1339b73be646SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1340b73be646Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1341b73be646Smrg   test x$BUILD_PSDOC != xno; then
1342b73be646Smrg	BUILDPSDOC=yes
1343fc27e79cSmrgfi
1344b73be646SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1345b73be646SmrgAC_MSG_RESULT([$BUILDPSDOC])
1346659607e0Smrg
1347b73be646SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1348b73be646Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1349b73be646Smrg   test x$BUILD_HTMLDOC != xno; then
1350b73be646Smrg	BUILDHTMLDOC=yes
1351b73be646Smrgfi
1352b73be646SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1353b73be646SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1354659607e0Smrg
1355b73be646SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1356b73be646SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1357b73be646SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1358b73be646SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1359659607e0Smrg
1360b73be646SmrgAC_SUBST(MAKE_TEXT)
1361b73be646SmrgAC_SUBST(MAKE_PS)
1362b73be646SmrgAC_SUBST(MAKE_PDF)
1363b73be646SmrgAC_SUBST(MAKE_HTML)
1364b73be646Smrg]) # XORG_CHECK_DOCBOOK
1365659607e0Smrg
1366b73be646Smrg# XORG_WITH_XMLTO([MIN-VERSION])
1367b73be646Smrg# ----------------
1368b73be646Smrg# Minimum version: 1.5.0
1369b73be646Smrg#
1370b73be646Smrg# Documentation tools are not always available on all platforms and sometimes
1371b73be646Smrg# not at the appropriate level. This macro enables a module to test for the
1372b73be646Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1373b73be646Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1374b73be646Smrg# as whether or not to use the xmlto package.
1375b73be646Smrg#
1376b73be646Smrg# Interface to module:
1377b73be646Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1378b73be646Smrg# XMLTO:	returns the path of the xmlto program found
1379b73be646Smrg#		returns the path set by the user in the environment
1380b73be646Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1381b73be646Smrg#		'no' user instructs the module not to use xmlto
1382b73be646Smrg#
1383b73be646Smrg# Added in version 1.10.0
1384b73be646Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1385b73be646Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1386b73be646Smrg#
1387b73be646Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1388b73be646Smrg#
1389b73be646SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1390b73be646SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1391b73be646SmrgAC_ARG_WITH(xmlto,
1392b73be646Smrg	AS_HELP_STRING([--with-xmlto],
1393b73be646Smrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
1394b73be646Smrg	   [use_xmlto=$withval], [use_xmlto=auto])
1395b73be646Smrg
1396b73be646Smrgif test "x$use_xmlto" = x"auto"; then
1397b73be646Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1398b73be646Smrg   if test "x$XMLTO" = "x"; then
1399b73be646Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1400b73be646Smrg	have_xmlto=no
1401b73be646Smrg   else
1402b73be646Smrg        have_xmlto=yes
1403b73be646Smrg   fi
1404b73be646Smrgelif test "x$use_xmlto" = x"yes" ; then
1405b73be646Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1406b73be646Smrg   if test "x$XMLTO" = "x"; then
1407b73be646Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1408b73be646Smrg   fi
1409b73be646Smrg   have_xmlto=yes
1410b73be646Smrgelif test "x$use_xmlto" = x"no" ; then
1411b73be646Smrg   if test "x$XMLTO" != "x"; then
1412b73be646Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1413b73be646Smrg   fi
1414b73be646Smrg   have_xmlto=no
1415b73be646Smrgelse
1416b73be646Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1417b73be646Smrgfi
1418659607e0Smrg
1419b73be646Smrg# Test for a minimum version of xmlto, if provided.
1420b73be646Smrgm4_ifval([$1],
1421b73be646Smrg[if test "$have_xmlto" = yes; then
1422b73be646Smrg    # scrape the xmlto version
1423b73be646Smrg    AC_MSG_CHECKING([the xmlto version])
1424b73be646Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1425b73be646Smrg    AC_MSG_RESULT([$xmlto_version])
1426b73be646Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1427b73be646Smrg        [if test "x$use_xmlto" = xauto; then
1428b73be646Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1429b73be646Smrg            have_xmlto=no
1430fc27e79cSmrg        else
1431b73be646Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1432b73be646Smrg        fi])
1433b73be646Smrgfi])
1434659607e0Smrg
1435b73be646Smrg# Test for the ability of xmlto to generate a text target
1436b73be646Smrghave_xmlto_text=no
1437b73be646Smrgcat > conftest.xml << "EOF"
1438b73be646SmrgEOF
1439b73be646SmrgAS_IF([test "$have_xmlto" = yes],
1440b73be646Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1441b73be646Smrg             [have_xmlto_text=yes],
1442b73be646Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1443b73be646Smrgrm -f conftest.xml
1444b73be646SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1445b73be646SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1446b73be646Smrg]) # XORG_WITH_XMLTO
1447b73be646Smrg
1448b73be646Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
1449b73be646Smrg# ----------------
1450b73be646Smrg# Minimum version: 1.5.0
1451b73be646Smrg#
1452b73be646Smrg# Documentation tools are not always available on all platforms and sometimes
1453b73be646Smrg# not at the appropriate level. This macro enables a module to test for the
1454b73be646Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1455b73be646Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1456b73be646Smrg# as whether or not to use the asciidoc package.
1457b73be646Smrg#
1458b73be646Smrg# Interface to module:
1459b73be646Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1460b73be646Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
1461b73be646Smrg#		 returns the path set by the user in the environment
1462b73be646Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1463b73be646Smrg#		  'no' user instructs the module not to use asciidoc
1464b73be646Smrg#
1465b73be646Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1466b73be646Smrg#
1467b73be646SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1468b73be646SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1469b73be646SmrgAC_ARG_WITH(asciidoc,
1470b73be646Smrg	AS_HELP_STRING([--with-asciidoc],
1471b73be646Smrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
1472b73be646Smrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
1473b73be646Smrg
1474b73be646Smrgif test "x$use_asciidoc" = x"auto"; then
1475b73be646Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1476b73be646Smrg   if test "x$ASCIIDOC" = "x"; then
1477b73be646Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1478b73be646Smrg	have_asciidoc=no
1479b73be646Smrg   else
1480b73be646Smrg        have_asciidoc=yes
1481b73be646Smrg   fi
1482b73be646Smrgelif test "x$use_asciidoc" = x"yes" ; then
1483b73be646Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1484b73be646Smrg   if test "x$ASCIIDOC" = "x"; then
1485b73be646Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1486b73be646Smrg   fi
1487b73be646Smrg   have_asciidoc=yes
1488b73be646Smrgelif test "x$use_asciidoc" = x"no" ; then
1489b73be646Smrg   if test "x$ASCIIDOC" != "x"; then
1490b73be646Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1491b73be646Smrg   fi
1492b73be646Smrg   have_asciidoc=no
1493b73be646Smrgelse
1494b73be646Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1495b73be646Smrgfi
1496b73be646Smrgm4_ifval([$1],
1497b73be646Smrg[if test "$have_asciidoc" = yes; then
1498b73be646Smrg    # scrape the asciidoc version
1499b73be646Smrg    AC_MSG_CHECKING([the asciidoc version])
1500b73be646Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1501b73be646Smrg    AC_MSG_RESULT([$asciidoc_version])
1502b73be646Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1503b73be646Smrg        [if test "x$use_asciidoc" = xauto; then
1504b73be646Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1505b73be646Smrg            have_asciidoc=no
1506b73be646Smrg        else
1507b73be646Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1508b73be646Smrg        fi])
1509b73be646Smrgfi])
1510b73be646SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1511b73be646Smrg]) # XORG_WITH_ASCIIDOC
1512659607e0Smrg
1513b73be646Smrg# XORG_WITH_DOXYGEN([MIN-VERSION])
1514b73be646Smrg# --------------------------------
1515b73be646Smrg# Minimum version: 1.5.0
1516b73be646Smrg#
1517b73be646Smrg# Documentation tools are not always available on all platforms and sometimes
1518b73be646Smrg# not at the appropriate level. This macro enables a module to test for the
1519b73be646Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1520b73be646Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1521b73be646Smrg# as whether or not to use the doxygen package.
1522b73be646Smrg#
1523b73be646Smrg# Interface to module:
1524b73be646Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1525b73be646Smrg# DOXYGEN:	 returns the path of the doxygen program found
1526b73be646Smrg#		 returns the path set by the user in the environment
1527b73be646Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1528b73be646Smrg#		  'no' user instructs the module not to use doxygen
1529b73be646Smrg#
1530b73be646Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1531b73be646Smrg#
1532b73be646SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1533b73be646SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1534b73be646SmrgAC_ARG_WITH(doxygen,
1535b73be646Smrg	AS_HELP_STRING([--with-doxygen],
1536b73be646Smrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
1537b73be646Smrg	   [use_doxygen=$withval], [use_doxygen=auto])
1538b73be646Smrg
1539b73be646Smrgif test "x$use_doxygen" = x"auto"; then
1540b73be646Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1541b73be646Smrg   if test "x$DOXYGEN" = "x"; then
1542b73be646Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1543b73be646Smrg	have_doxygen=no
1544b73be646Smrg   else
1545b73be646Smrg        have_doxygen=yes
1546b73be646Smrg   fi
1547b73be646Smrgelif test "x$use_doxygen" = x"yes" ; then
1548b73be646Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1549b73be646Smrg   if test "x$DOXYGEN" = "x"; then
1550b73be646Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1551b73be646Smrg   fi
1552b73be646Smrg   have_doxygen=yes
1553b73be646Smrgelif test "x$use_doxygen" = x"no" ; then
1554b73be646Smrg   if test "x$DOXYGEN" != "x"; then
1555b73be646Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1556b73be646Smrg   fi
1557b73be646Smrg   have_doxygen=no
1558b73be646Smrgelse
1559b73be646Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1560b73be646Smrgfi
1561b73be646Smrgm4_ifval([$1],
1562b73be646Smrg[if test "$have_doxygen" = yes; then
1563b73be646Smrg    # scrape the doxygen version
1564b73be646Smrg    AC_MSG_CHECKING([the doxygen version])
1565b73be646Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1566b73be646Smrg    AC_MSG_RESULT([$doxygen_version])
1567b73be646Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1568b73be646Smrg        [if test "x$use_doxygen" = xauto; then
1569b73be646Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1570b73be646Smrg            have_doxygen=no
1571b73be646Smrg        else
1572b73be646Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1573b73be646Smrg        fi])
1574b73be646Smrgfi])
1575b73be646SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1576b73be646Smrg]) # XORG_WITH_DOXYGEN
1577b73be646Smrg
1578b73be646Smrg# XORG_WITH_GROFF
1579b73be646Smrg# ----------------
1580b73be646Smrg# Minimum version: 1.6.0
1581b73be646Smrg#
1582b73be646Smrg# Documentation tools are not always available on all platforms and sometimes
1583b73be646Smrg# not at the appropriate level. This macro enables a module to test for the
1584b73be646Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1585b73be646Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
1586b73be646Smrg# as whether or not to use the groff package.
1587b73be646Smrg#
1588b73be646Smrg# Interface to module:
1589b73be646Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1590b73be646Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1591b73be646Smrg# HAVE_GROFF_MS: the -ms macros package
1592b73be646Smrg# GROFF:	 returns the path of the groff program found
1593b73be646Smrg#		 returns the path set by the user in the environment
1594b73be646Smrg# --with-groff:	 'yes' user instructs the module to use groff
1595b73be646Smrg#		 'no' user instructs the module not to use groff
1596b73be646Smrg#
1597b73be646Smrg# Added in version 1.9.0:
1598b73be646Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1599b73be646Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1600b73be646Smrg#		   psselect from the psutils package.
1601b73be646Smrg#		   the ghostcript package. Refer to the grohtml man pages
1602b73be646Smrg#
1603b73be646Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1604b73be646Smrg#
1605b73be646Smrg# OS and distros often splits groff in a basic and full package, the former
1606b73be646Smrg# having the groff program and the later having devices, fonts and macros
1607b73be646Smrg# Checking for the groff executable is not enough.
1608b73be646Smrg#
1609b73be646Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
1610b73be646Smrg# unset HAVE_GROFF or GROFF env variables.
1611b73be646Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1612b73be646Smrg#
1613b73be646SmrgAC_DEFUN([XORG_WITH_GROFF],[
1614b73be646SmrgAC_ARG_VAR([GROFF], [Path to groff command])
1615b73be646SmrgAC_ARG_WITH(groff,
1616b73be646Smrg	AS_HELP_STRING([--with-groff],
1617b73be646Smrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
1618b73be646Smrg	   [use_groff=$withval], [use_groff=auto])
1619b73be646Smrg
1620b73be646Smrgif test "x$use_groff" = x"auto"; then
1621b73be646Smrg   AC_PATH_PROG([GROFF], [groff])
1622b73be646Smrg   if test "x$GROFF" = "x"; then
1623b73be646Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1624b73be646Smrg	have_groff=no
1625b73be646Smrg   else
1626b73be646Smrg        have_groff=yes
1627b73be646Smrg   fi
1628b73be646Smrgelif test "x$use_groff" = x"yes" ; then
1629b73be646Smrg   AC_PATH_PROG([GROFF], [groff])
1630b73be646Smrg   if test "x$GROFF" = "x"; then
1631b73be646Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1632b73be646Smrg   fi
1633b73be646Smrg   have_groff=yes
1634b73be646Smrgelif test "x$use_groff" = x"no" ; then
1635b73be646Smrg   if test "x$GROFF" != "x"; then
1636b73be646Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1637b73be646Smrg   fi
1638b73be646Smrg   have_groff=no
1639b73be646Smrgelse
1640b73be646Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1641b73be646Smrgfi
1642b73be646Smrg
1643b73be646Smrg# We have groff, test for the presence of the macro packages
1644b73be646Smrgif test "x$have_groff" = x"yes"; then
1645b73be646Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1646b73be646Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1647b73be646Smrg        groff_ms_works=yes
1648b73be646Smrg    else
1649b73be646Smrg        groff_ms_works=no
1650fc27e79cSmrg    fi
1651b73be646Smrg    AC_MSG_RESULT([$groff_ms_works])
1652b73be646Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1653b73be646Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1654b73be646Smrg        groff_mm_works=yes
1655b73be646Smrg    else
1656b73be646Smrg        groff_mm_works=no
1657b73be646Smrg    fi
1658b73be646Smrg    AC_MSG_RESULT([$groff_mm_works])
16596aab59a7Smrgfi
1660659607e0Smrg
1661b73be646Smrg# We have groff, test for HTML dependencies, one command per package
1662b73be646Smrgif test "x$have_groff" = x"yes"; then
1663b73be646Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1664b73be646Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1665b73be646Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1666b73be646Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1667b73be646Smrg      have_groff_html=yes
1668b73be646Smrg   else
1669b73be646Smrg      have_groff_html=no
1670b73be646Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1671b73be646Smrg   fi
16726aab59a7Smrgfi
1673659607e0Smrg
1674b73be646Smrg# Set Automake conditionals for Makefiles
1675b73be646SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1676b73be646SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1677b73be646SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1678b73be646SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1679b73be646Smrg]) # XORG_WITH_GROFF
1680659607e0Smrg
1681b73be646Smrg# XORG_WITH_FOP
1682b73be646Smrg# ----------------
1683b73be646Smrg# Minimum version: 1.6.0
1684b73be646Smrg#
1685b73be646Smrg# Documentation tools are not always available on all platforms and sometimes
1686b73be646Smrg# not at the appropriate level. This macro enables a module to test for the
1687b73be646Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1688b73be646Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
1689b73be646Smrg# as whether or not to use the fop package.
1690b73be646Smrg#
1691b73be646Smrg# Interface to module:
1692b73be646Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1693b73be646Smrg# FOP:	 	returns the path of the fop program found
1694b73be646Smrg#		returns the path set by the user in the environment
1695b73be646Smrg# --with-fop: 	'yes' user instructs the module to use fop
1696b73be646Smrg#		'no' user instructs the module not to use fop
1697b73be646Smrg#
1698b73be646Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1699b73be646Smrg#
1700b73be646SmrgAC_DEFUN([XORG_WITH_FOP],[
1701b73be646SmrgAC_ARG_VAR([FOP], [Path to fop command])
1702b73be646SmrgAC_ARG_WITH(fop,
1703b73be646Smrg	AS_HELP_STRING([--with-fop],
1704b73be646Smrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
1705b73be646Smrg	   [use_fop=$withval], [use_fop=auto])
1706b73be646Smrg
1707b73be646Smrgif test "x$use_fop" = x"auto"; then
1708b73be646Smrg   AC_PATH_PROG([FOP], [fop])
1709b73be646Smrg   if test "x$FOP" = "x"; then
1710b73be646Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1711b73be646Smrg	have_fop=no
1712b73be646Smrg   else
1713b73be646Smrg        have_fop=yes
1714b73be646Smrg   fi
1715b73be646Smrgelif test "x$use_fop" = x"yes" ; then
1716b73be646Smrg   AC_PATH_PROG([FOP], [fop])
1717b73be646Smrg   if test "x$FOP" = "x"; then
1718b73be646Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1719b73be646Smrg   fi
1720b73be646Smrg   have_fop=yes
1721b73be646Smrgelif test "x$use_fop" = x"no" ; then
1722b73be646Smrg   if test "x$FOP" != "x"; then
1723b73be646Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1724b73be646Smrg   fi
1725b73be646Smrg   have_fop=no
1726b73be646Smrgelse
1727b73be646Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1728b73be646Smrgfi
1729b73be646SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1730b73be646Smrg]) # XORG_WITH_FOP
1731659607e0Smrg
1732b73be646Smrg# XORG_WITH_PS2PDF
1733b73be646Smrg# ----------------
1734b73be646Smrg# Minimum version: 1.6.0
1735b73be646Smrg#
1736b73be646Smrg# Documentation tools are not always available on all platforms and sometimes
1737b73be646Smrg# not at the appropriate level. This macro enables a module to test for the
1738b73be646Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1739b73be646Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1740b73be646Smrg# as whether or not to use the ps2pdf package.
1741b73be646Smrg#
1742b73be646Smrg# Interface to module:
1743b73be646Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1744b73be646Smrg# PS2PDF:	returns the path of the ps2pdf program found
1745b73be646Smrg#		returns the path set by the user in the environment
1746b73be646Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1747b73be646Smrg#		 'no' user instructs the module not to use ps2pdf
1748b73be646Smrg#
1749b73be646Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1750b73be646Smrg#
1751b73be646SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1752b73be646SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1753b73be646SmrgAC_ARG_WITH(ps2pdf,
1754b73be646Smrg	AS_HELP_STRING([--with-ps2pdf],
1755b73be646Smrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
1756b73be646Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
1757b73be646Smrg
1758b73be646Smrgif test "x$use_ps2pdf" = x"auto"; then
1759b73be646Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1760b73be646Smrg   if test "x$PS2PDF" = "x"; then
1761b73be646Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1762b73be646Smrg	have_ps2pdf=no
1763b73be646Smrg   else
1764b73be646Smrg        have_ps2pdf=yes
1765b73be646Smrg   fi
1766b73be646Smrgelif test "x$use_ps2pdf" = x"yes" ; then
1767b73be646Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1768b73be646Smrg   if test "x$PS2PDF" = "x"; then
1769b73be646Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1770b73be646Smrg   fi
1771b73be646Smrg   have_ps2pdf=yes
1772b73be646Smrgelif test "x$use_ps2pdf" = x"no" ; then
1773b73be646Smrg   if test "x$PS2PDF" != "x"; then
1774b73be646Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1775b73be646Smrg   fi
1776b73be646Smrg   have_ps2pdf=no
1777b73be646Smrgelse
1778b73be646Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1779b73be646Smrgfi
1780b73be646SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1781b73be646Smrg]) # XORG_WITH_PS2PDF
1782659607e0Smrg
1783b73be646Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
1784b73be646Smrg# ----------------
1785b73be646Smrg# Minimum version: 1.6.0
1786b73be646Smrg#
1787b73be646Smrg# Documentation tools are not always available on all platforms and sometimes
1788b73be646Smrg# not at the appropriate level. This macro enables a builder to skip all
1789b73be646Smrg# documentation targets except traditional man pages.
1790b73be646Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1791b73be646Smrg# maximum flexibilty in controlling documentation building.
1792b73be646Smrg# Refer to:
1793b73be646Smrg# XORG_WITH_XMLTO         --with-xmlto
1794b73be646Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1795b73be646Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1796b73be646Smrg# XORG_WITH_FOP           --with-fop
1797b73be646Smrg# XORG_WITH_GROFF         --with-groff
1798b73be646Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1799b73be646Smrg#
1800b73be646Smrg# Interface to module:
1801b73be646Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1802b73be646Smrg# --enable-docs: 'yes' user instructs the module to generate docs
1803b73be646Smrg#		 'no' user instructs the module not to generate docs
1804b73be646Smrg# parm1:	specify the default value, yes or no.
1805b73be646Smrg#
1806b73be646SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1807b73be646Smrgdefault=$1
1808b73be646Smrgif test "x$default" = x ; then
1809b73be646Smrg  default="yes"
1810b73be646Smrgfi
1811b73be646SmrgAC_ARG_ENABLE(docs,
1812b73be646Smrg	AS_HELP_STRING([--enable-docs],
1813b73be646Smrg	   [Enable building the documentation (default: yes)]),
1814b73be646Smrg	   [build_docs=$enableval], [build_docs=$default])
1815b73be646SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1816b73be646SmrgAC_MSG_CHECKING([whether to build documentation])
1817b73be646SmrgAC_MSG_RESULT([$build_docs])
1818b73be646Smrg]) # XORG_ENABLE_DOCS
1819b73be646Smrg
1820b73be646Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1821b73be646Smrg# ----------------
1822b73be646Smrg# Minimum version: 1.6.0
1823b73be646Smrg#
1824b73be646Smrg# This macro enables a builder to skip all developer documentation.
1825b73be646Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1826b73be646Smrg# maximum flexibilty in controlling documentation building.
1827b73be646Smrg# Refer to:
1828b73be646Smrg# XORG_WITH_XMLTO         --with-xmlto
1829b73be646Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1830b73be646Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1831b73be646Smrg# XORG_WITH_FOP           --with-fop
1832b73be646Smrg# XORG_WITH_GROFF         --with-groff
1833b73be646Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1834b73be646Smrg#
1835b73be646Smrg# Interface to module:
1836b73be646Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1837b73be646Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1838b73be646Smrg#			'no' user instructs the module not to generate developer docs
1839b73be646Smrg# parm1:		specify the default value, yes or no.
1840b73be646Smrg#
1841b73be646SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1842b73be646Smrgdevel_default=$1
1843b73be646Smrgif test "x$devel_default" = x ; then
1844b73be646Smrg  devel_default="yes"
1845b73be646Smrgfi
1846b73be646SmrgAC_ARG_ENABLE(devel-docs,
1847b73be646Smrg	AS_HELP_STRING([--enable-devel-docs],
1848b73be646Smrg	   [Enable building the developer documentation (default: yes)]),
1849b73be646Smrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
1850b73be646SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1851b73be646SmrgAC_MSG_CHECKING([whether to build developer documentation])
1852b73be646SmrgAC_MSG_RESULT([$build_devel_docs])
1853b73be646Smrg]) # XORG_ENABLE_DEVEL_DOCS
1854b73be646Smrg
1855b73be646Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
1856b73be646Smrg# ----------------
1857b73be646Smrg# Minimum version: 1.6.0
1858b73be646Smrg#
1859b73be646Smrg# This macro enables a builder to skip all functional specification targets.
1860b73be646Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1861b73be646Smrg# maximum flexibilty in controlling documentation building.
1862b73be646Smrg# Refer to:
1863b73be646Smrg# XORG_WITH_XMLTO         --with-xmlto
1864b73be646Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1865b73be646Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1866b73be646Smrg# XORG_WITH_FOP           --with-fop
1867b73be646Smrg# XORG_WITH_GROFF         --with-groff
1868b73be646Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1869b73be646Smrg#
1870b73be646Smrg# Interface to module:
1871b73be646Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1872b73be646Smrg# --enable-specs:	'yes' user instructs the module to generate specs
1873b73be646Smrg#			'no' user instructs the module not to generate specs
1874b73be646Smrg# parm1:		specify the default value, yes or no.
1875b73be646Smrg#
1876b73be646SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1877b73be646Smrgspec_default=$1
1878b73be646Smrgif test "x$spec_default" = x ; then
1879b73be646Smrg  spec_default="yes"
1880b73be646Smrgfi
1881b73be646SmrgAC_ARG_ENABLE(specs,
1882b73be646Smrg	AS_HELP_STRING([--enable-specs],
1883b73be646Smrg	   [Enable building the specs (default: yes)]),
1884b73be646Smrg	   [build_specs=$enableval], [build_specs=$spec_default])
1885b73be646SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1886b73be646SmrgAC_MSG_CHECKING([whether to build functional specifications])
1887b73be646SmrgAC_MSG_RESULT([$build_specs])
1888b73be646Smrg]) # XORG_ENABLE_SPECS
1889659607e0Smrg
1890b73be646Smrg# XORG_CHECK_MALLOC_ZERO
1891b73be646Smrg# ----------------------
1892b73be646Smrg# Minimum version: 1.0.0
1893b73be646Smrg#
1894b73be646Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1895b73be646Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1896b73be646Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1897b73be646SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1898b73be646SmrgAC_ARG_ENABLE(malloc0returnsnull,
1899b73be646Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1900b73be646Smrg		       [malloc(0) returns NULL (default: auto)]),
1901b73be646Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1902b73be646Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1903b73be646Smrg
1904b73be646SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1905b73be646Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1906b73be646Smrg	AC_RUN_IFELSE([
1907b73be646Smrgchar *malloc();
1908b73be646Smrgchar *realloc();
1909b73be646Smrgchar *calloc();
1910b73be646Smrgmain() {
1911b73be646Smrg    char *m0, *r0, *c0, *p;
1912b73be646Smrg    m0 = malloc(0);
1913b73be646Smrg    p = malloc(10);
1914b73be646Smrg    r0 = realloc(p,0);
1915b73be646Smrg    c0 = calloc(0);
1916b73be646Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1917b73be646Smrg}],
1918b73be646Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1919b73be646Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
1920b73be646Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1921b73be646Smrgfi
1922b73be646SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1923b73be646Smrg
1924b73be646Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1925b73be646Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1926b73be646Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1927b73be646Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1928b73be646Smrgelse
1929b73be646Smrg	MALLOC_ZERO_CFLAGS=""
1930b73be646Smrg	XMALLOC_ZERO_CFLAGS=""
1931b73be646Smrg	XTMALLOC_ZERO_CFLAGS=""
1932b73be646Smrgfi
1933b73be646Smrg
1934b73be646SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1935b73be646SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1936b73be646SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1937b73be646Smrg]) # XORG_CHECK_MALLOC_ZERO
1938b73be646Smrg
1939b73be646Smrg# XORG_WITH_LINT()
1940b73be646Smrg# ----------------
1941b73be646Smrg# Minimum version: 1.1.0
1942b73be646Smrg#
1943b73be646Smrg# This macro enables the use of a tool that flags some suspicious and
1944b73be646Smrg# non-portable constructs (likely to be bugs) in C language source code.
1945b73be646Smrg# It will attempt to locate the tool and use appropriate options.
1946b73be646Smrg# There are various lint type tools on different platforms.
1947b73be646Smrg#
1948b73be646Smrg# Interface to module:
1949b73be646Smrg# LINT:		returns the path to the tool found on the platform
1950b73be646Smrg#		or the value set to LINT on the configure cmd line
1951b73be646Smrg#		also an Automake conditional
1952b73be646Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1953b73be646Smrg#
1954b73be646Smrg# --with-lint:	'yes' user instructs the module to use lint
1955b73be646Smrg#		'no' user instructs the module not to use lint (default)
1956b73be646Smrg#
1957b73be646Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1958b73be646Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1959b73be646Smrg#
1960b73be646SmrgAC_DEFUN([XORG_WITH_LINT],[
1961b73be646Smrg
1962b73be646SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1963b73be646SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1964b73be646SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1965b73be646Smrg		[Use a lint-style source code checker (default: disabled)])],
1966b73be646Smrg		[use_lint=$withval], [use_lint=no])
1967b73be646Smrg
1968b73be646Smrg# Obtain platform specific info like program name and options
1969b73be646Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1970b73be646Smrgcase $host_os in
1971b73be646Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1972b73be646Smrg	lint_name=splint
1973b73be646Smrg	lint_options="-badflag"
1974fc27e79cSmrg	;;
1975b73be646Smrg  *freebsd* | *netbsd*)
1976b73be646Smrg	lint_name=lint
1977b73be646Smrg	lint_options="-u -b"
1978fc27e79cSmrg	;;
1979b73be646Smrg  *solaris*)
1980b73be646Smrg	lint_name=lint
1981b73be646Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1982fc27e79cSmrg	;;
1983fc27e79cSmrgesac
1984fc27e79cSmrg
1985b73be646Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1986b73be646Smrgif test "x$use_lint" = x"yes" ; then
1987b73be646Smrg   AC_PATH_PROG([LINT], [$lint_name])
1988b73be646Smrg   if test "x$LINT" = "x"; then
1989b73be646Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1990b73be646Smrg   fi
1991b73be646Smrgelif test "x$use_lint" = x"no" ; then
1992b73be646Smrg   if test "x$LINT" != "x"; then
1993b73be646Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1994b73be646Smrg   fi
1995b73be646Smrgelse
1996b73be646Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1997b73be646Smrgfi
1998fc27e79cSmrg
1999b73be646Smrg# User supplied flags override default flags
2000b73be646Smrgif test "x$LINT_FLAGS" != "x"; then
2001b73be646Smrg   lint_options=$LINT_FLAGS
2002b73be646Smrgfi
2003fc27e79cSmrg
2004b73be646SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2005b73be646SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2006fc27e79cSmrg
2007b73be646Smrg]) # XORG_WITH_LINT
2008fc27e79cSmrg
2009b73be646Smrg# XORG_LINT_LIBRARY(LIBNAME)
2010b73be646Smrg# --------------------------
2011b73be646Smrg# Minimum version: 1.1.0
2012b73be646Smrg#
2013b73be646Smrg# Sets up flags for building lint libraries for checking programs that call
2014b73be646Smrg# functions in the library.
2015b73be646Smrg#
2016b73be646Smrg# Interface to module:
2017b73be646Smrg# LINTLIB		- Automake variable with the name of lint library file to make
2018b73be646Smrg# MAKE_LINT_LIB		- Automake conditional
2019b73be646Smrg#
2020b73be646Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2021b73be646Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2022fc27e79cSmrg
2023b73be646SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2024b73be646SmrgAC_REQUIRE([XORG_WITH_LINT])
2025b73be646SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2026b73be646Smrg	[Create lint library (default: disabled)])],
2027b73be646Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2028fc27e79cSmrg
2029b73be646Smrgif test "x$make_lint_lib" = x"yes" ; then
2030b73be646Smrg   LINTLIB=llib-l$1.ln
2031b73be646Smrg   if test "x$LINT" = "x"; then
2032b73be646Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2033b73be646Smrg   fi
2034b73be646Smrgelif test "x$make_lint_lib" != x"no" ; then
2035b73be646Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
20366aab59a7Smrgfi
2037659607e0Smrg
2038b73be646SmrgAC_SUBST(LINTLIB)
2039b73be646SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2040659607e0Smrg
2041b73be646Smrg]) # XORG_LINT_LIBRARY
2042659607e0Smrg
2043b73be646Smrg# XORG_CWARNFLAGS
2044b73be646Smrg# ---------------
2045b73be646Smrg# Minimum version: 1.2.0
2046b73be646Smrg#
2047b73be646Smrg# Defines CWARNFLAGS to enable C compiler warnings.
2048b73be646Smrg#
2049b73be646SmrgAC_DEFUN([XORG_CWARNFLAGS], [
2050b73be646SmrgAC_REQUIRE([AC_PROG_CC_C99])
2051b73be646Smrgif  test "x$GCC" = xyes ; then
2052b73be646Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2053b73be646Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2054b73be646Smrg-Wbad-function-cast -Wformat=2"
2055b73be646Smrg    case `$CC -dumpversion` in
2056b73be646Smrg    3.4.* | 4.*)
2057b73be646Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2058b73be646Smrg	;;
2059b73be646Smrg    esac
20606aab59a7Smrgelse
2061b73be646Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2062b73be646Smrg    if test "x$SUNCC" = "xyes"; then
2063b73be646Smrg	CWARNFLAGS="-v"
2064b73be646Smrg    fi
20656aab59a7Smrgfi
2066b73be646SmrgAC_SUBST(CWARNFLAGS)
2067b73be646Smrg]) # XORG_CWARNFLAGS
2068659607e0Smrg
2069b73be646Smrg# XORG_STRICT_OPTION
2070b73be646Smrg# -----------------------
2071b73be646Smrg# Minimum version: 1.3.0
2072b73be646Smrg#
2073b73be646Smrg# Add configure option to enable strict compilation
2074b73be646SmrgAC_DEFUN([XORG_STRICT_OPTION], [
2075b73be646Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2076b73be646SmrgAC_REQUIRE([AC_PROG_CC_C99])
2077b73be646SmrgAC_REQUIRE([XORG_CWARNFLAGS])
2078659607e0Smrg
2079b73be646SmrgAC_ARG_ENABLE(strict-compilation,
2080b73be646Smrg			  AS_HELP_STRING([--enable-strict-compilation],
2081b73be646Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2082b73be646Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2083b73be646Smrgif test "x$STRICT_COMPILE" = "xyes"; then
2084b73be646Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2085b73be646Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2086b73be646Smrg	if test "x$GCC" = xyes ; then
2087b73be646Smrg		STRICT_CFLAGS="-pedantic -Werror"
2088b73be646Smrg	elif test "x$SUNCC" = "xyes"; then
2089b73be646Smrg		STRICT_CFLAGS="-errwarn"
2090b73be646Smrg    elif test "x$INTELCC" = "xyes"; then
2091b73be646Smrg		STRICT_CFLAGS="-Werror"
2092b73be646Smrg	fi
20936aab59a7Smrgfi
2094b73be646SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2095b73be646SmrgAC_SUBST([CWARNFLAGS])
2096b73be646Smrg]) # XORG_STRICT_OPTION
2097659607e0Smrg
2098b73be646Smrg# XORG_DEFAULT_OPTIONS
2099b73be646Smrg# --------------------
2100b73be646Smrg# Minimum version: 1.3.0
2101b73be646Smrg#
2102b73be646Smrg# Defines default options for X.Org modules.
2103b73be646Smrg#
2104b73be646SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2105b73be646SmrgAC_REQUIRE([AC_PROG_INSTALL])
2106b73be646SmrgXORG_CWARNFLAGS
2107b73be646SmrgXORG_STRICT_OPTION
2108b73be646SmrgXORG_RELEASE_VERSION
2109b73be646SmrgXORG_CHANGELOG
2110b73be646SmrgXORG_INSTALL
2111b73be646SmrgXORG_MANPAGE_SECTIONS
2112b73be646Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2113b73be646Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2114b73be646Smrg]) # XORG_DEFAULT_OPTIONS
2115659607e0Smrg
2116b73be646Smrg# XORG_INSTALL()
2117b73be646Smrg# ----------------
2118b73be646Smrg# Minimum version: 1.4.0
2119b73be646Smrg#
2120b73be646Smrg# Defines the variable INSTALL_CMD as the command to copy
2121b73be646Smrg# INSTALL from $prefix/share/util-macros.
2122b73be646Smrg#
2123b73be646SmrgAC_DEFUN([XORG_INSTALL], [
2124b73be646SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2125b73be646Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2126b73be646SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2127b73be646Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2128b73be646Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2129b73be646Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2130b73be646SmrgAC_SUBST([INSTALL_CMD])
2131b73be646Smrg]) # XORG_INSTALL
2132b73be646Smrgdnl Copyright 2005 Red Hat, Inc
2133b73be646Smrgdnl
2134b73be646Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2135b73be646Smrgdnl documentation for any purpose is hereby granted without fee, provided that
2136b73be646Smrgdnl the above copyright notice appear in all copies and that both that
2137b73be646Smrgdnl copyright notice and this permission notice appear in supporting
2138b73be646Smrgdnl documentation.
2139b73be646Smrgdnl
2140b73be646Smrgdnl The above copyright notice and this permission notice shall be included
2141b73be646Smrgdnl in all copies or substantial portions of the Software.
2142b73be646Smrgdnl
2143b73be646Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2144b73be646Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2145b73be646Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2146b73be646Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2147b73be646Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2148b73be646Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2149b73be646Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
2150b73be646Smrgdnl
2151b73be646Smrgdnl Except as contained in this notice, the name of the copyright holders shall
2152b73be646Smrgdnl not be used in advertising or otherwise to promote the sale, use or
2153b73be646Smrgdnl other dealings in this Software without prior written authorization
2154b73be646Smrgdnl from the copyright holders.
2155b73be646Smrgdnl
2156659607e0Smrg
2157b73be646Smrg# XORG_RELEASE_VERSION
2158b73be646Smrg# --------------------
2159b73be646Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2160b73be646Smrg 
2161b73be646SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2162b73be646Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2163b73be646Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2164b73be646Smrg		[Major version of this package])
2165b73be646Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2166b73be646Smrg	if test "x$PVM" = "x"; then
2167b73be646Smrg		PVM="0"
2168b73be646Smrg	fi
2169b73be646Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2170b73be646Smrg		[$PVM],
2171b73be646Smrg		[Minor version of this package])
2172b73be646Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2173b73be646Smrg	if test "x$PVP" = "x"; then
2174b73be646Smrg		PVP="0"
2175b73be646Smrg	fi
2176b73be646Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2177b73be646Smrg		[$PVP],
2178b73be646Smrg		[Patch version of this package])
2179b73be646Smrg])
2180659607e0Smrg
2181b73be646Smrg# XORG_CHANGELOG()
2182b73be646Smrg# ----------------
2183b73be646Smrg# Minimum version: 1.2.0
2184b73be646Smrg#
2185b73be646Smrg# Defines the variable CHANGELOG_CMD as the command to generate
2186b73be646Smrg# ChangeLog from git.
2187b73be646Smrg#
2188b73be646Smrg#
2189b73be646SmrgAC_DEFUN([XORG_CHANGELOG], [
2190b73be646SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2191b73be646Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2192b73be646Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2193b73be646Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2194b73be646SmrgAC_SUBST([CHANGELOG_CMD])
2195b73be646Smrg]) # XORG_CHANGELOG
2196659607e0Smrg
2197b73be646Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2198b73be646Smrg# 
2199b73be646Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2200b73be646Smrg#
2201b73be646Smrg# This program is free software; you can redistribute it and/or modify
2202b73be646Smrg# it under the terms of the GNU General Public License as published by
2203b73be646Smrg# the Free Software Foundation; either version 2 of the License, or
2204b73be646Smrg# (at your option) any later version.
2205b73be646Smrg#
2206b73be646Smrg# This program is distributed in the hope that it will be useful, but
2207b73be646Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2208b73be646Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2209b73be646Smrg# General Public License for more details.
2210b73be646Smrg#
2211b73be646Smrg# You should have received a copy of the GNU General Public License
2212b73be646Smrg# along with this program; if not, write to the Free Software
2213b73be646Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2214b73be646Smrg#
2215b73be646Smrg# As a special exception to the GNU General Public License, if you
2216b73be646Smrg# distribute this file as part of a program that contains a
2217b73be646Smrg# configuration script generated by Autoconf, you may include it under
2218b73be646Smrg# the same distribution terms that you use for the rest of that program.
2219659607e0Smrg
2220b73be646Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2221b73be646Smrg# ----------------------------------
2222b73be646SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2223b73be646Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2224b73be646Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2225b73be646SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2226b73be646Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2227b73be646Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2228b73be646Smrgfi
2229b73be646Smrgif test -n "$PKG_CONFIG"; then
2230b73be646Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
2231b73be646Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2232b73be646Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2233b73be646Smrg		AC_MSG_RESULT([yes])
2234b73be646Smrg	else
2235b73be646Smrg		AC_MSG_RESULT([no])
2236b73be646Smrg		PKG_CONFIG=""
2237b73be646Smrg	fi
2238b73be646Smrg		
2239b73be646Smrgfi[]dnl
2240b73be646Smrg])# PKG_PROG_PKG_CONFIG
2241659607e0Smrg
2242b73be646Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2243b73be646Smrg#
2244b73be646Smrg# Check to see whether a particular set of modules exists.  Similar
2245b73be646Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2246b73be646Smrg#
2247b73be646Smrg#
2248b73be646Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2249b73be646Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
2250b73be646Smrg# PKG_CHECK_EXISTS manually
2251b73be646Smrg# --------------------------------------------------------------
2252b73be646SmrgAC_DEFUN([PKG_CHECK_EXISTS],
2253b73be646Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2254b73be646Smrgif test -n "$PKG_CONFIG" && \
2255b73be646Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2256b73be646Smrg  m4_ifval([$2], [$2], [:])
2257b73be646Smrgm4_ifvaln([$3], [else
2258b73be646Smrg  $3])dnl
2259b73be646Smrgfi])
2260659607e0Smrg
2261659607e0Smrg
2262b73be646Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2263b73be646Smrg# ---------------------------------------------
2264b73be646Smrgm4_define([_PKG_CONFIG],
2265b73be646Smrg[if test -n "$$1"; then
2266b73be646Smrg    pkg_cv_[]$1="$$1"
2267b73be646Smrg elif test -n "$PKG_CONFIG"; then
2268b73be646Smrg    PKG_CHECK_EXISTS([$3],
2269b73be646Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2270b73be646Smrg		     [pkg_failed=yes])
2271b73be646Smrg else
2272b73be646Smrg    pkg_failed=untried
2273b73be646Smrgfi[]dnl
2274b73be646Smrg])# _PKG_CONFIG
2275659607e0Smrg
2276b73be646Smrg# _PKG_SHORT_ERRORS_SUPPORTED
2277b73be646Smrg# -----------------------------
2278b73be646SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2279b73be646Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2280b73be646Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2281b73be646Smrg        _pkg_short_errors_supported=yes
2282b73be646Smrgelse
2283b73be646Smrg        _pkg_short_errors_supported=no
2284b73be646Smrgfi[]dnl
2285b73be646Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
2286659607e0Smrg
2287659607e0Smrg
2288b73be646Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2289b73be646Smrg# [ACTION-IF-NOT-FOUND])
2290b73be646Smrg#
2291b73be646Smrg#
2292b73be646Smrg# Note that if there is a possibility the first call to
2293b73be646Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2294b73be646Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2295b73be646Smrg#
2296b73be646Smrg#
2297b73be646Smrg# --------------------------------------------------------------
2298b73be646SmrgAC_DEFUN([PKG_CHECK_MODULES],
2299b73be646Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2300b73be646SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2301b73be646SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2302659607e0Smrg
2303b73be646Smrgpkg_failed=no
2304b73be646SmrgAC_MSG_CHECKING([for $1])
2305659607e0Smrg
2306b73be646Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2307b73be646Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2308659607e0Smrg
2309b73be646Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2310b73be646Smrgand $1[]_LIBS to avoid the need to call pkg-config.
2311b73be646SmrgSee the pkg-config man page for more details.])
2312659607e0Smrg
2313b73be646Smrgif test $pkg_failed = yes; then
2314b73be646Smrg        _PKG_SHORT_ERRORS_SUPPORTED
2315b73be646Smrg        if test $_pkg_short_errors_supported = yes; then
2316b73be646Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2317b73be646Smrg        else 
2318b73be646Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2319b73be646Smrg        fi
2320b73be646Smrg	# Put the nasty error message in config.log where it belongs
2321b73be646Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2322659607e0Smrg
2323b73be646Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2324b73be646Smrg[Package requirements ($2) were not met:
2325659607e0Smrg
2326b73be646Smrg$$1_PKG_ERRORS
2327659607e0Smrg
2328b73be646SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2329b73be646Smrginstalled software in a non-standard prefix.
2330659607e0Smrg
2331b73be646Smrg_PKG_TEXT
2332b73be646Smrg])],
2333b73be646Smrg		[AC_MSG_RESULT([no])
2334b73be646Smrg                $4])
2335b73be646Smrgelif test $pkg_failed = untried; then
2336b73be646Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2337b73be646Smrg[The pkg-config script could not be found or is too old.  Make sure it
2338b73be646Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
2339b73be646Smrgpath to pkg-config.
2340659607e0Smrg
2341b73be646Smrg_PKG_TEXT
2342659607e0Smrg
2343b73be646SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2344b73be646Smrg		[$4])
2345fc27e79cSmrgelse
2346b73be646Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2347b73be646Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2348b73be646Smrg        AC_MSG_RESULT([yes])
2349b73be646Smrg	ifelse([$3], , :, [$3])
2350b73be646Smrgfi[]dnl
2351b73be646Smrg])# PKG_CHECK_MODULES
2352659607e0Smrg
2353b73be646Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2354b73be646Smrg#
2355b73be646Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2356b73be646Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
2357b73be646Smrg#   Written by Gordon Matzigkeit, 1996
2358b73be646Smrg#
2359b73be646Smrg# This file is free software; the Free Software Foundation gives
2360b73be646Smrg# unlimited permission to copy and/or distribute it, with or without
2361b73be646Smrg# modifications, as long as this notice is preserved.
2362659607e0Smrg
2363b73be646Smrgm4_define([_LT_COPYING], [dnl
2364b73be646Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2365b73be646Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
2366b73be646Smrg#   Written by Gordon Matzigkeit, 1996
2367b73be646Smrg#
2368b73be646Smrg#   This file is part of GNU Libtool.
2369b73be646Smrg#
2370b73be646Smrg# GNU Libtool is free software; you can redistribute it and/or
2371b73be646Smrg# modify it under the terms of the GNU General Public License as
2372b73be646Smrg# published by the Free Software Foundation; either version 2 of
2373b73be646Smrg# the License, or (at your option) any later version.
2374b73be646Smrg#
2375b73be646Smrg# As a special exception to the GNU General Public License,
2376b73be646Smrg# if you distribute this file as part of a program or library that
2377b73be646Smrg# is built using GNU Libtool, you may include this file under the
2378b73be646Smrg# same distribution terms that you use for the rest of that program.
2379b73be646Smrg#
2380b73be646Smrg# GNU Libtool is distributed in the hope that it will be useful,
2381b73be646Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
2382b73be646Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2383b73be646Smrg# GNU General Public License for more details.
2384b73be646Smrg#
2385b73be646Smrg# You should have received a copy of the GNU General Public License
2386b73be646Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
2387b73be646Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
2388b73be646Smrg# obtained by writing to the Free Software Foundation, Inc.,
2389b73be646Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2390b73be646Smrg])
2391659607e0Smrg
2392b73be646Smrg# serial 56 LT_INIT
2393659607e0Smrg
2394fc27e79cSmrg
2395b73be646Smrg# LT_PREREQ(VERSION)
2396b73be646Smrg# ------------------
2397b73be646Smrg# Complain and exit if this libtool version is less that VERSION.
2398b73be646Smrgm4_defun([LT_PREREQ],
2399b73be646Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
2400b73be646Smrg       [m4_default([$3],
2401b73be646Smrg		   [m4_fatal([Libtool version $1 or higher is required],
2402b73be646Smrg		             63)])],
2403b73be646Smrg       [$2])])
2404659607e0Smrg
2405659607e0Smrg
2406b73be646Smrg# _LT_CHECK_BUILDDIR
2407b73be646Smrg# ------------------
2408b73be646Smrg# Complain if the absolute build directory name contains unusual characters
2409b73be646Smrgm4_defun([_LT_CHECK_BUILDDIR],
2410b73be646Smrg[case `pwd` in
2411b73be646Smrg  *\ * | *\	*)
2412b73be646Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
2413b73be646Smrgesac
2414b73be646Smrg])
2415fc27e79cSmrg
2416659607e0Smrg
2417b73be646Smrg# LT_INIT([OPTIONS])
2418b73be646Smrg# ------------------
2419b73be646SmrgAC_DEFUN([LT_INIT],
2420b73be646Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
2421b73be646SmrgAC_BEFORE([$0], [LT_LANG])dnl
2422b73be646SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
2423b73be646SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
2424b73be646Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
2425659607e0Smrg
2426b73be646Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
2427b73be646Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
2428b73be646Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
2429b73be646Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
2430b73be646Smrgdnl unless we require an AC_DEFUNed macro:
2431b73be646SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
2432b73be646SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
2433b73be646SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
2434b73be646SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
2435b73be646Smrgm4_require([_LT_PROG_LTMAIN])dnl
2436659607e0Smrg
2437b73be646Smrgdnl Parse OPTIONS
2438b73be646Smrg_LT_SET_OPTIONS([$0], [$1])
2439659607e0Smrg
2440b73be646Smrg# This can be used to rebuild libtool when needed
2441b73be646SmrgLIBTOOL_DEPS="$ltmain"
2442659607e0Smrg
2443b73be646Smrg# Always use our own libtool.
2444b73be646SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
2445b73be646SmrgAC_SUBST(LIBTOOL)dnl
2446659607e0Smrg
2447b73be646Smrg_LT_SETUP
2448659607e0Smrg
2449b73be646Smrg# Only expand once:
2450b73be646Smrgm4_define([LT_INIT])
2451b73be646Smrg])# LT_INIT
2452659607e0Smrg
2453b73be646Smrg# Old names:
2454b73be646SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
2455b73be646SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
2456b73be646Smrgdnl aclocal-1.4 backwards compatibility:
2457b73be646Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
2458b73be646Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
2459659607e0Smrg
2460659607e0Smrg
2461b73be646Smrg# _LT_CC_BASENAME(CC)
2462b73be646Smrg# -------------------
2463b73be646Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
2464b73be646Smrgm4_defun([_LT_CC_BASENAME],
2465b73be646Smrg[for cc_temp in $1""; do
2466b73be646Smrg  case $cc_temp in
2467b73be646Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
2468b73be646Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
2469b73be646Smrg    \-*) ;;
2470b73be646Smrg    *) break;;
2471b73be646Smrg  esac
2472b73be646Smrgdone
2473b73be646Smrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
24746aab59a7Smrg])
2475659607e0Smrg
2476659607e0Smrg
2477b73be646Smrg# _LT_FILEUTILS_DEFAULTS
2478b73be646Smrg# ----------------------
2479b73be646Smrg# It is okay to use these file commands and assume they have been set
2480b73be646Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
2481b73be646Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
2482b73be646Smrg[: ${CP="cp -f"}
2483b73be646Smrg: ${MV="mv -f"}
2484b73be646Smrg: ${RM="rm -f"}
2485b73be646Smrg])# _LT_FILEUTILS_DEFAULTS
2486659607e0Smrg
2487659607e0Smrg
2488b73be646Smrg# _LT_SETUP
2489b73be646Smrg# ---------
2490b73be646Smrgm4_defun([_LT_SETUP],
2491b73be646Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2492b73be646SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2493b73be646Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
2494b73be646Smrg_LT_DECL([], [host], [0])dnl
2495b73be646Smrg_LT_DECL([], [host_os], [0])dnl
2496b73be646Smrgdnl
2497b73be646Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
2498b73be646Smrg_LT_DECL([], [build], [0])dnl
2499b73be646Smrg_LT_DECL([], [build_os], [0])dnl
2500b73be646Smrgdnl
2501b73be646SmrgAC_REQUIRE([AC_PROG_CC])dnl
2502b73be646SmrgAC_REQUIRE([LT_PATH_LD])dnl
2503b73be646SmrgAC_REQUIRE([LT_PATH_NM])dnl
2504b73be646Smrgdnl
2505b73be646SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
2506b73be646Smrgtest -z "$LN_S" && LN_S="ln -s"
2507b73be646Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
2508b73be646Smrgdnl
2509b73be646SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
2510b73be646Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
2511b73be646Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
2512b73be646Smrgdnl
2513b73be646Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2514b73be646Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2515b73be646Smrgm4_require([_LT_CMD_RELOAD])dnl
2516b73be646Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
2517b73be646Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
2518b73be646Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
2519659607e0Smrg
2520b73be646Smrg_LT_CONFIG_LIBTOOL_INIT([
2521b73be646Smrg# See if we are running on zsh, and set the options which allow our
2522b73be646Smrg# commands through without removal of \ escapes INIT.
2523b73be646Smrgif test -n "\${ZSH_VERSION+set}" ; then
2524b73be646Smrg   setopt NO_GLOB_SUBST
2525b73be646Smrgfi
2526b73be646Smrg])
2527b73be646Smrgif test -n "${ZSH_VERSION+set}" ; then
2528b73be646Smrg   setopt NO_GLOB_SUBST
2529fc27e79cSmrgfi
2530659607e0Smrg
2531b73be646Smrg_LT_CHECK_OBJDIR
2532659607e0Smrg
2533b73be646Smrgm4_require([_LT_TAG_COMPILER])dnl
2534b73be646Smrg_LT_PROG_ECHO_BACKSLASH
2535659607e0Smrg
2536b73be646Smrgcase $host_os in
2537b73be646Smrgaix3*)
2538b73be646Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2539b73be646Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2540b73be646Smrg  # vanish in a puff of smoke.
2541b73be646Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
2542b73be646Smrg    COLLECT_NAMES=
2543b73be646Smrg    export COLLECT_NAMES
2544fc27e79cSmrg  fi
2545b73be646Smrg  ;;
2546b73be646Smrgesac
2547659607e0Smrg
2548b73be646Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
2549b73be646Smrg# metacharacters that are still active within double-quoted strings.
2550b73be646Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2551659607e0Smrg
2552b73be646Smrg# Same as above, but do not quote variable references.
2553b73be646Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2554659607e0Smrg
2555b73be646Smrg# Sed substitution to delay expansion of an escaped shell variable in a
2556b73be646Smrg# double_quote_subst'ed string.
2557b73be646Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2558659607e0Smrg
2559b73be646Smrg# Sed substitution to delay expansion of an escaped single quote.
2560b73be646Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2561659607e0Smrg
2562b73be646Smrg# Sed substitution to avoid accidental globbing in evaled expressions
2563b73be646Smrgno_glob_subst='s/\*/\\\*/g'
2564659607e0Smrg
2565b73be646Smrg# Global variables:
2566b73be646Smrgofile=libtool
2567b73be646Smrgcan_build_shared=yes
2568659607e0Smrg
2569b73be646Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
2570b73be646Smrg# which needs '.lib').
2571b73be646Smrglibext=a
2572659607e0Smrg
2573b73be646Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
2574fc27e79cSmrg
2575b73be646Smrgold_CC="$CC"
2576b73be646Smrgold_CFLAGS="$CFLAGS"
2577659607e0Smrg
2578b73be646Smrg# Set sane defaults for various variables
2579b73be646Smrgtest -z "$CC" && CC=cc
2580b73be646Smrgtest -z "$LTCC" && LTCC=$CC
2581b73be646Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2582b73be646Smrgtest -z "$LD" && LD=ld
2583b73be646Smrgtest -z "$ac_objext" && ac_objext=o
2584659607e0Smrg
2585b73be646Smrg_LT_CC_BASENAME([$compiler])
2586659607e0Smrg
2587b73be646Smrg# Only perform the check for file, if the check method requires it
2588b73be646Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2589b73be646Smrgcase $deplibs_check_method in
2590b73be646Smrgfile_magic*)
2591b73be646Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2592b73be646Smrg    _LT_PATH_MAGIC
2593b73be646Smrg  fi
2594fc27e79cSmrg  ;;
2595b73be646Smrgesac
2596659607e0Smrg
2597b73be646Smrg# Use C for the default configuration in the libtool script
2598b73be646SmrgLT_SUPPORTED_TAG([CC])
2599b73be646Smrg_LT_LANG_C_CONFIG
2600b73be646Smrg_LT_LANG_DEFAULT_CONFIG
2601b73be646Smrg_LT_CONFIG_COMMANDS
2602b73be646Smrg])# _LT_SETUP
2603659607e0Smrg
2604fc27e79cSmrg
2605b73be646Smrg# _LT_PROG_LTMAIN
2606b73be646Smrg# ---------------
2607b73be646Smrg# Note that this code is called both from `configure', and `config.status'
2608b73be646Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
2609b73be646Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
2610b73be646Smrg# so we pass a copy along to make sure it has a sensible value anyway.
2611b73be646Smrgm4_defun([_LT_PROG_LTMAIN],
2612b73be646Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
2613b73be646Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
2614b73be646Smrgltmain="$ac_aux_dir/ltmain.sh"
2615b73be646Smrg])# _LT_PROG_LTMAIN
2616fc27e79cSmrg
2617659607e0Smrg
2618fc27e79cSmrg
2619b73be646Smrg# So that we can recreate a full libtool script including additional
2620b73be646Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
2621b73be646Smrg# in macros and then make a single call at the end using the `libtool'
2622b73be646Smrg# label.
2623fc27e79cSmrg
2624fc27e79cSmrg
2625b73be646Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
2626b73be646Smrg# ----------------------------------------
2627b73be646Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
2628b73be646Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
2629b73be646Smrg[m4_ifval([$1],
2630b73be646Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
2631b73be646Smrg                     [$1
2632b73be646Smrg])])])
2633659607e0Smrg
2634b73be646Smrg# Initialize.
2635b73be646Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
2636fc27e79cSmrg
2637fc27e79cSmrg
2638b73be646Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
2639b73be646Smrg# ------------------------------
2640b73be646Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
2641b73be646Smrgm4_define([_LT_CONFIG_LIBTOOL],
2642b73be646Smrg[m4_ifval([$1],
2643b73be646Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
2644b73be646Smrg                     [$1
2645b73be646Smrg])])])
2646fc27e79cSmrg
2647b73be646Smrg# Initialize.
2648b73be646Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
2649659607e0Smrg
2650659607e0Smrg
2651b73be646Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
2652b73be646Smrg# -----------------------------------------------------
2653b73be646Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
2654b73be646Smrg[_LT_CONFIG_LIBTOOL([$1])
2655b73be646Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
2656b73be646Smrg])
2657659607e0Smrg
26586aab59a7Smrg
2659b73be646Smrg# _LT_FORMAT_COMMENT([COMMENT])
2660b73be646Smrg# -----------------------------
2661b73be646Smrg# Add leading comment marks to the start of each line, and a trailing
2662b73be646Smrg# full-stop to the whole comment if one is not present already.
2663b73be646Smrgm4_define([_LT_FORMAT_COMMENT],
2664b73be646Smrg[m4_ifval([$1], [
2665b73be646Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
2666b73be646Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
2667b73be646Smrg)])
26686aab59a7Smrg
26696aab59a7Smrg
2670659607e0Smrg
2671659607e0Smrg
2672659607e0Smrg
2673b73be646Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
2674b73be646Smrg# -------------------------------------------------------------------
2675b73be646Smrg# CONFIGNAME is the name given to the value in the libtool script.
2676b73be646Smrg# VARNAME is the (base) name used in the configure script.
2677b73be646Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
2678b73be646Smrg# VARNAME.  Any other value will be used directly.
2679b73be646Smrgm4_define([_LT_DECL],
2680b73be646Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
2681b73be646Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
2682b73be646Smrg	[m4_ifval([$1], [$1], [$2])])
2683b73be646Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
2684b73be646Smrg    m4_ifval([$4],
2685b73be646Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
2686b73be646Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
2687b73be646Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
2688b73be646Smrg])
2689659607e0Smrg
2690659607e0Smrg
2691b73be646Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
2692b73be646Smrg# --------------------------------------------------------
2693b73be646Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
2694659607e0Smrg
2695659607e0Smrg
2696b73be646Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
2697b73be646Smrg# ------------------------------------------------
2698b73be646Smrgm4_define([lt_decl_tag_varnames],
2699b73be646Smrg[_lt_decl_filter([tagged?], [yes], $@)])
2700659607e0Smrg
2701659607e0Smrg
2702b73be646Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
2703b73be646Smrg# ---------------------------------------------------------
2704b73be646Smrgm4_define([_lt_decl_filter],
2705b73be646Smrg[m4_case([$#],
2706b73be646Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
2707b73be646Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
2708b73be646Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
2709b73be646Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
2710b73be646Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
2711b73be646Smrg])
2712659607e0Smrg
2713659607e0Smrg
2714b73be646Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
2715b73be646Smrg# --------------------------------------------------
2716b73be646Smrgm4_define([lt_decl_quote_varnames],
2717b73be646Smrg[_lt_decl_filter([value], [1], $@)])
2718659607e0Smrg
2719659607e0Smrg
2720b73be646Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
2721b73be646Smrg# ---------------------------------------------------
2722b73be646Smrgm4_define([lt_decl_dquote_varnames],
2723b73be646Smrg[_lt_decl_filter([value], [2], $@)])
2724659607e0Smrg
2725659607e0Smrg
2726b73be646Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
2727b73be646Smrg# ---------------------------------------------------
2728b73be646Smrgm4_define([lt_decl_varnames_tagged],
2729b73be646Smrg[m4_assert([$# <= 2])dnl
2730b73be646Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
2731b73be646Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
2732b73be646Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
2733b73be646Smrgm4_define([_lt_decl_varnames_tagged],
2734b73be646Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
2735659607e0Smrg
2736659607e0Smrg
2737b73be646Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
2738b73be646Smrg# ------------------------------------------------
2739b73be646Smrgm4_define([lt_decl_all_varnames],
2740b73be646Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
2741b73be646Smrg     m4_if([$2], [],
2742b73be646Smrg	   m4_quote(lt_decl_varnames),
2743b73be646Smrg	m4_quote(m4_shift($@))))[]dnl
2744b73be646Smrg])
2745b73be646Smrgm4_define([_lt_decl_all_varnames],
2746b73be646Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
2747b73be646Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
2748b73be646Smrg])
2749659607e0Smrg
2750fc27e79cSmrg
2751b73be646Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
2752b73be646Smrg# ------------------------------------
2753b73be646Smrg# Quote a variable value, and forward it to `config.status' so that its
2754b73be646Smrg# declaration there will have the same value as in `configure'.  VARNAME
2755b73be646Smrg# must have a single quote delimited value for this to work.
2756b73be646Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
2757b73be646Smrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
2758fc27e79cSmrg
2759659607e0Smrg
2760b73be646Smrg# _LT_CONFIG_STATUS_DECLARATIONS
2761b73be646Smrg# ------------------------------
2762b73be646Smrg# We delimit libtool config variables with single quotes, so when
2763b73be646Smrg# we write them to config.status, we have to be sure to quote all
2764b73be646Smrg# embedded single quotes properly.  In configure, this macro expands
2765b73be646Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
2766b73be646Smrg#
2767b73be646Smrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
2768b73be646Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
2769b73be646Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
2770b73be646Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
2771659607e0Smrg
2772659607e0Smrg
2773b73be646Smrg# _LT_LIBTOOL_TAGS
2774b73be646Smrg# ----------------
2775b73be646Smrg# Output comment and list of tags supported by the script
2776b73be646Smrgm4_defun([_LT_LIBTOOL_TAGS],
2777b73be646Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
2778b73be646Smrgavailable_tags="_LT_TAGS"dnl
2779b73be646Smrg])
2780659607e0Smrg
2781659607e0Smrg
2782b73be646Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
2783b73be646Smrg# -----------------------------------
2784b73be646Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
2785b73be646Smrg# expand to a commented shell variable setting:
2786b73be646Smrg#
2787b73be646Smrg#    # Some comment about what VAR is for.
2788b73be646Smrg#    visible_name=$lt_internal_name
2789b73be646Smrgm4_define([_LT_LIBTOOL_DECLARE],
2790b73be646Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
2791b73be646Smrg					   [description])))[]dnl
2792b73be646Smrgm4_pushdef([_libtool_name],
2793b73be646Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
2794b73be646Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
2795b73be646Smrg    [0], [_libtool_name=[$]$1],
2796b73be646Smrg    [1], [_libtool_name=$lt_[]$1],
2797b73be646Smrg    [2], [_libtool_name=$lt_[]$1],
2798b73be646Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
2799b73be646Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
2800b73be646Smrg])
2801659607e0Smrg
2802659607e0Smrg
2803b73be646Smrg# _LT_LIBTOOL_CONFIG_VARS
2804b73be646Smrg# -----------------------
2805b73be646Smrg# Produce commented declarations of non-tagged libtool config variables
2806b73be646Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
2807b73be646Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
2808b73be646Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
2809b73be646Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
2810b73be646Smrg[m4_foreach([_lt_var],
2811b73be646Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
2812b73be646Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
2813659607e0Smrg
2814659607e0Smrg
2815b73be646Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
2816b73be646Smrg# -------------------------
2817b73be646Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
2818b73be646Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
2819b73be646Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
2820659607e0Smrg
2821659607e0Smrg
2822b73be646Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
2823b73be646Smrg# ------------------------------
2824b73be646Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
2825659607e0Smrg
2826659607e0Smrg
2827b73be646Smrg# _LT_CONFIG_COMMANDS
2828b73be646Smrg# -------------------
2829b73be646Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
2830b73be646Smrg# variables for single and double quote escaping we saved from calls
2831b73be646Smrg# to _LT_DECL, we can put quote escaped variables declarations
2832b73be646Smrg# into `config.status', and then the shell code to quote escape them in
2833b73be646Smrg# for loops in `config.status'.  Finally, any additional code accumulated
2834b73be646Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
2835b73be646Smrgm4_defun([_LT_CONFIG_COMMANDS],
2836b73be646Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
2837b73be646Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
2838b73be646Smrg	dnl instead of duplicating it all over again into config.status,
2839b73be646Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
2840b73be646Smrg	dnl needs to know what name is stored there:
2841b73be646Smrg        [AC_CONFIG_COMMANDS([libtool],
2842b73be646Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
2843b73be646Smrg    dnl If the libtool generation code is destined for config.status,
2844b73be646Smrg    dnl expand the accumulated commands and init code now:
2845b73be646Smrg    [AC_CONFIG_COMMANDS([libtool],
2846b73be646Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
2847b73be646Smrg])#_LT_CONFIG_COMMANDS
2848659607e0Smrg
2849659607e0Smrg
2850b73be646Smrg# Initialize.
2851b73be646Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
2852b73be646Smrg[
2853659607e0Smrg
2854b73be646Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
2855b73be646Smrg# if CDPATH is set.
2856b73be646Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2857659607e0Smrg
2858b73be646Smrgsed_quote_subst='$sed_quote_subst'
2859b73be646Smrgdouble_quote_subst='$double_quote_subst'
2860b73be646Smrgdelay_variable_subst='$delay_variable_subst'
2861b73be646Smrg_LT_CONFIG_STATUS_DECLARATIONS
2862b73be646SmrgLTCC='$LTCC'
2863b73be646SmrgLTCFLAGS='$LTCFLAGS'
2864b73be646Smrgcompiler='$compiler_DEFAULT'
2865659607e0Smrg
2866b73be646Smrg# Quote evaled strings.
2867b73be646Smrgfor var in lt_decl_all_varnames([[ \
2868b73be646Smrg]], lt_decl_quote_varnames); do
2869b73be646Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
2870b73be646Smrg    *[[\\\\\\\`\\"\\\$]]*)
2871b73be646Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
2872b73be646Smrg      ;;
2873b73be646Smrg    *)
2874b73be646Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
2875b73be646Smrg      ;;
2876b73be646Smrg    esac
2877b73be646Smrgdone
2878659607e0Smrg
2879b73be646Smrg# Double-quote double-evaled strings.
2880b73be646Smrgfor var in lt_decl_all_varnames([[ \
2881b73be646Smrg]], lt_decl_dquote_varnames); do
2882b73be646Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
2883b73be646Smrg    *[[\\\\\\\`\\"\\\$]]*)
2884b73be646Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
2885b73be646Smrg      ;;
2886b73be646Smrg    *)
2887b73be646Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
2888b73be646Smrg      ;;
2889b73be646Smrg    esac
2890b73be646Smrgdone
2891659607e0Smrg
2892b73be646Smrg# Fix-up fallback echo if it was mangled by the above quoting rules.
2893b73be646Smrgcase \$lt_ECHO in
2894b73be646Smrg*'\\\[$]0 --fallback-echo"')dnl "
2895b73be646Smrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
2896fc27e79cSmrg  ;;
2897b73be646Smrgesac
2898659607e0Smrg
2899b73be646Smrg_LT_OUTPUT_LIBTOOL_INIT
2900b73be646Smrg])
29016aab59a7Smrg
2902659607e0Smrg
2903b73be646Smrg# LT_OUTPUT
2904b73be646Smrg# ---------
2905b73be646Smrg# This macro allows early generation of the libtool script (before
2906b73be646Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
2907b73be646Smrg# tests.
2908b73be646SmrgAC_DEFUN([LT_OUTPUT],
2909b73be646Smrg[: ${CONFIG_LT=./config.lt}
2910b73be646SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
2911b73be646Smrgcat >"$CONFIG_LT" <<_LTEOF
2912b73be646Smrg#! $SHELL
2913b73be646Smrg# Generated by $as_me.
2914b73be646Smrg# Run this file to recreate a libtool stub with the current configuration.
2915659607e0Smrg
2916b73be646Smrglt_cl_silent=false
2917b73be646SmrgSHELL=\${CONFIG_SHELL-$SHELL}
2918b73be646Smrg_LTEOF
2919659607e0Smrg
2920b73be646Smrgcat >>"$CONFIG_LT" <<\_LTEOF
2921b73be646SmrgAS_SHELL_SANITIZE
2922b73be646Smrg_AS_PREPARE
2923659607e0Smrg
2924b73be646Smrgexec AS_MESSAGE_FD>&1
2925b73be646Smrgexec AS_MESSAGE_LOG_FD>>config.log
2926b73be646Smrg{
2927b73be646Smrg  echo
2928b73be646Smrg  AS_BOX([Running $as_me.])
2929b73be646Smrg} >&AS_MESSAGE_LOG_FD
2930659607e0Smrg
2931b73be646Smrglt_cl_help="\
2932b73be646Smrg\`$as_me' creates a local libtool stub from the current configuration,
2933b73be646Smrgfor use in further configure time tests before the real libtool is
2934b73be646Smrggenerated.
2935fc27e79cSmrg
2936b73be646SmrgUsage: $[0] [[OPTIONS]]
2937659607e0Smrg
2938b73be646Smrg  -h, --help      print this help, then exit
2939b73be646Smrg  -V, --version   print version number, then exit
2940b73be646Smrg  -q, --quiet     do not print progress messages
2941b73be646Smrg  -d, --debug     don't remove temporary files
2942659607e0Smrg
2943b73be646SmrgReport bugs to <bug-libtool@gnu.org>."
2944fc27e79cSmrg
2945b73be646Smrglt_cl_version="\
2946b73be646Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
2947b73be646Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
2948b73be646Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
2949659607e0Smrg
2950b73be646SmrgCopyright (C) 2008 Free Software Foundation, Inc.
2951b73be646SmrgThis config.lt script is free software; the Free Software Foundation
2952b73be646Smrggives unlimited permision to copy, distribute and modify it."
2953659607e0Smrg
2954b73be646Smrgwhile test $[#] != 0
2955b73be646Smrgdo
2956b73be646Smrg  case $[1] in
2957b73be646Smrg    --version | --v* | -V )
2958b73be646Smrg      echo "$lt_cl_version"; exit 0 ;;
2959b73be646Smrg    --help | --h* | -h )
2960b73be646Smrg      echo "$lt_cl_help"; exit 0 ;;
2961b73be646Smrg    --debug | --d* | -d )
2962b73be646Smrg      debug=: ;;
2963b73be646Smrg    --quiet | --q* | --silent | --s* | -q )
2964b73be646Smrg      lt_cl_silent=: ;;
2965659607e0Smrg
2966b73be646Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
2967b73be646SmrgTry \`$[0] --help' for more information.]) ;;
2968659607e0Smrg
2969b73be646Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
2970b73be646SmrgTry \`$[0] --help' for more information.]) ;;
2971b73be646Smrg  esac
2972b73be646Smrg  shift
2973b73be646Smrgdone
2974659607e0Smrg
2975b73be646Smrgif $lt_cl_silent; then
2976b73be646Smrg  exec AS_MESSAGE_FD>/dev/null
2977b73be646Smrgfi
2978b73be646Smrg_LTEOF
2979659607e0Smrg
2980b73be646Smrgcat >>"$CONFIG_LT" <<_LTEOF
2981b73be646Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
2982b73be646Smrg_LTEOF
29836aab59a7Smrg
2984b73be646Smrgcat >>"$CONFIG_LT" <<\_LTEOF
2985b73be646SmrgAC_MSG_NOTICE([creating $ofile])
2986b73be646Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
2987b73be646SmrgAS_EXIT(0)
2988b73be646Smrg_LTEOF
2989b73be646Smrgchmod +x "$CONFIG_LT"
29906aab59a7Smrg
2991b73be646Smrg# configure is writing to config.log, but config.lt does its own redirection,
2992b73be646Smrg# appending to config.log, which fails on DOS, as config.log is still kept
2993b73be646Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
2994b73be646Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
2995b73be646Smrgif test "$no_create" != yes; then
2996b73be646Smrg  lt_cl_success=:
2997b73be646Smrg  test "$silent" = yes &&
2998b73be646Smrg    lt_config_lt_args="$lt_config_lt_args --quiet"
2999b73be646Smrg  exec AS_MESSAGE_LOG_FD>/dev/null
3000b73be646Smrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
3001b73be646Smrg  exec AS_MESSAGE_LOG_FD>>config.log
3002b73be646Smrg  $lt_cl_success || AS_EXIT(1)
3003b73be646Smrgfi
3004b73be646Smrg])# LT_OUTPUT
3005659607e0Smrg
3006659607e0Smrg
3007b73be646Smrg# _LT_CONFIG(TAG)
3008b73be646Smrg# ---------------
3009b73be646Smrg# If TAG is the built-in tag, create an initial libtool script with a
3010b73be646Smrg# default configuration from the untagged config vars.  Otherwise add code
3011b73be646Smrg# to config.status for appending the configuration named by TAG from the
3012b73be646Smrg# matching tagged config vars.
3013b73be646Smrgm4_defun([_LT_CONFIG],
3014b73be646Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3015b73be646Smrg_LT_CONFIG_SAVE_COMMANDS([
3016b73be646Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
3017b73be646Smrg  m4_if(_LT_TAG, [C], [
3018b73be646Smrg    # See if we are running on zsh, and set the options which allow our
3019b73be646Smrg    # commands through without removal of \ escapes.
3020b73be646Smrg    if test -n "${ZSH_VERSION+set}" ; then
3021b73be646Smrg      setopt NO_GLOB_SUBST
3022b73be646Smrg    fi
3023659607e0Smrg
3024b73be646Smrg    cfgfile="${ofile}T"
3025b73be646Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
3026b73be646Smrg    $RM "$cfgfile"
3027659607e0Smrg
3028b73be646Smrg    cat <<_LT_EOF >> "$cfgfile"
3029b73be646Smrg#! $SHELL
3030fc27e79cSmrg
3031b73be646Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
3032b73be646Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
3033b73be646Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3034b73be646Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
3035b73be646Smrg#
3036b73be646Smrg_LT_COPYING
3037b73be646Smrg_LT_LIBTOOL_TAGS
30386aab59a7Smrg
3039b73be646Smrg# ### BEGIN LIBTOOL CONFIG
3040b73be646Smrg_LT_LIBTOOL_CONFIG_VARS
3041b73be646Smrg_LT_LIBTOOL_TAG_VARS
3042b73be646Smrg# ### END LIBTOOL CONFIG
30436aab59a7Smrg
3044b73be646Smrg_LT_EOF
3045659607e0Smrg
3046b73be646Smrg  case $host_os in
3047b73be646Smrg  aix3*)
3048b73be646Smrg    cat <<\_LT_EOF >> "$cfgfile"
3049b73be646Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
3050b73be646Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
3051b73be646Smrg# vanish in a puff of smoke.
3052b73be646Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
3053b73be646Smrg  COLLECT_NAMES=
3054b73be646Smrg  export COLLECT_NAMES
3055b73be646Smrgfi
3056b73be646Smrg_LT_EOF
3057b73be646Smrg    ;;
3058b73be646Smrg  esac
3059659607e0Smrg
3060b73be646Smrg  _LT_PROG_LTMAIN
3061659607e0Smrg
3062b73be646Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
3063b73be646Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3064b73be646Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
3065b73be646Smrg  # is reportedly fixed, but why not run on old versions too?
3066b73be646Smrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
3067b73be646Smrg    || (rm -f "$cfgfile"; exit 1)
3068659607e0Smrg
3069b73be646Smrg  _LT_PROG_XSI_SHELLFNS
3070659607e0Smrg
3071b73be646Smrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
3072b73be646Smrg    || (rm -f "$cfgfile"; exit 1)
3073659607e0Smrg
3074b73be646Smrg  mv -f "$cfgfile" "$ofile" ||
3075b73be646Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
3076b73be646Smrg  chmod +x "$ofile"
3077b73be646Smrg],
3078b73be646Smrg[cat <<_LT_EOF >> "$ofile"
3079659607e0Smrg
3080b73be646Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
3081b73be646Smrgdnl in a comment (ie after a #).
3082b73be646Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
3083b73be646Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
3084b73be646Smrg# ### END LIBTOOL TAG CONFIG: $1
3085b73be646Smrg_LT_EOF
3086b73be646Smrg])dnl /m4_if
3087b73be646Smrg],
3088b73be646Smrg[m4_if([$1], [], [
3089b73be646Smrg    PACKAGE='$PACKAGE'
3090b73be646Smrg    VERSION='$VERSION'
3091b73be646Smrg    TIMESTAMP='$TIMESTAMP'
3092b73be646Smrg    RM='$RM'
3093b73be646Smrg    ofile='$ofile'], [])
3094b73be646Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
3095b73be646Smrg])# _LT_CONFIG
3096659607e0Smrg
3097659607e0Smrg
3098b73be646Smrg# LT_SUPPORTED_TAG(TAG)
3099b73be646Smrg# ---------------------
3100b73be646Smrg# Trace this macro to discover what tags are supported by the libtool
3101b73be646Smrg# --tag option, using:
3102b73be646Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
3103b73be646SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
3104fc27e79cSmrg
3105fc27e79cSmrg
3106b73be646Smrg# C support is built-in for now
3107b73be646Smrgm4_define([_LT_LANG_C_enabled], [])
3108b73be646Smrgm4_define([_LT_TAGS], [])
3109fc27e79cSmrg
3110fc27e79cSmrg
3111b73be646Smrg# LT_LANG(LANG)
3112b73be646Smrg# -------------
3113b73be646Smrg# Enable libtool support for the given language if not already enabled.
3114b73be646SmrgAC_DEFUN([LT_LANG],
3115b73be646Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
3116b73be646Smrgm4_case([$1],
3117b73be646Smrg  [C],			[_LT_LANG(C)],
3118b73be646Smrg  [C++],		[_LT_LANG(CXX)],
3119b73be646Smrg  [Java],		[_LT_LANG(GCJ)],
3120b73be646Smrg  [Fortran 77],		[_LT_LANG(F77)],
3121b73be646Smrg  [Fortran],		[_LT_LANG(FC)],
3122b73be646Smrg  [Windows Resource],	[_LT_LANG(RC)],
3123b73be646Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
3124b73be646Smrg    [_LT_LANG($1)],
3125b73be646Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
3126b73be646Smrg])# LT_LANG
3127659607e0Smrg
3128659607e0Smrg
3129b73be646Smrg# _LT_LANG(LANGNAME)
3130b73be646Smrg# ------------------
3131b73be646Smrgm4_defun([_LT_LANG],
3132b73be646Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
3133b73be646Smrg  [LT_SUPPORTED_TAG([$1])dnl
3134b73be646Smrg  m4_append([_LT_TAGS], [$1 ])dnl
3135b73be646Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
3136b73be646Smrg  _LT_LANG_$1_CONFIG($1)])dnl
3137b73be646Smrg])# _LT_LANG
3138fc27e79cSmrg
3139fc27e79cSmrg
3140b73be646Smrg# _LT_LANG_DEFAULT_CONFIG
3141b73be646Smrg# -----------------------
3142b73be646Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
3143b73be646Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
3144b73be646Smrg  [LT_LANG(CXX)],
3145b73be646Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
3146659607e0Smrg
3147b73be646SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
3148b73be646Smrg  [LT_LANG(F77)],
3149b73be646Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
3150659607e0Smrg
3151b73be646SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
3152b73be646Smrg  [LT_LANG(FC)],
3153b73be646Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
3154659607e0Smrg
3155b73be646Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
3156b73be646Smrgdnl pulling things in needlessly.
3157b73be646SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
3158b73be646Smrg  [LT_LANG(GCJ)],
3159b73be646Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
3160b73be646Smrg    [LT_LANG(GCJ)],
3161b73be646Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
3162b73be646Smrg      [LT_LANG(GCJ)],
3163b73be646Smrg      [m4_ifdef([AC_PROG_GCJ],
3164b73be646Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
3165b73be646Smrg       m4_ifdef([A][M_PROG_GCJ],
3166b73be646Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
3167b73be646Smrg       m4_ifdef([LT_PROG_GCJ],
3168b73be646Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
31696aab59a7Smrg
3170b73be646SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
3171b73be646Smrg  [LT_LANG(RC)],
3172b73be646Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
3173b73be646Smrg])# _LT_LANG_DEFAULT_CONFIG
3174659607e0Smrg
3175b73be646Smrg# Obsolete macros:
3176b73be646SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
3177b73be646SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
3178b73be646SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
3179b73be646SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
3180b73be646Smrgdnl aclocal-1.4 backwards compatibility:
3181b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
3182b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
3183b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
3184b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
31856aab59a7Smrg
31866aab59a7Smrg
3187b73be646Smrg# _LT_TAG_COMPILER
3188b73be646Smrg# ----------------
3189b73be646Smrgm4_defun([_LT_TAG_COMPILER],
3190b73be646Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3191659607e0Smrg
3192b73be646Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
3193b73be646Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
3194b73be646Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
3195b73be646Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
31966aab59a7Smrg
3197b73be646Smrg# If no C compiler was specified, use CC.
3198b73be646SmrgLTCC=${LTCC-"$CC"}
31996aab59a7Smrg
3200b73be646Smrg# If no C compiler flags were specified, use CFLAGS.
3201b73be646SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
32026aab59a7Smrg
3203b73be646Smrg# Allow CC to be a program name with arguments.
3204b73be646Smrgcompiler=$CC
3205b73be646Smrg])# _LT_TAG_COMPILER
3206659607e0Smrg
3207659607e0Smrg
3208b73be646Smrg# _LT_COMPILER_BOILERPLATE
3209b73be646Smrg# ------------------------
3210b73be646Smrg# Check for compiler boilerplate output or warnings with
3211b73be646Smrg# the simple compiler test code.
3212b73be646Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
3213b73be646Smrg[m4_require([_LT_DECL_SED])dnl
3214b73be646Smrgac_outfile=conftest.$ac_objext
3215b73be646Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
3216b73be646Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
3217b73be646Smrg_lt_compiler_boilerplate=`cat conftest.err`
3218b73be646Smrg$RM conftest*
3219b73be646Smrg])# _LT_COMPILER_BOILERPLATE
3220659607e0Smrg
3221659607e0Smrg
3222b73be646Smrg# _LT_LINKER_BOILERPLATE
3223b73be646Smrg# ----------------------
3224b73be646Smrg# Check for linker boilerplate output or warnings with
3225b73be646Smrg# the simple link test code.
3226b73be646Smrgm4_defun([_LT_LINKER_BOILERPLATE],
3227b73be646Smrg[m4_require([_LT_DECL_SED])dnl
3228b73be646Smrgac_outfile=conftest.$ac_objext
3229b73be646Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
3230b73be646Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
3231b73be646Smrg_lt_linker_boilerplate=`cat conftest.err`
3232b73be646Smrg$RM -r conftest*
3233b73be646Smrg])# _LT_LINKER_BOILERPLATE
3234659607e0Smrg
3235b73be646Smrg# _LT_REQUIRED_DARWIN_CHECKS
3236b73be646Smrg# -------------------------
3237b73be646Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
3238b73be646Smrg  case $host_os in
3239b73be646Smrg    rhapsody* | darwin*)
3240b73be646Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
3241b73be646Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
3242b73be646Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
3243b73be646Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
3244b73be646Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
3245b73be646Smrg    _LT_DECL([], [DSYMUTIL], [1],
3246b73be646Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
3247b73be646Smrg    _LT_DECL([], [NMEDIT], [1],
3248b73be646Smrg      [Tool to change global to local symbols on Mac OS X])
3249b73be646Smrg    _LT_DECL([], [LIPO], [1],
3250b73be646Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
3251b73be646Smrg    _LT_DECL([], [OTOOL], [1],
3252b73be646Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
3253b73be646Smrg    _LT_DECL([], [OTOOL64], [1],
3254b73be646Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
3255659607e0Smrg
3256b73be646Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
3257b73be646Smrg      [lt_cv_apple_cc_single_mod=no
3258b73be646Smrg      if test -z "${LT_MULTI_MODULE}"; then
3259b73be646Smrg	# By default we will add the -single_module flag. You can override
3260b73be646Smrg	# by either setting the environment variable LT_MULTI_MODULE
3261b73be646Smrg	# non-empty at configure time, or by adding -multi_module to the
3262b73be646Smrg	# link flags.
3263b73be646Smrg	rm -rf libconftest.dylib*
3264b73be646Smrg	echo "int foo(void){return 1;}" > conftest.c
3265b73be646Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
3266b73be646Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
3267b73be646Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
3268b73be646Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
3269b73be646Smrg        _lt_result=$?
3270b73be646Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
3271b73be646Smrg	  lt_cv_apple_cc_single_mod=yes
3272b73be646Smrg	else
3273b73be646Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
3274b73be646Smrg	fi
3275b73be646Smrg	rm -rf libconftest.dylib*
3276b73be646Smrg	rm -f conftest.*
3277b73be646Smrg      fi])
3278b73be646Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
3279b73be646Smrg      [lt_cv_ld_exported_symbols_list],
3280b73be646Smrg      [lt_cv_ld_exported_symbols_list=no
3281b73be646Smrg      save_LDFLAGS=$LDFLAGS
3282b73be646Smrg      echo "_main" > conftest.sym
3283b73be646Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
3284b73be646Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3285b73be646Smrg	[lt_cv_ld_exported_symbols_list=yes],
3286b73be646Smrg	[lt_cv_ld_exported_symbols_list=no])
3287b73be646Smrg	LDFLAGS="$save_LDFLAGS"
3288b73be646Smrg    ])
3289fc27e79cSmrg    case $host_os in
3290b73be646Smrg    rhapsody* | darwin1.[[012]])
3291b73be646Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
3292b73be646Smrg    darwin1.*)
3293b73be646Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
3294b73be646Smrg    darwin*) # darwin 5.x on
3295b73be646Smrg      # if running on 10.5 or later, the deployment target defaults
3296b73be646Smrg      # to the OS version, if on x86, and 10.4, the deployment
3297b73be646Smrg      # target defaults to 10.4. Don't you love it?
3298b73be646Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
3299b73be646Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
3300b73be646Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
3301b73be646Smrg	10.[[012]]*)
3302b73be646Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
3303b73be646Smrg	10.*)
3304b73be646Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
3305fc27e79cSmrg      esac
3306b73be646Smrg    ;;
3307b73be646Smrg  esac
3308b73be646Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
3309b73be646Smrg      _lt_dar_single_mod='$single_module'
3310b73be646Smrg    fi
3311b73be646Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
3312b73be646Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
3313b73be646Smrg    else
3314b73be646Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
3315b73be646Smrg    fi
3316b73be646Smrg    if test "$DSYMUTIL" != ":"; then
3317b73be646Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
3318b73be646Smrg    else
3319b73be646Smrg      _lt_dsymutil=
3320b73be646Smrg    fi
3321b73be646Smrg    ;;
3322b73be646Smrg  esac
3323b73be646Smrg])
3324659607e0Smrg
3325b73be646Smrg
3326b73be646Smrg# _LT_DARWIN_LINKER_FEATURES
3327b73be646Smrg# --------------------------
3328b73be646Smrg# Checks for linker and compiler features on darwin
3329b73be646Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
3330b73be646Smrg[
3331b73be646Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
3332b73be646Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
3333b73be646Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
3334b73be646Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
3335b73be646Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3336b73be646Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
3337b73be646Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
3338b73be646Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
3339b73be646Smrg  case $cc_basename in
3340b73be646Smrg     ifort*) _lt_dar_can_shared=yes ;;
3341b73be646Smrg     *) _lt_dar_can_shared=$GCC ;;
3342b73be646Smrg  esac
3343b73be646Smrg  if test "$_lt_dar_can_shared" = "yes"; then
3344b73be646Smrg    output_verbose_link_cmd=echo
3345b73be646Smrg    _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}"
3346b73be646Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
3347b73be646Smrg    _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}"
3348b73be646Smrg    _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}"
3349b73be646Smrg    m4_if([$1], [CXX],
3350b73be646Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
3351b73be646Smrg      _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}"
3352b73be646Smrg      _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}"
3353b73be646Smrg    fi
3354b73be646Smrg],[])
3355fc27e79cSmrg  else
3356b73be646Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
3357b73be646Smrg  fi
3358b73be646Smrg])
3359b73be646Smrg
3360b73be646Smrg# _LT_SYS_MODULE_PATH_AIX
3361b73be646Smrg# -----------------------
3362b73be646Smrg# Links a minimal program and checks the executable
3363b73be646Smrg# for the system default hardcoded library path. In most cases,
3364b73be646Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
3365b73be646Smrg# the location of the communication and MPI libs are included too.
3366b73be646Smrg# If we don't find anything, use the default library path according
3367b73be646Smrg# to the aix ld manual.
3368b73be646Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
3369b73be646Smrg[m4_require([_LT_DECL_SED])dnl
3370b73be646SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
3371b73be646Smrglt_aix_libpath_sed='
3372b73be646Smrg    /Import File Strings/,/^$/ {
3373b73be646Smrg	/^0/ {
3374b73be646Smrg	    s/^0  *\(.*\)$/\1/
3375b73be646Smrg	    p
3376b73be646Smrg	}
3377b73be646Smrg    }'
3378b73be646Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
3379b73be646Smrg# Check for a 64-bit object if we didn't find anything.
3380b73be646Smrgif test -z "$aix_libpath"; then
3381b73be646Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
3382b73be646Smrgfi],[])
3383b73be646Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
3384b73be646Smrg])# _LT_SYS_MODULE_PATH_AIX
3385b73be646Smrg
3386b73be646Smrg
3387b73be646Smrg# _LT_SHELL_INIT(ARG)
3388b73be646Smrg# -------------------
3389b73be646Smrgm4_define([_LT_SHELL_INIT],
3390b73be646Smrg[ifdef([AC_DIVERSION_NOTICE],
3391b73be646Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
3392b73be646Smrg	 [AC_DIVERT_PUSH(NOTICE)])
3393b73be646Smrg$1
3394b73be646SmrgAC_DIVERT_POP
3395b73be646Smrg])# _LT_SHELL_INIT
3396b73be646Smrg
3397b73be646Smrg
3398b73be646Smrg# _LT_PROG_ECHO_BACKSLASH
3399b73be646Smrg# -----------------------
3400b73be646Smrg# Add some code to the start of the generated configure script which
3401b73be646Smrg# will find an echo command which doesn't interpret backslashes.
3402b73be646Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
3403b73be646Smrg[_LT_SHELL_INIT([
3404b73be646Smrg# Check that we are running under the correct shell.
3405b73be646SmrgSHELL=${CONFIG_SHELL-/bin/sh}
3406b73be646Smrg
3407b73be646Smrgcase X$lt_ECHO in
3408b73be646SmrgX*--fallback-echo)
3409b73be646Smrg  # Remove one level of quotation (which was required for Make).
3410b73be646Smrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
3411b73be646Smrg  ;;
3412b73be646Smrgesac
3413b73be646Smrg
3414b73be646SmrgECHO=${lt_ECHO-echo}
3415b73be646Smrgif test "X[$]1" = X--no-reexec; then
3416b73be646Smrg  # Discard the --no-reexec flag, and continue.
3417b73be646Smrg  shift
3418b73be646Smrgelif test "X[$]1" = X--fallback-echo; then
3419b73be646Smrg  # Avoid inline document here, it may be left over
3420b73be646Smrg  :
3421b73be646Smrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
3422b73be646Smrg  # Yippee, $ECHO works!
3423b73be646Smrg  :
3424b73be646Smrgelse
3425b73be646Smrg  # Restart under the correct shell.
3426b73be646Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
3427b73be646Smrgfi
3428b73be646Smrg
3429b73be646Smrgif test "X[$]1" = X--fallback-echo; then
3430b73be646Smrg  # used as fallback echo
3431b73be646Smrg  shift
3432b73be646Smrg  cat <<_LT_EOF
3433b73be646Smrg[$]*
3434b73be646Smrg_LT_EOF
3435b73be646Smrg  exit 0
3436b73be646Smrgfi
3437b73be646Smrg
3438b73be646Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
3439b73be646Smrg# if CDPATH is set.
3440b73be646Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3441b73be646Smrg
3442b73be646Smrgif test -z "$lt_ECHO"; then
3443b73be646Smrg  if test "X${echo_test_string+set}" != Xset; then
3444b73be646Smrg    # find a string as large as possible, as long as the shell can cope with it
3445b73be646Smrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
3446b73be646Smrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
3447b73be646Smrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
3448b73be646Smrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
3449b73be646Smrg      then
3450b73be646Smrg        break
3451b73be646Smrg      fi
3452b73be646Smrg    done
3453b73be646Smrg  fi
3454b73be646Smrg
3455b73be646Smrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
3456b73be646Smrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
3457b73be646Smrg     test "X$echo_testing_string" = "X$echo_test_string"; then
3458b73be646Smrg    :
3459b73be646Smrg  else
3460b73be646Smrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
3461b73be646Smrg    # backslashes.  This makes it impossible to quote backslashes using
3462b73be646Smrg    #   echo "$something" | sed 's/\\/\\\\/g'
3463b73be646Smrg    #
3464b73be646Smrg    # So, first we look for a working echo in the user's PATH.
3465b73be646Smrg
3466b73be646Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3467b73be646Smrg    for dir in $PATH /usr/ucb; do
3468b73be646Smrg      IFS="$lt_save_ifs"
3469b73be646Smrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
3470b73be646Smrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
3471b73be646Smrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
3472b73be646Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
3473b73be646Smrg        ECHO="$dir/echo"
3474b73be646Smrg        break
3475b73be646Smrg      fi
3476b73be646Smrg    done
3477b73be646Smrg    IFS="$lt_save_ifs"
3478b73be646Smrg
3479b73be646Smrg    if test "X$ECHO" = Xecho; then
3480b73be646Smrg      # We didn't find a better echo, so look for alternatives.
3481b73be646Smrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
3482b73be646Smrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
3483b73be646Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
3484b73be646Smrg        # This shell has a builtin print -r that does the trick.
3485b73be646Smrg        ECHO='print -r'
3486b73be646Smrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
3487b73be646Smrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
3488b73be646Smrg        # If we have ksh, try running configure again with it.
3489b73be646Smrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
3490b73be646Smrg        export ORIGINAL_CONFIG_SHELL
3491b73be646Smrg        CONFIG_SHELL=/bin/ksh
3492b73be646Smrg        export CONFIG_SHELL
3493b73be646Smrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
3494b73be646Smrg      else
3495b73be646Smrg        # Try using printf.
3496b73be646Smrg        ECHO='printf %s\n'
3497b73be646Smrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
3498b73be646Smrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
3499b73be646Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
3500b73be646Smrg	  # Cool, printf works
3501b73be646Smrg	  :
3502b73be646Smrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
3503b73be646Smrg	     test "X$echo_testing_string" = 'X\t' &&
3504b73be646Smrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
3505b73be646Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
3506b73be646Smrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
3507b73be646Smrg	  export CONFIG_SHELL
3508b73be646Smrg	  SHELL="$CONFIG_SHELL"
3509b73be646Smrg	  export SHELL
3510b73be646Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
3511b73be646Smrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
3512b73be646Smrg	     test "X$echo_testing_string" = 'X\t' &&
3513b73be646Smrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
3514b73be646Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
3515b73be646Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
3516b73be646Smrg        else
3517b73be646Smrg	  # maybe with a smaller string...
3518b73be646Smrg	  prev=:
3519b73be646Smrg
3520b73be646Smrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
3521b73be646Smrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
3522b73be646Smrg	    then
3523b73be646Smrg	      break
3524b73be646Smrg	    fi
3525b73be646Smrg	    prev="$cmd"
3526b73be646Smrg	  done
3527b73be646Smrg
3528b73be646Smrg	  if test "$prev" != 'sed 50q "[$]0"'; then
3529b73be646Smrg	    echo_test_string=`eval $prev`
3530b73be646Smrg	    export echo_test_string
3531b73be646Smrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
3532b73be646Smrg	  else
3533b73be646Smrg	    # Oops.  We lost completely, so just stick with echo.
3534b73be646Smrg	    ECHO=echo
3535b73be646Smrg	  fi
3536b73be646Smrg        fi
3537b73be646Smrg      fi
3538b73be646Smrg    fi
3539b73be646Smrg  fi
3540b73be646Smrgfi
3541b73be646Smrg
3542b73be646Smrg# Copy echo and quote the copy suitably for passing to libtool from
3543b73be646Smrg# the Makefile, instead of quoting the original, which is used later.
3544b73be646Smrglt_ECHO=$ECHO
3545b73be646Smrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
3546b73be646Smrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
3547b73be646Smrgfi
3548b73be646Smrg
3549b73be646SmrgAC_SUBST(lt_ECHO)
3550b73be646Smrg])
3551b73be646Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
3552b73be646Smrg_LT_DECL([], [ECHO], [1],
3553b73be646Smrg    [An echo program that does not interpret backslashes])
3554b73be646Smrg])# _LT_PROG_ECHO_BACKSLASH
3555b73be646Smrg
3556b73be646Smrg
3557b73be646Smrg# _LT_ENABLE_LOCK
3558b73be646Smrg# ---------------
3559b73be646Smrgm4_defun([_LT_ENABLE_LOCK],
3560b73be646Smrg[AC_ARG_ENABLE([libtool-lock],
3561b73be646Smrg  [AS_HELP_STRING([--disable-libtool-lock],
3562b73be646Smrg    [avoid locking (might break parallel builds)])])
3563b73be646Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
3564b73be646Smrg
3565b73be646Smrg# Some flags need to be propagated to the compiler or linker for good
3566b73be646Smrg# libtool support.
3567b73be646Smrgcase $host in
3568b73be646Smrgia64-*-hpux*)
3569b73be646Smrg  # Find out which ABI we are using.
3570b73be646Smrg  echo 'int i;' > conftest.$ac_ext
3571b73be646Smrg  if AC_TRY_EVAL(ac_compile); then
3572b73be646Smrg    case `/usr/bin/file conftest.$ac_objext` in
3573b73be646Smrg      *ELF-32*)
3574b73be646Smrg	HPUX_IA64_MODE="32"
3575fc27e79cSmrg	;;
3576b73be646Smrg      *ELF-64*)
3577b73be646Smrg	HPUX_IA64_MODE="64"
3578fc27e79cSmrg	;;
3579b73be646Smrg    esac
3580b73be646Smrg  fi
3581b73be646Smrg  rm -rf conftest*
3582b73be646Smrg  ;;
3583b73be646Smrg*-*-irix6*)
3584b73be646Smrg  # Find out which ABI we are using.
3585b73be646Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
3586b73be646Smrg  if AC_TRY_EVAL(ac_compile); then
3587b73be646Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
3588b73be646Smrg      case `/usr/bin/file conftest.$ac_objext` in
3589b73be646Smrg	*32-bit*)
3590b73be646Smrg	  LD="${LD-ld} -melf32bsmip"
3591b73be646Smrg	  ;;
3592b73be646Smrg	*N32*)
3593b73be646Smrg	  LD="${LD-ld} -melf32bmipn32"
3594b73be646Smrg	  ;;
3595b73be646Smrg	*64-bit*)
3596b73be646Smrg	  LD="${LD-ld} -melf64bmip"
3597fc27e79cSmrg	;;
3598b73be646Smrg      esac
3599b73be646Smrg    else
3600b73be646Smrg      case `/usr/bin/file conftest.$ac_objext` in
3601b73be646Smrg	*32-bit*)
3602b73be646Smrg	  LD="${LD-ld} -32"
3603b73be646Smrg	  ;;
3604b73be646Smrg	*N32*)
3605b73be646Smrg	  LD="${LD-ld} -n32"
3606b73be646Smrg	  ;;
3607b73be646Smrg	*64-bit*)
3608b73be646Smrg	  LD="${LD-ld} -64"
3609b73be646Smrg	  ;;
3610b73be646Smrg      esac
3611b73be646Smrg    fi
3612b73be646Smrg  fi
3613b73be646Smrg  rm -rf conftest*
3614b73be646Smrg  ;;
3615b73be646Smrg
3616b73be646Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
3617b73be646Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
3618b73be646Smrg  # Find out which ABI we are using.
3619b73be646Smrg  echo 'int i;' > conftest.$ac_ext
3620b73be646Smrg  if AC_TRY_EVAL(ac_compile); then
3621b73be646Smrg    case `/usr/bin/file conftest.o` in
3622b73be646Smrg      *32-bit*)
3623b73be646Smrg	case $host in
3624b73be646Smrg	  x86_64-*kfreebsd*-gnu)
3625b73be646Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
3626fc27e79cSmrg	    ;;
3627b73be646Smrg	  x86_64-*linux*)
3628b73be646Smrg	    LD="${LD-ld} -m elf_i386"
3629fc27e79cSmrg	    ;;
3630b73be646Smrg	  ppc64-*linux*|powerpc64-*linux*)
3631b73be646Smrg	    LD="${LD-ld} -m elf32ppclinux"
3632fc27e79cSmrg	    ;;
3633b73be646Smrg	  s390x-*linux*)
3634b73be646Smrg	    LD="${LD-ld} -m elf_s390"
3635fc27e79cSmrg	    ;;
3636b73be646Smrg	  sparc64-*linux*)
3637b73be646Smrg	    LD="${LD-ld} -m elf32_sparc"
3638fc27e79cSmrg	    ;;
3639fc27e79cSmrg	esac
3640fc27e79cSmrg	;;
3641b73be646Smrg      *64-bit*)
3642b73be646Smrg	case $host in
3643b73be646Smrg	  x86_64-*kfreebsd*-gnu)
3644b73be646Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
3645fc27e79cSmrg	    ;;
3646b73be646Smrg	  x86_64-*linux*)
3647b73be646Smrg	    LD="${LD-ld} -m elf_x86_64"
3648fc27e79cSmrg	    ;;
3649b73be646Smrg	  ppc*-*linux*|powerpc*-*linux*)
3650b73be646Smrg	    LD="${LD-ld} -m elf64ppc"
3651fc27e79cSmrg	    ;;
3652b73be646Smrg	  s390*-*linux*|s390*-*tpf*)
3653b73be646Smrg	    LD="${LD-ld} -m elf64_s390"
3654fc27e79cSmrg	    ;;
3655b73be646Smrg	  sparc*-*linux*)
3656b73be646Smrg	    LD="${LD-ld} -m elf64_sparc"
3657fc27e79cSmrg	    ;;
3658fc27e79cSmrg	esac
3659fc27e79cSmrg	;;
3660b73be646Smrg    esac
3661b73be646Smrg  fi
3662b73be646Smrg  rm -rf conftest*
3663b73be646Smrg  ;;
3664b73be646Smrg
3665b73be646Smrg*-*-sco3.2v5*)
3666b73be646Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3667b73be646Smrg  SAVE_CFLAGS="$CFLAGS"
3668b73be646Smrg  CFLAGS="$CFLAGS -belf"
3669b73be646Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
3670b73be646Smrg    [AC_LANG_PUSH(C)
3671b73be646Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
3672b73be646Smrg     AC_LANG_POP])
3673b73be646Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3674b73be646Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3675b73be646Smrg    CFLAGS="$SAVE_CFLAGS"
3676b73be646Smrg  fi
3677b73be646Smrg  ;;
3678b73be646Smrgsparc*-*solaris*)
3679b73be646Smrg  # Find out which ABI we are using.
3680b73be646Smrg  echo 'int i;' > conftest.$ac_ext
3681b73be646Smrg  if AC_TRY_EVAL(ac_compile); then
3682b73be646Smrg    case `/usr/bin/file conftest.o` in
3683b73be646Smrg    *64-bit*)
3684b73be646Smrg      case $lt_cv_prog_gnu_ld in
3685b73be646Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
3686fc27e79cSmrg      *)
3687b73be646Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
3688b73be646Smrg	  LD="${LD-ld} -64"
3689b73be646Smrg	fi
3690fc27e79cSmrg	;;
3691b73be646Smrg      esac
3692b73be646Smrg      ;;
3693fc27e79cSmrg    esac
3694fc27e79cSmrg  fi
3695b73be646Smrg  rm -rf conftest*
3696b73be646Smrg  ;;
3697b73be646Smrgesac
3698b73be646Smrg
3699b73be646Smrgneed_locks="$enable_libtool_lock"
3700b73be646Smrg])# _LT_ENABLE_LOCK
3701b73be646Smrg
3702b73be646Smrg
3703b73be646Smrg# _LT_CMD_OLD_ARCHIVE
3704b73be646Smrg# -------------------
3705b73be646Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
3706b73be646Smrg[AC_CHECK_TOOL(AR, ar, false)
3707b73be646Smrgtest -z "$AR" && AR=ar
3708b73be646Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
3709b73be646Smrg_LT_DECL([], [AR], [1], [The archiver])
3710b73be646Smrg_LT_DECL([], [AR_FLAGS], [1])
3711b73be646Smrg
3712b73be646SmrgAC_CHECK_TOOL(STRIP, strip, :)
3713b73be646Smrgtest -z "$STRIP" && STRIP=:
3714b73be646Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
3715b73be646Smrg
3716b73be646SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
3717b73be646Smrgtest -z "$RANLIB" && RANLIB=:
3718b73be646Smrg_LT_DECL([], [RANLIB], [1],
3719b73be646Smrg    [Commands used to install an old-style archive])
3720b73be646Smrg
3721b73be646Smrg# Determine commands to create old-style static archives.
3722b73be646Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
3723b73be646Smrgold_postinstall_cmds='chmod 644 $oldlib'
3724b73be646Smrgold_postuninstall_cmds=
3725b73be646Smrg
3726b73be646Smrgif test -n "$RANLIB"; then
3727b73be646Smrg  case $host_os in
3728b73be646Smrg  openbsd*)
3729b73be646Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
3730b73be646Smrg    ;;
3731b73be646Smrg  *)
3732b73be646Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
3733b73be646Smrg    ;;
3734b73be646Smrg  esac
3735b73be646Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
3736b73be646Smrgfi
3737b73be646Smrg_LT_DECL([], [old_postinstall_cmds], [2])
3738b73be646Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
3739b73be646Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
3740b73be646Smrg    [Commands used to build an old-style archive])
3741b73be646Smrg])# _LT_CMD_OLD_ARCHIVE
3742b73be646Smrg
3743b73be646Smrg
3744b73be646Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
3745b73be646Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
3746b73be646Smrg# ----------------------------------------------------------------
3747b73be646Smrg# Check whether the given compiler option works
3748b73be646SmrgAC_DEFUN([_LT_COMPILER_OPTION],
3749b73be646Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3750b73be646Smrgm4_require([_LT_DECL_SED])dnl
3751b73be646SmrgAC_CACHE_CHECK([$1], [$2],
3752b73be646Smrg  [$2=no
3753b73be646Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
3754b73be646Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3755b73be646Smrg   lt_compiler_flag="$3"
3756b73be646Smrg   # Insert the option either (1) after the last *FLAGS variable, or
3757b73be646Smrg   # (2) before a word containing "conftest.", or (3) at the end.
3758b73be646Smrg   # Note that $ac_compile itself does not contain backslashes and begins
3759b73be646Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
3760b73be646Smrg   # The option is referenced via a variable to avoid confusing sed.
3761b73be646Smrg   lt_compile=`echo "$ac_compile" | $SED \
3762b73be646Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3763b73be646Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3764b73be646Smrg   -e 's:$: $lt_compiler_flag:'`
3765b73be646Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3766b73be646Smrg   (eval "$lt_compile" 2>conftest.err)
3767b73be646Smrg   ac_status=$?
3768b73be646Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
3769b73be646Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3770b73be646Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
3771b73be646Smrg     # The compiler can only warn and ignore the option if not recognized
3772b73be646Smrg     # So say no if there are warnings other than the usual output.
3773b73be646Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
3774b73be646Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
3775b73be646Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
3776b73be646Smrg       $2=yes
3777b73be646Smrg     fi
3778b73be646Smrg   fi
3779b73be646Smrg   $RM conftest*
3780b73be646Smrg])
3781b73be646Smrg
3782b73be646Smrgif test x"[$]$2" = xyes; then
3783b73be646Smrg    m4_if([$5], , :, [$5])
3784b73be646Smrgelse
3785b73be646Smrg    m4_if([$6], , :, [$6])
3786b73be646Smrgfi
3787b73be646Smrg])# _LT_COMPILER_OPTION
3788b73be646Smrg
3789b73be646Smrg# Old name:
3790b73be646SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
3791b73be646Smrgdnl aclocal-1.4 backwards compatibility:
3792b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
3793b73be646Smrg
3794b73be646Smrg
3795b73be646Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
3796b73be646Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
3797b73be646Smrg# ----------------------------------------------------
3798b73be646Smrg# Check whether the given linker option works
3799b73be646SmrgAC_DEFUN([_LT_LINKER_OPTION],
3800b73be646Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3801b73be646Smrgm4_require([_LT_DECL_SED])dnl
3802b73be646SmrgAC_CACHE_CHECK([$1], [$2],
3803b73be646Smrg  [$2=no
3804b73be646Smrg   save_LDFLAGS="$LDFLAGS"
3805b73be646Smrg   LDFLAGS="$LDFLAGS $3"
3806b73be646Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
3807b73be646Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
3808b73be646Smrg     # The linker can only warn and ignore the option if not recognized
3809b73be646Smrg     # So say no if there are warnings
3810b73be646Smrg     if test -s conftest.err; then
3811b73be646Smrg       # Append any errors to the config.log.
3812b73be646Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
3813b73be646Smrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
3814b73be646Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
3815b73be646Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
3816b73be646Smrg         $2=yes
3817b73be646Smrg       fi
3818b73be646Smrg     else
3819b73be646Smrg       $2=yes
3820b73be646Smrg     fi
3821b73be646Smrg   fi
3822b73be646Smrg   $RM -r conftest*
3823b73be646Smrg   LDFLAGS="$save_LDFLAGS"
3824b73be646Smrg])
3825b73be646Smrg
3826b73be646Smrgif test x"[$]$2" = xyes; then
3827b73be646Smrg    m4_if([$4], , :, [$4])
3828b73be646Smrgelse
3829b73be646Smrg    m4_if([$5], , :, [$5])
3830b73be646Smrgfi
3831b73be646Smrg])# _LT_LINKER_OPTION
3832b73be646Smrg
3833b73be646Smrg# Old name:
3834b73be646SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
3835b73be646Smrgdnl aclocal-1.4 backwards compatibility:
3836b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
3837b73be646Smrg
3838b73be646Smrg
3839b73be646Smrg# LT_CMD_MAX_LEN
3840b73be646Smrg#---------------
3841b73be646SmrgAC_DEFUN([LT_CMD_MAX_LEN],
3842b73be646Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3843b73be646Smrg# find the maximum length of command line arguments
3844b73be646SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
3845b73be646SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
3846b73be646Smrg  i=0
3847b73be646Smrg  teststring="ABCD"
3848b73be646Smrg
3849b73be646Smrg  case $build_os in
3850b73be646Smrg  msdosdjgpp*)
3851b73be646Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
3852b73be646Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
3853b73be646Smrg    # during glob expansion).  Even if it were fixed, the result of this
3854b73be646Smrg    # check would be larger than it should be.
3855b73be646Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
3856b73be646Smrg    ;;
3857b73be646Smrg
3858b73be646Smrg  gnu*)
3859b73be646Smrg    # Under GNU Hurd, this test is not required because there is
3860b73be646Smrg    # no limit to the length of command line arguments.
3861b73be646Smrg    # Libtool will interpret -1 as no limit whatsoever
3862b73be646Smrg    lt_cv_sys_max_cmd_len=-1;
3863b73be646Smrg    ;;
3864b73be646Smrg
3865b73be646Smrg  cygwin* | mingw* | cegcc*)
3866b73be646Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
3867b73be646Smrg    # about 5 minutes as the teststring grows exponentially.
3868b73be646Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
3869b73be646Smrg    # you end up with a "frozen" computer, even though with patience
3870b73be646Smrg    # the test eventually succeeds (with a max line length of 256k).
3871b73be646Smrg    # Instead, let's just punt: use the minimum linelength reported by
3872b73be646Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
3873b73be646Smrg    lt_cv_sys_max_cmd_len=8192;
3874b73be646Smrg    ;;
3875b73be646Smrg
3876b73be646Smrg  amigaos*)
3877b73be646Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
3878b73be646Smrg    # So we just punt and use a minimum line length of 8192.
3879b73be646Smrg    lt_cv_sys_max_cmd_len=8192;
3880b73be646Smrg    ;;
3881b73be646Smrg
3882b73be646Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
3883b73be646Smrg    # This has been around since 386BSD, at least.  Likely further.
3884b73be646Smrg    if test -x /sbin/sysctl; then
3885b73be646Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
3886b73be646Smrg    elif test -x /usr/sbin/sysctl; then
3887b73be646Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
3888b73be646Smrg    else
3889b73be646Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
3890b73be646Smrg    fi
3891b73be646Smrg    # And add a safety zone
3892b73be646Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
3893b73be646Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
3894b73be646Smrg    ;;
3895b73be646Smrg
3896b73be646Smrg  interix*)
3897b73be646Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
3898b73be646Smrg    lt_cv_sys_max_cmd_len=196608
3899b73be646Smrg    ;;
3900b73be646Smrg
3901b73be646Smrg  osf*)
3902b73be646Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
3903b73be646Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
3904b73be646Smrg    # nice to cause kernel panics so lets avoid the loop below.
3905b73be646Smrg    # First set a reasonable default.
3906b73be646Smrg    lt_cv_sys_max_cmd_len=16384
3907b73be646Smrg    #
3908b73be646Smrg    if test -x /sbin/sysconfig; then
3909b73be646Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
3910b73be646Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
3911b73be646Smrg      esac
3912b73be646Smrg    fi
3913b73be646Smrg    ;;
3914b73be646Smrg  sco3.2v5*)
3915b73be646Smrg    lt_cv_sys_max_cmd_len=102400
3916b73be646Smrg    ;;
3917b73be646Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
3918b73be646Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
3919b73be646Smrg    if test -n "$kargmax"; then
3920b73be646Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
3921b73be646Smrg    else
3922b73be646Smrg      lt_cv_sys_max_cmd_len=32768
3923b73be646Smrg    fi
3924b73be646Smrg    ;;
3925b73be646Smrg  *)
3926b73be646Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
3927b73be646Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
3928b73be646Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
3929b73be646Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
3930b73be646Smrg    else
3931b73be646Smrg      # Make teststring a little bigger before we do anything with it.
3932b73be646Smrg      # a 1K string should be a reasonable start.
3933b73be646Smrg      for i in 1 2 3 4 5 6 7 8 ; do
3934b73be646Smrg        teststring=$teststring$teststring
3935b73be646Smrg      done
3936b73be646Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
3937b73be646Smrg      # If test is not a shell built-in, we'll probably end up computing a
3938b73be646Smrg      # maximum length that is only half of the actual maximum length, but
3939b73be646Smrg      # we can't tell.
3940b73be646Smrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
3941b73be646Smrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
3942b73be646Smrg	      test $i != 17 # 1/2 MB should be enough
3943b73be646Smrg      do
3944b73be646Smrg        i=`expr $i + 1`
3945b73be646Smrg        teststring=$teststring$teststring
3946b73be646Smrg      done
3947b73be646Smrg      # Only check the string length outside the loop.
3948b73be646Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
3949b73be646Smrg      teststring=
3950b73be646Smrg      # Add a significant safety factor because C++ compilers can tack on
3951b73be646Smrg      # massive amounts of additional arguments before passing them to the
3952b73be646Smrg      # linker.  It appears as though 1/2 is a usable value.
3953b73be646Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
3954b73be646Smrg    fi
3955b73be646Smrg    ;;
3956b73be646Smrg  esac
3957b73be646Smrg])
3958b73be646Smrgif test -n $lt_cv_sys_max_cmd_len ; then
3959b73be646Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
3960b73be646Smrgelse
3961b73be646Smrg  AC_MSG_RESULT(none)
3962b73be646Smrgfi
3963b73be646Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
3964b73be646Smrg_LT_DECL([], [max_cmd_len], [0],
3965b73be646Smrg    [What is the maximum length of a command?])
3966b73be646Smrg])# LT_CMD_MAX_LEN
3967659607e0Smrg
3968b73be646Smrg# Old name:
3969b73be646SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
3970b73be646Smrgdnl aclocal-1.4 backwards compatibility:
3971b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
3972659607e0Smrg
3973659607e0Smrg
3974b73be646Smrg# _LT_HEADER_DLFCN
3975b73be646Smrg# ----------------
3976b73be646Smrgm4_defun([_LT_HEADER_DLFCN],
3977b73be646Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
3978b73be646Smrg])# _LT_HEADER_DLFCN
3979659607e0Smrg
3980659607e0Smrg
3981b73be646Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
3982b73be646Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
3983b73be646Smrg# ----------------------------------------------------------------
3984b73be646Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
3985b73be646Smrg[m4_require([_LT_HEADER_DLFCN])dnl
3986b73be646Smrgif test "$cross_compiling" = yes; then :
3987b73be646Smrg  [$4]
3988b73be646Smrgelse
3989b73be646Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
3990b73be646Smrg  lt_status=$lt_dlunknown
3991b73be646Smrg  cat > conftest.$ac_ext <<_LT_EOF
3992b73be646Smrg[#line __oline__ "configure"
3993b73be646Smrg#include "confdefs.h"
3994659607e0Smrg
3995b73be646Smrg#if HAVE_DLFCN_H
3996b73be646Smrg#include <dlfcn.h>
3997b73be646Smrg#endif
3998659607e0Smrg
3999b73be646Smrg#include <stdio.h>
4000659607e0Smrg
4001b73be646Smrg#ifdef RTLD_GLOBAL
4002b73be646Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
4003b73be646Smrg#else
4004b73be646Smrg#  ifdef DL_GLOBAL
4005b73be646Smrg#    define LT_DLGLOBAL		DL_GLOBAL
4006b73be646Smrg#  else
4007b73be646Smrg#    define LT_DLGLOBAL		0
4008b73be646Smrg#  endif
4009b73be646Smrg#endif
4010659607e0Smrg
4011b73be646Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
4012b73be646Smrg   find out it does not work in some platform. */
4013b73be646Smrg#ifndef LT_DLLAZY_OR_NOW
4014b73be646Smrg#  ifdef RTLD_LAZY
4015b73be646Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
4016b73be646Smrg#  else
4017b73be646Smrg#    ifdef DL_LAZY
4018b73be646Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
4019b73be646Smrg#    else
4020b73be646Smrg#      ifdef RTLD_NOW
4021b73be646Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
4022b73be646Smrg#      else
4023b73be646Smrg#        ifdef DL_NOW
4024b73be646Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
4025b73be646Smrg#        else
4026b73be646Smrg#          define LT_DLLAZY_OR_NOW	0
4027b73be646Smrg#        endif
4028b73be646Smrg#      endif
4029b73be646Smrg#    endif
4030b73be646Smrg#  endif
4031b73be646Smrg#endif
4032659607e0Smrg
4033b73be646Smrgvoid fnord() { int i=42;}
4034b73be646Smrgint main ()
4035b73be646Smrg{
4036b73be646Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
4037b73be646Smrg  int status = $lt_dlunknown;
4038659607e0Smrg
4039b73be646Smrg  if (self)
4040b73be646Smrg    {
4041b73be646Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
4042b73be646Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
4043b73be646Smrg      /* dlclose (self); */
4044b73be646Smrg    }
4045b73be646Smrg  else
4046b73be646Smrg    puts (dlerror ());
4047b73be646Smrg
4048b73be646Smrg  return status;
4049b73be646Smrg}]
4050b73be646Smrg_LT_EOF
4051b73be646Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
4052b73be646Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
4053b73be646Smrg    lt_status=$?
4054b73be646Smrg    case x$lt_status in
4055b73be646Smrg      x$lt_dlno_uscore) $1 ;;
4056b73be646Smrg      x$lt_dlneed_uscore) $2 ;;
4057b73be646Smrg      x$lt_dlunknown|x*) $3 ;;
40586aab59a7Smrg    esac
4059b73be646Smrg  else :
4060b73be646Smrg    # compilation failed
4061b73be646Smrg    $3
4062b73be646Smrg  fi
4063b73be646Smrgfi
4064b73be646Smrgrm -fr conftest*
4065b73be646Smrg])# _LT_TRY_DLOPEN_SELF
4066b73be646Smrg
4067b73be646Smrg
4068b73be646Smrg# LT_SYS_DLOPEN_SELF
4069b73be646Smrg# ------------------
4070b73be646SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
4071b73be646Smrg[m4_require([_LT_HEADER_DLFCN])dnl
4072b73be646Smrgif test "x$enable_dlopen" != xyes; then
4073b73be646Smrg  enable_dlopen=unknown
4074b73be646Smrg  enable_dlopen_self=unknown
4075b73be646Smrg  enable_dlopen_self_static=unknown
4076b73be646Smrgelse
4077b73be646Smrg  lt_cv_dlopen=no
4078b73be646Smrg  lt_cv_dlopen_libs=
4079b73be646Smrg
4080b73be646Smrg  case $host_os in
4081b73be646Smrg  beos*)
4082b73be646Smrg    lt_cv_dlopen="load_add_on"
4083b73be646Smrg    lt_cv_dlopen_libs=
4084b73be646Smrg    lt_cv_dlopen_self=yes
4085b73be646Smrg    ;;
4086b73be646Smrg
4087b73be646Smrg  mingw* | pw32* | cegcc*)
4088b73be646Smrg    lt_cv_dlopen="LoadLibrary"
4089b73be646Smrg    lt_cv_dlopen_libs=
4090b73be646Smrg    ;;
4091b73be646Smrg
4092b73be646Smrg  cygwin*)
4093b73be646Smrg    lt_cv_dlopen="dlopen"
4094b73be646Smrg    lt_cv_dlopen_libs=
4095b73be646Smrg    ;;
4096b73be646Smrg
4097b73be646Smrg  darwin*)
4098b73be646Smrg  # if libdl is installed we need to link against it
4099b73be646Smrg    AC_CHECK_LIB([dl], [dlopen],
4100b73be646Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
4101b73be646Smrg    lt_cv_dlopen="dyld"
4102b73be646Smrg    lt_cv_dlopen_libs=
4103b73be646Smrg    lt_cv_dlopen_self=yes
4104b73be646Smrg    ])
4105b73be646Smrg    ;;
4106b73be646Smrg
4107b73be646Smrg  *)
4108b73be646Smrg    AC_CHECK_FUNC([shl_load],
4109b73be646Smrg	  [lt_cv_dlopen="shl_load"],
4110b73be646Smrg      [AC_CHECK_LIB([dld], [shl_load],
4111b73be646Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
4112b73be646Smrg	[AC_CHECK_FUNC([dlopen],
4113b73be646Smrg	      [lt_cv_dlopen="dlopen"],
4114b73be646Smrg	  [AC_CHECK_LIB([dl], [dlopen],
4115b73be646Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
4116b73be646Smrg	    [AC_CHECK_LIB([svld], [dlopen],
4117b73be646Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
4118b73be646Smrg	      [AC_CHECK_LIB([dld], [dld_link],
4119b73be646Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
4120b73be646Smrg	      ])
4121b73be646Smrg	    ])
4122b73be646Smrg	  ])
4123b73be646Smrg	])
4124b73be646Smrg      ])
4125b73be646Smrg    ;;
4126b73be646Smrg  esac
4127b73be646Smrg
4128b73be646Smrg  if test "x$lt_cv_dlopen" != xno; then
4129b73be646Smrg    enable_dlopen=yes
41306aab59a7Smrg  else
4131b73be646Smrg    enable_dlopen=no
4132b73be646Smrg  fi
4133b73be646Smrg
4134b73be646Smrg  case $lt_cv_dlopen in
4135b73be646Smrg  dlopen)
4136b73be646Smrg    save_CPPFLAGS="$CPPFLAGS"
4137b73be646Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
4138b73be646Smrg
4139b73be646Smrg    save_LDFLAGS="$LDFLAGS"
4140b73be646Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
4141659607e0Smrg
4142b73be646Smrg    save_LIBS="$LIBS"
4143b73be646Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
4144659607e0Smrg
4145b73be646Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
4146b73be646Smrg	  lt_cv_dlopen_self, [dnl
4147b73be646Smrg	  _LT_TRY_DLOPEN_SELF(
4148b73be646Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
4149b73be646Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
4150b73be646Smrg    ])
4151659607e0Smrg
4152b73be646Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
4153b73be646Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
4154b73be646Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
4155b73be646Smrg	  lt_cv_dlopen_self_static, [dnl
4156b73be646Smrg	  _LT_TRY_DLOPEN_SELF(
4157b73be646Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
4158b73be646Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
4159b73be646Smrg      ])
4160b73be646Smrg    fi
4161659607e0Smrg
4162b73be646Smrg    CPPFLAGS="$save_CPPFLAGS"
4163b73be646Smrg    LDFLAGS="$save_LDFLAGS"
4164b73be646Smrg    LIBS="$save_LIBS"
4165b73be646Smrg    ;;
4166b73be646Smrg  esac
4167659607e0Smrg
4168b73be646Smrg  case $lt_cv_dlopen_self in
4169b73be646Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
4170b73be646Smrg  *) enable_dlopen_self=unknown ;;
4171b73be646Smrg  esac
4172659607e0Smrg
4173b73be646Smrg  case $lt_cv_dlopen_self_static in
4174b73be646Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
4175b73be646Smrg  *) enable_dlopen_self_static=unknown ;;
4176b73be646Smrg  esac
4177b73be646Smrgfi
4178b73be646Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
4179b73be646Smrg	 [Whether dlopen is supported])
4180b73be646Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
4181b73be646Smrg	 [Whether dlopen of programs is supported])
4182b73be646Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
4183b73be646Smrg	 [Whether dlopen of statically linked programs is supported])
4184b73be646Smrg])# LT_SYS_DLOPEN_SELF
4185659607e0Smrg
4186b73be646Smrg# Old name:
4187b73be646SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
4188b73be646Smrgdnl aclocal-1.4 backwards compatibility:
4189b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
4190659607e0Smrg
4191659607e0Smrg
4192b73be646Smrg# _LT_COMPILER_C_O([TAGNAME])
4193b73be646Smrg# ---------------------------
4194b73be646Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
4195b73be646Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
4196b73be646Smrgm4_defun([_LT_COMPILER_C_O],
4197b73be646Smrg[m4_require([_LT_DECL_SED])dnl
4198b73be646Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4199b73be646Smrgm4_require([_LT_TAG_COMPILER])dnl
4200b73be646SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
4201b73be646Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
4202b73be646Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
4203b73be646Smrg   $RM -r conftest 2>/dev/null
4204b73be646Smrg   mkdir conftest
4205b73be646Smrg   cd conftest
4206b73be646Smrg   mkdir out
4207b73be646Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
4208659607e0Smrg
4209b73be646Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
4210b73be646Smrg   # Insert the option either (1) after the last *FLAGS variable, or
4211b73be646Smrg   # (2) before a word containing "conftest.", or (3) at the end.
4212b73be646Smrg   # Note that $ac_compile itself does not contain backslashes and begins
4213b73be646Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
4214b73be646Smrg   lt_compile=`echo "$ac_compile" | $SED \
4215b73be646Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
4216b73be646Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
4217b73be646Smrg   -e 's:$: $lt_compiler_flag:'`
4218b73be646Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
4219b73be646Smrg   (eval "$lt_compile" 2>out/conftest.err)
4220b73be646Smrg   ac_status=$?
4221b73be646Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
4222b73be646Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
4223b73be646Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
4224b73be646Smrg   then
4225b73be646Smrg     # The compiler can only warn and ignore the option if not recognized
4226b73be646Smrg     # So say no if there are warnings
4227b73be646Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
4228b73be646Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
4229b73be646Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
4230b73be646Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
4231b73be646Smrg     fi
4232b73be646Smrg   fi
4233b73be646Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
4234b73be646Smrg   $RM conftest*
4235b73be646Smrg   # SGI C++ compiler will create directory out/ii_files/ for
4236b73be646Smrg   # template instantiation
4237b73be646Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
4238b73be646Smrg   $RM out/* && rmdir out
4239b73be646Smrg   cd ..
4240b73be646Smrg   $RM -r conftest
4241b73be646Smrg   $RM conftest*
4242b73be646Smrg])
4243b73be646Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
4244b73be646Smrg	[Does compiler simultaneously support -c and -o options?])
4245b73be646Smrg])# _LT_COMPILER_C_O
4246659607e0Smrg
4247659607e0Smrg
4248b73be646Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
4249b73be646Smrg# ----------------------------------
4250b73be646Smrg# Check to see if we can do hard links to lock some files if needed
4251b73be646Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
4252b73be646Smrg[m4_require([_LT_ENABLE_LOCK])dnl
4253b73be646Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4254b73be646Smrg_LT_COMPILER_C_O([$1])
4255b73be646Smrg
4256b73be646Smrghard_links="nottested"
4257b73be646Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
4258b73be646Smrg  # do not overwrite the value of need_locks provided by the user
4259b73be646Smrg  AC_MSG_CHECKING([if we can lock with hard links])
4260b73be646Smrg  hard_links=yes
4261b73be646Smrg  $RM conftest*
4262b73be646Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
4263b73be646Smrg  touch conftest.a
4264b73be646Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
4265b73be646Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
4266b73be646Smrg  AC_MSG_RESULT([$hard_links])
4267b73be646Smrg  if test "$hard_links" = no; then
4268b73be646Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
4269b73be646Smrg    need_locks=warn
4270b73be646Smrg  fi
4271b73be646Smrgelse
4272b73be646Smrg  need_locks=no
4273b73be646Smrgfi
4274b73be646Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
4275b73be646Smrg])# _LT_COMPILER_FILE_LOCKS
4276fc27e79cSmrg
4277fc27e79cSmrg
4278b73be646Smrg# _LT_CHECK_OBJDIR
4279b73be646Smrg# ----------------
4280b73be646Smrgm4_defun([_LT_CHECK_OBJDIR],
4281b73be646Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
4282b73be646Smrg[rm -f .libs 2>/dev/null
4283b73be646Smrgmkdir .libs 2>/dev/null
4284b73be646Smrgif test -d .libs; then
4285b73be646Smrg  lt_cv_objdir=.libs
4286b73be646Smrgelse
4287b73be646Smrg  # MS-DOS does not allow filenames that begin with a dot.
4288b73be646Smrg  lt_cv_objdir=_libs
4289b73be646Smrgfi
4290b73be646Smrgrmdir .libs 2>/dev/null])
4291b73be646Smrgobjdir=$lt_cv_objdir
4292b73be646Smrg_LT_DECL([], [objdir], [0],
4293b73be646Smrg         [The name of the directory that contains temporary libtool files])dnl
4294b73be646Smrgm4_pattern_allow([LT_OBJDIR])dnl
4295b73be646SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
4296b73be646Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
4297b73be646Smrg])# _LT_CHECK_OBJDIR
4298fc27e79cSmrg
4299fc27e79cSmrg
4300b73be646Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
4301b73be646Smrg# --------------------------------------
4302b73be646Smrg# Check hardcoding attributes.
4303b73be646Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
4304b73be646Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
4305b73be646Smrg_LT_TAGVAR(hardcode_action, $1)=
4306b73be646Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
4307b73be646Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
4308b73be646Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
4309659607e0Smrg
4310b73be646Smrg  # We can hardcode non-existent directories.
4311b73be646Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
4312b73be646Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
4313b73be646Smrg     # have to relink, otherwise we might link with an installed library
4314b73be646Smrg     # when we should be linking with a yet-to-be-installed one
4315b73be646Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
4316b73be646Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
4317b73be646Smrg    # Linking always hardcodes the temporary library directory.
4318b73be646Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
4319b73be646Smrg  else
4320b73be646Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
4321b73be646Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
4322b73be646Smrg  fi
4323b73be646Smrgelse
4324b73be646Smrg  # We cannot hardcode anything, or else we can only hardcode existing
4325b73be646Smrg  # directories.
4326b73be646Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
4327fc27e79cSmrgfi
4328b73be646SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
4329659607e0Smrg
4330b73be646Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
4331b73be646Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
4332b73be646Smrg  # Fast installation is not supported
4333b73be646Smrg  enable_fast_install=no
4334b73be646Smrgelif test "$shlibpath_overrides_runpath" = yes ||
4335b73be646Smrg     test "$enable_shared" = no; then
4336b73be646Smrg  # Fast installation is not necessary
4337b73be646Smrg  enable_fast_install=needless
4338b73be646Smrgfi
4339b73be646Smrg_LT_TAGDECL([], [hardcode_action], [0],
4340b73be646Smrg    [How to hardcode a shared library path into an executable])
4341b73be646Smrg])# _LT_LINKER_HARDCODE_LIBPATH
4342659607e0Smrg
4343659607e0Smrg
4344b73be646Smrg# _LT_CMD_STRIPLIB
4345b73be646Smrg# ----------------
4346b73be646Smrgm4_defun([_LT_CMD_STRIPLIB],
4347b73be646Smrg[m4_require([_LT_DECL_EGREP])
4348b73be646Smrgstriplib=
4349b73be646Smrgold_striplib=
4350b73be646SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
4351b73be646Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
4352b73be646Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
4353b73be646Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
4354b73be646Smrg  AC_MSG_RESULT([yes])
4355b73be646Smrgelse
4356b73be646Smrg# FIXME - insert some real tests, host_os isn't really good enough
4357fc27e79cSmrg  case $host_os in
4358b73be646Smrg  darwin*)
4359b73be646Smrg    if test -n "$STRIP" ; then
4360b73be646Smrg      striplib="$STRIP -x"
4361b73be646Smrg      old_striplib="$STRIP -S"
4362b73be646Smrg      AC_MSG_RESULT([yes])
4363fc27e79cSmrg    else
4364b73be646Smrg      AC_MSG_RESULT([no])
4365fc27e79cSmrg    fi
4366fc27e79cSmrg    ;;
4367fc27e79cSmrg  *)
4368b73be646Smrg    AC_MSG_RESULT([no])
4369fc27e79cSmrg    ;;
4370fc27e79cSmrg  esac
4371b73be646Smrgfi
4372b73be646Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
4373b73be646Smrg_LT_DECL([], [striplib], [1])
4374b73be646Smrg])# _LT_CMD_STRIPLIB
4375659607e0Smrg
4376659607e0Smrg
4377b73be646Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
4378b73be646Smrg# -----------------------------
4379b73be646Smrg# PORTME Fill in your ld.so characteristics
4380b73be646Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
4381b73be646Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4382b73be646Smrgm4_require([_LT_DECL_EGREP])dnl
4383b73be646Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4384b73be646Smrgm4_require([_LT_DECL_OBJDUMP])dnl
4385b73be646Smrgm4_require([_LT_DECL_SED])dnl
4386b73be646SmrgAC_MSG_CHECKING([dynamic linker characteristics])
4387b73be646Smrgm4_if([$1],
4388b73be646Smrg	[], [
4389b73be646Smrgif test "$GCC" = yes; then
4390b73be646Smrg  case $host_os in
4391b73be646Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
4392b73be646Smrg    *) lt_awk_arg="/^libraries:/" ;;
4393b73be646Smrg  esac
4394b73be646Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
4395b73be646Smrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
4396b73be646Smrg    # if the path contains ";" then we assume it to be the separator
4397b73be646Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
4398b73be646Smrg    # assumed that no part of a normal pathname contains ";" but that should
4399b73be646Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
4400b73be646Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
4401b73be646Smrg  else
4402b73be646Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
4403b73be646Smrg  fi
4404b73be646Smrg  # Ok, now we have the path, separated by spaces, we can step through it
4405b73be646Smrg  # and add multilib dir if necessary.
4406b73be646Smrg  lt_tmp_lt_search_path_spec=
4407b73be646Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
4408b73be646Smrg  for lt_sys_path in $lt_search_path_spec; do
4409b73be646Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
4410b73be646Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
4411fc27e79cSmrg    else
4412b73be646Smrg      test -d "$lt_sys_path" && \
4413b73be646Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
4414fc27e79cSmrg    fi
4415b73be646Smrg  done
4416b73be646Smrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
4417b73be646SmrgBEGIN {RS=" "; FS="/|\n";} {
4418b73be646Smrg  lt_foo="";
4419b73be646Smrg  lt_count=0;
4420b73be646Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
4421b73be646Smrg    if ($lt_i != "" && $lt_i != ".") {
4422b73be646Smrg      if ($lt_i == "..") {
4423b73be646Smrg        lt_count++;
4424b73be646Smrg      } else {
4425b73be646Smrg        if (lt_count == 0) {
4426b73be646Smrg          lt_foo="/" $lt_i lt_foo;
4427b73be646Smrg        } else {
4428b73be646Smrg          lt_count--;
4429b73be646Smrg        }
4430b73be646Smrg      }
4431b73be646Smrg    }
4432b73be646Smrg  }
4433b73be646Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
4434b73be646Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
4435b73be646Smrg}'`
4436b73be646Smrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
4437b73be646Smrgelse
4438b73be646Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
4439b73be646Smrgfi])
4440b73be646Smrglibrary_names_spec=
4441b73be646Smrglibname_spec='lib$name'
4442b73be646Smrgsoname_spec=
4443b73be646Smrgshrext_cmds=".so"
4444b73be646Smrgpostinstall_cmds=
4445b73be646Smrgpostuninstall_cmds=
4446b73be646Smrgfinish_cmds=
4447b73be646Smrgfinish_eval=
4448b73be646Smrgshlibpath_var=
4449b73be646Smrgshlibpath_overrides_runpath=unknown
4450b73be646Smrgversion_type=none
4451b73be646Smrgdynamic_linker="$host_os ld.so"
4452b73be646Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
4453b73be646Smrgneed_lib_prefix=unknown
4454b73be646Smrghardcode_into_libs=no
4455659607e0Smrg
4456b73be646Smrg# when you set need_version to no, make sure it does not cause -set_version
4457b73be646Smrg# flags to be left without arguments
4458b73be646Smrgneed_version=unknown
4459659607e0Smrg
4460b73be646Smrgcase $host_os in
4461b73be646Smrgaix3*)
4462b73be646Smrg  version_type=linux
4463b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
4464b73be646Smrg  shlibpath_var=LIBPATH
4465659607e0Smrg
4466b73be646Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
4467b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4468b73be646Smrg  ;;
4469659607e0Smrg
4470b73be646Smrgaix[[4-9]]*)
4471b73be646Smrg  version_type=linux
4472b73be646Smrg  need_lib_prefix=no
4473b73be646Smrg  need_version=no
4474b73be646Smrg  hardcode_into_libs=yes
4475b73be646Smrg  if test "$host_cpu" = ia64; then
4476b73be646Smrg    # AIX 5 supports IA64
4477b73be646Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
4478b73be646Smrg    shlibpath_var=LD_LIBRARY_PATH
4479b73be646Smrg  else
4480b73be646Smrg    # With GCC up to 2.95.x, collect2 would create an import file
4481b73be646Smrg    # for dependence libraries.  The import file would start with
4482b73be646Smrg    # the line `#! .'.  This would cause the generated library to
4483b73be646Smrg    # depend on `.', always an invalid library.  This was fixed in
4484b73be646Smrg    # development snapshots of GCC prior to 3.0.
4485b73be646Smrg    case $host_os in
4486b73be646Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
4487b73be646Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
4488b73be646Smrg	   echo ' yes '
4489b73be646Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
4490b73be646Smrg	:
4491fc27e79cSmrg      else
4492b73be646Smrg	can_build_shared=no
4493fc27e79cSmrg      fi
4494fc27e79cSmrg      ;;
4495b73be646Smrg    esac
4496b73be646Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
4497b73be646Smrg    # soname into executable. Probably we can add versioning support to
4498b73be646Smrg    # collect2, so additional links can be useful in future.
4499b73be646Smrg    if test "$aix_use_runtimelinking" = yes; then
4500b73be646Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
4501b73be646Smrg      # instead of lib<name>.a to let people know that these are not
4502b73be646Smrg      # typical AIX shared libraries.
4503b73be646Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4504b73be646Smrg    else
4505b73be646Smrg      # We preserve .a as extension for shared libraries through AIX4.2
4506b73be646Smrg      # and later when we are not doing run time linking.
4507b73be646Smrg      library_names_spec='${libname}${release}.a $libname.a'
4508b73be646Smrg      soname_spec='${libname}${release}${shared_ext}$major'
4509b73be646Smrg    fi
4510b73be646Smrg    shlibpath_var=LIBPATH
4511b73be646Smrg  fi
4512b73be646Smrg  ;;
4513659607e0Smrg
4514b73be646Smrgamigaos*)
4515b73be646Smrg  case $host_cpu in
4516b73be646Smrg  powerpc)
4517b73be646Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
4518b73be646Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
4519b73be646Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4520b73be646Smrg    ;;
4521b73be646Smrg  m68k)
4522b73be646Smrg    library_names_spec='$libname.ixlibrary $libname.a'
4523b73be646Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
4524b73be646Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
4525b73be646Smrg    ;;
4526b73be646Smrg  esac
4527b73be646Smrg  ;;
4528659607e0Smrg
4529b73be646Smrgbeos*)
4530b73be646Smrg  library_names_spec='${libname}${shared_ext}'
4531b73be646Smrg  dynamic_linker="$host_os ld.so"
4532b73be646Smrg  shlibpath_var=LIBRARY_PATH
4533b73be646Smrg  ;;
4534659607e0Smrg
4535b73be646Smrgbsdi[[45]]*)
4536b73be646Smrg  version_type=linux
4537b73be646Smrg  need_version=no
4538b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4539b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4540b73be646Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
4541b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4542b73be646Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
4543b73be646Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
4544b73be646Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
4545b73be646Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
4546b73be646Smrg  # libtool to hard-code these into programs
4547b73be646Smrg  ;;
4548659607e0Smrg
4549b73be646Smrgcygwin* | mingw* | pw32* | cegcc*)
4550b73be646Smrg  version_type=windows
4551b73be646Smrg  shrext_cmds=".dll"
4552b73be646Smrg  need_version=no
4553b73be646Smrg  need_lib_prefix=no
4554659607e0Smrg
4555b73be646Smrg  case $GCC,$host_os in
4556b73be646Smrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
4557b73be646Smrg    library_names_spec='$libname.dll.a'
4558b73be646Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
4559b73be646Smrg    postinstall_cmds='base_file=`basename \${file}`~
4560b73be646Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
4561b73be646Smrg      dldir=$destdir/`dirname \$dlpath`~
4562b73be646Smrg      test -d \$dldir || mkdir -p \$dldir~
4563b73be646Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
4564b73be646Smrg      chmod a+x \$dldir/$dlname~
4565b73be646Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
4566b73be646Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
4567b73be646Smrg      fi'
4568b73be646Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
4569b73be646Smrg      dlpath=$dir/\$dldll~
4570b73be646Smrg       $RM \$dlpath'
4571b73be646Smrg    shlibpath_overrides_runpath=yes
4572659607e0Smrg
4573b73be646Smrg    case $host_os in
4574b73be646Smrg    cygwin*)
4575b73be646Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
4576b73be646Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4577b73be646Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
4578b73be646Smrg      ;;
4579b73be646Smrg    mingw* | cegcc*)
4580b73be646Smrg      # MinGW DLLs use traditional 'lib' prefix
4581b73be646Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4582b73be646Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
4583b73be646Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
4584b73be646Smrg        # It is most probably a Windows format PATH printed by
4585b73be646Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
4586b73be646Smrg        # path with ; separators, and with drive letters. We can handle the
4587b73be646Smrg        # drive letters (cygwin fileutils understands them), so leave them,
4588b73be646Smrg        # especially as we might pass files found there to a mingw objdump,
4589b73be646Smrg        # which wouldn't understand a cygwinified path. Ahh.
4590b73be646Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
4591fc27e79cSmrg      else
4592b73be646Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
4593fc27e79cSmrg      fi
4594fc27e79cSmrg      ;;
4595b73be646Smrg    pw32*)
4596b73be646Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
4597b73be646Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
4598b73be646Smrg      ;;
4599b73be646Smrg    esac
4600b73be646Smrg    ;;
4601659607e0Smrg
4602b73be646Smrg  *)
4603b73be646Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
4604b73be646Smrg    ;;
4605b73be646Smrg  esac
4606b73be646Smrg  dynamic_linker='Win32 ld.exe'
4607b73be646Smrg  # FIXME: first we should search . and the directory the executable is in
4608b73be646Smrg  shlibpath_var=PATH
4609b73be646Smrg  ;;
4610659607e0Smrg
4611b73be646Smrgdarwin* | rhapsody*)
4612b73be646Smrg  dynamic_linker="$host_os dyld"
4613b73be646Smrg  version_type=darwin
4614b73be646Smrg  need_lib_prefix=no
4615b73be646Smrg  need_version=no
4616b73be646Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
4617b73be646Smrg  soname_spec='${libname}${release}${major}$shared_ext'
4618b73be646Smrg  shlibpath_overrides_runpath=yes
4619b73be646Smrg  shlibpath_var=DYLD_LIBRARY_PATH
4620b73be646Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
4621b73be646Smrgm4_if([$1], [],[
4622b73be646Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
4623b73be646Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
4624b73be646Smrg  ;;
4625659607e0Smrg
4626b73be646Smrgdgux*)
4627b73be646Smrg  version_type=linux
4628b73be646Smrg  need_lib_prefix=no
4629b73be646Smrg  need_version=no
4630b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
4631b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4632b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4633b73be646Smrg  ;;
4634659607e0Smrg
4635b73be646Smrgfreebsd1*)
4636b73be646Smrg  dynamic_linker=no
4637b73be646Smrg  ;;
4638659607e0Smrg
4639b73be646Smrgfreebsd* | dragonfly*)
4640b73be646Smrg  # DragonFly does not have aout.  When/if they implement a new
4641b73be646Smrg  # versioning mechanism, adjust this.
4642b73be646Smrg  if test -x /usr/bin/objformat; then
4643b73be646Smrg    objformat=`/usr/bin/objformat`
4644b73be646Smrg  else
4645b73be646Smrg    case $host_os in
4646b73be646Smrg    freebsd[[123]]*) objformat=aout ;;
4647b73be646Smrg    *) objformat=elf ;;
4648b73be646Smrg    esac
4649b73be646Smrg  fi
4650b73be646Smrg  version_type=freebsd-$objformat
4651b73be646Smrg  case $version_type in
4652b73be646Smrg    freebsd-elf*)
4653b73be646Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
4654b73be646Smrg      need_version=no
4655b73be646Smrg      need_lib_prefix=no
4656fc27e79cSmrg      ;;
4657b73be646Smrg    freebsd-*)
4658b73be646Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
4659b73be646Smrg      need_version=yes
4660b73be646Smrg      ;;
4661b73be646Smrg  esac
4662b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4663b73be646Smrg  case $host_os in
4664b73be646Smrg  freebsd2*)
4665b73be646Smrg    shlibpath_overrides_runpath=yes
4666b73be646Smrg    ;;
4667b73be646Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
4668b73be646Smrg    shlibpath_overrides_runpath=yes
4669b73be646Smrg    hardcode_into_libs=yes
4670b73be646Smrg    ;;
4671b73be646Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
4672b73be646Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
4673b73be646Smrg    shlibpath_overrides_runpath=no
4674b73be646Smrg    hardcode_into_libs=yes
4675b73be646Smrg    ;;
4676b73be646Smrg  *) # from 4.6 on, and DragonFly
4677b73be646Smrg    shlibpath_overrides_runpath=yes
4678b73be646Smrg    hardcode_into_libs=yes
4679b73be646Smrg    ;;
4680b73be646Smrg  esac
4681b73be646Smrg  ;;
4682b73be646Smrg
4683b73be646Smrggnu*)
4684b73be646Smrg  version_type=linux
4685b73be646Smrg  need_lib_prefix=no
4686b73be646Smrg  need_version=no
4687b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
4688b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4689b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4690b73be646Smrg  hardcode_into_libs=yes
4691b73be646Smrg  ;;
4692b73be646Smrg
4693b73be646Smrghpux9* | hpux10* | hpux11*)
4694b73be646Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
4695b73be646Smrg  # link against other versions.
4696b73be646Smrg  version_type=sunos
4697b73be646Smrg  need_lib_prefix=no
4698b73be646Smrg  need_version=no
4699b73be646Smrg  case $host_cpu in
4700b73be646Smrg  ia64*)
4701b73be646Smrg    shrext_cmds='.so'
4702b73be646Smrg    hardcode_into_libs=yes
4703b73be646Smrg    dynamic_linker="$host_os dld.so"
4704b73be646Smrg    shlibpath_var=LD_LIBRARY_PATH
4705b73be646Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
4706b73be646Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4707b73be646Smrg    soname_spec='${libname}${release}${shared_ext}$major'
4708b73be646Smrg    if test "X$HPUX_IA64_MODE" = X32; then
4709b73be646Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
4710b73be646Smrg    else
4711b73be646Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
4712b73be646Smrg    fi
4713b73be646Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
4714b73be646Smrg    ;;
4715b73be646Smrg  hppa*64*)
4716b73be646Smrg    shrext_cmds='.sl'
4717b73be646Smrg    hardcode_into_libs=yes
4718b73be646Smrg    dynamic_linker="$host_os dld.sl"
4719b73be646Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
4720b73be646Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
4721b73be646Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4722b73be646Smrg    soname_spec='${libname}${release}${shared_ext}$major'
4723b73be646Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
4724b73be646Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
4725b73be646Smrg    ;;
4726b73be646Smrg  *)
4727b73be646Smrg    shrext_cmds='.sl'
4728b73be646Smrg    dynamic_linker="$host_os dld.sl"
4729b73be646Smrg    shlibpath_var=SHLIB_PATH
4730b73be646Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
4731b73be646Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4732b73be646Smrg    soname_spec='${libname}${release}${shared_ext}$major'
4733b73be646Smrg    ;;
4734b73be646Smrg  esac
4735b73be646Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
4736b73be646Smrg  postinstall_cmds='chmod 555 $lib'
4737b73be646Smrg  ;;
4738659607e0Smrg
4739b73be646Smrginterix[[3-9]]*)
4740b73be646Smrg  version_type=linux
4741b73be646Smrg  need_lib_prefix=no
4742b73be646Smrg  need_version=no
4743b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
4744b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4745b73be646Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
4746b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4747b73be646Smrg  shlibpath_overrides_runpath=no
4748b73be646Smrg  hardcode_into_libs=yes
4749b73be646Smrg  ;;
4750659607e0Smrg
4751b73be646Smrgirix5* | irix6* | nonstopux*)
4752b73be646Smrg  case $host_os in
4753b73be646Smrg    nonstopux*) version_type=nonstopux ;;
4754fc27e79cSmrg    *)
4755b73be646Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
4756b73be646Smrg		version_type=linux
4757fc27e79cSmrg	else
4758b73be646Smrg		version_type=irix
4759b73be646Smrg	fi ;;
4760b73be646Smrg  esac
4761b73be646Smrg  need_lib_prefix=no
4762b73be646Smrg  need_version=no
4763b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4764b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
4765b73be646Smrg  case $host_os in
4766b73be646Smrg  irix5* | nonstopux*)
4767b73be646Smrg    libsuff= shlibsuff=
4768b73be646Smrg    ;;
4769b73be646Smrg  *)
4770b73be646Smrg    case $LD in # libtool.m4 will add one of these switches to LD
4771b73be646Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
4772b73be646Smrg      libsuff= shlibsuff= libmagic=32-bit;;
4773b73be646Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
4774b73be646Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
4775b73be646Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
4776b73be646Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
4777b73be646Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
4778b73be646Smrg    esac
4779b73be646Smrg    ;;
4780b73be646Smrg  esac
4781b73be646Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
4782b73be646Smrg  shlibpath_overrides_runpath=no
4783b73be646Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
4784b73be646Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
4785b73be646Smrg  hardcode_into_libs=yes
4786b73be646Smrg  ;;
4787659607e0Smrg
4788b73be646Smrg# No shared lib support for Linux oldld, aout, or coff.
4789b73be646Smrglinux*oldld* | linux*aout* | linux*coff*)
4790b73be646Smrg  dynamic_linker=no
4791b73be646Smrg  ;;
4792659607e0Smrg
4793b73be646Smrg# This must be Linux ELF.
4794b73be646Smrglinux* | k*bsd*-gnu)
4795b73be646Smrg  version_type=linux
4796b73be646Smrg  need_lib_prefix=no
4797b73be646Smrg  need_version=no
4798b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4799b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4800b73be646Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
4801b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4802b73be646Smrg  shlibpath_overrides_runpath=no
4803b73be646Smrg  # Some binutils ld are patched to set DT_RUNPATH
4804b73be646Smrg  save_LDFLAGS=$LDFLAGS
4805b73be646Smrg  save_libdir=$libdir
4806b73be646Smrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
4807b73be646Smrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
4808b73be646Smrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
4809b73be646Smrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
4810b73be646Smrg       [shlibpath_overrides_runpath=yes])])
4811b73be646Smrg  LDFLAGS=$save_LDFLAGS
4812b73be646Smrg  libdir=$save_libdir
4813659607e0Smrg
4814b73be646Smrg  # This implies no fast_install, which is unacceptable.
4815b73be646Smrg  # Some rework will be needed to allow for fast_install
4816b73be646Smrg  # before this can be enabled.
4817b73be646Smrg  hardcode_into_libs=yes
4818659607e0Smrg
4819b73be646Smrg  # Append ld.so.conf contents to the search path
4820b73be646Smrg  if test -f /etc/ld.so.conf; then
4821b73be646Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
4822b73be646Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
4823b73be646Smrg  fi
4824659607e0Smrg
4825b73be646Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
4826b73be646Smrg  # powerpc, because MkLinux only supported shared libraries with the
4827b73be646Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
4828b73be646Smrg  # most powerpc-linux boxes support dynamic linking these days and
4829b73be646Smrg  # people can always --disable-shared, the test was removed, and we
4830b73be646Smrg  # assume the GNU/Linux dynamic linker is in use.
4831b73be646Smrg  dynamic_linker='GNU/Linux ld.so'
4832b73be646Smrg  ;;
4833659607e0Smrg
4834b73be646Smrgnetbsd*)
4835b73be646Smrg  version_type=sunos
4836b73be646Smrg  need_lib_prefix=no
4837b73be646Smrg  need_version=no
4838b73be646Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4839b73be646Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
4840b73be646Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
4841b73be646Smrg    dynamic_linker='NetBSD (a.out) ld.so'
4842b73be646Smrg  else
4843b73be646Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
4844b73be646Smrg    soname_spec='${libname}${release}${shared_ext}$major'
4845b73be646Smrg    dynamic_linker='NetBSD ld.elf_so'
4846b73be646Smrg  fi
4847b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4848b73be646Smrg  shlibpath_overrides_runpath=yes
4849b73be646Smrg  hardcode_into_libs=yes
4850b73be646Smrg  ;;
4851659607e0Smrg
4852b73be646Smrgnewsos6)
4853b73be646Smrg  version_type=linux
4854b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4855b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4856b73be646Smrg  shlibpath_overrides_runpath=yes
4857b73be646Smrg  ;;
4858b73be646Smrg
4859b73be646Smrg*nto* | *qnx*)
4860b73be646Smrg  version_type=qnx
4861b73be646Smrg  need_lib_prefix=no
4862b73be646Smrg  need_version=no
4863b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4864b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4865b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4866b73be646Smrg  shlibpath_overrides_runpath=no
4867b73be646Smrg  hardcode_into_libs=yes
4868b73be646Smrg  dynamic_linker='ldqnx.so'
4869b73be646Smrg  ;;
4870b73be646Smrg
4871b73be646Smrgopenbsd*)
4872b73be646Smrg  version_type=sunos
4873b73be646Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
4874b73be646Smrg  need_lib_prefix=no
4875b73be646Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
4876b73be646Smrg  case $host_os in
4877b73be646Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
4878b73be646Smrg    *)				need_version=no  ;;
4879b73be646Smrg  esac
4880b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
4881b73be646Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
4882b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4883b73be646Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4884b73be646Smrg    case $host_os in
4885b73be646Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
4886b73be646Smrg	shlibpath_overrides_runpath=no
4887b73be646Smrg	;;
4888b73be646Smrg      *)
4889b73be646Smrg	shlibpath_overrides_runpath=yes
4890b73be646Smrg	;;
4891fc27e79cSmrg      esac
4892b73be646Smrg  else
4893b73be646Smrg    shlibpath_overrides_runpath=yes
4894b73be646Smrg  fi
4895b73be646Smrg  ;;
4896659607e0Smrg
4897b73be646Smrgos2*)
4898b73be646Smrg  libname_spec='$name'
4899b73be646Smrg  shrext_cmds=".dll"
4900b73be646Smrg  need_lib_prefix=no
4901b73be646Smrg  library_names_spec='$libname${shared_ext} $libname.a'
4902b73be646Smrg  dynamic_linker='OS/2 ld.exe'
4903b73be646Smrg  shlibpath_var=LIBPATH
4904b73be646Smrg  ;;
4905659607e0Smrg
4906b73be646Smrgosf3* | osf4* | osf5*)
4907b73be646Smrg  version_type=osf
4908b73be646Smrg  need_lib_prefix=no
4909b73be646Smrg  need_version=no
4910b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4911b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4912b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4913b73be646Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
4914b73be646Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
4915b73be646Smrg  ;;
4916659607e0Smrg
4917b73be646Smrgrdos*)
4918b73be646Smrg  dynamic_linker=no
4919b73be646Smrg  ;;
4920fc27e79cSmrg
4921b73be646Smrgsolaris*)
4922b73be646Smrg  version_type=linux
4923b73be646Smrg  need_lib_prefix=no
4924b73be646Smrg  need_version=no
4925b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4926b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4927b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4928b73be646Smrg  shlibpath_overrides_runpath=yes
4929b73be646Smrg  hardcode_into_libs=yes
4930b73be646Smrg  # ldd complains unless libraries are executable
4931b73be646Smrg  postinstall_cmds='chmod +x $lib'
4932b73be646Smrg  ;;
4933fc27e79cSmrg
4934b73be646Smrgsunos4*)
4935b73be646Smrg  version_type=sunos
4936b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
4937b73be646Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
4938b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4939b73be646Smrg  shlibpath_overrides_runpath=yes
4940b73be646Smrg  if test "$with_gnu_ld" = yes; then
4941b73be646Smrg    need_lib_prefix=no
4942b73be646Smrg  fi
4943b73be646Smrg  need_version=yes
4944b73be646Smrg  ;;
4945659607e0Smrg
4946b73be646Smrgsysv4 | sysv4.3*)
4947b73be646Smrg  version_type=linux
4948b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4949b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4950b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4951b73be646Smrg  case $host_vendor in
4952b73be646Smrg    sni)
4953b73be646Smrg      shlibpath_overrides_runpath=no
4954b73be646Smrg      need_lib_prefix=no
4955b73be646Smrg      runpath_var=LD_RUN_PATH
49566aab59a7Smrg      ;;
4957b73be646Smrg    siemens)
4958b73be646Smrg      need_lib_prefix=no
49596aab59a7Smrg      ;;
4960b73be646Smrg    motorola)
4961b73be646Smrg      need_lib_prefix=no
4962b73be646Smrg      need_version=no
4963b73be646Smrg      shlibpath_overrides_runpath=no
4964b73be646Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
4965fc27e79cSmrg      ;;
4966b73be646Smrg  esac
4967b73be646Smrg  ;;
4968fc27e79cSmrg
4969b73be646Smrgsysv4*MP*)
4970b73be646Smrg  if test -d /usr/nec ;then
4971b73be646Smrg    version_type=linux
4972b73be646Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
4973b73be646Smrg    soname_spec='$libname${shared_ext}.$major'
4974b73be646Smrg    shlibpath_var=LD_LIBRARY_PATH
4975b73be646Smrg  fi
4976b73be646Smrg  ;;
4977fc27e79cSmrg
4978b73be646Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4979b73be646Smrg  version_type=freebsd-elf
4980b73be646Smrg  need_lib_prefix=no
4981b73be646Smrg  need_version=no
4982b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
4983b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
4984b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
4985b73be646Smrg  shlibpath_overrides_runpath=yes
4986b73be646Smrg  hardcode_into_libs=yes
4987b73be646Smrg  if test "$with_gnu_ld" = yes; then
4988b73be646Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
4989b73be646Smrg  else
4990b73be646Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
4991b73be646Smrg    case $host_os in
4992b73be646Smrg      sco3.2v5*)
4993b73be646Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
4994b73be646Smrg	;;
4995b73be646Smrg    esac
4996b73be646Smrg  fi
4997b73be646Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
4998b73be646Smrg  ;;
4999fc27e79cSmrg
5000b73be646Smrgtpf*)
5001b73be646Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
5002b73be646Smrg  version_type=linux
5003b73be646Smrg  need_lib_prefix=no
5004b73be646Smrg  need_version=no
5005b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5006b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
5007b73be646Smrg  shlibpath_overrides_runpath=no
5008b73be646Smrg  hardcode_into_libs=yes
5009b73be646Smrg  ;;
5010fc27e79cSmrg
5011b73be646Smrguts4*)
5012b73be646Smrg  version_type=linux
5013b73be646Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
5014b73be646Smrg  soname_spec='${libname}${release}${shared_ext}$major'
5015b73be646Smrg  shlibpath_var=LD_LIBRARY_PATH
5016b73be646Smrg  ;;
5017659607e0Smrg
5018b73be646Smrg*)
5019b73be646Smrg  dynamic_linker=no
5020b73be646Smrg  ;;
5021b73be646Smrgesac
5022b73be646SmrgAC_MSG_RESULT([$dynamic_linker])
5023b73be646Smrgtest "$dynamic_linker" = no && can_build_shared=no
5024659607e0Smrg
5025b73be646Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
5026b73be646Smrgif test "$GCC" = yes; then
5027b73be646Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
5028b73be646Smrgfi
5029659607e0Smrg
5030b73be646Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
5031b73be646Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
5032b73be646Smrgfi
5033b73be646Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
5034b73be646Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
5035b73be646Smrgfi
5036659607e0Smrg
5037b73be646Smrg_LT_DECL([], [variables_saved_for_relink], [1],
5038b73be646Smrg    [Variables whose values should be saved in libtool wrapper scripts and
5039b73be646Smrg    restored at link time])
5040b73be646Smrg_LT_DECL([], [need_lib_prefix], [0],
5041b73be646Smrg    [Do we need the "lib" prefix for modules?])
5042b73be646Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
5043b73be646Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
5044b73be646Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
5045b73be646Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
5046b73be646Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
5047b73be646Smrg    [Is shlibpath searched before the hard-coded library search path?])
5048b73be646Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
5049b73be646Smrg_LT_DECL([], [library_names_spec], [1],
5050b73be646Smrg    [[List of archive names.  First name is the real one, the rest are links.
5051b73be646Smrg    The last name is the one that the linker finds with -lNAME]])
5052b73be646Smrg_LT_DECL([], [soname_spec], [1],
5053b73be646Smrg    [[The coded name of the library, if different from the real name]])
5054b73be646Smrg_LT_DECL([], [postinstall_cmds], [2],
5055b73be646Smrg    [Command to use after installation of a shared archive])
5056b73be646Smrg_LT_DECL([], [postuninstall_cmds], [2],
5057b73be646Smrg    [Command to use after uninstallation of a shared archive])
5058b73be646Smrg_LT_DECL([], [finish_cmds], [2],
5059b73be646Smrg    [Commands used to finish a libtool library installation in a directory])
5060b73be646Smrg_LT_DECL([], [finish_eval], [1],
5061b73be646Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
5062b73be646Smrg    not shown]])
5063b73be646Smrg_LT_DECL([], [hardcode_into_libs], [0],
5064b73be646Smrg    [Whether we should hardcode library paths into libraries])
5065b73be646Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
5066b73be646Smrg    [Compile-time system search path for libraries])
5067b73be646Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
5068b73be646Smrg    [Run-time system search path for libraries])
5069b73be646Smrg])# _LT_SYS_DYNAMIC_LINKER
5070659607e0Smrg
5071659607e0Smrg
5072b73be646Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
5073b73be646Smrg# --------------------------
5074b73be646Smrg# find a file program which can recognize shared library
5075b73be646SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
5076b73be646Smrg[m4_require([_LT_DECL_EGREP])dnl
5077b73be646SmrgAC_MSG_CHECKING([for $1])
5078b73be646SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
5079b73be646Smrg[case $MAGIC_CMD in
5080b73be646Smrg[[\\/*] |  ?:[\\/]*])
5081b73be646Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
5082b73be646Smrg  ;;
5083b73be646Smrg*)
5084b73be646Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
5085b73be646Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5086b73be646Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
5087b73be646Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
5088b73be646Smrgdnl not every word.  This closes a longstanding sh security hole.
5089b73be646Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
5090b73be646Smrg  for ac_dir in $ac_dummy; do
5091b73be646Smrg    IFS="$lt_save_ifs"
5092b73be646Smrg    test -z "$ac_dir" && ac_dir=.
5093b73be646Smrg    if test -f $ac_dir/$1; then
5094b73be646Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
5095b73be646Smrg      if test -n "$file_magic_test_file"; then
5096b73be646Smrg	case $deplibs_check_method in
5097b73be646Smrg	"file_magic "*)
5098b73be646Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
5099b73be646Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5100b73be646Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
5101b73be646Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
5102b73be646Smrg	    :
5103b73be646Smrg	  else
5104b73be646Smrg	    cat <<_LT_EOF 1>&2
5105659607e0Smrg
5106b73be646Smrg*** Warning: the command libtool uses to detect shared libraries,
5107b73be646Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
5108b73be646Smrg*** The result is that libtool may fail to recognize shared libraries
5109b73be646Smrg*** as such.  This will affect the creation of libtool libraries that
5110b73be646Smrg*** depend on shared libraries, but programs linked with such libtool
5111b73be646Smrg*** libraries will work regardless of this problem.  Nevertheless, you
5112b73be646Smrg*** may want to report the problem to your system manager and/or to
5113b73be646Smrg*** bug-libtool@gnu.org
5114b73be646Smrg
5115b73be646Smrg_LT_EOF
5116b73be646Smrg	  fi ;;
5117b73be646Smrg	esac
5118fc27e79cSmrg      fi
5119b73be646Smrg      break
5120b73be646Smrg    fi
5121b73be646Smrg  done
5122b73be646Smrg  IFS="$lt_save_ifs"
5123b73be646Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
5124b73be646Smrg  ;;
5125b73be646Smrgesac])
5126b73be646SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
5127b73be646Smrgif test -n "$MAGIC_CMD"; then
5128b73be646Smrg  AC_MSG_RESULT($MAGIC_CMD)
5129b73be646Smrgelse
5130b73be646Smrg  AC_MSG_RESULT(no)
5131b73be646Smrgfi
5132b73be646Smrg_LT_DECL([], [MAGIC_CMD], [0],
5133b73be646Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
5134b73be646Smrg])# _LT_PATH_TOOL_PREFIX
5135fc27e79cSmrg
5136b73be646Smrg# Old name:
5137b73be646SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
5138b73be646Smrgdnl aclocal-1.4 backwards compatibility:
5139b73be646Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
5140fc27e79cSmrg
5141659607e0Smrg
5142b73be646Smrg# _LT_PATH_MAGIC
5143b73be646Smrg# --------------
5144b73be646Smrg# find a file program which can recognize a shared library
5145b73be646Smrgm4_defun([_LT_PATH_MAGIC],
5146b73be646Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
5147b73be646Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
5148b73be646Smrg  if test -n "$ac_tool_prefix"; then
5149b73be646Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
5150b73be646Smrg  else
5151b73be646Smrg    MAGIC_CMD=:
5152b73be646Smrg  fi
5153b73be646Smrgfi
5154b73be646Smrg])# _LT_PATH_MAGIC
5155b73be646Smrg
5156659607e0Smrg
5157b73be646Smrg# LT_PATH_LD
5158b73be646Smrg# ----------
5159b73be646Smrg# find the pathname to the GNU or non-GNU linker
5160b73be646SmrgAC_DEFUN([LT_PATH_LD],
5161b73be646Smrg[AC_REQUIRE([AC_PROG_CC])dnl
5162b73be646SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
5163b73be646SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
5164b73be646Smrgm4_require([_LT_DECL_SED])dnl
5165b73be646Smrgm4_require([_LT_DECL_EGREP])dnl
5166659607e0Smrg
5167b73be646SmrgAC_ARG_WITH([gnu-ld],
5168b73be646Smrg    [AS_HELP_STRING([--with-gnu-ld],
5169b73be646Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
5170b73be646Smrg    [test "$withval" = no || with_gnu_ld=yes],
5171b73be646Smrg    [with_gnu_ld=no])dnl
5172fc27e79cSmrg
5173b73be646Smrgac_prog=ld
5174b73be646Smrgif test "$GCC" = yes; then
5175b73be646Smrg  # Check if gcc -print-prog-name=ld gives a path.
5176b73be646Smrg  AC_MSG_CHECKING([for ld used by $CC])
5177b73be646Smrg  case $host in
5178b73be646Smrg  *-*-mingw*)
5179b73be646Smrg    # gcc leaves a trailing carriage return which upsets mingw
5180b73be646Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5181b73be646Smrg  *)
5182b73be646Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5183b73be646Smrg  esac
5184b73be646Smrg  case $ac_prog in
5185b73be646Smrg    # Accept absolute paths.
5186b73be646Smrg    [[\\/]]* | ?:[[\\/]]*)
5187b73be646Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
5188b73be646Smrg      # Canonicalize the pathname of ld
5189b73be646Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
5190b73be646Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
5191b73be646Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
5192b73be646Smrg      done
5193b73be646Smrg      test -z "$LD" && LD="$ac_prog"
5194fc27e79cSmrg      ;;
5195b73be646Smrg  "")
5196b73be646Smrg    # If it fails, then pretend we aren't using GCC.
5197b73be646Smrg    ac_prog=ld
5198b73be646Smrg    ;;
5199b73be646Smrg  *)
5200b73be646Smrg    # If it is relative, then search for the first ld in PATH.
5201b73be646Smrg    with_gnu_ld=unknown
5202b73be646Smrg    ;;
5203b73be646Smrg  esac
5204b73be646Smrgelif test "$with_gnu_ld" = yes; then
5205b73be646Smrg  AC_MSG_CHECKING([for GNU ld])
5206b73be646Smrgelse
5207b73be646Smrg  AC_MSG_CHECKING([for non-GNU ld])
5208b73be646Smrgfi
5209b73be646SmrgAC_CACHE_VAL(lt_cv_path_LD,
5210b73be646Smrg[if test -z "$LD"; then
5211b73be646Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5212b73be646Smrg  for ac_dir in $PATH; do
5213b73be646Smrg    IFS="$lt_save_ifs"
5214b73be646Smrg    test -z "$ac_dir" && ac_dir=.
5215b73be646Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5216b73be646Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
5217b73be646Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
5218b73be646Smrg      # but apparently some variants of GNU ld only accept -v.
5219b73be646Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
5220b73be646Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
5221b73be646Smrg      *GNU* | *'with BFD'*)
5222b73be646Smrg	test "$with_gnu_ld" != no && break
52236aab59a7Smrg	;;
5224b73be646Smrg      *)
5225b73be646Smrg	test "$with_gnu_ld" != yes && break
52266aab59a7Smrg	;;
5227fc27e79cSmrg      esac
5228b73be646Smrg    fi
5229b73be646Smrg  done
5230b73be646Smrg  IFS="$lt_save_ifs"
5231b73be646Smrgelse
5232b73be646Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
5233b73be646Smrgfi])
5234b73be646SmrgLD="$lt_cv_path_LD"
5235b73be646Smrgif test -n "$LD"; then
5236b73be646Smrg  AC_MSG_RESULT($LD)
5237b73be646Smrgelse
5238b73be646Smrg  AC_MSG_RESULT(no)
5239b73be646Smrgfi
5240b73be646Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5241b73be646Smrg_LT_PATH_LD_GNU
5242b73be646SmrgAC_SUBST([LD])
5243659607e0Smrg
5244b73be646Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
5245b73be646Smrg])# LT_PATH_LD
5246659607e0Smrg
5247b73be646Smrg# Old names:
5248b73be646SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
5249b73be646SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
5250b73be646Smrgdnl aclocal-1.4 backwards compatibility:
5251b73be646Smrgdnl AC_DEFUN([AM_PROG_LD], [])
5252b73be646Smrgdnl AC_DEFUN([AC_PROG_LD], [])
5253659607e0Smrg
52546aab59a7Smrg
5255b73be646Smrg# _LT_PATH_LD_GNU
5256b73be646Smrg#- --------------
5257b73be646Smrgm4_defun([_LT_PATH_LD_GNU],
5258b73be646Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
5259b73be646Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
5260b73be646Smrgcase `$LD -v 2>&1 </dev/null` in
5261b73be646Smrg*GNU* | *'with BFD'*)
5262b73be646Smrg  lt_cv_prog_gnu_ld=yes
5263b73be646Smrg  ;;
5264b73be646Smrg*)
5265b73be646Smrg  lt_cv_prog_gnu_ld=no
5266b73be646Smrg  ;;
5267b73be646Smrgesac])
5268b73be646Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
5269b73be646Smrg])# _LT_PATH_LD_GNU
52706aab59a7Smrg
52716aab59a7Smrg
5272b73be646Smrg# _LT_CMD_RELOAD
5273b73be646Smrg# --------------
5274b73be646Smrg# find reload flag for linker
5275b73be646Smrg#   -- PORTME Some linkers may need a different reload flag.
5276b73be646Smrgm4_defun([_LT_CMD_RELOAD],
5277b73be646Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
5278b73be646Smrg  lt_cv_ld_reload_flag,
5279b73be646Smrg  [lt_cv_ld_reload_flag='-r'])
5280b73be646Smrgreload_flag=$lt_cv_ld_reload_flag
5281b73be646Smrgcase $reload_flag in
5282b73be646Smrg"" | " "*) ;;
5283b73be646Smrg*) reload_flag=" $reload_flag" ;;
5284b73be646Smrgesac
5285b73be646Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
5286b73be646Smrgcase $host_os in
5287b73be646Smrg  darwin*)
5288b73be646Smrg    if test "$GCC" = yes; then
5289b73be646Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
5290b73be646Smrg    else
5291b73be646Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
5292b73be646Smrg    fi
5293b73be646Smrg    ;;
5294b73be646Smrgesac
5295b73be646Smrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
5296b73be646Smrg_LT_DECL([], [reload_cmds], [2])dnl
5297b73be646Smrg])# _LT_CMD_RELOAD
5298b73be646Smrg
5299fc27e79cSmrg
5300b73be646Smrg# _LT_CHECK_MAGIC_METHOD
5301b73be646Smrg# ----------------------
5302b73be646Smrg# how to check for library dependencies
5303b73be646Smrg#  -- PORTME fill in with the dynamic library characteristics
5304b73be646Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
5305b73be646Smrg[m4_require([_LT_DECL_EGREP])
5306b73be646Smrgm4_require([_LT_DECL_OBJDUMP])
5307b73be646SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
5308b73be646Smrglt_cv_deplibs_check_method,
5309b73be646Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
5310b73be646Smrglt_cv_file_magic_test_file=
5311b73be646Smrglt_cv_deplibs_check_method='unknown'
5312b73be646Smrg# Need to set the preceding variable on all platforms that support
5313b73be646Smrg# interlibrary dependencies.
5314b73be646Smrg# 'none' -- dependencies not supported.
5315b73be646Smrg# `unknown' -- same as none, but documents that we really don't know.
5316b73be646Smrg# 'pass_all' -- all dependencies passed with no checks.
5317b73be646Smrg# 'test_compile' -- check by making test program.
5318b73be646Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
5319b73be646Smrg# which responds to the $file_magic_cmd with a given extended regex.
5320b73be646Smrg# If you have `file' or equivalent on your system and you're not sure
5321b73be646Smrg# whether `pass_all' will *always* work, you probably want this one.
5322fc27e79cSmrg
5323b73be646Smrgcase $host_os in
5324b73be646Smrgaix[[4-9]]*)
5325b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5326b73be646Smrg  ;;
5327659607e0Smrg
5328b73be646Smrgbeos*)
5329b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5330b73be646Smrg  ;;
5331659607e0Smrg
5332b73be646Smrgbsdi[[45]]*)
5333b73be646Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
5334b73be646Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
5335b73be646Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
5336b73be646Smrg  ;;
5337659607e0Smrg
5338b73be646Smrgcygwin*)
5339b73be646Smrg  # func_win32_libid is a shell function defined in ltmain.sh
5340b73be646Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5341b73be646Smrg  lt_cv_file_magic_cmd='func_win32_libid'
5342b73be646Smrg  ;;
5343659607e0Smrg
5344b73be646Smrgmingw* | pw32*)
5345b73be646Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
5346b73be646Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
5347b73be646Smrg  # unless we find 'file', for example because we are cross-compiling.
5348b73be646Smrg  if ( file / ) >/dev/null 2>&1; then
5349b73be646Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5350b73be646Smrg    lt_cv_file_magic_cmd='func_win32_libid'
5351b73be646Smrg  else
5352b73be646Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
5353b73be646Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
5354b73be646Smrg  fi
5355b73be646Smrg  ;;
5356659607e0Smrg
5357b73be646Smrgcegcc)
5358b73be646Smrg  # use the weaker test based on 'objdump'. See mingw*.
5359b73be646Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5360b73be646Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
5361b73be646Smrg  ;;
5362659607e0Smrg
5363b73be646Smrgdarwin* | rhapsody*)
5364b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5365b73be646Smrg  ;;
5366b73be646Smrg
5367b73be646Smrgfreebsd* | dragonfly*)
5368b73be646Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5369b73be646Smrg    case $host_cpu in
5370b73be646Smrg    i*86 )
5371b73be646Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
5372b73be646Smrg      # Let's accept both of them until this is cleared up.
5373b73be646Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
5374b73be646Smrg      lt_cv_file_magic_cmd=/usr/bin/file
5375b73be646Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5376fc27e79cSmrg      ;;
53776aab59a7Smrg    esac
5378b73be646Smrg  else
5379b73be646Smrg    lt_cv_deplibs_check_method=pass_all
5380fc27e79cSmrg  fi
53816aab59a7Smrg  ;;
5382659607e0Smrg
5383b73be646Smrggnu*)
5384b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5385b73be646Smrg  ;;
5386b73be646Smrg
5387b73be646Smrghpux10.20* | hpux11*)
5388b73be646Smrg  lt_cv_file_magic_cmd=/usr/bin/file
5389b73be646Smrg  case $host_cpu in
5390b73be646Smrg  ia64*)
5391b73be646Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
5392b73be646Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5393b73be646Smrg    ;;
5394b73be646Smrg  hppa*64*)
5395b73be646Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
5396b73be646Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5397b73be646Smrg    ;;
5398b73be646Smrg  *)
5399b73be646Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
5400b73be646Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
5401b73be646Smrg    ;;
5402b73be646Smrg  esac
5403b73be646Smrg  ;;
5404fc27e79cSmrg
5405b73be646Smrginterix[[3-9]]*)
5406b73be646Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5407b73be646Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
5408b73be646Smrg  ;;
5409fc27e79cSmrg
5410b73be646Smrgirix5* | irix6* | nonstopux*)
5411b73be646Smrg  case $LD in
5412b73be646Smrg  *-32|*"-32 ") libmagic=32-bit;;
5413b73be646Smrg  *-n32|*"-n32 ") libmagic=N32;;
5414b73be646Smrg  *-64|*"-64 ") libmagic=64-bit;;
5415b73be646Smrg  *) libmagic=never-match;;
5416b73be646Smrg  esac
5417b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5418b73be646Smrg  ;;
5419659607e0Smrg
5420b73be646Smrg# This must be Linux ELF.
5421b73be646Smrglinux* | k*bsd*-gnu)
5422b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5423b73be646Smrg  ;;
5424659607e0Smrg
5425b73be646Smrgnetbsd*)
5426b73be646Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5427b73be646Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
5428b73be646Smrg  else
5429b73be646Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
5430b73be646Smrg  fi
5431b73be646Smrg  ;;
5432659607e0Smrg
5433b73be646Smrgnewos6*)
5434b73be646Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
5435b73be646Smrg  lt_cv_file_magic_cmd=/usr/bin/file
5436b73be646Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
5437b73be646Smrg  ;;
5438659607e0Smrg
5439b73be646Smrg*nto* | *qnx*)
5440b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5441b73be646Smrg  ;;
5442659607e0Smrg
5443b73be646Smrgopenbsd*)
5444b73be646Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5445b73be646Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
5446b73be646Smrg  else
5447b73be646Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
5448b73be646Smrg  fi
5449b73be646Smrg  ;;
5450659607e0Smrg
5451b73be646Smrgosf3* | osf4* | osf5*)
5452b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5453b73be646Smrg  ;;
5454659607e0Smrg
5455b73be646Smrgrdos*)
5456b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5457b73be646Smrg  ;;
5458fc27e79cSmrg
5459b73be646Smrgsolaris*)
5460b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5461b73be646Smrg  ;;
5462fc27e79cSmrg
5463b73be646Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5464b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5465b73be646Smrg  ;;
5466fc27e79cSmrg
5467b73be646Smrgsysv4 | sysv4.3*)
5468b73be646Smrg  case $host_vendor in
5469b73be646Smrg  motorola)
5470b73be646Smrg    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]]'
5471b73be646Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5472b73be646Smrg    ;;
5473b73be646Smrg  ncr)
5474b73be646Smrg    lt_cv_deplibs_check_method=pass_all
5475fc27e79cSmrg    ;;
5476b73be646Smrg  sequent)
5477b73be646Smrg    lt_cv_file_magic_cmd='/bin/file'
5478b73be646Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
5479b73be646Smrg    ;;
5480b73be646Smrg  sni)
5481b73be646Smrg    lt_cv_file_magic_cmd='/bin/file'
5482b73be646Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
5483b73be646Smrg    lt_cv_file_magic_test_file=/lib/libc.so
5484b73be646Smrg    ;;
5485b73be646Smrg  siemens)
5486b73be646Smrg    lt_cv_deplibs_check_method=pass_all
5487b73be646Smrg    ;;
5488b73be646Smrg  pc)
5489b73be646Smrg    lt_cv_deplibs_check_method=pass_all
5490b73be646Smrg    ;;
5491b73be646Smrg  esac
5492b73be646Smrg  ;;
5493b73be646Smrg
5494b73be646Smrgtpf*)
5495b73be646Smrg  lt_cv_deplibs_check_method=pass_all
5496b73be646Smrg  ;;
5497b73be646Smrgesac
5498b73be646Smrg])
5499b73be646Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
5500b73be646Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
5501b73be646Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
5502b73be646Smrg
5503b73be646Smrg_LT_DECL([], [deplibs_check_method], [1],
5504b73be646Smrg    [Method to check whether dependent libraries are shared objects])
5505b73be646Smrg_LT_DECL([], [file_magic_cmd], [1],
5506b73be646Smrg    [Command to use when deplibs_check_method == "file_magic"])
5507b73be646Smrg])# _LT_CHECK_MAGIC_METHOD
5508b73be646Smrg
5509b73be646Smrg
5510b73be646Smrg# LT_PATH_NM
5511b73be646Smrg# ----------
5512b73be646Smrg# find the pathname to a BSD- or MS-compatible name lister
5513b73be646SmrgAC_DEFUN([LT_PATH_NM],
5514b73be646Smrg[AC_REQUIRE([AC_PROG_CC])dnl
5515b73be646SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
5516b73be646Smrg[if test -n "$NM"; then
5517b73be646Smrg  # Let the user override the test.
5518b73be646Smrg  lt_cv_path_NM="$NM"
5519b73be646Smrgelse
5520b73be646Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
5521b73be646Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
5522b73be646Smrg    lt_nm_to_check="$lt_nm_to_check nm"
5523b73be646Smrg  fi
5524b73be646Smrg  for lt_tmp_nm in $lt_nm_to_check; do
5525b73be646Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5526b73be646Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
5527b73be646Smrg      IFS="$lt_save_ifs"
5528b73be646Smrg      test -z "$ac_dir" && ac_dir=.
5529b73be646Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
5530b73be646Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
5531b73be646Smrg	# Check to see if the nm accepts a BSD-compat flag.
5532b73be646Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
5533b73be646Smrg	#   nm: unknown option "B" ignored
5534b73be646Smrg	# Tru64's nm complains that /dev/null is an invalid object file
5535b73be646Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
5536b73be646Smrg	*/dev/null* | *'Invalid file or object type'*)
5537b73be646Smrg	  lt_cv_path_NM="$tmp_nm -B"
5538b73be646Smrg	  break
5539b73be646Smrg	  ;;
5540b73be646Smrg	*)
5541b73be646Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
5542b73be646Smrg	  */dev/null*)
5543b73be646Smrg	    lt_cv_path_NM="$tmp_nm -p"
5544b73be646Smrg	    break
5545b73be646Smrg	    ;;
5546b73be646Smrg	  *)
5547b73be646Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
5548b73be646Smrg	    continue # so that we can try to find one that supports BSD flags
5549b73be646Smrg	    ;;
5550b73be646Smrg	  esac
5551b73be646Smrg	  ;;
5552b73be646Smrg	esac
5553b73be646Smrg      fi
5554b73be646Smrg    done
5555b73be646Smrg    IFS="$lt_save_ifs"
5556b73be646Smrg  done
5557b73be646Smrg  : ${lt_cv_path_NM=no}
5558b73be646Smrgfi])
5559b73be646Smrgif test "$lt_cv_path_NM" != "no"; then
5560b73be646Smrg  NM="$lt_cv_path_NM"
5561b73be646Smrgelse
5562b73be646Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
5563b73be646Smrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
5564b73be646Smrg  AC_SUBST([DUMPBIN])
5565b73be646Smrg  if test "$DUMPBIN" != ":"; then
5566b73be646Smrg    NM="$DUMPBIN"
5567b73be646Smrg  fi
5568b73be646Smrgfi
5569b73be646Smrgtest -z "$NM" && NM=nm
5570b73be646SmrgAC_SUBST([NM])
5571b73be646Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
5572b73be646Smrg
5573b73be646SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
5574b73be646Smrg  [lt_cv_nm_interface="BSD nm"
5575b73be646Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
5576b73be646Smrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
5577b73be646Smrg  (eval "$ac_compile" 2>conftest.err)
5578b73be646Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
5579b73be646Smrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
5580b73be646Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
5581b73be646Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
5582b73be646Smrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
5583b73be646Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
5584b73be646Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
5585b73be646Smrg    lt_cv_nm_interface="MS dumpbin"
5586b73be646Smrg  fi
5587b73be646Smrg  rm -f conftest*])
5588b73be646Smrg])# LT_PATH_NM
5589b73be646Smrg
5590b73be646Smrg# Old names:
5591b73be646SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
5592b73be646SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
5593b73be646Smrgdnl aclocal-1.4 backwards compatibility:
5594b73be646Smrgdnl AC_DEFUN([AM_PROG_NM], [])
5595b73be646Smrgdnl AC_DEFUN([AC_PROG_NM], [])
5596b73be646Smrg
5597b73be646Smrg
5598b73be646Smrg# LT_LIB_M
5599b73be646Smrg# --------
5600b73be646Smrg# check for math library
5601b73be646SmrgAC_DEFUN([LT_LIB_M],
5602b73be646Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5603b73be646SmrgLIBM=
5604b73be646Smrgcase $host in
5605b73be646Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
5606b73be646Smrg  # These system don't have libm, or don't need it
5607b73be646Smrg  ;;
5608b73be646Smrg*-ncr-sysv4.3*)
5609b73be646Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
5610b73be646Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
5611b73be646Smrg  ;;
5612b73be646Smrg*)
5613b73be646Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
5614b73be646Smrg  ;;
5615b73be646Smrgesac
5616b73be646SmrgAC_SUBST([LIBM])
5617b73be646Smrg])# LT_LIB_M
5618b73be646Smrg
5619b73be646Smrg# Old name:
5620b73be646SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
5621b73be646Smrgdnl aclocal-1.4 backwards compatibility:
5622b73be646Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
5623659607e0Smrg
5624659607e0Smrg
5625b73be646Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
5626b73be646Smrg# -------------------------------
5627b73be646Smrgm4_defun([_LT_COMPILER_NO_RTTI],
5628b73be646Smrg[m4_require([_LT_TAG_COMPILER])dnl
5629659607e0Smrg
5630b73be646Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5631659607e0Smrg
5632b73be646Smrgif test "$GCC" = yes; then
5633b73be646Smrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5634659607e0Smrg
5635b73be646Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
5636b73be646Smrg    lt_cv_prog_compiler_rtti_exceptions,
5637b73be646Smrg    [-fno-rtti -fno-exceptions], [],
5638b73be646Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
5639fc27e79cSmrgfi
5640b73be646Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
5641b73be646Smrg	[Compiler flag to turn off builtin functions])
5642b73be646Smrg])# _LT_COMPILER_NO_RTTI
5643659607e0Smrg
5644659607e0Smrg
5645b73be646Smrg# _LT_CMD_GLOBAL_SYMBOLS
5646b73be646Smrg# ----------------------
5647b73be646Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
5648b73be646Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5649b73be646SmrgAC_REQUIRE([AC_PROG_CC])dnl
5650b73be646SmrgAC_REQUIRE([LT_PATH_NM])dnl
5651b73be646SmrgAC_REQUIRE([LT_PATH_LD])dnl
5652b73be646Smrgm4_require([_LT_DECL_SED])dnl
5653fc27e79cSmrgm4_require([_LT_DECL_EGREP])dnl
5654b73be646Smrgm4_require([_LT_TAG_COMPILER])dnl
5655fc27e79cSmrg
5656b73be646Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
5657b73be646SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
5658b73be646SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
5659b73be646Smrg[
5660b73be646Smrg# These are sane defaults that work on at least a few old systems.
5661b73be646Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
5662659607e0Smrg
5663b73be646Smrg# Character class describing NM global symbol codes.
5664b73be646Smrgsymcode='[[BCDEGRST]]'
5665659607e0Smrg
5666b73be646Smrg# Regexp to match symbols that can be accessed directly from C.
5667b73be646Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
5668fc27e79cSmrg
5669b73be646Smrg# Define system-specific variables.
5670b73be646Smrgcase $host_os in
5671b73be646Smrgaix*)
5672b73be646Smrg  symcode='[[BCDT]]'
5673b73be646Smrg  ;;
5674b73be646Smrgcygwin* | mingw* | pw32* | cegcc*)
5675b73be646Smrg  symcode='[[ABCDGISTW]]'
5676b73be646Smrg  ;;
5677b73be646Smrghpux*)
5678b73be646Smrg  if test "$host_cpu" = ia64; then
5679b73be646Smrg    symcode='[[ABCDEGRST]]'
5680b73be646Smrg  fi
5681b73be646Smrg  ;;
5682b73be646Smrgirix* | nonstopux*)
5683b73be646Smrg  symcode='[[BCDEGRST]]'
5684b73be646Smrg  ;;
5685b73be646Smrgosf*)
5686b73be646Smrg  symcode='[[BCDEGQRST]]'
5687b73be646Smrg  ;;
5688b73be646Smrgsolaris*)
5689b73be646Smrg  symcode='[[BDRT]]'
5690b73be646Smrg  ;;
5691b73be646Smrgsco3.2v5*)
5692b73be646Smrg  symcode='[[DT]]'
5693b73be646Smrg  ;;
5694b73be646Smrgsysv4.2uw2*)
5695b73be646Smrg  symcode='[[DT]]'
5696b73be646Smrg  ;;
5697b73be646Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
5698b73be646Smrg  symcode='[[ABDT]]'
5699b73be646Smrg  ;;
5700b73be646Smrgsysv4)
5701b73be646Smrg  symcode='[[DFNSTU]]'
5702b73be646Smrg  ;;
5703b73be646Smrgesac
5704fc27e79cSmrg
5705b73be646Smrg# If we're using GNU nm, then use its standard symbol codes.
5706b73be646Smrgcase `$NM -V 2>&1` in
5707b73be646Smrg*GNU* | *'with BFD'*)
5708b73be646Smrg  symcode='[[ABCDGIRSTW]]' ;;
5709b73be646Smrgesac
5710fc27e79cSmrg
5711b73be646Smrg# Transform an extracted symbol line into a proper C declaration.
5712b73be646Smrg# Some systems (esp. on ia64) link data and code symbols differently,
5713b73be646Smrg# so use this general approach.
5714b73be646Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
5715fc27e79cSmrg
5716b73be646Smrg# Transform an extracted symbol line into symbol name and symbol address
5717b73be646Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
5718b73be646Smrglt_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'"
5719fc27e79cSmrg
5720b73be646Smrg# Handle CRLF in mingw tool chain
5721b73be646Smrgopt_cr=
5722b73be646Smrgcase $build_os in
5723b73be646Smrgmingw*)
5724b73be646Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
5725b73be646Smrg  ;;
5726b73be646Smrgesac
5727b73be646Smrg
5728b73be646Smrg# Try without a prefix underscore, then with it.
5729b73be646Smrgfor ac_symprfx in "" "_"; do
5730b73be646Smrg
5731b73be646Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
5732b73be646Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
5733b73be646Smrg
5734b73be646Smrg  # Write the raw and C identifiers.
5735b73be646Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
5736b73be646Smrg    # Fake it for dumpbin and say T for any non-static function
5737b73be646Smrg    # and D for any global variable.
5738b73be646Smrg    # Also find C++ and __fastcall symbols from MSVC++,
5739b73be646Smrg    # which start with @ or ?.
5740b73be646Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
5741b73be646Smrg"     {last_section=section; section=\$ 3};"\
5742b73be646Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
5743b73be646Smrg"     \$ 0!~/External *\|/{next};"\
5744b73be646Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
5745b73be646Smrg"     {if(hide[section]) next};"\
5746b73be646Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
5747b73be646Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
5748b73be646Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
5749b73be646Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
5750b73be646Smrg"     ' prfx=^$ac_symprfx]"
5751fc27e79cSmrg  else
5752b73be646Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
5753fc27e79cSmrg  fi
5754659607e0Smrg
5755b73be646Smrg  # Check to see that the pipe works correctly.
5756b73be646Smrg  pipe_works=no
5757659607e0Smrg
5758b73be646Smrg  rm -f conftest*
5759b73be646Smrg  cat > conftest.$ac_ext <<_LT_EOF
5760b73be646Smrg#ifdef __cplusplus
5761b73be646Smrgextern "C" {
5762b73be646Smrg#endif
5763b73be646Smrgchar nm_test_var;
5764b73be646Smrgvoid nm_test_func(void);
5765b73be646Smrgvoid nm_test_func(void){}
5766b73be646Smrg#ifdef __cplusplus
5767b73be646Smrg}
5768b73be646Smrg#endif
5769b73be646Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
5770b73be646Smrg_LT_EOF
5771b73be646Smrg
5772b73be646Smrg  if AC_TRY_EVAL(ac_compile); then
5773b73be646Smrg    # Now try to grab the symbols.
5774b73be646Smrg    nlist=conftest.nm
5775b73be646Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
5776b73be646Smrg      # Try sorting and uniquifying the output.
5777b73be646Smrg      if sort "$nlist" | uniq > "$nlist"T; then
5778b73be646Smrg	mv -f "$nlist"T "$nlist"
5779b73be646Smrg      else
5780b73be646Smrg	rm -f "$nlist"T
5781b73be646Smrg      fi
5782659607e0Smrg
5783b73be646Smrg      # Make sure that we snagged all the symbols we need.
5784b73be646Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
5785b73be646Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
5786b73be646Smrg	  cat <<_LT_EOF > conftest.$ac_ext
5787b73be646Smrg#ifdef __cplusplus
5788b73be646Smrgextern "C" {
5789b73be646Smrg#endif
5790659607e0Smrg
5791b73be646Smrg_LT_EOF
5792b73be646Smrg	  # Now generate the symbol file.
5793b73be646Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
5794659607e0Smrg
5795b73be646Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
5796659607e0Smrg
5797b73be646Smrg/* The mapping between symbol names and symbols.  */
5798b73be646Smrgconst struct {
5799b73be646Smrg  const char *name;
5800b73be646Smrg  void       *address;
5801b73be646Smrg}
5802b73be646Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
5803b73be646Smrg{
5804b73be646Smrg  { "@PROGRAM@", (void *) 0 },
5805b73be646Smrg_LT_EOF
5806b73be646Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
5807b73be646Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
5808b73be646Smrg  {0, (void *) 0}
5809b73be646Smrg};
5810659607e0Smrg
5811b73be646Smrg/* This works around a problem in FreeBSD linker */
5812b73be646Smrg#ifdef FREEBSD_WORKAROUND
5813b73be646Smrgstatic const void *lt_preloaded_setup() {
5814b73be646Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
5815b73be646Smrg}
5816b73be646Smrg#endif
5817fc27e79cSmrg
5818b73be646Smrg#ifdef __cplusplus
5819b73be646Smrg}
5820b73be646Smrg#endif
5821b73be646Smrg_LT_EOF
5822b73be646Smrg	  # Now try linking the two files.
5823b73be646Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
5824b73be646Smrg	  lt_save_LIBS="$LIBS"
5825b73be646Smrg	  lt_save_CFLAGS="$CFLAGS"
5826b73be646Smrg	  LIBS="conftstm.$ac_objext"
5827b73be646Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
5828b73be646Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
5829b73be646Smrg	    pipe_works=yes
5830b73be646Smrg	  fi
5831b73be646Smrg	  LIBS="$lt_save_LIBS"
5832b73be646Smrg	  CFLAGS="$lt_save_CFLAGS"
5833b73be646Smrg	else
5834b73be646Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
5835b73be646Smrg	fi
5836b73be646Smrg      else
5837b73be646Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
5838fc27e79cSmrg      fi
5839fc27e79cSmrg    else
5840b73be646Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
5841fc27e79cSmrg    fi
5842b73be646Smrg  else
5843b73be646Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
5844b73be646Smrg    cat conftest.$ac_ext >&5
5845b73be646Smrg  fi
5846b73be646Smrg  rm -rf conftest* conftst*
5847659607e0Smrg
5848b73be646Smrg  # Do not use the global_symbol_pipe unless it works.
5849b73be646Smrg  if test "$pipe_works" = yes; then
5850b73be646Smrg    break
5851b73be646Smrg  else
5852b73be646Smrg    lt_cv_sys_global_symbol_pipe=
5853b73be646Smrg  fi
5854b73be646Smrgdone
5855b73be646Smrg])
5856b73be646Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
5857b73be646Smrg  lt_cv_sys_global_symbol_to_cdecl=
5858b73be646Smrgfi
5859b73be646Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5860b73be646Smrg  AC_MSG_RESULT(failed)
5861b73be646Smrgelse
5862b73be646Smrg  AC_MSG_RESULT(ok)
5863b73be646Smrgfi
5864fc27e79cSmrg
5865b73be646Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
5866b73be646Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
5867b73be646Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
5868b73be646Smrg    [Transform the output of nm in a proper C declaration])
5869b73be646Smrg_LT_DECL([global_symbol_to_c_name_address],
5870b73be646Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
5871b73be646Smrg    [Transform the output of nm in a C name address pair])
5872b73be646Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
5873b73be646Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
5874b73be646Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
5875b73be646Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
5876fc27e79cSmrg
5877659607e0Smrg
5878b73be646Smrg# _LT_COMPILER_PIC([TAGNAME])
5879b73be646Smrg# ---------------------------
5880b73be646Smrgm4_defun([_LT_COMPILER_PIC],
5881b73be646Smrg[m4_require([_LT_TAG_COMPILER])dnl
5882b73be646Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
5883b73be646Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5884b73be646Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
5885fc27e79cSmrg
5886b73be646SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
5887b73be646Smrgm4_if([$1], [CXX], [
5888b73be646Smrg  # C++ specific cases for pic, static, wl, etc.
5889b73be646Smrg  if test "$GXX" = yes; then
5890b73be646Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5891b73be646Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5892b73be646Smrg
5893b73be646Smrg    case $host_os in
5894b73be646Smrg    aix*)
5895b73be646Smrg      # All AIX code is PIC.
5896b73be646Smrg      if test "$host_cpu" = ia64; then
5897b73be646Smrg	# AIX 5 now supports IA64 processor
5898b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5899b73be646Smrg      fi
5900b73be646Smrg      ;;
5901b73be646Smrg
5902b73be646Smrg    amigaos*)
5903b73be646Smrg      case $host_cpu in
5904b73be646Smrg      powerpc)
5905b73be646Smrg            # see comment about AmigaOS4 .so support
5906b73be646Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5907b73be646Smrg        ;;
5908b73be646Smrg      m68k)
5909b73be646Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
5910b73be646Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
5911b73be646Smrg            # like `-m68040'.
5912b73be646Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5913fc27e79cSmrg        ;;
5914b73be646Smrg      esac
5915b73be646Smrg      ;;
5916659607e0Smrg
5917b73be646Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5918b73be646Smrg      # PIC is the default for these OSes.
5919b73be646Smrg      ;;
5920b73be646Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
5921b73be646Smrg      # This hack is so that the source file can tell whether it is being
5922b73be646Smrg      # built for inclusion in a dll (and should export symbols for example).
5923b73be646Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5924b73be646Smrg      # (--disable-auto-import) libraries
5925b73be646Smrg      m4_if([$1], [GCJ], [],
5926b73be646Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5927b73be646Smrg      ;;
5928b73be646Smrg    darwin* | rhapsody*)
5929b73be646Smrg      # PIC is the default on this platform
5930b73be646Smrg      # Common symbols not allowed in MH_DYLIB files
5931b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5932b73be646Smrg      ;;
5933b73be646Smrg    *djgpp*)
5934b73be646Smrg      # DJGPP does not support shared libraries at all
5935b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5936b73be646Smrg      ;;
5937b73be646Smrg    interix[[3-9]]*)
5938b73be646Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5939b73be646Smrg      # Instead, we relocate shared libraries at runtime.
5940b73be646Smrg      ;;
5941b73be646Smrg    sysv4*MP*)
5942b73be646Smrg      if test -d /usr/nec; then
5943b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5944b73be646Smrg      fi
5945b73be646Smrg      ;;
5946b73be646Smrg    hpux*)
5947b73be646Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5948b73be646Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5949b73be646Smrg      # sets the default TLS model and affects inlining.
5950b73be646Smrg      case $host_cpu in
5951b73be646Smrg      hppa*64*)
5952b73be646Smrg	;;
5953b73be646Smrg      *)
5954b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5955b73be646Smrg	;;
5956b73be646Smrg      esac
5957b73be646Smrg      ;;
5958b73be646Smrg    *qnx* | *nto*)
5959b73be646Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5960b73be646Smrg      # it will coredump.
5961b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5962b73be646Smrg      ;;
5963b73be646Smrg    *)
5964b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5965b73be646Smrg      ;;
5966b73be646Smrg    esac
5967b73be646Smrg  else
5968b73be646Smrg    case $host_os in
5969b73be646Smrg      aix[[4-9]]*)
5970b73be646Smrg	# All AIX code is PIC.
5971b73be646Smrg	if test "$host_cpu" = ia64; then
5972b73be646Smrg	  # AIX 5 now supports IA64 processor
5973b73be646Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5974fc27e79cSmrg	else
5975b73be646Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5976fc27e79cSmrg	fi
5977fc27e79cSmrg	;;
5978fc27e79cSmrg      chorus*)
5979b73be646Smrg	case $cc_basename in
5980b73be646Smrg	cxch68*)
5981b73be646Smrg	  # Green Hills C++ Compiler
5982b73be646Smrg	  # _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"
5983fc27e79cSmrg	  ;;
5984b73be646Smrg	esac
5985fc27e79cSmrg	;;
5986fc27e79cSmrg      dgux*)
5987b73be646Smrg	case $cc_basename in
5988b73be646Smrg	  ec++*)
5989b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5990fc27e79cSmrg	    ;;
5991b73be646Smrg	  ghcx*)
5992fc27e79cSmrg	    # Green Hills C++ Compiler
5993b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5994fc27e79cSmrg	    ;;
5995b73be646Smrg	  *)
5996fc27e79cSmrg	    ;;
5997b73be646Smrg	esac
5998b73be646Smrg	;;
5999fc27e79cSmrg      freebsd* | dragonfly*)
6000b73be646Smrg	# FreeBSD uses GNU C++
6001b73be646Smrg	;;
6002b73be646Smrg      hpux9* | hpux10* | hpux11*)
6003b73be646Smrg	case $cc_basename in
6004b73be646Smrg	  CC*)
6005b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6006b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6007b73be646Smrg	    if test "$host_cpu" != ia64; then
6008b73be646Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6009b73be646Smrg	    fi
6010b73be646Smrg	    ;;
6011b73be646Smrg	  aCC*)
6012b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6013b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6014b73be646Smrg	    case $host_cpu in
6015b73be646Smrg	    hppa*64*|ia64*)
6016b73be646Smrg	      # +Z the default
6017b73be646Smrg	      ;;
6018b73be646Smrg	    *)
6019b73be646Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6020b73be646Smrg	      ;;
6021fc27e79cSmrg	    esac
6022fc27e79cSmrg	    ;;
6023b73be646Smrg	  *)
6024fc27e79cSmrg	    ;;
6025b73be646Smrg	esac
6026fc27e79cSmrg	;;
6027b73be646Smrg      interix*)
6028b73be646Smrg	# This is c89, which is MS Visual C++ (no shared libs)
6029b73be646Smrg	# Anyone wants to do a port?
6030b73be646Smrg	;;
6031b73be646Smrg      irix5* | irix6* | nonstopux*)
6032b73be646Smrg	case $cc_basename in
6033b73be646Smrg	  CC*)
6034b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6035b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6036b73be646Smrg	    # CC pic flag -KPIC is the default.
6037fc27e79cSmrg	    ;;
6038b73be646Smrg	  *)
6039fc27e79cSmrg	    ;;
6040b73be646Smrg	esac
6041b73be646Smrg	;;
6042fc27e79cSmrg      linux* | k*bsd*-gnu)
6043b73be646Smrg	case $cc_basename in
6044b73be646Smrg	  KCC*)
6045b73be646Smrg	    # KAI C++ Compiler
6046b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6047b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6048fc27e79cSmrg	    ;;
6049b73be646Smrg	  ecpc* )
6050b73be646Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
6051b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6052b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6053b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
6054b73be646Smrg	    ;;
6055b73be646Smrg	  icpc* )
6056b73be646Smrg	    # Intel C++, used to be incompatible with GCC.
6057b73be646Smrg	    # ICC 10 doesn't accept -KPIC any more.
6058b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6059b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6060b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
6061b73be646Smrg	    ;;
6062b73be646Smrg	  pgCC* | pgcpp*)
6063b73be646Smrg	    # Portland Group C++ compiler
6064b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6065b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
6066b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6067fc27e79cSmrg	    ;;
6068fc27e79cSmrg	  cxx*)
6069fc27e79cSmrg	    # Compaq C++
6070b73be646Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
6071b73be646Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
6072b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
6073b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6074fc27e79cSmrg	    ;;
6075b73be646Smrg	  xlc* | xlC*)
6076b73be646Smrg	    # IBM XL 8.0 on PPC
6077b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6078b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
6079b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
6080b73be646Smrg	    ;;
6081b73be646Smrg	  *)
6082b73be646Smrg	    case `$CC -V 2>&1 | sed 5q` in
6083b73be646Smrg	    *Sun\ C*)
6084b73be646Smrg	      # Sun C++ 5.9
6085b73be646Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6086b73be646Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6087b73be646Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6088fc27e79cSmrg	      ;;
6089fc27e79cSmrg	    esac
6090fc27e79cSmrg	    ;;
6091fc27e79cSmrg	esac
6092fc27e79cSmrg	;;
6093fc27e79cSmrg      lynxos*)
6094fc27e79cSmrg	;;
6095fc27e79cSmrg      m88k*)
6096fc27e79cSmrg	;;
6097fc27e79cSmrg      mvs*)
6098b73be646Smrg	case $cc_basename in
6099b73be646Smrg	  cxx*)
6100b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
6101fc27e79cSmrg	    ;;
6102fc27e79cSmrg	  *)
6103fc27e79cSmrg	    ;;
6104fc27e79cSmrg	esac
6105fc27e79cSmrg	;;
6106fc27e79cSmrg      netbsd*)
6107fc27e79cSmrg	;;
6108b73be646Smrg      *qnx* | *nto*)
6109b73be646Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
6110b73be646Smrg        # it will coredump.
6111b73be646Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
6112b73be646Smrg        ;;
6113fc27e79cSmrg      osf3* | osf4* | osf5*)
6114b73be646Smrg	case $cc_basename in
6115b73be646Smrg	  KCC*)
6116b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6117fc27e79cSmrg	    ;;
6118b73be646Smrg	  RCC*)
6119fc27e79cSmrg	    # Rational C++ 2.4.1
6120b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6121fc27e79cSmrg	    ;;
6122b73be646Smrg	  cxx*)
6123b73be646Smrg	    # Digital/Compaq C++
6124b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6125b73be646Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
6126b73be646Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
6127b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
6128b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6129fc27e79cSmrg	    ;;
6130b73be646Smrg	  *)
6131b73be646Smrg	    ;;
6132b73be646Smrg	esac
6133b73be646Smrg	;;
6134b73be646Smrg      psos*)
6135b73be646Smrg	;;
6136b73be646Smrg      solaris*)
6137fc27e79cSmrg	case $cc_basename in
6138b73be646Smrg	  CC*)
6139b73be646Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6140b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6141b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6142b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6143b73be646Smrg	    ;;
6144b73be646Smrg	  gcx*)
6145b73be646Smrg	    # Green Hills C++ Compiler
6146b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
6147fc27e79cSmrg	    ;;
6148fc27e79cSmrg	  *)
6149fc27e79cSmrg	    ;;
6150fc27e79cSmrg	esac
6151b73be646Smrg	;;
6152b73be646Smrg      sunos4*)
6153b73be646Smrg	case $cc_basename in
6154b73be646Smrg	  CC*)
6155b73be646Smrg	    # Sun C++ 4.x
6156b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6157b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6158b73be646Smrg	    ;;
6159b73be646Smrg	  lcc*)
6160b73be646Smrg	    # Lucid
6161b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6162b73be646Smrg	    ;;
6163b73be646Smrg	  *)
6164b73be646Smrg	    ;;
6165b73be646Smrg	esac
6166b73be646Smrg	;;
6167b73be646Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
6168b73be646Smrg	case $cc_basename in
6169b73be646Smrg	  CC*)
6170b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6171b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6172b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6173b73be646Smrg	    ;;
6174b73be646Smrg	esac
6175b73be646Smrg	;;
6176fc27e79cSmrg      tandem*)
6177b73be646Smrg	case $cc_basename in
6178b73be646Smrg	  NCC*)
6179fc27e79cSmrg	    # NonStop-UX NCC 3.20
6180b73be646Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6181fc27e79cSmrg	    ;;
6182b73be646Smrg	  *)
6183fc27e79cSmrg	    ;;
6184b73be646Smrg	esac
6185b73be646Smrg	;;
6186fc27e79cSmrg      vxworks*)
6187b73be646Smrg	;;
6188fc27e79cSmrg      *)
6189b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6190b73be646Smrg	;;
6191fc27e79cSmrg    esac
6192b73be646Smrg  fi
6193b73be646Smrg],
6194b73be646Smrg[
6195b73be646Smrg  if test "$GCC" = yes; then
6196b73be646Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6197b73be646Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
6198659607e0Smrg
6199b73be646Smrg    case $host_os in
6200b73be646Smrg      aix*)
6201b73be646Smrg      # All AIX code is PIC.
6202b73be646Smrg      if test "$host_cpu" = ia64; then
6203b73be646Smrg	# AIX 5 now supports IA64 processor
6204b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6205b73be646Smrg      fi
6206b73be646Smrg      ;;
6207fc27e79cSmrg
6208b73be646Smrg    amigaos*)
6209b73be646Smrg      case $host_cpu in
6210b73be646Smrg      powerpc)
6211b73be646Smrg            # see comment about AmigaOS4 .so support
6212b73be646Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6213b73be646Smrg        ;;
6214b73be646Smrg      m68k)
6215b73be646Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
6216b73be646Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
6217b73be646Smrg            # like `-m68040'.
6218b73be646Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
6219b73be646Smrg        ;;
6220b73be646Smrg      esac
6221b73be646Smrg      ;;
6222659607e0Smrg
6223b73be646Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
6224b73be646Smrg      # PIC is the default for these OSes.
6225b73be646Smrg      ;;
6226659607e0Smrg
6227b73be646Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
6228b73be646Smrg      # This hack is so that the source file can tell whether it is being
6229b73be646Smrg      # built for inclusion in a dll (and should export symbols for example).
6230b73be646Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
6231b73be646Smrg      # (--disable-auto-import) libraries
6232b73be646Smrg      m4_if([$1], [GCJ], [],
6233b73be646Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
6234b73be646Smrg      ;;
6235659607e0Smrg
6236b73be646Smrg    darwin* | rhapsody*)
6237b73be646Smrg      # PIC is the default on this platform
6238b73be646Smrg      # Common symbols not allowed in MH_DYLIB files
6239b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
6240b73be646Smrg      ;;
6241659607e0Smrg
6242b73be646Smrg    hpux*)
6243b73be646Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
6244b73be646Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
6245b73be646Smrg      # sets the default TLS model and affects inlining.
6246b73be646Smrg      case $host_cpu in
6247b73be646Smrg      hppa*64*)
6248b73be646Smrg	# +Z the default
6249b73be646Smrg	;;
6250b73be646Smrg      *)
6251b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6252b73be646Smrg	;;
6253b73be646Smrg      esac
6254b73be646Smrg      ;;
6255659607e0Smrg
6256b73be646Smrg    interix[[3-9]]*)
6257b73be646Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
6258b73be646Smrg      # Instead, we relocate shared libraries at runtime.
6259b73be646Smrg      ;;
6260659607e0Smrg
6261b73be646Smrg    msdosdjgpp*)
6262b73be646Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
6263b73be646Smrg      # on systems that don't support them.
6264b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6265b73be646Smrg      enable_shared=no
6266b73be646Smrg      ;;
6267659607e0Smrg
6268b73be646Smrg    *nto* | *qnx*)
6269b73be646Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
6270b73be646Smrg      # it will coredump.
6271b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
6272b73be646Smrg      ;;
6273659607e0Smrg
6274b73be646Smrg    sysv4*MP*)
6275b73be646Smrg      if test -d /usr/nec; then
6276b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
6277b73be646Smrg      fi
6278b73be646Smrg      ;;
6279659607e0Smrg
6280b73be646Smrg    *)
6281b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6282b73be646Smrg      ;;
6283b73be646Smrg    esac
6284b73be646Smrg  else
6285b73be646Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
6286b73be646Smrg    case $host_os in
6287b73be646Smrg    aix*)
6288b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6289b73be646Smrg      if test "$host_cpu" = ia64; then
6290b73be646Smrg	# AIX 5 now supports IA64 processor
6291b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6292b73be646Smrg      else
6293b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
6294b73be646Smrg      fi
6295b73be646Smrg      ;;
6296659607e0Smrg
6297b73be646Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
6298b73be646Smrg      # This hack is so that the source file can tell whether it is being
6299b73be646Smrg      # built for inclusion in a dll (and should export symbols for example).
6300b73be646Smrg      m4_if([$1], [GCJ], [],
6301b73be646Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
6302b73be646Smrg      ;;
6303659607e0Smrg
6304b73be646Smrg    hpux9* | hpux10* | hpux11*)
6305b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6306b73be646Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
6307b73be646Smrg      # not for PA HP-UX.
6308b73be646Smrg      case $host_cpu in
6309b73be646Smrg      hppa*64*|ia64*)
6310b73be646Smrg	# +Z the default
6311b73be646Smrg	;;
6312b73be646Smrg      *)
6313b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6314b73be646Smrg	;;
6315b73be646Smrg      esac
6316b73be646Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
6317b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6318b73be646Smrg      ;;
63196aab59a7Smrg
6320b73be646Smrg    irix5* | irix6* | nonstopux*)
6321b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6322b73be646Smrg      # PIC (with -KPIC) is the default.
6323b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6324b73be646Smrg      ;;
63256aab59a7Smrg
6326b73be646Smrg    linux* | k*bsd*-gnu)
6327b73be646Smrg      case $cc_basename in
6328b73be646Smrg      # old Intel for x86_64 which still supported -KPIC.
6329b73be646Smrg      ecc*)
6330b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6331b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6332b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
6333b73be646Smrg        ;;
6334b73be646Smrg      # icc used to be incompatible with GCC.
6335b73be646Smrg      # ICC 10 doesn't accept -KPIC any more.
6336b73be646Smrg      icc* | ifort*)
6337b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6338b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6339b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
6340b73be646Smrg        ;;
6341b73be646Smrg      # Lahey Fortran 8.1.
6342b73be646Smrg      lf95*)
6343b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6344b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
6345b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
6346b73be646Smrg	;;
6347b73be646Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
6348b73be646Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
6349b73be646Smrg	# which looks to be a dead project)
6350b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6351b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
6352b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6353b73be646Smrg        ;;
6354b73be646Smrg      ccc*)
6355b73be646Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6356b73be646Smrg        # All Alpha code is PIC.
6357b73be646Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6358b73be646Smrg        ;;
6359b73be646Smrg      xl*)
6360b73be646Smrg	# IBM XL C 8.0/Fortran 10.1 on PPC
6361b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6362b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
6363b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
6364b73be646Smrg	;;
6365b73be646Smrg      *)
6366b73be646Smrg	case `$CC -V 2>&1 | sed 5q` in
6367b73be646Smrg	*Sun\ C*)
6368b73be646Smrg	  # Sun C 5.9
6369b73be646Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6370b73be646Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6371b73be646Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6372b73be646Smrg	  ;;
6373b73be646Smrg	*Sun\ F*)
6374b73be646Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
6375b73be646Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6376b73be646Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6377b73be646Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
6378b73be646Smrg	  ;;
6379b73be646Smrg	esac
6380b73be646Smrg	;;
6381b73be646Smrg      esac
6382b73be646Smrg      ;;
63836aab59a7Smrg
6384b73be646Smrg    newsos6)
6385b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6386b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6387b73be646Smrg      ;;
63886aab59a7Smrg
6389b73be646Smrg    *nto* | *qnx*)
6390b73be646Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
6391b73be646Smrg      # it will coredump.
6392b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
6393b73be646Smrg      ;;
63946aab59a7Smrg
6395b73be646Smrg    osf3* | osf4* | osf5*)
6396b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6397b73be646Smrg      # All OSF/1 code is PIC.
6398b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6399b73be646Smrg      ;;
6400b73be646Smrg
6401b73be646Smrg    rdos*)
6402b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6403b73be646Smrg      ;;
6404b73be646Smrg
6405b73be646Smrg    solaris*)
6406b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6407b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6408b73be646Smrg      case $cc_basename in
6409b73be646Smrg      f77* | f90* | f95*)
6410b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
6411b73be646Smrg      *)
6412b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
6413b73be646Smrg      esac
6414b73be646Smrg      ;;
6415b73be646Smrg
6416b73be646Smrg    sunos4*)
6417b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6418b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
6419b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6420b73be646Smrg      ;;
6421b73be646Smrg
6422b73be646Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
6423b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6424b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6425b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6426b73be646Smrg      ;;
6427b73be646Smrg
6428b73be646Smrg    sysv4*MP*)
6429b73be646Smrg      if test -d /usr/nec ;then
6430b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
6431b73be646Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6432b73be646Smrg      fi
6433b73be646Smrg      ;;
6434fc27e79cSmrg
6435b73be646Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
6436b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6437b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6438b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6439fc27e79cSmrg      ;;
64406aab59a7Smrg
6441b73be646Smrg    unicos*)
6442b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6443b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6444b73be646Smrg      ;;
64456aab59a7Smrg
6446b73be646Smrg    uts4*)
6447b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6448b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6449fc27e79cSmrg      ;;
64506aab59a7Smrg
6451b73be646Smrg    *)
6452b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6453b73be646Smrg      ;;
6454b73be646Smrg    esac
6455b73be646Smrg  fi
6456fc27e79cSmrg])
6457b73be646Smrgcase $host_os in
6458b73be646Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
6459b73be646Smrg  *djgpp*)
6460b73be646Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
6461b73be646Smrg    ;;
6462b73be646Smrg  *)
6463b73be646Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
6464b73be646Smrg    ;;
6465fc27e79cSmrgesac
6466b73be646SmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
6467b73be646Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
6468b73be646Smrg	[How to pass a linker flag through the compiler])
6469fc27e79cSmrg
6470b73be646Smrg#
6471b73be646Smrg# Check to make sure the PIC flag actually works.
6472b73be646Smrg#
6473b73be646Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
6474b73be646Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
6475b73be646Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
6476b73be646Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
6477b73be646Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
6478b73be646Smrg     "" | " "*) ;;
6479b73be646Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
6480b73be646Smrg     esac],
6481b73be646Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
6482b73be646Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
6483fc27e79cSmrgfi
6484b73be646Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
6485b73be646Smrg	[Additional compiler flags for building library objects])
64866aab59a7Smrg
6487b73be646Smrg#
6488b73be646Smrg# Check to make sure the static flag actually works.
6489b73be646Smrg#
6490b73be646Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
6491b73be646Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
6492b73be646Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
6493b73be646Smrg  $lt_tmp_static_flag,
6494b73be646Smrg  [],
6495b73be646Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
6496b73be646Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
6497b73be646Smrg	[Compiler flag to prevent dynamic linking])
6498b73be646Smrg])# _LT_COMPILER_PIC
64996aab59a7Smrg
65006aab59a7Smrg
6501b73be646Smrg# _LT_LINKER_SHLIBS([TAGNAME])
6502b73be646Smrg# ----------------------------
6503b73be646Smrg# See if the linker supports building shared libraries.
6504b73be646Smrgm4_defun([_LT_LINKER_SHLIBS],
6505b73be646Smrg[AC_REQUIRE([LT_PATH_LD])dnl
6506b73be646SmrgAC_REQUIRE([LT_PATH_NM])dnl
6507b73be646Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
6508b73be646Smrgm4_require([_LT_DECL_EGREP])dnl
6509b73be646Smrgm4_require([_LT_DECL_SED])dnl
6510b73be646Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
6511b73be646Smrgm4_require([_LT_TAG_COMPILER])dnl
6512b73be646SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6513b73be646Smrgm4_if([$1], [CXX], [
6514b73be646Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6515b73be646Smrg  case $host_os in
6516b73be646Smrg  aix[[4-9]]*)
6517b73be646Smrg    # If we're using GNU nm, then we don't want the "-C" option.
6518b73be646Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
6519b73be646Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6520b73be646Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6521b73be646Smrg    else
6522b73be646Smrg      _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'
6523b73be646Smrg    fi
6524b73be646Smrg    ;;
6525b73be646Smrg  pw32*)
6526b73be646Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
6527b73be646Smrg  ;;
6528b73be646Smrg  cygwin* | mingw* | cegcc*)
6529b73be646Smrg    _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'
6530b73be646Smrg  ;;
6531b73be646Smrg  *)
6532b73be646Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6533b73be646Smrg  ;;
6534b73be646Smrg  esac
6535b73be646Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
6536b73be646Smrg], [
6537b73be646Smrg  runpath_var=
6538b73be646Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
6539b73be646Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
6540b73be646Smrg  _LT_TAGVAR(archive_cmds, $1)=
6541b73be646Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
6542b73be646Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
6543b73be646Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6544b73be646Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6545b73be646Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6546b73be646Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
6547b73be646Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
6548b73be646Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6549b73be646Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6550b73be646Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6551b73be646Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6552b73be646Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
6553b73be646Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6554b73be646Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
6555b73be646Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
6556b73be646Smrg  _LT_TAGVAR(module_cmds, $1)=
6557b73be646Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
6558b73be646Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
6559b73be646Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
6560b73be646Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
6561b73be646Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
6562b73be646Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
6563b73be646Smrg  # included in the symbol list
6564b73be646Smrg  _LT_TAGVAR(include_expsyms, $1)=
6565b73be646Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
6566b73be646Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
6567b73be646Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
6568b73be646Smrg  # as well as any symbol that contains `d'.
6569b73be646Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
6570b73be646Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
6571b73be646Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
6572b73be646Smrg  # the symbol is explicitly referenced.  Since portable code cannot
6573b73be646Smrg  # rely on this symbol name, it's probably fine to never include it in
6574b73be646Smrg  # preloaded symbol tables.
6575b73be646Smrg  # Exclude shared library initialization/finalization symbols.
6576b73be646Smrgdnl Note also adjust exclude_expsyms for C++ above.
6577b73be646Smrg  extract_expsyms_cmds=
6578fc27e79cSmrg
6579b73be646Smrg  case $host_os in
6580b73be646Smrg  cygwin* | mingw* | pw32* | cegcc*)
6581b73be646Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
6582b73be646Smrg    # When not using gcc, we currently assume that we are using
6583b73be646Smrg    # Microsoft Visual C++.
6584b73be646Smrg    if test "$GCC" != yes; then
6585b73be646Smrg      with_gnu_ld=no
6586b73be646Smrg    fi
6587b73be646Smrg    ;;
6588b73be646Smrg  interix*)
6589b73be646Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
6590b73be646Smrg    with_gnu_ld=yes
6591b73be646Smrg    ;;
6592b73be646Smrg  openbsd*)
6593b73be646Smrg    with_gnu_ld=no
6594b73be646Smrg    ;;
6595b73be646Smrg  esac
65966aab59a7Smrg
6597b73be646Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
6598b73be646Smrg  if test "$with_gnu_ld" = yes; then
6599b73be646Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
6600b73be646Smrg    wlarc='${wl}'
66016aab59a7Smrg
6602b73be646Smrg    # Set some defaults for GNU ld with shared library support. These
6603b73be646Smrg    # are reset later if shared libraries are not supported. Putting them
6604b73be646Smrg    # here allows them to be overridden if necessary.
6605b73be646Smrg    runpath_var=LD_RUN_PATH
6606b73be646Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6607b73be646Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6608b73be646Smrg    # ancient GNU ld didn't support --whole-archive et. al.
6609b73be646Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
6610b73be646Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6611b73be646Smrg    else
6612b73be646Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
6613b73be646Smrg    fi
6614b73be646Smrg    supports_anon_versioning=no
6615b73be646Smrg    case `$LD -v 2>&1` in
6616b73be646Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
6617b73be646Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
6618b73be646Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
6619b73be646Smrg      *\ 2.11.*) ;; # other 2.11 versions
6620b73be646Smrg      *) supports_anon_versioning=yes ;;
6621b73be646Smrg    esac
66226aab59a7Smrg
6623b73be646Smrg    # See if GNU ld supports shared libraries.
6624b73be646Smrg    case $host_os in
6625b73be646Smrg    aix[[3-9]]*)
6626b73be646Smrg      # On AIX/PPC, the GNU linker is very broken
6627b73be646Smrg      if test "$host_cpu" != ia64; then
6628b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6629b73be646Smrg	cat <<_LT_EOF 1>&2
66306aab59a7Smrg
6631b73be646Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
6632b73be646Smrg*** to be unable to reliably create shared libraries on AIX.
6633b73be646Smrg*** Therefore, libtool is disabling shared libraries support.  If you
6634b73be646Smrg*** really care for shared libraries, you may want to modify your PATH
6635b73be646Smrg*** so that a non-GNU linker is found, and then restart.
66366aab59a7Smrg
6637b73be646Smrg_LT_EOF
6638b73be646Smrg      fi
6639b73be646Smrg      ;;
66406aab59a7Smrg
6641b73be646Smrg    amigaos*)
6642b73be646Smrg      case $host_cpu in
6643b73be646Smrg      powerpc)
6644b73be646Smrg            # see comment about AmigaOS4 .so support
6645b73be646Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6646b73be646Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6647fc27e79cSmrg        ;;
6648b73be646Smrg      m68k)
6649b73be646Smrg            _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)'
6650b73be646Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6651b73be646Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6652fc27e79cSmrg        ;;
6653b73be646Smrg      esac
6654b73be646Smrg      ;;
6655fc27e79cSmrg
6656b73be646Smrg    beos*)
6657b73be646Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6658b73be646Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6659b73be646Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6660b73be646Smrg	# support --undefined.  This deserves some investigation.  FIXME
6661b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6662b73be646Smrg      else
6663b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6664b73be646Smrg      fi
6665b73be646Smrg      ;;
6666fc27e79cSmrg
6667b73be646Smrg    cygwin* | mingw* | pw32* | cegcc*)
6668b73be646Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6669b73be646Smrg      # as there is no search path for DLLs.
6670b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6671b73be646Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6672b73be646Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
6673b73be646Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6674b73be646Smrg      _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'
6675fc27e79cSmrg
6676b73be646Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6677b73be646Smrg        _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'
6678b73be646Smrg	# If the export-symbols file already is a .def file (1st line
6679b73be646Smrg	# is EXPORTS), use it as is; otherwise, prepend...
6680b73be646Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6681b73be646Smrg	  cp $export_symbols $output_objdir/$soname.def;
6682b73be646Smrg	else
6683b73be646Smrg	  echo EXPORTS > $output_objdir/$soname.def;
6684b73be646Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
6685b73be646Smrg	fi~
6686b73be646Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6687b73be646Smrg      else
6688b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6689b73be646Smrg      fi
6690b73be646Smrg      ;;
6691fc27e79cSmrg
6692b73be646Smrg    interix[[3-9]]*)
6693b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
6694b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6695b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6696b73be646Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6697b73be646Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6698b73be646Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
6699b73be646Smrg      # default) and relocated if they conflict, which is a slow very memory
6700b73be646Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
6701b73be646Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6702b73be646Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6703b73be646Smrg      _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'
6704b73be646Smrg      _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'
6705b73be646Smrg      ;;
6706fc27e79cSmrg
6707b73be646Smrg    gnu* | linux* | tpf* | k*bsd*-gnu)
6708b73be646Smrg      tmp_diet=no
6709b73be646Smrg      if test "$host_os" = linux-dietlibc; then
6710b73be646Smrg	case $cc_basename in
6711b73be646Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
6712b73be646Smrg	esac
6713b73be646Smrg      fi
6714b73be646Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
6715b73be646Smrg	 && test "$tmp_diet" = no
6716b73be646Smrg      then
6717b73be646Smrg	tmp_addflag=
6718b73be646Smrg	tmp_sharedflag='-shared'
6719b73be646Smrg	case $cc_basename,$host_cpu in
6720b73be646Smrg        pgcc*)				# Portland Group C compiler
6721b73be646Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
6722b73be646Smrg	  tmp_addflag=' $pic_flag'
6723b73be646Smrg	  ;;
6724b73be646Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
6725b73be646Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
6726b73be646Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
6727b73be646Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
6728b73be646Smrg	  tmp_addflag=' -i_dynamic' ;;
6729b73be646Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
6730b73be646Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
6731b73be646Smrg	ifc* | ifort*)			# Intel Fortran compiler
6732b73be646Smrg	  tmp_addflag=' -nofor_main' ;;
6733b73be646Smrg	lf95*)				# Lahey Fortran 8.1
6734b73be646Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
6735b73be646Smrg	  tmp_sharedflag='--shared' ;;
6736b73be646Smrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
6737b73be646Smrg	  tmp_sharedflag='-qmkshrobj'
6738b73be646Smrg	  tmp_addflag= ;;
6739b73be646Smrg	esac
6740b73be646Smrg	case `$CC -V 2>&1 | sed 5q` in
6741b73be646Smrg	*Sun\ C*)			# Sun C 5.9
6742b73be646Smrg	  _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
6743b73be646Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
6744b73be646Smrg	  tmp_sharedflag='-G' ;;
6745b73be646Smrg	*Sun\ F*)			# Sun Fortran 8.3
6746b73be646Smrg	  tmp_sharedflag='-G' ;;
6747b73be646Smrg	esac
6748b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
67496aab59a7Smrg
6750b73be646Smrg        if test "x$supports_anon_versioning" = xyes; then
6751b73be646Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6752b73be646Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6753b73be646Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
6754b73be646Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6755b73be646Smrg        fi
67566aab59a7Smrg
6757b73be646Smrg	case $cc_basename in
6758b73be646Smrg	xlf*)
6759b73be646Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
6760b73be646Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
6761b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6762b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
6763b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
6764b73be646Smrg	  if test "x$supports_anon_versioning" = xyes; then
6765b73be646Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6766b73be646Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6767b73be646Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
6768b73be646Smrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
6769b73be646Smrg	  fi
6770b73be646Smrg	  ;;
6771b73be646Smrg	esac
6772b73be646Smrg      else
6773b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6774b73be646Smrg      fi
6775b73be646Smrg      ;;
67766aab59a7Smrg
6777b73be646Smrg    netbsd*)
6778b73be646Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6779b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6780b73be646Smrg	wlarc=
6781b73be646Smrg      else
6782b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6783b73be646Smrg	_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'
6784b73be646Smrg      fi
6785b73be646Smrg      ;;
67866aab59a7Smrg
6787b73be646Smrg    solaris*)
6788b73be646Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
6789b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6790b73be646Smrg	cat <<_LT_EOF 1>&2
67916aab59a7Smrg
6792b73be646Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
6793b73be646Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
6794b73be646Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
6795b73be646Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
6796b73be646Smrg*** your PATH or compiler configuration so that the native linker is
6797b73be646Smrg*** used, and then restart.
6798659607e0Smrg
6799b73be646Smrg_LT_EOF
6800b73be646Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6801b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6802b73be646Smrg	_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'
6803b73be646Smrg      else
6804b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6805b73be646Smrg      fi
6806b73be646Smrg      ;;
6807fc27e79cSmrg
6808b73be646Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
6809b73be646Smrg      case `$LD -v 2>&1` in
6810b73be646Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
6811b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6812b73be646Smrg	cat <<_LT_EOF 1>&2
6813fc27e79cSmrg
6814b73be646Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
6815b73be646Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
6816b73be646Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
6817b73be646Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
6818b73be646Smrg*** your PATH or compiler configuration so that the native linker is
6819b73be646Smrg*** used, and then restart.
6820fc27e79cSmrg
6821b73be646Smrg_LT_EOF
6822b73be646Smrg	;;
6823b73be646Smrg	*)
6824b73be646Smrg	  # For security reasons, it is highly recommended that you always
6825b73be646Smrg	  # use absolute paths for naming shared libraries, and exclude the
6826b73be646Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
6827b73be646Smrg	  # requires that you compile everything twice, which is a pain.
6828b73be646Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6829b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6830b73be646Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6831b73be646Smrg	    _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'
6832b73be646Smrg	  else
6833b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6834b73be646Smrg	  fi
6835b73be646Smrg	;;
6836b73be646Smrg      esac
6837b73be646Smrg      ;;
6838fc27e79cSmrg
6839b73be646Smrg    sunos4*)
6840b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6841b73be646Smrg      wlarc=
6842b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6843b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6844b73be646Smrg      ;;
6845659607e0Smrg
6846b73be646Smrg    *)
6847b73be646Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6848b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6849b73be646Smrg	_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'
6850b73be646Smrg      else
6851b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6852b73be646Smrg      fi
6853b73be646Smrg      ;;
6854b73be646Smrg    esac
6855659607e0Smrg
6856b73be646Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
6857b73be646Smrg      runpath_var=
6858b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6859b73be646Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6860b73be646Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
6861b73be646Smrg    fi
6862b73be646Smrg  else
6863b73be646Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
6864b73be646Smrg    case $host_os in
6865b73be646Smrg    aix3*)
6866b73be646Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6867b73be646Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
6868b73be646Smrg      _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'
6869b73be646Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
6870b73be646Smrg      # are no directories specified by -L.
6871b73be646Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6872b73be646Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6873b73be646Smrg	# Neither direct hardcoding nor static linking is supported with a
6874b73be646Smrg	# broken collect2.
6875b73be646Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
6876b73be646Smrg      fi
6877b73be646Smrg      ;;
6878659607e0Smrg
6879b73be646Smrg    aix[[4-9]]*)
6880b73be646Smrg      if test "$host_cpu" = ia64; then
6881b73be646Smrg	# On IA64, the linker does run time linking by default, so we don't
6882b73be646Smrg	# have to do anything special.
6883b73be646Smrg	aix_use_runtimelinking=no
6884b73be646Smrg	exp_sym_flag='-Bexport'
6885b73be646Smrg	no_entry_flag=""
6886b73be646Smrg      else
6887b73be646Smrg	# If we're using GNU nm, then we don't want the "-C" option.
6888b73be646Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6889b73be646Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6890b73be646Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6891b73be646Smrg	else
6892b73be646Smrg	  _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'
6893b73be646Smrg	fi
6894b73be646Smrg	aix_use_runtimelinking=no
68956aab59a7Smrg
6896b73be646Smrg	# Test if we are trying to use run time linking or normal
6897b73be646Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6898b73be646Smrg	# need to do runtime linking.
6899b73be646Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6900b73be646Smrg	  for ld_flag in $LDFLAGS; do
6901b73be646Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6902b73be646Smrg	    aix_use_runtimelinking=yes
6903b73be646Smrg	    break
6904b73be646Smrg	  fi
6905b73be646Smrg	  done
6906b73be646Smrg	  ;;
6907b73be646Smrg	esac
6908659607e0Smrg
6909b73be646Smrg	exp_sym_flag='-bexport'
6910b73be646Smrg	no_entry_flag='-bnoentry'
6911b73be646Smrg      fi
6912659607e0Smrg
6913b73be646Smrg      # When large executables or shared objects are built, AIX ld can
6914b73be646Smrg      # have problems creating the table of contents.  If linking a library
6915b73be646Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
6916b73be646Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6917b73be646Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6918659607e0Smrg
6919b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)=''
6920b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6921b73be646Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6922b73be646Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6923b73be646Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6924b73be646Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6925b73be646Smrg
6926b73be646Smrg      if test "$GCC" = yes; then
6927b73be646Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6928b73be646Smrg	# We only want to do this on AIX 4.2 and lower, the check
6929b73be646Smrg	# below for broken collect2 doesn't work under 4.3+
6930b73be646Smrg	  collect2name=`${CC} -print-prog-name=collect2`
6931b73be646Smrg	  if test -f "$collect2name" &&
6932b73be646Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6933b73be646Smrg	  then
6934b73be646Smrg	  # We have reworked collect2
6935b73be646Smrg	  :
6936b73be646Smrg	  else
6937b73be646Smrg	  # We have old collect2
6938b73be646Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6939b73be646Smrg	  # It fails to find uninstalled libraries when the uninstalled
6940b73be646Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
6941b73be646Smrg	  # to unsupported forces relinking
6942b73be646Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6943b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6944b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6945b73be646Smrg	  fi
6946b73be646Smrg	  ;;
6947b73be646Smrg	esac
6948b73be646Smrg	shared_flag='-shared'
6949b73be646Smrg	if test "$aix_use_runtimelinking" = yes; then
6950b73be646Smrg	  shared_flag="$shared_flag "'${wl}-G'
6951b73be646Smrg	fi
6952b73be646Smrg      else
6953b73be646Smrg	# not using gcc
6954b73be646Smrg	if test "$host_cpu" = ia64; then
6955b73be646Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6956b73be646Smrg	# chokes on -Wl,-G. The following line is correct:
6957b73be646Smrg	  shared_flag='-G'
6958b73be646Smrg	else
6959b73be646Smrg	  if test "$aix_use_runtimelinking" = yes; then
6960b73be646Smrg	    shared_flag='${wl}-G'
6961b73be646Smrg	  else
6962b73be646Smrg	    shared_flag='${wl}-bM:SRE'
6963b73be646Smrg	  fi
6964b73be646Smrg	fi
6965b73be646Smrg      fi
6966b73be646Smrg
6967b73be646Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6968b73be646Smrg      # It seems that -bexpall does not export symbols beginning with
6969b73be646Smrg      # underscore (_), so it is better to generate a list of symbols to export.
6970b73be646Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
6971b73be646Smrg      if test "$aix_use_runtimelinking" = yes; then
6972b73be646Smrg	# Warning - without using the other runtime loading flags (-brtl),
6973b73be646Smrg	# -berok will link without error, but may produce a broken library.
6974b73be646Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6975b73be646Smrg        # Determine the default libpath from the value encoded in an
6976b73be646Smrg        # empty executable.
6977b73be646Smrg        _LT_SYS_MODULE_PATH_AIX
6978b73be646Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6979b73be646Smrg        _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6980b73be646Smrg      else
6981b73be646Smrg	if test "$host_cpu" = ia64; then
6982b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6983b73be646Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6984b73be646Smrg	  _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"
6985b73be646Smrg	else
6986b73be646Smrg	 # Determine the default libpath from the value encoded in an
6987b73be646Smrg	 # empty executable.
6988b73be646Smrg	 _LT_SYS_MODULE_PATH_AIX
6989b73be646Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6990b73be646Smrg	  # Warning - without using the other run time loading flags,
6991b73be646Smrg	  # -berok will link without error, but may produce a broken library.
6992b73be646Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6993b73be646Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6994b73be646Smrg	  # Exported symbols can be pulled into shared objects from archives
6995b73be646Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6996b73be646Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6997b73be646Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
6998b73be646Smrg	  _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'
6999b73be646Smrg	fi
7000b73be646Smrg      fi
7001b73be646Smrg      ;;
7002659607e0Smrg
7003b73be646Smrg    amigaos*)
7004b73be646Smrg      case $host_cpu in
7005b73be646Smrg      powerpc)
7006b73be646Smrg            # see comment about AmigaOS4 .so support
7007b73be646Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7008b73be646Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
7009fc27e79cSmrg        ;;
7010b73be646Smrg      m68k)
7011b73be646Smrg            _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)'
7012b73be646Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7013b73be646Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
7014fc27e79cSmrg        ;;
7015b73be646Smrg      esac
7016b73be646Smrg      ;;
70176aab59a7Smrg
7018b73be646Smrg    bsdi[[45]]*)
7019b73be646Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
7020b73be646Smrg      ;;
70216aab59a7Smrg
7022b73be646Smrg    cygwin* | mingw* | pw32* | cegcc*)
7023b73be646Smrg      # When not using gcc, we currently assume that we are using
7024b73be646Smrg      # Microsoft Visual C++.
7025b73be646Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
7026b73be646Smrg      # no search path for DLLs.
7027b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7028b73be646Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7029b73be646Smrg      # Tell ltmain to make .lib files, not .a files.
7030b73be646Smrg      libext=lib
7031b73be646Smrg      # Tell ltmain to make .dll files, not .so files.
7032b73be646Smrg      shrext_cmds=".dll"
7033b73be646Smrg      # FIXME: Setting linknames here is a bad hack.
7034b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
7035b73be646Smrg      # The linker will automatically build a .lib file if we build a DLL.
7036b73be646Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7037b73be646Smrg      # FIXME: Should let the user specify the lib program.
7038b73be646Smrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
7039b73be646Smrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
7040b73be646Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7041b73be646Smrg      ;;
70426aab59a7Smrg
7043b73be646Smrg    darwin* | rhapsody*)
7044b73be646Smrg      _LT_DARWIN_LINKER_FEATURES($1)
7045b73be646Smrg      ;;
70466aab59a7Smrg
7047b73be646Smrg    dgux*)
7048b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7049b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7050b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7051b73be646Smrg      ;;
70526aab59a7Smrg
7053b73be646Smrg    freebsd1*)
7054b73be646Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
7055b73be646Smrg      ;;
70566aab59a7Smrg
7057b73be646Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
7058b73be646Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
7059b73be646Smrg    # does not break anything, and helps significantly (at the cost of a little
7060b73be646Smrg    # extra space).
7061b73be646Smrg    freebsd2.2*)
7062b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
7063b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7064b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7065b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7066b73be646Smrg      ;;
70676aab59a7Smrg
7068b73be646Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
7069b73be646Smrg    freebsd2*)
7070b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7071b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7072b73be646Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
7073b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7074b73be646Smrg      ;;
70756aab59a7Smrg
7076b73be646Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
7077b73be646Smrg    freebsd* | dragonfly*)
7078b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
7079b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7080b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7081b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7082b73be646Smrg      ;;
70836aab59a7Smrg
7084b73be646Smrg    hpux9*)
7085b73be646Smrg      if test "$GCC" = yes; then
7086b73be646Smrg	_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'
7087b73be646Smrg      else
7088b73be646Smrg	_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'
7089b73be646Smrg      fi
7090b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7091b73be646Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7092b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
70936aab59a7Smrg
7094b73be646Smrg      # hardcode_minus_L: Not really in the search PATH,
7095b73be646Smrg      # but as the default location of the library.
7096b73be646Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
7097b73be646Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7098b73be646Smrg      ;;
70996aab59a7Smrg
7100b73be646Smrg    hpux10*)
7101b73be646Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
7102b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7103b73be646Smrg      else
7104b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
7105b73be646Smrg      fi
7106b73be646Smrg      if test "$with_gnu_ld" = no; then
7107b73be646Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7108b73be646Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
7109b73be646Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
7110b73be646Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
7111b73be646Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7112b73be646Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7113b73be646Smrg	# hardcode_minus_L: Not really in the search PATH,
7114b73be646Smrg	# but as the default location of the library.
7115b73be646Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
7116b73be646Smrg      fi
7117b73be646Smrg      ;;
71186aab59a7Smrg
7119b73be646Smrg    hpux11*)
7120b73be646Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
7121b73be646Smrg	case $host_cpu in
7122b73be646Smrg	hppa*64*)
7123b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7124b73be646Smrg	  ;;
7125b73be646Smrg	ia64*)
7126b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
7127b73be646Smrg	  ;;
7128b73be646Smrg	*)
7129b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7130b73be646Smrg	  ;;
7131b73be646Smrg	esac
7132b73be646Smrg      else
7133b73be646Smrg	case $host_cpu in
7134b73be646Smrg	hppa*64*)
7135b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7136b73be646Smrg	  ;;
7137b73be646Smrg	ia64*)
7138b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
7139b73be646Smrg	  ;;
7140b73be646Smrg	*)
7141b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7142b73be646Smrg	  ;;
7143b73be646Smrg	esac
7144b73be646Smrg      fi
7145b73be646Smrg      if test "$with_gnu_ld" = no; then
7146b73be646Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7147b73be646Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
71486aab59a7Smrg
7149b73be646Smrg	case $host_cpu in
7150b73be646Smrg	hppa*64*|ia64*)
7151b73be646Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
7152b73be646Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7153b73be646Smrg	  ;;
7154b73be646Smrg	*)
7155b73be646Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7156b73be646Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7157b73be646Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
71586aab59a7Smrg
7159b73be646Smrg	  # hardcode_minus_L: Not really in the search PATH,
7160b73be646Smrg	  # but as the default location of the library.
7161b73be646Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
7162b73be646Smrg	  ;;
7163b73be646Smrg	esac
7164b73be646Smrg      fi
7165b73be646Smrg      ;;
71666aab59a7Smrg
7167b73be646Smrg    irix5* | irix6* | nonstopux*)
7168b73be646Smrg      if test "$GCC" = yes; then
7169b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7170b73be646Smrg	# Try to use the -exported_symbol ld option, if it does not
7171b73be646Smrg	# work, assume that -exports_file does not work either and
7172b73be646Smrg	# implicitly export all symbols.
7173b73be646Smrg        save_LDFLAGS="$LDFLAGS"
7174b73be646Smrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
7175b73be646Smrg        AC_LINK_IFELSE(int foo(void) {},
7176b73be646Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
7177b73be646Smrg        )
7178b73be646Smrg        LDFLAGS="$save_LDFLAGS"
7179b73be646Smrg      else
7180b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
7181b73be646Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
7182b73be646Smrg      fi
7183b73be646Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
7184b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7185b73be646Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7186b73be646Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
7187b73be646Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
7188b73be646Smrg      ;;
7189fc27e79cSmrg
7190b73be646Smrg    netbsd*)
7191b73be646Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7192b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
7193b73be646Smrg      else
7194b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
7195b73be646Smrg      fi
7196b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7197b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7198b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7199b73be646Smrg      ;;
7200fc27e79cSmrg
7201b73be646Smrg    newsos6)
7202b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7203b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7204b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7205b73be646Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7206b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7207b73be646Smrg      ;;
7208fc27e79cSmrg
7209b73be646Smrg    *nto* | *qnx*)
7210b73be646Smrg      ;;
7211fc27e79cSmrg
7212b73be646Smrg    openbsd*)
7213b73be646Smrg      if test -f /usr/libexec/ld.so; then
7214b73be646Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
7215b73be646Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7216b73be646Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7217b73be646Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7218b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
7219b73be646Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
7220b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7221b73be646Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7222b73be646Smrg	else
7223b73be646Smrg	  case $host_os in
7224b73be646Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
7225b73be646Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7226b73be646Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7227b73be646Smrg	     ;;
7228b73be646Smrg	   *)
7229b73be646Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
7230b73be646Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7231b73be646Smrg	     ;;
7232b73be646Smrg	  esac
7233b73be646Smrg	fi
7234b73be646Smrg      else
7235b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
7236b73be646Smrg      fi
7237b73be646Smrg      ;;
7238fc27e79cSmrg
7239b73be646Smrg    os2*)
7240b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7241b73be646Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
7242b73be646Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7243b73be646Smrg      _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'
7244b73be646Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
7245b73be646Smrg      ;;
7246fc27e79cSmrg
7247b73be646Smrg    osf3*)
7248b73be646Smrg      if test "$GCC" = yes; then
7249b73be646Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7250b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7251b73be646Smrg      else
7252b73be646Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7253b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
7254b73be646Smrg      fi
7255b73be646Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
7256b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7257b73be646Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7258b73be646Smrg      ;;
7259fc27e79cSmrg
7260b73be646Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
7261b73be646Smrg      if test "$GCC" = yes; then
7262b73be646Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7263b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7264b73be646Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7265b73be646Smrg      else
7266b73be646Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7267b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
7268b73be646Smrg	_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~
7269b73be646Smrg	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
7270fc27e79cSmrg
7271b73be646Smrg	# Both c and cxx compiler support -rpath directly
7272b73be646Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7273b73be646Smrg      fi
7274b73be646Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
7275b73be646Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7276b73be646Smrg      ;;
7277fc27e79cSmrg
7278b73be646Smrg    solaris*)
7279b73be646Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
7280b73be646Smrg      if test "$GCC" = yes; then
7281b73be646Smrg	wlarc='${wl}'
7282b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7283b73be646Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7284b73be646Smrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
7285b73be646Smrg      else
7286b73be646Smrg	case `$CC -V 2>&1` in
7287b73be646Smrg	*"Compilers 5.0"*)
7288b73be646Smrg	  wlarc=''
7289b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
7290b73be646Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7291b73be646Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
7292b73be646Smrg	  ;;
7293b73be646Smrg	*)
7294b73be646Smrg	  wlarc='${wl}'
7295b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
7296b73be646Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7297b73be646Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
7298b73be646Smrg	  ;;
7299b73be646Smrg	esac
7300b73be646Smrg      fi
7301b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7302b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7303b73be646Smrg      case $host_os in
7304b73be646Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7305b73be646Smrg      *)
7306b73be646Smrg	# The compiler driver will combine and reorder linker options,
7307b73be646Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
7308b73be646Smrg	# but is careful enough not to reorder.
7309b73be646Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
7310b73be646Smrg	if test "$GCC" = yes; then
7311b73be646Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7312b73be646Smrg	else
7313b73be646Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7314b73be646Smrg	fi
7315b73be646Smrg	;;
7316b73be646Smrg      esac
7317b73be646Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
7318b73be646Smrg      ;;
7319fc27e79cSmrg
7320b73be646Smrg    sunos4*)
7321b73be646Smrg      if test "x$host_vendor" = xsequent; then
7322b73be646Smrg	# Use $CC to link under sequent, because it throws in some extra .o
7323b73be646Smrg	# files that make .init and .fini sections work.
7324b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
7325b73be646Smrg      else
7326b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
7327b73be646Smrg      fi
7328b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7329b73be646Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
7330b73be646Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
7331b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7332b73be646Smrg      ;;
7333fc27e79cSmrg
7334b73be646Smrg    sysv4)
7335b73be646Smrg      case $host_vendor in
7336b73be646Smrg	sni)
7337b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7338b73be646Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
7339b73be646Smrg	;;
7340b73be646Smrg	siemens)
7341b73be646Smrg	  ## LD is ld it makes a PLAMLIB
7342b73be646Smrg	  ## CC just makes a GrossModule.
7343b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
7344b73be646Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
7345b73be646Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
7346b73be646Smrg        ;;
7347b73be646Smrg	motorola)
7348b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7349b73be646Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
7350b73be646Smrg	;;
7351b73be646Smrg      esac
7352b73be646Smrg      runpath_var='LD_RUN_PATH'
7353b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7354b73be646Smrg      ;;
7355fc27e79cSmrg
7356b73be646Smrg    sysv4.3*)
7357b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7358b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7359b73be646Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
7360b73be646Smrg      ;;
7361fc27e79cSmrg
7362b73be646Smrg    sysv4*MP*)
7363b73be646Smrg      if test -d /usr/nec; then
7364b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7365b73be646Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7366b73be646Smrg	runpath_var=LD_RUN_PATH
7367b73be646Smrg	hardcode_runpath_var=yes
7368b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
7369b73be646Smrg      fi
7370b73be646Smrg      ;;
7371fc27e79cSmrg
7372b73be646Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7373b73be646Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7374b73be646Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7375b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7376b73be646Smrg      runpath_var='LD_RUN_PATH'
7377fc27e79cSmrg
7378b73be646Smrg      if test "$GCC" = yes; then
7379b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7380b73be646Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7381b73be646Smrg      else
7382b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7383b73be646Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7384b73be646Smrg      fi
7385b73be646Smrg      ;;
7386fc27e79cSmrg
7387b73be646Smrg    sysv5* | sco3.2v5* | sco5v6*)
7388b73be646Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
7389b73be646Smrg      # link with -lc, and that would cause any symbols used from libc to
7390b73be646Smrg      # always be unresolved, which means just about no library would
7391b73be646Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
7392b73be646Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
7393b73be646Smrg      # as -z defs.
7394b73be646Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7395b73be646Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7396b73be646Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7397b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7398b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7399b73be646Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7400b73be646Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
7401b73be646Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7402b73be646Smrg      runpath_var='LD_RUN_PATH'
7403fc27e79cSmrg
7404b73be646Smrg      if test "$GCC" = yes; then
7405b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7406b73be646Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7407b73be646Smrg      else
7408b73be646Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7409b73be646Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7410b73be646Smrg      fi
7411b73be646Smrg      ;;
7412fc27e79cSmrg
7413b73be646Smrg    uts4*)
7414b73be646Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7415b73be646Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7416b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7417b73be646Smrg      ;;
7418fc27e79cSmrg
7419b73be646Smrg    *)
7420b73be646Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
7421b73be646Smrg      ;;
7422b73be646Smrg    esac
7423fc27e79cSmrg
7424b73be646Smrg    if test x$host_vendor = xsni; then
7425b73be646Smrg      case $host in
7426b73be646Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7427b73be646Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
7428b73be646Smrg	;;
7429b73be646Smrg      esac
7430b73be646Smrg    fi
7431b73be646Smrg  fi
7432fc27e79cSmrg])
7433b73be646SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7434b73be646Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7435fc27e79cSmrg
7436b73be646Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
7437fc27e79cSmrg
7438b73be646Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
7439b73be646Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
7440b73be646Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
7441b73be646Smrg    [The commands to extract the exported symbol list from a shared archive])
7442fc27e79cSmrg
7443b73be646Smrg#
7444b73be646Smrg# Do we need to explicitly link libc?
7445b73be646Smrg#
7446b73be646Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
7447b73be646Smrgx|xyes)
7448b73be646Smrg  # Assume -lc should be added
7449b73be646Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7450fc27e79cSmrg
7451b73be646Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
7452b73be646Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
7453b73be646Smrg    *'~'*)
7454b73be646Smrg      # FIXME: we may have to deal with multi-command sequences.
7455b73be646Smrg      ;;
7456b73be646Smrg    '$CC '*)
7457b73be646Smrg      # Test whether the compiler implicitly links with -lc since on some
7458b73be646Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
7459b73be646Smrg      # to ld, don't add -lc before -lgcc.
7460b73be646Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
7461b73be646Smrg      $RM conftest*
7462b73be646Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7463b73be646Smrg
7464b73be646Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
7465b73be646Smrg        soname=conftest
7466b73be646Smrg        lib=conftest
7467b73be646Smrg        libobjs=conftest.$ac_objext
7468b73be646Smrg        deplibs=
7469b73be646Smrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
7470b73be646Smrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
7471b73be646Smrg        compiler_flags=-v
7472b73be646Smrg        linker_flags=-v
7473b73be646Smrg        verstring=
7474b73be646Smrg        output_objdir=.
7475b73be646Smrg        libname=conftest
7476b73be646Smrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
7477b73be646Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=
7478b73be646Smrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
7479b73be646Smrg        then
7480b73be646Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7481b73be646Smrg        else
7482b73be646Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7483b73be646Smrg        fi
7484b73be646Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
7485b73be646Smrg      else
7486b73be646Smrg        cat conftest.err 1>&5
7487fc27e79cSmrg      fi
7488b73be646Smrg      $RM conftest*
7489b73be646Smrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
7490b73be646Smrg      ;;
7491b73be646Smrg    esac
74926aab59a7Smrg  fi
7493b73be646Smrg  ;;
7494b73be646Smrgesac
7495fc27e79cSmrg
7496b73be646Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
7497b73be646Smrg    [Whether or not to add -lc for building shared libraries])
7498b73be646Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
7499b73be646Smrg    [enable_shared_with_static_runtimes], [0],
7500b73be646Smrg    [Whether or not to disallow shared libs when runtime libs are static])
7501b73be646Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
7502b73be646Smrg    [Compiler flag to allow reflexive dlopens])
7503b73be646Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
7504b73be646Smrg    [Compiler flag to generate shared objects directly from archives])
7505b73be646Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
7506b73be646Smrg    [Whether the compiler copes with passing no objects directly])
7507b73be646Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
7508b73be646Smrg    [Create an old-style archive from a shared archive])
7509b73be646Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
7510b73be646Smrg    [Create a temporary old-style archive to link instead of a shared archive])
7511b73be646Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
7512b73be646Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
7513b73be646Smrg_LT_TAGDECL([], [module_cmds], [2],
7514b73be646Smrg    [Commands used to build a loadable module if different from building
7515b73be646Smrg    a shared archive.])
7516b73be646Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
7517b73be646Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
7518b73be646Smrg    [Whether we are building with GNU ld or not])
7519b73be646Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
7520b73be646Smrg    [Flag that allows shared libraries with undefined symbols to be built])
7521b73be646Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
7522b73be646Smrg    [Flag that enforces no undefined symbols])
7523b73be646Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
7524b73be646Smrg    [Flag to hardcode $libdir into a binary during linking.
7525b73be646Smrg    This must work even if $libdir does not exist])
7526b73be646Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
7527b73be646Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
7528b73be646Smrg    during linking.  This must work even if $libdir does not exist]])
7529b73be646Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
7530b73be646Smrg    [Whether we need a single "-rpath" flag with a separated argument])
7531b73be646Smrg_LT_TAGDECL([], [hardcode_direct], [0],
7532b73be646Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
7533b73be646Smrg    DIR into the resulting binary])
7534b73be646Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
7535b73be646Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
7536b73be646Smrg    DIR into the resulting binary and the resulting library dependency is
7537b73be646Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
7538b73be646Smrg    library is relocated])
7539b73be646Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
7540b73be646Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
7541b73be646Smrg    into the resulting binary])
7542b73be646Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
7543b73be646Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
7544b73be646Smrg    into the resulting binary])
7545b73be646Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
7546b73be646Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
7547b73be646Smrg    into the library and all subsequent libraries and executables linked
7548b73be646Smrg    against it])
7549b73be646Smrg_LT_TAGDECL([], [inherit_rpath], [0],
7550b73be646Smrg    [Set to yes if linker adds runtime paths of dependent libraries
7551b73be646Smrg    to runtime path list])
7552b73be646Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
7553b73be646Smrg    [Whether libtool must link a program against all its dependency libraries])
7554b73be646Smrg_LT_TAGDECL([], [fix_srcfile_path], [1],
7555b73be646Smrg    [Fix the shell variable $srcfile for the compiler])
7556b73be646Smrg_LT_TAGDECL([], [always_export_symbols], [0],
7557b73be646Smrg    [Set to "yes" if exported symbols are required])
7558b73be646Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
7559b73be646Smrg    [The commands to list exported symbols])
7560b73be646Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
7561b73be646Smrg    [Symbols that should not be listed in the preloaded symbols])
7562b73be646Smrg_LT_TAGDECL([], [include_expsyms], [1],
7563b73be646Smrg    [Symbols that must always be exported])
7564b73be646Smrg_LT_TAGDECL([], [prelink_cmds], [2],
7565b73be646Smrg    [Commands necessary for linking programs (against libraries) with templates])
7566b73be646Smrg_LT_TAGDECL([], [file_list_spec], [1],
7567b73be646Smrg    [Specify filename containing input files])
7568b73be646Smrgdnl FIXME: Not yet implemented
7569b73be646Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
7570b73be646Smrgdnl    [Compiler flag to generate thread safe objects])
7571b73be646Smrg])# _LT_LINKER_SHLIBS
7572fc27e79cSmrg
7573fc27e79cSmrg
7574b73be646Smrg# _LT_LANG_C_CONFIG([TAG])
7575fc27e79cSmrg# ------------------------
7576b73be646Smrg# Ensure that the configuration variables for a C compiler are suitably
7577b73be646Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
7578b73be646Smrg# the compiler configuration to `libtool'.
7579b73be646Smrgm4_defun([_LT_LANG_C_CONFIG],
7580b73be646Smrg[m4_require([_LT_DECL_EGREP])dnl
7581b73be646Smrglt_save_CC="$CC"
7582b73be646SmrgAC_LANG_PUSH(C)
7583fc27e79cSmrg
7584b73be646Smrg# Source file extension for C test sources.
7585b73be646Smrgac_ext=c
7586fc27e79cSmrg
7587b73be646Smrg# Object file extension for compiled C test sources.
7588b73be646Smrgobjext=o
7589b73be646Smrg_LT_TAGVAR(objext, $1)=$objext
7590fc27e79cSmrg
7591b73be646Smrg# Code to be used in simple compile tests
7592b73be646Smrglt_simple_compile_test_code="int some_variable = 0;"
75936aab59a7Smrg
7594b73be646Smrg# Code to be used in simple link tests
7595b73be646Smrglt_simple_link_test_code='int main(){return(0);}'
75966aab59a7Smrg
7597b73be646Smrg_LT_TAG_COMPILER
7598b73be646Smrg# Save the default compiler, since it gets overwritten when the other
7599b73be646Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
7600b73be646Smrgcompiler_DEFAULT=$CC
7601fc27e79cSmrg
7602b73be646Smrg# save warnings/boilerplate of simple test code
7603b73be646Smrg_LT_COMPILER_BOILERPLATE
7604b73be646Smrg_LT_LINKER_BOILERPLATE
76056aab59a7Smrg
7606b73be646Smrgif test -n "$compiler"; then
7607b73be646Smrg  _LT_COMPILER_NO_RTTI($1)
7608b73be646Smrg  _LT_COMPILER_PIC($1)
7609b73be646Smrg  _LT_COMPILER_C_O($1)
7610b73be646Smrg  _LT_COMPILER_FILE_LOCKS($1)
7611b73be646Smrg  _LT_LINKER_SHLIBS($1)
7612b73be646Smrg  _LT_SYS_DYNAMIC_LINKER($1)
7613b73be646Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7614b73be646Smrg  LT_SYS_DLOPEN_SELF
7615b73be646Smrg  _LT_CMD_STRIPLIB
76166aab59a7Smrg
7617b73be646Smrg  # Report which library types will actually be built
7618b73be646Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
7619b73be646Smrg  AC_MSG_RESULT([$can_build_shared])
7620fc27e79cSmrg
7621b73be646Smrg  AC_MSG_CHECKING([whether to build shared libraries])
7622b73be646Smrg  test "$can_build_shared" = "no" && enable_shared=no
7623fc27e79cSmrg
7624b73be646Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
7625b73be646Smrg  # are all built from PIC.
7626b73be646Smrg  case $host_os in
7627b73be646Smrg  aix3*)
7628b73be646Smrg    test "$enable_shared" = yes && enable_static=no
7629b73be646Smrg    if test -n "$RANLIB"; then
7630b73be646Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
7631b73be646Smrg      postinstall_cmds='$RANLIB $lib'
7632b73be646Smrg    fi
7633b73be646Smrg    ;;
7634fc27e79cSmrg
7635b73be646Smrg  aix[[4-9]]*)
7636b73be646Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7637b73be646Smrg      test "$enable_shared" = yes && enable_static=no
7638b73be646Smrg    fi
7639b73be646Smrg    ;;
7640fc27e79cSmrg  esac
7641b73be646Smrg  AC_MSG_RESULT([$enable_shared])
7642b73be646Smrg
7643b73be646Smrg  AC_MSG_CHECKING([whether to build static libraries])
7644b73be646Smrg  # Make sure either enable_shared or enable_static is yes.
7645b73be646Smrg  test "$enable_shared" = yes || enable_static=yes
7646b73be646Smrg  AC_MSG_RESULT([$enable_static])
7647b73be646Smrg
7648b73be646Smrg  _LT_CONFIG($1)
7649b73be646Smrgfi
7650b73be646SmrgAC_LANG_POP
7651b73be646SmrgCC="$lt_save_CC"
7652b73be646Smrg])# _LT_LANG_C_CONFIG
7653b73be646Smrg
7654b73be646Smrg
7655b73be646Smrg# _LT_PROG_CXX
7656b73be646Smrg# ------------
7657b73be646Smrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
7658b73be646Smrg# compiler, we have our own version here.
7659b73be646Smrgm4_defun([_LT_PROG_CXX],
7660b73be646Smrg[
7661b73be646Smrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
7662b73be646SmrgAC_PROG_CXX
7663b73be646Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
7664b73be646Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
7665b73be646Smrg    (test "X$CXX" != "Xg++"))) ; then
7666b73be646Smrg  AC_PROG_CXXCPP
7667b73be646Smrgelse
7668b73be646Smrg  _lt_caught_CXX_error=yes
7669b73be646Smrgfi
7670b73be646Smrgpopdef([AC_MSG_ERROR])
7671b73be646Smrg])# _LT_PROG_CXX
7672b73be646Smrg
7673b73be646Smrgdnl aclocal-1.4 backwards compatibility:
7674b73be646Smrgdnl AC_DEFUN([_LT_PROG_CXX], [])
7675b73be646Smrg
7676b73be646Smrg
7677b73be646Smrg# _LT_LANG_CXX_CONFIG([TAG])
7678b73be646Smrg# --------------------------
7679b73be646Smrg# Ensure that the configuration variables for a C++ compiler are suitably
7680b73be646Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
7681b73be646Smrg# the compiler configuration to `libtool'.
7682b73be646Smrgm4_defun([_LT_LANG_CXX_CONFIG],
7683b73be646Smrg[AC_REQUIRE([_LT_PROG_CXX])dnl
7684b73be646Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
7685b73be646Smrgm4_require([_LT_DECL_EGREP])dnl
7686b73be646Smrg
7687b73be646SmrgAC_LANG_PUSH(C++)
7688b73be646Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7689b73be646Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7690b73be646Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7691b73be646Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7692b73be646Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
7693b73be646Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7694b73be646Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7695b73be646Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7696b73be646Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7697b73be646Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
7698b73be646Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7699b73be646Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7700b73be646Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
7701b73be646Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7702b73be646Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7703b73be646Smrg_LT_TAGVAR(module_cmds, $1)=
7704b73be646Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7705b73be646Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7706b73be646Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7707b73be646Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7708b73be646Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7709b73be646Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7710fc27e79cSmrg
7711b73be646Smrg# Source file extension for C++ test sources.
7712b73be646Smrgac_ext=cpp
7713fc27e79cSmrg
7714b73be646Smrg# Object file extension for compiled C++ test sources.
7715b73be646Smrgobjext=o
7716b73be646Smrg_LT_TAGVAR(objext, $1)=$objext
7717fc27e79cSmrg
7718b73be646Smrg# No sense in running all these tests if we already determined that
7719b73be646Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
7720b73be646Smrg# are currently assumed to apply to all compilers on this platform,
7721b73be646Smrg# and will be corrupted by setting them based on a non-working compiler.
7722b73be646Smrgif test "$_lt_caught_CXX_error" != yes; then
7723b73be646Smrg  # Code to be used in simple compile tests
7724b73be646Smrg  lt_simple_compile_test_code="int some_variable = 0;"
7725fc27e79cSmrg
7726b73be646Smrg  # Code to be used in simple link tests
7727b73be646Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
7728fc27e79cSmrg
7729b73be646Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7730b73be646Smrg  _LT_TAG_COMPILER
7731b73be646Smrg
7732b73be646Smrg  # save warnings/boilerplate of simple test code
7733b73be646Smrg  _LT_COMPILER_BOILERPLATE
7734b73be646Smrg  _LT_LINKER_BOILERPLATE
7735b73be646Smrg
7736b73be646Smrg  # Allow CC to be a program name with arguments.
7737b73be646Smrg  lt_save_CC=$CC
7738b73be646Smrg  lt_save_LD=$LD
7739b73be646Smrg  lt_save_GCC=$GCC
7740b73be646Smrg  GCC=$GXX
7741b73be646Smrg  lt_save_with_gnu_ld=$with_gnu_ld
7742b73be646Smrg  lt_save_path_LD=$lt_cv_path_LD
7743b73be646Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
7744b73be646Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
7745fc27e79cSmrg  else
7746b73be646Smrg    $as_unset lt_cv_prog_gnu_ld
7747fc27e79cSmrg  fi
7748b73be646Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
7749b73be646Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
7750b73be646Smrg  else
7751b73be646Smrg    $as_unset lt_cv_path_LD
7752b73be646Smrg  fi
7753b73be646Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
7754b73be646Smrg  CC=${CXX-"c++"}
7755b73be646Smrg  compiler=$CC
7756b73be646Smrg  _LT_TAGVAR(compiler, $1)=$CC
7757b73be646Smrg  _LT_CC_BASENAME([$compiler])
7758fc27e79cSmrg
7759b73be646Smrg  if test -n "$compiler"; then
7760b73be646Smrg    # We don't want -fno-exception when compiling C++ code, so set the
7761b73be646Smrg    # no_builtin_flag separately
7762b73be646Smrg    if test "$GXX" = yes; then
7763b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7764b73be646Smrg    else
7765b73be646Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7766b73be646Smrg    fi
7767fc27e79cSmrg
7768b73be646Smrg    if test "$GXX" = yes; then
7769b73be646Smrg      # Set up default GNU C++ configuration
7770fc27e79cSmrg
7771b73be646Smrg      LT_PATH_LD
7772fc27e79cSmrg
7773b73be646Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
7774b73be646Smrg      # archiving commands below assume that GNU ld is being used.
7775b73be646Smrg      if test "$with_gnu_ld" = yes; then
7776b73be646Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7777b73be646Smrg        _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'
7778fc27e79cSmrg
7779b73be646Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7780b73be646Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7781fc27e79cSmrg
7782b73be646Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
7783b73be646Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
7784b73be646Smrg        #     investigate it a little bit more. (MM)
7785b73be646Smrg        wlarc='${wl}'
7786fc27e79cSmrg
7787b73be646Smrg        # ancient GNU ld didn't support --whole-archive et. al.
7788b73be646Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
7789b73be646Smrg	  $GREP 'no-whole-archive' > /dev/null; then
7790b73be646Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7791b73be646Smrg        else
7792b73be646Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
7793b73be646Smrg        fi
7794b73be646Smrg      else
7795b73be646Smrg        with_gnu_ld=no
7796b73be646Smrg        wlarc=
7797fc27e79cSmrg
7798b73be646Smrg        # A generic and very simple default shared library creation
7799b73be646Smrg        # command for GNU C++ for the case where it uses the native
7800b73be646Smrg        # linker, instead of GNU ld.  If possible, this setting should
7801b73be646Smrg        # overridden to take advantage of the native linker features on
7802b73be646Smrg        # the platform it is being used on.
7803b73be646Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7804b73be646Smrg      fi
7805fc27e79cSmrg
7806b73be646Smrg      # Commands to make compiler produce verbose output that lists
7807b73be646Smrg      # what "hidden" libraries, object files and flags are used when
7808b73be646Smrg      # linking a shared library.
7809b73be646Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
7810fc27e79cSmrg
7811b73be646Smrg    else
7812b73be646Smrg      GXX=no
7813b73be646Smrg      with_gnu_ld=no
7814b73be646Smrg      wlarc=
7815b73be646Smrg    fi
7816fc27e79cSmrg
7817b73be646Smrg    # PORTME: fill in a description of your system's C++ link characteristics
7818b73be646Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7819b73be646Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
7820b73be646Smrg    case $host_os in
7821b73be646Smrg      aix3*)
7822b73be646Smrg        # FIXME: insert proper C++ library support
7823b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7824b73be646Smrg        ;;
7825b73be646Smrg      aix[[4-9]]*)
7826b73be646Smrg        if test "$host_cpu" = ia64; then
7827b73be646Smrg          # On IA64, the linker does run time linking by default, so we don't
7828b73be646Smrg          # have to do anything special.
7829b73be646Smrg          aix_use_runtimelinking=no
7830b73be646Smrg          exp_sym_flag='-Bexport'
7831b73be646Smrg          no_entry_flag=""
7832b73be646Smrg        else
7833b73be646Smrg          aix_use_runtimelinking=no
7834fc27e79cSmrg
7835b73be646Smrg          # Test if we are trying to use run time linking or normal
7836b73be646Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7837b73be646Smrg          # need to do runtime linking.
7838b73be646Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7839b73be646Smrg	    for ld_flag in $LDFLAGS; do
7840b73be646Smrg	      case $ld_flag in
7841b73be646Smrg	      *-brtl*)
7842b73be646Smrg	        aix_use_runtimelinking=yes
7843b73be646Smrg	        break
7844b73be646Smrg	        ;;
7845b73be646Smrg	      esac
7846b73be646Smrg	    done
7847b73be646Smrg	    ;;
7848b73be646Smrg          esac
7849fc27e79cSmrg
7850b73be646Smrg          exp_sym_flag='-bexport'
7851b73be646Smrg          no_entry_flag='-bnoentry'
7852b73be646Smrg        fi
7853fc27e79cSmrg
7854b73be646Smrg        # When large executables or shared objects are built, AIX ld can
7855b73be646Smrg        # have problems creating the table of contents.  If linking a library
7856b73be646Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
7857b73be646Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7858b73be646Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7859fc27e79cSmrg
7860b73be646Smrg        _LT_TAGVAR(archive_cmds, $1)=''
7861b73be646Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
7862b73be646Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7863b73be646Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7864b73be646Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
7865b73be646Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7866b73be646Smrg
7867b73be646Smrg        if test "$GXX" = yes; then
7868b73be646Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7869b73be646Smrg          # We only want to do this on AIX 4.2 and lower, the check
7870b73be646Smrg          # below for broken collect2 doesn't work under 4.3+
7871b73be646Smrg	  collect2name=`${CC} -print-prog-name=collect2`
7872b73be646Smrg	  if test -f "$collect2name" &&
7873b73be646Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7874b73be646Smrg	  then
7875b73be646Smrg	    # We have reworked collect2
7876b73be646Smrg	    :
7877b73be646Smrg	  else
7878b73be646Smrg	    # We have old collect2
7879b73be646Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7880b73be646Smrg	    # It fails to find uninstalled libraries when the uninstalled
7881b73be646Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
7882b73be646Smrg	    # to unsupported forces relinking
7883b73be646Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7884b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7885b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7886b73be646Smrg	  fi
7887b73be646Smrg          esac
7888b73be646Smrg          shared_flag='-shared'
7889b73be646Smrg	  if test "$aix_use_runtimelinking" = yes; then
7890b73be646Smrg	    shared_flag="$shared_flag "'${wl}-G'
7891b73be646Smrg	  fi
7892b73be646Smrg        else
7893b73be646Smrg          # not using gcc
7894b73be646Smrg          if test "$host_cpu" = ia64; then
7895b73be646Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7896b73be646Smrg	  # chokes on -Wl,-G. The following line is correct:
7897b73be646Smrg	  shared_flag='-G'
7898b73be646Smrg          else
7899b73be646Smrg	    if test "$aix_use_runtimelinking" = yes; then
7900b73be646Smrg	      shared_flag='${wl}-G'
7901b73be646Smrg	    else
7902b73be646Smrg	      shared_flag='${wl}-bM:SRE'
7903b73be646Smrg	    fi
7904b73be646Smrg          fi
7905b73be646Smrg        fi
7906fc27e79cSmrg
7907b73be646Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7908b73be646Smrg        # It seems that -bexpall does not export symbols beginning with
7909b73be646Smrg        # underscore (_), so it is better to generate a list of symbols to
7910b73be646Smrg	# export.
7911b73be646Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
7912b73be646Smrg        if test "$aix_use_runtimelinking" = yes; then
7913b73be646Smrg          # Warning - without using the other runtime loading flags (-brtl),
7914b73be646Smrg          # -berok will link without error, but may produce a broken library.
7915b73be646Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7916b73be646Smrg          # Determine the default libpath from the value encoded in an empty
7917b73be646Smrg          # executable.
7918b73be646Smrg          _LT_SYS_MODULE_PATH_AIX
7919b73be646Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7920fc27e79cSmrg
7921b73be646Smrg          _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
7922b73be646Smrg        else
7923b73be646Smrg          if test "$host_cpu" = ia64; then
7924b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7925b73be646Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7926b73be646Smrg	    _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"
7927b73be646Smrg          else
7928b73be646Smrg	    # Determine the default libpath from the value encoded in an
7929b73be646Smrg	    # empty executable.
7930b73be646Smrg	    _LT_SYS_MODULE_PATH_AIX
7931b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7932b73be646Smrg	    # Warning - without using the other run time loading flags,
7933b73be646Smrg	    # -berok will link without error, but may produce a broken library.
7934b73be646Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7935b73be646Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7936b73be646Smrg	    # Exported symbols can be pulled into shared objects from archives
7937b73be646Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7938b73be646Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7939b73be646Smrg	    # This is similar to how AIX traditionally builds its shared
7940b73be646Smrg	    # libraries.
7941b73be646Smrg	    _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'
7942b73be646Smrg          fi
7943b73be646Smrg        fi
7944b73be646Smrg        ;;
7945fc27e79cSmrg
7946b73be646Smrg      beos*)
7947b73be646Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7948b73be646Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7949b73be646Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7950b73be646Smrg	  # support --undefined.  This deserves some investigation.  FIXME
7951b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7952b73be646Smrg	else
7953b73be646Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7954b73be646Smrg	fi
7955b73be646Smrg	;;
7956fc27e79cSmrg
7957b73be646Smrg      chorus*)
7958b73be646Smrg        case $cc_basename in
7959b73be646Smrg          *)
7960b73be646Smrg	  # FIXME: insert proper C++ library support
7961b73be646Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7962b73be646Smrg	  ;;
7963b73be646Smrg        esac
7964b73be646Smrg        ;;
7965fc27e79cSmrg
7966b73be646Smrg      cygwin* | mingw* | pw32* | cegcc*)
7967b73be646Smrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7968b73be646Smrg        # as there is no search path for DLLs.
7969b73be646Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7970b73be646Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7971b73be646Smrg        _LT_TAGVAR(always_export_symbols, $1)=no
7972b73be646Smrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7973fc27e79cSmrg
7974b73be646Smrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7975b73be646Smrg          _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'
7976b73be646Smrg          # If the export-symbols file already is a .def file (1st line
7977b73be646Smrg          # is EXPORTS), use it as is; otherwise, prepend...
7978b73be646Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7979b73be646Smrg	    cp $export_symbols $output_objdir/$soname.def;
7980b73be646Smrg          else
7981b73be646Smrg	    echo EXPORTS > $output_objdir/$soname.def;
7982b73be646Smrg	    cat $export_symbols >> $output_objdir/$soname.def;
7983b73be646Smrg          fi~
7984b73be646Smrg          $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'
7985b73be646Smrg        else
7986b73be646Smrg          _LT_TAGVAR(ld_shlibs, $1)=no
7987b73be646Smrg        fi
7988b73be646Smrg        ;;
7989b73be646Smrg      darwin* | rhapsody*)
7990b73be646Smrg        _LT_DARWIN_LINKER_FEATURES($1)
7991b73be646Smrg	;;
7992fc27e79cSmrg
7993b73be646Smrg      dgux*)
7994b73be646Smrg        case $cc_basename in
7995b73be646Smrg          ec++*)
7996b73be646Smrg	    # FIXME: insert proper C++ library support
7997b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7998b73be646Smrg	    ;;
7999b73be646Smrg          ghcx*)
8000b73be646Smrg	    # Green Hills C++ Compiler
8001b73be646Smrg	    # FIXME: insert proper C++ library support
8002b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8003b73be646Smrg	    ;;
8004b73be646Smrg          *)
8005b73be646Smrg	    # FIXME: insert proper C++ library support
8006b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8007b73be646Smrg	    ;;
8008b73be646Smrg        esac
8009b73be646Smrg        ;;
8010fc27e79cSmrg
8011b73be646Smrg      freebsd[[12]]*)
8012b73be646Smrg        # C++ shared libraries reported to be fairly broken before
8013b73be646Smrg	# switch to ELF
8014b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
8015b73be646Smrg        ;;
8016fc27e79cSmrg
8017b73be646Smrg      freebsd-elf*)
8018b73be646Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8019b73be646Smrg        ;;
8020fc27e79cSmrg
8021b73be646Smrg      freebsd* | dragonfly*)
8022b73be646Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
8023b73be646Smrg        # conventions
8024b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
8025b73be646Smrg        ;;
8026fc27e79cSmrg
8027b73be646Smrg      gnu*)
8028b73be646Smrg        ;;
8029fc27e79cSmrg
8030b73be646Smrg      hpux9*)
8031b73be646Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8032b73be646Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8033b73be646Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8034b73be646Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
8035b73be646Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8036b73be646Smrg				             # but as the default
8037b73be646Smrg				             # location of the library.
8038fc27e79cSmrg
8039b73be646Smrg        case $cc_basename in
8040b73be646Smrg          CC*)
8041b73be646Smrg            # FIXME: insert proper C++ library support
8042b73be646Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
8043b73be646Smrg            ;;
8044b73be646Smrg          aCC*)
8045b73be646Smrg            _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'
8046b73be646Smrg            # Commands to make compiler produce verbose output that lists
8047b73be646Smrg            # what "hidden" libraries, object files and flags are used when
8048b73be646Smrg            # linking a shared library.
8049b73be646Smrg            #
8050b73be646Smrg            # There doesn't appear to be a way to prevent this compiler from
8051b73be646Smrg            # explicitly linking system object files so we need to strip them
8052b73be646Smrg            # from the output so that they don't get included in the library
8053b73be646Smrg            # dependencies.
8054b73be646Smrg            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; $ECHO "X$list" | $Xsed'
8055b73be646Smrg            ;;
8056b73be646Smrg          *)
8057b73be646Smrg            if test "$GXX" = yes; then
8058b73be646Smrg              _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'
8059b73be646Smrg            else
8060b73be646Smrg              # FIXME: insert proper C++ library support
8061b73be646Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
8062b73be646Smrg            fi
8063b73be646Smrg            ;;
8064b73be646Smrg        esac
8065b73be646Smrg        ;;
8066fc27e79cSmrg
8067b73be646Smrg      hpux10*|hpux11*)
8068b73be646Smrg        if test $with_gnu_ld = no; then
8069b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8070b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8071fc27e79cSmrg
8072b73be646Smrg          case $host_cpu in
8073b73be646Smrg            hppa*64*|ia64*)
8074b73be646Smrg              ;;
8075b73be646Smrg            *)
8076b73be646Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8077b73be646Smrg              ;;
8078b73be646Smrg          esac
8079b73be646Smrg        fi
8080b73be646Smrg        case $host_cpu in
8081b73be646Smrg          hppa*64*|ia64*)
8082b73be646Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
8083b73be646Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8084b73be646Smrg            ;;
8085b73be646Smrg          *)
8086b73be646Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
8087b73be646Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8088b73be646Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8089b73be646Smrg					         # but as the default
8090b73be646Smrg					         # location of the library.
8091b73be646Smrg            ;;
8092b73be646Smrg        esac
8093fc27e79cSmrg
8094b73be646Smrg        case $cc_basename in
8095b73be646Smrg          CC*)
8096b73be646Smrg	    # FIXME: insert proper C++ library support
8097b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8098b73be646Smrg	    ;;
8099b73be646Smrg          aCC*)
8100b73be646Smrg	    case $host_cpu in
8101b73be646Smrg	      hppa*64*)
8102b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8103b73be646Smrg	        ;;
8104b73be646Smrg	      ia64*)
8105b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8106b73be646Smrg	        ;;
8107b73be646Smrg	      *)
8108b73be646Smrg	        _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'
8109b73be646Smrg	        ;;
8110b73be646Smrg	    esac
8111b73be646Smrg	    # Commands to make compiler produce verbose output that lists
8112b73be646Smrg	    # what "hidden" libraries, object files and flags are used when
8113b73be646Smrg	    # linking a shared library.
8114b73be646Smrg	    #
8115b73be646Smrg	    # There doesn't appear to be a way to prevent this compiler from
8116b73be646Smrg	    # explicitly linking system object files so we need to strip them
8117b73be646Smrg	    # from the output so that they don't get included in the library
8118b73be646Smrg	    # dependencies.
8119b73be646Smrg	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
8120b73be646Smrg	    ;;
8121b73be646Smrg          *)
8122b73be646Smrg	    if test "$GXX" = yes; then
8123b73be646Smrg	      if test $with_gnu_ld = no; then
8124b73be646Smrg	        case $host_cpu in
8125b73be646Smrg	          hppa*64*)
8126b73be646Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8127b73be646Smrg	            ;;
8128b73be646Smrg	          ia64*)
8129b73be646Smrg	            _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'
8130b73be646Smrg	            ;;
8131b73be646Smrg	          *)
8132b73be646Smrg	            _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'
8133b73be646Smrg	            ;;
8134b73be646Smrg	        esac
8135b73be646Smrg	      fi
8136b73be646Smrg	    else
8137b73be646Smrg	      # FIXME: insert proper C++ library support
8138b73be646Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
8139b73be646Smrg	    fi
8140b73be646Smrg	    ;;
8141b73be646Smrg        esac
8142b73be646Smrg        ;;
8143fc27e79cSmrg
8144b73be646Smrg      interix[[3-9]]*)
8145b73be646Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
8146b73be646Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8147b73be646Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8148b73be646Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8149b73be646Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8150b73be646Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
8151b73be646Smrg	# default) and relocated if they conflict, which is a slow very memory
8152b73be646Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
8153b73be646Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8154b73be646Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
8155b73be646Smrg	_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'
8156b73be646Smrg	_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'
8157b73be646Smrg	;;
8158b73be646Smrg      irix5* | irix6*)
8159b73be646Smrg        case $cc_basename in
8160b73be646Smrg          CC*)
8161b73be646Smrg	    # SGI C++
8162b73be646Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8163fc27e79cSmrg
8164b73be646Smrg	    # Archives containing C++ object files must be created using
8165b73be646Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
8166b73be646Smrg	    # necessary to make sure instantiated templates are included
8167b73be646Smrg	    # in the archive.
8168b73be646Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
8169b73be646Smrg	    ;;
8170b73be646Smrg          *)
8171b73be646Smrg	    if test "$GXX" = yes; then
8172b73be646Smrg	      if test "$with_gnu_ld" = no; then
8173b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8174b73be646Smrg	      else
8175b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
8176b73be646Smrg	      fi
8177b73be646Smrg	    fi
8178b73be646Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
8179b73be646Smrg	    ;;
8180b73be646Smrg        esac
8181b73be646Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8182b73be646Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8183b73be646Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
8184b73be646Smrg        ;;
8185fc27e79cSmrg
8186b73be646Smrg      linux* | k*bsd*-gnu)
8187b73be646Smrg        case $cc_basename in
8188b73be646Smrg          KCC*)
8189b73be646Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
8190fc27e79cSmrg
8191b73be646Smrg	    # KCC will only create a shared library if the output file
8192b73be646Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
8193b73be646Smrg	    # to its proper name (with version) after linking.
8194b73be646Smrg	    _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'
8195b73be646Smrg	    _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'
8196b73be646Smrg	    # Commands to make compiler produce verbose output that lists
8197b73be646Smrg	    # what "hidden" libraries, object files and flags are used when
8198b73be646Smrg	    # linking a shared library.
8199b73be646Smrg	    #
8200b73be646Smrg	    # There doesn't appear to be a way to prevent this compiler from
8201b73be646Smrg	    # explicitly linking system object files so we need to strip them
8202b73be646Smrg	    # from the output so that they don't get included in the library
8203b73be646Smrg	    # dependencies.
8204b73be646Smrg	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
8205fc27e79cSmrg
8206b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8207b73be646Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8208fc27e79cSmrg
8209b73be646Smrg	    # Archives containing C++ object files must be created using
8210b73be646Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
8211b73be646Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
8212b73be646Smrg	    ;;
8213b73be646Smrg	  icpc* | ecpc* )
8214b73be646Smrg	    # Intel C++
8215b73be646Smrg	    with_gnu_ld=yes
8216b73be646Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
8217b73be646Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
8218b73be646Smrg	    # earlier do not add the objects themselves.
8219b73be646Smrg	    case `$CC -V 2>&1` in
8220b73be646Smrg	      *"Version 7."*)
8221b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
8222b73be646Smrg		_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'
8223b73be646Smrg		;;
8224b73be646Smrg	      *)  # Version 8.0 or newer
8225b73be646Smrg	        tmp_idyn=
8226b73be646Smrg	        case $host_cpu in
8227b73be646Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
8228b73be646Smrg		esac
8229b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8230b73be646Smrg		_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'
8231b73be646Smrg		;;
8232b73be646Smrg	    esac
8233b73be646Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8234b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8235b73be646Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8236b73be646Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
8237b73be646Smrg	    ;;
8238b73be646Smrg          pgCC* | pgcpp*)
8239b73be646Smrg            # Portland Group C++ compiler
8240b73be646Smrg	    case `$CC -V` in
8241b73be646Smrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
8242b73be646Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
8243b73be646Smrg		rm -rf $tpldir~
8244b73be646Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
8245b73be646Smrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
8246b73be646Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
8247b73be646Smrg		rm -rf $tpldir~
8248b73be646Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
8249b73be646Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
8250b73be646Smrg		$RANLIB $oldlib'
8251b73be646Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
8252b73be646Smrg		rm -rf $tpldir~
8253b73be646Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
8254b73be646Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
8255b73be646Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
8256b73be646Smrg		rm -rf $tpldir~
8257b73be646Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
8258b73be646Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
8259b73be646Smrg	      ;;
8260b73be646Smrg	    *) # Version 6 will use weak symbols
8261b73be646Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
8262b73be646Smrg	      _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'
8263b73be646Smrg	      ;;
8264b73be646Smrg	    esac
8265fc27e79cSmrg
8266b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
8267b73be646Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8268b73be646Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8269b73be646Smrg            ;;
8270b73be646Smrg	  cxx*)
8271b73be646Smrg	    # Compaq C++
8272b73be646Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
8273b73be646Smrg	    _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'
8274fc27e79cSmrg
8275b73be646Smrg	    runpath_var=LD_RUN_PATH
8276b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8277b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8278fc27e79cSmrg
8279b73be646Smrg	    # Commands to make compiler produce verbose output that lists
8280b73be646Smrg	    # what "hidden" libraries, object files and flags are used when
8281b73be646Smrg	    # linking a shared library.
8282b73be646Smrg	    #
8283b73be646Smrg	    # There doesn't appear to be a way to prevent this compiler from
8284b73be646Smrg	    # explicitly linking system object files so we need to strip them
8285b73be646Smrg	    # from the output so that they don't get included in the library
8286b73be646Smrg	    # dependencies.
8287b73be646Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
8288b73be646Smrg	    ;;
8289b73be646Smrg	  xl*)
8290b73be646Smrg	    # IBM XL 8.0 on PPC, with GNU ld
8291b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8292b73be646Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8293b73be646Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8294b73be646Smrg	    if test "x$supports_anon_versioning" = xyes; then
8295b73be646Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8296b73be646Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8297b73be646Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
8298b73be646Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8299b73be646Smrg	    fi
8300b73be646Smrg	    ;;
8301b73be646Smrg	  *)
8302b73be646Smrg	    case `$CC -V 2>&1 | sed 5q` in
8303b73be646Smrg	    *Sun\ C*)
8304b73be646Smrg	      # Sun C++ 5.9
8305b73be646Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
8306b73be646Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8307b73be646Smrg	      _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'
8308b73be646Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8309b73be646Smrg	      _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8310b73be646Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
8311fc27e79cSmrg
8312b73be646Smrg	      # Not sure whether something based on
8313b73be646Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
8314b73be646Smrg	      # would be better.
8315b73be646Smrg	      output_verbose_link_cmd='echo'
8316fc27e79cSmrg
8317b73be646Smrg	      # Archives containing C++ object files must be created using
8318b73be646Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
8319b73be646Smrg	      # necessary to make sure instantiated templates are included
8320b73be646Smrg	      # in the archive.
8321b73be646Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
8322b73be646Smrg	      ;;
8323b73be646Smrg	    esac
8324b73be646Smrg	    ;;
8325b73be646Smrg	esac
8326b73be646Smrg	;;
8327fc27e79cSmrg
8328b73be646Smrg      lynxos*)
8329b73be646Smrg        # FIXME: insert proper C++ library support
8330b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8331b73be646Smrg	;;
8332fc27e79cSmrg
8333b73be646Smrg      m88k*)
8334b73be646Smrg        # FIXME: insert proper C++ library support
8335b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
8336b73be646Smrg	;;
8337fc27e79cSmrg
8338b73be646Smrg      mvs*)
8339b73be646Smrg        case $cc_basename in
8340b73be646Smrg          cxx*)
8341b73be646Smrg	    # FIXME: insert proper C++ library support
8342b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8343b73be646Smrg	    ;;
8344b73be646Smrg	  *)
8345b73be646Smrg	    # FIXME: insert proper C++ library support
8346b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8347b73be646Smrg	    ;;
8348b73be646Smrg	esac
8349b73be646Smrg	;;
8350fc27e79cSmrg
8351b73be646Smrg      netbsd*)
8352b73be646Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8353b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
8354b73be646Smrg	  wlarc=
8355b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8356b73be646Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
8357b73be646Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8358b73be646Smrg	fi
8359b73be646Smrg	# Workaround some broken pre-1.5 toolchains
8360b73be646Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
8361b73be646Smrg	;;
8362fc27e79cSmrg
8363b73be646Smrg      *nto* | *qnx*)
8364b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
8365b73be646Smrg	;;
8366b73be646Smrg
8367b73be646Smrg      openbsd2*)
8368b73be646Smrg        # C++ shared libraries are fairly broken
8369b73be646Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
8370b73be646Smrg	;;
8371b73be646Smrg
8372b73be646Smrg      openbsd*)
8373b73be646Smrg	if test -f /usr/libexec/ld.so; then
8374b73be646Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
8375b73be646Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8376b73be646Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8377b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
8378b73be646Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8379b73be646Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8380b73be646Smrg	    _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'
8381b73be646Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8382b73be646Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8383b73be646Smrg	  fi
8384b73be646Smrg	  output_verbose_link_cmd=echo
8385b73be646Smrg	else
8386b73be646Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
8387fc27e79cSmrg	fi
8388b73be646Smrg	;;
8389fc27e79cSmrg
8390b73be646Smrg      osf3* | osf4* | osf5*)
8391b73be646Smrg        case $cc_basename in
8392b73be646Smrg          KCC*)
8393b73be646Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
8394fc27e79cSmrg
8395b73be646Smrg	    # KCC will only create a shared library if the output file
8396b73be646Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
8397b73be646Smrg	    # to its proper name (with version) after linking.
8398b73be646Smrg	    _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'
8399fc27e79cSmrg
8400b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8401b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8402fc27e79cSmrg
8403b73be646Smrg	    # Archives containing C++ object files must be created using
8404b73be646Smrg	    # the KAI C++ compiler.
8405b73be646Smrg	    case $host in
8406b73be646Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
8407b73be646Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
8408b73be646Smrg	    esac
8409b73be646Smrg	    ;;
8410b73be646Smrg          RCC*)
8411b73be646Smrg	    # Rational C++ 2.4.1
8412b73be646Smrg	    # FIXME: insert proper C++ library support
8413b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8414b73be646Smrg	    ;;
8415b73be646Smrg          cxx*)
8416b73be646Smrg	    case $host in
8417b73be646Smrg	      osf3*)
8418b73be646Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8419b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8420b73be646Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8421b73be646Smrg		;;
8422b73be646Smrg	      *)
8423b73be646Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8424b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8425b73be646Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
8426b73be646Smrg	          echo "-hidden">> $lib.exp~
8427b73be646Smrg	          $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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
8428b73be646Smrg	          $RM $lib.exp'
8429b73be646Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8430b73be646Smrg		;;
8431b73be646Smrg	    esac
8432fc27e79cSmrg
8433b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8434fc27e79cSmrg
8435b73be646Smrg	    # Commands to make compiler produce verbose output that lists
8436b73be646Smrg	    # what "hidden" libraries, object files and flags are used when
8437b73be646Smrg	    # linking a shared library.
8438b73be646Smrg	    #
8439b73be646Smrg	    # There doesn't appear to be a way to prevent this compiler from
8440b73be646Smrg	    # explicitly linking system object files so we need to strip them
8441b73be646Smrg	    # from the output so that they don't get included in the library
8442b73be646Smrg	    # dependencies.
8443b73be646Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
8444b73be646Smrg	    ;;
8445b73be646Smrg	  *)
8446b73be646Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8447b73be646Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8448b73be646Smrg	      case $host in
8449b73be646Smrg	        osf3*)
8450b73be646Smrg	          _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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8451b73be646Smrg		  ;;
8452b73be646Smrg	        *)
8453b73be646Smrg	          _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" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8454b73be646Smrg		  ;;
8455b73be646Smrg	      esac
8456fc27e79cSmrg
8457b73be646Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8458b73be646Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
8459fc27e79cSmrg
8460b73be646Smrg	      # Commands to make compiler produce verbose output that lists
8461b73be646Smrg	      # what "hidden" libraries, object files and flags are used when
8462b73be646Smrg	      # linking a shared library.
8463b73be646Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
8464fc27e79cSmrg
8465b73be646Smrg	    else
8466b73be646Smrg	      # FIXME: insert proper C++ library support
8467b73be646Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
8468b73be646Smrg	    fi
8469b73be646Smrg	    ;;
8470b73be646Smrg        esac
8471b73be646Smrg        ;;
8472fc27e79cSmrg
8473b73be646Smrg      psos*)
8474b73be646Smrg        # FIXME: insert proper C++ library support
8475b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
8476b73be646Smrg        ;;
8477fc27e79cSmrg
8478b73be646Smrg      sunos4*)
8479b73be646Smrg        case $cc_basename in
8480b73be646Smrg          CC*)
8481b73be646Smrg	    # Sun C++ 4.x
8482b73be646Smrg	    # FIXME: insert proper C++ library support
8483b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8484b73be646Smrg	    ;;
8485b73be646Smrg          lcc*)
8486b73be646Smrg	    # Lucid
8487b73be646Smrg	    # FIXME: insert proper C++ library support
8488b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8489b73be646Smrg	    ;;
8490b73be646Smrg          *)
8491b73be646Smrg	    # FIXME: insert proper C++ library support
8492b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8493b73be646Smrg	    ;;
8494b73be646Smrg        esac
8495b73be646Smrg        ;;
8496fc27e79cSmrg
8497b73be646Smrg      solaris*)
8498b73be646Smrg        case $cc_basename in
8499b73be646Smrg          CC*)
8500b73be646Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
8501b73be646Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
8502b73be646Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
8503b73be646Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8504b73be646Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8505b73be646Smrg	      $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'
8506fc27e79cSmrg
8507b73be646Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8508b73be646Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8509b73be646Smrg	    case $host_os in
8510b73be646Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
8511b73be646Smrg	      *)
8512b73be646Smrg		# The compiler driver will combine and reorder linker options,
8513b73be646Smrg		# but understands `-z linker_flag'.
8514b73be646Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
8515b73be646Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
8516b73be646Smrg	        ;;
8517b73be646Smrg	    esac
8518b73be646Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
8519fc27e79cSmrg
8520b73be646Smrg	    output_verbose_link_cmd='echo'
8521fc27e79cSmrg
8522b73be646Smrg	    # Archives containing C++ object files must be created using
8523b73be646Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
8524b73be646Smrg	    # necessary to make sure instantiated templates are included
8525b73be646Smrg	    # in the archive.
8526b73be646Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
8527b73be646Smrg	    ;;
8528b73be646Smrg          gcx*)
8529b73be646Smrg	    # Green Hills C++ Compiler
8530b73be646Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
8531fc27e79cSmrg
8532b73be646Smrg	    # The C++ compiler must be used to create the archive.
8533b73be646Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
8534b73be646Smrg	    ;;
8535b73be646Smrg          *)
8536b73be646Smrg	    # GNU C++ compiler with Solaris linker
8537b73be646Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8538b73be646Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
8539b73be646Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
8540b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
8541b73be646Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8542b73be646Smrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
8543fc27e79cSmrg
8544b73be646Smrg	        # Commands to make compiler produce verbose output that lists
8545b73be646Smrg	        # what "hidden" libraries, object files and flags are used when
8546b73be646Smrg	        # linking a shared library.
8547b73be646Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
8548b73be646Smrg	      else
8549b73be646Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
8550b73be646Smrg	        # platform.
8551b73be646Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
8552b73be646Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8553b73be646Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
8554fc27e79cSmrg
8555b73be646Smrg	        # Commands to make compiler produce verbose output that lists
8556b73be646Smrg	        # what "hidden" libraries, object files and flags are used when
8557b73be646Smrg	        # linking a shared library.
8558b73be646Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
8559b73be646Smrg	      fi
8560fc27e79cSmrg
8561b73be646Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
8562b73be646Smrg	      case $host_os in
8563b73be646Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
8564b73be646Smrg		*)
8565b73be646Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
8566b73be646Smrg		  ;;
8567b73be646Smrg	      esac
8568b73be646Smrg	    fi
8569b73be646Smrg	    ;;
8570b73be646Smrg        esac
8571b73be646Smrg        ;;
8572fc27e79cSmrg
8573b73be646Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
8574b73be646Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
8575b73be646Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8576b73be646Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8577b73be646Smrg      runpath_var='LD_RUN_PATH'
8578fc27e79cSmrg
8579b73be646Smrg      case $cc_basename in
8580b73be646Smrg        CC*)
8581b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8582b73be646Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8583b73be646Smrg	  ;;
8584b73be646Smrg	*)
8585b73be646Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8586b73be646Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8587b73be646Smrg	  ;;
8588b73be646Smrg      esac
8589b73be646Smrg      ;;
8590fc27e79cSmrg
8591b73be646Smrg      sysv5* | sco3.2v5* | sco5v6*)
8592b73be646Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
8593b73be646Smrg	# link with -lc, and that would cause any symbols used from libc to
8594b73be646Smrg	# always be unresolved, which means just about no library would
8595b73be646Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
8596b73be646Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
8597b73be646Smrg	# as -z defs.
8598b73be646Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
8599b73be646Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
8600b73be646Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8601b73be646Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8602b73be646Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
8603b73be646Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
8604b73be646Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
8605b73be646Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
8606b73be646Smrg	runpath_var='LD_RUN_PATH'
8607fc27e79cSmrg
8608b73be646Smrg	case $cc_basename in
8609b73be646Smrg          CC*)
8610b73be646Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8611b73be646Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8612b73be646Smrg	    ;;
8613b73be646Smrg	  *)
8614b73be646Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8615b73be646Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8616b73be646Smrg	    ;;
8617b73be646Smrg	esac
8618b73be646Smrg      ;;
8619fc27e79cSmrg
8620b73be646Smrg      tandem*)
8621b73be646Smrg        case $cc_basename in
8622b73be646Smrg          NCC*)
8623b73be646Smrg	    # NonStop-UX NCC 3.20
8624b73be646Smrg	    # FIXME: insert proper C++ library support
8625b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8626b73be646Smrg	    ;;
8627b73be646Smrg          *)
8628b73be646Smrg	    # FIXME: insert proper C++ library support
8629b73be646Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8630b73be646Smrg	    ;;
8631b73be646Smrg        esac
8632b73be646Smrg        ;;
8633fc27e79cSmrg
8634b73be646Smrg      vxworks*)
8635b73be646Smrg        # FIXME: insert proper C++ library support
8636b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
8637b73be646Smrg        ;;
8638fc27e79cSmrg
8639b73be646Smrg      *)
8640b73be646Smrg        # FIXME: insert proper C++ library support
8641b73be646Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
8642b73be646Smrg        ;;
8643b73be646Smrg    esac
8644fc27e79cSmrg
8645b73be646Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
8646b73be646Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
8647fc27e79cSmrg
8648b73be646Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
8649b73be646Smrg    _LT_TAGVAR(LD, $1)="$LD"
8650fc27e79cSmrg
8651b73be646Smrg    ## CAVEAT EMPTOR:
8652b73be646Smrg    ## There is no encapsulation within the following macros, do not change
8653b73be646Smrg    ## the running order or otherwise move them around unless you know exactly
8654b73be646Smrg    ## what you are doing...
8655b73be646Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
8656b73be646Smrg    _LT_COMPILER_PIC($1)
8657b73be646Smrg    _LT_COMPILER_C_O($1)
8658b73be646Smrg    _LT_COMPILER_FILE_LOCKS($1)
8659b73be646Smrg    _LT_LINKER_SHLIBS($1)
8660b73be646Smrg    _LT_SYS_DYNAMIC_LINKER($1)
8661b73be646Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8662fc27e79cSmrg
8663b73be646Smrg    _LT_CONFIG($1)
8664b73be646Smrg  fi # test -n "$compiler"
8665fc27e79cSmrg
8666b73be646Smrg  CC=$lt_save_CC
8667b73be646Smrg  LDCXX=$LD
8668b73be646Smrg  LD=$lt_save_LD
8669b73be646Smrg  GCC=$lt_save_GCC
8670b73be646Smrg  with_gnu_ld=$lt_save_with_gnu_ld
8671b73be646Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
8672b73be646Smrg  lt_cv_path_LD=$lt_save_path_LD
8673b73be646Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
8674b73be646Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
8675b73be646Smrgfi # test "$_lt_caught_CXX_error" != yes
8676fc27e79cSmrg
8677b73be646SmrgAC_LANG_POP
8678b73be646Smrg])# _LT_LANG_CXX_CONFIG
8679fc27e79cSmrg
8680fc27e79cSmrg
8681b73be646Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
8682b73be646Smrg# ---------------------------------
8683b73be646Smrg# Figure out "hidden" library dependencies from verbose
8684b73be646Smrg# compiler output when linking a shared library.
8685b73be646Smrg# Parse the compiler output and extract the necessary
8686b73be646Smrg# objects, libraries and library flags.
8687b73be646Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
8688b73be646Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
8689b73be646Smrg# Dependencies to place before and after the object being linked:
8690b73be646Smrg_LT_TAGVAR(predep_objects, $1)=
8691b73be646Smrg_LT_TAGVAR(postdep_objects, $1)=
8692b73be646Smrg_LT_TAGVAR(predeps, $1)=
8693b73be646Smrg_LT_TAGVAR(postdeps, $1)=
8694b73be646Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
8695fc27e79cSmrg
8696b73be646Smrgdnl we can't use the lt_simple_compile_test_code here,
8697b73be646Smrgdnl because it contains code intended for an executable,
8698b73be646Smrgdnl not a library.  It's possible we should let each
8699b73be646Smrgdnl tag define a new lt_????_link_test_code variable,
8700b73be646Smrgdnl but it's only used here...
8701b73be646Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
8702b73be646Smrgint a;
8703b73be646Smrgvoid foo (void) { a = 0; }
8704b73be646Smrg_LT_EOF
8705b73be646Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
8706b73be646Smrgclass Foo
8707b73be646Smrg{
8708b73be646Smrgpublic:
8709b73be646Smrg  Foo (void) { a = 0; }
8710b73be646Smrgprivate:
8711b73be646Smrg  int a;
8712b73be646Smrg};
8713b73be646Smrg_LT_EOF
8714b73be646Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
8715b73be646Smrg      subroutine foo
8716b73be646Smrg      implicit none
8717b73be646Smrg      integer*4 a
8718b73be646Smrg      a=0
8719b73be646Smrg      return
8720b73be646Smrg      end
8721b73be646Smrg_LT_EOF
8722b73be646Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
8723b73be646Smrg      subroutine foo
8724b73be646Smrg      implicit none
8725b73be646Smrg      integer a
8726b73be646Smrg      a=0
8727b73be646Smrg      return
8728b73be646Smrg      end
8729b73be646Smrg_LT_EOF
8730b73be646Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
8731b73be646Smrgpublic class foo {
8732b73be646Smrg  private int a;
8733b73be646Smrg  public void bar (void) {
8734b73be646Smrg    a = 0;
8735b73be646Smrg  }
8736b73be646Smrg};
8737b73be646Smrg_LT_EOF
8738b73be646Smrg])
8739b73be646Smrgdnl Parse the compiler output and extract the necessary
8740b73be646Smrgdnl objects, libraries and library flags.
8741b73be646Smrgif AC_TRY_EVAL(ac_compile); then
8742b73be646Smrg  # Parse the compiler output and extract the necessary
8743b73be646Smrg  # objects, libraries and library flags.
8744fc27e79cSmrg
8745b73be646Smrg  # Sentinel used to keep track of whether or not we are before
8746b73be646Smrg  # the conftest object file.
8747b73be646Smrg  pre_test_object_deps_done=no
8748fc27e79cSmrg
8749b73be646Smrg  for p in `eval "$output_verbose_link_cmd"`; do
8750b73be646Smrg    case $p in
8751fc27e79cSmrg
8752b73be646Smrg    -L* | -R* | -l*)
8753b73be646Smrg       # Some compilers place space between "-{L,R}" and the path.
8754b73be646Smrg       # Remove the space.
8755b73be646Smrg       if test $p = "-L" ||
8756b73be646Smrg          test $p = "-R"; then
8757b73be646Smrg	 prev=$p
8758b73be646Smrg	 continue
8759b73be646Smrg       else
8760b73be646Smrg	 prev=
8761b73be646Smrg       fi
8762b73be646Smrg
8763b73be646Smrg       if test "$pre_test_object_deps_done" = no; then
8764b73be646Smrg	 case $p in
8765b73be646Smrg	 -L* | -R*)
8766b73be646Smrg	   # Internal compiler library paths should come after those
8767b73be646Smrg	   # provided the user.  The postdeps already come after the
8768b73be646Smrg	   # user supplied libs so there is no need to process them.
8769b73be646Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8770b73be646Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8771b73be646Smrg	   else
8772b73be646Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8773b73be646Smrg	   fi
8774b73be646Smrg	   ;;
8775b73be646Smrg	 # The "-l" case would never come before the object being
8776b73be646Smrg	 # linked, so don't bother handling this case.
8777b73be646Smrg	 esac
8778b73be646Smrg       else
8779b73be646Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8780b73be646Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8781b73be646Smrg	 else
8782b73be646Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8783b73be646Smrg	 fi
8784b73be646Smrg       fi
8785b73be646Smrg       ;;
8786fc27e79cSmrg
8787b73be646Smrg    *.$objext)
8788b73be646Smrg       # This assumes that the test object file only shows up
8789b73be646Smrg       # once in the compiler output.
8790b73be646Smrg       if test "$p" = "conftest.$objext"; then
8791b73be646Smrg	 pre_test_object_deps_done=yes
8792b73be646Smrg	 continue
8793b73be646Smrg       fi
8794fc27e79cSmrg
8795b73be646Smrg       if test "$pre_test_object_deps_done" = no; then
8796b73be646Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8797b73be646Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
8798b73be646Smrg	 else
8799b73be646Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8800b73be646Smrg	 fi
8801b73be646Smrg       else
8802b73be646Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8803b73be646Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
8804b73be646Smrg	 else
8805b73be646Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8806b73be646Smrg	 fi
8807b73be646Smrg       fi
8808b73be646Smrg       ;;
8809fc27e79cSmrg
8810b73be646Smrg    *) ;; # Ignore the rest.
8811fc27e79cSmrg
8812b73be646Smrg    esac
8813b73be646Smrg  done
8814fc27e79cSmrg
8815b73be646Smrg  # Clean up.
8816b73be646Smrg  rm -f a.out a.exe
8817b73be646Smrgelse
8818b73be646Smrg  echo "libtool.m4: error: problem compiling $1 test program"
8819b73be646Smrgfi
8820fc27e79cSmrg
8821b73be646Smrg$RM -f confest.$objext
8822fc27e79cSmrg
8823b73be646Smrg# PORTME: override above test on systems where it is broken
8824b73be646Smrgm4_if([$1], [CXX],
8825b73be646Smrg[case $host_os in
8826b73be646Smrginterix[[3-9]]*)
8827b73be646Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8828b73be646Smrg  # hack all around it, let's just trust "g++" to DTRT.
8829b73be646Smrg  _LT_TAGVAR(predep_objects,$1)=
8830b73be646Smrg  _LT_TAGVAR(postdep_objects,$1)=
8831b73be646Smrg  _LT_TAGVAR(postdeps,$1)=
8832b73be646Smrg  ;;
8833fc27e79cSmrg
8834b73be646Smrglinux*)
8835b73be646Smrg  case `$CC -V 2>&1 | sed 5q` in
8836b73be646Smrg  *Sun\ C*)
8837b73be646Smrg    # Sun C++ 5.9
8838fc27e79cSmrg
8839b73be646Smrg    # The more standards-conforming stlport4 library is
8840b73be646Smrg    # incompatible with the Cstd library. Avoid specifying
8841b73be646Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
8842b73be646Smrg    # -library=stlport4 depends on it.
8843b73be646Smrg    case " $CXX $CXXFLAGS " in
8844b73be646Smrg    *" -library=stlport4 "*)
8845b73be646Smrg      solaris_use_stlport4=yes
8846b73be646Smrg      ;;
8847b73be646Smrg    esac
8848fc27e79cSmrg
8849b73be646Smrg    if test "$solaris_use_stlport4" != yes; then
8850b73be646Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8851b73be646Smrg    fi
8852b73be646Smrg    ;;
8853b73be646Smrg  esac
8854b73be646Smrg  ;;
8855fc27e79cSmrg
8856b73be646Smrgsolaris*)
8857b73be646Smrg  case $cc_basename in
8858b73be646Smrg  CC*)
8859b73be646Smrg    # The more standards-conforming stlport4 library is
8860b73be646Smrg    # incompatible with the Cstd library. Avoid specifying
8861b73be646Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
8862b73be646Smrg    # -library=stlport4 depends on it.
8863b73be646Smrg    case " $CXX $CXXFLAGS " in
8864b73be646Smrg    *" -library=stlport4 "*)
8865b73be646Smrg      solaris_use_stlport4=yes
8866b73be646Smrg      ;;
8867b73be646Smrg    esac
8868fc27e79cSmrg
8869b73be646Smrg    # Adding this requires a known-good setup of shared libraries for
8870b73be646Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
8871b73be646Smrg    # archive will be linked into the output, leading to subtle bugs.
8872b73be646Smrg    if test "$solaris_use_stlport4" != yes; then
8873b73be646Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8874b73be646Smrg    fi
8875b73be646Smrg    ;;
8876b73be646Smrg  esac
8877b73be646Smrg  ;;
8878b73be646Smrgesac
8879b73be646Smrg])
8880fc27e79cSmrg
8881b73be646Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
8882b73be646Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8883b73be646Smrgesac
8884b73be646Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8885b73be646Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8886b73be646Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8887b73be646Smrgfi
8888b73be646Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8889b73be646Smrg    [The directories searched by this compiler when creating a shared library])
8890b73be646Smrg_LT_TAGDECL([], [predep_objects], [1],
8891b73be646Smrg    [Dependencies to place before and after the objects being linked to
8892b73be646Smrg    create a shared library])
8893b73be646Smrg_LT_TAGDECL([], [postdep_objects], [1])
8894b73be646Smrg_LT_TAGDECL([], [predeps], [1])
8895b73be646Smrg_LT_TAGDECL([], [postdeps], [1])
8896b73be646Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
8897b73be646Smrg    [The library search path used internally by the compiler when linking
8898b73be646Smrg    a shared library])
8899b73be646Smrg])# _LT_SYS_HIDDEN_LIBDEPS
8900fc27e79cSmrg
8901fc27e79cSmrg
8902b73be646Smrg# _LT_PROG_F77
8903b73be646Smrg# ------------
8904b73be646Smrg# Since AC_PROG_F77 is broken, in that it returns the empty string
8905b73be646Smrg# if there is no fortran compiler, we have our own version here.
8906b73be646Smrgm4_defun([_LT_PROG_F77],
8907b73be646Smrg[
8908b73be646Smrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
8909b73be646SmrgAC_PROG_F77
8910b73be646Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
8911b73be646Smrg  _lt_disable_F77=yes
8912b73be646Smrgfi
8913b73be646Smrgpopdef([AC_MSG_ERROR])
8914b73be646Smrg])# _LT_PROG_F77
8915fc27e79cSmrg
8916b73be646Smrgdnl aclocal-1.4 backwards compatibility:
8917b73be646Smrgdnl AC_DEFUN([_LT_PROG_F77], [])
8918fc27e79cSmrg
8919fc27e79cSmrg
8920b73be646Smrg# _LT_LANG_F77_CONFIG([TAG])
8921b73be646Smrg# --------------------------
8922b73be646Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
8923b73be646Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
8924b73be646Smrg# to write the compiler configuration to `libtool'.
8925b73be646Smrgm4_defun([_LT_LANG_F77_CONFIG],
8926b73be646Smrg[AC_REQUIRE([_LT_PROG_F77])dnl
8927b73be646SmrgAC_LANG_PUSH(Fortran 77)
8928fc27e79cSmrg
8929b73be646Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8930b73be646Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
8931b73be646Smrg_LT_TAGVAR(always_export_symbols, $1)=no
8932b73be646Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8933b73be646Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8934b73be646Smrg_LT_TAGVAR(hardcode_direct, $1)=no
8935b73be646Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8936b73be646Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8937b73be646Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8938b73be646Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8939b73be646Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8940b73be646Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
8941b73be646Smrg_LT_TAGVAR(inherit_rpath, $1)=no
8942b73be646Smrg_LT_TAGVAR(module_cmds, $1)=
8943b73be646Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
8944b73be646Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8945b73be646Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8946b73be646Smrg_LT_TAGVAR(no_undefined_flag, $1)=
8947b73be646Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8948b73be646Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8949fc27e79cSmrg
8950b73be646Smrg# Source file extension for f77 test sources.
8951b73be646Smrgac_ext=f
8952fc27e79cSmrg
8953b73be646Smrg# Object file extension for compiled f77 test sources.
8954b73be646Smrgobjext=o
8955b73be646Smrg_LT_TAGVAR(objext, $1)=$objext
8956fc27e79cSmrg
8957b73be646Smrg# No sense in running all these tests if we already determined that
8958b73be646Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
8959b73be646Smrg# are currently assumed to apply to all compilers on this platform,
8960b73be646Smrg# and will be corrupted by setting them based on a non-working compiler.
8961b73be646Smrgif test "$_lt_disable_F77" != yes; then
8962b73be646Smrg  # Code to be used in simple compile tests
8963b73be646Smrg  lt_simple_compile_test_code="\
8964b73be646Smrg      subroutine t
8965b73be646Smrg      return
8966b73be646Smrg      end
8967b73be646Smrg"
8968fc27e79cSmrg
8969b73be646Smrg  # Code to be used in simple link tests
8970b73be646Smrg  lt_simple_link_test_code="\
8971b73be646Smrg      program t
8972b73be646Smrg      end
8973b73be646Smrg"
8974fc27e79cSmrg
8975b73be646Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8976b73be646Smrg  _LT_TAG_COMPILER
8977fc27e79cSmrg
8978b73be646Smrg  # save warnings/boilerplate of simple test code
8979b73be646Smrg  _LT_COMPILER_BOILERPLATE
8980b73be646Smrg  _LT_LINKER_BOILERPLATE
8981fc27e79cSmrg
8982b73be646Smrg  # Allow CC to be a program name with arguments.
8983b73be646Smrg  lt_save_CC="$CC"
8984b73be646Smrg  lt_save_GCC=$GCC
8985b73be646Smrg  CC=${F77-"f77"}
8986b73be646Smrg  compiler=$CC
8987b73be646Smrg  _LT_TAGVAR(compiler, $1)=$CC
8988b73be646Smrg  _LT_CC_BASENAME([$compiler])
8989b73be646Smrg  GCC=$G77
8990b73be646Smrg  if test -n "$compiler"; then
8991b73be646Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8992b73be646Smrg    AC_MSG_RESULT([$can_build_shared])
8993fc27e79cSmrg
8994b73be646Smrg    AC_MSG_CHECKING([whether to build shared libraries])
8995b73be646Smrg    test "$can_build_shared" = "no" && enable_shared=no
8996fc27e79cSmrg
8997b73be646Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
8998b73be646Smrg    # are all built from PIC.
8999b73be646Smrg    case $host_os in
9000b73be646Smrg      aix3*)
9001b73be646Smrg        test "$enable_shared" = yes && enable_static=no
9002b73be646Smrg        if test -n "$RANLIB"; then
9003b73be646Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
9004b73be646Smrg          postinstall_cmds='$RANLIB $lib'
9005b73be646Smrg        fi
9006b73be646Smrg        ;;
9007b73be646Smrg      aix[[4-9]]*)
9008b73be646Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
9009b73be646Smrg	  test "$enable_shared" = yes && enable_static=no
9010b73be646Smrg	fi
9011b73be646Smrg        ;;
9012b73be646Smrg    esac
9013b73be646Smrg    AC_MSG_RESULT([$enable_shared])
9014fc27e79cSmrg
9015b73be646Smrg    AC_MSG_CHECKING([whether to build static libraries])
9016b73be646Smrg    # Make sure either enable_shared or enable_static is yes.
9017b73be646Smrg    test "$enable_shared" = yes || enable_static=yes
9018b73be646Smrg    AC_MSG_RESULT([$enable_static])
9019fc27e79cSmrg
9020b73be646Smrg    _LT_TAGVAR(GCC, $1)="$G77"
9021b73be646Smrg    _LT_TAGVAR(LD, $1)="$LD"
9022fc27e79cSmrg
9023b73be646Smrg    ## CAVEAT EMPTOR:
9024b73be646Smrg    ## There is no encapsulation within the following macros, do not change
9025b73be646Smrg    ## the running order or otherwise move them around unless you know exactly
9026b73be646Smrg    ## what you are doing...
9027b73be646Smrg    _LT_COMPILER_PIC($1)
9028b73be646Smrg    _LT_COMPILER_C_O($1)
9029b73be646Smrg    _LT_COMPILER_FILE_LOCKS($1)
9030b73be646Smrg    _LT_LINKER_SHLIBS($1)
9031b73be646Smrg    _LT_SYS_DYNAMIC_LINKER($1)
9032b73be646Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
9033b73be646Smrg
9034b73be646Smrg    _LT_CONFIG($1)
9035b73be646Smrg  fi # test -n "$compiler"
9036b73be646Smrg
9037b73be646Smrg  GCC=$lt_save_GCC
9038b73be646Smrg  CC="$lt_save_CC"
9039b73be646Smrgfi # test "$_lt_disable_F77" != yes
9040b73be646Smrg
9041b73be646SmrgAC_LANG_POP
9042b73be646Smrg])# _LT_LANG_F77_CONFIG
9043b73be646Smrg
9044b73be646Smrg
9045b73be646Smrg# _LT_PROG_FC
9046b73be646Smrg# -----------
9047b73be646Smrg# Since AC_PROG_FC is broken, in that it returns the empty string
9048b73be646Smrg# if there is no fortran compiler, we have our own version here.
9049b73be646Smrgm4_defun([_LT_PROG_FC],
9050b73be646Smrg[
9051b73be646Smrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
9052b73be646SmrgAC_PROG_FC
9053b73be646Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
9054b73be646Smrg  _lt_disable_FC=yes
9055fc27e79cSmrgfi
9056b73be646Smrgpopdef([AC_MSG_ERROR])
9057b73be646Smrg])# _LT_PROG_FC
9058fc27e79cSmrg
9059b73be646Smrgdnl aclocal-1.4 backwards compatibility:
9060b73be646Smrgdnl AC_DEFUN([_LT_PROG_FC], [])
9061fc27e79cSmrg
9062fc27e79cSmrg
9063b73be646Smrg# _LT_LANG_FC_CONFIG([TAG])
9064b73be646Smrg# -------------------------
9065b73be646Smrg# Ensure that the configuration variables for a Fortran compiler are
9066b73be646Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
9067b73be646Smrg# to write the compiler configuration to `libtool'.
9068b73be646Smrgm4_defun([_LT_LANG_FC_CONFIG],
9069b73be646Smrg[AC_REQUIRE([_LT_PROG_FC])dnl
9070b73be646SmrgAC_LANG_PUSH(Fortran)
9071fc27e79cSmrg
9072b73be646Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9073b73be646Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
9074b73be646Smrg_LT_TAGVAR(always_export_symbols, $1)=no
9075b73be646Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
9076b73be646Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
9077b73be646Smrg_LT_TAGVAR(hardcode_direct, $1)=no
9078b73be646Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
9079b73be646Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9080b73be646Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
9081b73be646Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
9082b73be646Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
9083b73be646Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
9084b73be646Smrg_LT_TAGVAR(inherit_rpath, $1)=no
9085b73be646Smrg_LT_TAGVAR(module_cmds, $1)=
9086b73be646Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
9087b73be646Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
9088b73be646Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9089b73be646Smrg_LT_TAGVAR(no_undefined_flag, $1)=
9090b73be646Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
9091b73be646Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9092fc27e79cSmrg
9093b73be646Smrg# Source file extension for fc test sources.
9094b73be646Smrgac_ext=${ac_fc_srcext-f}
9095fc27e79cSmrg
9096b73be646Smrg# Object file extension for compiled fc test sources.
9097b73be646Smrgobjext=o
9098b73be646Smrg_LT_TAGVAR(objext, $1)=$objext
9099fc27e79cSmrg
9100b73be646Smrg# No sense in running all these tests if we already determined that
9101b73be646Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
9102b73be646Smrg# are currently assumed to apply to all compilers on this platform,
9103b73be646Smrg# and will be corrupted by setting them based on a non-working compiler.
9104b73be646Smrgif test "$_lt_disable_FC" != yes; then
9105b73be646Smrg  # Code to be used in simple compile tests
9106b73be646Smrg  lt_simple_compile_test_code="\
9107b73be646Smrg      subroutine t
9108b73be646Smrg      return
9109b73be646Smrg      end
9110b73be646Smrg"
9111fc27e79cSmrg
9112b73be646Smrg  # Code to be used in simple link tests
9113b73be646Smrg  lt_simple_link_test_code="\
9114b73be646Smrg      program t
9115b73be646Smrg      end
9116b73be646Smrg"
9117fc27e79cSmrg
9118b73be646Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9119b73be646Smrg  _LT_TAG_COMPILER
9120fc27e79cSmrg
9121b73be646Smrg  # save warnings/boilerplate of simple test code
9122b73be646Smrg  _LT_COMPILER_BOILERPLATE
9123b73be646Smrg  _LT_LINKER_BOILERPLATE
9124fc27e79cSmrg
9125b73be646Smrg  # Allow CC to be a program name with arguments.
9126b73be646Smrg  lt_save_CC="$CC"
9127b73be646Smrg  lt_save_GCC=$GCC
9128b73be646Smrg  CC=${FC-"f95"}
9129b73be646Smrg  compiler=$CC
9130b73be646Smrg  GCC=$ac_cv_fc_compiler_gnu
9131fc27e79cSmrg
9132b73be646Smrg  _LT_TAGVAR(compiler, $1)=$CC
9133b73be646Smrg  _LT_CC_BASENAME([$compiler])
9134fc27e79cSmrg
9135b73be646Smrg  if test -n "$compiler"; then
9136b73be646Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
9137b73be646Smrg    AC_MSG_RESULT([$can_build_shared])
9138fc27e79cSmrg
9139b73be646Smrg    AC_MSG_CHECKING([whether to build shared libraries])
9140b73be646Smrg    test "$can_build_shared" = "no" && enable_shared=no
9141b73be646Smrg
9142b73be646Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
9143b73be646Smrg    # are all built from PIC.
9144b73be646Smrg    case $host_os in
9145b73be646Smrg      aix3*)
9146b73be646Smrg        test "$enable_shared" = yes && enable_static=no
9147b73be646Smrg        if test -n "$RANLIB"; then
9148b73be646Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
9149b73be646Smrg          postinstall_cmds='$RANLIB $lib'
9150b73be646Smrg        fi
9151b73be646Smrg        ;;
9152b73be646Smrg      aix[[4-9]]*)
9153b73be646Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
9154b73be646Smrg	  test "$enable_shared" = yes && enable_static=no
9155b73be646Smrg	fi
9156b73be646Smrg        ;;
9157b73be646Smrg    esac
9158b73be646Smrg    AC_MSG_RESULT([$enable_shared])
9159b73be646Smrg
9160b73be646Smrg    AC_MSG_CHECKING([whether to build static libraries])
9161b73be646Smrg    # Make sure either enable_shared or enable_static is yes.
9162b73be646Smrg    test "$enable_shared" = yes || enable_static=yes
9163b73be646Smrg    AC_MSG_RESULT([$enable_static])
9164fc27e79cSmrg
9165b73be646Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
9166b73be646Smrg    _LT_TAGVAR(LD, $1)="$LD"
9167fc27e79cSmrg
9168b73be646Smrg    ## CAVEAT EMPTOR:
9169b73be646Smrg    ## There is no encapsulation within the following macros, do not change
9170b73be646Smrg    ## the running order or otherwise move them around unless you know exactly
9171b73be646Smrg    ## what you are doing...
9172b73be646Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
9173b73be646Smrg    _LT_COMPILER_PIC($1)
9174b73be646Smrg    _LT_COMPILER_C_O($1)
9175b73be646Smrg    _LT_COMPILER_FILE_LOCKS($1)
9176b73be646Smrg    _LT_LINKER_SHLIBS($1)
9177b73be646Smrg    _LT_SYS_DYNAMIC_LINKER($1)
9178b73be646Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
9179fc27e79cSmrg
9180b73be646Smrg    _LT_CONFIG($1)
9181b73be646Smrg  fi # test -n "$compiler"
9182fc27e79cSmrg
9183b73be646Smrg  GCC=$lt_save_GCC
9184b73be646Smrg  CC="$lt_save_CC"
9185b73be646Smrgfi # test "$_lt_disable_FC" != yes
9186fc27e79cSmrg
9187b73be646SmrgAC_LANG_POP
9188b73be646Smrg])# _LT_LANG_FC_CONFIG
9189fc27e79cSmrg
9190fc27e79cSmrg
9191b73be646Smrg# _LT_LANG_GCJ_CONFIG([TAG])
9192b73be646Smrg# --------------------------
9193b73be646Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
9194b73be646Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
9195b73be646Smrg# to write the compiler configuration to `libtool'.
9196b73be646Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
9197b73be646Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
9198b73be646SmrgAC_LANG_SAVE
9199fc27e79cSmrg
9200b73be646Smrg# Source file extension for Java test sources.
9201b73be646Smrgac_ext=java
9202fc27e79cSmrg
9203b73be646Smrg# Object file extension for compiled Java test sources.
9204b73be646Smrgobjext=o
9205b73be646Smrg_LT_TAGVAR(objext, $1)=$objext
9206fc27e79cSmrg
9207b73be646Smrg# Code to be used in simple compile tests
9208b73be646Smrglt_simple_compile_test_code="class foo {}"
9209fc27e79cSmrg
9210b73be646Smrg# Code to be used in simple link tests
9211b73be646Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
9212fc27e79cSmrg
9213b73be646Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
9214b73be646Smrg_LT_TAG_COMPILER
9215fc27e79cSmrg
9216b73be646Smrg# save warnings/boilerplate of simple test code
9217b73be646Smrg_LT_COMPILER_BOILERPLATE
9218b73be646Smrg_LT_LINKER_BOILERPLATE
9219fc27e79cSmrg
9220b73be646Smrg# Allow CC to be a program name with arguments.
9221b73be646Smrglt_save_CC="$CC"
9222b73be646Smrglt_save_GCC=$GCC
9223b73be646SmrgGCC=yes
9224b73be646SmrgCC=${GCJ-"gcj"}
9225b73be646Smrgcompiler=$CC
9226b73be646Smrg_LT_TAGVAR(compiler, $1)=$CC
9227b73be646Smrg_LT_TAGVAR(LD, $1)="$LD"
9228b73be646Smrg_LT_CC_BASENAME([$compiler])
9229fc27e79cSmrg
9230b73be646Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
9231b73be646Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9232fc27e79cSmrg
9233b73be646Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9234fc27e79cSmrg
9235b73be646Smrgif test -n "$compiler"; then
9236b73be646Smrg  _LT_COMPILER_NO_RTTI($1)
9237b73be646Smrg  _LT_COMPILER_PIC($1)
9238b73be646Smrg  _LT_COMPILER_C_O($1)
9239b73be646Smrg  _LT_COMPILER_FILE_LOCKS($1)
9240b73be646Smrg  _LT_LINKER_SHLIBS($1)
9241b73be646Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
9242fc27e79cSmrg
9243b73be646Smrg  _LT_CONFIG($1)
9244b73be646Smrgfi
9245fc27e79cSmrg
9246b73be646SmrgAC_LANG_RESTORE
9247fc27e79cSmrg
9248b73be646SmrgGCC=$lt_save_GCC
9249b73be646SmrgCC="$lt_save_CC"
9250b73be646Smrg])# _LT_LANG_GCJ_CONFIG
9251fc27e79cSmrg
9252fc27e79cSmrg
9253b73be646Smrg# _LT_LANG_RC_CONFIG([TAG])
9254b73be646Smrg# -------------------------
9255b73be646Smrg# Ensure that the configuration variables for the Windows resource compiler
9256b73be646Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
9257b73be646Smrg# to write the compiler configuration to `libtool'.
9258b73be646Smrgm4_defun([_LT_LANG_RC_CONFIG],
9259b73be646Smrg[AC_REQUIRE([LT_PROG_RC])dnl
9260b73be646SmrgAC_LANG_SAVE
92616aab59a7Smrg
9262b73be646Smrg# Source file extension for RC test sources.
9263b73be646Smrgac_ext=rc
9264fc27e79cSmrg
9265b73be646Smrg# Object file extension for compiled RC test sources.
9266b73be646Smrgobjext=o
9267b73be646Smrg_LT_TAGVAR(objext, $1)=$objext
9268659607e0Smrg
9269b73be646Smrg# Code to be used in simple compile tests
9270b73be646Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
9271659607e0Smrg
9272b73be646Smrg# Code to be used in simple link tests
9273b73be646Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
9274659607e0Smrg
9275b73be646Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
9276b73be646Smrg_LT_TAG_COMPILER
9277659607e0Smrg
9278b73be646Smrg# save warnings/boilerplate of simple test code
9279b73be646Smrg_LT_COMPILER_BOILERPLATE
9280b73be646Smrg_LT_LINKER_BOILERPLATE
9281659607e0Smrg
9282b73be646Smrg# Allow CC to be a program name with arguments.
9283b73be646Smrglt_save_CC="$CC"
9284b73be646Smrglt_save_GCC=$GCC
9285b73be646SmrgGCC=
9286b73be646SmrgCC=${RC-"windres"}
9287b73be646Smrgcompiler=$CC
9288b73be646Smrg_LT_TAGVAR(compiler, $1)=$CC
9289b73be646Smrg_LT_CC_BASENAME([$compiler])
9290b73be646Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
9291b73be646Smrg
9292b73be646Smrgif test -n "$compiler"; then
9293b73be646Smrg  :
9294b73be646Smrg  _LT_CONFIG($1)
9295fc27e79cSmrgfi
9296659607e0Smrg
9297b73be646SmrgGCC=$lt_save_GCC
9298b73be646SmrgAC_LANG_RESTORE
9299b73be646SmrgCC="$lt_save_CC"
9300b73be646Smrg])# _LT_LANG_RC_CONFIG
9301659607e0Smrg
9302659607e0Smrg
9303b73be646Smrg# LT_PROG_GCJ
9304b73be646Smrg# -----------
9305b73be646SmrgAC_DEFUN([LT_PROG_GCJ],
9306b73be646Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
9307b73be646Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
9308b73be646Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
9309b73be646Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
9310b73be646Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
9311b73be646Smrg])
9312fc27e79cSmrg
9313b73be646Smrg# Old name:
9314b73be646SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
9315b73be646Smrgdnl aclocal-1.4 backwards compatibility:
9316b73be646Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
9317fc27e79cSmrg
9318fc27e79cSmrg
9319b73be646Smrg# LT_PROG_RC
9320b73be646Smrg# ----------
9321b73be646SmrgAC_DEFUN([LT_PROG_RC],
9322b73be646Smrg[AC_CHECK_TOOL(RC, windres,)
9323fc27e79cSmrg])
9324fc27e79cSmrg
9325b73be646Smrg# Old name:
9326b73be646SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
9327b73be646Smrgdnl aclocal-1.4 backwards compatibility:
9328b73be646Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
9329b73be646Smrg
9330fc27e79cSmrg
9331b73be646Smrg# _LT_DECL_EGREP
9332b73be646Smrg# --------------
9333b73be646Smrg# If we don't have a new enough Autoconf to choose the best grep
9334b73be646Smrg# available, choose the one first in the user's PATH.
9335b73be646Smrgm4_defun([_LT_DECL_EGREP],
9336b73be646Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
9337b73be646SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
9338b73be646Smrgtest -z "$GREP" && GREP=grep
9339b73be646Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
9340b73be646Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
9341b73be646Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
9342b73be646Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
9343b73be646SmrgAC_SUBST([GREP])
9344b73be646Smrg])
9345fc27e79cSmrg
9346fc27e79cSmrg
9347b73be646Smrg# _LT_DECL_OBJDUMP
9348b73be646Smrg# --------------
9349b73be646Smrg# If we don't have a new enough Autoconf to choose the best objdump
9350b73be646Smrg# available, choose the one first in the user's PATH.
9351b73be646Smrgm4_defun([_LT_DECL_OBJDUMP],
9352b73be646Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
9353b73be646Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
9354b73be646Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
9355b73be646SmrgAC_SUBST([OBJDUMP])
9356b73be646Smrg])
9357fc27e79cSmrg
9358fc27e79cSmrg
9359b73be646Smrg# _LT_DECL_SED
9360b73be646Smrg# ------------
9361b73be646Smrg# Check for a fully-functional sed program, that truncates
9362b73be646Smrg# as few characters as possible.  Prefer GNU sed if found.
9363b73be646Smrgm4_defun([_LT_DECL_SED],
9364b73be646Smrg[AC_PROG_SED
9365b73be646Smrgtest -z "$SED" && SED=sed
9366b73be646SmrgXsed="$SED -e 1s/^X//"
9367b73be646Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
9368b73be646Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
9369b73be646Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
9370b73be646Smrg])# _LT_DECL_SED
9371fc27e79cSmrg
9372b73be646Smrgm4_ifndef([AC_PROG_SED], [
9373b73be646Smrg# NOTE: This macro has been submitted for inclusion into   #
9374b73be646Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
9375b73be646Smrg#  a released version of Autoconf we should remove this    #
9376b73be646Smrg#  macro and use it instead.                               #
9377fc27e79cSmrg
9378b73be646Smrgm4_defun([AC_PROG_SED],
9379b73be646Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
9380b73be646SmrgAC_CACHE_VAL(lt_cv_path_SED,
9381b73be646Smrg[# Loop through the user's path and test for sed and gsed.
9382b73be646Smrg# Then use that list of sed's as ones to test for truncation.
9383b73be646Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9384b73be646Smrgfor as_dir in $PATH
9385b73be646Smrgdo
9386b73be646Smrg  IFS=$as_save_IFS
9387b73be646Smrg  test -z "$as_dir" && as_dir=.
9388b73be646Smrg  for lt_ac_prog in sed gsed; do
9389b73be646Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
9390b73be646Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
9391b73be646Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
9392b73be646Smrg      fi
9393b73be646Smrg    done
9394b73be646Smrg  done
9395b73be646Smrgdone
9396b73be646SmrgIFS=$as_save_IFS
9397b73be646Smrglt_ac_max=0
9398b73be646Smrglt_ac_count=0
9399b73be646Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
9400b73be646Smrg# along with /bin/sed that truncates output.
9401b73be646Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
9402b73be646Smrg  test ! -f $lt_ac_sed && continue
9403b73be646Smrg  cat /dev/null > conftest.in
9404b73be646Smrg  lt_ac_count=0
9405b73be646Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
9406b73be646Smrg  # Check for GNU sed and select it if it is found.
9407b73be646Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
9408b73be646Smrg    lt_cv_path_SED=$lt_ac_sed
9409b73be646Smrg    break
9410fc27e79cSmrg  fi
9411b73be646Smrg  while true; do
9412b73be646Smrg    cat conftest.in conftest.in >conftest.tmp
9413b73be646Smrg    mv conftest.tmp conftest.in
9414b73be646Smrg    cp conftest.in conftest.nl
9415b73be646Smrg    echo >>conftest.nl
9416b73be646Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
9417b73be646Smrg    cmp -s conftest.out conftest.nl || break
9418b73be646Smrg    # 10000 chars as input seems more than enough
9419b73be646Smrg    test $lt_ac_count -gt 10 && break
9420b73be646Smrg    lt_ac_count=`expr $lt_ac_count + 1`
9421b73be646Smrg    if test $lt_ac_count -gt $lt_ac_max; then
9422b73be646Smrg      lt_ac_max=$lt_ac_count
9423b73be646Smrg      lt_cv_path_SED=$lt_ac_sed
9424b73be646Smrg    fi
9425b73be646Smrg  done
9426b73be646Smrgdone
9427b73be646Smrg])
9428b73be646SmrgSED=$lt_cv_path_SED
9429b73be646SmrgAC_SUBST([SED])
9430b73be646SmrgAC_MSG_RESULT([$SED])
9431b73be646Smrg])#AC_PROG_SED
9432b73be646Smrg])#m4_ifndef
9433fc27e79cSmrg
9434b73be646Smrg# Old name:
9435b73be646SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
9436b73be646Smrgdnl aclocal-1.4 backwards compatibility:
9437b73be646Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
9438fc27e79cSmrg
9439fc27e79cSmrg
9440b73be646Smrg# _LT_CHECK_SHELL_FEATURES
9441b73be646Smrg# ------------------------
9442b73be646Smrg# Find out whether the shell is Bourne or XSI compatible,
9443b73be646Smrg# or has some other useful features.
9444b73be646Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
9445b73be646Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
9446b73be646Smrg# Try some XSI features
9447b73be646Smrgxsi_shell=no
9448b73be646Smrg( _lt_dummy="a/b/c"
9449b73be646Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
9450b73be646Smrg      = c,a/b,, \
9451b73be646Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
9452b73be646Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
9453b73be646Smrg  && xsi_shell=yes
9454b73be646SmrgAC_MSG_RESULT([$xsi_shell])
9455b73be646Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
9456fc27e79cSmrg
9457b73be646SmrgAC_MSG_CHECKING([whether the shell understands "+="])
9458b73be646Smrglt_shell_append=no
9459b73be646Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
9460b73be646Smrg    >/dev/null 2>&1 \
9461b73be646Smrg  && lt_shell_append=yes
9462b73be646SmrgAC_MSG_RESULT([$lt_shell_append])
9463b73be646Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
9464fc27e79cSmrg
9465b73be646Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
9466b73be646Smrg  lt_unset=unset
9467b73be646Smrgelse
9468b73be646Smrg  lt_unset=false
9469b73be646Smrgfi
9470b73be646Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
9471b73be646Smrg
9472b73be646Smrg# test EBCDIC or ASCII
9473b73be646Smrgcase `echo X|tr X '\101'` in
9474b73be646Smrg A) # ASCII based system
9475b73be646Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
9476b73be646Smrg  lt_SP2NL='tr \040 \012'
9477b73be646Smrg  lt_NL2SP='tr \015\012 \040\040'
9478b73be646Smrg  ;;
9479b73be646Smrg *) # EBCDIC based system
9480b73be646Smrg  lt_SP2NL='tr \100 \n'
9481b73be646Smrg  lt_NL2SP='tr \r\n \100\100'
9482b73be646Smrg  ;;
9483b73be646Smrgesac
9484b73be646Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
9485b73be646Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
9486b73be646Smrg])# _LT_CHECK_SHELL_FEATURES
9487fc27e79cSmrg
9488fc27e79cSmrg
9489b73be646Smrg# _LT_PROG_XSI_SHELLFNS
9490b73be646Smrg# ---------------------
9491b73be646Smrg# Bourne and XSI compatible variants of some useful shell functions.
9492b73be646Smrgm4_defun([_LT_PROG_XSI_SHELLFNS],
9493b73be646Smrg[case $xsi_shell in
9494b73be646Smrg  yes)
9495b73be646Smrg    cat << \_LT_EOF >> "$cfgfile"
9496fc27e79cSmrg
9497b73be646Smrg# func_dirname file append nondir_replacement
9498b73be646Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
9499b73be646Smrg# otherwise set result to NONDIR_REPLACEMENT.
9500b73be646Smrgfunc_dirname ()
9501b73be646Smrg{
9502b73be646Smrg  case ${1} in
9503b73be646Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
9504b73be646Smrg    *  ) func_dirname_result="${3}" ;;
9505fc27e79cSmrg  esac
9506b73be646Smrg}
9507659607e0Smrg
9508b73be646Smrg# func_basename file
9509b73be646Smrgfunc_basename ()
9510b73be646Smrg{
9511b73be646Smrg  func_basename_result="${1##*/}"
9512b73be646Smrg}
9513659607e0Smrg
9514b73be646Smrg# func_dirname_and_basename file append nondir_replacement
9515b73be646Smrg# perform func_basename and func_dirname in a single function
9516b73be646Smrg# call:
9517b73be646Smrg#   dirname:  Compute the dirname of FILE.  If nonempty,
9518b73be646Smrg#             add APPEND to the result, otherwise set result
9519b73be646Smrg#             to NONDIR_REPLACEMENT.
9520b73be646Smrg#             value returned in "$func_dirname_result"
9521b73be646Smrg#   basename: Compute filename of FILE.
9522b73be646Smrg#             value retuned in "$func_basename_result"
9523b73be646Smrg# Implementation must be kept synchronized with func_dirname
9524b73be646Smrg# and func_basename. For efficiency, we do not delegate to
9525b73be646Smrg# those functions but instead duplicate the functionality here.
9526b73be646Smrgfunc_dirname_and_basename ()
9527b73be646Smrg{
9528b73be646Smrg  case ${1} in
9529b73be646Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
9530b73be646Smrg    *  ) func_dirname_result="${3}" ;;
9531fc27e79cSmrg  esac
9532b73be646Smrg  func_basename_result="${1##*/}"
9533b73be646Smrg}
9534659607e0Smrg
9535b73be646Smrg# func_stripname prefix suffix name
9536b73be646Smrg# strip PREFIX and SUFFIX off of NAME.
9537b73be646Smrg# PREFIX and SUFFIX must not contain globbing or regex special
9538b73be646Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
9539b73be646Smrg# dot (in which case that matches only a dot).
9540b73be646Smrgfunc_stripname ()
9541b73be646Smrg{
9542b73be646Smrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
9543b73be646Smrg  # positional parameters, so assign one to ordinary parameter first.
9544b73be646Smrg  func_stripname_result=${3}
9545b73be646Smrg  func_stripname_result=${func_stripname_result#"${1}"}
9546b73be646Smrg  func_stripname_result=${func_stripname_result%"${2}"}
9547b73be646Smrg}
9548659607e0Smrg
9549b73be646Smrg# func_opt_split
9550b73be646Smrgfunc_opt_split ()
9551b73be646Smrg{
9552b73be646Smrg  func_opt_split_opt=${1%%=*}
9553b73be646Smrg  func_opt_split_arg=${1#*=}
9554b73be646Smrg}
9555659607e0Smrg
9556b73be646Smrg# func_lo2o object
9557b73be646Smrgfunc_lo2o ()
9558b73be646Smrg{
9559b73be646Smrg  case ${1} in
9560b73be646Smrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
9561b73be646Smrg    *)    func_lo2o_result=${1} ;;
9562b73be646Smrg  esac
9563b73be646Smrg}
9564659607e0Smrg
9565b73be646Smrg# func_xform libobj-or-source
9566b73be646Smrgfunc_xform ()
9567b73be646Smrg{
9568b73be646Smrg  func_xform_result=${1%.*}.lo
9569b73be646Smrg}
9570659607e0Smrg
9571b73be646Smrg# func_arith arithmetic-term...
9572b73be646Smrgfunc_arith ()
9573b73be646Smrg{
9574b73be646Smrg  func_arith_result=$(( $[*] ))
9575b73be646Smrg}
9576659607e0Smrg
9577b73be646Smrg# func_len string
9578b73be646Smrg# STRING may not start with a hyphen.
9579b73be646Smrgfunc_len ()
9580b73be646Smrg{
9581b73be646Smrg  func_len_result=${#1}
9582b73be646Smrg}
9583659607e0Smrg
9584b73be646Smrg_LT_EOF
9585b73be646Smrg    ;;
9586b73be646Smrg  *) # Bourne compatible functions.
9587b73be646Smrg    cat << \_LT_EOF >> "$cfgfile"
9588659607e0Smrg
9589b73be646Smrg# func_dirname file append nondir_replacement
9590b73be646Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
9591b73be646Smrg# otherwise set result to NONDIR_REPLACEMENT.
9592b73be646Smrgfunc_dirname ()
9593b73be646Smrg{
9594b73be646Smrg  # Extract subdirectory from the argument.
9595b73be646Smrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
9596b73be646Smrg  if test "X$func_dirname_result" = "X${1}"; then
9597b73be646Smrg    func_dirname_result="${3}"
9598b73be646Smrg  else
9599b73be646Smrg    func_dirname_result="$func_dirname_result${2}"
9600b73be646Smrg  fi
9601b73be646Smrg}
9602659607e0Smrg
9603b73be646Smrg# func_basename file
9604b73be646Smrgfunc_basename ()
9605b73be646Smrg{
9606b73be646Smrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
9607b73be646Smrg}
9608659607e0Smrg
9609b73be646Smrgdnl func_dirname_and_basename
9610b73be646Smrgdnl A portable version of this function is already defined in general.m4sh
9611b73be646Smrgdnl so there is no need for it here.
9612659607e0Smrg
9613b73be646Smrg# func_stripname prefix suffix name
9614b73be646Smrg# strip PREFIX and SUFFIX off of NAME.
9615b73be646Smrg# PREFIX and SUFFIX must not contain globbing or regex special
9616b73be646Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
9617b73be646Smrg# dot (in which case that matches only a dot).
9618b73be646Smrg# func_strip_suffix prefix name
9619b73be646Smrgfunc_stripname ()
9620b73be646Smrg{
9621b73be646Smrg  case ${2} in
9622b73be646Smrg    .*) func_stripname_result=`$ECHO "X${3}" \
9623b73be646Smrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
9624b73be646Smrg    *)  func_stripname_result=`$ECHO "X${3}" \
9625b73be646Smrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
9626b73be646Smrg  esac
9627b73be646Smrg}
9628659607e0Smrg
9629b73be646Smrg# sed scripts:
9630b73be646Smrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
9631b73be646Smrgmy_sed_long_arg='1s/^-[[^=]]*=//'
9632659607e0Smrg
9633b73be646Smrg# func_opt_split
9634b73be646Smrgfunc_opt_split ()
9635b73be646Smrg{
9636b73be646Smrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
9637b73be646Smrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
9638b73be646Smrg}
9639b73be646Smrg
9640b73be646Smrg# func_lo2o object
9641b73be646Smrgfunc_lo2o ()
9642b73be646Smrg{
9643b73be646Smrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
9644b73be646Smrg}
9645b73be646Smrg
9646b73be646Smrg# func_xform libobj-or-source
9647b73be646Smrgfunc_xform ()
9648b73be646Smrg{
9649b73be646Smrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
9650b73be646Smrg}
9651659607e0Smrg
9652b73be646Smrg# func_arith arithmetic-term...
9653b73be646Smrgfunc_arith ()
9654b73be646Smrg{
9655b73be646Smrg  func_arith_result=`expr "$[@]"`
9656b73be646Smrg}
9657659607e0Smrg
9658b73be646Smrg# func_len string
9659b73be646Smrg# STRING may not start with a hyphen.
9660b73be646Smrgfunc_len ()
9661b73be646Smrg{
9662b73be646Smrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
9663b73be646Smrg}
9664659607e0Smrg
9665b73be646Smrg_LT_EOF
9666b73be646Smrgesac
9667fc27e79cSmrg
9668b73be646Smrgcase $lt_shell_append in
9669b73be646Smrg  yes)
9670b73be646Smrg    cat << \_LT_EOF >> "$cfgfile"
9671fc27e79cSmrg
9672b73be646Smrg# func_append var value
9673b73be646Smrg# Append VALUE to the end of shell variable VAR.
9674b73be646Smrgfunc_append ()
9675b73be646Smrg{
9676b73be646Smrg  eval "$[1]+=\$[2]"
9677b73be646Smrg}
9678b73be646Smrg_LT_EOF
9679b73be646Smrg    ;;
96806aab59a7Smrg  *)
9681b73be646Smrg    cat << \_LT_EOF >> "$cfgfile"
9682b73be646Smrg
9683b73be646Smrg# func_append var value
9684b73be646Smrg# Append VALUE to the end of shell variable VAR.
9685b73be646Smrgfunc_append ()
9686b73be646Smrg{
9687b73be646Smrg  eval "$[1]=\$$[1]\$[2]"
9688b73be646Smrg}
9689b73be646Smrg
9690b73be646Smrg_LT_EOF
9691b73be646Smrg    ;;
96926aab59a7Smrg  esac
9693fc27e79cSmrg])
96946aab59a7Smrg
9695b73be646Smrg# Helper functions for option handling.                    -*- Autoconf -*-
9696fc27e79cSmrg#
9697b73be646Smrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9698b73be646Smrg#   Written by Gary V. Vaughan, 2004
9699b73be646Smrg#
9700b73be646Smrg# This file is free software; the Free Software Foundation gives
9701b73be646Smrg# unlimited permission to copy and/or distribute it, with or without
9702b73be646Smrg# modifications, as long as this notice is preserved.
97036aab59a7Smrg
9704b73be646Smrg# serial 6 ltoptions.m4
9705659607e0Smrg
9706b73be646Smrg# This is to help aclocal find these macros, as it can't see m4_define.
9707b73be646SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9708659607e0Smrg
9709659607e0Smrg
9710b73be646Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9711b73be646Smrg# ------------------------------------------
9712b73be646Smrgm4_define([_LT_MANGLE_OPTION],
9713b73be646Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9714659607e0Smrg
9715659607e0Smrg
9716b73be646Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9717b73be646Smrg# ---------------------------------------
9718b73be646Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9719b73be646Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9720b73be646Smrg# saved as a flag.
9721b73be646Smrgm4_define([_LT_SET_OPTION],
9722b73be646Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9723b73be646Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9724b73be646Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
9725b73be646Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
9726b73be646Smrg])
9727659607e0Smrg
9728659607e0Smrg
9729b73be646Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9730b73be646Smrg# ------------------------------------------------------------
9731fc27e79cSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9732b73be646Smrgm4_define([_LT_IF_OPTION],
9733b73be646Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9734659607e0Smrg
9735659607e0Smrg
9736b73be646Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9737b73be646Smrg# -------------------------------------------------------
9738b73be646Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9739b73be646Smrg# are set.
9740b73be646Smrgm4_define([_LT_UNLESS_OPTIONS],
9741b73be646Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9742b73be646Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9743b73be646Smrg		      [m4_define([$0_found])])])[]dnl
9744b73be646Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9745b73be646Smrg])[]dnl
9746b73be646Smrg])
9747659607e0Smrg
9748659607e0Smrg
9749b73be646Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9750b73be646Smrg# ----------------------------------------
9751b73be646Smrg# OPTION-LIST is a space-separated list of Libtool options associated
9752b73be646Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
9753b73be646Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9754b73be646Smrg# the unknown option and exit.
9755b73be646Smrgm4_defun([_LT_SET_OPTIONS],
9756b73be646Smrg[# Set options
9757b73be646Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9758b73be646Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
9759659607e0Smrg
9760b73be646Smrgm4_if([$1],[LT_INIT],[
9761b73be646Smrg  dnl
9762b73be646Smrg  dnl Simply set some default values (i.e off) if boolean options were not
9763b73be646Smrg  dnl specified:
9764b73be646Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9765b73be646Smrg  ])
9766b73be646Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9767b73be646Smrg  ])
9768b73be646Smrg  dnl
9769b73be646Smrg  dnl If no reference was made to various pairs of opposing options, then
9770b73be646Smrg  dnl we run the default mode handler for the pair.  For example, if neither
9771b73be646Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9772b73be646Smrg  dnl archives by default:
9773b73be646Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9774b73be646Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9775b73be646Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9776b73be646Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9777b73be646Smrg  		   [_LT_ENABLE_FAST_INSTALL])
9778b73be646Smrg  ])
9779b73be646Smrg])# _LT_SET_OPTIONS
9780659607e0Smrg
9781659607e0Smrg
9782659607e0Smrg
9783b73be646Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9784b73be646Smrg# -----------------------------------------
9785b73be646Smrgm4_define([_LT_MANGLE_DEFUN],
9786b73be646Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9787659607e0Smrg
9788659607e0Smrg
9789b73be646Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9790b73be646Smrg# -----------------------------------------------
9791b73be646Smrgm4_define([LT_OPTION_DEFINE],
9792b73be646Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9793b73be646Smrg])# LT_OPTION_DEFINE
97946aab59a7Smrg
9795659607e0Smrg
9796b73be646Smrg# dlopen
9797b73be646Smrg# ------
9798b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9799b73be646Smrg])
9800659607e0Smrg
9801b73be646SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
9802b73be646Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
9803b73be646SmrgAC_DIAGNOSE([obsolete],
9804b73be646Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9805b73be646Smrgput the `dlopen' option into LT_INIT's first parameter.])
9806b73be646Smrg])
9807659607e0Smrg
9808b73be646Smrgdnl aclocal-1.4 backwards compatibility:
9809b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9810659607e0Smrg
9811659607e0Smrg
9812b73be646Smrg# win32-dll
9813b73be646Smrg# ---------
9814b73be646Smrg# Declare package support for building win32 dll's.
9815b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
9816b73be646Smrg[enable_win32_dll=yes
9817659607e0Smrg
9818b73be646Smrgcase $host in
9819b73be646Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
9820b73be646Smrg  AC_CHECK_TOOL(AS, as, false)
9821b73be646Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9822b73be646Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9823b73be646Smrg  ;;
9824b73be646Smrgesac
9825659607e0Smrg
9826b73be646Smrgtest -z "$AS" && AS=as
9827b73be646Smrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
9828659607e0Smrg
9829b73be646Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
9830b73be646Smrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
9831659607e0Smrg
9832b73be646Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
9833b73be646Smrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
9834b73be646Smrg])# win32-dll
9835659607e0Smrg
9836b73be646SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9837b73be646Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9838b73be646Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
9839b73be646SmrgAC_DIAGNOSE([obsolete],
9840b73be646Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9841b73be646Smrgput the `win32-dll' option into LT_INIT's first parameter.])
9842b73be646Smrg])
9843659607e0Smrg
9844b73be646Smrgdnl aclocal-1.4 backwards compatibility:
9845b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9846659607e0Smrg
98476aab59a7Smrg
9848b73be646Smrg# _LT_ENABLE_SHARED([DEFAULT])
9849b73be646Smrg# ----------------------------
9850b73be646Smrg# implement the --enable-shared flag, and supports the `shared' and
9851b73be646Smrg# `disable-shared' LT_INIT options.
9852b73be646Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9853b73be646Smrgm4_define([_LT_ENABLE_SHARED],
9854b73be646Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9855b73be646SmrgAC_ARG_ENABLE([shared],
9856b73be646Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9857b73be646Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9858b73be646Smrg    [p=${PACKAGE-default}
9859b73be646Smrg    case $enableval in
9860b73be646Smrg    yes) enable_shared=yes ;;
9861b73be646Smrg    no) enable_shared=no ;;
9862b73be646Smrg    *)
9863b73be646Smrg      enable_shared=no
9864b73be646Smrg      # Look at the argument we got.  We use all the common list separators.
9865b73be646Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9866b73be646Smrg      for pkg in $enableval; do
9867b73be646Smrg	IFS="$lt_save_ifs"
9868b73be646Smrg	if test "X$pkg" = "X$p"; then
9869b73be646Smrg	  enable_shared=yes
9870b73be646Smrg	fi
9871b73be646Smrg      done
9872b73be646Smrg      IFS="$lt_save_ifs"
9873b73be646Smrg      ;;
9874b73be646Smrg    esac],
9875b73be646Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9876659607e0Smrg
9877b73be646Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9878b73be646Smrg	[Whether or not to build shared libraries])
9879b73be646Smrg])# _LT_ENABLE_SHARED
9880659607e0Smrg
9881b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9882b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9883659607e0Smrg
9884b73be646Smrg# Old names:
9885b73be646SmrgAC_DEFUN([AC_ENABLE_SHARED],
9886b73be646Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9887b73be646Smrg])
9888fc27e79cSmrg
9889b73be646SmrgAC_DEFUN([AC_DISABLE_SHARED],
9890b73be646Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
9891b73be646Smrg])
9892b73be646Smrg
9893b73be646SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9894b73be646SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9895b73be646Smrg
9896b73be646Smrgdnl aclocal-1.4 backwards compatibility:
9897b73be646Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
9898b73be646Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
9899b73be646Smrg
9900b73be646Smrg
9901b73be646Smrg
9902b73be646Smrg# _LT_ENABLE_STATIC([DEFAULT])
9903b73be646Smrg# ----------------------------
9904b73be646Smrg# implement the --enable-static flag, and support the `static' and
9905b73be646Smrg# `disable-static' LT_INIT options.
9906b73be646Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9907b73be646Smrgm4_define([_LT_ENABLE_STATIC],
9908b73be646Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9909b73be646SmrgAC_ARG_ENABLE([static],
9910b73be646Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9911b73be646Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9912b73be646Smrg    [p=${PACKAGE-default}
9913b73be646Smrg    case $enableval in
9914b73be646Smrg    yes) enable_static=yes ;;
9915b73be646Smrg    no) enable_static=no ;;
9916b73be646Smrg    *)
9917b73be646Smrg     enable_static=no
9918b73be646Smrg      # Look at the argument we got.  We use all the common list separators.
9919b73be646Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9920b73be646Smrg      for pkg in $enableval; do
9921b73be646Smrg	IFS="$lt_save_ifs"
9922b73be646Smrg	if test "X$pkg" = "X$p"; then
9923b73be646Smrg	  enable_static=yes
9924fc27e79cSmrg	fi
9925b73be646Smrg      done
9926b73be646Smrg      IFS="$lt_save_ifs"
9927b73be646Smrg      ;;
9928b73be646Smrg    esac],
9929b73be646Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9930659607e0Smrg
9931b73be646Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
9932b73be646Smrg	[Whether or not to build static libraries])
9933b73be646Smrg])# _LT_ENABLE_STATIC
9934659607e0Smrg
9935b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9936b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9937659607e0Smrg
9938b73be646Smrg# Old names:
9939b73be646SmrgAC_DEFUN([AC_ENABLE_STATIC],
9940b73be646Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9941b73be646Smrg])
9942659607e0Smrg
9943b73be646SmrgAC_DEFUN([AC_DISABLE_STATIC],
9944b73be646Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
9945b73be646Smrg])
9946659607e0Smrg
9947b73be646SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9948b73be646SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9949659607e0Smrg
9950b73be646Smrgdnl aclocal-1.4 backwards compatibility:
9951b73be646Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
9952b73be646Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
9953659607e0Smrg
9954659607e0Smrg
9955659607e0Smrg
9956b73be646Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9957b73be646Smrg# ----------------------------------
9958b73be646Smrg# implement the --enable-fast-install flag, and support the `fast-install'
9959b73be646Smrg# and `disable-fast-install' LT_INIT options.
9960b73be646Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9961b73be646Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
9962b73be646Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9963b73be646SmrgAC_ARG_ENABLE([fast-install],
9964b73be646Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9965b73be646Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9966b73be646Smrg    [p=${PACKAGE-default}
9967b73be646Smrg    case $enableval in
9968b73be646Smrg    yes) enable_fast_install=yes ;;
9969b73be646Smrg    no) enable_fast_install=no ;;
9970b73be646Smrg    *)
9971b73be646Smrg      enable_fast_install=no
9972b73be646Smrg      # Look at the argument we got.  We use all the common list separators.
9973b73be646Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9974b73be646Smrg      for pkg in $enableval; do
9975b73be646Smrg	IFS="$lt_save_ifs"
9976b73be646Smrg	if test "X$pkg" = "X$p"; then
9977b73be646Smrg	  enable_fast_install=yes
9978b73be646Smrg	fi
9979b73be646Smrg      done
9980b73be646Smrg      IFS="$lt_save_ifs"
9981b73be646Smrg      ;;
9982b73be646Smrg    esac],
9983b73be646Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9984b73be646Smrg
9985b73be646Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
9986b73be646Smrg	 [Whether or not to optimize for fast installation])dnl
9987b73be646Smrg])# _LT_ENABLE_FAST_INSTALL
9988659607e0Smrg
9989b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9990b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9991659607e0Smrg
9992b73be646Smrg# Old names:
9993b73be646SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
9994b73be646Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9995b73be646SmrgAC_DIAGNOSE([obsolete],
9996b73be646Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9997b73be646Smrgthe `fast-install' option into LT_INIT's first parameter.])
9998b73be646Smrg])
9999659607e0Smrg
10000b73be646SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
10001b73be646Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
10002b73be646SmrgAC_DIAGNOSE([obsolete],
10003b73be646Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
10004b73be646Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
10005b73be646Smrg])
10006659607e0Smrg
10007b73be646Smrgdnl aclocal-1.4 backwards compatibility:
10008b73be646Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
10009b73be646Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
10010659607e0Smrg
10011659607e0Smrg
10012b73be646Smrg# _LT_WITH_PIC([MODE])
10013b73be646Smrg# --------------------
10014b73be646Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
10015b73be646Smrg# LT_INIT options.
10016b73be646Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
10017b73be646Smrgm4_define([_LT_WITH_PIC],
10018b73be646Smrg[AC_ARG_WITH([pic],
10019b73be646Smrg    [AS_HELP_STRING([--with-pic],
10020b73be646Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
10021b73be646Smrg    [pic_mode="$withval"],
10022b73be646Smrg    [pic_mode=default])
10023659607e0Smrg
10024b73be646Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
10025659607e0Smrg
10026b73be646Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
10027b73be646Smrg])# _LT_WITH_PIC
10028659607e0Smrg
10029b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
10030b73be646SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
10031659607e0Smrg
10032b73be646Smrg# Old name:
10033b73be646SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
10034b73be646Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
10035b73be646SmrgAC_DIAGNOSE([obsolete],
10036b73be646Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
10037b73be646Smrgput the `pic-only' option into LT_INIT's first parameter.])
10038b73be646Smrg])
10039659607e0Smrg
10040b73be646Smrgdnl aclocal-1.4 backwards compatibility:
10041b73be646Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
10042659607e0Smrg
10043659607e0Smrg
10044b73be646Smrgm4_define([_LTDL_MODE], [])
10045b73be646SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
10046b73be646Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
10047b73be646SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
10048b73be646Smrg		 [m4_define([_LTDL_MODE], [recursive])])
10049b73be646SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
10050b73be646Smrg		 [m4_define([_LTDL_MODE], [subproject])])
10051659607e0Smrg
10052b73be646Smrgm4_define([_LTDL_TYPE], [])
10053b73be646SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
10054b73be646Smrg		 [m4_define([_LTDL_TYPE], [installable])])
10055b73be646SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
10056b73be646Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
10057659607e0Smrg
10058b73be646Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
10059fc27e79cSmrg#
10060b73be646Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
10061b73be646Smrg# Written by Gary V. Vaughan, 2004
10062b73be646Smrg#
10063b73be646Smrg# This file is free software; the Free Software Foundation gives
10064b73be646Smrg# unlimited permission to copy and/or distribute it, with or without
10065b73be646Smrg# modifications, as long as this notice is preserved.
10066659607e0Smrg
10067b73be646Smrg# serial 6 ltsugar.m4
10068659607e0Smrg
10069b73be646Smrg# This is to help aclocal find these macros, as it can't see m4_define.
10070b73be646SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
10071659607e0Smrg
10072659607e0Smrg
10073b73be646Smrg# lt_join(SEP, ARG1, [ARG2...])
10074b73be646Smrg# -----------------------------
10075b73be646Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
10076b73be646Smrg# associated separator.
10077b73be646Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
10078b73be646Smrg# versions in m4sugar had bugs.
10079b73be646Smrgm4_define([lt_join],
10080b73be646Smrg[m4_if([$#], [1], [],
10081b73be646Smrg       [$#], [2], [[$2]],
10082b73be646Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
10083b73be646Smrgm4_define([_lt_join],
10084b73be646Smrg[m4_if([$#$2], [2], [],
10085b73be646Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
10086659607e0Smrg
100876aab59a7Smrg
10088b73be646Smrg# lt_car(LIST)
10089b73be646Smrg# lt_cdr(LIST)
10090b73be646Smrg# ------------
10091b73be646Smrg# Manipulate m4 lists.
10092b73be646Smrg# These macros are necessary as long as will still need to support
10093b73be646Smrg# Autoconf-2.59 which quotes differently.
10094b73be646Smrgm4_define([lt_car], [[$1]])
10095b73be646Smrgm4_define([lt_cdr],
10096b73be646Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
10097b73be646Smrg       [$#], 1, [],
10098b73be646Smrg       [m4_dquote(m4_shift($@))])])
10099b73be646Smrgm4_define([lt_unquote], $1)
10100659607e0Smrg
10101659607e0Smrg
10102b73be646Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
10103b73be646Smrg# ------------------------------------------
10104b73be646Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
10105b73be646Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
10106b73be646Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
10107b73be646Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
10108b73be646Smrg# than defined and empty).
101096aab59a7Smrg#
10110b73be646Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
10111b73be646Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
10112b73be646Smrgm4_define([lt_append],
10113b73be646Smrg[m4_define([$1],
10114b73be646Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
10115659607e0Smrg
10116659607e0Smrg
10117659607e0Smrg
10118b73be646Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
10119b73be646Smrg# ----------------------------------------------------------
10120b73be646Smrg# Produce a SEP delimited list of all paired combinations of elements of
10121b73be646Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
10122b73be646Smrg# has the form PREFIXmINFIXSUFFIXn.
10123b73be646Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
10124b73be646Smrgm4_define([lt_combine],
10125b73be646Smrg[m4_if(m4_eval([$# > 3]), [1],
10126b73be646Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
10127b73be646Smrg[[m4_foreach([_Lt_prefix], [$2],
10128b73be646Smrg	     [m4_foreach([_Lt_suffix],
10129b73be646Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
10130b73be646Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
10131659607e0Smrg
10132659607e0Smrg
10133b73be646Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
10134b73be646Smrg# -----------------------------------------------------------------------
10135b73be646Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
10136b73be646Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
10137b73be646Smrgm4_define([lt_if_append_uniq],
10138b73be646Smrg[m4_ifdef([$1],
10139b73be646Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
10140b73be646Smrg		 [lt_append([$1], [$2], [$3])$4],
10141b73be646Smrg		 [$5])],
10142b73be646Smrg	  [lt_append([$1], [$2], [$3])$4])])
10143659607e0Smrg
101446aab59a7Smrg
10145b73be646Smrg# lt_dict_add(DICT, KEY, VALUE)
10146b73be646Smrg# -----------------------------
10147b73be646Smrgm4_define([lt_dict_add],
10148b73be646Smrg[m4_define([$1($2)], [$3])])
101496aab59a7Smrg
10150659607e0Smrg
10151b73be646Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
10152b73be646Smrg# --------------------------------------------
10153b73be646Smrgm4_define([lt_dict_add_subkey],
10154b73be646Smrg[m4_define([$1($2:$3)], [$4])])
10155b73be646Smrg
10156b73be646Smrg
10157b73be646Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
10158b73be646Smrg# ----------------------------------
10159b73be646Smrgm4_define([lt_dict_fetch],
10160b73be646Smrg[m4_ifval([$3],
10161b73be646Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
10162b73be646Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
10163b73be646Smrg
10164659607e0Smrg
10165b73be646Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
10166b73be646Smrg# -----------------------------------------------------------------
10167b73be646Smrgm4_define([lt_if_dict_fetch],
10168b73be646Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
10169b73be646Smrg	[$5],
10170b73be646Smrg    [$6])])
10171fc27e79cSmrg
10172b73be646Smrg
10173b73be646Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
10174b73be646Smrg# --------------------------------------------------------------
10175b73be646Smrgm4_define([lt_dict_filter],
10176b73be646Smrg[m4_if([$5], [], [],
10177b73be646Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
10178b73be646Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
10179b73be646Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
10180b73be646Smrg])
10181b73be646Smrg
10182b73be646Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
101836aab59a7Smrg#
10184b73be646Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
10185b73be646Smrg#   Written by Scott James Remnant, 2004
101866aab59a7Smrg#
10187b73be646Smrg# This file is free software; the Free Software Foundation gives
10188b73be646Smrg# unlimited permission to copy and/or distribute it, with or without
10189b73be646Smrg# modifications, as long as this notice is preserved.
10190659607e0Smrg
10191b73be646Smrg# Generated from ltversion.in.
10192fc27e79cSmrg
10193b73be646Smrg# serial 3017 ltversion.m4
10194b73be646Smrg# This file is part of GNU Libtool
10195fc27e79cSmrg
10196b73be646Smrgm4_define([LT_PACKAGE_VERSION], [2.2.6b])
10197b73be646Smrgm4_define([LT_PACKAGE_REVISION], [1.3017])
10198b73be646Smrg
10199b73be646SmrgAC_DEFUN([LTVERSION_VERSION],
10200b73be646Smrg[macro_version='2.2.6b'
10201b73be646Smrgmacro_revision='1.3017'
10202b73be646Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
10203b73be646Smrg_LT_DECL(, macro_revision, 0)
10204b73be646Smrg])
10205b73be646Smrg
10206b73be646Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
102076aab59a7Smrg#
10208b73be646Smrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
10209b73be646Smrg#   Written by Scott James Remnant, 2004.
102106aab59a7Smrg#
10211b73be646Smrg# This file is free software; the Free Software Foundation gives
10212b73be646Smrg# unlimited permission to copy and/or distribute it, with or without
10213b73be646Smrg# modifications, as long as this notice is preserved.
10214659607e0Smrg
10215b73be646Smrg# serial 4 lt~obsolete.m4
10216659607e0Smrg
10217b73be646Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
10218fc27e79cSmrg#
10219b73be646Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
10220b73be646Smrg# which have later been changed to m4_define as they aren't part of the
10221b73be646Smrg# exported API, or moved to Autoconf or Automake where they belong.
10222fc27e79cSmrg#
10223b73be646Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
10224b73be646Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
10225b73be646Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
10226b73be646Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
10227b73be646Smrg# and doesn't know about Autoconf macros at all.)
10228fc27e79cSmrg#
10229b73be646Smrg# So we provide this file, which has a silly filename so it's always
10230b73be646Smrg# included after everything else.  This provides aclocal with the
10231b73be646Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
10232b73be646Smrg# because those macros already exist, or will be overwritten later.
10233b73be646Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
10234b73be646Smrg#
10235b73be646Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
10236b73be646Smrg# Yes, that means every name once taken will need to remain here until
10237b73be646Smrg# we give up compatibility with versions before 1.7, at which point
10238b73be646Smrg# we need to keep only those names which we still refer to.
10239659607e0Smrg
10240b73be646Smrg# This is to help aclocal find these macros, as it can't see m4_define.
10241b73be646SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
10242659607e0Smrg
10243b73be646Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
10244b73be646Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
10245b73be646Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
10246b73be646Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
10247b73be646Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
10248b73be646Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
10249b73be646Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
10250b73be646Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
10251b73be646Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
10252b73be646Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
10253b73be646Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
10254b73be646Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
10255b73be646Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
10256b73be646Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
10257b73be646Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
10258b73be646Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
10259b73be646Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
10260b73be646Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
10261b73be646Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
10262b73be646Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
10263b73be646Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
10264b73be646Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
10265b73be646Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
10266b73be646Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
10267b73be646Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
10268b73be646Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
10269b73be646Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
10270b73be646Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
10271b73be646Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
10272b73be646Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
10273b73be646Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
10274b73be646Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
10275b73be646Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
10276b73be646Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
10277b73be646Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
10278b73be646Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
10279b73be646Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
10280b73be646Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
10281b73be646Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
10282b73be646Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
10283b73be646Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
10284b73be646Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
10285b73be646Smrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
10286b73be646Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
10287b73be646Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
10288b73be646Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
10289b73be646Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
10290b73be646Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
10291b73be646Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
10292b73be646Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
10293b73be646Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
10294b73be646Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
10295b73be646Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
10296b73be646Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
10297b73be646Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
10298659607e0Smrg
10299