1636c353eSmrg# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2e07dc26bSmrg
3636c353eSmrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
4e07dc26bSmrg
5e07dc26bSmrg# This file is free software; the Free Software Foundation
6e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
7e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
8e07dc26bSmrg
9e07dc26bSmrg# This program is distributed in the hope that it will be useful,
10e07dc26bSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11e07dc26bSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12e07dc26bSmrg# PARTICULAR PURPOSE.
13e07dc26bSmrg
14e07dc26bSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15e07dc26bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16e07dc26bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17636c353eSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
18636c353eSmrg[m4_warning([this file was generated for autoconf 2.72.
19e07dc26bSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20e07dc26bSmrgIf you have problems, you may need to regenerate the build system entirely.
21e07dc26bSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22e07dc26bSmrg
23636c353eSmrg# Copyright (C) 2002-2021 Free Software Foundation, Inc.
24e07dc26bSmrg#
25636c353eSmrg# This file is free software; the Free Software Foundation
26636c353eSmrg# gives unlimited permission to copy and/or distribute it,
27636c353eSmrg# with or without modifications, as long as this notice is preserved.
28e07dc26bSmrg
29636c353eSmrg# AM_AUTOMAKE_VERSION(VERSION)
30636c353eSmrg# ----------------------------
31636c353eSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32636c353eSmrg# generated from the m4 files accompanying Automake X.Y.
33636c353eSmrg# (This private macro should not be called outside this file.)
34636c353eSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
35636c353eSmrg[am__api_version='1.16'
36636c353eSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37636c353eSmrgdnl require some minimum version.  Point them to the right macro.
38636c353eSmrgm4_if([$1], [1.16.5], [],
39636c353eSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40e07dc26bSmrg])
41e07dc26bSmrg
42636c353eSmrg# _AM_AUTOCONF_VERSION(VERSION)
43636c353eSmrg# -----------------------------
44636c353eSmrg# aclocal traces this macro to find the Autoconf version.
45636c353eSmrg# This is a private macro too.  Using m4_define simplifies
46636c353eSmrg# the logic in aclocal, which can simply ignore this definition.
47636c353eSmrgm4_define([_AM_AUTOCONF_VERSION], [])
48e07dc26bSmrg
49636c353eSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50636c353eSmrg# -------------------------------
51636c353eSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52636c353eSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53636c353eSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54636c353eSmrg[AM_AUTOMAKE_VERSION([1.16.5])dnl
55636c353eSmrgm4_ifndef([AC_AUTOCONF_VERSION],
56636c353eSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57636c353eSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58e07dc26bSmrg
59636c353eSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60e07dc26bSmrg
61636c353eSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
62636c353eSmrg#
63636c353eSmrg# This file is free software; the Free Software Foundation
64636c353eSmrg# gives unlimited permission to copy and/or distribute it,
65636c353eSmrg# with or without modifications, as long as this notice is preserved.
66e07dc26bSmrg
67636c353eSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68636c353eSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69636c353eSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70636c353eSmrg#
71636c353eSmrg# Of course, Automake must honor this variable whenever it calls a
72636c353eSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73636c353eSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74636c353eSmrg# depending on how configure is run.  This is pretty annoying, since
75636c353eSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76636c353eSmrg# source directory, any form will work fine, but in subdirectories a
77636c353eSmrg# relative path needs to be adjusted first.
78636c353eSmrg#
79636c353eSmrg# $ac_aux_dir/missing
80636c353eSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81636c353eSmrg# $top_srcdir/$ac_aux_dir/missing
82636c353eSmrg#    fails if $ac_aux_dir is absolute,
83636c353eSmrg#    fails when called from a subdirectory in a VPATH build with
84636c353eSmrg#          a relative $ac_aux_dir
85636c353eSmrg#
86636c353eSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87636c353eSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
88636c353eSmrg# harmless because $srcdir is '.', but things will broke when you
89636c353eSmrg# start a VPATH build or use an absolute $srcdir.
90636c353eSmrg#
91636c353eSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92636c353eSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93636c353eSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94636c353eSmrg# and then we would define $MISSING as
95636c353eSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96636c353eSmrg# This will work as long as MISSING is not called from configure, because
97636c353eSmrg# unfortunately $(top_srcdir) has no meaning in configure.
98636c353eSmrg# However there are other variables, like CC, which are often used in
99636c353eSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
100636c353eSmrg#
101636c353eSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
102636c353eSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
103636c353eSmrg# configured tree to be moved without reconfiguration.
104636c353eSmrg
105636c353eSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
106636c353eSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
107636c353eSmrg# Expand $ac_aux_dir to an absolute path.
108636c353eSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
109e07dc26bSmrg])
110e07dc26bSmrg
111636c353eSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112e07dc26bSmrg
113636c353eSmrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
114636c353eSmrg#
115636c353eSmrg# This file is free software; the Free Software Foundation
116636c353eSmrg# gives unlimited permission to copy and/or distribute it,
117636c353eSmrg# with or without modifications, as long as this notice is preserved.
118e07dc26bSmrg
119636c353eSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
120636c353eSmrg# -------------------------------------
121636c353eSmrg# Define a conditional.
122636c353eSmrgAC_DEFUN([AM_CONDITIONAL],
123636c353eSmrg[AC_PREREQ([2.52])dnl
124636c353eSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
125636c353eSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
126636c353eSmrgAC_SUBST([$1_TRUE])dnl
127636c353eSmrgAC_SUBST([$1_FALSE])dnl
128636c353eSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
129636c353eSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
130636c353eSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
131636c353eSmrgif $2; then
132636c353eSmrg  $1_TRUE=
133636c353eSmrg  $1_FALSE='#'
134636c353eSmrgelse
135636c353eSmrg  $1_TRUE='#'
136636c353eSmrg  $1_FALSE=
137636c353eSmrgfi
138636c353eSmrgAC_CONFIG_COMMANDS_PRE(
139636c353eSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
140636c353eSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
141636c353eSmrgUsually this means the macro was only invoked conditionally.]])
142636c353eSmrgfi])])
143e07dc26bSmrg
144636c353eSmrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
145636c353eSmrg#
146636c353eSmrg# This file is free software; the Free Software Foundation
147636c353eSmrg# gives unlimited permission to copy and/or distribute it,
148636c353eSmrg# with or without modifications, as long as this notice is preserved.
149e07dc26bSmrg
150e07dc26bSmrg
151636c353eSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
152636c353eSmrg# written in clear, in which case automake, when reading aclocal.m4,
153636c353eSmrg# will think it sees a *use*, and therefore will trigger all it's
154636c353eSmrg# C support machinery.  Also note that it means that autoscan, seeing
155636c353eSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
156e07dc26bSmrg
157e07dc26bSmrg
158636c353eSmrg# _AM_DEPENDENCIES(NAME)
159636c353eSmrg# ----------------------
160636c353eSmrg# See how the compiler implements dependency checking.
161636c353eSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
162636c353eSmrg# We try a few techniques and use that to set a single cache variable.
163636c353eSmrg#
164636c353eSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
165636c353eSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
166636c353eSmrg# dependency, and given that the user is not expected to run this macro,
167636c353eSmrg# just rely on AC_PROG_CC.
168636c353eSmrgAC_DEFUN([_AM_DEPENDENCIES],
169636c353eSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
170636c353eSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
171636c353eSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
172636c353eSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
173e07dc26bSmrg
174636c353eSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
175636c353eSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
176636c353eSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
177636c353eSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
178636c353eSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
179636c353eSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
180636c353eSmrg                    [depcc="$$1"   am_compiler_list=])
181e07dc26bSmrg
182636c353eSmrgAC_CACHE_CHECK([dependency style of $depcc],
183636c353eSmrg               [am_cv_$1_dependencies_compiler_type],
184636c353eSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
185636c353eSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
186636c353eSmrg  # making bogus files that we don't know about and never remove.  For
187636c353eSmrg  # instance it was reported that on HP-UX the gcc test will end up
188636c353eSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
189636c353eSmrg  # in D".
190636c353eSmrg  rm -rf conftest.dir
191636c353eSmrg  mkdir conftest.dir
192636c353eSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
193636c353eSmrg  # using a relative directory.
194636c353eSmrg  cp "$am_depcomp" conftest.dir
195636c353eSmrg  cd conftest.dir
196636c353eSmrg  # We will build objects and dependencies in a subdirectory because
197636c353eSmrg  # it helps to detect inapplicable dependency modes.  For instance
198636c353eSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
199636c353eSmrg  # side effect of compilation, but ICC will put the dependencies in
200636c353eSmrg  # the current directory while Tru64 will put them in the object
201636c353eSmrg  # directory.
202636c353eSmrg  mkdir sub
203e07dc26bSmrg
204636c353eSmrg  am_cv_$1_dependencies_compiler_type=none
205636c353eSmrg  if test "$am_compiler_list" = ""; then
206636c353eSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
207636c353eSmrg  fi
208636c353eSmrg  am__universal=false
209636c353eSmrg  m4_case([$1], [CC],
210636c353eSmrg    [case " $depcc " in #(
211636c353eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
212636c353eSmrg     esac],
213636c353eSmrg    [CXX],
214636c353eSmrg    [case " $depcc " in #(
215636c353eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
216636c353eSmrg     esac])
217e07dc26bSmrg
218636c353eSmrg  for depmode in $am_compiler_list; do
219636c353eSmrg    # Setup a source with many dependencies, because some compilers
220636c353eSmrg    # like to wrap large dependency lists on column 80 (with \), and
221636c353eSmrg    # we should not choose a depcomp mode which is confused by this.
222636c353eSmrg    #
223636c353eSmrg    # We need to recreate these files for each test, as the compiler may
224636c353eSmrg    # overwrite some of them when testing with obscure command lines.
225636c353eSmrg    # This happens at least with the AIX C compiler.
226636c353eSmrg    : > sub/conftest.c
227636c353eSmrg    for i in 1 2 3 4 5 6; do
228636c353eSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
229636c353eSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
230636c353eSmrg      # Solaris 10 /bin/sh.
231636c353eSmrg      echo '/* dummy */' > sub/conftst$i.h
232e07dc26bSmrg    done
233636c353eSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
234e07dc26bSmrg
235636c353eSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
236636c353eSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
237636c353eSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
238636c353eSmrg    # versions had trouble with output in subdirs.
239636c353eSmrg    am__obj=sub/conftest.${OBJEXT-o}
240636c353eSmrg    am__minus_obj="-o $am__obj"
241636c353eSmrg    case $depmode in
242636c353eSmrg    gcc)
243636c353eSmrg      # This depmode causes a compiler race in universal mode.
244636c353eSmrg      test "$am__universal" = false || continue
245636c353eSmrg      ;;
246636c353eSmrg    nosideeffect)
247636c353eSmrg      # After this tag, mechanisms are not by side-effect, so they'll
248636c353eSmrg      # only be used when explicitly requested.
249636c353eSmrg      if test "x$enable_dependency_tracking" = xyes; then
250636c353eSmrg	continue
251636c353eSmrg      else
252636c353eSmrg	break
253636c353eSmrg      fi
254636c353eSmrg      ;;
255636c353eSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
256636c353eSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
257636c353eSmrg      # not run yet.  These depmodes are late enough in the game, and
258636c353eSmrg      # so weak that their functioning should not be impacted.
259636c353eSmrg      am__obj=conftest.${OBJEXT-o}
260636c353eSmrg      am__minus_obj=
261636c353eSmrg      ;;
262636c353eSmrg    none) break ;;
263636c353eSmrg    esac
264636c353eSmrg    if depmode=$depmode \
265636c353eSmrg       source=sub/conftest.c object=$am__obj \
266636c353eSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
267636c353eSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
268636c353eSmrg         >/dev/null 2>conftest.err &&
269636c353eSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
270636c353eSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
271636c353eSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
272636c353eSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
273636c353eSmrg      # icc doesn't choke on unknown options, it will just issue warnings
274636c353eSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
275636c353eSmrg      # that says an option was ignored or not supported.
276636c353eSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
277636c353eSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
278636c353eSmrg      # The diagnosis changed in icc 8.0:
279636c353eSmrg      #   icc: Command line remark: option '-MP' not supported
280636c353eSmrg      if (grep 'ignoring option' conftest.err ||
281636c353eSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
282636c353eSmrg        am_cv_$1_dependencies_compiler_type=$depmode
283636c353eSmrg        break
284636c353eSmrg      fi
285636c353eSmrg    fi
286636c353eSmrg  done
287e07dc26bSmrg
288636c353eSmrg  cd ..
289636c353eSmrg  rm -rf conftest.dir
290636c353eSmrgelse
291636c353eSmrg  am_cv_$1_dependencies_compiler_type=none
292636c353eSmrgfi
293636c353eSmrg])
294636c353eSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
295636c353eSmrgAM_CONDITIONAL([am__fastdep$1], [
296636c353eSmrg  test "x$enable_dependency_tracking" != xno \
297636c353eSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
298e07dc26bSmrg])
299e07dc26bSmrg
300e07dc26bSmrg
301636c353eSmrg# AM_SET_DEPDIR
302636c353eSmrg# -------------
303636c353eSmrg# Choose a directory name for dependency files.
304636c353eSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
305636c353eSmrgAC_DEFUN([AM_SET_DEPDIR],
306636c353eSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
307636c353eSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
308636c353eSmrg])
309e07dc26bSmrg
310e07dc26bSmrg
311636c353eSmrg# AM_DEP_TRACK
312636c353eSmrg# ------------
313636c353eSmrgAC_DEFUN([AM_DEP_TRACK],
314636c353eSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
315636c353eSmrgAS_HELP_STRING(
316636c353eSmrg  [--enable-dependency-tracking],
317636c353eSmrg  [do not reject slow dependency extractors])
318636c353eSmrgAS_HELP_STRING(
319636c353eSmrg  [--disable-dependency-tracking],
320636c353eSmrg  [speeds up one-time build])])
321636c353eSmrgif test "x$enable_dependency_tracking" != xno; then
322636c353eSmrg  am_depcomp="$ac_aux_dir/depcomp"
323636c353eSmrg  AMDEPBACKSLASH='\'
324636c353eSmrg  am__nodep='_no'
325e07dc26bSmrgfi
326636c353eSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
327636c353eSmrgAC_SUBST([AMDEPBACKSLASH])dnl
328636c353eSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
329636c353eSmrgAC_SUBST([am__nodep])dnl
330636c353eSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
331e07dc26bSmrg])
332e07dc26bSmrg
333636c353eSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
334e07dc26bSmrg
335636c353eSmrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
336636c353eSmrg#
337636c353eSmrg# This file is free software; the Free Software Foundation
338636c353eSmrg# gives unlimited permission to copy and/or distribute it,
339636c353eSmrg# with or without modifications, as long as this notice is preserved.
340e07dc26bSmrg
341636c353eSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
342636c353eSmrg# ------------------------------
343636c353eSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
344636c353eSmrg[{
345636c353eSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
346636c353eSmrg  # are listed without --file.  Let's play safe and only enable the eval
347636c353eSmrg  # if we detect the quoting.
348636c353eSmrg  # TODO: see whether this extra hack can be removed once we start
349636c353eSmrg  # requiring Autoconf 2.70 or later.
350636c353eSmrg  AS_CASE([$CONFIG_FILES],
351636c353eSmrg          [*\'*], [eval set x "$CONFIG_FILES"],
352636c353eSmrg          [*], [set x $CONFIG_FILES])
353636c353eSmrg  shift
354636c353eSmrg  # Used to flag and report bootstrapping failures.
355636c353eSmrg  am_rc=0
356636c353eSmrg  for am_mf
357636c353eSmrg  do
358636c353eSmrg    # Strip MF so we end up with the name of the file.
359636c353eSmrg    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
360636c353eSmrg    # Check whether this is an Automake generated Makefile which includes
361636c353eSmrg    # dependency-tracking related rules and includes.
362636c353eSmrg    # Grep'ing the whole file directly is not great: AIX grep has a line
363636c353eSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
364636c353eSmrg    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
365636c353eSmrg      || continue
366636c353eSmrg    am_dirpart=`AS_DIRNAME(["$am_mf"])`
367636c353eSmrg    am_filepart=`AS_BASENAME(["$am_mf"])`
368636c353eSmrg    AM_RUN_LOG([cd "$am_dirpart" \
369636c353eSmrg      && sed -e '/# am--include-marker/d' "$am_filepart" \
370636c353eSmrg        | $MAKE -f - am--depfiles]) || am_rc=$?
371636c353eSmrg  done
372636c353eSmrg  if test $am_rc -ne 0; then
373636c353eSmrg    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
374636c353eSmrg    for automatic dependency tracking.  If GNU make was not used, consider
375636c353eSmrg    re-running the configure script with MAKE="gmake" (or whatever is
376636c353eSmrg    necessary).  You can also try re-running configure with the
377636c353eSmrg    '--disable-dependency-tracking' option to at least be able to build
378636c353eSmrg    the package (albeit without support for automatic dependency tracking).])
379e07dc26bSmrg  fi
380636c353eSmrg  AS_UNSET([am_dirpart])
381636c353eSmrg  AS_UNSET([am_filepart])
382636c353eSmrg  AS_UNSET([am_mf])
383636c353eSmrg  AS_UNSET([am_rc])
384636c353eSmrg  rm -f conftest-deps.mk
385636c353eSmrg}
386636c353eSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
387e07dc26bSmrg
388e07dc26bSmrg
389636c353eSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
390636c353eSmrg# -----------------------------
391636c353eSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
392636c353eSmrg#
393636c353eSmrg# This code is only required when automatic dependency tracking is enabled.
394636c353eSmrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
395636c353eSmrg# order to bootstrap the dependency handling code.
396636c353eSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
397636c353eSmrg[AC_CONFIG_COMMANDS([depfiles],
398636c353eSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
399636c353eSmrg     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
400e07dc26bSmrg
401636c353eSmrg# Do all the work for Automake.                             -*- Autoconf -*-
402e07dc26bSmrg
403636c353eSmrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
404636c353eSmrg#
405636c353eSmrg# This file is free software; the Free Software Foundation
406636c353eSmrg# gives unlimited permission to copy and/or distribute it,
407636c353eSmrg# with or without modifications, as long as this notice is preserved.
408e07dc26bSmrg
409636c353eSmrg# This macro actually does too much.  Some checks are only needed if
410636c353eSmrg# your package does certain things.  But this isn't really a big deal.
411e07dc26bSmrg
412636c353eSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
413636c353eSmrgm4_define([AC_PROG_CC],
414636c353eSmrgm4_defn([AC_PROG_CC])
415636c353eSmrg[_AM_PROG_CC_C_O
416636c353eSmrg])
417e07dc26bSmrg
418636c353eSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
419636c353eSmrg# AM_INIT_AUTOMAKE([OPTIONS])
420636c353eSmrg# -----------------------------------------------
421636c353eSmrg# The call with PACKAGE and VERSION arguments is the old style
422636c353eSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
423636c353eSmrg# and VERSION should now be passed to AC_INIT and removed from
424636c353eSmrg# the call to AM_INIT_AUTOMAKE.
425636c353eSmrg# We support both call styles for the transition.  After
426636c353eSmrg# the next Automake release, Autoconf can make the AC_INIT
427636c353eSmrg# arguments mandatory, and then we can depend on a new Autoconf
428636c353eSmrg# release and drop the old call support.
429636c353eSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
430636c353eSmrg[AC_PREREQ([2.65])dnl
431636c353eSmrgm4_ifdef([_$0_ALREADY_INIT],
432636c353eSmrg  [m4_fatal([$0 expanded multiple times
433636c353eSmrg]m4_defn([_$0_ALREADY_INIT]))],
434636c353eSmrg  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
435636c353eSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
436636c353eSmrgdnl the ones we care about.
437636c353eSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
438636c353eSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
439636c353eSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
440636c353eSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
441636c353eSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
442636c353eSmrg  # is not polluted with repeated "-I."
443636c353eSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
444636c353eSmrg  # test to see if srcdir already configured
445636c353eSmrg  if test -f $srcdir/config.status; then
446636c353eSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
447636c353eSmrg  fi
448636c353eSmrgfi
449e07dc26bSmrg
450636c353eSmrg# test whether we have cygpath
451636c353eSmrgif test -z "$CYGPATH_W"; then
452636c353eSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
453636c353eSmrg    CYGPATH_W='cygpath -w'
454636c353eSmrg  else
455636c353eSmrg    CYGPATH_W=echo
456636c353eSmrg  fi
457636c353eSmrgfi
458636c353eSmrgAC_SUBST([CYGPATH_W])
459e07dc26bSmrg
460636c353eSmrg# Define the identity of the package.
461636c353eSmrgdnl Distinguish between old-style and new-style calls.
462636c353eSmrgm4_ifval([$2],
463636c353eSmrg[AC_DIAGNOSE([obsolete],
464636c353eSmrg             [$0: two- and three-arguments forms are deprecated.])
465636c353eSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
466636c353eSmrg AC_SUBST([PACKAGE], [$1])dnl
467636c353eSmrg AC_SUBST([VERSION], [$2])],
468636c353eSmrg[_AM_SET_OPTIONS([$1])dnl
469636c353eSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
470636c353eSmrgm4_if(
471636c353eSmrg  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
472636c353eSmrg  [ok:ok],,
473636c353eSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
474636c353eSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
475636c353eSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
476e07dc26bSmrg
477636c353eSmrg_AM_IF_OPTION([no-define],,
478636c353eSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
479636c353eSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
480e07dc26bSmrg
481636c353eSmrg# Some tools Automake needs.
482636c353eSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
483636c353eSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
484636c353eSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
485636c353eSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
486636c353eSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
487636c353eSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
488636c353eSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
489636c353eSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
490636c353eSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
491636c353eSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
492636c353eSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
493636c353eSmrg# dies out for good.  For more background, see:
494636c353eSmrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
495636c353eSmrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
496636c353eSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
497636c353eSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
498636c353eSmrg# system "awk" is bad on some platforms.
499636c353eSmrgAC_REQUIRE([AC_PROG_AWK])dnl
500636c353eSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
501636c353eSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
502636c353eSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
503636c353eSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
504636c353eSmrg			     [_AM_PROG_TAR([v7])])])
505636c353eSmrg_AM_IF_OPTION([no-dependencies],,
506636c353eSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
507636c353eSmrg		  [_AM_DEPENDENCIES([CC])],
508636c353eSmrg		  [m4_define([AC_PROG_CC],
509636c353eSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
510636c353eSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
511636c353eSmrg		  [_AM_DEPENDENCIES([CXX])],
512636c353eSmrg		  [m4_define([AC_PROG_CXX],
513636c353eSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
514636c353eSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
515636c353eSmrg		  [_AM_DEPENDENCIES([OBJC])],
516636c353eSmrg		  [m4_define([AC_PROG_OBJC],
517636c353eSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
518636c353eSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
519636c353eSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
520636c353eSmrg		  [m4_define([AC_PROG_OBJCXX],
521636c353eSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
522e07dc26bSmrg])
523636c353eSmrg# Variables for tags utilities; see am/tags.am
524636c353eSmrgif test -z "$CTAGS"; then
525636c353eSmrg  CTAGS=ctags
526636c353eSmrgfi
527636c353eSmrgAC_SUBST([CTAGS])
528636c353eSmrgif test -z "$ETAGS"; then
529636c353eSmrg  ETAGS=etags
530636c353eSmrgfi
531636c353eSmrgAC_SUBST([ETAGS])
532636c353eSmrgif test -z "$CSCOPE"; then
533636c353eSmrg  CSCOPE=cscope
534636c353eSmrgfi
535636c353eSmrgAC_SUBST([CSCOPE])
536e07dc26bSmrg
537636c353eSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
538636c353eSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
539636c353eSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
540636c353eSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
541636c353eSmrgAC_CONFIG_COMMANDS_PRE(dnl
542636c353eSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
543636c353eSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
544e07dc26bSmrg
545636c353eSmrg# POSIX will say in a future version that running "rm -f" with no argument
546636c353eSmrg# is OK; and we want to be able to make that assumption in our Makefile
547636c353eSmrg# recipes.  So use an aggressive probe to check that the usage we want is
548636c353eSmrg# actually supported "in the wild" to an acceptable degree.
549636c353eSmrg# See automake bug#10828.
550636c353eSmrg# To make any issue more visible, cause the running configure to be aborted
551636c353eSmrg# by default if the 'rm' program in use doesn't match our expectations; the
552636c353eSmrg# user can still override this though.
553636c353eSmrgif rm -f && rm -fr && rm -rf; then : OK; else
554636c353eSmrg  cat >&2 <<'END'
555636c353eSmrgOops!
556e07dc26bSmrg
557636c353eSmrgYour 'rm' program seems unable to run without file operands specified
558636c353eSmrgon the command line, even when the '-f' option is present.  This is contrary
559636c353eSmrgto the behaviour of most rm programs out there, and not conforming with
560636c353eSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
561e07dc26bSmrg
562636c353eSmrgPlease tell bug-automake@gnu.org about your system, including the value
563636c353eSmrgof your $PATH and any error possibly output before this message.  This
564636c353eSmrgcan help us improve future automake versions.
565e07dc26bSmrg
566636c353eSmrgEND
567636c353eSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
568636c353eSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
569636c353eSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
570636c353eSmrg    echo >&2
571636c353eSmrg  else
572636c353eSmrg    cat >&2 <<'END'
573636c353eSmrgAborting the configuration process, to ensure you take notice of the issue.
574e07dc26bSmrg
575636c353eSmrgYou can download and install GNU coreutils to get an 'rm' implementation
576636c353eSmrgthat behaves properly: <https://www.gnu.org/software/coreutils/>.
577e07dc26bSmrg
578636c353eSmrgIf you want to complete the configuration process using your problematic
579636c353eSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
580636c353eSmrgto "yes", and re-run configure.
581e07dc26bSmrg
582636c353eSmrgEND
583636c353eSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
584636c353eSmrg  fi
585636c353eSmrgfi
586636c353eSmrgdnl The trailing newline in this macro's definition is deliberate, for
587636c353eSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
588636c353eSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
589e07dc26bSmrg])
590e07dc26bSmrg
591636c353eSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
592636c353eSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
593636c353eSmrgdnl mangled by Autoconf and run in a shell conditional statement.
594636c353eSmrgm4_define([_AC_COMPILER_EXEEXT],
595636c353eSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
596e07dc26bSmrg
597636c353eSmrg# When config.status generates a header, we must update the stamp-h file.
598636c353eSmrg# This file resides in the same directory as the config header
599636c353eSmrg# that is generated.  The stamp files are numbered to have different names.
600e07dc26bSmrg
601636c353eSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
602636c353eSmrg# loop where config.status creates the headers, so we can generate
603636c353eSmrg# our stamp files there.
604636c353eSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
605636c353eSmrg[# Compute $1's index in $config_headers.
606636c353eSmrg_am_arg=$1
607636c353eSmrg_am_stamp_count=1
608636c353eSmrgfor _am_header in $config_headers :; do
609636c353eSmrg  case $_am_header in
610636c353eSmrg    $_am_arg | $_am_arg:* )
611636c353eSmrg      break ;;
612636c353eSmrg    * )
613636c353eSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
614636c353eSmrg  esac
615636c353eSmrgdone
616636c353eSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
617e07dc26bSmrg
618636c353eSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
619636c353eSmrg#
620636c353eSmrg# This file is free software; the Free Software Foundation
621636c353eSmrg# gives unlimited permission to copy and/or distribute it,
622636c353eSmrg# with or without modifications, as long as this notice is preserved.
623e07dc26bSmrg
624636c353eSmrg# AM_PROG_INSTALL_SH
625636c353eSmrg# ------------------
626636c353eSmrg# Define $install_sh.
627636c353eSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
628636c353eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
629636c353eSmrgif test x"${install_sh+set}" != xset; then
630636c353eSmrg  case $am_aux_dir in
631636c353eSmrg  *\ * | *\	*)
632636c353eSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
633636c353eSmrg  *)
634636c353eSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
635636c353eSmrg  esac
636636c353eSmrgfi
637636c353eSmrgAC_SUBST([install_sh])])
638e07dc26bSmrg
639636c353eSmrg# Copyright (C) 2003-2021 Free Software Foundation, Inc.
640636c353eSmrg#
641636c353eSmrg# This file is free software; the Free Software Foundation
642636c353eSmrg# gives unlimited permission to copy and/or distribute it,
643636c353eSmrg# with or without modifications, as long as this notice is preserved.
644e07dc26bSmrg
645636c353eSmrg# Check whether the underlying file-system supports filenames
646636c353eSmrg# with a leading dot.  For instance MS-DOS doesn't.
647636c353eSmrgAC_DEFUN([AM_SET_LEADING_DOT],
648636c353eSmrg[rm -rf .tst 2>/dev/null
649636c353eSmrgmkdir .tst 2>/dev/null
650636c353eSmrgif test -d .tst; then
651636c353eSmrg  am__leading_dot=.
652636c353eSmrgelse
653636c353eSmrg  am__leading_dot=_
654636c353eSmrgfi
655636c353eSmrgrmdir .tst 2>/dev/null
656636c353eSmrgAC_SUBST([am__leading_dot])])
657e07dc26bSmrg
658636c353eSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
659e07dc26bSmrg
660636c353eSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
661636c353eSmrg#
662636c353eSmrg# This file is free software; the Free Software Foundation
663636c353eSmrg# gives unlimited permission to copy and/or distribute it,
664636c353eSmrg# with or without modifications, as long as this notice is preserved.
665e07dc26bSmrg
666636c353eSmrg# AM_MAKE_INCLUDE()
667636c353eSmrg# -----------------
668636c353eSmrg# Check whether make has an 'include' directive that can support all
669636c353eSmrg# the idioms we need for our automatic dependency tracking code.
670636c353eSmrgAC_DEFUN([AM_MAKE_INCLUDE],
671636c353eSmrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
672636c353eSmrgcat > confinc.mk << 'END'
673636c353eSmrgam__doit:
674636c353eSmrg	@echo this is the am__doit target >confinc.out
675636c353eSmrg.PHONY: am__doit
676636c353eSmrgEND
677636c353eSmrgam__include="#"
678636c353eSmrgam__quote=
679636c353eSmrg# BSD make does it like this.
680636c353eSmrgecho '.include "confinc.mk" # ignored' > confmf.BSD
681636c353eSmrg# Other make implementations (GNU, Solaris 10, AIX) do it like this.
682636c353eSmrgecho 'include confinc.mk # ignored' > confmf.GNU
683636c353eSmrg_am_result=no
684636c353eSmrgfor s in GNU BSD; do
685636c353eSmrg  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
686636c353eSmrg  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
687636c353eSmrg      ['0:this is the am__doit target'],
688636c353eSmrg      [AS_CASE([$s],
689636c353eSmrg          [BSD], [am__include='.include' am__quote='"'],
690636c353eSmrg          [am__include='include' am__quote=''])])
691636c353eSmrg  if test "$am__include" != "#"; then
692636c353eSmrg    _am_result="yes ($s style)"
693636c353eSmrg    break
694636c353eSmrg  fi
695636c353eSmrgdone
696636c353eSmrgrm -f confinc.* confmf.*
697636c353eSmrgAC_MSG_RESULT([${_am_result}])
698636c353eSmrgAC_SUBST([am__include])])
699636c353eSmrgAC_SUBST([am__quote])])
700e07dc26bSmrg
701636c353eSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
702e07dc26bSmrg
703636c353eSmrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
704636c353eSmrg#
705636c353eSmrg# This file is free software; the Free Software Foundation
706636c353eSmrg# gives unlimited permission to copy and/or distribute it,
707636c353eSmrg# with or without modifications, as long as this notice is preserved.
708e07dc26bSmrg
709636c353eSmrg# AM_MISSING_PROG(NAME, PROGRAM)
710636c353eSmrg# ------------------------------
711636c353eSmrgAC_DEFUN([AM_MISSING_PROG],
712636c353eSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
713636c353eSmrg$1=${$1-"${am_missing_run}$2"}
714636c353eSmrgAC_SUBST($1)])
715636c353eSmrg
716636c353eSmrg# AM_MISSING_HAS_RUN
717636c353eSmrg# ------------------
718636c353eSmrg# Define MISSING if not defined so far and test if it is modern enough.
719636c353eSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
720636c353eSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
721636c353eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
722636c353eSmrgAC_REQUIRE_AUX_FILE([missing])dnl
723636c353eSmrgif test x"${MISSING+set}" != xset; then
724636c353eSmrg  MISSING="\${SHELL} '$am_aux_dir/missing'"
725636c353eSmrgfi
726636c353eSmrg# Use eval to expand $SHELL
727636c353eSmrgif eval "$MISSING --is-lightweight"; then
728636c353eSmrg  am_missing_run="$MISSING "
729636c353eSmrgelse
730636c353eSmrg  am_missing_run=
731636c353eSmrg  AC_MSG_WARN(['missing' script is too old or missing])
732636c353eSmrgfi
733636c353eSmrg])
734e07dc26bSmrg
735636c353eSmrg# Helper functions for option handling.                     -*- Autoconf -*-
736e07dc26bSmrg
737636c353eSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
738636c353eSmrg#
739636c353eSmrg# This file is free software; the Free Software Foundation
740636c353eSmrg# gives unlimited permission to copy and/or distribute it,
741636c353eSmrg# with or without modifications, as long as this notice is preserved.
742e07dc26bSmrg
743636c353eSmrg# _AM_MANGLE_OPTION(NAME)
744636c353eSmrg# -----------------------
745636c353eSmrgAC_DEFUN([_AM_MANGLE_OPTION],
746636c353eSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
747e07dc26bSmrg
748636c353eSmrg# _AM_SET_OPTION(NAME)
749636c353eSmrg# --------------------
750636c353eSmrg# Set option NAME.  Presently that only means defining a flag for this option.
751636c353eSmrgAC_DEFUN([_AM_SET_OPTION],
752636c353eSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
753e07dc26bSmrg
754636c353eSmrg# _AM_SET_OPTIONS(OPTIONS)
755636c353eSmrg# ------------------------
756636c353eSmrg# OPTIONS is a space-separated list of Automake options.
757636c353eSmrgAC_DEFUN([_AM_SET_OPTIONS],
758636c353eSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
759e07dc26bSmrg
760636c353eSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
761636c353eSmrg# -------------------------------------------
762636c353eSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
763636c353eSmrgAC_DEFUN([_AM_IF_OPTION],
764636c353eSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
765e07dc26bSmrg
766636c353eSmrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
767636c353eSmrg#
768636c353eSmrg# This file is free software; the Free Software Foundation
769636c353eSmrg# gives unlimited permission to copy and/or distribute it,
770636c353eSmrg# with or without modifications, as long as this notice is preserved.
771e07dc26bSmrg
772636c353eSmrg# _AM_PROG_CC_C_O
773636c353eSmrg# ---------------
774636c353eSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
775636c353eSmrg# to automatically call this.
776636c353eSmrgAC_DEFUN([_AM_PROG_CC_C_O],
777636c353eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
778636c353eSmrgAC_REQUIRE_AUX_FILE([compile])dnl
779636c353eSmrgAC_LANG_PUSH([C])dnl
780636c353eSmrgAC_CACHE_CHECK(
781636c353eSmrg  [whether $CC understands -c and -o together],
782636c353eSmrg  [am_cv_prog_cc_c_o],
783636c353eSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
784636c353eSmrg  # Make sure it works both with $CC and with simple cc.
785636c353eSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
786636c353eSmrg  # compilers refuse to overwrite an existing .o file with -o,
787636c353eSmrg  # though they will create one.
788636c353eSmrg  am_cv_prog_cc_c_o=yes
789636c353eSmrg  for am_i in 1 2; do
790636c353eSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
791636c353eSmrg         && test -f conftest2.$ac_objext; then
792636c353eSmrg      : OK
793636c353eSmrg    else
794636c353eSmrg      am_cv_prog_cc_c_o=no
795636c353eSmrg      break
796636c353eSmrg    fi
797636c353eSmrg  done
798636c353eSmrg  rm -f core conftest*
799636c353eSmrg  unset am_i])
800636c353eSmrgif test "$am_cv_prog_cc_c_o" != yes; then
801636c353eSmrg   # Losing compiler, so override with the script.
802636c353eSmrg   # FIXME: It is wrong to rewrite CC.
803636c353eSmrg   # But if we don't then we get into trouble of one sort or another.
804636c353eSmrg   # A longer-term fix would be to have automake use am__CC in this case,
805636c353eSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
806636c353eSmrg   CC="$am_aux_dir/compile $CC"
807636c353eSmrgfi
808636c353eSmrgAC_LANG_POP([C])])
809e07dc26bSmrg
810636c353eSmrg# For backward compatibility.
811636c353eSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
812e07dc26bSmrg
813636c353eSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
814e07dc26bSmrg#
815636c353eSmrg# This file is free software; the Free Software Foundation
816636c353eSmrg# gives unlimited permission to copy and/or distribute it,
817636c353eSmrg# with or without modifications, as long as this notice is preserved.
818e07dc26bSmrg
819636c353eSmrg# AM_RUN_LOG(COMMAND)
820636c353eSmrg# -------------------
821636c353eSmrg# Run COMMAND, save the exit status in ac_status, and log it.
822636c353eSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
823636c353eSmrgAC_DEFUN([AM_RUN_LOG],
824636c353eSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
825636c353eSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
826636c353eSmrg   ac_status=$?
827636c353eSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
828636c353eSmrg   (exit $ac_status); }])
829e07dc26bSmrg
830636c353eSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
831e07dc26bSmrg
832636c353eSmrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
833e07dc26bSmrg#
834636c353eSmrg# This file is free software; the Free Software Foundation
835636c353eSmrg# gives unlimited permission to copy and/or distribute it,
836636c353eSmrg# with or without modifications, as long as this notice is preserved.
837e07dc26bSmrg
838636c353eSmrg# AM_SANITY_CHECK
839636c353eSmrg# ---------------
840636c353eSmrgAC_DEFUN([AM_SANITY_CHECK],
841636c353eSmrg[AC_MSG_CHECKING([whether build environment is sane])
842636c353eSmrg# Reject unsafe characters in $srcdir or the absolute working directory
843636c353eSmrg# name.  Accept space and tab only in the latter.
844636c353eSmrgam_lf='
845636c353eSmrg'
846636c353eSmrgcase `pwd` in
847636c353eSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
848636c353eSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
849636c353eSmrgesac
850636c353eSmrgcase $srcdir in
851636c353eSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
852636c353eSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
853636c353eSmrgesac
854e07dc26bSmrg
855636c353eSmrg# Do 'set' in a subshell so we don't clobber the current shell's
856636c353eSmrg# arguments.  Must try -L first in case configure is actually a
857636c353eSmrg# symlink; some systems play weird games with the mod time of symlinks
858636c353eSmrg# (eg FreeBSD returns the mod time of the symlink's containing
859636c353eSmrg# directory).
860636c353eSmrgif (
861636c353eSmrg   am_has_slept=no
862636c353eSmrg   for am_try in 1 2; do
863636c353eSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
864636c353eSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
865636c353eSmrg     if test "$[*]" = "X"; then
866636c353eSmrg	# -L didn't work.
867636c353eSmrg	set X `ls -t "$srcdir/configure" conftest.file`
868636c353eSmrg     fi
869636c353eSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
870636c353eSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
871e07dc26bSmrg
872636c353eSmrg	# If neither matched, then we have a broken ls.  This can happen
873636c353eSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
874636c353eSmrg	# broken ls alias from the environment.  This has actually
875636c353eSmrg	# happened.  Such a system could not be considered "sane".
876636c353eSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
877636c353eSmrg  alias in your environment])
878636c353eSmrg     fi
879636c353eSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
880636c353eSmrg       break
881636c353eSmrg     fi
882636c353eSmrg     # Just in case.
883636c353eSmrg     sleep 1
884636c353eSmrg     am_has_slept=yes
885636c353eSmrg   done
886636c353eSmrg   test "$[2]" = conftest.file
887636c353eSmrg   )
888636c353eSmrgthen
889636c353eSmrg   # Ok.
890636c353eSmrg   :
891636c353eSmrgelse
892636c353eSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
893636c353eSmrgCheck your system clock])
894636c353eSmrgfi
895636c353eSmrgAC_MSG_RESULT([yes])
896636c353eSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
897636c353eSmrg# generated files are strictly newer.
898636c353eSmrgam_sleep_pid=
899636c353eSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
900636c353eSmrg  ( sleep 1 ) &
901636c353eSmrg  am_sleep_pid=$!
902636c353eSmrgfi
903636c353eSmrgAC_CONFIG_COMMANDS_PRE(
904636c353eSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
905636c353eSmrg   if test -n "$am_sleep_pid"; then
906636c353eSmrg     # Hide warnings about reused PIDs.
907636c353eSmrg     wait $am_sleep_pid 2>/dev/null
908636c353eSmrg   fi
909636c353eSmrg   AC_MSG_RESULT([done])])
910636c353eSmrgrm -f conftest.file
911636c353eSmrg])
912e07dc26bSmrg
913636c353eSmrg# Copyright (C) 2009-2021 Free Software Foundation, Inc.
914636c353eSmrg#
915636c353eSmrg# This file is free software; the Free Software Foundation
916636c353eSmrg# gives unlimited permission to copy and/or distribute it,
917636c353eSmrg# with or without modifications, as long as this notice is preserved.
918e07dc26bSmrg
919636c353eSmrg# AM_SILENT_RULES([DEFAULT])
920636c353eSmrg# --------------------------
921636c353eSmrg# Enable less verbose build rules; with the default set to DEFAULT
922636c353eSmrg# ("yes" being less verbose, "no" or empty being verbose).
923636c353eSmrgAC_DEFUN([AM_SILENT_RULES],
924636c353eSmrg[AC_ARG_ENABLE([silent-rules], [dnl
925636c353eSmrgAS_HELP_STRING(
926636c353eSmrg  [--enable-silent-rules],
927636c353eSmrg  [less verbose build output (undo: "make V=1")])
928636c353eSmrgAS_HELP_STRING(
929636c353eSmrg  [--disable-silent-rules],
930636c353eSmrg  [verbose build output (undo: "make V=0")])dnl
931636c353eSmrg])
932636c353eSmrgcase $enable_silent_rules in @%:@ (((
933636c353eSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
934636c353eSmrg   no) AM_DEFAULT_VERBOSITY=1;;
935636c353eSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
936636c353eSmrgesac
937636c353eSmrgdnl
938636c353eSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
939636c353eSmrgdnl do not support nested variable expansions.
940636c353eSmrgdnl See automake bug#9928 and bug#10237.
941636c353eSmrgam_make=${MAKE-make}
942636c353eSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
943636c353eSmrg   [am_cv_make_support_nested_variables],
944636c353eSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
945636c353eSmrgBAR0=false
946636c353eSmrgBAR1=true
947636c353eSmrgV=1
948636c353eSmrgam__doit:
949636c353eSmrg	@$(TRUE)
950636c353eSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
951636c353eSmrg  am_cv_make_support_nested_variables=yes
952636c353eSmrgelse
953636c353eSmrg  am_cv_make_support_nested_variables=no
954636c353eSmrgfi])
955636c353eSmrgif test $am_cv_make_support_nested_variables = yes; then
956636c353eSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
957636c353eSmrg  AM_V='$(V)'
958636c353eSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
959636c353eSmrgelse
960636c353eSmrg  AM_V=$AM_DEFAULT_VERBOSITY
961636c353eSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
962636c353eSmrgfi
963636c353eSmrgAC_SUBST([AM_V])dnl
964636c353eSmrgAM_SUBST_NOTMAKE([AM_V])dnl
965636c353eSmrgAC_SUBST([AM_DEFAULT_V])dnl
966636c353eSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
967636c353eSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
968636c353eSmrgAM_BACKSLASH='\'
969636c353eSmrgAC_SUBST([AM_BACKSLASH])dnl
970636c353eSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
971636c353eSmrg])
972e07dc26bSmrg
973636c353eSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
974636c353eSmrg#
975636c353eSmrg# This file is free software; the Free Software Foundation
976636c353eSmrg# gives unlimited permission to copy and/or distribute it,
977636c353eSmrg# with or without modifications, as long as this notice is preserved.
978e07dc26bSmrg
979636c353eSmrg# AM_PROG_INSTALL_STRIP
980636c353eSmrg# ---------------------
981636c353eSmrg# One issue with vendor 'install' (even GNU) is that you can't
982636c353eSmrg# specify the program used to strip binaries.  This is especially
983636c353eSmrg# annoying in cross-compiling environments, where the build's strip
984636c353eSmrg# is unlikely to handle the host's binaries.
985636c353eSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
986636c353eSmrg# always use install-sh in "make install-strip", and initialize
987636c353eSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
988636c353eSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
989636c353eSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
990636c353eSmrg# Installed binaries are usually stripped using 'strip' when the user
991636c353eSmrg# run "make install-strip".  However 'strip' might not be the right
992636c353eSmrg# tool to use in cross-compilation environments, therefore Automake
993636c353eSmrg# will honor the 'STRIP' environment variable to overrule this program.
994636c353eSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
995636c353eSmrgif test "$cross_compiling" != no; then
996636c353eSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
997636c353eSmrgfi
998636c353eSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
999636c353eSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1000e07dc26bSmrg
1001636c353eSmrg# Copyright (C) 2006-2021 Free Software Foundation, Inc.
1002636c353eSmrg#
1003636c353eSmrg# This file is free software; the Free Software Foundation
1004636c353eSmrg# gives unlimited permission to copy and/or distribute it,
1005636c353eSmrg# with or without modifications, as long as this notice is preserved.
1006e07dc26bSmrg
1007636c353eSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
1008636c353eSmrg# ---------------------------
1009636c353eSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1010636c353eSmrg# This macro is traced by Automake.
1011636c353eSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1012e07dc26bSmrg
1013636c353eSmrg# AM_SUBST_NOTMAKE(VARIABLE)
1014636c353eSmrg# --------------------------
1015636c353eSmrg# Public sister of _AM_SUBST_NOTMAKE.
1016636c353eSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1017e07dc26bSmrg
1018636c353eSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1019e07dc26bSmrg
1020636c353eSmrg# Copyright (C) 2004-2021 Free Software Foundation, Inc.
1021636c353eSmrg#
1022636c353eSmrg# This file is free software; the Free Software Foundation
1023636c353eSmrg# gives unlimited permission to copy and/or distribute it,
1024636c353eSmrg# with or without modifications, as long as this notice is preserved.
1025e07dc26bSmrg
1026636c353eSmrg# _AM_PROG_TAR(FORMAT)
1027636c353eSmrg# --------------------
1028636c353eSmrg# Check how to create a tarball in format FORMAT.
1029636c353eSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1030636c353eSmrg#
1031636c353eSmrg# Substitute a variable $(am__tar) that is a command
1032636c353eSmrg# writing to stdout a FORMAT-tarball containing the directory
1033636c353eSmrg# $tardir.
1034636c353eSmrg#     tardir=directory && $(am__tar) > result.tar
1035636c353eSmrg#
1036636c353eSmrg# Substitute a variable $(am__untar) that extract such
1037636c353eSmrg# a tarball read from stdin.
1038636c353eSmrg#     $(am__untar) < result.tar
1039636c353eSmrg#
1040636c353eSmrgAC_DEFUN([_AM_PROG_TAR],
1041636c353eSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1042636c353eSmrg# in the wild :-(  We should find a proper way to deprecate it ...
1043636c353eSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1044e07dc26bSmrg
1045636c353eSmrg# We'll loop over all known methods to create a tar archive until one works.
1046636c353eSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1047e07dc26bSmrg
1048636c353eSmrgm4_if([$1], [v7],
1049636c353eSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1050e07dc26bSmrg
1051636c353eSmrg  [m4_case([$1],
1052636c353eSmrg    [ustar],
1053636c353eSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1054636c353eSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1055636c353eSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1056636c353eSmrg      # and bug#13588).
1057636c353eSmrg      am_max_uid=2097151 # 2^21 - 1
1058636c353eSmrg      am_max_gid=$am_max_uid
1059636c353eSmrg      # The $UID and $GID variables are not portable, so we need to resort
1060636c353eSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1061636c353eSmrg      # below are definitely unexpected, so allow the users to see them
1062636c353eSmrg      # (that is, avoid stderr redirection).
1063636c353eSmrg      am_uid=`id -u || echo unknown`
1064636c353eSmrg      am_gid=`id -g || echo unknown`
1065636c353eSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1066636c353eSmrg      if test $am_uid -le $am_max_uid; then
1067636c353eSmrg         AC_MSG_RESULT([yes])
1068636c353eSmrg      else
1069636c353eSmrg         AC_MSG_RESULT([no])
1070636c353eSmrg         _am_tools=none
1071636c353eSmrg      fi
1072636c353eSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1073636c353eSmrg      if test $am_gid -le $am_max_gid; then
1074636c353eSmrg         AC_MSG_RESULT([yes])
1075636c353eSmrg      else
1076636c353eSmrg        AC_MSG_RESULT([no])
1077636c353eSmrg        _am_tools=none
1078636c353eSmrg      fi],
1079e07dc26bSmrg
1080636c353eSmrg  [pax],
1081636c353eSmrg    [],
1082e07dc26bSmrg
1083636c353eSmrg  [m4_fatal([Unknown tar format])])
1084e07dc26bSmrg
1085636c353eSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
1086e07dc26bSmrg
1087636c353eSmrg  # Go ahead even if we have the value already cached.  We do so because we
1088636c353eSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
1089636c353eSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1090e07dc26bSmrg
1091636c353eSmrg  for _am_tool in $_am_tools; do
1092636c353eSmrg    case $_am_tool in
1093636c353eSmrg    gnutar)
1094636c353eSmrg      for _am_tar in tar gnutar gtar; do
1095636c353eSmrg        AM_RUN_LOG([$_am_tar --version]) && break
1096636c353eSmrg      done
1097636c353eSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1098636c353eSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1099636c353eSmrg      am__untar="$_am_tar -xf -"
1100636c353eSmrg      ;;
1101636c353eSmrg    plaintar)
1102636c353eSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
1103636c353eSmrg      # ustar tarball either.
1104636c353eSmrg      (tar --version) >/dev/null 2>&1 && continue
1105636c353eSmrg      am__tar='tar chf - "$$tardir"'
1106636c353eSmrg      am__tar_='tar chf - "$tardir"'
1107636c353eSmrg      am__untar='tar xf -'
1108636c353eSmrg      ;;
1109636c353eSmrg    pax)
1110636c353eSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
1111636c353eSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
1112636c353eSmrg      am__untar='pax -r'
1113636c353eSmrg      ;;
1114636c353eSmrg    cpio)
1115636c353eSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1116636c353eSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1117636c353eSmrg      am__untar='cpio -i -H $1 -d'
1118636c353eSmrg      ;;
1119636c353eSmrg    none)
1120636c353eSmrg      am__tar=false
1121636c353eSmrg      am__tar_=false
1122636c353eSmrg      am__untar=false
1123636c353eSmrg      ;;
1124636c353eSmrg    esac
1125e07dc26bSmrg
1126636c353eSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
1127636c353eSmrg    # and am__untar set.
1128636c353eSmrg    test -n "${am_cv_prog_tar_$1}" && break
1129e07dc26bSmrg
1130636c353eSmrg    # tar/untar a dummy directory, and stop if the command works.
1131636c353eSmrg    rm -rf conftest.dir
1132636c353eSmrg    mkdir conftest.dir
1133636c353eSmrg    echo GrepMe > conftest.dir/file
1134636c353eSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1135636c353eSmrg    rm -rf conftest.dir
1136636c353eSmrg    if test -s conftest.tar; then
1137636c353eSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
1138636c353eSmrg      AM_RUN_LOG([cat conftest.dir/file])
1139636c353eSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1140636c353eSmrg    fi
1141636c353eSmrg  done
1142636c353eSmrg  rm -rf conftest.dir
1143e07dc26bSmrg
1144636c353eSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1145636c353eSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1146e07dc26bSmrg
1147636c353eSmrgAC_SUBST([am__tar])
1148636c353eSmrgAC_SUBST([am__untar])
1149636c353eSmrg]) # _AM_PROG_TAR
1150e07dc26bSmrg
1151636c353eSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
1152636c353eSmrgdnl serial 11 (pkg-config-0.29)
1153636c353eSmrgdnl
1154636c353eSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1155636c353eSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
1156636c353eSmrgdnl
1157636c353eSmrgdnl This program is free software; you can redistribute it and/or modify
1158636c353eSmrgdnl it under the terms of the GNU General Public License as published by
1159636c353eSmrgdnl the Free Software Foundation; either version 2 of the License, or
1160636c353eSmrgdnl (at your option) any later version.
1161636c353eSmrgdnl
1162636c353eSmrgdnl This program is distributed in the hope that it will be useful, but
1163636c353eSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
1164636c353eSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1165636c353eSmrgdnl General Public License for more details.
1166636c353eSmrgdnl
1167636c353eSmrgdnl You should have received a copy of the GNU General Public License
1168636c353eSmrgdnl along with this program; if not, write to the Free Software
1169636c353eSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1170636c353eSmrgdnl 02111-1307, USA.
1171636c353eSmrgdnl
1172636c353eSmrgdnl As a special exception to the GNU General Public License, if you
1173636c353eSmrgdnl distribute this file as part of a program that contains a
1174636c353eSmrgdnl configuration script generated by Autoconf, you may include it under
1175636c353eSmrgdnl the same distribution terms that you use for the rest of that
1176636c353eSmrgdnl program.
1177e07dc26bSmrg
1178636c353eSmrgdnl PKG_PREREQ(MIN-VERSION)
1179636c353eSmrgdnl -----------------------
1180636c353eSmrgdnl Since: 0.29
1181636c353eSmrgdnl
1182636c353eSmrgdnl Verify that the version of the pkg-config macros are at least
1183636c353eSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
1184636c353eSmrgdnl installed version of pkg-config, this checks the developer's version
1185636c353eSmrgdnl of pkg.m4 when generating configure.
1186636c353eSmrgdnl
1187636c353eSmrgdnl To ensure that this macro is defined, also add:
1188636c353eSmrgdnl m4_ifndef([PKG_PREREQ],
1189636c353eSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
1190636c353eSmrgdnl
1191636c353eSmrgdnl See the "Since" comment for each macro you use to see what version
1192636c353eSmrgdnl of the macros you require.
1193636c353eSmrgm4_defun([PKG_PREREQ],
1194636c353eSmrg[m4_define([PKG_MACROS_VERSION], [0.29])
1195636c353eSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
1196636c353eSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
1197636c353eSmrg])dnl PKG_PREREQ
1198e07dc26bSmrg
1199636c353eSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
1200636c353eSmrgdnl ----------------------------------
1201636c353eSmrgdnl Since: 0.16
1202636c353eSmrgdnl
1203636c353eSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
1204636c353eSmrgdnl first found in the path. Checks that the version of pkg-config found
1205636c353eSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
1206636c353eSmrgdnl used since that's the first version where most current features of
1207636c353eSmrgdnl pkg-config existed.
1208636c353eSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1209636c353eSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1210636c353eSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1211636c353eSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1212636c353eSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1213636c353eSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1214636c353eSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1215e07dc26bSmrg
1216636c353eSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1217636c353eSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1218636c353eSmrgfi
1219636c353eSmrgif test -n "$PKG_CONFIG"; then
1220636c353eSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
1221636c353eSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1222636c353eSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1223636c353eSmrg		AC_MSG_RESULT([yes])
1224636c353eSmrg	else
1225636c353eSmrg		AC_MSG_RESULT([no])
1226636c353eSmrg		PKG_CONFIG=""
1227636c353eSmrg	fi
1228636c353eSmrgfi[]dnl
1229636c353eSmrg])dnl PKG_PROG_PKG_CONFIG
1230e07dc26bSmrg
1231636c353eSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1232636c353eSmrgdnl -------------------------------------------------------------------
1233636c353eSmrgdnl Since: 0.18
1234636c353eSmrgdnl
1235636c353eSmrgdnl Check to see whether a particular set of modules exists. Similar to
1236636c353eSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
1237636c353eSmrgdnl
1238636c353eSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1239636c353eSmrgdnl only at the first occurence in configure.ac, so if the first place
1240636c353eSmrgdnl it's called might be skipped (such as if it is within an "if", you
1241636c353eSmrgdnl have to call PKG_CHECK_EXISTS manually
1242636c353eSmrgAC_DEFUN([PKG_CHECK_EXISTS],
1243636c353eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1244636c353eSmrgif test -n "$PKG_CONFIG" && \
1245636c353eSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1246636c353eSmrg  m4_default([$2], [:])
1247636c353eSmrgm4_ifvaln([$3], [else
1248636c353eSmrg  $3])dnl
1249636c353eSmrgfi])
1250e07dc26bSmrg
1251636c353eSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1252636c353eSmrgdnl ---------------------------------------------
1253636c353eSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
1254636c353eSmrgdnl pkg_failed based on the result.
1255636c353eSmrgm4_define([_PKG_CONFIG],
1256636c353eSmrg[if test -n "$$1"; then
1257636c353eSmrg    pkg_cv_[]$1="$$1"
1258636c353eSmrg elif test -n "$PKG_CONFIG"; then
1259636c353eSmrg    PKG_CHECK_EXISTS([$3],
1260636c353eSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1261636c353eSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
1262636c353eSmrg		     [pkg_failed=yes])
1263636c353eSmrg else
1264636c353eSmrg    pkg_failed=untried
1265636c353eSmrgfi[]dnl
1266636c353eSmrg])dnl _PKG_CONFIG
1267e07dc26bSmrg
1268636c353eSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
1269636c353eSmrgdnl ---------------------------
1270636c353eSmrgdnl Internal check to see if pkg-config supports short errors.
1271636c353eSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1272636c353eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1273636c353eSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1274636c353eSmrg        _pkg_short_errors_supported=yes
1275636c353eSmrgelse
1276636c353eSmrg        _pkg_short_errors_supported=no
1277636c353eSmrgfi[]dnl
1278636c353eSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
1279e07dc26bSmrg
1280e07dc26bSmrg
1281636c353eSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1282636c353eSmrgdnl   [ACTION-IF-NOT-FOUND])
1283636c353eSmrgdnl --------------------------------------------------------------
1284636c353eSmrgdnl Since: 0.4.0
1285636c353eSmrgdnl
1286636c353eSmrgdnl Note that if there is a possibility the first call to
1287636c353eSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
1288636c353eSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1289636c353eSmrgAC_DEFUN([PKG_CHECK_MODULES],
1290636c353eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1291636c353eSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1292636c353eSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1293e07dc26bSmrg
1294636c353eSmrgpkg_failed=no
1295636c353eSmrgAC_MSG_CHECKING([for $1])
1296e07dc26bSmrg
1297636c353eSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1298636c353eSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1299e07dc26bSmrg
1300636c353eSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1301636c353eSmrgand $1[]_LIBS to avoid the need to call pkg-config.
1302636c353eSmrgSee the pkg-config man page for more details.])
1303e07dc26bSmrg
1304636c353eSmrgif test $pkg_failed = yes; then
1305636c353eSmrg   	AC_MSG_RESULT([no])
1306636c353eSmrg        _PKG_SHORT_ERRORS_SUPPORTED
1307636c353eSmrg        if test $_pkg_short_errors_supported = yes; then
1308636c353eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1309636c353eSmrg        else 
1310636c353eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1311636c353eSmrg        fi
1312636c353eSmrg	# Put the nasty error message in config.log where it belongs
1313636c353eSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1314e07dc26bSmrg
1315636c353eSmrg	m4_default([$4], [AC_MSG_ERROR(
1316636c353eSmrg[Package requirements ($2) were not met:
1317e07dc26bSmrg
1318636c353eSmrg$$1_PKG_ERRORS
1319e07dc26bSmrg
1320636c353eSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1321636c353eSmrginstalled software in a non-standard prefix.
1322e07dc26bSmrg
1323636c353eSmrg_PKG_TEXT])[]dnl
1324636c353eSmrg        ])
1325636c353eSmrgelif test $pkg_failed = untried; then
1326636c353eSmrg     	AC_MSG_RESULT([no])
1327636c353eSmrg	m4_default([$4], [AC_MSG_FAILURE(
1328636c353eSmrg[The pkg-config script could not be found or is too old.  Make sure it
1329636c353eSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
1330636c353eSmrgpath to pkg-config.
1331e07dc26bSmrg
1332636c353eSmrg_PKG_TEXT
1333e07dc26bSmrg
1334636c353eSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1335636c353eSmrg        ])
1336636c353eSmrgelse
1337636c353eSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1338636c353eSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1339636c353eSmrg        AC_MSG_RESULT([yes])
1340636c353eSmrg	$3
1341636c353eSmrgfi[]dnl
1342636c353eSmrg])dnl PKG_CHECK_MODULES
1343e07dc26bSmrg
1344e07dc26bSmrg
1345636c353eSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1346636c353eSmrgdnl   [ACTION-IF-NOT-FOUND])
1347636c353eSmrgdnl ---------------------------------------------------------------------
1348636c353eSmrgdnl Since: 0.29
1349636c353eSmrgdnl
1350636c353eSmrgdnl Checks for existence of MODULES and gathers its build flags with
1351636c353eSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
1352636c353eSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
1353636c353eSmrgdnl
1354636c353eSmrgdnl Note that if there is a possibility the first call to
1355636c353eSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
1356636c353eSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
1357636c353eSmrgdnl configure.ac.
1358636c353eSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
1359636c353eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1360636c353eSmrg_save_PKG_CONFIG=$PKG_CONFIG
1361636c353eSmrgPKG_CONFIG="$PKG_CONFIG --static"
1362636c353eSmrgPKG_CHECK_MODULES($@)
1363636c353eSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
1364636c353eSmrg])dnl PKG_CHECK_MODULES_STATIC
1365e07dc26bSmrg
1366e07dc26bSmrg
1367636c353eSmrgdnl PKG_INSTALLDIR([DIRECTORY])
1368636c353eSmrgdnl -------------------------
1369636c353eSmrgdnl Since: 0.27
1370636c353eSmrgdnl
1371636c353eSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
1372636c353eSmrgdnl should install pkg-config .pc files. By default the directory is
1373636c353eSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
1374636c353eSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
1375636c353eSmrgdnl parameter.
1376636c353eSmrgAC_DEFUN([PKG_INSTALLDIR],
1377636c353eSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1378636c353eSmrgm4_pushdef([pkg_description],
1379636c353eSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
1380636c353eSmrgAC_ARG_WITH([pkgconfigdir],
1381636c353eSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1382636c353eSmrg    [with_pkgconfigdir=]pkg_default)
1383636c353eSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1384636c353eSmrgm4_popdef([pkg_default])
1385636c353eSmrgm4_popdef([pkg_description])
1386636c353eSmrg])dnl PKG_INSTALLDIR
1387e07dc26bSmrg
1388e07dc26bSmrg
1389636c353eSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
1390636c353eSmrgdnl --------------------------------
1391636c353eSmrgdnl Since: 0.27
1392636c353eSmrgdnl
1393636c353eSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
1394636c353eSmrgdnl module should install arch-independent pkg-config .pc files. By
1395636c353eSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
1396636c353eSmrgdnl changed by passing DIRECTORY. The user can override through the
1397636c353eSmrgdnl --with-noarch-pkgconfigdir parameter.
1398636c353eSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
1399636c353eSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
1400636c353eSmrgm4_pushdef([pkg_description],
1401636c353eSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1402636c353eSmrgAC_ARG_WITH([noarch-pkgconfigdir],
1403636c353eSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1404636c353eSmrg    [with_noarch_pkgconfigdir=]pkg_default)
1405636c353eSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
1406636c353eSmrgm4_popdef([pkg_default])
1407636c353eSmrgm4_popdef([pkg_description])
1408636c353eSmrg])dnl PKG_NOARCH_INSTALLDIR
1409e07dc26bSmrg
1410e07dc26bSmrg
1411636c353eSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1412636c353eSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1413636c353eSmrgdnl -------------------------------------------
1414636c353eSmrgdnl Since: 0.28
1415636c353eSmrgdnl
1416636c353eSmrgdnl Retrieves the value of the pkg-config variable for the given module.
1417636c353eSmrgAC_DEFUN([PKG_CHECK_VAR],
1418636c353eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1419636c353eSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
1420e07dc26bSmrg
1421636c353eSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
1422636c353eSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
1423e07dc26bSmrg
1424636c353eSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
1425636c353eSmrg])dnl PKG_CHECK_VAR
1426e07dc26bSmrg
1427636c353eSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1428636c353eSmrgdnl
1429636c353eSmrgdnl Copyright (c) 2005, 2023, Oracle and/or its affiliates.
1430636c353eSmrgdnl
1431636c353eSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1432636c353eSmrgdnl copy of this software and associated documentation files (the "Software"),
1433636c353eSmrgdnl to deal in the Software without restriction, including without limitation
1434636c353eSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1435636c353eSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
1436636c353eSmrgdnl Software is furnished to do so, subject to the following conditions:
1437636c353eSmrgdnl
1438636c353eSmrgdnl The above copyright notice and this permission notice (including the next
1439636c353eSmrgdnl paragraph) shall be included in all copies or substantial portions of the
1440636c353eSmrgdnl Software.
1441636c353eSmrgdnl
1442636c353eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1443636c353eSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1444636c353eSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1445636c353eSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1446636c353eSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1447636c353eSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1448636c353eSmrgdnl DEALINGS IN THE SOFTWARE.
1449e07dc26bSmrg
1450636c353eSmrg# XORG_MACROS_VERSION(required-version)
1451636c353eSmrg# -------------------------------------
1452636c353eSmrg# Minimum version: 1.1.0
1453636c353eSmrg#
1454636c353eSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1455636c353eSmrg# your configure.ac with the minimum required version, such as:
1456636c353eSmrg# XORG_MACROS_VERSION(1.1)
1457636c353eSmrg#
1458636c353eSmrg# To ensure that this macro is defined, also add:
1459636c353eSmrg# m4_ifndef([XORG_MACROS_VERSION],
1460636c353eSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1461636c353eSmrg#
1462636c353eSmrg#
1463636c353eSmrg# See the "minimum version" comment for each macro you use to see what
1464636c353eSmrg# version you require.
1465636c353eSmrgm4_defun([XORG_MACROS_VERSION],[
1466636c353eSmrgm4_define([vers_have], [1.20.0])
1467636c353eSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1468636c353eSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1469636c353eSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1470636c353eSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1471636c353eSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1472636c353eSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1473636c353eSmrgm4_undefine([vers_have])
1474636c353eSmrgm4_undefine([maj_have])
1475636c353eSmrgm4_undefine([maj_needed])
1476636c353eSmrg]) # XORG_MACROS_VERSION
1477e07dc26bSmrg
1478636c353eSmrg# XORG_PROG_RAWCPP()
1479636c353eSmrg# ------------------
1480636c353eSmrg# Minimum version: 1.0.0
1481636c353eSmrg#
1482636c353eSmrg# Find cpp program and necessary flags for use in pre-processing text files
1483636c353eSmrg# such as man pages and config files
1484636c353eSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1485636c353eSmrgAC_REQUIRE([AC_PROG_CPP])
1486636c353eSmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
1487636c353eSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1488e07dc26bSmrg
1489636c353eSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1490636c353eSmrg# which is not the best choice for supporting other OS'es, but covers most
1491636c353eSmrg# of the ones we need for now.
1492636c353eSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1493636c353eSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1494636c353eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1495636c353eSmrg	AC_MSG_RESULT([no])
1496636c353eSmrgelse
1497636c353eSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1498636c353eSmrg		RAWCPPFLAGS=-undef
1499636c353eSmrg		AC_MSG_RESULT([yes])
1500636c353eSmrg	# under Cygwin unix is still defined even with -undef
1501636c353eSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1502636c353eSmrg		RAWCPPFLAGS="-undef -ansi"
1503636c353eSmrg		AC_MSG_RESULT([yes, with -ansi])
1504636c353eSmrg	else
1505636c353eSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1506636c353eSmrg	fi
1507636c353eSmrgfi
1508636c353eSmrgrm -f conftest.$ac_ext
1509e07dc26bSmrg
1510636c353eSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1511636c353eSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
1512636c353eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   "'` -eq 1 ; then
1513636c353eSmrg	AC_MSG_RESULT([no])
1514636c353eSmrgelse
1515636c353eSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   "'` -eq 1 ; then
1516636c353eSmrg		TRADITIONALCPPFLAGS="-traditional"
1517636c353eSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1518636c353eSmrg		AC_MSG_RESULT([yes])
1519636c353eSmrg	else
1520636c353eSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1521636c353eSmrg	fi
1522636c353eSmrgfi
1523636c353eSmrgrm -f conftest.$ac_ext
1524636c353eSmrgAC_SUBST(RAWCPPFLAGS)
1525636c353eSmrgAC_SUBST(TRADITIONALCPPFLAGS)
1526636c353eSmrg]) # XORG_PROG_RAWCPP
1527e07dc26bSmrg
1528636c353eSmrg# XORG_MANPAGE_SECTIONS()
1529636c353eSmrg# -----------------------
1530636c353eSmrg# Minimum version: 1.0.0
1531636c353eSmrg#
1532636c353eSmrg# Determine which sections man pages go in for the different man page types
1533636c353eSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1534636c353eSmrg# Not sure if there's any better way than just hardcoding by OS name.
1535636c353eSmrg# Override default settings by setting environment variables
1536636c353eSmrg# Added MAN_SUBSTS in version 1.8
1537636c353eSmrg# Added AC_PROG_SED in version 1.8
1538e07dc26bSmrg
1539636c353eSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1540636c353eSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1541636c353eSmrgAC_REQUIRE([AC_PROG_SED])
1542e07dc26bSmrg
1543636c353eSmrgcase $host_os in
1544636c353eSmrg    solaris*)
1545636c353eSmrg        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
1546636c353eSmrg        # check for a man page file found in later versions that use
1547636c353eSmrg        # traditional section numbers instead
1548636c353eSmrg        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
1549636c353eSmrg                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
1550636c353eSmrg        ;;
1551636c353eSmrg    *) SYSV_MAN_SECTIONS=false ;;
1552636c353eSmrgesac
1553e07dc26bSmrg
1554636c353eSmrgif test x$APP_MAN_SUFFIX = x    ; then
1555636c353eSmrg    APP_MAN_SUFFIX=1
1556636c353eSmrgfi
1557636c353eSmrgif test x$APP_MAN_DIR = x    ; then
1558636c353eSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1559636c353eSmrgfi
1560e07dc26bSmrg
1561636c353eSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1562636c353eSmrg    LIB_MAN_SUFFIX=3
1563636c353eSmrgfi
1564636c353eSmrgif test x$LIB_MAN_DIR = x    ; then
1565636c353eSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1566636c353eSmrgfi
1567e07dc26bSmrg
1568636c353eSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1569636c353eSmrg    case $SYSV_MAN_SECTIONS in
1570636c353eSmrg	true)				FILE_MAN_SUFFIX=4  ;;
1571636c353eSmrg	*)				FILE_MAN_SUFFIX=5  ;;
1572636c353eSmrg    esac
1573636c353eSmrgfi
1574636c353eSmrgif test x$FILE_MAN_DIR = x    ; then
1575636c353eSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1576636c353eSmrgfi
1577e07dc26bSmrg
1578636c353eSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1579636c353eSmrg    case $SYSV_MAN_SECTIONS in
1580636c353eSmrg	true)				MISC_MAN_SUFFIX=5  ;;
1581636c353eSmrg	*)				MISC_MAN_SUFFIX=7  ;;
1582636c353eSmrg    esac
1583636c353eSmrgfi
1584636c353eSmrgif test x$MISC_MAN_DIR = x    ; then
1585636c353eSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1586636c353eSmrgfi
1587e07dc26bSmrg
1588636c353eSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1589636c353eSmrg    case $SYSV_MAN_SECTIONS in
1590636c353eSmrg	true)				DRIVER_MAN_SUFFIX=7  ;;
1591636c353eSmrg	*)				DRIVER_MAN_SUFFIX=4  ;;
1592636c353eSmrg    esac
1593636c353eSmrgfi
1594636c353eSmrgif test x$DRIVER_MAN_DIR = x    ; then
1595636c353eSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1596636c353eSmrgfi
1597e07dc26bSmrg
1598636c353eSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1599636c353eSmrg    case $SYSV_MAN_SECTIONS in
1600636c353eSmrg	true)				ADMIN_MAN_SUFFIX=1m ;;
1601636c353eSmrg	*)				ADMIN_MAN_SUFFIX=8  ;;
1602636c353eSmrg    esac
1603636c353eSmrgfi
1604636c353eSmrgif test x$ADMIN_MAN_DIR = x    ; then
1605636c353eSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1606636c353eSmrgfi
1607e07dc26bSmrg
1608e07dc26bSmrg
1609636c353eSmrgAC_SUBST([APP_MAN_SUFFIX])
1610636c353eSmrgAC_SUBST([LIB_MAN_SUFFIX])
1611636c353eSmrgAC_SUBST([FILE_MAN_SUFFIX])
1612636c353eSmrgAC_SUBST([MISC_MAN_SUFFIX])
1613636c353eSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1614636c353eSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1615636c353eSmrgAC_SUBST([APP_MAN_DIR])
1616636c353eSmrgAC_SUBST([LIB_MAN_DIR])
1617636c353eSmrgAC_SUBST([FILE_MAN_DIR])
1618636c353eSmrgAC_SUBST([MISC_MAN_DIR])
1619636c353eSmrgAC_SUBST([DRIVER_MAN_DIR])
1620636c353eSmrgAC_SUBST([ADMIN_MAN_DIR])
1621e07dc26bSmrg
1622636c353eSmrgXORG_MAN_PAGE="X Version 11"
1623636c353eSmrgAC_SUBST([XORG_MAN_PAGE])
1624636c353eSmrgMAN_SUBSTS="\
1625636c353eSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1626636c353eSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1627636c353eSmrg	-e 's|__xservername__|Xorg|g' \
1628636c353eSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
1629636c353eSmrg	-e 's|__projectroot__|\$(prefix)|g' \
1630636c353eSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1631636c353eSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1632636c353eSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1633636c353eSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1634636c353eSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1635636c353eSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1636636c353eSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1637636c353eSmrgAC_SUBST([MAN_SUBSTS])
1638e07dc26bSmrg
1639636c353eSmrg]) # XORG_MANPAGE_SECTIONS
1640e07dc26bSmrg
1641636c353eSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1642636c353eSmrg# ------------------------
1643636c353eSmrg# Minimum version: 1.7.0
1644636c353eSmrg#
1645636c353eSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1646636c353eSmrg# provided by xorg-sgml-doctools, if installed.
1647636c353eSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1648636c353eSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1649636c353eSmrgXORG_SGML_PATH=
1650636c353eSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1651636c353eSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1652636c353eSmrg    [m4_ifval([$1],[:],
1653636c353eSmrg        [if test x"$cross_compiling" != x"yes" ; then
1654636c353eSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1655636c353eSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1656636c353eSmrg         fi])
1657e07dc26bSmrg    ])
1658e07dc26bSmrg
1659636c353eSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1660636c353eSmrg# the path and the name of the doc stylesheet
1661636c353eSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1662636c353eSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1663636c353eSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1664636c353eSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1665636c353eSmrgelse
1666636c353eSmrg   AC_MSG_RESULT([no])
1667636c353eSmrgfi
1668e07dc26bSmrg
1669636c353eSmrgAC_SUBST(XORG_SGML_PATH)
1670636c353eSmrgAC_SUBST(STYLESHEET_SRCDIR)
1671636c353eSmrgAC_SUBST(XSL_STYLESHEET)
1672636c353eSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1673636c353eSmrg]) # XORG_CHECK_SGML_DOCTOOLS
1674e07dc26bSmrg
1675636c353eSmrg# XORG_CHECK_LINUXDOC
1676636c353eSmrg# -------------------
1677636c353eSmrg# Minimum version: 1.0.0
1678636c353eSmrg#
1679636c353eSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1680636c353eSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1681636c353eSmrg# Whether or not the necessary tools and files are found can be checked
1682636c353eSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1683636c353eSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1684636c353eSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1685636c353eSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1686e07dc26bSmrg
1687636c353eSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1688e07dc26bSmrg
1689636c353eSmrgAC_MSG_CHECKING([whether to build documentation])
1690e07dc26bSmrg
1691636c353eSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1692636c353eSmrg   BUILDDOC=yes
1693636c353eSmrgelse
1694636c353eSmrg   BUILDDOC=no
1695636c353eSmrgfi
1696e07dc26bSmrg
1697636c353eSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1698e07dc26bSmrg
1699636c353eSmrgAC_MSG_RESULT([$BUILDDOC])
1700e07dc26bSmrg
1701636c353eSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1702e07dc26bSmrg
1703636c353eSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1704636c353eSmrg   BUILDPDFDOC=yes
1705e07dc26bSmrgelse
1706636c353eSmrg   BUILDPDFDOC=no
1707e07dc26bSmrgfi
1708e07dc26bSmrg
1709636c353eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1710e07dc26bSmrg
1711636c353eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1712e07dc26bSmrg
1713636c353eSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1714636c353eSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1715636c353eSmrgMAKE_PDF="$PS2PDF"
1716636c353eSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1717e07dc26bSmrg
1718636c353eSmrgAC_SUBST(MAKE_TEXT)
1719636c353eSmrgAC_SUBST(MAKE_PS)
1720636c353eSmrgAC_SUBST(MAKE_PDF)
1721636c353eSmrgAC_SUBST(MAKE_HTML)
1722636c353eSmrg]) # XORG_CHECK_LINUXDOC
1723e07dc26bSmrg
1724636c353eSmrg# XORG_CHECK_DOCBOOK
1725636c353eSmrg# -------------------
1726636c353eSmrg# Minimum version: 1.0.0
1727636c353eSmrg#
1728636c353eSmrg# Checks for the ability to build output formats from SGML DocBook source.
1729636c353eSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1730636c353eSmrg# indicates whether the necessary tools and files are found and, if set,
1731636c353eSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1732636c353eSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1733636c353eSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1734e07dc26bSmrg
1735636c353eSmrgBUILDTXTDOC=no
1736636c353eSmrgBUILDPDFDOC=no
1737636c353eSmrgBUILDPSDOC=no
1738636c353eSmrgBUILDHTMLDOC=no
1739e07dc26bSmrg
1740636c353eSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1741636c353eSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1742636c353eSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1743636c353eSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1744e07dc26bSmrg
1745636c353eSmrgAC_MSG_CHECKING([whether to build text documentation])
1746636c353eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1747636c353eSmrg   test x$BUILD_TXTDOC != xno; then
1748636c353eSmrg	BUILDTXTDOC=yes
1749636c353eSmrgfi
1750636c353eSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1751636c353eSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1752e07dc26bSmrg
1753636c353eSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1754636c353eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1755636c353eSmrg   test x$BUILD_PDFDOC != xno; then
1756636c353eSmrg	BUILDPDFDOC=yes
1757636c353eSmrgfi
1758636c353eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1759636c353eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1760e07dc26bSmrg
1761636c353eSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1762636c353eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1763636c353eSmrg   test x$BUILD_PSDOC != xno; then
1764636c353eSmrg	BUILDPSDOC=yes
1765636c353eSmrgfi
1766636c353eSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1767636c353eSmrgAC_MSG_RESULT([$BUILDPSDOC])
1768e07dc26bSmrg
1769636c353eSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1770636c353eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1771636c353eSmrg   test x$BUILD_HTMLDOC != xno; then
1772636c353eSmrg	BUILDHTMLDOC=yes
1773636c353eSmrgfi
1774636c353eSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1775636c353eSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1776e07dc26bSmrg
1777636c353eSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1778636c353eSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1779636c353eSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1780636c353eSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1781e07dc26bSmrg
1782636c353eSmrgAC_SUBST(MAKE_TEXT)
1783636c353eSmrgAC_SUBST(MAKE_PS)
1784636c353eSmrgAC_SUBST(MAKE_PDF)
1785636c353eSmrgAC_SUBST(MAKE_HTML)
1786636c353eSmrg]) # XORG_CHECK_DOCBOOK
1787e07dc26bSmrg
1788636c353eSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1789636c353eSmrg# ----------------
1790636c353eSmrg# Minimum version: 1.5.0
1791636c353eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1792636c353eSmrg#
1793636c353eSmrg# Documentation tools are not always available on all platforms and sometimes
1794636c353eSmrg# not at the appropriate level. This macro enables a module to test for the
1795636c353eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1796636c353eSmrg# the --with-xmlto option, it allows maximum flexibility in making decisions
1797636c353eSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1798636c353eSmrg# --with-xmlto assumes 'auto'.
1799636c353eSmrg#
1800636c353eSmrg# Interface to module:
1801636c353eSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1802636c353eSmrg# XMLTO:	returns the path of the xmlto program found
1803636c353eSmrg#		returns the path set by the user in the environment
1804636c353eSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1805636c353eSmrg#		'no' user instructs the module not to use xmlto
1806636c353eSmrg#
1807636c353eSmrg# Added in version 1.10.0
1808636c353eSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1809636c353eSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1810636c353eSmrg#
1811636c353eSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1812636c353eSmrg#
1813636c353eSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1814636c353eSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1815636c353eSmrgm4_define([_defopt], m4_default([$2], [auto]))
1816636c353eSmrgAC_ARG_WITH(xmlto,
1817636c353eSmrg	AS_HELP_STRING([--with-xmlto],
1818636c353eSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1819636c353eSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1820636c353eSmrgm4_undefine([_defopt])
1821e07dc26bSmrg
1822636c353eSmrgif test "x$use_xmlto" = x"auto"; then
1823636c353eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1824636c353eSmrg   if test "x$XMLTO" = "x"; then
1825636c353eSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1826636c353eSmrg	have_xmlto=no
1827636c353eSmrg   else
1828636c353eSmrg        have_xmlto=yes
1829636c353eSmrg   fi
1830636c353eSmrgelif test "x$use_xmlto" = x"yes" ; then
1831636c353eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1832636c353eSmrg   if test "x$XMLTO" = "x"; then
1833636c353eSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1834636c353eSmrg   fi
1835636c353eSmrg   have_xmlto=yes
1836636c353eSmrgelif test "x$use_xmlto" = x"no" ; then
1837636c353eSmrg   if test "x$XMLTO" != "x"; then
1838636c353eSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1839636c353eSmrg   fi
1840636c353eSmrg   have_xmlto=no
1841e07dc26bSmrgelse
1842636c353eSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1843e07dc26bSmrgfi
1844e07dc26bSmrg
1845636c353eSmrg# Test for a minimum version of xmlto, if provided.
1846636c353eSmrgm4_ifval([$1],
1847636c353eSmrg[if test "$have_xmlto" = yes; then
1848636c353eSmrg    # scrape the xmlto version
1849636c353eSmrg    AC_MSG_CHECKING([the xmlto version])
1850636c353eSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1851636c353eSmrg    AC_MSG_RESULT([$xmlto_version])
1852636c353eSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1853636c353eSmrg        [if test "x$use_xmlto" = xauto; then
1854636c353eSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1855636c353eSmrg            have_xmlto=no
1856636c353eSmrg        else
1857636c353eSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1858636c353eSmrg        fi])
1859636c353eSmrgfi])
1860e07dc26bSmrg
1861636c353eSmrg# Test for the ability of xmlto to generate a text target
1862636c353eSmrg#
1863636c353eSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
1864636c353eSmrg# following test for empty XML docbook files.
1865636c353eSmrg# For compatibility reasons use the following empty XML docbook file and if
1866636c353eSmrg# it fails try it again with a non-empty XML file.
1867636c353eSmrghave_xmlto_text=no
1868636c353eSmrgcat > conftest.xml << "EOF"
1869636c353eSmrgEOF
1870636c353eSmrgAS_IF([test "$have_xmlto" = yes],
1871636c353eSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1872636c353eSmrg             [have_xmlto_text=yes],
1873636c353eSmrg             [# Try it again with a non-empty XML file.
1874636c353eSmrg              cat > conftest.xml << "EOF"
1875636c353eSmrg<x></x>
1876636c353eSmrgEOF
1877636c353eSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1878636c353eSmrg                    [have_xmlto_text=yes],
1879636c353eSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
1880636c353eSmrgrm -f conftest.xml
1881636c353eSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1882636c353eSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1883636c353eSmrg]) # XORG_WITH_XMLTO
1884e07dc26bSmrg
1885636c353eSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1886636c353eSmrg# --------------------------------------------
1887636c353eSmrg# Minimum version: 1.12.0
1888636c353eSmrg# Minimum version for optional DEFAULT argument: 1.12.0
1889636c353eSmrg#
1890636c353eSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1891636c353eSmrg# XML-based language used for the transformation of XML documents.
1892636c353eSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1893636c353eSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1894636c353eSmrg# The XSLT processor is often used as a standalone tool for transformations.
1895636c353eSmrg# It should not be assumed that this tool is used only to work with documnetation.
1896636c353eSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1897636c353eSmrg#
1898636c353eSmrg# Interface to module:
1899636c353eSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1900636c353eSmrg# XSLTPROC:	 returns the path of the xsltproc program found
1901636c353eSmrg#		 returns the path set by the user in the environment
1902636c353eSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1903636c353eSmrg#		  'no' user instructs the module not to use xsltproc
1904636c353eSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
1905636c353eSmrg#
1906636c353eSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1907636c353eSmrg#
1908636c353eSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1909636c353eSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1910636c353eSmrg# Preserves the interface, should it be implemented later
1911636c353eSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1912636c353eSmrgm4_define([_defopt], m4_default([$2], [auto]))
1913636c353eSmrgAC_ARG_WITH(xsltproc,
1914636c353eSmrg	AS_HELP_STRING([--with-xsltproc],
1915636c353eSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1916636c353eSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1917636c353eSmrgm4_undefine([_defopt])
1918e07dc26bSmrg
1919636c353eSmrgif test "x$use_xsltproc" = x"auto"; then
1920636c353eSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1921636c353eSmrg   if test "x$XSLTPROC" = "x"; then
1922636c353eSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1923636c353eSmrg	have_xsltproc=no
1924636c353eSmrg   else
1925636c353eSmrg        have_xsltproc=yes
1926e07dc26bSmrg   fi
1927636c353eSmrgelif test "x$use_xsltproc" = x"yes" ; then
1928636c353eSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1929636c353eSmrg   if test "x$XSLTPROC" = "x"; then
1930636c353eSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1931636c353eSmrg   fi
1932636c353eSmrg   have_xsltproc=yes
1933636c353eSmrgelif test "x$use_xsltproc" = x"no" ; then
1934636c353eSmrg   if test "x$XSLTPROC" != "x"; then
1935636c353eSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1936636c353eSmrg   fi
1937636c353eSmrg   have_xsltproc=no
1938e07dc26bSmrgelse
1939636c353eSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1940e07dc26bSmrgfi
1941e07dc26bSmrg
1942636c353eSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1943636c353eSmrg]) # XORG_WITH_XSLTPROC
1944e07dc26bSmrg
1945636c353eSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1946636c353eSmrg# ----------------------------------------
1947636c353eSmrg# Minimum version: 1.15.0
1948636c353eSmrg#
1949636c353eSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
1950636c353eSmrg# scanning arbitrary text files, extracting information from those text files,
1951636c353eSmrg# and printing reports based on that information.
1952636c353eSmrg#
1953636c353eSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
1954636c353eSmrg#
1955636c353eSmrg# Interface to module:
1956636c353eSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
1957636c353eSmrg# PERL:	     returns the path of the perl program found
1958636c353eSmrg#	     returns the path set by the user in the environment
1959636c353eSmrg# --with-perl: 'yes' user instructs the module to use perl
1960636c353eSmrg#	       'no' user instructs the module not to use perl
1961636c353eSmrg# have_perl: returns yes if perl found in PATH or no
1962636c353eSmrg#
1963636c353eSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1964636c353eSmrg#
1965636c353eSmrgAC_DEFUN([XORG_WITH_PERL],[
1966636c353eSmrgAC_ARG_VAR([PERL], [Path to perl command])
1967636c353eSmrg# Preserves the interface, should it be implemented later
1968636c353eSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1969636c353eSmrgm4_define([_defopt], m4_default([$2], [auto]))
1970636c353eSmrgAC_ARG_WITH(perl,
1971636c353eSmrg	AS_HELP_STRING([--with-perl],
1972636c353eSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1973636c353eSmrg	   [use_perl=$withval], [use_perl=]_defopt)
1974636c353eSmrgm4_undefine([_defopt])
1975e07dc26bSmrg
1976636c353eSmrgif test "x$use_perl" = x"auto"; then
1977636c353eSmrg   AC_PATH_PROG([PERL], [perl])
1978636c353eSmrg   if test "x$PERL" = "x"; then
1979636c353eSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1980636c353eSmrg	have_perl=no
1981636c353eSmrg   else
1982636c353eSmrg        have_perl=yes
1983e07dc26bSmrg   fi
1984636c353eSmrgelif test "x$use_perl" = x"yes" ; then
1985636c353eSmrg   AC_PATH_PROG([PERL], [perl])
1986636c353eSmrg   if test "x$PERL" = "x"; then
1987636c353eSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1988636c353eSmrg   fi
1989636c353eSmrg   have_perl=yes
1990636c353eSmrgelif test "x$use_perl" = x"no" ; then
1991636c353eSmrg   if test "x$PERL" != "x"; then
1992636c353eSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1993636c353eSmrg   fi
1994636c353eSmrg   have_perl=no
1995e07dc26bSmrgelse
1996636c353eSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1997e07dc26bSmrgfi
1998e07dc26bSmrg
1999636c353eSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
2000636c353eSmrg]) # XORG_WITH_PERL
2001e07dc26bSmrg
2002636c353eSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
2003636c353eSmrg# ----------------
2004636c353eSmrg# Minimum version: 1.5.0
2005636c353eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2006636c353eSmrg#
2007636c353eSmrg# Documentation tools are not always available on all platforms and sometimes
2008636c353eSmrg# not at the appropriate level. This macro enables a module to test for the
2009636c353eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
2010636c353eSmrg# the --with-asciidoc option, it allows maximum flexibility in making decisions
2011636c353eSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
2012636c353eSmrg# --with-asciidoc assumes 'auto'.
2013636c353eSmrg#
2014636c353eSmrg# Interface to module:
2015636c353eSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
2016636c353eSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
2017636c353eSmrg#		 returns the path set by the user in the environment
2018636c353eSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
2019636c353eSmrg#		  'no' user instructs the module not to use asciidoc
2020636c353eSmrg#
2021636c353eSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
2022636c353eSmrg#
2023636c353eSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
2024636c353eSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
2025636c353eSmrgm4_define([_defopt], m4_default([$2], [auto]))
2026636c353eSmrgAC_ARG_WITH(asciidoc,
2027636c353eSmrg	AS_HELP_STRING([--with-asciidoc],
2028636c353eSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
2029636c353eSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
2030636c353eSmrgm4_undefine([_defopt])
2031e07dc26bSmrg
2032636c353eSmrgif test "x$use_asciidoc" = x"auto"; then
2033636c353eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2034636c353eSmrg   if test "x$ASCIIDOC" = "x"; then
2035636c353eSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
2036636c353eSmrg	have_asciidoc=no
2037636c353eSmrg   else
2038636c353eSmrg        have_asciidoc=yes
2039636c353eSmrg   fi
2040636c353eSmrgelif test "x$use_asciidoc" = x"yes" ; then
2041636c353eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2042636c353eSmrg   if test "x$ASCIIDOC" = "x"; then
2043636c353eSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
2044636c353eSmrg   fi
2045636c353eSmrg   have_asciidoc=yes
2046636c353eSmrgelif test "x$use_asciidoc" = x"no" ; then
2047636c353eSmrg   if test "x$ASCIIDOC" != "x"; then
2048636c353eSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
2049636c353eSmrg   fi
2050636c353eSmrg   have_asciidoc=no
2051636c353eSmrgelse
2052636c353eSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
2053636c353eSmrgfi
2054636c353eSmrgm4_ifval([$1],
2055636c353eSmrg[if test "$have_asciidoc" = yes; then
2056636c353eSmrg    # scrape the asciidoc version
2057636c353eSmrg    AC_MSG_CHECKING([the asciidoc version])
2058636c353eSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
2059636c353eSmrg    AC_MSG_RESULT([$asciidoc_version])
2060636c353eSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
2061636c353eSmrg        [if test "x$use_asciidoc" = xauto; then
2062636c353eSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
2063636c353eSmrg            have_asciidoc=no
2064636c353eSmrg        else
2065636c353eSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
2066636c353eSmrg        fi])
2067636c353eSmrgfi])
2068636c353eSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
2069636c353eSmrg]) # XORG_WITH_ASCIIDOC
2070e07dc26bSmrg
2071636c353eSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
2072636c353eSmrg# -------------------------------------------
2073636c353eSmrg# Minimum version: 1.5.0
2074636c353eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2075636c353eSmrg# Minimum version for optional DOT checking: 1.18.0
2076636c353eSmrg#
2077636c353eSmrg# Documentation tools are not always available on all platforms and sometimes
2078636c353eSmrg# not at the appropriate level. This macro enables a module to test for the
2079636c353eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
2080636c353eSmrg# the --with-doxygen option, it allows maximum flexibility in making decisions
2081636c353eSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
2082636c353eSmrg# --with-doxygen assumes 'auto'.
2083636c353eSmrg#
2084636c353eSmrg# Interface to module:
2085636c353eSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
2086636c353eSmrg# DOXYGEN:	 returns the path of the doxygen program found
2087636c353eSmrg#		 returns the path set by the user in the environment
2088636c353eSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
2089636c353eSmrg#		  'no' user instructs the module not to use doxygen
2090636c353eSmrg#
2091636c353eSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
2092636c353eSmrg#
2093636c353eSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
2094636c353eSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
2095636c353eSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
2096636c353eSmrgm4_define([_defopt], m4_default([$2], [auto]))
2097636c353eSmrgAC_ARG_WITH(doxygen,
2098636c353eSmrg	AS_HELP_STRING([--with-doxygen],
2099636c353eSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
2100636c353eSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
2101636c353eSmrgm4_undefine([_defopt])
2102e07dc26bSmrg
2103636c353eSmrgif test "x$use_doxygen" = x"auto"; then
2104636c353eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2105636c353eSmrg   if test "x$DOXYGEN" = "x"; then
2106636c353eSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
2107636c353eSmrg	have_doxygen=no
2108636c353eSmrg   else
2109636c353eSmrg        have_doxygen=yes
2110636c353eSmrg   fi
2111636c353eSmrgelif test "x$use_doxygen" = x"yes" ; then
2112636c353eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2113636c353eSmrg   if test "x$DOXYGEN" = "x"; then
2114636c353eSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
2115636c353eSmrg   fi
2116636c353eSmrg   have_doxygen=yes
2117636c353eSmrgelif test "x$use_doxygen" = x"no" ; then
2118636c353eSmrg   if test "x$DOXYGEN" != "x"; then
2119636c353eSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
2120636c353eSmrg   fi
2121636c353eSmrg   have_doxygen=no
2122636c353eSmrgelse
2123636c353eSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
2124636c353eSmrgfi
2125636c353eSmrgm4_ifval([$1],
2126636c353eSmrg[if test "$have_doxygen" = yes; then
2127636c353eSmrg    # scrape the doxygen version
2128636c353eSmrg    AC_MSG_CHECKING([the doxygen version])
2129636c353eSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
2130636c353eSmrg    AC_MSG_RESULT([$doxygen_version])
2131636c353eSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
2132636c353eSmrg        [if test "x$use_doxygen" = xauto; then
2133636c353eSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
2134636c353eSmrg            have_doxygen=no
2135636c353eSmrg        else
2136636c353eSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
2137636c353eSmrg        fi])
2138636c353eSmrgfi])
2139e07dc26bSmrg
2140636c353eSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
2141636c353eSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
2142636c353eSmrgdnl 	HAVE_DOT = @HAVE_DOT@
2143636c353eSmrgHAVE_DOT=no
2144636c353eSmrgif test "x$have_doxygen" = "xyes"; then
2145636c353eSmrg  AC_PATH_PROG([DOT], [dot])
2146636c353eSmrg    if test "x$DOT" != "x"; then
2147636c353eSmrg      HAVE_DOT=yes
2148e07dc26bSmrg    fi
2149636c353eSmrgfi
2150e07dc26bSmrg
2151636c353eSmrgAC_SUBST([HAVE_DOT])
2152636c353eSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
2153636c353eSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
2154636c353eSmrg]) # XORG_WITH_DOXYGEN
2155e07dc26bSmrg
2156636c353eSmrg# XORG_WITH_GROFF([DEFAULT])
2157636c353eSmrg# ----------------
2158636c353eSmrg# Minimum version: 1.6.0
2159636c353eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2160636c353eSmrg#
2161636c353eSmrg# Documentation tools are not always available on all platforms and sometimes
2162636c353eSmrg# not at the appropriate level. This macro enables a module to test for the
2163636c353eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
2164636c353eSmrg# the --with-groff option, it allows maximum flexibility in making decisions
2165636c353eSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
2166636c353eSmrg# --with-groff assumes 'auto'.
2167636c353eSmrg#
2168636c353eSmrg# Interface to module:
2169636c353eSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
2170636c353eSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
2171636c353eSmrg# HAVE_GROFF_MS: the -ms macros package
2172636c353eSmrg# GROFF:	 returns the path of the groff program found
2173636c353eSmrg#		 returns the path set by the user in the environment
2174636c353eSmrg# --with-groff:	 'yes' user instructs the module to use groff
2175636c353eSmrg#		 'no' user instructs the module not to use groff
2176636c353eSmrg#
2177636c353eSmrg# Added in version 1.9.0:
2178636c353eSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
2179636c353eSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
2180636c353eSmrg#		   psselect from the psutils package.
2181636c353eSmrg#		   the ghostcript package. Refer to the grohtml man pages
2182636c353eSmrg#
2183636c353eSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
2184636c353eSmrg#
2185636c353eSmrg# OS and distros often splits groff in a basic and full package, the former
2186636c353eSmrg# having the groff program and the later having devices, fonts and macros
2187636c353eSmrg# Checking for the groff executable is not enough.
2188636c353eSmrg#
2189636c353eSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
2190636c353eSmrg# unset HAVE_GROFF or GROFF env variables.
2191636c353eSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
2192636c353eSmrg#
2193636c353eSmrgAC_DEFUN([XORG_WITH_GROFF],[
2194636c353eSmrgAC_ARG_VAR([GROFF], [Path to groff command])
2195636c353eSmrgm4_define([_defopt], m4_default([$1], [auto]))
2196636c353eSmrgAC_ARG_WITH(groff,
2197636c353eSmrg	AS_HELP_STRING([--with-groff],
2198636c353eSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
2199636c353eSmrg	   [use_groff=$withval], [use_groff=]_defopt)
2200636c353eSmrgm4_undefine([_defopt])
2201e07dc26bSmrg
2202636c353eSmrgif test "x$use_groff" = x"auto"; then
2203636c353eSmrg   AC_PATH_PROG([GROFF], [groff])
2204636c353eSmrg   if test "x$GROFF" = "x"; then
2205636c353eSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
2206636c353eSmrg	have_groff=no
2207636c353eSmrg   else
2208636c353eSmrg        have_groff=yes
2209636c353eSmrg   fi
2210636c353eSmrgelif test "x$use_groff" = x"yes" ; then
2211636c353eSmrg   AC_PATH_PROG([GROFF], [groff])
2212636c353eSmrg   if test "x$GROFF" = "x"; then
2213636c353eSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2214636c353eSmrg   fi
2215636c353eSmrg   have_groff=yes
2216636c353eSmrgelif test "x$use_groff" = x"no" ; then
2217636c353eSmrg   if test "x$GROFF" != "x"; then
2218636c353eSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2219636c353eSmrg   fi
2220636c353eSmrg   have_groff=no
2221636c353eSmrgelse
2222636c353eSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
2223636c353eSmrgfi
2224636c353eSmrg
2225636c353eSmrg# We have groff, test for the presence of the macro packages
2226636c353eSmrgif test "x$have_groff" = x"yes"; then
2227636c353eSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
2228636c353eSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2229636c353eSmrg        groff_ms_works=yes
2230e07dc26bSmrg    else
2231636c353eSmrg        groff_ms_works=no
2232e07dc26bSmrg    fi
2233636c353eSmrg    AC_MSG_RESULT([$groff_ms_works])
2234636c353eSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
2235636c353eSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2236636c353eSmrg        groff_mm_works=yes
2237e07dc26bSmrg    else
2238636c353eSmrg        groff_mm_works=no
2239e07dc26bSmrg    fi
2240636c353eSmrg    AC_MSG_RESULT([$groff_mm_works])
2241e07dc26bSmrgfi
2242e07dc26bSmrg
2243636c353eSmrg# We have groff, test for HTML dependencies, one command per package
2244636c353eSmrgif test "x$have_groff" = x"yes"; then
2245636c353eSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2246636c353eSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2247636c353eSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
2248636c353eSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2249636c353eSmrg      have_groff_html=yes
2250636c353eSmrg   else
2251636c353eSmrg      have_groff_html=no
2252636c353eSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2253636c353eSmrg   fi
2254636c353eSmrgfi
2255e07dc26bSmrg
2256636c353eSmrg# Set Automake conditionals for Makefiles
2257636c353eSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2258636c353eSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2259636c353eSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2260636c353eSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2261636c353eSmrg]) # XORG_WITH_GROFF
2262e07dc26bSmrg
2263636c353eSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
2264636c353eSmrg# ---------------------------------------
2265636c353eSmrg# Minimum version: 1.6.0
2266636c353eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2267636c353eSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
2268636c353eSmrg#
2269636c353eSmrg# Documentation tools are not always available on all platforms and sometimes
2270636c353eSmrg# not at the appropriate level. This macro enables a module to test for the
2271636c353eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
2272636c353eSmrg# the --with-fop option, it allows maximum flexibility in making decisions
2273636c353eSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
2274636c353eSmrg# --with-fop assumes 'auto'.
2275636c353eSmrg#
2276636c353eSmrg# Interface to module:
2277636c353eSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
2278636c353eSmrg# FOP:	 	returns the path of the fop program found
2279636c353eSmrg#		returns the path set by the user in the environment
2280636c353eSmrg# --with-fop: 	'yes' user instructs the module to use fop
2281636c353eSmrg#		'no' user instructs the module not to use fop
2282636c353eSmrg#
2283636c353eSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2284636c353eSmrg#
2285636c353eSmrgAC_DEFUN([XORG_WITH_FOP],[
2286636c353eSmrgAC_ARG_VAR([FOP], [Path to fop command])
2287636c353eSmrgm4_define([_defopt], m4_default([$2], [auto]))
2288636c353eSmrgAC_ARG_WITH(fop,
2289636c353eSmrg	AS_HELP_STRING([--with-fop],
2290636c353eSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
2291636c353eSmrg	   [use_fop=$withval], [use_fop=]_defopt)
2292636c353eSmrgm4_undefine([_defopt])
2293e07dc26bSmrg
2294636c353eSmrgif test "x$use_fop" = x"auto"; then
2295636c353eSmrg   AC_PATH_PROG([FOP], [fop])
2296636c353eSmrg   if test "x$FOP" = "x"; then
2297636c353eSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
2298636c353eSmrg	have_fop=no
2299636c353eSmrg   else
2300636c353eSmrg        have_fop=yes
2301636c353eSmrg   fi
2302636c353eSmrgelif test "x$use_fop" = x"yes" ; then
2303636c353eSmrg   AC_PATH_PROG([FOP], [fop])
2304636c353eSmrg   if test "x$FOP" = "x"; then
2305636c353eSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2306636c353eSmrg   fi
2307636c353eSmrg   have_fop=yes
2308636c353eSmrgelif test "x$use_fop" = x"no" ; then
2309636c353eSmrg   if test "x$FOP" != "x"; then
2310636c353eSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2311636c353eSmrg   fi
2312636c353eSmrg   have_fop=no
2313e07dc26bSmrgelse
2314636c353eSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
2315636c353eSmrgfi
2316e07dc26bSmrg
2317636c353eSmrg# Test for a minimum version of fop, if provided.
2318636c353eSmrgm4_ifval([$1],
2319636c353eSmrg[if test "$have_fop" = yes; then
2320636c353eSmrg    # scrape the fop version
2321636c353eSmrg    AC_MSG_CHECKING([for fop minimum version])
2322636c353eSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2323636c353eSmrg    AC_MSG_RESULT([$fop_version])
2324636c353eSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
2325636c353eSmrg        [if test "x$use_fop" = xauto; then
2326636c353eSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2327636c353eSmrg            have_fop=no
2328636c353eSmrg        else
2329636c353eSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2330636c353eSmrg        fi])
2331636c353eSmrgfi])
2332636c353eSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2333636c353eSmrg]) # XORG_WITH_FOP
2334e07dc26bSmrg
2335636c353eSmrg# XORG_WITH_M4([MIN-VERSION])
2336636c353eSmrg# ---------------------------
2337636c353eSmrg# Minimum version: 1.19.0
2338636c353eSmrg#
2339636c353eSmrg# This macro attempts to locate an m4 macro processor which supports
2340636c353eSmrg# -I option and is only useful for modules relying on M4 in order to
2341636c353eSmrg# expand macros in source code files.
2342636c353eSmrg#
2343636c353eSmrg# Interface to module:
2344636c353eSmrg# M4:	 	returns the path of the m4 program found
2345636c353eSmrg#		returns the path set by the user in the environment
2346636c353eSmrg#
2347636c353eSmrgAC_DEFUN([XORG_WITH_M4], [
2348636c353eSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
2349636c353eSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
2350636c353eSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
2351636c353eSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
2352636c353eSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
2353636c353eSmrg   [$PATH:/usr/gnu/bin])])
2354e07dc26bSmrg
2355636c353eSmrgAC_SUBST([M4], [$ac_cv_path_M4])
2356636c353eSmrg]) # XORG_WITH_M4
2357e07dc26bSmrg
2358636c353eSmrg# XORG_WITH_PS2PDF([DEFAULT])
2359636c353eSmrg# ----------------
2360636c353eSmrg# Minimum version: 1.6.0
2361636c353eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2362636c353eSmrg#
2363636c353eSmrg# Documentation tools are not always available on all platforms and sometimes
2364636c353eSmrg# not at the appropriate level. This macro enables a module to test for the
2365636c353eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
2366636c353eSmrg# the --with-ps2pdf option, it allows maximum flexibility in making decisions
2367636c353eSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2368636c353eSmrg# --with-ps2pdf assumes 'auto'.
2369636c353eSmrg#
2370636c353eSmrg# Interface to module:
2371636c353eSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
2372636c353eSmrg# PS2PDF:	returns the path of the ps2pdf program found
2373636c353eSmrg#		returns the path set by the user in the environment
2374636c353eSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2375636c353eSmrg#		 'no' user instructs the module not to use ps2pdf
2376636c353eSmrg#
2377636c353eSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2378636c353eSmrg#
2379636c353eSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
2380636c353eSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2381636c353eSmrgm4_define([_defopt], m4_default([$1], [auto]))
2382636c353eSmrgAC_ARG_WITH(ps2pdf,
2383636c353eSmrg	AS_HELP_STRING([--with-ps2pdf],
2384636c353eSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2385636c353eSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2386636c353eSmrgm4_undefine([_defopt])
2387e07dc26bSmrg
2388636c353eSmrgif test "x$use_ps2pdf" = x"auto"; then
2389636c353eSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2390636c353eSmrg   if test "x$PS2PDF" = "x"; then
2391636c353eSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2392636c353eSmrg	have_ps2pdf=no
2393636c353eSmrg   else
2394636c353eSmrg        have_ps2pdf=yes
2395636c353eSmrg   fi
2396636c353eSmrgelif test "x$use_ps2pdf" = x"yes" ; then
2397636c353eSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2398636c353eSmrg   if test "x$PS2PDF" = "x"; then
2399636c353eSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2400636c353eSmrg   fi
2401636c353eSmrg   have_ps2pdf=yes
2402636c353eSmrgelif test "x$use_ps2pdf" = x"no" ; then
2403636c353eSmrg   if test "x$PS2PDF" != "x"; then
2404636c353eSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2405636c353eSmrg   fi
2406636c353eSmrg   have_ps2pdf=no
2407636c353eSmrgelse
2408636c353eSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2409e07dc26bSmrgfi
2410636c353eSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2411636c353eSmrg]) # XORG_WITH_PS2PDF
2412e07dc26bSmrg
2413636c353eSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
2414636c353eSmrg# ----------------
2415636c353eSmrg# Minimum version: 1.6.0
2416636c353eSmrg#
2417636c353eSmrg# Documentation tools are not always available on all platforms and sometimes
2418636c353eSmrg# not at the appropriate level. This macro enables a builder to skip all
2419636c353eSmrg# documentation targets except traditional man pages.
2420636c353eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2421636c353eSmrg# maximum flexibility in controlling documentation building.
2422636c353eSmrg# Refer to:
2423636c353eSmrg# XORG_WITH_XMLTO         --with-xmlto
2424636c353eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2425636c353eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2426636c353eSmrg# XORG_WITH_FOP           --with-fop
2427636c353eSmrg# XORG_WITH_GROFF         --with-groff
2428636c353eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2429636c353eSmrg#
2430636c353eSmrg# Interface to module:
2431636c353eSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
2432636c353eSmrg# --enable-docs: 'yes' user instructs the module to generate docs
2433636c353eSmrg#		 'no' user instructs the module not to generate docs
2434636c353eSmrg# parm1:	specify the default value, yes or no.
2435636c353eSmrg#
2436636c353eSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
2437636c353eSmrgm4_define([docs_default], m4_default([$1], [yes]))
2438636c353eSmrgAC_ARG_ENABLE(docs,
2439636c353eSmrg	AS_HELP_STRING([--enable-docs],
2440636c353eSmrg	   [Enable building the documentation (default: ]docs_default[)]),
2441636c353eSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
2442636c353eSmrgm4_undefine([docs_default])
2443636c353eSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2444636c353eSmrgAC_MSG_CHECKING([whether to build documentation])
2445636c353eSmrgAC_MSG_RESULT([$build_docs])
2446636c353eSmrg]) # XORG_ENABLE_DOCS
2447e07dc26bSmrg
2448636c353eSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2449636c353eSmrg# ----------------
2450636c353eSmrg# Minimum version: 1.6.0
2451636c353eSmrg#
2452636c353eSmrg# This macro enables a builder to skip all developer documentation.
2453636c353eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2454636c353eSmrg# maximum flexibility in controlling documentation building.
2455636c353eSmrg# Refer to:
2456636c353eSmrg# XORG_WITH_XMLTO         --with-xmlto
2457636c353eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2458636c353eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2459636c353eSmrg# XORG_WITH_FOP           --with-fop
2460636c353eSmrg# XORG_WITH_GROFF         --with-groff
2461636c353eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2462636c353eSmrg#
2463636c353eSmrg# Interface to module:
2464636c353eSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
2465636c353eSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
2466636c353eSmrg#			'no' user instructs the module not to generate developer docs
2467636c353eSmrg# parm1:		specify the default value, yes or no.
2468636c353eSmrg#
2469636c353eSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2470636c353eSmrgm4_define([devel_default], m4_default([$1], [yes]))
2471636c353eSmrgAC_ARG_ENABLE(devel-docs,
2472636c353eSmrg	AS_HELP_STRING([--enable-devel-docs],
2473636c353eSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
2474636c353eSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2475636c353eSmrgm4_undefine([devel_default])
2476636c353eSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2477636c353eSmrgAC_MSG_CHECKING([whether to build developer documentation])
2478636c353eSmrgAC_MSG_RESULT([$build_devel_docs])
2479636c353eSmrg]) # XORG_ENABLE_DEVEL_DOCS
2480e07dc26bSmrg
2481636c353eSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
2482636c353eSmrg# ----------------
2483636c353eSmrg# Minimum version: 1.6.0
2484636c353eSmrg#
2485636c353eSmrg# This macro enables a builder to skip all functional specification targets.
2486636c353eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2487636c353eSmrg# maximum flexibility in controlling documentation building.
2488636c353eSmrg# Refer to:
2489636c353eSmrg# XORG_WITH_XMLTO         --with-xmlto
2490636c353eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2491636c353eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2492636c353eSmrg# XORG_WITH_FOP           --with-fop
2493636c353eSmrg# XORG_WITH_GROFF         --with-groff
2494636c353eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2495636c353eSmrg#
2496636c353eSmrg# Interface to module:
2497636c353eSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
2498636c353eSmrg# --enable-specs:	'yes' user instructs the module to generate specs
2499636c353eSmrg#			'no' user instructs the module not to generate specs
2500636c353eSmrg# parm1:		specify the default value, yes or no.
2501636c353eSmrg#
2502636c353eSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
2503636c353eSmrgm4_define([spec_default], m4_default([$1], [yes]))
2504636c353eSmrgAC_ARG_ENABLE(specs,
2505636c353eSmrg	AS_HELP_STRING([--enable-specs],
2506636c353eSmrg	   [Enable building the specs (default: ]spec_default[)]),
2507636c353eSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
2508636c353eSmrgm4_undefine([spec_default])
2509636c353eSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2510636c353eSmrgAC_MSG_CHECKING([whether to build functional specifications])
2511636c353eSmrgAC_MSG_RESULT([$build_specs])
2512636c353eSmrg]) # XORG_ENABLE_SPECS
2513e07dc26bSmrg
2514636c353eSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2515636c353eSmrg# ----------------------------------------------
2516636c353eSmrg# Minimum version: 1.13.0
2517636c353eSmrg#
2518636c353eSmrg# This macro enables a builder to enable/disable unit testing
2519636c353eSmrg# It makes no assumption about the test cases implementation
2520636c353eSmrg# Test cases may or may not use Automake "Support for test suites"
2521636c353eSmrg# They may or may not use the software utility library GLib
2522636c353eSmrg#
2523636c353eSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2524636c353eSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2525636c353eSmrg# The variable enable_unit_tests is used by other macros in this file.
2526636c353eSmrg#
2527636c353eSmrg# Interface to module:
2528636c353eSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2529636c353eSmrg# enable_unit_tests:    used in configure.ac for additional configuration
2530636c353eSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
2531636c353eSmrg#			'no' user instructs the module not to build tests
2532636c353eSmrg# parm1:		specify the default value, yes or no.
2533636c353eSmrg#
2534636c353eSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2535636c353eSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
2536636c353eSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
2537636c353eSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2538636c353eSmrgm4_define([_defopt], m4_default([$1], [auto]))
2539636c353eSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2540636c353eSmrg	[Enable building unit test cases (default: ]_defopt[)]),
2541636c353eSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2542636c353eSmrgm4_undefine([_defopt])
2543636c353eSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2544636c353eSmrgAC_MSG_CHECKING([whether to build unit test cases])
2545636c353eSmrgAC_MSG_RESULT([$enable_unit_tests])
2546636c353eSmrg]) # XORG_ENABLE_UNIT_TESTS
2547e07dc26bSmrg
2548636c353eSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2549636c353eSmrg# ------------------------------------------------------
2550636c353eSmrg# Minimum version: 1.17.0
2551636c353eSmrg#
2552636c353eSmrg# This macro enables a builder to enable/disable integration testing
2553636c353eSmrg# It makes no assumption about the test cases' implementation
2554636c353eSmrg# Test cases may or may not use Automake "Support for test suites"
2555636c353eSmrg#
2556636c353eSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2557636c353eSmrg# usually requires less dependencies and may be built and run under less
2558636c353eSmrg# stringent environments than integration tests.
2559636c353eSmrg#
2560636c353eSmrg# Interface to module:
2561636c353eSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
2562636c353eSmrg# enable_integration_tests:   used in configure.ac for additional configuration
2563636c353eSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
2564636c353eSmrg#                             'no' user instructs the module not to build tests
2565636c353eSmrg# parm1:                      specify the default value, yes or no.
2566636c353eSmrg#
2567636c353eSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2568636c353eSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2569636c353eSmrgm4_define([_defopt], m4_default([$1], [auto]))
2570636c353eSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2571636c353eSmrg	[Enable building integration test cases (default: ]_defopt[)]),
2572636c353eSmrg	[enable_integration_tests=$enableval],
2573636c353eSmrg	[enable_integration_tests=]_defopt)
2574636c353eSmrgm4_undefine([_defopt])
2575636c353eSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2576636c353eSmrg	[test "x$enable_integration_tests" != xno])
2577636c353eSmrgAC_MSG_CHECKING([whether to build unit test cases])
2578636c353eSmrgAC_MSG_RESULT([$enable_integration_tests])
2579636c353eSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
2580e07dc26bSmrg
2581636c353eSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2582636c353eSmrg# ----------------------------------------
2583636c353eSmrg# Minimum version: 1.13.0
2584636c353eSmrg#
2585636c353eSmrg# GLib is a library which provides advanced data structures and functions.
2586636c353eSmrg# This macro enables a module to test for the presence of Glib.
2587636c353eSmrg#
2588636c353eSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2589636c353eSmrg# Otherwise the value of $enable_unit_tests is blank.
2590636c353eSmrg#
2591636c353eSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2592636c353eSmrg# test support usually requires less dependencies and may be built and run under
2593636c353eSmrg# less stringent environments than integration tests.
2594636c353eSmrg#
2595636c353eSmrg# Interface to module:
2596636c353eSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
2597636c353eSmrg# with_glib: used in configure.ac to know if GLib has been found
2598636c353eSmrg# --with-glib:	'yes' user instructs the module to use glib
2599636c353eSmrg#		'no' user instructs the module not to use glib
2600636c353eSmrg#
2601636c353eSmrgAC_DEFUN([XORG_WITH_GLIB],[
2602636c353eSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2603636c353eSmrgm4_define([_defopt], m4_default([$2], [auto]))
2604636c353eSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2605636c353eSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
2606636c353eSmrg	[with_glib=$withval], [with_glib=]_defopt)
2607636c353eSmrgm4_undefine([_defopt])
2608e07dc26bSmrg
2609636c353eSmrghave_glib=no
2610636c353eSmrg# Do not probe GLib if user explicitly disabled unit testing
2611636c353eSmrgif test "x$enable_unit_tests" != x"no"; then
2612636c353eSmrg  # Do not probe GLib if user explicitly disabled it
2613636c353eSmrg  if test "x$with_glib" != x"no"; then
2614636c353eSmrg    m4_ifval(
2615636c353eSmrg      [$1],
2616636c353eSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2617636c353eSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2618636c353eSmrg    )
2619e07dc26bSmrg  fi
2620e07dc26bSmrgfi
2621e07dc26bSmrg
2622636c353eSmrg# Not having GLib when unit testing has been explicitly requested is an error
2623636c353eSmrgif test "x$enable_unit_tests" = x"yes"; then
2624636c353eSmrg  if test "x$have_glib" = x"no"; then
2625636c353eSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2626636c353eSmrg  fi
2627636c353eSmrgfi
2628e07dc26bSmrg
2629636c353eSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
2630636c353eSmrgif test "x$enable_unit_tests" = x"no"; then
2631636c353eSmrg  if test "x$with_glib" = x"yes"; then
2632636c353eSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2633636c353eSmrg  fi
2634636c353eSmrgfi
2635e07dc26bSmrg
2636636c353eSmrg# Not having GLib when it has been explicitly requested is an error
2637636c353eSmrgif test "x$with_glib" = x"yes"; then
2638636c353eSmrg  if test "x$have_glib" = x"no"; then
2639636c353eSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2640e07dc26bSmrg  fi
2641e07dc26bSmrgfi
2642e07dc26bSmrg
2643636c353eSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2644636c353eSmrg]) # XORG_WITH_GLIB
2645e07dc26bSmrg
2646636c353eSmrg# XORG_LD_WRAP([required|optional])
2647636c353eSmrg# ---------------------------------
2648636c353eSmrg# Minimum version: 1.13.0
2649636c353eSmrg#
2650636c353eSmrg# Check if linker supports -wrap, passed via compiler flags
2651636c353eSmrg#
2652636c353eSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2653636c353eSmrg# Otherwise the value of $enable_unit_tests is blank.
2654636c353eSmrg#
2655636c353eSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
2656636c353eSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
2657636c353eSmrg# available, an argument of "optional" allows use when some unit tests require
2658636c353eSmrg# ld -wrap and others do not.
2659636c353eSmrg#
2660636c353eSmrgAC_DEFUN([XORG_LD_WRAP],[
2661636c353eSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2662636c353eSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
2663636c353eSmrg                      void __wrap_exit(int status) { return; }],
2664636c353eSmrg                     [exit(0);])])
2665636c353eSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
2666636c353eSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2667636c353eSmrg  if test "x$have_ld_wrap" = x"no"; then
2668636c353eSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2669e07dc26bSmrg  fi
2670e07dc26bSmrgfi
2671636c353eSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2672636c353eSmrg#
2673636c353eSmrg]) # XORG_LD_WRAP
2674e07dc26bSmrg
2675636c353eSmrg# XORG_CHECK_LINKER_FLAGS
2676636c353eSmrg# -----------------------
2677636c353eSmrg# SYNOPSIS
2678636c353eSmrg#
2679636c353eSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2680636c353eSmrg#
2681636c353eSmrg# DESCRIPTION
2682636c353eSmrg#
2683636c353eSmrg#   Check whether the given linker FLAGS work with the current language's
2684636c353eSmrg#   linker, or whether they give an error.
2685636c353eSmrg#
2686636c353eSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2687636c353eSmrg#   success/failure.
2688636c353eSmrg#
2689636c353eSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
2690636c353eSmrg#
2691636c353eSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2692636c353eSmrg#
2693636c353eSmrg# LICENSE
2694636c353eSmrg#
2695636c353eSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2696636c353eSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2697636c353eSmrg#   Copyright (c) 2009 Matteo Frigo
2698636c353eSmrg#
2699636c353eSmrg#   This program is free software: you can redistribute it and/or modify it
2700636c353eSmrg#   under the terms of the GNU General Public License as published by the
2701636c353eSmrg#   Free Software Foundation, either version 3 of the License, or (at your
2702636c353eSmrg#   option) any later version.
2703636c353eSmrg#
2704636c353eSmrg#   This program is distributed in the hope that it will be useful, but
2705636c353eSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
2706636c353eSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2707636c353eSmrg#   Public License for more details.
2708636c353eSmrg#
2709636c353eSmrg#   You should have received a copy of the GNU General Public License along
2710636c353eSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
2711636c353eSmrg#
2712636c353eSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
2713636c353eSmrg#   gives unlimited permission to copy, distribute and modify the configure
2714636c353eSmrg#   scripts that are the output of Autoconf when processing the Macro. You
2715636c353eSmrg#   need not follow the terms of the GNU General Public License when using
2716636c353eSmrg#   or distributing such scripts, even though portions of the text of the
2717636c353eSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
2718636c353eSmrg#   all other use of the material that constitutes the Autoconf Macro.
2719636c353eSmrg#
2720636c353eSmrg#   This special exception to the GPL applies to versions of the Autoconf
2721636c353eSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
2722636c353eSmrg#   modified version of the Autoconf Macro, you may extend this special
2723636c353eSmrg#   exception to the GPL to apply to your modified version as well.#
2724636c353eSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2725636c353eSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
2726636c353eSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2727636c353eSmrgAS_LITERAL_IF([$1],
2728636c353eSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2729636c353eSmrg      ax_save_FLAGS=$LDFLAGS
2730636c353eSmrg      LDFLAGS="$1"
2731636c353eSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2732636c353eSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2733636c353eSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2734636c353eSmrg      LDFLAGS=$ax_save_FLAGS])],
2735636c353eSmrg  [ax_save_FLAGS=$LDFLAGS
2736636c353eSmrg   LDFLAGS="$1"
2737636c353eSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2738636c353eSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2739636c353eSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2740636c353eSmrg   LDFLAGS=$ax_save_FLAGS])
2741636c353eSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2742636c353eSmrgAC_MSG_RESULT($xorg_check_linker_flags)
2743636c353eSmrgif test "x$xorg_check_linker_flags" = xyes; then
2744636c353eSmrg	m4_default([$2], :)
2745e07dc26bSmrgelse
2746636c353eSmrg	m4_default([$3], :)
2747e07dc26bSmrgfi
2748636c353eSmrg]) # XORG_CHECK_LINKER_FLAGS
2749636c353eSmrg
2750636c353eSmrg# XORG_MEMORY_CHECK_FLAGS
2751636c353eSmrg# -----------------------
2752636c353eSmrg# Minimum version: 1.16.0
2753636c353eSmrg#
2754636c353eSmrg# This macro attempts to find appropriate memory checking functionality
2755636c353eSmrg# for various platforms which unit testing code may use to catch various
2756636c353eSmrg# forms of memory allocation and access errors in testing.
2757636c353eSmrg#
2758636c353eSmrg# Interface to module:
2759636c353eSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2760636c353eSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
2761636c353eSmrg#
2762636c353eSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2763636c353eSmrg#
2764636c353eSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
2765e07dc26bSmrg
2766636c353eSmrgAC_REQUIRE([AC_CANONICAL_HOST])
2767636c353eSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2768636c353eSmrg           [Environment variables to enable memory checking in tests])
2769e07dc26bSmrg
2770636c353eSmrg# Check for different types of support on different platforms
2771636c353eSmrgcase $host_os in
2772636c353eSmrg    solaris*)
2773636c353eSmrg        AC_CHECK_LIB([umem], [umem_alloc],
2774636c353eSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2775e07dc26bSmrg        ;;
2776636c353eSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2777636c353eSmrg        # both directly and inverted, so should not be 0 or 255.
2778636c353eSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
2779e07dc26bSmrg        ;;
2780636c353eSmrg    darwin*)
2781636c353eSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2782e07dc26bSmrg        ;;
2783636c353eSmrg    *bsd*)
2784636c353eSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2785e07dc26bSmrg        ;;
2786636c353eSmrgesac
2787e07dc26bSmrg
2788636c353eSmrg# User supplied flags override default flags
2789636c353eSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2790636c353eSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2791636c353eSmrgfi
2792e07dc26bSmrg
2793636c353eSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2794636c353eSmrg]) # XORG_WITH_LINT
2795636c353eSmrg
2796636c353eSmrg# XORG_CHECK_MALLOC_ZERO
2797636c353eSmrg# ----------------------
2798636c353eSmrg# Minimum version: 1.0.0
2799636c353eSmrg#
2800636c353eSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2801636c353eSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
2802636c353eSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2803636c353eSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2804636c353eSmrgAC_ARG_ENABLE(malloc0returnsnull,
2805636c353eSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
2806636c353eSmrg		       [malloc(0) returns NULL (default: auto)]),
2807636c353eSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2808636c353eSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2809636c353eSmrg
2810636c353eSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
2811636c353eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2812636c353eSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
2813636c353eSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
2814636c353eSmrg#include <stdlib.h>
2815636c353eSmrg],[
2816636c353eSmrg    char *m0, *r0, *c0, *p;
2817636c353eSmrg    m0 = malloc(0);
2818636c353eSmrg    p = malloc(10);
2819636c353eSmrg    r0 = realloc(p,0);
2820636c353eSmrg    c0 = calloc(0,10);
2821636c353eSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2822636c353eSmrg])],
2823636c353eSmrg		[xorg_cv_malloc0_returns_null=yes],
2824636c353eSmrg		[xorg_cv_malloc0_returns_null=no])])
2825636c353eSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2826636c353eSmrgfi
2827636c353eSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2828636c353eSmrg
2829636c353eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2830636c353eSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2831636c353eSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2832636c353eSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2833e07dc26bSmrgelse
2834636c353eSmrg	MALLOC_ZERO_CFLAGS=""
2835636c353eSmrg	XMALLOC_ZERO_CFLAGS=""
2836636c353eSmrg	XTMALLOC_ZERO_CFLAGS=""
2837636c353eSmrgfi
2838e07dc26bSmrg
2839636c353eSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
2840636c353eSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
2841636c353eSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
2842636c353eSmrg]) # XORG_CHECK_MALLOC_ZERO
2843e07dc26bSmrg
2844636c353eSmrg# XORG_WITH_LINT()
2845636c353eSmrg# ----------------
2846636c353eSmrg# Minimum version: 1.1.0
2847636c353eSmrg#
2848636c353eSmrg# This macro enables the use of a tool that flags some suspicious and
2849636c353eSmrg# non-portable constructs (likely to be bugs) in C language source code.
2850636c353eSmrg# It will attempt to locate the tool and use appropriate options.
2851636c353eSmrg# There are various lint type tools on different platforms.
2852636c353eSmrg#
2853636c353eSmrg# Interface to module:
2854636c353eSmrg# LINT:		returns the path to the tool found on the platform
2855636c353eSmrg#		or the value set to LINT on the configure cmd line
2856636c353eSmrg#		also an Automake conditional
2857636c353eSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
2858636c353eSmrg#
2859636c353eSmrg# --with-lint:	'yes' user instructs the module to use lint
2860636c353eSmrg#		'no' user instructs the module not to use lint (default)
2861636c353eSmrg#
2862636c353eSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2863636c353eSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
2864636c353eSmrg#
2865636c353eSmrgAC_DEFUN([XORG_WITH_LINT],[
2866636c353eSmrg
2867636c353eSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
2868636c353eSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2869636c353eSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2870636c353eSmrg		[Use a lint-style source code checker (default: disabled)])],
2871636c353eSmrg		[use_lint=$withval], [use_lint=no])
2872e07dc26bSmrg
2873636c353eSmrg# Obtain platform specific info like program name and options
2874636c353eSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2875e07dc26bSmrgcase $host_os in
2876636c353eSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2877636c353eSmrg	lint_name=splint
2878636c353eSmrg	lint_options="-badflag"
2879636c353eSmrg	;;
2880636c353eSmrg  *freebsd* | *netbsd*)
2881636c353eSmrg	lint_name=lint
2882636c353eSmrg	lint_options="-u -b"
2883636c353eSmrg	;;
2884636c353eSmrg  *solaris*)
2885636c353eSmrg	lint_name=lint
2886636c353eSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2887636c353eSmrg	;;
2888636c353eSmrgesac
2889e07dc26bSmrg
2890636c353eSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2891636c353eSmrgif test "x$use_lint" = x"yes" ; then
2892636c353eSmrg   AC_PATH_PROG([LINT], [$lint_name])
2893636c353eSmrg   if test "x$LINT" = "x"; then
2894636c353eSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2895636c353eSmrg   fi
2896636c353eSmrgelif test "x$use_lint" = x"no" ; then
2897636c353eSmrg   if test "x$LINT" != "x"; then
2898636c353eSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2899636c353eSmrg   fi
2900636c353eSmrgelse
2901636c353eSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2902636c353eSmrgfi
2903e07dc26bSmrg
2904636c353eSmrg# User supplied flags override default flags
2905636c353eSmrgif test "x$LINT_FLAGS" != "x"; then
2906636c353eSmrg   lint_options=$LINT_FLAGS
2907636c353eSmrgfi
2908e07dc26bSmrg
2909636c353eSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2910636c353eSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2911e07dc26bSmrg
2912636c353eSmrg]) # XORG_WITH_LINT
2913e07dc26bSmrg
2914636c353eSmrg# XORG_LINT_LIBRARY(LIBNAME)
2915636c353eSmrg# --------------------------
2916636c353eSmrg# Minimum version: 1.1.0
2917636c353eSmrg#
2918636c353eSmrg# Sets up flags for building lint libraries for checking programs that call
2919636c353eSmrg# functions in the library.
2920636c353eSmrg#
2921636c353eSmrg# Interface to module:
2922636c353eSmrg# LINTLIB		- Automake variable with the name of lint library file to make
2923636c353eSmrg# MAKE_LINT_LIB		- Automake conditional
2924636c353eSmrg#
2925636c353eSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2926636c353eSmrg#			  - 'no' user instructs the module not to create a lint library (default)
2927e07dc26bSmrg
2928636c353eSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2929636c353eSmrgAC_REQUIRE([XORG_WITH_LINT])
2930636c353eSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2931636c353eSmrg	[Create lint library (default: disabled)])],
2932636c353eSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2933e07dc26bSmrg
2934636c353eSmrgif test "x$make_lint_lib" = x"yes" ; then
2935636c353eSmrg   LINTLIB=llib-l$1.ln
2936636c353eSmrg   if test "x$LINT" = "x"; then
2937636c353eSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2938636c353eSmrg   fi
2939636c353eSmrgelif test "x$make_lint_lib" != x"no" ; then
2940636c353eSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2941636c353eSmrgfi
2942e07dc26bSmrg
2943636c353eSmrgAC_SUBST(LINTLIB)
2944636c353eSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2945e07dc26bSmrg
2946636c353eSmrg]) # XORG_LINT_LIBRARY
2947e07dc26bSmrg
2948636c353eSmrg# XORG_COMPILER_BRAND
2949636c353eSmrg# -------------------
2950636c353eSmrg# Minimum version: 1.14.0
2951636c353eSmrg#
2952636c353eSmrg# Checks for various brands of compilers and sets flags as appropriate:
2953636c353eSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2954636c353eSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2955636c353eSmrg#   clang compiler - sets CLANGCC to "yes"
2956636c353eSmrg#   Intel compiler - sets INTELCC to "yes"
2957636c353eSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2958636c353eSmrg#
2959636c353eSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
2960636c353eSmrgAC_LANG_CASE(
2961636c353eSmrg	[C], [
2962636c353eSmrg		dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
2963636c353eSmrg		dnl and complains that AC_PROG_CC_C99 is obsolete
2964636c353eSmrg		m4_version_prereq([2.70],
2965636c353eSmrg			[AC_REQUIRE([AC_PROG_CC])],
2966636c353eSmrg			[AC_REQUIRE([AC_PROG_CC_C99])])
2967636c353eSmrg	],
2968636c353eSmrg	[C++], [
2969636c353eSmrg		AC_REQUIRE([AC_PROG_CXX])
2970636c353eSmrg	]
2971636c353eSmrg)
2972636c353eSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2973636c353eSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2974636c353eSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2975636c353eSmrg]) # XORG_COMPILER_BRAND
2976e07dc26bSmrg
2977636c353eSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
2978636c353eSmrg# ---------------
2979636c353eSmrg# Minimum version: 1.16.0
2980636c353eSmrg#
2981636c353eSmrg# Test if the compiler works when passed the given flag as a command line argument.
2982636c353eSmrg# If it succeeds, the flag is appended to the given variable.  If not, it tries the
2983636c353eSmrg# next flag in the list until there are no more options.
2984636c353eSmrg#
2985636c353eSmrg# Note that this does not guarantee that the compiler supports the flag as some
2986636c353eSmrg# compilers will simply ignore arguments that they do not understand, but we do
2987636c353eSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
2988636c353eSmrg# -Werror=unused-command-line-argument
2989636c353eSmrg#
2990636c353eSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
2991636c353eSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2992636c353eSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2993e07dc26bSmrg
2994636c353eSmrgAC_LANG_COMPILER_REQUIRE
2995e07dc26bSmrg
2996636c353eSmrgAC_LANG_CASE(
2997636c353eSmrg	[C], [
2998636c353eSmrg		dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
2999636c353eSmrg		dnl and complains that AC_PROG_CC_C99 is obsolete
3000636c353eSmrg		m4_version_prereq([2.70],
3001636c353eSmrg			[AC_REQUIRE([AC_PROG_CC])],
3002636c353eSmrg			[AC_REQUIRE([AC_PROG_CC_C99])])
3003636c353eSmrg		define([PREFIX], [C])
3004636c353eSmrg		define([CACHE_PREFIX], [cc])
3005636c353eSmrg		define([COMPILER], [$CC])
3006636c353eSmrg	],
3007636c353eSmrg	[C++], [
3008636c353eSmrg		define([PREFIX], [CXX])
3009636c353eSmrg		define([CACHE_PREFIX], [cxx])
3010636c353eSmrg		define([COMPILER], [$CXX])
3011636c353eSmrg	]
3012636c353eSmrg)
3013e07dc26bSmrg
3014636c353eSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
3015e07dc26bSmrg
3016636c353eSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
3017636c353eSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3018636c353eSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
3019636c353eSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
3020636c353eSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3021636c353eSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
3022636c353eSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
3023636c353eSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
3024636c353eSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3025636c353eSmrgfi
3026e07dc26bSmrg
3027636c353eSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
3028636c353eSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
3029636c353eSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3030636c353eSmrg	fi
3031636c353eSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3032636c353eSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
3033636c353eSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
3034636c353eSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3035636c353eSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
3036636c353eSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
3037636c353eSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
3038636c353eSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3039636c353eSmrgfi
3040e07dc26bSmrg
3041636c353eSmrgfound="no"
3042636c353eSmrgm4_foreach([flag], m4_cdr($@), [
3043636c353eSmrg	if test $found = "no" ; then
3044636c353eSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
3045636c353eSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3046636c353eSmrg		fi
3047e07dc26bSmrg
3048636c353eSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
3049636c353eSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3050636c353eSmrg		fi
3051e07dc26bSmrg
3052636c353eSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
3053e07dc26bSmrg
3054636c353eSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
3055636c353eSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
3056636c353eSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
3057636c353eSmrg		AC_CACHE_VAL($cacheid,
3058636c353eSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
3059636c353eSmrg					     [eval $cacheid=yes],
3060636c353eSmrg					     [eval $cacheid=no])])
3061e07dc26bSmrg
3062636c353eSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3063e07dc26bSmrg
3064636c353eSmrg		eval supported=\$$cacheid
3065636c353eSmrg		AC_MSG_RESULT([$supported])
3066636c353eSmrg		if test "$supported" = "yes" ; then
3067636c353eSmrg			$1="$$1 ]flag["
3068636c353eSmrg			found="yes"
3069636c353eSmrg		fi
3070636c353eSmrg	fi
3071636c353eSmrg])
3072636c353eSmrg]) # XORG_TESTSET_CFLAG
3073e07dc26bSmrg
3074636c353eSmrg# XORG_COMPILER_FLAGS
3075636c353eSmrg# ---------------
3076636c353eSmrg# Minimum version: 1.16.0
3077636c353eSmrg#
3078636c353eSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
3079636c353eSmrg# arguments supported by the selected compiler which do NOT alter the generated
3080636c353eSmrg# code.  These arguments will cause the compiler to print various warnings
3081636c353eSmrg# during compilation AND turn a conservative set of warnings into errors.
3082636c353eSmrg#
3083636c353eSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
3084636c353eSmrg# future versions of util-macros as options are added to new compilers.
3085636c353eSmrg#
3086636c353eSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
3087636c353eSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3088e07dc26bSmrg
3089636c353eSmrgAC_ARG_ENABLE(selective-werror,
3090636c353eSmrg              AS_HELP_STRING([--disable-selective-werror],
3091636c353eSmrg                             [Turn off selective compiler errors. (default: enabled)]),
3092636c353eSmrg              [SELECTIVE_WERROR=$enableval],
3093636c353eSmrg              [SELECTIVE_WERROR=yes])
3094e07dc26bSmrg
3095636c353eSmrgAC_LANG_CASE(
3096636c353eSmrg        [C], [
3097636c353eSmrg                define([PREFIX], [C])
3098636c353eSmrg        ],
3099636c353eSmrg        [C++], [
3100636c353eSmrg                define([PREFIX], [CXX])
3101636c353eSmrg        ]
3102636c353eSmrg)
3103636c353eSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
3104636c353eSmrgif test "x$SUNCC" = "xyes"; then
3105636c353eSmrg    [BASE_]PREFIX[FLAGS]="-v"
3106636c353eSmrgelse
3107636c353eSmrg    [BASE_]PREFIX[FLAGS]=""
3108636c353eSmrgfi
3109e07dc26bSmrg
3110636c353eSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
3111636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
3112636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
3113636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
3114636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
3115e07dc26bSmrg
3116636c353eSmrgAC_LANG_CASE(
3117636c353eSmrg	[C], [
3118636c353eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
3119636c353eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
3120636c353eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
3121636c353eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
3122636c353eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
3123636c353eSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
3124636c353eSmrg	]
3125636c353eSmrg)
3126e07dc26bSmrg
3127636c353eSmrg# This chunk adds additional warnings that could catch undesired effects.
3128636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
3129636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
3130636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
3131636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
3132636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
3133636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
3134636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
3135e07dc26bSmrg
3136636c353eSmrg# These are currently disabled because they are noisy.  They will be enabled
3137636c353eSmrg# in the future once the codebase is sufficiently modernized to silence
3138636c353eSmrg# them.  For now, I don't want them to drown out the other warnings.
3139636c353eSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
3140636c353eSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
3141636c353eSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
3142e07dc26bSmrg
3143636c353eSmrg# Turn some warnings into errors, so we don't accidentally get successful builds
3144636c353eSmrg# when there are problems that should be fixed.
3145e07dc26bSmrg
3146636c353eSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
3147636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
3148636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
3149636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
3150636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
3151636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
3152636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
3153636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
3154636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
3155636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
3156636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3157636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3158636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3159636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
3160636c353eSmrgelse
3161636c353eSmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
3162636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3163636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3164636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3165636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3166636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3167636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3168636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3169636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3170636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3171636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3172636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3173636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3174636c353eSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
3175636c353eSmrgfi
3176e07dc26bSmrg
3177636c353eSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3178636c353eSmrg]) # XORG_COMPILER_FLAGS
3179e07dc26bSmrg
3180636c353eSmrg# XORG_CWARNFLAGS
3181636c353eSmrg# ---------------
3182636c353eSmrg# Minimum version: 1.2.0
3183636c353eSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3184636c353eSmrg#
3185636c353eSmrg# Defines CWARNFLAGS to enable C compiler warnings.
3186636c353eSmrg#
3187636c353eSmrg# This function is deprecated because it defines -fno-strict-aliasing
3188636c353eSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
3189636c353eSmrg# is needed, then it should be added explicitly in the module when
3190636c353eSmrg# it is updated to use BASE_CFLAGS.
3191636c353eSmrg#
3192636c353eSmrgAC_DEFUN([XORG_CWARNFLAGS], [
3193636c353eSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3194636c353eSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3195636c353eSmrgAC_LANG_CASE(
3196636c353eSmrg	[C], [
3197636c353eSmrg		CWARNFLAGS="$BASE_CFLAGS"
3198636c353eSmrg		if  test "x$GCC" = xyes ; then
3199636c353eSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3200636c353eSmrg		fi
3201636c353eSmrg		AC_SUBST(CWARNFLAGS)
3202636c353eSmrg	]
3203636c353eSmrg)
3204636c353eSmrg]) # XORG_CWARNFLAGS
3205e07dc26bSmrg
3206636c353eSmrg# XORG_STRICT_OPTION
3207636c353eSmrg# -----------------------
3208636c353eSmrg# Minimum version: 1.3.0
3209636c353eSmrg#
3210636c353eSmrg# Add configure option to enable strict compilation flags, such as treating
3211636c353eSmrg# warnings as fatal errors.
3212636c353eSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
3213636c353eSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
3214636c353eSmrg#
3215636c353eSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
3216636c353eSmrg# when strict compilation is unconditionally desired.
3217636c353eSmrgAC_DEFUN([XORG_STRICT_OPTION], [
3218636c353eSmrgAC_REQUIRE([XORG_CWARNFLAGS])
3219636c353eSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3220e07dc26bSmrg
3221636c353eSmrgAC_ARG_ENABLE(strict-compilation,
3222636c353eSmrg			  AS_HELP_STRING([--enable-strict-compilation],
3223636c353eSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
3224636c353eSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
3225e07dc26bSmrg
3226636c353eSmrgAC_LANG_CASE(
3227636c353eSmrg        [C], [
3228636c353eSmrg                define([PREFIX], [C])
3229636c353eSmrg        ],
3230636c353eSmrg        [C++], [
3231636c353eSmrg                define([PREFIX], [CXX])
3232636c353eSmrg        ]
3233636c353eSmrg)
3234e07dc26bSmrg
3235636c353eSmrg[STRICT_]PREFIX[FLAGS]=""
3236636c353eSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3237636c353eSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3238e07dc26bSmrg
3239636c353eSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3240636c353eSmrg# activate it with -Werror, so we add it here explicitly.
3241636c353eSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
3242e07dc26bSmrg
3243636c353eSmrgif test "x$STRICT_COMPILE" = "xyes"; then
3244636c353eSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3245636c353eSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
3246e07dc26bSmrgfi
3247636c353eSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
3248636c353eSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3249636c353eSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
3250636c353eSmrg]) # XORG_STRICT_OPTION
3251e07dc26bSmrg
3252636c353eSmrg# XORG_DEFAULT_NOCODE_OPTIONS
3253636c353eSmrg# ---------------------------
3254636c353eSmrg# Minimum version: 1.20.0
3255636c353eSmrg#
3256636c353eSmrg# Defines default options for X.Org modules which don't compile code,
3257636c353eSmrg# such as fonts, bitmaps, cursors, and docs.
3258636c353eSmrg#
3259636c353eSmrgAC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [
3260636c353eSmrgAC_REQUIRE([AC_PROG_INSTALL])
3261636c353eSmrgXORG_RELEASE_VERSION
3262636c353eSmrgXORG_CHANGELOG
3263636c353eSmrgXORG_INSTALL
3264636c353eSmrgXORG_MANPAGE_SECTIONS
3265636c353eSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
3266636c353eSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
3267636c353eSmrg]) # XORG_DEFAULT_NOCODE_OPTIONS
3268e07dc26bSmrg
3269636c353eSmrg# XORG_DEFAULT_OPTIONS
3270636c353eSmrg# --------------------
3271636c353eSmrg# Minimum version: 1.3.0
3272636c353eSmrg#
3273636c353eSmrg# Defines default options for X.Org modules which compile code.
3274636c353eSmrg#
3275636c353eSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
3276636c353eSmrgAC_REQUIRE([AC_PROG_INSTALL])
3277636c353eSmrgXORG_COMPILER_FLAGS
3278636c353eSmrgXORG_CWARNFLAGS
3279636c353eSmrgXORG_STRICT_OPTION
3280636c353eSmrgXORG_DEFAULT_NOCODE_OPTIONS
3281636c353eSmrg]) # XORG_DEFAULT_OPTIONS
3282e07dc26bSmrg
3283636c353eSmrg# XORG_INSTALL()
3284636c353eSmrg# ----------------
3285636c353eSmrg# Minimum version: 1.4.0
3286636c353eSmrg#
3287636c353eSmrg# Defines the variable INSTALL_CMD as the command to copy
3288636c353eSmrg# INSTALL from $prefix/share/util-macros.
3289636c353eSmrg#
3290636c353eSmrgAC_DEFUN([XORG_INSTALL], [
3291636c353eSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
3292636c353eSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
3293636c353eSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
3294636c353eSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
3295636c353eSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
3296636c353eSmrgtouch \$(top_srcdir)/INSTALL; \
3297636c353eSmrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
3298636c353eSmrgAC_SUBST([INSTALL_CMD])
3299636c353eSmrg]) # XORG_INSTALL
3300636c353eSmrgdnl Copyright 2005 Red Hat, Inc
3301636c353eSmrgdnl
3302636c353eSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
3303636c353eSmrgdnl documentation for any purpose is hereby granted without fee, provided that
3304636c353eSmrgdnl the above copyright notice appear in all copies and that both that
3305636c353eSmrgdnl copyright notice and this permission notice appear in supporting
3306636c353eSmrgdnl documentation.
3307636c353eSmrgdnl
3308636c353eSmrgdnl The above copyright notice and this permission notice shall be included
3309636c353eSmrgdnl in all copies or substantial portions of the Software.
3310636c353eSmrgdnl
3311636c353eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3312636c353eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3313636c353eSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3314636c353eSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3315636c353eSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3316636c353eSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3317636c353eSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
3318636c353eSmrgdnl
3319636c353eSmrgdnl Except as contained in this notice, the name of the copyright holders shall
3320636c353eSmrgdnl not be used in advertising or otherwise to promote the sale, use or
3321636c353eSmrgdnl other dealings in this Software without prior written authorization
3322636c353eSmrgdnl from the copyright holders.
3323636c353eSmrgdnl
3324e07dc26bSmrg
3325636c353eSmrg# XORG_RELEASE_VERSION
3326636c353eSmrg# --------------------
3327636c353eSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
3328e07dc26bSmrg
3329636c353eSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
3330636c353eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3331636c353eSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
3332636c353eSmrg		[Major version of this package])
3333636c353eSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3334636c353eSmrg	if test "x$PVM" = "x"; then
3335636c353eSmrg		PVM="0"
3336636c353eSmrg	fi
3337636c353eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3338636c353eSmrg		[$PVM],
3339636c353eSmrg		[Minor version of this package])
3340636c353eSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3341636c353eSmrg	if test "x$PVP" = "x"; then
3342636c353eSmrg		PVP="0"
3343636c353eSmrg	fi
3344636c353eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3345636c353eSmrg		[$PVP],
3346636c353eSmrg		[Patch version of this package])
3347636c353eSmrg])
3348e07dc26bSmrg
3349636c353eSmrg# XORG_CHANGELOG()
3350636c353eSmrg# ----------------
3351636c353eSmrg# Minimum version: 1.2.0
3352636c353eSmrg#
3353636c353eSmrg# Defines the variable CHANGELOG_CMD as the command to generate
3354636c353eSmrg# ChangeLog from git.
3355636c353eSmrg#
3356636c353eSmrg#
3357636c353eSmrgAC_DEFUN([XORG_CHANGELOG], [
3358636c353eSmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
3359636c353eSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3360636c353eSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
3361636c353eSmrgtouch \$(top_srcdir)/ChangeLog; \
3362636c353eSmrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
3363636c353eSmrgAC_SUBST([CHANGELOG_CMD])
3364636c353eSmrg]) # XORG_CHANGELOG
3365e07dc26bSmrg
3366636c353eSmrgdnl Copyright 2005 Red Hat, Inc
3367636c353eSmrgdnl 
3368636c353eSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
3369636c353eSmrgdnl documentation for any purpose is hereby granted without fee, provided that
3370636c353eSmrgdnl the above copyright notice appear in all copies and that both that
3371636c353eSmrgdnl copyright notice and this permission notice appear in supporting
3372636c353eSmrgdnl documentation.
3373636c353eSmrgdnl 
3374636c353eSmrgdnl The above copyright notice and this permission notice shall be included
3375636c353eSmrgdnl in all copies or substantial portions of the Software.
3376636c353eSmrgdnl 
3377636c353eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3378636c353eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3379636c353eSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3380636c353eSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3381636c353eSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3382636c353eSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3383636c353eSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
3384636c353eSmrgdnl 
3385636c353eSmrgdnl Except as contained in this notice, the name of the copyright holders shall
3386636c353eSmrgdnl not be used in advertising or otherwise to promote the sale, use or
3387636c353eSmrgdnl other dealings in this Software without prior written authorization
3388636c353eSmrgdnl from the copyright holders.
3389636c353eSmrgdnl 
3390e07dc26bSmrg
3391636c353eSmrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
3392e07dc26bSmrg# --------------------------
3393636c353eSmrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
3394636c353eSmrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
3395e07dc26bSmrg
3396636c353eSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
3397636c353eSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3398636c353eSmrg	SAVE_CFLAGS="$CFLAGS"
3399636c353eSmrg	CFLAGS="$CFLAGS `$PKG_CONFIG --cflags xorg-server`"
3400636c353eSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3401636c353eSmrg#include "xorg-server.h"
3402636c353eSmrg#if !defined $1
3403636c353eSmrg#error $1 not defined
3404636c353eSmrg#endif
3405636c353eSmrg		]])],
3406636c353eSmrg		[_EXT_CHECK=yes],
3407636c353eSmrg		[_EXT_CHECK=no])
3408636c353eSmrg	CFLAGS="$SAVE_CFLAGS"
3409636c353eSmrg	AC_MSG_CHECKING([if $1 is defined])
3410636c353eSmrg	AC_MSG_RESULT([$_EXT_CHECK])
3411636c353eSmrg	if test "$_EXT_CHECK" != no; then
3412636c353eSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
3413636c353eSmrg	fi
3414636c353eSmrg])
3415e07dc26bSmrg
3416636c353eSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
3417636c353eSmrg#
3418636c353eSmrg#   Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
3419636c353eSmrg#   Foundation, Inc.
3420636c353eSmrg#   Written by Gordon Matzigkeit, 1996
3421636c353eSmrg#
3422636c353eSmrg# This file is free software; the Free Software Foundation gives
3423636c353eSmrg# unlimited permission to copy and/or distribute it, with or without
3424636c353eSmrg# modifications, as long as this notice is preserved.
3425e07dc26bSmrg
3426636c353eSmrgm4_define([_LT_COPYING], [dnl
3427636c353eSmrg# Copyright (C) 2014 Free Software Foundation, Inc.
3428636c353eSmrg# This is free software; see the source for copying conditions.  There is NO
3429636c353eSmrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3430e07dc26bSmrg
3431636c353eSmrg# GNU Libtool is free software; you can redistribute it and/or modify
3432636c353eSmrg# it under the terms of the GNU General Public License as published by
3433636c353eSmrg# the Free Software Foundation; either version 2 of of the License, or
3434636c353eSmrg# (at your option) any later version.
3435636c353eSmrg#
3436636c353eSmrg# As a special exception to the GNU General Public License, if you
3437636c353eSmrg# distribute this file as part of a program or library that is built
3438636c353eSmrg# using GNU Libtool, you may include this file under the  same
3439636c353eSmrg# distribution terms that you use for the rest of that program.
3440636c353eSmrg#
3441636c353eSmrg# GNU Libtool is distributed in the hope that it will be useful, but
3442636c353eSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
3443636c353eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3444636c353eSmrg# GNU General Public License for more details.
3445636c353eSmrg#
3446636c353eSmrg# You should have received a copy of the GNU General Public License
3447636c353eSmrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
3448636c353eSmrg])
3449e07dc26bSmrg
3450636c353eSmrg# serial 59 LT_INIT
3451e07dc26bSmrg
3452e07dc26bSmrg
3453636c353eSmrg# LT_PREREQ(VERSION)
3454636c353eSmrg# ------------------
3455636c353eSmrg# Complain and exit if this libtool version is less that VERSION.
3456636c353eSmrgm4_defun([LT_PREREQ],
3457636c353eSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
3458636c353eSmrg       [m4_default([$3],
3459636c353eSmrg		   [m4_fatal([Libtool version $1 or higher is required],
3460636c353eSmrg		             63)])],
3461636c353eSmrg       [$2])])
3462e07dc26bSmrg
3463e07dc26bSmrg
3464636c353eSmrg# _LT_CHECK_BUILDDIR
3465636c353eSmrg# ------------------
3466636c353eSmrg# Complain if the absolute build directory name contains unusual characters
3467636c353eSmrgm4_defun([_LT_CHECK_BUILDDIR],
3468636c353eSmrg[case `pwd` in
3469636c353eSmrg  *\ * | *\	*)
3470636c353eSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
3471636c353eSmrgesac
3472636c353eSmrg])
3473e07dc26bSmrg
3474e07dc26bSmrg
3475636c353eSmrg# LT_INIT([OPTIONS])
3476636c353eSmrg# ------------------
3477636c353eSmrgAC_DEFUN([LT_INIT],
3478636c353eSmrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
3479636c353eSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3480636c353eSmrgAC_BEFORE([$0], [LT_LANG])dnl
3481636c353eSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
3482636c353eSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
3483636c353eSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
3484e07dc26bSmrg
3485636c353eSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
3486636c353eSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
3487636c353eSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
3488636c353eSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
3489636c353eSmrgdnl unless we require an AC_DEFUNed macro:
3490636c353eSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
3491636c353eSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
3492636c353eSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
3493636c353eSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
3494636c353eSmrgm4_require([_LT_PROG_LTMAIN])dnl
3495e07dc26bSmrg
3496636c353eSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
3497e07dc26bSmrg
3498636c353eSmrgdnl Parse OPTIONS
3499636c353eSmrg_LT_SET_OPTIONS([$0], [$1])
3500e07dc26bSmrg
3501636c353eSmrg# This can be used to rebuild libtool when needed
3502636c353eSmrgLIBTOOL_DEPS=$ltmain
3503e07dc26bSmrg
3504636c353eSmrg# Always use our own libtool.
3505636c353eSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
3506636c353eSmrgAC_SUBST(LIBTOOL)dnl
3507e07dc26bSmrg
3508636c353eSmrg_LT_SETUP
3509e07dc26bSmrg
3510636c353eSmrg# Only expand once:
3511636c353eSmrgm4_define([LT_INIT])
3512636c353eSmrg])# LT_INIT
3513e07dc26bSmrg
3514636c353eSmrg# Old names:
3515636c353eSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
3516636c353eSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
3517636c353eSmrgdnl aclocal-1.4 backwards compatibility:
3518636c353eSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
3519636c353eSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
3520e07dc26bSmrg
3521e07dc26bSmrg
3522636c353eSmrg# _LT_PREPARE_CC_BASENAME
3523636c353eSmrg# -----------------------
3524636c353eSmrgm4_defun([_LT_PREPARE_CC_BASENAME], [
3525636c353eSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
3526636c353eSmrgfunc_cc_basename ()
3527636c353eSmrg{
3528636c353eSmrg    for cc_temp in @S|@*""; do
3529636c353eSmrg      case $cc_temp in
3530636c353eSmrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
3531636c353eSmrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
3532636c353eSmrg        \-*) ;;
3533636c353eSmrg        *) break;;
3534636c353eSmrg      esac
3535636c353eSmrg    done
3536636c353eSmrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
3537636c353eSmrg}
3538636c353eSmrg])# _LT_PREPARE_CC_BASENAME
3539e07dc26bSmrg
3540e07dc26bSmrg
3541636c353eSmrg# _LT_CC_BASENAME(CC)
3542636c353eSmrg# -------------------
3543636c353eSmrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
3544636c353eSmrg# but that macro is also expanded into generated libtool script, which
3545636c353eSmrg# arranges for $SED and $ECHO to be set by different means.
3546636c353eSmrgm4_defun([_LT_CC_BASENAME],
3547636c353eSmrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
3548636c353eSmrgAC_REQUIRE([_LT_DECL_SED])dnl
3549636c353eSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
3550636c353eSmrgfunc_cc_basename $1
3551636c353eSmrgcc_basename=$func_cc_basename_result
3552636c353eSmrg])
3553e07dc26bSmrg
3554e07dc26bSmrg
3555636c353eSmrg# _LT_FILEUTILS_DEFAULTS
3556636c353eSmrg# ----------------------
3557636c353eSmrg# It is okay to use these file commands and assume they have been set
3558636c353eSmrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
3559636c353eSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
3560636c353eSmrg[: ${CP="cp -f"}
3561636c353eSmrg: ${MV="mv -f"}
3562636c353eSmrg: ${RM="rm -f"}
3563636c353eSmrg])# _LT_FILEUTILS_DEFAULTS
3564e07dc26bSmrg
3565e07dc26bSmrg
3566636c353eSmrg# _LT_SETUP
3567636c353eSmrg# ---------
3568636c353eSmrgm4_defun([_LT_SETUP],
3569636c353eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3570636c353eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3571636c353eSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
3572636c353eSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
3573e07dc26bSmrg
3574636c353eSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
3575636c353eSmrgdnl
3576636c353eSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
3577636c353eSmrg_LT_DECL([], [host], [0])dnl
3578636c353eSmrg_LT_DECL([], [host_os], [0])dnl
3579636c353eSmrgdnl
3580636c353eSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
3581636c353eSmrg_LT_DECL([], [build], [0])dnl
3582636c353eSmrg_LT_DECL([], [build_os], [0])dnl
3583636c353eSmrgdnl
3584636c353eSmrgAC_REQUIRE([AC_PROG_CC])dnl
3585636c353eSmrgAC_REQUIRE([LT_PATH_LD])dnl
3586636c353eSmrgAC_REQUIRE([LT_PATH_NM])dnl
3587636c353eSmrgdnl
3588636c353eSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
3589636c353eSmrgtest -z "$LN_S" && LN_S="ln -s"
3590636c353eSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
3591636c353eSmrgdnl
3592636c353eSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
3593636c353eSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
3594636c353eSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
3595636c353eSmrgdnl
3596636c353eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
3597636c353eSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
3598636c353eSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
3599636c353eSmrgm4_require([_LT_CMD_RELOAD])dnl
3600636c353eSmrgm4_require([_LT_DECL_FILECMD])dnl
3601636c353eSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
3602636c353eSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
3603636c353eSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
3604636c353eSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
3605636c353eSmrgm4_require([_LT_WITH_SYSROOT])dnl
3606636c353eSmrgm4_require([_LT_CMD_TRUNCATE])dnl
3607e07dc26bSmrg
3608636c353eSmrg_LT_CONFIG_LIBTOOL_INIT([
3609636c353eSmrg# See if we are running on zsh, and set the options that allow our
3610636c353eSmrg# commands through without removal of \ escapes INIT.
3611636c353eSmrgif test -n "\${ZSH_VERSION+set}"; then
3612636c353eSmrg   setopt NO_GLOB_SUBST
3613636c353eSmrgfi
3614636c353eSmrg])
3615636c353eSmrgif test -n "${ZSH_VERSION+set}"; then
3616636c353eSmrg   setopt NO_GLOB_SUBST
3617636c353eSmrgfi
3618e07dc26bSmrg
3619636c353eSmrg_LT_CHECK_OBJDIR
3620e07dc26bSmrg
3621636c353eSmrgm4_require([_LT_TAG_COMPILER])dnl
3622e07dc26bSmrg
3623636c353eSmrgcase $host_os in
3624636c353eSmrgaix3*)
3625636c353eSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
3626636c353eSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
3627636c353eSmrg  # vanish in a puff of smoke.
3628636c353eSmrg  if test set != "${COLLECT_NAMES+set}"; then
3629636c353eSmrg    COLLECT_NAMES=
3630636c353eSmrg    export COLLECT_NAMES
3631636c353eSmrg  fi
3632e07dc26bSmrg  ;;
3633636c353eSmrgesac
3634e07dc26bSmrg
3635636c353eSmrg# Global variables:
3636636c353eSmrgofile=libtool
3637636c353eSmrgcan_build_shared=yes
3638e07dc26bSmrg
3639636c353eSmrg# All known linkers require a '.a' archive for static linking (except MSVC and
3640636c353eSmrg# ICC, which need '.lib').
3641636c353eSmrglibext=a
3642e07dc26bSmrg
3643636c353eSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3644e07dc26bSmrg
3645636c353eSmrgold_CC=$CC
3646636c353eSmrgold_CFLAGS=$CFLAGS
3647e07dc26bSmrg
3648636c353eSmrg# Set sane defaults for various variables
3649636c353eSmrgtest -z "$CC" && CC=cc
3650636c353eSmrgtest -z "$LTCC" && LTCC=$CC
3651636c353eSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
3652636c353eSmrgtest -z "$LD" && LD=ld
3653636c353eSmrgtest -z "$ac_objext" && ac_objext=o
3654636c353eSmrg
3655636c353eSmrg_LT_CC_BASENAME([$compiler])
3656636c353eSmrg
3657636c353eSmrg# Only perform the check for file, if the check method requires it
3658636c353eSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
3659636c353eSmrgcase $deplibs_check_method in
3660636c353eSmrgfile_magic*)
3661636c353eSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
3662636c353eSmrg    _LT_PATH_MAGIC
3663e07dc26bSmrg  fi
3664e07dc26bSmrg  ;;
3665636c353eSmrgesac
3666e07dc26bSmrg
3667636c353eSmrg# Use C for the default configuration in the libtool script
3668636c353eSmrgLT_SUPPORTED_TAG([CC])
3669636c353eSmrg_LT_LANG_C_CONFIG
3670636c353eSmrg_LT_LANG_DEFAULT_CONFIG
3671636c353eSmrg_LT_CONFIG_COMMANDS
3672636c353eSmrg])# _LT_SETUP
3673e07dc26bSmrg
3674e07dc26bSmrg
3675636c353eSmrg# _LT_PREPARE_SED_QUOTE_VARS
3676636c353eSmrg# --------------------------
3677636c353eSmrg# Define a few sed substitution that help us do robust quoting.
3678636c353eSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
3679636c353eSmrg[# Backslashify metacharacters that are still active within
3680636c353eSmrg# double-quoted strings.
3681636c353eSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
3682e07dc26bSmrg
3683636c353eSmrg# Same as above, but do not quote variable references.
3684636c353eSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
3685e07dc26bSmrg
3686636c353eSmrg# Sed substitution to delay expansion of an escaped shell variable in a
3687636c353eSmrg# double_quote_subst'ed string.
3688636c353eSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
3689e07dc26bSmrg
3690636c353eSmrg# Sed substitution to delay expansion of an escaped single quote.
3691636c353eSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
3692e07dc26bSmrg
3693636c353eSmrg# Sed substitution to avoid accidental globbing in evaled expressions
3694636c353eSmrgno_glob_subst='s/\*/\\\*/g'
3695636c353eSmrg])
3696e07dc26bSmrg
3697636c353eSmrg# _LT_PROG_LTMAIN
3698636c353eSmrg# ---------------
3699636c353eSmrg# Note that this code is called both from 'configure', and 'config.status'
3700636c353eSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
3701636c353eSmrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
3702636c353eSmrg# so we pass a copy along to make sure it has a sensible value anyway.
3703636c353eSmrgm4_defun([_LT_PROG_LTMAIN],
3704636c353eSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3705636c353eSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3706636c353eSmrgltmain=$ac_aux_dir/ltmain.sh
3707636c353eSmrg])# _LT_PROG_LTMAIN
3708e07dc26bSmrg
3709e07dc26bSmrg
3710e07dc26bSmrg
3711636c353eSmrg# So that we can recreate a full libtool script including additional
3712636c353eSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3713636c353eSmrg# in macros and then make a single call at the end using the 'libtool'
3714636c353eSmrg# label.
3715e07dc26bSmrg
3716e07dc26bSmrg
3717636c353eSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3718636c353eSmrg# ----------------------------------------
3719636c353eSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3720636c353eSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
3721636c353eSmrg[m4_ifval([$1],
3722636c353eSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3723636c353eSmrg                     [$1
3724636c353eSmrg])])])
3725e07dc26bSmrg
3726636c353eSmrg# Initialize.
3727636c353eSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
3728e07dc26bSmrg
3729e07dc26bSmrg
3730636c353eSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3731636c353eSmrg# ------------------------------
3732636c353eSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3733636c353eSmrgm4_define([_LT_CONFIG_LIBTOOL],
3734636c353eSmrg[m4_ifval([$1],
3735636c353eSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3736636c353eSmrg                     [$1
3737636c353eSmrg])])])
3738e07dc26bSmrg
3739636c353eSmrg# Initialize.
3740636c353eSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3741e07dc26bSmrg
3742e07dc26bSmrg
3743636c353eSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3744636c353eSmrg# -----------------------------------------------------
3745636c353eSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3746636c353eSmrg[_LT_CONFIG_LIBTOOL([$1])
3747636c353eSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
3748636c353eSmrg])
3749e07dc26bSmrg
3750e07dc26bSmrg
3751636c353eSmrg# _LT_FORMAT_COMMENT([COMMENT])
3752636c353eSmrg# -----------------------------
3753636c353eSmrg# Add leading comment marks to the start of each line, and a trailing
3754636c353eSmrg# full-stop to the whole comment if one is not present already.
3755636c353eSmrgm4_define([_LT_FORMAT_COMMENT],
3756636c353eSmrg[m4_ifval([$1], [
3757636c353eSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3758636c353eSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3759636c353eSmrg)])
3760e07dc26bSmrg
3761e07dc26bSmrg
3762e07dc26bSmrg
3763e07dc26bSmrg
3764e07dc26bSmrg
3765636c353eSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3766636c353eSmrg# -------------------------------------------------------------------
3767636c353eSmrg# CONFIGNAME is the name given to the value in the libtool script.
3768636c353eSmrg# VARNAME is the (base) name used in the configure script.
3769636c353eSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3770636c353eSmrg# VARNAME.  Any other value will be used directly.
3771636c353eSmrgm4_define([_LT_DECL],
3772636c353eSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3773636c353eSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3774636c353eSmrg	[m4_ifval([$1], [$1], [$2])])
3775636c353eSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3776636c353eSmrg    m4_ifval([$4],
3777636c353eSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3778636c353eSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3779636c353eSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3780636c353eSmrg])
3781e07dc26bSmrg
3782e07dc26bSmrg
3783636c353eSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3784636c353eSmrg# --------------------------------------------------------
3785636c353eSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3786e07dc26bSmrg
3787e07dc26bSmrg
3788636c353eSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3789636c353eSmrg# ------------------------------------------------
3790636c353eSmrgm4_define([lt_decl_tag_varnames],
3791636c353eSmrg[_lt_decl_filter([tagged?], [yes], $@)])
3792e07dc26bSmrg
3793e07dc26bSmrg
3794636c353eSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3795636c353eSmrg# ---------------------------------------------------------
3796636c353eSmrgm4_define([_lt_decl_filter],
3797636c353eSmrg[m4_case([$#],
3798636c353eSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
3799636c353eSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
3800636c353eSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3801636c353eSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3802636c353eSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3803636c353eSmrg])
3804e07dc26bSmrg
3805e07dc26bSmrg
3806636c353eSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
3807636c353eSmrg# --------------------------------------------------
3808636c353eSmrgm4_define([lt_decl_quote_varnames],
3809636c353eSmrg[_lt_decl_filter([value], [1], $@)])
3810e07dc26bSmrg
3811e07dc26bSmrg
3812636c353eSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
3813636c353eSmrg# ---------------------------------------------------
3814636c353eSmrgm4_define([lt_decl_dquote_varnames],
3815636c353eSmrg[_lt_decl_filter([value], [2], $@)])
3816e07dc26bSmrg
3817e07dc26bSmrg
3818636c353eSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
3819636c353eSmrg# ---------------------------------------------------
3820636c353eSmrgm4_define([lt_decl_varnames_tagged],
3821636c353eSmrg[m4_assert([$# <= 2])dnl
3822636c353eSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
3823636c353eSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
3824636c353eSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
3825636c353eSmrgm4_define([_lt_decl_varnames_tagged],
3826636c353eSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
3827e07dc26bSmrg
3828e07dc26bSmrg
3829636c353eSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
3830636c353eSmrg# ------------------------------------------------
3831636c353eSmrgm4_define([lt_decl_all_varnames],
3832636c353eSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
3833636c353eSmrg     m4_if([$2], [],
3834636c353eSmrg	   m4_quote(lt_decl_varnames),
3835636c353eSmrg	m4_quote(m4_shift($@))))[]dnl
3836636c353eSmrg])
3837636c353eSmrgm4_define([_lt_decl_all_varnames],
3838636c353eSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
3839636c353eSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
3840636c353eSmrg])
3841e07dc26bSmrg
3842e07dc26bSmrg
3843636c353eSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
3844636c353eSmrg# ------------------------------------
3845636c353eSmrg# Quote a variable value, and forward it to 'config.status' so that its
3846636c353eSmrg# declaration there will have the same value as in 'configure'.  VARNAME
3847636c353eSmrg# must have a single quote delimited value for this to work.
3848636c353eSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
3849636c353eSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
3850e07dc26bSmrg
3851e07dc26bSmrg
3852636c353eSmrg# _LT_CONFIG_STATUS_DECLARATIONS
3853636c353eSmrg# ------------------------------
3854636c353eSmrg# We delimit libtool config variables with single quotes, so when
3855636c353eSmrg# we write them to config.status, we have to be sure to quote all
3856636c353eSmrg# embedded single quotes properly.  In configure, this macro expands
3857636c353eSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
3858636c353eSmrg#
3859636c353eSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
3860636c353eSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
3861636c353eSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
3862636c353eSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
3863e07dc26bSmrg
3864e07dc26bSmrg
3865636c353eSmrg# _LT_LIBTOOL_TAGS
3866636c353eSmrg# ----------------
3867636c353eSmrg# Output comment and list of tags supported by the script
3868636c353eSmrgm4_defun([_LT_LIBTOOL_TAGS],
3869636c353eSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
3870636c353eSmrgavailable_tags='_LT_TAGS'dnl
3871636c353eSmrg])
3872e07dc26bSmrg
3873e07dc26bSmrg
3874636c353eSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
3875636c353eSmrg# -----------------------------------
3876636c353eSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
3877636c353eSmrg# expand to a commented shell variable setting:
3878636c353eSmrg#
3879636c353eSmrg#    # Some comment about what VAR is for.
3880636c353eSmrg#    visible_name=$lt_internal_name
3881636c353eSmrgm4_define([_LT_LIBTOOL_DECLARE],
3882636c353eSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
3883636c353eSmrg					   [description])))[]dnl
3884636c353eSmrgm4_pushdef([_libtool_name],
3885636c353eSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
3886636c353eSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
3887636c353eSmrg    [0], [_libtool_name=[$]$1],
3888636c353eSmrg    [1], [_libtool_name=$lt_[]$1],
3889636c353eSmrg    [2], [_libtool_name=$lt_[]$1],
3890636c353eSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
3891636c353eSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
3892636c353eSmrg])
3893e07dc26bSmrg
3894e07dc26bSmrg
3895636c353eSmrg# _LT_LIBTOOL_CONFIG_VARS
3896636c353eSmrg# -----------------------
3897636c353eSmrg# Produce commented declarations of non-tagged libtool config variables
3898636c353eSmrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
3899636c353eSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
3900636c353eSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
3901636c353eSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
3902636c353eSmrg[m4_foreach([_lt_var],
3903636c353eSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
3904636c353eSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
3905e07dc26bSmrg
3906e07dc26bSmrg
3907636c353eSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
3908636c353eSmrg# -------------------------
3909636c353eSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
3910636c353eSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
3911636c353eSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
3912e07dc26bSmrg
3913e07dc26bSmrg
3914636c353eSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
3915636c353eSmrg# ------------------------------
3916636c353eSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
3917e07dc26bSmrg
3918e07dc26bSmrg
3919636c353eSmrg# _LT_CONFIG_COMMANDS
3920636c353eSmrg# -------------------
3921636c353eSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
3922636c353eSmrg# variables for single and double quote escaping we saved from calls
3923636c353eSmrg# to _LT_DECL, we can put quote escaped variables declarations
3924636c353eSmrg# into 'config.status', and then the shell code to quote escape them in
3925636c353eSmrg# for loops in 'config.status'.  Finally, any additional code accumulated
3926636c353eSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
3927636c353eSmrgm4_defun([_LT_CONFIG_COMMANDS],
3928636c353eSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
3929636c353eSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
3930636c353eSmrg	dnl instead of duplicating it all over again into config.status,
3931636c353eSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
3932636c353eSmrg	dnl needs to know what name is stored there:
3933636c353eSmrg        [AC_CONFIG_COMMANDS([libtool],
3934636c353eSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
3935636c353eSmrg    dnl If the libtool generation code is destined for config.status,
3936636c353eSmrg    dnl expand the accumulated commands and init code now:
3937636c353eSmrg    [AC_CONFIG_COMMANDS([libtool],
3938636c353eSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
3939636c353eSmrg])#_LT_CONFIG_COMMANDS
3940e07dc26bSmrg
3941e07dc26bSmrg
3942636c353eSmrg# Initialize.
3943636c353eSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
3944636c353eSmrg[
3945e07dc26bSmrg
3946636c353eSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
3947636c353eSmrg# if CDPATH is set.
3948636c353eSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3949636c353eSmrg
3950636c353eSmrgsed_quote_subst='$sed_quote_subst'
3951636c353eSmrgdouble_quote_subst='$double_quote_subst'
3952636c353eSmrgdelay_variable_subst='$delay_variable_subst'
3953636c353eSmrg_LT_CONFIG_STATUS_DECLARATIONS
3954636c353eSmrgLTCC='$LTCC'
3955636c353eSmrgLTCFLAGS='$LTCFLAGS'
3956636c353eSmrgcompiler='$compiler_DEFAULT'
3957636c353eSmrg
3958636c353eSmrg# A function that is used when there is no print builtin or printf.
3959636c353eSmrgfunc_fallback_echo ()
3960636c353eSmrg{
3961636c353eSmrg  eval 'cat <<_LTECHO_EOF
3962636c353eSmrg\$[]1
3963636c353eSmrg_LTECHO_EOF'
3964636c353eSmrg}
3965636c353eSmrg
3966636c353eSmrg# Quote evaled strings.
3967636c353eSmrgfor var in lt_decl_all_varnames([[ \
3968636c353eSmrg]], lt_decl_quote_varnames); do
3969636c353eSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
3970636c353eSmrg    *[[\\\\\\\`\\"\\\$]]*)
3971636c353eSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
3972e07dc26bSmrg      ;;
3973636c353eSmrg    *)
3974636c353eSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
3975e07dc26bSmrg      ;;
3976636c353eSmrg    esac
3977636c353eSmrgdone
3978636c353eSmrg
3979636c353eSmrg# Double-quote double-evaled strings.
3980636c353eSmrgfor var in lt_decl_all_varnames([[ \
3981636c353eSmrg]], lt_decl_dquote_varnames); do
3982636c353eSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
3983636c353eSmrg    *[[\\\\\\\`\\"\\\$]]*)
3984636c353eSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
3985e07dc26bSmrg      ;;
3986636c353eSmrg    *)
3987636c353eSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
3988e07dc26bSmrg      ;;
3989636c353eSmrg    esac
3990636c353eSmrgdone
3991e07dc26bSmrg
3992636c353eSmrg_LT_OUTPUT_LIBTOOL_INIT
3993636c353eSmrg])
3994e07dc26bSmrg
3995636c353eSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
3996636c353eSmrg# ------------------------------------
3997636c353eSmrg# Generate a child script FILE with all initialization necessary to
3998636c353eSmrg# reuse the environment learned by the parent script, and make the
3999636c353eSmrg# file executable.  If COMMENT is supplied, it is inserted after the
4000636c353eSmrg# '#!' sequence but before initialization text begins.  After this
4001636c353eSmrg# macro, additional text can be appended to FILE to form the body of
4002636c353eSmrg# the child script.  The macro ends with non-zero status if the
4003636c353eSmrg# file could not be fully written (such as if the disk is full).
4004636c353eSmrgm4_ifdef([AS_INIT_GENERATED],
4005636c353eSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
4006636c353eSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
4007636c353eSmrg[m4_require([AS_PREPARE])]dnl
4008636c353eSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
4009636c353eSmrg[lt_write_fail=0
4010636c353eSmrgcat >$1 <<_ASEOF || lt_write_fail=1
4011636c353eSmrg#! $SHELL
4012636c353eSmrg# Generated by $as_me.
4013636c353eSmrg$2
4014636c353eSmrgSHELL=\${CONFIG_SHELL-$SHELL}
4015636c353eSmrgexport SHELL
4016636c353eSmrg_ASEOF
4017636c353eSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
4018636c353eSmrgAS_SHELL_SANITIZE
4019636c353eSmrg_AS_PREPARE
4020636c353eSmrgexec AS_MESSAGE_FD>&1
4021636c353eSmrg_ASEOF
4022636c353eSmrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
4023636c353eSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
4024e07dc26bSmrg
4025636c353eSmrg# LT_OUTPUT
4026636c353eSmrg# ---------
4027636c353eSmrg# This macro allows early generation of the libtool script (before
4028636c353eSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
4029636c353eSmrg# tests.
4030636c353eSmrgAC_DEFUN([LT_OUTPUT],
4031636c353eSmrg[: ${CONFIG_LT=./config.lt}
4032636c353eSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
4033636c353eSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
4034636c353eSmrg[# Run this file to recreate a libtool stub with the current configuration.])
4035e07dc26bSmrg
4036636c353eSmrgcat >>"$CONFIG_LT" <<\_LTEOF
4037636c353eSmrglt_cl_silent=false
4038636c353eSmrgexec AS_MESSAGE_LOG_FD>>config.log
4039636c353eSmrg{
4040636c353eSmrg  echo
4041636c353eSmrg  AS_BOX([Running $as_me.])
4042636c353eSmrg} >&AS_MESSAGE_LOG_FD
4043e07dc26bSmrg
4044636c353eSmrglt_cl_help="\
4045636c353eSmrg'$as_me' creates a local libtool stub from the current configuration,
4046636c353eSmrgfor use in further configure time tests before the real libtool is
4047636c353eSmrggenerated.
4048e07dc26bSmrg
4049636c353eSmrgUsage: $[0] [[OPTIONS]]
4050e07dc26bSmrg
4051636c353eSmrg  -h, --help      print this help, then exit
4052636c353eSmrg  -V, --version   print version number, then exit
4053636c353eSmrg  -q, --quiet     do not print progress messages
4054636c353eSmrg  -d, --debug     don't remove temporary files
4055e07dc26bSmrg
4056636c353eSmrgReport bugs to <bug-libtool@gnu.org>."
4057e07dc26bSmrg
4058636c353eSmrglt_cl_version="\
4059636c353eSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
4060636c353eSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
4061636c353eSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
4062e07dc26bSmrg
4063636c353eSmrgCopyright (C) 2011 Free Software Foundation, Inc.
4064636c353eSmrgThis config.lt script is free software; the Free Software Foundation
4065636c353eSmrggives unlimited permision to copy, distribute and modify it."
4066e07dc26bSmrg
4067636c353eSmrgwhile test 0 != $[#]
4068636c353eSmrgdo
4069636c353eSmrg  case $[1] in
4070636c353eSmrg    --version | --v* | -V )
4071636c353eSmrg      echo "$lt_cl_version"; exit 0 ;;
4072636c353eSmrg    --help | --h* | -h )
4073636c353eSmrg      echo "$lt_cl_help"; exit 0 ;;
4074636c353eSmrg    --debug | --d* | -d )
4075636c353eSmrg      debug=: ;;
4076636c353eSmrg    --quiet | --q* | --silent | --s* | -q )
4077636c353eSmrg      lt_cl_silent=: ;;
4078636c353eSmrg
4079636c353eSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
4080636c353eSmrgTry '$[0] --help' for more information.]) ;;
4081636c353eSmrg
4082636c353eSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
4083636c353eSmrgTry '$[0] --help' for more information.]) ;;
4084e07dc26bSmrg  esac
4085636c353eSmrg  shift
4086636c353eSmrgdone
4087e07dc26bSmrg
4088636c353eSmrgif $lt_cl_silent; then
4089636c353eSmrg  exec AS_MESSAGE_FD>/dev/null
4090636c353eSmrgfi
4091636c353eSmrg_LTEOF
4092e07dc26bSmrg
4093636c353eSmrgcat >>"$CONFIG_LT" <<_LTEOF
4094636c353eSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
4095636c353eSmrg_LTEOF
4096e07dc26bSmrg
4097636c353eSmrgcat >>"$CONFIG_LT" <<\_LTEOF
4098636c353eSmrgAC_MSG_NOTICE([creating $ofile])
4099636c353eSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
4100636c353eSmrgAS_EXIT(0)
4101636c353eSmrg_LTEOF
4102636c353eSmrgchmod +x "$CONFIG_LT"
4103e07dc26bSmrg
4104636c353eSmrg# configure is writing to config.log, but config.lt does its own redirection,
4105636c353eSmrg# appending to config.log, which fails on DOS, as config.log is still kept
4106636c353eSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
4107636c353eSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
4108636c353eSmrglt_cl_success=:
4109636c353eSmrgtest yes = "$silent" &&
4110636c353eSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
4111636c353eSmrgexec AS_MESSAGE_LOG_FD>/dev/null
4112636c353eSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
4113636c353eSmrgexec AS_MESSAGE_LOG_FD>>config.log
4114636c353eSmrg$lt_cl_success || AS_EXIT(1)
4115636c353eSmrg])# LT_OUTPUT
4116636c353eSmrg
4117636c353eSmrg
4118636c353eSmrg# _LT_CONFIG(TAG)
4119636c353eSmrg# ---------------
4120636c353eSmrg# If TAG is the built-in tag, create an initial libtool script with a
4121636c353eSmrg# default configuration from the untagged config vars.  Otherwise add code
4122636c353eSmrg# to config.status for appending the configuration named by TAG from the
4123636c353eSmrg# matching tagged config vars.
4124636c353eSmrgm4_defun([_LT_CONFIG],
4125636c353eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4126636c353eSmrg_LT_CONFIG_SAVE_COMMANDS([
4127636c353eSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
4128636c353eSmrg  m4_if(_LT_TAG, [C], [
4129636c353eSmrg    # See if we are running on zsh, and set the options that allow our
4130636c353eSmrg    # commands through without removal of \ escapes.
4131636c353eSmrg    if test -n "${ZSH_VERSION+set}"; then
4132636c353eSmrg      setopt NO_GLOB_SUBST
4133e07dc26bSmrg    fi
4134e07dc26bSmrg
4135636c353eSmrg    cfgfile=${ofile}T
4136636c353eSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
4137636c353eSmrg    $RM "$cfgfile"
4138e07dc26bSmrg
4139636c353eSmrg    cat <<_LT_EOF >> "$cfgfile"
4140636c353eSmrg#! $SHELL
4141636c353eSmrg# Generated automatically by $as_me ($PACKAGE) $VERSION
4142636c353eSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4143636c353eSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4144636c353eSmrg
4145636c353eSmrg# Provide generalized library-building support services.
4146636c353eSmrg# Written by Gordon Matzigkeit, 1996
4147636c353eSmrg
4148636c353eSmrg_LT_COPYING
4149636c353eSmrg_LT_LIBTOOL_TAGS
4150636c353eSmrg
4151636c353eSmrg# Configured defaults for sys_lib_dlsearch_path munging.
4152636c353eSmrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
4153636c353eSmrg
4154636c353eSmrg# ### BEGIN LIBTOOL CONFIG
4155636c353eSmrg_LT_LIBTOOL_CONFIG_VARS
4156636c353eSmrg_LT_LIBTOOL_TAG_VARS
4157636c353eSmrg# ### END LIBTOOL CONFIG
4158e07dc26bSmrg
4159e07dc26bSmrg_LT_EOF
4160e07dc26bSmrg
4161636c353eSmrg    cat <<'_LT_EOF' >> "$cfgfile"
4162e07dc26bSmrg
4163636c353eSmrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
4164e07dc26bSmrg
4165636c353eSmrg_LT_PREPARE_MUNGE_PATH_LIST
4166636c353eSmrg_LT_PREPARE_CC_BASENAME
4167e07dc26bSmrg
4168636c353eSmrg# ### END FUNCTIONS SHARED WITH CONFIGURE
4169e07dc26bSmrg
4170636c353eSmrg_LT_EOF
4171636c353eSmrg
4172636c353eSmrg  case $host_os in
4173636c353eSmrg  aix3*)
4174636c353eSmrg    cat <<\_LT_EOF >> "$cfgfile"
4175636c353eSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
4176636c353eSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
4177636c353eSmrg# vanish in a puff of smoke.
4178636c353eSmrgif test set != "${COLLECT_NAMES+set}"; then
4179636c353eSmrg  COLLECT_NAMES=
4180636c353eSmrg  export COLLECT_NAMES
4181636c353eSmrgfi
4182636c353eSmrg_LT_EOF
4183636c353eSmrg    ;;
4184636c353eSmrg  esac
4185636c353eSmrg
4186636c353eSmrg  _LT_PROG_LTMAIN
4187636c353eSmrg
4188636c353eSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
4189636c353eSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4190636c353eSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
4191636c353eSmrg  # is reportedly fixed, but why not run on old versions too?
4192636c353eSmrg  $SED '$q' "$ltmain" >> "$cfgfile" \
4193636c353eSmrg     || (rm -f "$cfgfile"; exit 1)
4194636c353eSmrg
4195636c353eSmrg   mv -f "$cfgfile" "$ofile" ||
4196636c353eSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4197636c353eSmrg  chmod +x "$ofile"
4198636c353eSmrg],
4199636c353eSmrg[cat <<_LT_EOF >> "$ofile"
4200636c353eSmrg
4201636c353eSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
4202636c353eSmrgdnl in a comment (ie after a #).
4203636c353eSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
4204636c353eSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
4205636c353eSmrg# ### END LIBTOOL TAG CONFIG: $1
4206636c353eSmrg_LT_EOF
4207636c353eSmrg])dnl /m4_if
4208636c353eSmrg],
4209636c353eSmrg[m4_if([$1], [], [
4210636c353eSmrg    PACKAGE='$PACKAGE'
4211636c353eSmrg    VERSION='$VERSION'
4212636c353eSmrg    RM='$RM'
4213636c353eSmrg    ofile='$ofile'], [])
4214636c353eSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
4215636c353eSmrg])# _LT_CONFIG
4216e07dc26bSmrg
4217e07dc26bSmrg
4218636c353eSmrg# LT_SUPPORTED_TAG(TAG)
4219636c353eSmrg# ---------------------
4220636c353eSmrg# Trace this macro to discover what tags are supported by the libtool
4221636c353eSmrg# --tag option, using:
4222636c353eSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
4223636c353eSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
4224e07dc26bSmrg
4225e07dc26bSmrg
4226636c353eSmrg# C support is built-in for now
4227636c353eSmrgm4_define([_LT_LANG_C_enabled], [])
4228636c353eSmrgm4_define([_LT_TAGS], [])
4229e07dc26bSmrg
4230e07dc26bSmrg
4231636c353eSmrg# LT_LANG(LANG)
4232636c353eSmrg# -------------
4233636c353eSmrg# Enable libtool support for the given language if not already enabled.
4234636c353eSmrgAC_DEFUN([LT_LANG],
4235636c353eSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
4236636c353eSmrgm4_case([$1],
4237636c353eSmrg  [C],			[_LT_LANG(C)],
4238636c353eSmrg  [C++],		[_LT_LANG(CXX)],
4239636c353eSmrg  [Go],			[_LT_LANG(GO)],
4240636c353eSmrg  [Java],		[_LT_LANG(GCJ)],
4241636c353eSmrg  [Fortran 77],		[_LT_LANG(F77)],
4242636c353eSmrg  [Fortran],		[_LT_LANG(FC)],
4243636c353eSmrg  [Windows Resource],	[_LT_LANG(RC)],
4244636c353eSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
4245636c353eSmrg    [_LT_LANG($1)],
4246636c353eSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
4247636c353eSmrg])# LT_LANG
4248e07dc26bSmrg
4249e07dc26bSmrg
4250636c353eSmrg# _LT_LANG(LANGNAME)
4251636c353eSmrg# ------------------
4252636c353eSmrgm4_defun([_LT_LANG],
4253636c353eSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
4254636c353eSmrg  [LT_SUPPORTED_TAG([$1])dnl
4255636c353eSmrg  m4_append([_LT_TAGS], [$1 ])dnl
4256636c353eSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
4257636c353eSmrg  _LT_LANG_$1_CONFIG($1)])dnl
4258636c353eSmrg])# _LT_LANG
4259e07dc26bSmrg
4260e07dc26bSmrg
4261636c353eSmrgm4_ifndef([AC_PROG_GO], [
4262636c353eSmrg# NOTE: This macro has been submitted for inclusion into   #
4263636c353eSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
4264636c353eSmrg#  a released version of Autoconf we should remove this    #
4265636c353eSmrg#  macro and use it instead.                               #
4266636c353eSmrgm4_defun([AC_PROG_GO],
4267636c353eSmrg[AC_LANG_PUSH(Go)dnl
4268636c353eSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
4269636c353eSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
4270636c353eSmrg_AC_ARG_VAR_LDFLAGS()dnl
4271636c353eSmrgAC_CHECK_TOOL(GOC, gccgo)
4272636c353eSmrgif test -z "$GOC"; then
4273636c353eSmrg  if test -n "$ac_tool_prefix"; then
4274636c353eSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
4275636c353eSmrg  fi
4276636c353eSmrgfi
4277636c353eSmrgif test -z "$GOC"; then
4278636c353eSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
4279636c353eSmrgfi
4280636c353eSmrg])#m4_defun
4281636c353eSmrg])#m4_ifndef
4282e07dc26bSmrg
4283e07dc26bSmrg
4284636c353eSmrg# _LT_LANG_DEFAULT_CONFIG
4285636c353eSmrg# -----------------------
4286636c353eSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
4287636c353eSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
4288636c353eSmrg  [LT_LANG(CXX)],
4289636c353eSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
4290e07dc26bSmrg
4291636c353eSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
4292636c353eSmrg  [LT_LANG(F77)],
4293636c353eSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
4294e07dc26bSmrg
4295636c353eSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
4296636c353eSmrg  [LT_LANG(FC)],
4297636c353eSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
4298e07dc26bSmrg
4299636c353eSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
4300636c353eSmrgdnl pulling things in needlessly.
4301636c353eSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
4302636c353eSmrg  [LT_LANG(GCJ)],
4303636c353eSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
4304636c353eSmrg    [LT_LANG(GCJ)],
4305636c353eSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
4306636c353eSmrg      [LT_LANG(GCJ)],
4307636c353eSmrg      [m4_ifdef([AC_PROG_GCJ],
4308636c353eSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
4309636c353eSmrg       m4_ifdef([A][M_PROG_GCJ],
4310636c353eSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
4311636c353eSmrg       m4_ifdef([LT_PROG_GCJ],
4312636c353eSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
4313e07dc26bSmrg
4314636c353eSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
4315636c353eSmrg  [LT_LANG(GO)],
4316636c353eSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
4317e07dc26bSmrg
4318636c353eSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
4319636c353eSmrg  [LT_LANG(RC)],
4320636c353eSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
4321636c353eSmrg])# _LT_LANG_DEFAULT_CONFIG
4322e07dc26bSmrg
4323636c353eSmrg# Obsolete macros:
4324636c353eSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
4325636c353eSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
4326636c353eSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
4327636c353eSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
4328636c353eSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
4329636c353eSmrgdnl aclocal-1.4 backwards compatibility:
4330636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
4331636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
4332636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
4333636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
4334636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
4335e07dc26bSmrg
4336e07dc26bSmrg
4337636c353eSmrg# _LT_TAG_COMPILER
4338636c353eSmrg# ----------------
4339636c353eSmrgm4_defun([_LT_TAG_COMPILER],
4340636c353eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
4341e07dc26bSmrg
4342636c353eSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
4343636c353eSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
4344636c353eSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
4345636c353eSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
4346e07dc26bSmrg
4347636c353eSmrg# If no C compiler was specified, use CC.
4348636c353eSmrgLTCC=${LTCC-"$CC"}
4349e07dc26bSmrg
4350636c353eSmrg# If no C compiler flags were specified, use CFLAGS.
4351636c353eSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
4352636c353eSmrg
4353636c353eSmrg# Allow CC to be a program name with arguments.
4354636c353eSmrgcompiler=$CC
4355636c353eSmrg])# _LT_TAG_COMPILER
4356e07dc26bSmrg
4357e07dc26bSmrg
4358636c353eSmrg# _LT_COMPILER_BOILERPLATE
4359636c353eSmrg# ------------------------
4360636c353eSmrg# Check for compiler boilerplate output or warnings with
4361636c353eSmrg# the simple compiler test code.
4362636c353eSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
4363636c353eSmrg[m4_require([_LT_DECL_SED])dnl
4364636c353eSmrgac_outfile=conftest.$ac_objext
4365636c353eSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
4366636c353eSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
4367636c353eSmrg_lt_compiler_boilerplate=`cat conftest.err`
4368636c353eSmrg$RM conftest*
4369636c353eSmrg])# _LT_COMPILER_BOILERPLATE
4370e07dc26bSmrg
4371e07dc26bSmrg
4372636c353eSmrg# _LT_LINKER_BOILERPLATE
4373636c353eSmrg# ----------------------
4374636c353eSmrg# Check for linker boilerplate output or warnings with
4375636c353eSmrg# the simple link test code.
4376636c353eSmrgm4_defun([_LT_LINKER_BOILERPLATE],
4377636c353eSmrg[m4_require([_LT_DECL_SED])dnl
4378636c353eSmrgac_outfile=conftest.$ac_objext
4379636c353eSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
4380636c353eSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
4381636c353eSmrg_lt_linker_boilerplate=`cat conftest.err`
4382636c353eSmrg$RM -r conftest*
4383636c353eSmrg])# _LT_LINKER_BOILERPLATE
4384e07dc26bSmrg
4385636c353eSmrg# _LT_REQUIRED_DARWIN_CHECKS
4386636c353eSmrg# -------------------------
4387636c353eSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
4388636c353eSmrg  case $host_os in
4389636c353eSmrg    rhapsody* | darwin*)
4390636c353eSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
4391636c353eSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
4392636c353eSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
4393636c353eSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
4394636c353eSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
4395636c353eSmrg    _LT_DECL([], [DSYMUTIL], [1],
4396636c353eSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
4397636c353eSmrg    _LT_DECL([], [NMEDIT], [1],
4398636c353eSmrg      [Tool to change global to local symbols on Mac OS X])
4399636c353eSmrg    _LT_DECL([], [LIPO], [1],
4400636c353eSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
4401636c353eSmrg    _LT_DECL([], [OTOOL], [1],
4402636c353eSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
4403636c353eSmrg    _LT_DECL([], [OTOOL64], [1],
4404636c353eSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
4405e07dc26bSmrg
4406636c353eSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
4407636c353eSmrg      [lt_cv_apple_cc_single_mod=no
4408636c353eSmrg      if test -z "$LT_MULTI_MODULE"; then
4409636c353eSmrg	# By default we will add the -single_module flag. You can override
4410636c353eSmrg	# by either setting the environment variable LT_MULTI_MODULE
4411636c353eSmrg	# non-empty at configure time, or by adding -multi_module to the
4412636c353eSmrg	# link flags.
4413636c353eSmrg	rm -rf libconftest.dylib*
4414636c353eSmrg	echo "int foo(void){return 1;}" > conftest.c
4415636c353eSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
4416636c353eSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
4417636c353eSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
4418636c353eSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
4419636c353eSmrg        _lt_result=$?
4420636c353eSmrg	# If there is a non-empty error log, and "single_module"
4421636c353eSmrg	# appears in it, assume the flag caused a linker warning
4422636c353eSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
4423636c353eSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
4424636c353eSmrg	# Otherwise, if the output was created with a 0 exit code from
4425636c353eSmrg	# the compiler, it worked.
4426636c353eSmrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
4427636c353eSmrg	  lt_cv_apple_cc_single_mod=yes
4428636c353eSmrg	else
4429636c353eSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
4430636c353eSmrg	fi
4431636c353eSmrg	rm -rf libconftest.dylib*
4432636c353eSmrg	rm -f conftest.*
4433636c353eSmrg      fi])
4434e07dc26bSmrg
4435636c353eSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
4436636c353eSmrg      [lt_cv_ld_exported_symbols_list],
4437636c353eSmrg      [lt_cv_ld_exported_symbols_list=no
4438636c353eSmrg      save_LDFLAGS=$LDFLAGS
4439636c353eSmrg      echo "_main" > conftest.sym
4440636c353eSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
4441636c353eSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
4442636c353eSmrg	[lt_cv_ld_exported_symbols_list=yes],
4443636c353eSmrg	[lt_cv_ld_exported_symbols_list=no])
4444636c353eSmrg	LDFLAGS=$save_LDFLAGS
4445636c353eSmrg    ])
4446e07dc26bSmrg
4447636c353eSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
4448636c353eSmrg      [lt_cv_ld_force_load=no
4449636c353eSmrg      cat > conftest.c << _LT_EOF
4450636c353eSmrgint forced_loaded() { return 2;}
4451636c353eSmrg_LT_EOF
4452636c353eSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
4453636c353eSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
4454636c353eSmrg      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
4455636c353eSmrg      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
4456636c353eSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
4457636c353eSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
4458636c353eSmrg      cat > conftest.c << _LT_EOF
4459636c353eSmrgint main() { return 0;}
4460636c353eSmrg_LT_EOF
4461636c353eSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
4462636c353eSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
4463636c353eSmrg      _lt_result=$?
4464636c353eSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
4465636c353eSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
4466636c353eSmrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
4467636c353eSmrg	lt_cv_ld_force_load=yes
4468e07dc26bSmrg      else
4469636c353eSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
4470e07dc26bSmrg      fi
4471636c353eSmrg        rm -f conftest.err libconftest.a conftest conftest.c
4472636c353eSmrg        rm -rf conftest.dSYM
4473636c353eSmrg    ])
4474636c353eSmrg    case $host_os in
4475636c353eSmrg    rhapsody* | darwin1.[[012]])
4476636c353eSmrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
4477636c353eSmrg    darwin1.*)
4478636c353eSmrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
4479636c353eSmrg    darwin*)
4480636c353eSmrg      case $MACOSX_DEPLOYMENT_TARGET,$host in
4481636c353eSmrg        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
4482636c353eSmrg          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
4483636c353eSmrg        *)
4484636c353eSmrg          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
4485636c353eSmrg      esac
4486636c353eSmrg    ;;
4487636c353eSmrg  esac
4488636c353eSmrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
4489636c353eSmrg      _lt_dar_single_mod='$single_module'
4490636c353eSmrg    fi
4491636c353eSmrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
4492636c353eSmrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
4493636c353eSmrg    else
4494636c353eSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
4495636c353eSmrg    fi
4496636c353eSmrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
4497636c353eSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
4498636c353eSmrg    else
4499636c353eSmrg      _lt_dsymutil=
4500636c353eSmrg    fi
4501636c353eSmrg    ;;
4502636c353eSmrg  esac
4503636c353eSmrg])
4504e07dc26bSmrg
4505e07dc26bSmrg
4506636c353eSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
4507636c353eSmrg# ---------------------------------
4508636c353eSmrg# Checks for linker and compiler features on darwin
4509636c353eSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
4510636c353eSmrg[
4511636c353eSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
4512636c353eSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
4513636c353eSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4514636c353eSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
4515636c353eSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4516636c353eSmrg  if test yes = "$lt_cv_ld_force_load"; then
4517636c353eSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
4518636c353eSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
4519636c353eSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
4520636c353eSmrg  else
4521636c353eSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
4522636c353eSmrg  fi
4523636c353eSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
4524636c353eSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
4525636c353eSmrg  case $cc_basename in
4526636c353eSmrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
4527636c353eSmrg     *) _lt_dar_can_shared=$GCC ;;
4528636c353eSmrg  esac
4529636c353eSmrg  if test yes = "$_lt_dar_can_shared"; then
4530636c353eSmrg    output_verbose_link_cmd=func_echo_all
4531636c353eSmrg    _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"
4532636c353eSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
4533636c353eSmrg    _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"
4534636c353eSmrg    _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"
4535636c353eSmrg    m4_if([$1], [CXX],
4536636c353eSmrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
4537636c353eSmrg      _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"
4538636c353eSmrg      _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"
4539636c353eSmrg    fi
4540636c353eSmrg],[])
4541636c353eSmrg  else
4542636c353eSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
4543636c353eSmrg  fi
4544636c353eSmrg])
4545636c353eSmrg
4546636c353eSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
4547636c353eSmrg# ----------------------------------
4548636c353eSmrg# Links a minimal program and checks the executable
4549636c353eSmrg# for the system default hardcoded library path. In most cases,
4550636c353eSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
4551636c353eSmrg# the location of the communication and MPI libs are included too.
4552636c353eSmrg# If we don't find anything, use the default library path according
4553636c353eSmrg# to the aix ld manual.
4554636c353eSmrg# Store the results from the different compilers for each TAGNAME.
4555636c353eSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
4556636c353eSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
4557636c353eSmrg[m4_require([_LT_DECL_SED])dnl
4558636c353eSmrgif test set = "${lt_cv_aix_libpath+set}"; then
4559636c353eSmrg  aix_libpath=$lt_cv_aix_libpath
4560636c353eSmrgelse
4561636c353eSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
4562636c353eSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
4563636c353eSmrg  lt_aix_libpath_sed='[
4564636c353eSmrg      /Import File Strings/,/^$/ {
4565636c353eSmrg	  /^0/ {
4566636c353eSmrg	      s/^0  *\([^ ]*\) *$/\1/
4567636c353eSmrg	      p
4568636c353eSmrg	  }
4569636c353eSmrg      }]'
4570636c353eSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
4571636c353eSmrg  # Check for a 64-bit object if we didn't find anything.
4572636c353eSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
4573636c353eSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
4574636c353eSmrg  fi],[])
4575636c353eSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
4576636c353eSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
4577636c353eSmrg  fi
4578636c353eSmrg  ])
4579636c353eSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
4580636c353eSmrgfi
4581636c353eSmrg])# _LT_SYS_MODULE_PATH_AIX
4582e07dc26bSmrg
4583e07dc26bSmrg
4584636c353eSmrg# _LT_SHELL_INIT(ARG)
4585636c353eSmrg# -------------------
4586636c353eSmrgm4_define([_LT_SHELL_INIT],
4587636c353eSmrg[m4_divert_text([M4SH-INIT], [$1
4588636c353eSmrg])])# _LT_SHELL_INIT
4589e07dc26bSmrg
4590e07dc26bSmrg
4591e07dc26bSmrg
4592636c353eSmrg# _LT_PROG_ECHO_BACKSLASH
4593636c353eSmrg# -----------------------
4594636c353eSmrg# Find how we can fake an echo command that does not interpret backslash.
4595636c353eSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
4596636c353eSmrg# of the generated configure script that will find a shell with a builtin
4597636c353eSmrg# printf (that we can use as an echo command).
4598636c353eSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
4599636c353eSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4600636c353eSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4601636c353eSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4602e07dc26bSmrg
4603636c353eSmrgAC_MSG_CHECKING([how to print strings])
4604636c353eSmrg# Test print first, because it will be a builtin if present.
4605636c353eSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
4606636c353eSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
4607636c353eSmrg  ECHO='print -r --'
4608636c353eSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
4609636c353eSmrg  ECHO='printf %s\n'
4610636c353eSmrgelse
4611636c353eSmrg  # Use this function as a fallback that always works.
4612636c353eSmrg  func_fallback_echo ()
4613636c353eSmrg  {
4614636c353eSmrg    eval 'cat <<_LTECHO_EOF
4615636c353eSmrg$[]1
4616636c353eSmrg_LTECHO_EOF'
4617636c353eSmrg  }
4618636c353eSmrg  ECHO='func_fallback_echo'
4619636c353eSmrgfi
4620e07dc26bSmrg
4621636c353eSmrg# func_echo_all arg...
4622636c353eSmrg# Invoke $ECHO with all args, space-separated.
4623636c353eSmrgfunc_echo_all ()
4624636c353eSmrg{
4625636c353eSmrg    $ECHO "$*"
4626636c353eSmrg}
4627e07dc26bSmrg
4628636c353eSmrgcase $ECHO in
4629636c353eSmrg  printf*) AC_MSG_RESULT([printf]) ;;
4630636c353eSmrg  print*) AC_MSG_RESULT([print -r]) ;;
4631636c353eSmrg  *) AC_MSG_RESULT([cat]) ;;
4632636c353eSmrgesac
4633e07dc26bSmrg
4634636c353eSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
4635636c353eSmrg[_AS_DETECT_SUGGESTED([
4636636c353eSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
4637636c353eSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4638636c353eSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4639636c353eSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4640636c353eSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
4641636c353eSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
4642636c353eSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
4643e07dc26bSmrg
4644636c353eSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
4645636c353eSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
4646636c353eSmrg])# _LT_PROG_ECHO_BACKSLASH
4647e07dc26bSmrg
4648e07dc26bSmrg
4649636c353eSmrg# _LT_WITH_SYSROOT
4650636c353eSmrg# ----------------
4651636c353eSmrgAC_DEFUN([_LT_WITH_SYSROOT],
4652636c353eSmrg[m4_require([_LT_DECL_SED])dnl
4653636c353eSmrgAC_MSG_CHECKING([for sysroot])
4654636c353eSmrgAC_ARG_WITH([sysroot],
4655636c353eSmrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
4656636c353eSmrg  [Search for dependent libraries within DIR (or the compiler's sysroot
4657636c353eSmrg   if not specified).])],
4658636c353eSmrg[], [with_sysroot=no])
4659e07dc26bSmrg
4660636c353eSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
4661636c353eSmrgdnl in case the user passed a directory name.
4662636c353eSmrglt_sysroot=
4663636c353eSmrgcase $with_sysroot in #(
4664636c353eSmrg yes)
4665636c353eSmrg   if test yes = "$GCC"; then
4666636c353eSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
4667636c353eSmrg   fi
4668636c353eSmrg   ;; #(
4669636c353eSmrg /*)
4670636c353eSmrg   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
4671636c353eSmrg   ;; #(
4672636c353eSmrg no|'')
4673636c353eSmrg   ;; #(
4674636c353eSmrg *)
4675636c353eSmrg   AC_MSG_RESULT([$with_sysroot])
4676636c353eSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
4677636c353eSmrg   ;;
4678636c353eSmrgesac
4679e07dc26bSmrg
4680636c353eSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
4681636c353eSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
4682636c353eSmrg[dependent libraries, and where our libraries should be installed.])])
4683636c353eSmrg
4684636c353eSmrg# _LT_ENABLE_LOCK
4685636c353eSmrg# ---------------
4686636c353eSmrgm4_defun([_LT_ENABLE_LOCK],
4687636c353eSmrg[AC_ARG_ENABLE([libtool-lock],
4688636c353eSmrg  [AS_HELP_STRING([--disable-libtool-lock],
4689636c353eSmrg    [avoid locking (might break parallel builds)])])
4690636c353eSmrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
4691636c353eSmrg
4692636c353eSmrg# Some flags need to be propagated to the compiler or linker for good
4693636c353eSmrg# libtool support.
4694636c353eSmrgcase $host in
4695636c353eSmrgia64-*-hpux*)
4696636c353eSmrg  # Find out what ABI is being produced by ac_compile, and set mode
4697636c353eSmrg  # options accordingly.
4698636c353eSmrg  echo 'int i;' > conftest.$ac_ext
4699636c353eSmrg  if AC_TRY_EVAL(ac_compile); then
4700636c353eSmrg    case `$FILECMD conftest.$ac_objext` in
4701636c353eSmrg      *ELF-32*)
4702636c353eSmrg	HPUX_IA64_MODE=32
4703636c353eSmrg	;;
4704636c353eSmrg      *ELF-64*)
4705636c353eSmrg	HPUX_IA64_MODE=64
4706636c353eSmrg	;;
4707636c353eSmrg    esac
4708636c353eSmrg  fi
4709636c353eSmrg  rm -rf conftest*
4710636c353eSmrg  ;;
4711636c353eSmrg*-*-irix6*)
4712636c353eSmrg  # Find out what ABI is being produced by ac_compile, and set linker
4713636c353eSmrg  # options accordingly.
4714636c353eSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4715636c353eSmrg  if AC_TRY_EVAL(ac_compile); then
4716636c353eSmrg    if test yes = "$lt_cv_prog_gnu_ld"; then
4717636c353eSmrg      case `$FILECMD conftest.$ac_objext` in
4718636c353eSmrg	*32-bit*)
4719636c353eSmrg	  LD="${LD-ld} -melf32bsmip"
4720e07dc26bSmrg	  ;;
4721636c353eSmrg	*N32*)
4722636c353eSmrg	  LD="${LD-ld} -melf32bmipn32"
4723636c353eSmrg	  ;;
4724636c353eSmrg	*64-bit*)
4725636c353eSmrg	  LD="${LD-ld} -melf64bmip"
4726636c353eSmrg	;;
4727636c353eSmrg      esac
4728636c353eSmrg    else
4729636c353eSmrg      case `$FILECMD conftest.$ac_objext` in
4730636c353eSmrg	*32-bit*)
4731636c353eSmrg	  LD="${LD-ld} -32"
4732636c353eSmrg	  ;;
4733636c353eSmrg	*N32*)
4734636c353eSmrg	  LD="${LD-ld} -n32"
4735636c353eSmrg	  ;;
4736636c353eSmrg	*64-bit*)
4737636c353eSmrg	  LD="${LD-ld} -64"
4738e07dc26bSmrg	  ;;
4739636c353eSmrg      esac
4740636c353eSmrg    fi
4741636c353eSmrg  fi
4742636c353eSmrg  rm -rf conftest*
4743636c353eSmrg  ;;
4744636c353eSmrg
4745636c353eSmrgmips64*-*linux*)
4746636c353eSmrg  # Find out what ABI is being produced by ac_compile, and set linker
4747636c353eSmrg  # options accordingly.
4748636c353eSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
4749636c353eSmrg  if AC_TRY_EVAL(ac_compile); then
4750636c353eSmrg    emul=elf
4751636c353eSmrg    case `$FILECMD conftest.$ac_objext` in
4752636c353eSmrg      *32-bit*)
4753636c353eSmrg	emul="${emul}32"
4754636c353eSmrg	;;
4755636c353eSmrg      *64-bit*)
4756636c353eSmrg	emul="${emul}64"
4757636c353eSmrg	;;
4758636c353eSmrg    esac
4759636c353eSmrg    case `$FILECMD conftest.$ac_objext` in
4760636c353eSmrg      *MSB*)
4761636c353eSmrg	emul="${emul}btsmip"
4762636c353eSmrg	;;
4763636c353eSmrg      *LSB*)
4764636c353eSmrg	emul="${emul}ltsmip"
4765636c353eSmrg	;;
4766636c353eSmrg    esac
4767636c353eSmrg    case `$FILECMD conftest.$ac_objext` in
4768636c353eSmrg      *N32*)
4769636c353eSmrg	emul="${emul}n32"
4770636c353eSmrg	;;
4771636c353eSmrg    esac
4772636c353eSmrg    LD="${LD-ld} -m $emul"
4773636c353eSmrg  fi
4774636c353eSmrg  rm -rf conftest*
4775636c353eSmrg  ;;
4776636c353eSmrg
4777636c353eSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
4778636c353eSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
4779636c353eSmrg  # Find out what ABI is being produced by ac_compile, and set linker
4780636c353eSmrg  # options accordingly.  Note that the listed cases only cover the
4781636c353eSmrg  # situations where additional linker options are needed (such as when
4782636c353eSmrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
4783636c353eSmrg  # vice versa); the common cases where no linker options are needed do
4784636c353eSmrg  # not appear in the list.
4785636c353eSmrg  echo 'int i;' > conftest.$ac_ext
4786636c353eSmrg  if AC_TRY_EVAL(ac_compile); then
4787636c353eSmrg    case `$FILECMD conftest.o` in
4788636c353eSmrg      *32-bit*)
4789636c353eSmrg	case $host in
4790636c353eSmrg	  x86_64-*kfreebsd*-gnu)
4791636c353eSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
4792636c353eSmrg	    ;;
4793636c353eSmrg	  x86_64-*linux*)
4794636c353eSmrg	    case `$FILECMD conftest.o` in
4795636c353eSmrg	      *x86-64*)
4796636c353eSmrg		LD="${LD-ld} -m elf32_x86_64"
4797636c353eSmrg		;;
4798636c353eSmrg	      *)
4799636c353eSmrg		LD="${LD-ld} -m elf_i386"
4800636c353eSmrg		;;
4801636c353eSmrg	    esac
4802636c353eSmrg	    ;;
4803636c353eSmrg	  powerpc64le-*linux*)
4804636c353eSmrg	    LD="${LD-ld} -m elf32lppclinux"
4805636c353eSmrg	    ;;
4806636c353eSmrg	  powerpc64-*linux*)
4807636c353eSmrg	    LD="${LD-ld} -m elf32ppclinux"
4808636c353eSmrg	    ;;
4809636c353eSmrg	  s390x-*linux*)
4810636c353eSmrg	    LD="${LD-ld} -m elf_s390"
4811636c353eSmrg	    ;;
4812636c353eSmrg	  sparc64-*linux*)
4813636c353eSmrg	    LD="${LD-ld} -m elf32_sparc"
4814636c353eSmrg	    ;;
4815e07dc26bSmrg	esac
4816636c353eSmrg	;;
4817636c353eSmrg      *64-bit*)
4818636c353eSmrg	case $host in
4819636c353eSmrg	  x86_64-*kfreebsd*-gnu)
4820636c353eSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
4821636c353eSmrg	    ;;
4822636c353eSmrg	  x86_64-*linux*)
4823636c353eSmrg	    LD="${LD-ld} -m elf_x86_64"
4824636c353eSmrg	    ;;
4825636c353eSmrg	  powerpcle-*linux*)
4826636c353eSmrg	    LD="${LD-ld} -m elf64lppc"
4827636c353eSmrg	    ;;
4828636c353eSmrg	  powerpc-*linux*)
4829636c353eSmrg	    LD="${LD-ld} -m elf64ppc"
4830636c353eSmrg	    ;;
4831636c353eSmrg	  s390*-*linux*|s390*-*tpf*)
4832636c353eSmrg	    LD="${LD-ld} -m elf64_s390"
4833636c353eSmrg	    ;;
4834636c353eSmrg	  sparc*-*linux*)
4835636c353eSmrg	    LD="${LD-ld} -m elf64_sparc"
4836636c353eSmrg	    ;;
4837636c353eSmrg	esac
4838636c353eSmrg	;;
4839636c353eSmrg    esac
4840636c353eSmrg  fi
4841636c353eSmrg  rm -rf conftest*
4842636c353eSmrg  ;;
4843636c353eSmrg
4844636c353eSmrg*-*-sco3.2v5*)
4845636c353eSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4846636c353eSmrg  SAVE_CFLAGS=$CFLAGS
4847636c353eSmrg  CFLAGS="$CFLAGS -belf"
4848636c353eSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
4849636c353eSmrg    [AC_LANG_PUSH(C)
4850636c353eSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
4851636c353eSmrg     AC_LANG_POP])
4852636c353eSmrg  if test yes != "$lt_cv_cc_needs_belf"; then
4853636c353eSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4854636c353eSmrg    CFLAGS=$SAVE_CFLAGS
4855636c353eSmrg  fi
4856636c353eSmrg  ;;
4857636c353eSmrg*-*solaris*)
4858636c353eSmrg  # Find out what ABI is being produced by ac_compile, and set linker
4859636c353eSmrg  # options accordingly.
4860636c353eSmrg  echo 'int i;' > conftest.$ac_ext
4861636c353eSmrg  if AC_TRY_EVAL(ac_compile); then
4862636c353eSmrg    case `$FILECMD conftest.o` in
4863636c353eSmrg    *64-bit*)
4864636c353eSmrg      case $lt_cv_prog_gnu_ld in
4865636c353eSmrg      yes*)
4866636c353eSmrg        case $host in
4867636c353eSmrg        i?86-*-solaris*|x86_64-*-solaris*)
4868636c353eSmrg          LD="${LD-ld} -m elf_x86_64"
4869636c353eSmrg          ;;
4870636c353eSmrg        sparc*-*-solaris*)
4871636c353eSmrg          LD="${LD-ld} -m elf64_sparc"
4872636c353eSmrg          ;;
4873636c353eSmrg        esac
4874636c353eSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
4875636c353eSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
4876636c353eSmrg          LD=${LD-ld}_sol2
4877636c353eSmrg        fi
4878636c353eSmrg        ;;
4879e07dc26bSmrg      *)
4880636c353eSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
4881636c353eSmrg	  LD="${LD-ld} -64"
4882e07dc26bSmrg	fi
4883e07dc26bSmrg	;;
4884e07dc26bSmrg      esac
4885e07dc26bSmrg      ;;
4886636c353eSmrg    esac
4887636c353eSmrg  fi
4888636c353eSmrg  rm -rf conftest*
4889636c353eSmrg  ;;
4890636c353eSmrgesac
4891e07dc26bSmrg
4892636c353eSmrgneed_locks=$enable_libtool_lock
4893636c353eSmrg])# _LT_ENABLE_LOCK
4894e07dc26bSmrg
4895e07dc26bSmrg
4896636c353eSmrg# _LT_PROG_AR
4897636c353eSmrg# -----------
4898636c353eSmrgm4_defun([_LT_PROG_AR],
4899636c353eSmrg[AC_CHECK_TOOLS(AR, [ar], false)
4900636c353eSmrg: ${AR=ar}
4901636c353eSmrg_LT_DECL([], [AR], [1], [The archiver])
4902e07dc26bSmrg
4903636c353eSmrg# Use ARFLAGS variable as AR's operation code to sync the variable naming with
4904636c353eSmrg# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
4905636c353eSmrg# higher priority because thats what people were doing historically (setting
4906636c353eSmrg# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
4907636c353eSmrg# variable obsoleted/removed.
4908e07dc26bSmrg
4909636c353eSmrgtest ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
4910636c353eSmrglt_ar_flags=$AR_FLAGS
4911636c353eSmrg_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
4912e07dc26bSmrg
4913636c353eSmrg# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
4914636c353eSmrg# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
4915636c353eSmrg_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
4916636c353eSmrg         [Flags to create an archive])
4917636c353eSmrg
4918636c353eSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
4919636c353eSmrg  [lt_cv_ar_at_file=no
4920636c353eSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
4921636c353eSmrg     [echo conftest.$ac_objext > conftest.lst
4922636c353eSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
4923636c353eSmrg      AC_TRY_EVAL([lt_ar_try])
4924636c353eSmrg      if test 0 -eq "$ac_status"; then
4925636c353eSmrg	# Ensure the archiver fails upon bogus file names.
4926636c353eSmrg	rm -f conftest.$ac_objext libconftest.a
4927636c353eSmrg	AC_TRY_EVAL([lt_ar_try])
4928636c353eSmrg	if test 0 -ne "$ac_status"; then
4929636c353eSmrg          lt_cv_ar_at_file=@
4930636c353eSmrg        fi
4931e07dc26bSmrg      fi
4932636c353eSmrg      rm -f conftest.* libconftest.a
4933636c353eSmrg     ])
4934636c353eSmrg  ])
4935e07dc26bSmrg
4936636c353eSmrgif test no = "$lt_cv_ar_at_file"; then
4937636c353eSmrg  archiver_list_spec=
4938636c353eSmrgelse
4939636c353eSmrg  archiver_list_spec=$lt_cv_ar_at_file
4940636c353eSmrgfi
4941636c353eSmrg_LT_DECL([], [archiver_list_spec], [1],
4942636c353eSmrg  [How to feed a file listing to the archiver])
4943636c353eSmrg])# _LT_PROG_AR
4944e07dc26bSmrg
4945e07dc26bSmrg
4946636c353eSmrg# _LT_CMD_OLD_ARCHIVE
4947636c353eSmrg# -------------------
4948636c353eSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
4949636c353eSmrg[_LT_PROG_AR
4950e07dc26bSmrg
4951636c353eSmrgAC_CHECK_TOOL(STRIP, strip, :)
4952636c353eSmrgtest -z "$STRIP" && STRIP=:
4953636c353eSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
4954e07dc26bSmrg
4955636c353eSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
4956636c353eSmrgtest -z "$RANLIB" && RANLIB=:
4957636c353eSmrg_LT_DECL([], [RANLIB], [1],
4958636c353eSmrg    [Commands used to install an old-style archive])
4959636c353eSmrg
4960636c353eSmrg# Determine commands to create old-style static archives.
4961636c353eSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
4962636c353eSmrgold_postinstall_cmds='chmod 644 $oldlib'
4963636c353eSmrgold_postuninstall_cmds=
4964636c353eSmrg
4965636c353eSmrgif test -n "$RANLIB"; then
4966636c353eSmrg  case $host_os in
4967636c353eSmrg  bitrig* | openbsd*)
4968636c353eSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
4969636c353eSmrg    ;;
4970636c353eSmrg  *)
4971636c353eSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
4972636c353eSmrg    ;;
4973636c353eSmrg  esac
4974636c353eSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
4975636c353eSmrgfi
4976636c353eSmrg
4977636c353eSmrgcase $host_os in
4978636c353eSmrg  darwin*)
4979636c353eSmrg    lock_old_archive_extraction=yes ;;
4980636c353eSmrg  *)
4981636c353eSmrg    lock_old_archive_extraction=no ;;
4982636c353eSmrgesac
4983636c353eSmrg_LT_DECL([], [old_postinstall_cmds], [2])
4984636c353eSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
4985636c353eSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
4986636c353eSmrg    [Commands used to build an old-style archive])
4987636c353eSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
4988636c353eSmrg    [Whether to use a lock for old archive extraction])
4989636c353eSmrg])# _LT_CMD_OLD_ARCHIVE
4990636c353eSmrg
4991636c353eSmrg
4992636c353eSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
4993636c353eSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
4994636c353eSmrg# ----------------------------------------------------------------
4995636c353eSmrg# Check whether the given compiler option works
4996636c353eSmrgAC_DEFUN([_LT_COMPILER_OPTION],
4997636c353eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4998636c353eSmrgm4_require([_LT_DECL_SED])dnl
4999636c353eSmrgAC_CACHE_CHECK([$1], [$2],
5000636c353eSmrg  [$2=no
5001636c353eSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
5002636c353eSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5003636c353eSmrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
5004636c353eSmrg   # Insert the option either (1) after the last *FLAGS variable, or
5005636c353eSmrg   # (2) before a word containing "conftest.", or (3) at the end.
5006636c353eSmrg   # Note that $ac_compile itself does not contain backslashes and begins
5007636c353eSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
5008636c353eSmrg   # The option is referenced via a variable to avoid confusing sed.
5009636c353eSmrg   lt_compile=`echo "$ac_compile" | $SED \
5010636c353eSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
5011636c353eSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
5012636c353eSmrg   -e 's:$: $lt_compiler_flag:'`
5013636c353eSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
5014636c353eSmrg   (eval "$lt_compile" 2>conftest.err)
5015636c353eSmrg   ac_status=$?
5016636c353eSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
5017636c353eSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
5018636c353eSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
5019636c353eSmrg     # The compiler can only warn and ignore the option if not recognized
5020636c353eSmrg     # So say no if there are warnings other than the usual output.
5021636c353eSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
5022636c353eSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
5023636c353eSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
5024636c353eSmrg       $2=yes
5025636c353eSmrg     fi
5026636c353eSmrg   fi
5027636c353eSmrg   $RM conftest*
5028e07dc26bSmrg])
5029e07dc26bSmrg
5030636c353eSmrgif test yes = "[$]$2"; then
5031636c353eSmrg    m4_if([$5], , :, [$5])
5032636c353eSmrgelse
5033636c353eSmrg    m4_if([$6], , :, [$6])
5034636c353eSmrgfi
5035636c353eSmrg])# _LT_COMPILER_OPTION
5036e07dc26bSmrg
5037636c353eSmrg# Old name:
5038636c353eSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
5039636c353eSmrgdnl aclocal-1.4 backwards compatibility:
5040636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
5041e07dc26bSmrg
5042e07dc26bSmrg
5043636c353eSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
5044636c353eSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
5045636c353eSmrg# ----------------------------------------------------
5046636c353eSmrg# Check whether the given linker option works
5047636c353eSmrgAC_DEFUN([_LT_LINKER_OPTION],
5048636c353eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5049636c353eSmrgm4_require([_LT_DECL_SED])dnl
5050636c353eSmrgAC_CACHE_CHECK([$1], [$2],
5051636c353eSmrg  [$2=no
5052636c353eSmrg   save_LDFLAGS=$LDFLAGS
5053636c353eSmrg   LDFLAGS="$LDFLAGS $3"
5054636c353eSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
5055636c353eSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
5056636c353eSmrg     # The linker can only warn and ignore the option if not recognized
5057636c353eSmrg     # So say no if there are warnings
5058636c353eSmrg     if test -s conftest.err; then
5059636c353eSmrg       # Append any errors to the config.log.
5060636c353eSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
5061636c353eSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
5062636c353eSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
5063636c353eSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
5064636c353eSmrg         $2=yes
5065636c353eSmrg       fi
5066636c353eSmrg     else
5067636c353eSmrg       $2=yes
5068636c353eSmrg     fi
5069636c353eSmrg   fi
5070636c353eSmrg   $RM -r conftest*
5071636c353eSmrg   LDFLAGS=$save_LDFLAGS
5072636c353eSmrg])
5073e07dc26bSmrg
5074636c353eSmrgif test yes = "[$]$2"; then
5075636c353eSmrg    m4_if([$4], , :, [$4])
5076636c353eSmrgelse
5077636c353eSmrg    m4_if([$5], , :, [$5])
5078636c353eSmrgfi
5079636c353eSmrg])# _LT_LINKER_OPTION
5080e07dc26bSmrg
5081636c353eSmrg# Old name:
5082636c353eSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
5083636c353eSmrgdnl aclocal-1.4 backwards compatibility:
5084636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
5085e07dc26bSmrg
5086e07dc26bSmrg
5087636c353eSmrg# LT_CMD_MAX_LEN
5088636c353eSmrg#---------------
5089636c353eSmrgAC_DEFUN([LT_CMD_MAX_LEN],
5090636c353eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5091636c353eSmrg# find the maximum length of command line arguments
5092636c353eSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
5093636c353eSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
5094636c353eSmrg  i=0
5095636c353eSmrg  teststring=ABCD
5096e07dc26bSmrg
5097636c353eSmrg  case $build_os in
5098636c353eSmrg  msdosdjgpp*)
5099636c353eSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
5100636c353eSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
5101636c353eSmrg    # during glob expansion).  Even if it were fixed, the result of this
5102636c353eSmrg    # check would be larger than it should be.
5103636c353eSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
5104636c353eSmrg    ;;
5105e07dc26bSmrg
5106636c353eSmrg  gnu*)
5107636c353eSmrg    # Under GNU Hurd, this test is not required because there is
5108636c353eSmrg    # no limit to the length of command line arguments.
5109636c353eSmrg    # Libtool will interpret -1 as no limit whatsoever
5110636c353eSmrg    lt_cv_sys_max_cmd_len=-1;
5111636c353eSmrg    ;;
5112e07dc26bSmrg
5113636c353eSmrg  cygwin* | mingw* | cegcc*)
5114636c353eSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
5115636c353eSmrg    # about 5 minutes as the teststring grows exponentially.
5116636c353eSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
5117636c353eSmrg    # you end up with a "frozen" computer, even though with patience
5118636c353eSmrg    # the test eventually succeeds (with a max line length of 256k).
5119636c353eSmrg    # Instead, let's just punt: use the minimum linelength reported by
5120636c353eSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
5121636c353eSmrg    lt_cv_sys_max_cmd_len=8192;
5122636c353eSmrg    ;;
5123e07dc26bSmrg
5124636c353eSmrg  mint*)
5125636c353eSmrg    # On MiNT this can take a long time and run out of memory.
5126636c353eSmrg    lt_cv_sys_max_cmd_len=8192;
5127636c353eSmrg    ;;
5128e07dc26bSmrg
5129636c353eSmrg  amigaos*)
5130636c353eSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
5131636c353eSmrg    # So we just punt and use a minimum line length of 8192.
5132636c353eSmrg    lt_cv_sys_max_cmd_len=8192;
5133636c353eSmrg    ;;
5134e07dc26bSmrg
5135636c353eSmrg  bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
5136636c353eSmrg    # This has been around since 386BSD, at least.  Likely further.
5137636c353eSmrg    if test -x /sbin/sysctl; then
5138636c353eSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
5139636c353eSmrg    elif test -x /usr/sbin/sysctl; then
5140636c353eSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
5141636c353eSmrg    else
5142636c353eSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
5143636c353eSmrg    fi
5144636c353eSmrg    # And add a safety zone
5145636c353eSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5146636c353eSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5147636c353eSmrg    ;;
5148e07dc26bSmrg
5149636c353eSmrg  interix*)
5150636c353eSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
5151636c353eSmrg    lt_cv_sys_max_cmd_len=196608
5152636c353eSmrg    ;;
5153e07dc26bSmrg
5154636c353eSmrg  os2*)
5155636c353eSmrg    # The test takes a long time on OS/2.
5156636c353eSmrg    lt_cv_sys_max_cmd_len=8192
5157e07dc26bSmrg    ;;
5158e07dc26bSmrg
5159636c353eSmrg  osf*)
5160636c353eSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
5161636c353eSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
5162636c353eSmrg    # nice to cause kernel panics so lets avoid the loop below.
5163636c353eSmrg    # First set a reasonable default.
5164636c353eSmrg    lt_cv_sys_max_cmd_len=16384
5165636c353eSmrg    #
5166636c353eSmrg    if test -x /sbin/sysconfig; then
5167636c353eSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
5168636c353eSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
5169e07dc26bSmrg      esac
5170e07dc26bSmrg    fi
5171e07dc26bSmrg    ;;
5172636c353eSmrg  sco3.2v5*)
5173636c353eSmrg    lt_cv_sys_max_cmd_len=102400
5174636c353eSmrg    ;;
5175636c353eSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
5176636c353eSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
5177636c353eSmrg    if test -n "$kargmax"; then
5178636c353eSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
5179636c353eSmrg    else
5180636c353eSmrg      lt_cv_sys_max_cmd_len=32768
5181636c353eSmrg    fi
5182636c353eSmrg    ;;
5183636c353eSmrg  *)
5184636c353eSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
5185636c353eSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
5186636c353eSmrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
5187636c353eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5188636c353eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5189636c353eSmrg    else
5190636c353eSmrg      # Make teststring a little bigger before we do anything with it.
5191636c353eSmrg      # a 1K string should be a reasonable start.
5192636c353eSmrg      for i in 1 2 3 4 5 6 7 8; do
5193636c353eSmrg        teststring=$teststring$teststring
5194636c353eSmrg      done
5195636c353eSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
5196636c353eSmrg      # If test is not a shell built-in, we'll probably end up computing a
5197636c353eSmrg      # maximum length that is only half of the actual maximum length, but
5198636c353eSmrg      # we can't tell.
5199636c353eSmrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
5200636c353eSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
5201636c353eSmrg	      test 17 != "$i" # 1/2 MB should be enough
5202636c353eSmrg      do
5203636c353eSmrg        i=`expr $i + 1`
5204636c353eSmrg        teststring=$teststring$teststring
5205636c353eSmrg      done
5206636c353eSmrg      # Only check the string length outside the loop.
5207636c353eSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
5208636c353eSmrg      teststring=
5209636c353eSmrg      # Add a significant safety factor because C++ compilers can tack on
5210636c353eSmrg      # massive amounts of additional arguments before passing them to the
5211636c353eSmrg      # linker.  It appears as though 1/2 is a usable value.
5212636c353eSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
5213636c353eSmrg    fi
5214636c353eSmrg    ;;
5215e07dc26bSmrg  esac
5216636c353eSmrg])
5217636c353eSmrgif test -n "$lt_cv_sys_max_cmd_len"; then
5218636c353eSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
5219636c353eSmrgelse
5220636c353eSmrg  AC_MSG_RESULT(none)
5221636c353eSmrgfi
5222636c353eSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
5223636c353eSmrg_LT_DECL([], [max_cmd_len], [0],
5224636c353eSmrg    [What is the maximum length of a command?])
5225636c353eSmrg])# LT_CMD_MAX_LEN
5226e07dc26bSmrg
5227636c353eSmrg# Old name:
5228636c353eSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
5229636c353eSmrgdnl aclocal-1.4 backwards compatibility:
5230636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
5231e07dc26bSmrg
5232e07dc26bSmrg
5233636c353eSmrg# _LT_HEADER_DLFCN
5234636c353eSmrg# ----------------
5235636c353eSmrgm4_defun([_LT_HEADER_DLFCN],
5236636c353eSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
5237636c353eSmrg])# _LT_HEADER_DLFCN
5238e07dc26bSmrg
5239e07dc26bSmrg
5240636c353eSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
5241636c353eSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
5242636c353eSmrg# ----------------------------------------------------------------
5243636c353eSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
5244636c353eSmrg[m4_require([_LT_HEADER_DLFCN])dnl
5245636c353eSmrgif test yes = "$cross_compiling"; then :
5246636c353eSmrg  [$4]
5247636c353eSmrgelse
5248636c353eSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
5249636c353eSmrg  lt_status=$lt_dlunknown
5250636c353eSmrg  cat > conftest.$ac_ext <<_LT_EOF
5251636c353eSmrg[#line $LINENO "configure"
5252636c353eSmrg#include "confdefs.h"
5253e07dc26bSmrg
5254636c353eSmrg#if HAVE_DLFCN_H
5255636c353eSmrg#include <dlfcn.h>
5256636c353eSmrg#endif
5257e07dc26bSmrg
5258636c353eSmrg#include <stdio.h>
5259e07dc26bSmrg
5260636c353eSmrg#ifdef RTLD_GLOBAL
5261636c353eSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
5262636c353eSmrg#else
5263636c353eSmrg#  ifdef DL_GLOBAL
5264636c353eSmrg#    define LT_DLGLOBAL		DL_GLOBAL
5265636c353eSmrg#  else
5266636c353eSmrg#    define LT_DLGLOBAL		0
5267636c353eSmrg#  endif
5268636c353eSmrg#endif
5269e07dc26bSmrg
5270636c353eSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
5271636c353eSmrg   find out it does not work in some platform. */
5272636c353eSmrg#ifndef LT_DLLAZY_OR_NOW
5273636c353eSmrg#  ifdef RTLD_LAZY
5274636c353eSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
5275636c353eSmrg#  else
5276636c353eSmrg#    ifdef DL_LAZY
5277636c353eSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
5278636c353eSmrg#    else
5279636c353eSmrg#      ifdef RTLD_NOW
5280636c353eSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
5281636c353eSmrg#      else
5282636c353eSmrg#        ifdef DL_NOW
5283636c353eSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
5284636c353eSmrg#        else
5285636c353eSmrg#          define LT_DLLAZY_OR_NOW	0
5286636c353eSmrg#        endif
5287636c353eSmrg#      endif
5288636c353eSmrg#    endif
5289636c353eSmrg#  endif
5290636c353eSmrg#endif
5291e07dc26bSmrg
5292636c353eSmrg/* When -fvisibility=hidden is used, assume the code has been annotated
5293636c353eSmrg   correspondingly for the symbols needed.  */
5294636c353eSmrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
5295636c353eSmrgint fnord () __attribute__((visibility("default")));
5296636c353eSmrg#endif
5297e07dc26bSmrg
5298636c353eSmrgint fnord () { return 42; }
5299636c353eSmrgint main ()
5300636c353eSmrg{
5301636c353eSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
5302636c353eSmrg  int status = $lt_dlunknown;
5303e07dc26bSmrg
5304636c353eSmrg  if (self)
5305636c353eSmrg    {
5306636c353eSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
5307636c353eSmrg      else
5308636c353eSmrg        {
5309636c353eSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
5310636c353eSmrg          else puts (dlerror ());
5311636c353eSmrg	}
5312636c353eSmrg      /* dlclose (self); */
5313636c353eSmrg    }
5314e07dc26bSmrg  else
5315636c353eSmrg    puts (dlerror ());
5316e07dc26bSmrg
5317636c353eSmrg  return status;
5318636c353eSmrg}]
5319636c353eSmrg_LT_EOF
5320636c353eSmrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
5321636c353eSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
5322636c353eSmrg    lt_status=$?
5323636c353eSmrg    case x$lt_status in
5324636c353eSmrg      x$lt_dlno_uscore) $1 ;;
5325636c353eSmrg      x$lt_dlneed_uscore) $2 ;;
5326636c353eSmrg      x$lt_dlunknown|x*) $3 ;;
5327636c353eSmrg    esac
5328636c353eSmrg  else :
5329636c353eSmrg    # compilation failed
5330636c353eSmrg    $3
5331636c353eSmrg  fi
5332636c353eSmrgfi
5333636c353eSmrgrm -fr conftest*
5334636c353eSmrg])# _LT_TRY_DLOPEN_SELF
5335e07dc26bSmrg
5336e07dc26bSmrg
5337636c353eSmrg# LT_SYS_DLOPEN_SELF
5338636c353eSmrg# ------------------
5339636c353eSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
5340636c353eSmrg[m4_require([_LT_HEADER_DLFCN])dnl
5341636c353eSmrgif test yes != "$enable_dlopen"; then
5342636c353eSmrg  enable_dlopen=unknown
5343636c353eSmrg  enable_dlopen_self=unknown
5344636c353eSmrg  enable_dlopen_self_static=unknown
5345636c353eSmrgelse
5346636c353eSmrg  lt_cv_dlopen=no
5347636c353eSmrg  lt_cv_dlopen_libs=
5348e07dc26bSmrg
5349636c353eSmrg  case $host_os in
5350636c353eSmrg  beos*)
5351636c353eSmrg    lt_cv_dlopen=load_add_on
5352636c353eSmrg    lt_cv_dlopen_libs=
5353636c353eSmrg    lt_cv_dlopen_self=yes
5354636c353eSmrg    ;;
5355e07dc26bSmrg
5356636c353eSmrg  mingw* | pw32* | cegcc*)
5357636c353eSmrg    lt_cv_dlopen=LoadLibrary
5358636c353eSmrg    lt_cv_dlopen_libs=
5359636c353eSmrg    ;;
5360e07dc26bSmrg
5361636c353eSmrg  cygwin*)
5362636c353eSmrg    lt_cv_dlopen=dlopen
5363636c353eSmrg    lt_cv_dlopen_libs=
5364636c353eSmrg    ;;
5365e07dc26bSmrg
5366636c353eSmrg  darwin*)
5367636c353eSmrg    # if libdl is installed we need to link against it
5368636c353eSmrg    AC_CHECK_LIB([dl], [dlopen],
5369636c353eSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
5370636c353eSmrg    lt_cv_dlopen=dyld
5371636c353eSmrg    lt_cv_dlopen_libs=
5372636c353eSmrg    lt_cv_dlopen_self=yes
5373636c353eSmrg    ])
5374636c353eSmrg    ;;
5375e07dc26bSmrg
5376636c353eSmrg  tpf*)
5377636c353eSmrg    # Don't try to run any link tests for TPF.  We know it's impossible
5378636c353eSmrg    # because TPF is a cross-compiler, and we know how we open DSOs.
5379636c353eSmrg    lt_cv_dlopen=dlopen
5380636c353eSmrg    lt_cv_dlopen_libs=
5381636c353eSmrg    lt_cv_dlopen_self=no
5382636c353eSmrg    ;;
5383e07dc26bSmrg
5384636c353eSmrg  *)
5385636c353eSmrg    AC_CHECK_FUNC([shl_load],
5386636c353eSmrg	  [lt_cv_dlopen=shl_load],
5387636c353eSmrg      [AC_CHECK_LIB([dld], [shl_load],
5388636c353eSmrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
5389636c353eSmrg	[AC_CHECK_FUNC([dlopen],
5390636c353eSmrg	      [lt_cv_dlopen=dlopen],
5391636c353eSmrg	  [AC_CHECK_LIB([dl], [dlopen],
5392636c353eSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
5393636c353eSmrg	    [AC_CHECK_LIB([svld], [dlopen],
5394636c353eSmrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
5395636c353eSmrg	      [AC_CHECK_LIB([dld], [dld_link],
5396636c353eSmrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
5397636c353eSmrg	      ])
5398636c353eSmrg	    ])
5399636c353eSmrg	  ])
5400636c353eSmrg	])
5401636c353eSmrg      ])
5402636c353eSmrg    ;;
5403636c353eSmrg  esac
5404e07dc26bSmrg
5405636c353eSmrg  if test no = "$lt_cv_dlopen"; then
5406636c353eSmrg    enable_dlopen=no
5407636c353eSmrg  else
5408636c353eSmrg    enable_dlopen=yes
5409636c353eSmrg  fi
5410e07dc26bSmrg
5411636c353eSmrg  case $lt_cv_dlopen in
5412636c353eSmrg  dlopen)
5413636c353eSmrg    save_CPPFLAGS=$CPPFLAGS
5414636c353eSmrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
5415e07dc26bSmrg
5416636c353eSmrg    save_LDFLAGS=$LDFLAGS
5417636c353eSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
5418e07dc26bSmrg
5419636c353eSmrg    save_LIBS=$LIBS
5420636c353eSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
5421e07dc26bSmrg
5422636c353eSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
5423636c353eSmrg	  lt_cv_dlopen_self, [dnl
5424636c353eSmrg	  _LT_TRY_DLOPEN_SELF(
5425636c353eSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
5426636c353eSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
5427636c353eSmrg    ])
5428e07dc26bSmrg
5429636c353eSmrg    if test yes = "$lt_cv_dlopen_self"; then
5430636c353eSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
5431636c353eSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
5432636c353eSmrg	  lt_cv_dlopen_self_static, [dnl
5433636c353eSmrg	  _LT_TRY_DLOPEN_SELF(
5434636c353eSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
5435636c353eSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
5436636c353eSmrg      ])
5437636c353eSmrg    fi
5438e07dc26bSmrg
5439636c353eSmrg    CPPFLAGS=$save_CPPFLAGS
5440636c353eSmrg    LDFLAGS=$save_LDFLAGS
5441636c353eSmrg    LIBS=$save_LIBS
5442636c353eSmrg    ;;
5443636c353eSmrg  esac
5444e07dc26bSmrg
5445636c353eSmrg  case $lt_cv_dlopen_self in
5446636c353eSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
5447636c353eSmrg  *) enable_dlopen_self=unknown ;;
5448636c353eSmrg  esac
5449e07dc26bSmrg
5450636c353eSmrg  case $lt_cv_dlopen_self_static in
5451636c353eSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
5452636c353eSmrg  *) enable_dlopen_self_static=unknown ;;
5453636c353eSmrg  esac
5454636c353eSmrgfi
5455636c353eSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
5456636c353eSmrg	 [Whether dlopen is supported])
5457636c353eSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
5458636c353eSmrg	 [Whether dlopen of programs is supported])
5459636c353eSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
5460636c353eSmrg	 [Whether dlopen of statically linked programs is supported])
5461636c353eSmrg])# LT_SYS_DLOPEN_SELF
5462e07dc26bSmrg
5463636c353eSmrg# Old name:
5464636c353eSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
5465636c353eSmrgdnl aclocal-1.4 backwards compatibility:
5466636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
5467e07dc26bSmrg
5468e07dc26bSmrg
5469636c353eSmrg# _LT_COMPILER_C_O([TAGNAME])
5470636c353eSmrg# ---------------------------
5471636c353eSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
5472636c353eSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
5473636c353eSmrgm4_defun([_LT_COMPILER_C_O],
5474636c353eSmrg[m4_require([_LT_DECL_SED])dnl
5475636c353eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5476636c353eSmrgm4_require([_LT_TAG_COMPILER])dnl
5477636c353eSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
5478636c353eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
5479636c353eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
5480636c353eSmrg   $RM -r conftest 2>/dev/null
5481636c353eSmrg   mkdir conftest
5482636c353eSmrg   cd conftest
5483636c353eSmrg   mkdir out
5484636c353eSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5485636c353eSmrg
5486636c353eSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
5487636c353eSmrg   # Insert the option either (1) after the last *FLAGS variable, or
5488636c353eSmrg   # (2) before a word containing "conftest.", or (3) at the end.
5489636c353eSmrg   # Note that $ac_compile itself does not contain backslashes and begins
5490636c353eSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
5491636c353eSmrg   lt_compile=`echo "$ac_compile" | $SED \
5492636c353eSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
5493636c353eSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
5494636c353eSmrg   -e 's:$: $lt_compiler_flag:'`
5495636c353eSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
5496636c353eSmrg   (eval "$lt_compile" 2>out/conftest.err)
5497636c353eSmrg   ac_status=$?
5498636c353eSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
5499636c353eSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
5500636c353eSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
5501636c353eSmrg   then
5502636c353eSmrg     # The compiler can only warn and ignore the option if not recognized
5503636c353eSmrg     # So say no if there are warnings
5504636c353eSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
5505636c353eSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
5506636c353eSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
5507636c353eSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
5508636c353eSmrg     fi
5509636c353eSmrg   fi
5510636c353eSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
5511636c353eSmrg   $RM conftest*
5512636c353eSmrg   # SGI C++ compiler will create directory out/ii_files/ for
5513636c353eSmrg   # template instantiation
5514636c353eSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
5515636c353eSmrg   $RM out/* && rmdir out
5516636c353eSmrg   cd ..
5517636c353eSmrg   $RM -r conftest
5518636c353eSmrg   $RM conftest*
5519636c353eSmrg])
5520636c353eSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
5521636c353eSmrg	[Does compiler simultaneously support -c and -o options?])
5522636c353eSmrg])# _LT_COMPILER_C_O
5523e07dc26bSmrg
5524e07dc26bSmrg
5525636c353eSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
5526636c353eSmrg# ----------------------------------
5527636c353eSmrg# Check to see if we can do hard links to lock some files if needed
5528636c353eSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
5529636c353eSmrg[m4_require([_LT_ENABLE_LOCK])dnl
5530636c353eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5531636c353eSmrg_LT_COMPILER_C_O([$1])
5532e07dc26bSmrg
5533636c353eSmrghard_links=nottested
5534636c353eSmrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
5535636c353eSmrg  # do not overwrite the value of need_locks provided by the user
5536636c353eSmrg  AC_MSG_CHECKING([if we can lock with hard links])
5537636c353eSmrg  hard_links=yes
5538636c353eSmrg  $RM conftest*
5539636c353eSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5540636c353eSmrg  touch conftest.a
5541636c353eSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
5542636c353eSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
5543636c353eSmrg  AC_MSG_RESULT([$hard_links])
5544636c353eSmrg  if test no = "$hard_links"; then
5545636c353eSmrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
5546636c353eSmrg    need_locks=warn
5547636c353eSmrg  fi
5548636c353eSmrgelse
5549636c353eSmrg  need_locks=no
5550636c353eSmrgfi
5551636c353eSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
5552636c353eSmrg])# _LT_COMPILER_FILE_LOCKS
5553e07dc26bSmrg
5554e07dc26bSmrg
5555636c353eSmrg# _LT_CHECK_OBJDIR
5556636c353eSmrg# ----------------
5557636c353eSmrgm4_defun([_LT_CHECK_OBJDIR],
5558636c353eSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
5559636c353eSmrg[rm -f .libs 2>/dev/null
5560636c353eSmrgmkdir .libs 2>/dev/null
5561636c353eSmrgif test -d .libs; then
5562636c353eSmrg  lt_cv_objdir=.libs
5563636c353eSmrgelse
5564636c353eSmrg  # MS-DOS does not allow filenames that begin with a dot.
5565636c353eSmrg  lt_cv_objdir=_libs
5566636c353eSmrgfi
5567636c353eSmrgrmdir .libs 2>/dev/null])
5568636c353eSmrgobjdir=$lt_cv_objdir
5569636c353eSmrg_LT_DECL([], [objdir], [0],
5570636c353eSmrg         [The name of the directory that contains temporary libtool files])dnl
5571636c353eSmrgm4_pattern_allow([LT_OBJDIR])dnl
5572636c353eSmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
5573636c353eSmrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
5574636c353eSmrg])# _LT_CHECK_OBJDIR
5575e07dc26bSmrg
5576e07dc26bSmrg
5577636c353eSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
5578636c353eSmrg# --------------------------------------
5579636c353eSmrg# Check hardcoding attributes.
5580636c353eSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
5581636c353eSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
5582636c353eSmrg_LT_TAGVAR(hardcode_action, $1)=
5583636c353eSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
5584636c353eSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
5585636c353eSmrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
5586e07dc26bSmrg
5587636c353eSmrg  # We can hardcode non-existent directories.
5588636c353eSmrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
5589636c353eSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
5590636c353eSmrg     # have to relink, otherwise we might link with an installed library
5591636c353eSmrg     # when we should be linking with a yet-to-be-installed one
5592636c353eSmrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
5593636c353eSmrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
5594636c353eSmrg    # Linking always hardcodes the temporary library directory.
5595636c353eSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
5596636c353eSmrg  else
5597636c353eSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
5598636c353eSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
5599636c353eSmrg  fi
5600636c353eSmrgelse
5601636c353eSmrg  # We cannot hardcode anything, or else we can only hardcode existing
5602636c353eSmrg  # directories.
5603636c353eSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
5604636c353eSmrgfi
5605636c353eSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
5606e07dc26bSmrg
5607636c353eSmrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
5608636c353eSmrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
5609636c353eSmrg  # Fast installation is not supported
5610636c353eSmrg  enable_fast_install=no
5611636c353eSmrgelif test yes = "$shlibpath_overrides_runpath" ||
5612636c353eSmrg     test no = "$enable_shared"; then
5613636c353eSmrg  # Fast installation is not necessary
5614636c353eSmrg  enable_fast_install=needless
5615636c353eSmrgfi
5616636c353eSmrg_LT_TAGDECL([], [hardcode_action], [0],
5617636c353eSmrg    [How to hardcode a shared library path into an executable])
5618636c353eSmrg])# _LT_LINKER_HARDCODE_LIBPATH
5619636c353eSmrg
5620636c353eSmrg
5621636c353eSmrg# _LT_CMD_STRIPLIB
5622636c353eSmrg# ----------------
5623636c353eSmrgm4_defun([_LT_CMD_STRIPLIB],
5624636c353eSmrg[m4_require([_LT_DECL_EGREP])
5625636c353eSmrgstriplib=
5626636c353eSmrgold_striplib=
5627636c353eSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
5628636c353eSmrgif test -z "$STRIP"; then
5629636c353eSmrg  AC_MSG_RESULT([no])
5630636c353eSmrgelse
5631636c353eSmrg  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
5632636c353eSmrg    old_striplib="$STRIP --strip-debug"
5633636c353eSmrg    striplib="$STRIP --strip-unneeded"
5634636c353eSmrg    AC_MSG_RESULT([yes])
5635636c353eSmrg  else
5636636c353eSmrg    case $host_os in
5637636c353eSmrg    darwin*)
5638636c353eSmrg      # FIXME - insert some real tests, host_os isn't really good enough
5639636c353eSmrg      striplib="$STRIP -x"
5640636c353eSmrg      old_striplib="$STRIP -S"
5641636c353eSmrg      AC_MSG_RESULT([yes])
5642636c353eSmrg      ;;
5643636c353eSmrg    freebsd*)
5644636c353eSmrg      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
5645636c353eSmrg        old_striplib="$STRIP --strip-debug"
5646636c353eSmrg        striplib="$STRIP --strip-unneeded"
5647636c353eSmrg        AC_MSG_RESULT([yes])
5648636c353eSmrg      else
5649636c353eSmrg        AC_MSG_RESULT([no])
5650636c353eSmrg      fi
5651636c353eSmrg      ;;
5652636c353eSmrg    *)
5653636c353eSmrg      AC_MSG_RESULT([no])
5654636c353eSmrg      ;;
5655636c353eSmrg    esac
5656636c353eSmrg  fi
5657636c353eSmrgfi
5658636c353eSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
5659636c353eSmrg_LT_DECL([], [striplib], [1])
5660636c353eSmrg])# _LT_CMD_STRIPLIB
5661636c353eSmrg
5662636c353eSmrg
5663636c353eSmrg# _LT_PREPARE_MUNGE_PATH_LIST
5664636c353eSmrg# ---------------------------
5665636c353eSmrg# Make sure func_munge_path_list() is defined correctly.
5666636c353eSmrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
5667636c353eSmrg[[# func_munge_path_list VARIABLE PATH
5668636c353eSmrg# -----------------------------------
5669636c353eSmrg# VARIABLE is name of variable containing _space_ separated list of
5670636c353eSmrg# directories to be munged by the contents of PATH, which is string
5671636c353eSmrg# having a format:
5672636c353eSmrg# "DIR[:DIR]:"
5673636c353eSmrg#       string "DIR[ DIR]" will be prepended to VARIABLE
5674636c353eSmrg# ":DIR[:DIR]"
5675636c353eSmrg#       string "DIR[ DIR]" will be appended to VARIABLE
5676636c353eSmrg# "DIRP[:DIRP]::[DIRA:]DIRA"
5677636c353eSmrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
5678636c353eSmrg#       "DIRA[ DIRA]" will be appended to VARIABLE
5679636c353eSmrg# "DIR[:DIR]"
5680636c353eSmrg#       VARIABLE will be replaced by "DIR[ DIR]"
5681636c353eSmrgfunc_munge_path_list ()
5682636c353eSmrg{
5683636c353eSmrg    case x@S|@2 in
5684636c353eSmrg    x)
5685636c353eSmrg        ;;
5686636c353eSmrg    *:)
5687636c353eSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
5688636c353eSmrg        ;;
5689636c353eSmrg    x:*)
5690636c353eSmrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
5691636c353eSmrg        ;;
5692636c353eSmrg    *::*)
5693636c353eSmrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
5694636c353eSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
5695636c353eSmrg        ;;
5696636c353eSmrg    *)
5697636c353eSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
5698e07dc26bSmrg        ;;
5699636c353eSmrg    esac
5700636c353eSmrg}
5701636c353eSmrg]])# _LT_PREPARE_PATH_LIST
5702e07dc26bSmrg
5703e07dc26bSmrg
5704636c353eSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
5705636c353eSmrg# -----------------------------
5706636c353eSmrg# PORTME Fill in your ld.so characteristics
5707636c353eSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
5708636c353eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5709636c353eSmrgm4_require([_LT_DECL_EGREP])dnl
5710636c353eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5711636c353eSmrgm4_require([_LT_DECL_OBJDUMP])dnl
5712636c353eSmrgm4_require([_LT_DECL_SED])dnl
5713636c353eSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
5714636c353eSmrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
5715636c353eSmrgAC_MSG_CHECKING([dynamic linker characteristics])
5716636c353eSmrgm4_if([$1],
5717636c353eSmrg	[], [
5718636c353eSmrgif test yes = "$GCC"; then
5719636c353eSmrg  case $host_os in
5720636c353eSmrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
5721636c353eSmrg    *) lt_awk_arg='/^libraries:/' ;;
5722636c353eSmrg  esac
5723636c353eSmrg  case $host_os in
5724636c353eSmrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
5725636c353eSmrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
5726636c353eSmrg  esac
5727636c353eSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
5728636c353eSmrg  case $lt_search_path_spec in
5729636c353eSmrg  *\;*)
5730636c353eSmrg    # if the path contains ";" then we assume it to be the separator
5731636c353eSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
5732636c353eSmrg    # assumed that no part of a normal pathname contains ";" but that should
5733636c353eSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
5734636c353eSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
5735636c353eSmrg    ;;
5736636c353eSmrg  *)
5737636c353eSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
5738636c353eSmrg    ;;
5739636c353eSmrg  esac
5740636c353eSmrg  # Ok, now we have the path, separated by spaces, we can step through it
5741636c353eSmrg  # and add multilib dir if necessary...
5742636c353eSmrg  lt_tmp_lt_search_path_spec=
5743636c353eSmrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
5744636c353eSmrg  # ...but if some path component already ends with the multilib dir we assume
5745636c353eSmrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
5746636c353eSmrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
5747636c353eSmrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
5748636c353eSmrg    lt_multi_os_dir=
5749636c353eSmrg    ;;
5750636c353eSmrg  esac
5751636c353eSmrg  for lt_sys_path in $lt_search_path_spec; do
5752636c353eSmrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
5753636c353eSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
5754636c353eSmrg    elif test -n "$lt_multi_os_dir"; then
5755636c353eSmrg      test -d "$lt_sys_path" && \
5756636c353eSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
5757636c353eSmrg    fi
5758636c353eSmrg  done
5759636c353eSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
5760636c353eSmrgBEGIN {RS = " "; FS = "/|\n";} {
5761636c353eSmrg  lt_foo = "";
5762636c353eSmrg  lt_count = 0;
5763636c353eSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
5764636c353eSmrg    if ($lt_i != "" && $lt_i != ".") {
5765636c353eSmrg      if ($lt_i == "..") {
5766636c353eSmrg        lt_count++;
5767636c353eSmrg      } else {
5768636c353eSmrg        if (lt_count == 0) {
5769636c353eSmrg          lt_foo = "/" $lt_i lt_foo;
5770636c353eSmrg        } else {
5771636c353eSmrg          lt_count--;
5772636c353eSmrg        }
5773636c353eSmrg      }
5774636c353eSmrg    }
5775636c353eSmrg  }
5776636c353eSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
5777636c353eSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
5778636c353eSmrg}'`
5779636c353eSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
5780636c353eSmrg  # for these hosts.
5781636c353eSmrg  case $host_os in
5782636c353eSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
5783636c353eSmrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
5784636c353eSmrg  esac
5785636c353eSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
5786636c353eSmrgelse
5787636c353eSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
5788636c353eSmrgfi])
5789636c353eSmrglibrary_names_spec=
5790636c353eSmrglibname_spec='lib$name'
5791636c353eSmrgsoname_spec=
5792636c353eSmrgshrext_cmds=.so
5793636c353eSmrgpostinstall_cmds=
5794636c353eSmrgpostuninstall_cmds=
5795636c353eSmrgfinish_cmds=
5796636c353eSmrgfinish_eval=
5797636c353eSmrgshlibpath_var=
5798636c353eSmrgshlibpath_overrides_runpath=unknown
5799636c353eSmrgversion_type=none
5800636c353eSmrgdynamic_linker="$host_os ld.so"
5801636c353eSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
5802636c353eSmrgneed_lib_prefix=unknown
5803636c353eSmrghardcode_into_libs=no
5804e07dc26bSmrg
5805636c353eSmrg# when you set need_version to no, make sure it does not cause -set_version
5806636c353eSmrg# flags to be left without arguments
5807636c353eSmrgneed_version=unknown
5808e07dc26bSmrg
5809636c353eSmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
5810636c353eSmrg[User-defined run-time library search path.])
5811e07dc26bSmrg
5812636c353eSmrgcase $host_os in
5813636c353eSmrgaix3*)
5814636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
5815636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
5816636c353eSmrg  shlibpath_var=LIBPATH
5817636c353eSmrg
5818636c353eSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
5819636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
5820636c353eSmrg  ;;
5821636c353eSmrg
5822636c353eSmrgaix[[4-9]]*)
5823636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
5824636c353eSmrg  need_lib_prefix=no
5825636c353eSmrg  need_version=no
5826636c353eSmrg  hardcode_into_libs=yes
5827636c353eSmrg  if test ia64 = "$host_cpu"; then
5828636c353eSmrg    # AIX 5 supports IA64
5829636c353eSmrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
5830636c353eSmrg    shlibpath_var=LD_LIBRARY_PATH
5831636c353eSmrg  else
5832636c353eSmrg    # With GCC up to 2.95.x, collect2 would create an import file
5833636c353eSmrg    # for dependence libraries.  The import file would start with
5834636c353eSmrg    # the line '#! .'.  This would cause the generated library to
5835636c353eSmrg    # depend on '.', always an invalid library.  This was fixed in
5836636c353eSmrg    # development snapshots of GCC prior to 3.0.
5837636c353eSmrg    case $host_os in
5838636c353eSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
5839636c353eSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
5840636c353eSmrg	   echo ' yes '
5841636c353eSmrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
5842636c353eSmrg	:
5843636c353eSmrg      else
5844636c353eSmrg	can_build_shared=no
5845636c353eSmrg      fi
5846636c353eSmrg      ;;
5847636c353eSmrg    esac
5848636c353eSmrg    # Using Import Files as archive members, it is possible to support
5849636c353eSmrg    # filename-based versioning of shared library archives on AIX. While
5850636c353eSmrg    # this would work for both with and without runtime linking, it will
5851636c353eSmrg    # prevent static linking of such archives. So we do filename-based
5852636c353eSmrg    # shared library versioning with .so extension only, which is used
5853636c353eSmrg    # when both runtime linking and shared linking is enabled.
5854636c353eSmrg    # Unfortunately, runtime linking may impact performance, so we do
5855636c353eSmrg    # not want this to be the default eventually. Also, we use the
5856636c353eSmrg    # versioned .so libs for executables only if there is the -brtl
5857636c353eSmrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
5858636c353eSmrg    # To allow for filename-based versioning support, we need to create
5859636c353eSmrg    # libNAME.so.V as an archive file, containing:
5860636c353eSmrg    # *) an Import File, referring to the versioned filename of the
5861636c353eSmrg    #    archive as well as the shared archive member, telling the
5862636c353eSmrg    #    bitwidth (32 or 64) of that shared object, and providing the
5863636c353eSmrg    #    list of exported symbols of that shared object, eventually
5864636c353eSmrg    #    decorated with the 'weak' keyword
5865636c353eSmrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
5866636c353eSmrg    #    it being seen by the linker.
5867636c353eSmrg    # At run time we better use the real file rather than another symlink,
5868636c353eSmrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
5869e07dc26bSmrg
5870636c353eSmrg    case $with_aix_soname,$aix_use_runtimelinking in
5871636c353eSmrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
5872636c353eSmrg    # soname into executable. Probably we can add versioning support to
5873636c353eSmrg    # collect2, so additional links can be useful in future.
5874636c353eSmrg    aix,yes) # traditional libtool
5875636c353eSmrg      dynamic_linker='AIX unversionable lib.so'
5876636c353eSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
5877636c353eSmrg      # instead of lib<name>.a to let people know that these are not
5878636c353eSmrg      # typical AIX shared libraries.
5879636c353eSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5880636c353eSmrg      ;;
5881636c353eSmrg    aix,no) # traditional AIX only
5882636c353eSmrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
5883636c353eSmrg      # We preserve .a as extension for shared libraries through AIX4.2
5884636c353eSmrg      # and later when we are not doing run time linking.
5885636c353eSmrg      library_names_spec='$libname$release.a $libname.a'
5886636c353eSmrg      soname_spec='$libname$release$shared_ext$major'
5887636c353eSmrg      ;;
5888636c353eSmrg    svr4,*) # full svr4 only
5889636c353eSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
5890636c353eSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5891636c353eSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
5892636c353eSmrg      shlibpath_overrides_runpath=yes
5893636c353eSmrg      ;;
5894636c353eSmrg    *,yes) # both, prefer svr4
5895636c353eSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
5896636c353eSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
5897636c353eSmrg      # unpreferred sharedlib libNAME.a needs extra handling
5898636c353eSmrg      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
5899636c353eSmrg      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
5900636c353eSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
5901636c353eSmrg      shlibpath_overrides_runpath=yes
5902636c353eSmrg      ;;
5903636c353eSmrg    *,no) # both, prefer aix
5904636c353eSmrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
5905636c353eSmrg      library_names_spec='$libname$release.a $libname.a'
5906636c353eSmrg      soname_spec='$libname$release$shared_ext$major'
5907636c353eSmrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
5908636c353eSmrg      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
5909636c353eSmrg      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
5910636c353eSmrg      ;;
5911636c353eSmrg    esac
5912636c353eSmrg    shlibpath_var=LIBPATH
5913636c353eSmrg  fi
5914636c353eSmrg  ;;
5915e07dc26bSmrg
5916636c353eSmrgamigaos*)
5917636c353eSmrg  case $host_cpu in
5918636c353eSmrg  powerpc)
5919636c353eSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
5920636c353eSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
5921636c353eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5922636c353eSmrg    ;;
5923636c353eSmrg  m68k)
5924636c353eSmrg    library_names_spec='$libname.ixlibrary $libname.a'
5925636c353eSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
5926636c353eSmrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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'
5927636c353eSmrg    ;;
5928636c353eSmrg  esac
5929636c353eSmrg  ;;
5930e07dc26bSmrg
5931636c353eSmrgbeos*)
5932636c353eSmrg  library_names_spec='$libname$shared_ext'
5933636c353eSmrg  dynamic_linker="$host_os ld.so"
5934636c353eSmrg  shlibpath_var=LIBRARY_PATH
5935636c353eSmrg  ;;
5936e07dc26bSmrg
5937636c353eSmrgbsdi[[45]]*)
5938636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
5939636c353eSmrg  need_version=no
5940636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
5941636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
5942636c353eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
5943636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
5944636c353eSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
5945636c353eSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
5946636c353eSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
5947636c353eSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
5948636c353eSmrg  # libtool to hard-code these into programs
5949636c353eSmrg  ;;
5950e07dc26bSmrg
5951636c353eSmrgcygwin* | mingw* | pw32* | cegcc*)
5952636c353eSmrg  version_type=windows
5953636c353eSmrg  shrext_cmds=.dll
5954636c353eSmrg  need_version=no
5955636c353eSmrg  need_lib_prefix=no
5956e07dc26bSmrg
5957636c353eSmrg  case $GCC,$cc_basename in
5958636c353eSmrg  yes,*)
5959636c353eSmrg    # gcc
5960636c353eSmrg    library_names_spec='$libname.dll.a'
5961636c353eSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
5962636c353eSmrg    postinstall_cmds='base_file=`basename \$file`~
5963636c353eSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
5964636c353eSmrg      dldir=$destdir/`dirname \$dlpath`~
5965636c353eSmrg      test -d \$dldir || mkdir -p \$dldir~
5966636c353eSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
5967636c353eSmrg      chmod a+x \$dldir/$dlname~
5968636c353eSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
5969636c353eSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
5970636c353eSmrg      fi'
5971636c353eSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
5972636c353eSmrg      dlpath=$dir/\$dldll~
5973636c353eSmrg       $RM \$dlpath'
5974636c353eSmrg    shlibpath_overrides_runpath=yes
5975e07dc26bSmrg
5976636c353eSmrg    case $host_os in
5977636c353eSmrg    cygwin*)
5978636c353eSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
5979636c353eSmrg      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5980636c353eSmrgm4_if([$1], [],[
5981636c353eSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
5982636c353eSmrg      ;;
5983636c353eSmrg    mingw* | cegcc*)
5984636c353eSmrg      # MinGW DLLs use traditional 'lib' prefix
5985636c353eSmrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5986636c353eSmrg      ;;
5987636c353eSmrg    pw32*)
5988636c353eSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
5989636c353eSmrg      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5990636c353eSmrg      ;;
5991636c353eSmrg    esac
5992636c353eSmrg    dynamic_linker='Win32 ld.exe'
5993636c353eSmrg    ;;
5994e07dc26bSmrg
5995636c353eSmrg  *,cl* | *,icl*)
5996636c353eSmrg    # Native MSVC or ICC
5997636c353eSmrg    libname_spec='$name'
5998636c353eSmrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
5999636c353eSmrg    library_names_spec='$libname.dll.lib'
6000e07dc26bSmrg
6001636c353eSmrg    case $build_os in
6002636c353eSmrg    mingw*)
6003636c353eSmrg      sys_lib_search_path_spec=
6004636c353eSmrg      lt_save_ifs=$IFS
6005636c353eSmrg      IFS=';'
6006636c353eSmrg      for lt_path in $LIB
6007636c353eSmrg      do
6008636c353eSmrg        IFS=$lt_save_ifs
6009636c353eSmrg        # Let DOS variable expansion print the short 8.3 style file name.
6010636c353eSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
6011636c353eSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
6012636c353eSmrg      done
6013636c353eSmrg      IFS=$lt_save_ifs
6014636c353eSmrg      # Convert to MSYS style.
6015636c353eSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
6016636c353eSmrg      ;;
6017636c353eSmrg    cygwin*)
6018636c353eSmrg      # Convert to unix form, then to dos form, then back to unix form
6019636c353eSmrg      # but this time dos style (no spaces!) so that the unix form looks
6020636c353eSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
6021636c353eSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
6022636c353eSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
6023636c353eSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
6024636c353eSmrg      ;;
6025636c353eSmrg    *)
6026636c353eSmrg      sys_lib_search_path_spec=$LIB
6027636c353eSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
6028636c353eSmrg        # It is most probably a Windows format PATH.
6029636c353eSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
6030636c353eSmrg      else
6031636c353eSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
6032636c353eSmrg      fi
6033636c353eSmrg      # FIXME: find the short name or the path components, as spaces are
6034636c353eSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
6035636c353eSmrg      ;;
6036636c353eSmrg    esac
6037e07dc26bSmrg
6038636c353eSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
6039636c353eSmrg    postinstall_cmds='base_file=`basename \$file`~
6040636c353eSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
6041636c353eSmrg      dldir=$destdir/`dirname \$dlpath`~
6042636c353eSmrg      test -d \$dldir || mkdir -p \$dldir~
6043636c353eSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
6044636c353eSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
6045636c353eSmrg      dlpath=$dir/\$dldll~
6046636c353eSmrg       $RM \$dlpath'
6047636c353eSmrg    shlibpath_overrides_runpath=yes
6048636c353eSmrg    dynamic_linker='Win32 link.exe'
6049636c353eSmrg    ;;
6050e07dc26bSmrg
6051636c353eSmrg  *)
6052636c353eSmrg    # Assume MSVC and ICC wrapper
6053636c353eSmrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
6054636c353eSmrg    dynamic_linker='Win32 ld.exe'
6055636c353eSmrg    ;;
6056636c353eSmrg  esac
6057636c353eSmrg  # FIXME: first we should search . and the directory the executable is in
6058636c353eSmrg  shlibpath_var=PATH
6059636c353eSmrg  ;;
6060e07dc26bSmrg
6061636c353eSmrgdarwin* | rhapsody*)
6062636c353eSmrg  dynamic_linker="$host_os dyld"
6063636c353eSmrg  version_type=darwin
6064636c353eSmrg  need_lib_prefix=no
6065636c353eSmrg  need_version=no
6066636c353eSmrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
6067636c353eSmrg  soname_spec='$libname$release$major$shared_ext'
6068636c353eSmrg  shlibpath_overrides_runpath=yes
6069636c353eSmrg  shlibpath_var=DYLD_LIBRARY_PATH
6070636c353eSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
6071636c353eSmrgm4_if([$1], [],[
6072636c353eSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
6073636c353eSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
6074636c353eSmrg  ;;
6075e07dc26bSmrg
6076636c353eSmrgdgux*)
6077636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6078636c353eSmrg  need_lib_prefix=no
6079636c353eSmrg  need_version=no
6080636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6081636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6082636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6083636c353eSmrg  ;;
6084e07dc26bSmrg
6085636c353eSmrgfreebsd* | dragonfly* | midnightbsd*)
6086636c353eSmrg  # DragonFly does not have aout.  When/if they implement a new
6087636c353eSmrg  # versioning mechanism, adjust this.
6088636c353eSmrg  if test -x /usr/bin/objformat; then
6089636c353eSmrg    objformat=`/usr/bin/objformat`
6090636c353eSmrg  else
6091636c353eSmrg    case $host_os in
6092636c353eSmrg    freebsd[[23]].*) objformat=aout ;;
6093636c353eSmrg    *) objformat=elf ;;
6094636c353eSmrg    esac
6095636c353eSmrg  fi
6096636c353eSmrg  version_type=freebsd-$objformat
6097636c353eSmrg  case $version_type in
6098636c353eSmrg    freebsd-elf*)
6099636c353eSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6100636c353eSmrg      soname_spec='$libname$release$shared_ext$major'
6101636c353eSmrg      need_version=no
6102636c353eSmrg      need_lib_prefix=no
6103636c353eSmrg      ;;
6104636c353eSmrg    freebsd-*)
6105636c353eSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6106636c353eSmrg      need_version=yes
6107636c353eSmrg      ;;
6108636c353eSmrg  esac
6109636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6110636c353eSmrg  case $host_os in
6111636c353eSmrg  freebsd2.*)
6112636c353eSmrg    shlibpath_overrides_runpath=yes
6113636c353eSmrg    ;;
6114636c353eSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
6115636c353eSmrg    shlibpath_overrides_runpath=yes
6116636c353eSmrg    hardcode_into_libs=yes
6117636c353eSmrg    ;;
6118636c353eSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
6119636c353eSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
6120636c353eSmrg    shlibpath_overrides_runpath=no
6121636c353eSmrg    hardcode_into_libs=yes
6122636c353eSmrg    ;;
6123636c353eSmrg  *) # from 4.6 on, and DragonFly
6124636c353eSmrg    shlibpath_overrides_runpath=yes
6125636c353eSmrg    hardcode_into_libs=yes
6126636c353eSmrg    ;;
6127636c353eSmrg  esac
6128636c353eSmrg  ;;
6129e07dc26bSmrg
6130636c353eSmrghaiku*)
6131636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6132636c353eSmrg  need_lib_prefix=no
6133636c353eSmrg  need_version=no
6134636c353eSmrg  dynamic_linker="$host_os runtime_loader"
6135636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6136636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6137636c353eSmrg  shlibpath_var=LIBRARY_PATH
6138636c353eSmrg  shlibpath_overrides_runpath=no
6139636c353eSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
6140636c353eSmrg  hardcode_into_libs=yes
6141636c353eSmrg  ;;
6142636c353eSmrg
6143636c353eSmrghpux9* | hpux10* | hpux11*)
6144636c353eSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
6145636c353eSmrg  # link against other versions.
6146636c353eSmrg  version_type=sunos
6147636c353eSmrg  need_lib_prefix=no
6148636c353eSmrg  need_version=no
6149636c353eSmrg  case $host_cpu in
6150636c353eSmrg  ia64*)
6151636c353eSmrg    shrext_cmds='.so'
6152636c353eSmrg    hardcode_into_libs=yes
6153636c353eSmrg    dynamic_linker="$host_os dld.so"
6154636c353eSmrg    shlibpath_var=LD_LIBRARY_PATH
6155636c353eSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6156636c353eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6157636c353eSmrg    soname_spec='$libname$release$shared_ext$major'
6158636c353eSmrg    if test 32 = "$HPUX_IA64_MODE"; then
6159636c353eSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
6160636c353eSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
6161636c353eSmrg    else
6162636c353eSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
6163636c353eSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
6164636c353eSmrg    fi
6165636c353eSmrg    ;;
6166636c353eSmrg  hppa*64*)
6167636c353eSmrg    shrext_cmds='.sl'
6168636c353eSmrg    hardcode_into_libs=yes
6169636c353eSmrg    dynamic_linker="$host_os dld.sl"
6170636c353eSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
6171636c353eSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6172636c353eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6173636c353eSmrg    soname_spec='$libname$release$shared_ext$major'
6174636c353eSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
6175636c353eSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6176636c353eSmrg    ;;
6177636c353eSmrg  *)
6178636c353eSmrg    shrext_cmds='.sl'
6179636c353eSmrg    dynamic_linker="$host_os dld.sl"
6180636c353eSmrg    shlibpath_var=SHLIB_PATH
6181636c353eSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6182636c353eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6183636c353eSmrg    soname_spec='$libname$release$shared_ext$major'
6184636c353eSmrg    ;;
6185636c353eSmrg  esac
6186636c353eSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
6187636c353eSmrg  postinstall_cmds='chmod 555 $lib'
6188636c353eSmrg  # or fails outright, so override atomically:
6189636c353eSmrg  install_override_mode=555
6190636c353eSmrg  ;;
6191e07dc26bSmrg
6192636c353eSmrginterix[[3-9]]*)
6193636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6194636c353eSmrg  need_lib_prefix=no
6195636c353eSmrg  need_version=no
6196636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6197636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6198636c353eSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
6199636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6200636c353eSmrg  shlibpath_overrides_runpath=no
6201636c353eSmrg  hardcode_into_libs=yes
6202636c353eSmrg  ;;
6203e07dc26bSmrg
6204636c353eSmrgirix5* | irix6* | nonstopux*)
6205636c353eSmrg  case $host_os in
6206636c353eSmrg    nonstopux*) version_type=nonstopux ;;
6207636c353eSmrg    *)
6208636c353eSmrg	if test yes = "$lt_cv_prog_gnu_ld"; then
6209636c353eSmrg		version_type=linux # correct to gnu/linux during the next big refactor
6210636c353eSmrg	else
6211636c353eSmrg		version_type=irix
6212636c353eSmrg	fi ;;
6213636c353eSmrg  esac
6214636c353eSmrg  need_lib_prefix=no
6215636c353eSmrg  need_version=no
6216636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6217636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
6218636c353eSmrg  case $host_os in
6219636c353eSmrg  irix5* | nonstopux*)
6220636c353eSmrg    libsuff= shlibsuff=
6221636c353eSmrg    ;;
6222636c353eSmrg  *)
6223636c353eSmrg    case $LD in # libtool.m4 will add one of these switches to LD
6224636c353eSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
6225636c353eSmrg      libsuff= shlibsuff= libmagic=32-bit;;
6226636c353eSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
6227636c353eSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
6228636c353eSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
6229636c353eSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
6230636c353eSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
6231636c353eSmrg    esac
6232636c353eSmrg    ;;
6233636c353eSmrg  esac
6234636c353eSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6235636c353eSmrg  shlibpath_overrides_runpath=no
6236636c353eSmrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
6237636c353eSmrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
6238636c353eSmrg  hardcode_into_libs=yes
6239636c353eSmrg  ;;
6240e07dc26bSmrg
6241636c353eSmrg# No shared lib support for Linux oldld, aout, or coff.
6242636c353eSmrglinux*oldld* | linux*aout* | linux*coff*)
6243636c353eSmrg  dynamic_linker=no
6244636c353eSmrg  ;;
6245e07dc26bSmrg
6246636c353eSmrglinux*android*)
6247636c353eSmrg  version_type=none # Android doesn't support versioned libraries.
6248636c353eSmrg  need_lib_prefix=no
6249636c353eSmrg  need_version=no
6250636c353eSmrg  library_names_spec='$libname$release$shared_ext'
6251636c353eSmrg  soname_spec='$libname$release$shared_ext'
6252636c353eSmrg  finish_cmds=
6253636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6254636c353eSmrg  shlibpath_overrides_runpath=yes
6255e07dc26bSmrg
6256636c353eSmrg  # This implies no fast_install, which is unacceptable.
6257636c353eSmrg  # Some rework will be needed to allow for fast_install
6258636c353eSmrg  # before this can be enabled.
6259636c353eSmrg  hardcode_into_libs=yes
6260e07dc26bSmrg
6261636c353eSmrg  dynamic_linker='Android linker'
6262636c353eSmrg  # Don't embed -rpath directories since the linker doesn't support them.
6263636c353eSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6264636c353eSmrg  ;;
6265e07dc26bSmrg
6266636c353eSmrg# This must be glibc/ELF.
6267636c353eSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6268636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6269636c353eSmrg  need_lib_prefix=no
6270636c353eSmrg  need_version=no
6271636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6272636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6273636c353eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6274636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6275636c353eSmrg  shlibpath_overrides_runpath=no
6276e07dc26bSmrg
6277636c353eSmrg  # Some binutils ld are patched to set DT_RUNPATH
6278636c353eSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
6279636c353eSmrg    [lt_cv_shlibpath_overrides_runpath=no
6280636c353eSmrg    save_LDFLAGS=$LDFLAGS
6281636c353eSmrg    save_libdir=$libdir
6282636c353eSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
6283636c353eSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
6284636c353eSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
6285636c353eSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
6286636c353eSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
6287636c353eSmrg    LDFLAGS=$save_LDFLAGS
6288636c353eSmrg    libdir=$save_libdir
6289636c353eSmrg    ])
6290636c353eSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
6291e07dc26bSmrg
6292636c353eSmrg  # This implies no fast_install, which is unacceptable.
6293636c353eSmrg  # Some rework will be needed to allow for fast_install
6294636c353eSmrg  # before this can be enabled.
6295636c353eSmrg  hardcode_into_libs=yes
6296e07dc26bSmrg
6297636c353eSmrg  # Ideally, we could use ldconfig to report *all* directores which are
6298636c353eSmrg  # searched for libraries, however this is still not possible.  Aside from not
6299636c353eSmrg  # being certain /sbin/ldconfig is available, command
6300636c353eSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
6301636c353eSmrg  # even though it is searched at run-time.  Try to do the best guess by
6302636c353eSmrg  # appending ld.so.conf contents (and includes) to the search path.
6303636c353eSmrg  if test -f /etc/ld.so.conf; then
6304636c353eSmrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
6305636c353eSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
6306636c353eSmrg  fi
6307e07dc26bSmrg
6308636c353eSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
6309636c353eSmrg  # powerpc, because MkLinux only supported shared libraries with the
6310636c353eSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
6311636c353eSmrg  # most powerpc-linux boxes support dynamic linking these days and
6312636c353eSmrg  # people can always --disable-shared, the test was removed, and we
6313636c353eSmrg  # assume the GNU/Linux dynamic linker is in use.
6314636c353eSmrg  dynamic_linker='GNU/Linux ld.so'
6315636c353eSmrg  ;;
6316e07dc26bSmrg
6317636c353eSmrgnetbsd*)
6318636c353eSmrg  version_type=sunos
6319636c353eSmrg  need_lib_prefix=no
6320636c353eSmrg  need_version=no
6321636c353eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6322636c353eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6323636c353eSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6324636c353eSmrg    dynamic_linker='NetBSD (a.out) ld.so'
6325636c353eSmrg  else
6326636c353eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6327636c353eSmrg    soname_spec='$libname$release$shared_ext$major'
6328636c353eSmrg    dynamic_linker='NetBSD ld.elf_so'
6329636c353eSmrg  fi
6330636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6331636c353eSmrg  shlibpath_overrides_runpath=yes
6332636c353eSmrg  hardcode_into_libs=yes
6333636c353eSmrg  ;;
6334e07dc26bSmrg
6335636c353eSmrgnewsos6)
6336636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6337636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6338636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6339636c353eSmrg  shlibpath_overrides_runpath=yes
6340636c353eSmrg  ;;
6341e07dc26bSmrg
6342636c353eSmrg*nto* | *qnx*)
6343636c353eSmrg  version_type=qnx
6344636c353eSmrg  need_lib_prefix=no
6345636c353eSmrg  need_version=no
6346636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6347636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6348636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6349636c353eSmrg  shlibpath_overrides_runpath=no
6350636c353eSmrg  hardcode_into_libs=yes
6351636c353eSmrg  dynamic_linker='ldqnx.so'
6352636c353eSmrg  ;;
6353e07dc26bSmrg
6354636c353eSmrgopenbsd* | bitrig*)
6355636c353eSmrg  version_type=sunos
6356636c353eSmrg  sys_lib_dlsearch_path_spec=/usr/lib
6357636c353eSmrg  need_lib_prefix=no
6358636c353eSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
6359636c353eSmrg    need_version=no
6360636c353eSmrg  else
6361636c353eSmrg    need_version=yes
6362636c353eSmrg  fi
6363636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6364636c353eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6365636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6366636c353eSmrg  shlibpath_overrides_runpath=yes
6367636c353eSmrg  ;;
6368e07dc26bSmrg
6369636c353eSmrgos2*)
6370636c353eSmrg  libname_spec='$name'
6371636c353eSmrg  version_type=windows
6372636c353eSmrg  shrext_cmds=.dll
6373636c353eSmrg  need_version=no
6374636c353eSmrg  need_lib_prefix=no
6375636c353eSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
6376636c353eSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
6377636c353eSmrg    v=$($ECHO $release$versuffix | tr -d .-);
6378636c353eSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
6379636c353eSmrg    $ECHO $n$v`$shared_ext'
6380636c353eSmrg  library_names_spec='${libname}_dll.$libext'
6381636c353eSmrg  dynamic_linker='OS/2 ld.exe'
6382636c353eSmrg  shlibpath_var=BEGINLIBPATH
6383636c353eSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6384636c353eSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6385636c353eSmrg  postinstall_cmds='base_file=`basename \$file`~
6386636c353eSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
6387636c353eSmrg    dldir=$destdir/`dirname \$dlpath`~
6388636c353eSmrg    test -d \$dldir || mkdir -p \$dldir~
6389636c353eSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
6390636c353eSmrg    chmod a+x \$dldir/$dlname~
6391636c353eSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
6392636c353eSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
6393636c353eSmrg    fi'
6394636c353eSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
6395636c353eSmrg    dlpath=$dir/\$dldll~
6396636c353eSmrg    $RM \$dlpath'
6397636c353eSmrg  ;;
6398e07dc26bSmrg
6399636c353eSmrgosf3* | osf4* | osf5*)
6400636c353eSmrg  version_type=osf
6401636c353eSmrg  need_lib_prefix=no
6402636c353eSmrg  need_version=no
6403636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6404636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6405636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6406636c353eSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6407636c353eSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6408636c353eSmrg  ;;
6409e07dc26bSmrg
6410636c353eSmrgrdos*)
6411636c353eSmrg  dynamic_linker=no
6412636c353eSmrg  ;;
6413e07dc26bSmrg
6414636c353eSmrgsolaris*)
6415636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6416636c353eSmrg  need_lib_prefix=no
6417636c353eSmrg  need_version=no
6418636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6419636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6420636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6421636c353eSmrg  shlibpath_overrides_runpath=yes
6422636c353eSmrg  hardcode_into_libs=yes
6423636c353eSmrg  # ldd complains unless libraries are executable
6424636c353eSmrg  postinstall_cmds='chmod +x $lib'
6425636c353eSmrg  ;;
6426e07dc26bSmrg
6427636c353eSmrgsunos4*)
6428636c353eSmrg  version_type=sunos
6429636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6430636c353eSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6431636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6432636c353eSmrg  shlibpath_overrides_runpath=yes
6433636c353eSmrg  if test yes = "$with_gnu_ld"; then
6434636c353eSmrg    need_lib_prefix=no
6435636c353eSmrg  fi
6436636c353eSmrg  need_version=yes
6437636c353eSmrg  ;;
6438e07dc26bSmrg
6439636c353eSmrgsysv4 | sysv4.3*)
6440636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6441636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6442636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6443636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6444636c353eSmrg  case $host_vendor in
6445636c353eSmrg    sni)
6446636c353eSmrg      shlibpath_overrides_runpath=no
6447636c353eSmrg      need_lib_prefix=no
6448636c353eSmrg      runpath_var=LD_RUN_PATH
6449e07dc26bSmrg      ;;
6450636c353eSmrg    siemens)
6451636c353eSmrg      need_lib_prefix=no
6452e07dc26bSmrg      ;;
6453636c353eSmrg    motorola)
6454636c353eSmrg      need_lib_prefix=no
6455636c353eSmrg      need_version=no
6456636c353eSmrg      shlibpath_overrides_runpath=no
6457636c353eSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6458636c353eSmrg      ;;
6459636c353eSmrg  esac
6460636c353eSmrg  ;;
6461e07dc26bSmrg
6462636c353eSmrgsysv4*MP*)
6463636c353eSmrg  if test -d /usr/nec; then
6464636c353eSmrg    version_type=linux # correct to gnu/linux during the next big refactor
6465636c353eSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
6466636c353eSmrg    soname_spec='$libname$shared_ext.$major'
6467636c353eSmrg    shlibpath_var=LD_LIBRARY_PATH
6468636c353eSmrg  fi
6469636c353eSmrg  ;;
6470e07dc26bSmrg
6471636c353eSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
6472636c353eSmrg  version_type=sco
6473636c353eSmrg  need_lib_prefix=no
6474636c353eSmrg  need_version=no
6475636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
6476636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6477636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6478636c353eSmrg  shlibpath_overrides_runpath=yes
6479636c353eSmrg  hardcode_into_libs=yes
6480636c353eSmrg  if test yes = "$with_gnu_ld"; then
6481636c353eSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
6482636c353eSmrg  else
6483636c353eSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
6484636c353eSmrg    case $host_os in
6485636c353eSmrg      sco3.2v5*)
6486636c353eSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
6487636c353eSmrg	;;
6488e07dc26bSmrg    esac
6489636c353eSmrg  fi
6490636c353eSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
6491636c353eSmrg  ;;
6492e07dc26bSmrg
6493636c353eSmrgtpf*)
6494636c353eSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
6495636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6496636c353eSmrg  need_lib_prefix=no
6497636c353eSmrg  need_version=no
6498636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6499636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6500636c353eSmrg  shlibpath_overrides_runpath=no
6501636c353eSmrg  hardcode_into_libs=yes
6502636c353eSmrg  ;;
6503e07dc26bSmrg
6504636c353eSmrguts4*)
6505636c353eSmrg  version_type=linux # correct to gnu/linux during the next big refactor
6506636c353eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6507636c353eSmrg  soname_spec='$libname$release$shared_ext$major'
6508636c353eSmrg  shlibpath_var=LD_LIBRARY_PATH
6509636c353eSmrg  ;;
6510e07dc26bSmrg
6511636c353eSmrg*)
6512636c353eSmrg  dynamic_linker=no
6513636c353eSmrg  ;;
6514636c353eSmrgesac
6515636c353eSmrgAC_MSG_RESULT([$dynamic_linker])
6516636c353eSmrgtest no = "$dynamic_linker" && can_build_shared=no
6517e07dc26bSmrg
6518636c353eSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6519636c353eSmrgif test yes = "$GCC"; then
6520636c353eSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6521636c353eSmrgfi
6522e07dc26bSmrg
6523636c353eSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
6524636c353eSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
6525636c353eSmrgfi
6526e07dc26bSmrg
6527636c353eSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
6528636c353eSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
6529636c353eSmrgfi
6530e07dc26bSmrg
6531636c353eSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
6532636c353eSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
6533e07dc26bSmrg
6534636c353eSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
6535636c353eSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
6536e07dc26bSmrg
6537636c353eSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
6538636c353eSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
6539e07dc26bSmrg
6540636c353eSmrg_LT_DECL([], [variables_saved_for_relink], [1],
6541636c353eSmrg    [Variables whose values should be saved in libtool wrapper scripts and
6542636c353eSmrg    restored at link time])
6543636c353eSmrg_LT_DECL([], [need_lib_prefix], [0],
6544636c353eSmrg    [Do we need the "lib" prefix for modules?])
6545636c353eSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
6546636c353eSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
6547636c353eSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
6548636c353eSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
6549636c353eSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
6550636c353eSmrg    [Is shlibpath searched before the hard-coded library search path?])
6551636c353eSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
6552636c353eSmrg_LT_DECL([], [library_names_spec], [1],
6553636c353eSmrg    [[List of archive names.  First name is the real one, the rest are links.
6554636c353eSmrg    The last name is the one that the linker finds with -lNAME]])
6555636c353eSmrg_LT_DECL([], [soname_spec], [1],
6556636c353eSmrg    [[The coded name of the library, if different from the real name]])
6557636c353eSmrg_LT_DECL([], [install_override_mode], [1],
6558636c353eSmrg    [Permission mode override for installation of shared libraries])
6559636c353eSmrg_LT_DECL([], [postinstall_cmds], [2],
6560636c353eSmrg    [Command to use after installation of a shared archive])
6561636c353eSmrg_LT_DECL([], [postuninstall_cmds], [2],
6562636c353eSmrg    [Command to use after uninstallation of a shared archive])
6563636c353eSmrg_LT_DECL([], [finish_cmds], [2],
6564636c353eSmrg    [Commands used to finish a libtool library installation in a directory])
6565636c353eSmrg_LT_DECL([], [finish_eval], [1],
6566636c353eSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
6567636c353eSmrg    not shown]])
6568636c353eSmrg_LT_DECL([], [hardcode_into_libs], [0],
6569636c353eSmrg    [Whether we should hardcode library paths into libraries])
6570636c353eSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
6571636c353eSmrg    [Compile-time system search path for libraries])
6572636c353eSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
6573636c353eSmrg    [Detected run-time system search path for libraries])
6574636c353eSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
6575636c353eSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
6576636c353eSmrg])# _LT_SYS_DYNAMIC_LINKER
6577e07dc26bSmrg
6578e07dc26bSmrg
6579636c353eSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
6580636c353eSmrg# --------------------------
6581636c353eSmrg# find a file program that can recognize shared library
6582636c353eSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
6583636c353eSmrg[m4_require([_LT_DECL_EGREP])dnl
6584636c353eSmrgAC_MSG_CHECKING([for $1])
6585636c353eSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
6586636c353eSmrg[case $MAGIC_CMD in
6587636c353eSmrg[[\\/*] |  ?:[\\/]*])
6588636c353eSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
6589636c353eSmrg  ;;
6590636c353eSmrg*)
6591636c353eSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
6592636c353eSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6593636c353eSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
6594636c353eSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
6595636c353eSmrgdnl not every word.  This closes a longstanding sh security hole.
6596636c353eSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
6597636c353eSmrg  for ac_dir in $ac_dummy; do
6598636c353eSmrg    IFS=$lt_save_ifs
6599636c353eSmrg    test -z "$ac_dir" && ac_dir=.
6600636c353eSmrg    if test -f "$ac_dir/$1"; then
6601636c353eSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
6602636c353eSmrg      if test -n "$file_magic_test_file"; then
6603636c353eSmrg	case $deplibs_check_method in
6604636c353eSmrg	"file_magic "*)
6605636c353eSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
6606636c353eSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
6607636c353eSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
6608636c353eSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
6609636c353eSmrg	    :
6610636c353eSmrg	  else
6611636c353eSmrg	    cat <<_LT_EOF 1>&2
6612e07dc26bSmrg
6613636c353eSmrg*** Warning: the command libtool uses to detect shared libraries,
6614636c353eSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
6615636c353eSmrg*** The result is that libtool may fail to recognize shared libraries
6616636c353eSmrg*** as such.  This will affect the creation of libtool libraries that
6617636c353eSmrg*** depend on shared libraries, but programs linked with such libtool
6618636c353eSmrg*** libraries will work regardless of this problem.  Nevertheless, you
6619636c353eSmrg*** may want to report the problem to your system manager and/or to
6620636c353eSmrg*** bug-libtool@gnu.org
6621e07dc26bSmrg
6622636c353eSmrg_LT_EOF
6623636c353eSmrg	  fi ;;
6624636c353eSmrg	esac
6625636c353eSmrg      fi
6626636c353eSmrg      break
6627636c353eSmrg    fi
6628636c353eSmrg  done
6629636c353eSmrg  IFS=$lt_save_ifs
6630636c353eSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
6631636c353eSmrg  ;;
6632636c353eSmrgesac])
6633636c353eSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
6634636c353eSmrgif test -n "$MAGIC_CMD"; then
6635636c353eSmrg  AC_MSG_RESULT($MAGIC_CMD)
6636636c353eSmrgelse
6637636c353eSmrg  AC_MSG_RESULT(no)
6638636c353eSmrgfi
6639636c353eSmrg_LT_DECL([], [MAGIC_CMD], [0],
6640636c353eSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
6641636c353eSmrg])# _LT_PATH_TOOL_PREFIX
6642e07dc26bSmrg
6643636c353eSmrg# Old name:
6644636c353eSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
6645636c353eSmrgdnl aclocal-1.4 backwards compatibility:
6646636c353eSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
6647e07dc26bSmrg
6648e07dc26bSmrg
6649636c353eSmrg# _LT_PATH_MAGIC
6650636c353eSmrg# --------------
6651636c353eSmrg# find a file program that can recognize a shared library
6652636c353eSmrgm4_defun([_LT_PATH_MAGIC],
6653636c353eSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
6654636c353eSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
6655636c353eSmrg  if test -n "$ac_tool_prefix"; then
6656636c353eSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
6657636c353eSmrg  else
6658636c353eSmrg    MAGIC_CMD=:
6659636c353eSmrg  fi
6660636c353eSmrgfi
6661636c353eSmrg])# _LT_PATH_MAGIC
6662e07dc26bSmrg
6663e07dc26bSmrg
6664636c353eSmrg# LT_PATH_LD
6665636c353eSmrg# ----------
6666636c353eSmrg# find the pathname to the GNU or non-GNU linker
6667636c353eSmrgAC_DEFUN([LT_PATH_LD],
6668636c353eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
6669636c353eSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
6670636c353eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
6671636c353eSmrgm4_require([_LT_DECL_SED])dnl
6672636c353eSmrgm4_require([_LT_DECL_EGREP])dnl
6673636c353eSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
6674e07dc26bSmrg
6675636c353eSmrgAC_ARG_WITH([gnu-ld],
6676636c353eSmrg    [AS_HELP_STRING([--with-gnu-ld],
6677636c353eSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
6678636c353eSmrg    [test no = "$withval" || with_gnu_ld=yes],
6679636c353eSmrg    [with_gnu_ld=no])dnl
6680e07dc26bSmrg
6681636c353eSmrgac_prog=ld
6682636c353eSmrgif test yes = "$GCC"; then
6683636c353eSmrg  # Check if gcc -print-prog-name=ld gives a path.
6684636c353eSmrg  AC_MSG_CHECKING([for ld used by $CC])
6685636c353eSmrg  case $host in
6686636c353eSmrg  *-*-mingw*)
6687636c353eSmrg    # gcc leaves a trailing carriage return, which upsets mingw
6688636c353eSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6689636c353eSmrg  *)
6690636c353eSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6691636c353eSmrg  esac
6692636c353eSmrg  case $ac_prog in
6693636c353eSmrg    # Accept absolute paths.
6694636c353eSmrg    [[\\/]]* | ?:[[\\/]]*)
6695636c353eSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
6696636c353eSmrg      # Canonicalize the pathname of ld
6697636c353eSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
6698636c353eSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
6699636c353eSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
6700636c353eSmrg      done
6701636c353eSmrg      test -z "$LD" && LD=$ac_prog
6702636c353eSmrg      ;;
6703636c353eSmrg  "")
6704636c353eSmrg    # If it fails, then pretend we aren't using GCC.
6705636c353eSmrg    ac_prog=ld
6706636c353eSmrg    ;;
6707636c353eSmrg  *)
6708636c353eSmrg    # If it is relative, then search for the first ld in PATH.
6709636c353eSmrg    with_gnu_ld=unknown
6710636c353eSmrg    ;;
6711636c353eSmrg  esac
6712636c353eSmrgelif test yes = "$with_gnu_ld"; then
6713636c353eSmrg  AC_MSG_CHECKING([for GNU ld])
6714636c353eSmrgelse
6715636c353eSmrg  AC_MSG_CHECKING([for non-GNU ld])
6716636c353eSmrgfi
6717636c353eSmrgAC_CACHE_VAL(lt_cv_path_LD,
6718636c353eSmrg[if test -z "$LD"; then
6719636c353eSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
6720636c353eSmrg  for ac_dir in $PATH; do
6721636c353eSmrg    IFS=$lt_save_ifs
6722636c353eSmrg    test -z "$ac_dir" && ac_dir=.
6723636c353eSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6724636c353eSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
6725636c353eSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
6726636c353eSmrg      # but apparently some variants of GNU ld only accept -v.
6727636c353eSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
6728636c353eSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
6729636c353eSmrg      *GNU* | *'with BFD'*)
6730636c353eSmrg	test no != "$with_gnu_ld" && break
6731636c353eSmrg	;;
6732636c353eSmrg      *)
6733636c353eSmrg	test yes != "$with_gnu_ld" && break
6734636c353eSmrg	;;
6735636c353eSmrg      esac
6736636c353eSmrg    fi
6737e07dc26bSmrg  done
6738636c353eSmrg  IFS=$lt_save_ifs
6739e07dc26bSmrgelse
6740636c353eSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
6741636c353eSmrgfi])
6742636c353eSmrgLD=$lt_cv_path_LD
6743636c353eSmrgif test -n "$LD"; then
6744636c353eSmrg  AC_MSG_RESULT($LD)
6745636c353eSmrgelse
6746636c353eSmrg  AC_MSG_RESULT(no)
6747e07dc26bSmrgfi
6748636c353eSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
6749636c353eSmrg_LT_PATH_LD_GNU
6750636c353eSmrgAC_SUBST([LD])
6751e07dc26bSmrg
6752636c353eSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
6753636c353eSmrg])# LT_PATH_LD
6754e07dc26bSmrg
6755636c353eSmrg# Old names:
6756636c353eSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
6757636c353eSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
6758636c353eSmrgdnl aclocal-1.4 backwards compatibility:
6759636c353eSmrgdnl AC_DEFUN([AM_PROG_LD], [])
6760636c353eSmrgdnl AC_DEFUN([AC_PROG_LD], [])
6761636c353eSmrg
6762636c353eSmrg
6763636c353eSmrg# _LT_PATH_LD_GNU
6764636c353eSmrg#- --------------
6765636c353eSmrgm4_defun([_LT_PATH_LD_GNU],
6766636c353eSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
6767636c353eSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
6768636c353eSmrgcase `$LD -v 2>&1 </dev/null` in
6769636c353eSmrg*GNU* | *'with BFD'*)
6770636c353eSmrg  lt_cv_prog_gnu_ld=yes
6771e07dc26bSmrg  ;;
6772636c353eSmrg*)
6773636c353eSmrg  lt_cv_prog_gnu_ld=no
6774636c353eSmrg  ;;
6775636c353eSmrgesac])
6776636c353eSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
6777636c353eSmrg])# _LT_PATH_LD_GNU
6778e07dc26bSmrg
6779636c353eSmrg
6780636c353eSmrg# _LT_CMD_RELOAD
6781636c353eSmrg# --------------
6782636c353eSmrg# find reload flag for linker
6783636c353eSmrg#   -- PORTME Some linkers may need a different reload flag.
6784636c353eSmrgm4_defun([_LT_CMD_RELOAD],
6785636c353eSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
6786636c353eSmrg  lt_cv_ld_reload_flag,
6787636c353eSmrg  [lt_cv_ld_reload_flag='-r'])
6788636c353eSmrgreload_flag=$lt_cv_ld_reload_flag
6789636c353eSmrgcase $reload_flag in
6790636c353eSmrg"" | " "*) ;;
6791636c353eSmrg*) reload_flag=" $reload_flag" ;;
6792e07dc26bSmrgesac
6793636c353eSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
6794636c353eSmrgcase $host_os in
6795636c353eSmrg  cygwin* | mingw* | pw32* | cegcc*)
6796636c353eSmrg    if test yes != "$GCC"; then
6797636c353eSmrg      reload_cmds=false
6798636c353eSmrg    fi
6799636c353eSmrg    ;;
6800636c353eSmrg  darwin*)
6801636c353eSmrg    if test yes = "$GCC"; then
6802636c353eSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
6803636c353eSmrg    else
6804636c353eSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
6805636c353eSmrg    fi
6806636c353eSmrg    ;;
6807636c353eSmrgesac
6808636c353eSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
6809636c353eSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
6810636c353eSmrg])# _LT_CMD_RELOAD
6811e07dc26bSmrg
6812e07dc26bSmrg
6813636c353eSmrg# _LT_PATH_DD
6814636c353eSmrg# -----------
6815636c353eSmrg# find a working dd
6816636c353eSmrgm4_defun([_LT_PATH_DD],
6817636c353eSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
6818636c353eSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
6819636c353eSmrgcat conftest.i conftest.i >conftest2.i
6820636c353eSmrg: ${lt_DD:=$DD}
6821636c353eSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
6822636c353eSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6823636c353eSmrg  cmp -s conftest.i conftest.out \
6824636c353eSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6825636c353eSmrgfi])
6826636c353eSmrgrm -f conftest.i conftest2.i conftest.out])
6827636c353eSmrg])# _LT_PATH_DD
6828636c353eSmrg
6829636c353eSmrg
6830636c353eSmrg# _LT_CMD_TRUNCATE
6831636c353eSmrg# ----------------
6832636c353eSmrg# find command to truncate a binary pipe
6833636c353eSmrgm4_defun([_LT_CMD_TRUNCATE],
6834636c353eSmrg[m4_require([_LT_PATH_DD])
6835636c353eSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
6836636c353eSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
6837636c353eSmrgcat conftest.i conftest.i >conftest2.i
6838636c353eSmrglt_cv_truncate_bin=
6839636c353eSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6840636c353eSmrg  cmp -s conftest.i conftest.out \
6841636c353eSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6842e07dc26bSmrgfi
6843636c353eSmrgrm -f conftest.i conftest2.i conftest.out
6844636c353eSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
6845636c353eSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
6846636c353eSmrg  [Command to truncate a binary pipe])
6847636c353eSmrg])# _LT_CMD_TRUNCATE
6848e07dc26bSmrg
6849e07dc26bSmrg
6850636c353eSmrg# _LT_CHECK_MAGIC_METHOD
6851636c353eSmrg# ----------------------
6852636c353eSmrg# how to check for library dependencies
6853636c353eSmrg#  -- PORTME fill in with the dynamic library characteristics
6854636c353eSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
6855636c353eSmrg[m4_require([_LT_DECL_EGREP])
6856636c353eSmrgm4_require([_LT_DECL_OBJDUMP])
6857636c353eSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
6858636c353eSmrglt_cv_deplibs_check_method,
6859636c353eSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
6860636c353eSmrglt_cv_file_magic_test_file=
6861636c353eSmrglt_cv_deplibs_check_method='unknown'
6862636c353eSmrg# Need to set the preceding variable on all platforms that support
6863636c353eSmrg# interlibrary dependencies.
6864636c353eSmrg# 'none' -- dependencies not supported.
6865636c353eSmrg# 'unknown' -- same as none, but documents that we really don't know.
6866636c353eSmrg# 'pass_all' -- all dependencies passed with no checks.
6867636c353eSmrg# 'test_compile' -- check by making test program.
6868636c353eSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
6869636c353eSmrg# that responds to the $file_magic_cmd with a given extended regex.
6870636c353eSmrg# If you have 'file' or equivalent on your system and you're not sure
6871636c353eSmrg# whether 'pass_all' will *always* work, you probably want this one.
6872e07dc26bSmrg
6873636c353eSmrgcase $host_os in
6874636c353eSmrgaix[[4-9]]*)
6875636c353eSmrg  lt_cv_deplibs_check_method=pass_all
6876636c353eSmrg  ;;
6877e07dc26bSmrg
6878636c353eSmrgbeos*)
6879636c353eSmrg  lt_cv_deplibs_check_method=pass_all
6880636c353eSmrg  ;;
6881e07dc26bSmrg
6882636c353eSmrgbsdi[[45]]*)
6883636c353eSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
6884636c353eSmrg  lt_cv_file_magic_cmd='$FILECMD -L'
6885636c353eSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
6886636c353eSmrg  ;;
6887e07dc26bSmrg
6888636c353eSmrgcygwin*)
6889636c353eSmrg  # func_win32_libid is a shell function defined in ltmain.sh
6890636c353eSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6891636c353eSmrg  lt_cv_file_magic_cmd='func_win32_libid'
6892636c353eSmrg  ;;
6893e07dc26bSmrg
6894636c353eSmrgmingw* | pw32*)
6895636c353eSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
6896636c353eSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
6897636c353eSmrg  # unless we find 'file', for example because we are cross-compiling.
6898636c353eSmrg  if ( file / ) >/dev/null 2>&1; then
6899636c353eSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
6900636c353eSmrg    lt_cv_file_magic_cmd='func_win32_libid'
6901636c353eSmrg  else
6902636c353eSmrg    # Keep this pattern in sync with the one in func_win32_libid.
6903636c353eSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
6904636c353eSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
6905636c353eSmrg  fi
6906636c353eSmrg  ;;
6907e07dc26bSmrg
6908636c353eSmrgcegcc*)
6909636c353eSmrg  # use the weaker test based on 'objdump'. See mingw*.
6910636c353eSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
6911636c353eSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
6912636c353eSmrg  ;;
6913e07dc26bSmrg
6914636c353eSmrgdarwin* | rhapsody*)
6915636c353eSmrg  lt_cv_deplibs_check_method=pass_all
6916636c353eSmrg  ;;
6917e07dc26bSmrg
6918636c353eSmrgfreebsd* | dragonfly* | midnightbsd*)
6919636c353eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6920636c353eSmrg    case $host_cpu in
6921636c353eSmrg    i*86 )
6922636c353eSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
6923636c353eSmrg      # Let's accept both of them until this is cleared up.
6924636c353eSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
6925636c353eSmrg      lt_cv_file_magic_cmd=$FILECMD
6926636c353eSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
6927636c353eSmrg      ;;
6928e07dc26bSmrg    esac
6929636c353eSmrg  else
6930636c353eSmrg    lt_cv_deplibs_check_method=pass_all
6931636c353eSmrg  fi
6932636c353eSmrg  ;;
6933e07dc26bSmrg
6934636c353eSmrghaiku*)
6935636c353eSmrg  lt_cv_deplibs_check_method=pass_all
6936636c353eSmrg  ;;
6937e07dc26bSmrg
6938636c353eSmrghpux10.20* | hpux11*)
6939636c353eSmrg  lt_cv_file_magic_cmd=$FILECMD
6940636c353eSmrg  case $host_cpu in
6941636c353eSmrg  ia64*)
6942636c353eSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
6943636c353eSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
6944636c353eSmrg    ;;
6945636c353eSmrg  hppa*64*)
6946636c353eSmrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
6947636c353eSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
6948636c353eSmrg    ;;
6949636c353eSmrg  *)
6950636c353eSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
6951636c353eSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
6952636c353eSmrg    ;;
6953636c353eSmrg  esac
6954636c353eSmrg  ;;
6955e07dc26bSmrg
6956636c353eSmrginterix[[3-9]]*)
6957636c353eSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
6958636c353eSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
6959636c353eSmrg  ;;
6960e07dc26bSmrg
6961636c353eSmrgirix5* | irix6* | nonstopux*)
6962636c353eSmrg  case $LD in
6963636c353eSmrg  *-32|*"-32 ") libmagic=32-bit;;
6964636c353eSmrg  *-n32|*"-n32 ") libmagic=N32;;
6965636c353eSmrg  *-64|*"-64 ") libmagic=64-bit;;
6966636c353eSmrg  *) libmagic=never-match;;
6967636c353eSmrg  esac
6968636c353eSmrg  lt_cv_deplibs_check_method=pass_all
6969636c353eSmrg  ;;
6970e07dc26bSmrg
6971636c353eSmrg# This must be glibc/ELF.
6972636c353eSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6973636c353eSmrg  lt_cv_deplibs_check_method=pass_all
6974636c353eSmrg  ;;
6975e07dc26bSmrg
6976636c353eSmrgnetbsd*)
6977636c353eSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
6978636c353eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
6979636c353eSmrg  else
6980636c353eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
6981636c353eSmrg  fi
6982636c353eSmrg  ;;
6983e07dc26bSmrg
6984636c353eSmrgnewos6*)
6985636c353eSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
6986636c353eSmrg  lt_cv_file_magic_cmd=$FILECMD
6987636c353eSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
6988636c353eSmrg  ;;
6989e07dc26bSmrg
6990636c353eSmrg*nto* | *qnx*)
6991636c353eSmrg  lt_cv_deplibs_check_method=pass_all
6992636c353eSmrg  ;;
6993e07dc26bSmrg
6994636c353eSmrgopenbsd* | bitrig*)
6995636c353eSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
6996636c353eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
6997636c353eSmrg  else
6998636c353eSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
6999636c353eSmrg  fi
7000636c353eSmrg  ;;
7001e07dc26bSmrg
7002636c353eSmrgosf3* | osf4* | osf5*)
7003636c353eSmrg  lt_cv_deplibs_check_method=pass_all
7004636c353eSmrg  ;;
7005e07dc26bSmrg
7006636c353eSmrgrdos*)
7007636c353eSmrg  lt_cv_deplibs_check_method=pass_all
7008636c353eSmrg  ;;
7009e07dc26bSmrg
7010636c353eSmrgsolaris*)
7011636c353eSmrg  lt_cv_deplibs_check_method=pass_all
7012636c353eSmrg  ;;
7013e07dc26bSmrg
7014636c353eSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
7015636c353eSmrg  lt_cv_deplibs_check_method=pass_all
7016636c353eSmrg  ;;
7017e07dc26bSmrg
7018636c353eSmrgsysv4 | sysv4.3*)
7019636c353eSmrg  case $host_vendor in
7020636c353eSmrg  motorola)
7021636c353eSmrg    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]]'
7022636c353eSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
7023636c353eSmrg    ;;
7024636c353eSmrg  ncr)
7025636c353eSmrg    lt_cv_deplibs_check_method=pass_all
7026636c353eSmrg    ;;
7027636c353eSmrg  sequent)
7028636c353eSmrg    lt_cv_file_magic_cmd='/bin/file'
7029636c353eSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
7030636c353eSmrg    ;;
7031636c353eSmrg  sni)
7032636c353eSmrg    lt_cv_file_magic_cmd='/bin/file'
7033636c353eSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
7034636c353eSmrg    lt_cv_file_magic_test_file=/lib/libc.so
7035636c353eSmrg    ;;
7036636c353eSmrg  siemens)
7037636c353eSmrg    lt_cv_deplibs_check_method=pass_all
7038636c353eSmrg    ;;
7039636c353eSmrg  pc)
7040636c353eSmrg    lt_cv_deplibs_check_method=pass_all
7041636c353eSmrg    ;;
7042636c353eSmrg  esac
7043636c353eSmrg  ;;
7044e07dc26bSmrg
7045636c353eSmrgtpf*)
7046636c353eSmrg  lt_cv_deplibs_check_method=pass_all
7047636c353eSmrg  ;;
7048636c353eSmrgos2*)
7049636c353eSmrg  lt_cv_deplibs_check_method=pass_all
7050636c353eSmrg  ;;
7051636c353eSmrgesac
7052636c353eSmrg])
7053e07dc26bSmrg
7054636c353eSmrgfile_magic_glob=
7055636c353eSmrgwant_nocaseglob=no
7056636c353eSmrgif test "$build" = "$host"; then
7057636c353eSmrg  case $host_os in
7058636c353eSmrg  mingw* | pw32*)
7059636c353eSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
7060636c353eSmrg      want_nocaseglob=yes
7061636c353eSmrg    else
7062636c353eSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
7063636c353eSmrg    fi
7064636c353eSmrg    ;;
7065636c353eSmrg  esac
7066636c353eSmrgfi
7067e07dc26bSmrg
7068636c353eSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
7069636c353eSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
7070636c353eSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
7071e07dc26bSmrg
7072636c353eSmrg_LT_DECL([], [deplibs_check_method], [1],
7073636c353eSmrg    [Method to check whether dependent libraries are shared objects])
7074636c353eSmrg_LT_DECL([], [file_magic_cmd], [1],
7075636c353eSmrg    [Command to use when deplibs_check_method = "file_magic"])
7076636c353eSmrg_LT_DECL([], [file_magic_glob], [1],
7077636c353eSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
7078636c353eSmrg_LT_DECL([], [want_nocaseglob], [1],
7079636c353eSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
7080636c353eSmrg])# _LT_CHECK_MAGIC_METHOD
7081e07dc26bSmrg
7082e07dc26bSmrg
7083636c353eSmrg# LT_PATH_NM
7084636c353eSmrg# ----------
7085636c353eSmrg# find the pathname to a BSD- or MS-compatible name lister
7086636c353eSmrgAC_DEFUN([LT_PATH_NM],
7087636c353eSmrg[AC_REQUIRE([AC_PROG_CC])dnl
7088636c353eSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
7089636c353eSmrg[if test -n "$NM"; then
7090636c353eSmrg  # Let the user override the test.
7091636c353eSmrg  lt_cv_path_NM=$NM
7092636c353eSmrgelse
7093636c353eSmrg  lt_nm_to_check=${ac_tool_prefix}nm
7094636c353eSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
7095636c353eSmrg    lt_nm_to_check="$lt_nm_to_check nm"
7096636c353eSmrg  fi
7097636c353eSmrg  for lt_tmp_nm in $lt_nm_to_check; do
7098636c353eSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7099636c353eSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
7100636c353eSmrg      IFS=$lt_save_ifs
7101636c353eSmrg      test -z "$ac_dir" && ac_dir=.
7102636c353eSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
7103636c353eSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
7104636c353eSmrg	# Check to see if the nm accepts a BSD-compat flag.
7105636c353eSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
7106636c353eSmrg	#   nm: unknown option "B" ignored
7107636c353eSmrg	# Tru64's nm complains that /dev/null is an invalid object file
7108636c353eSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
7109636c353eSmrg	case $build_os in
7110636c353eSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
7111636c353eSmrg	*) lt_bad_file=/dev/null ;;
7112636c353eSmrg	esac
7113636c353eSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
7114636c353eSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
7115636c353eSmrg	  lt_cv_path_NM="$tmp_nm -B"
7116636c353eSmrg	  break 2
7117636c353eSmrg	  ;;
7118636c353eSmrg	*)
7119636c353eSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
7120636c353eSmrg	  */dev/null*)
7121636c353eSmrg	    lt_cv_path_NM="$tmp_nm -p"
7122636c353eSmrg	    break 2
7123636c353eSmrg	    ;;
7124636c353eSmrg	  *)
7125636c353eSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7126636c353eSmrg	    continue # so that we can try to find one that supports BSD flags
7127636c353eSmrg	    ;;
7128e07dc26bSmrg	  esac
7129636c353eSmrg	  ;;
7130636c353eSmrg	esac
7131636c353eSmrg      fi
7132636c353eSmrg    done
7133636c353eSmrg    IFS=$lt_save_ifs
7134636c353eSmrg  done
7135636c353eSmrg  : ${lt_cv_path_NM=no}
7136636c353eSmrgfi])
7137636c353eSmrgif test no != "$lt_cv_path_NM"; then
7138636c353eSmrg  NM=$lt_cv_path_NM
7139636c353eSmrgelse
7140636c353eSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
7141636c353eSmrg  if test -n "$DUMPBIN"; then :
7142636c353eSmrg    # Let the user override the test.
7143636c353eSmrg  else
7144636c353eSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
7145636c353eSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
7146636c353eSmrg    *COFF*)
7147636c353eSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
7148636c353eSmrg      ;;
7149636c353eSmrg    *)
7150636c353eSmrg      DUMPBIN=:
7151636c353eSmrg      ;;
7152e07dc26bSmrg    esac
7153636c353eSmrg  fi
7154636c353eSmrg  AC_SUBST([DUMPBIN])
7155636c353eSmrg  if test : != "$DUMPBIN"; then
7156636c353eSmrg    NM=$DUMPBIN
7157636c353eSmrg  fi
7158636c353eSmrgfi
7159636c353eSmrgtest -z "$NM" && NM=nm
7160636c353eSmrgAC_SUBST([NM])
7161636c353eSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
7162e07dc26bSmrg
7163636c353eSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
7164636c353eSmrg  [lt_cv_nm_interface="BSD nm"
7165636c353eSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
7166636c353eSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
7167636c353eSmrg  (eval "$ac_compile" 2>conftest.err)
7168636c353eSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7169636c353eSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
7170636c353eSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
7171636c353eSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7172636c353eSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
7173636c353eSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
7174636c353eSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
7175636c353eSmrg    lt_cv_nm_interface="MS dumpbin"
7176636c353eSmrg  fi
7177636c353eSmrg  rm -f conftest*])
7178636c353eSmrg])# LT_PATH_NM
7179e07dc26bSmrg
7180636c353eSmrg# Old names:
7181636c353eSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
7182636c353eSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
7183636c353eSmrgdnl aclocal-1.4 backwards compatibility:
7184636c353eSmrgdnl AC_DEFUN([AM_PROG_NM], [])
7185636c353eSmrgdnl AC_DEFUN([AC_PROG_NM], [])
7186e07dc26bSmrg
7187636c353eSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7188636c353eSmrg# --------------------------------
7189636c353eSmrg# how to determine the name of the shared library
7190636c353eSmrg# associated with a specific link library.
7191636c353eSmrg#  -- PORTME fill in with the dynamic library characteristics
7192636c353eSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
7193636c353eSmrg[m4_require([_LT_DECL_EGREP])
7194636c353eSmrgm4_require([_LT_DECL_OBJDUMP])
7195636c353eSmrgm4_require([_LT_DECL_DLLTOOL])
7196636c353eSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
7197636c353eSmrglt_cv_sharedlib_from_linklib_cmd,
7198636c353eSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
7199e07dc26bSmrg
7200636c353eSmrgcase $host_os in
7201636c353eSmrgcygwin* | mingw* | pw32* | cegcc*)
7202636c353eSmrg  # two different shell functions defined in ltmain.sh;
7203636c353eSmrg  # decide which one to use based on capabilities of $DLLTOOL
7204636c353eSmrg  case `$DLLTOOL --help 2>&1` in
7205636c353eSmrg  *--identify-strict*)
7206636c353eSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
7207636c353eSmrg    ;;
7208636c353eSmrg  *)
7209636c353eSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
7210636c353eSmrg    ;;
7211636c353eSmrg  esac
7212636c353eSmrg  ;;
7213636c353eSmrg*)
7214636c353eSmrg  # fallback: assume linklib IS sharedlib
7215636c353eSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
7216636c353eSmrg  ;;
7217636c353eSmrgesac
7218636c353eSmrg])
7219636c353eSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
7220636c353eSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
7221e07dc26bSmrg
7222636c353eSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
7223636c353eSmrg    [Command to associate shared and link libraries])
7224636c353eSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7225e07dc26bSmrg
7226e07dc26bSmrg
7227636c353eSmrg# _LT_PATH_MANIFEST_TOOL
7228636c353eSmrg# ----------------------
7229636c353eSmrg# locate the manifest tool
7230636c353eSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
7231636c353eSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
7232636c353eSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
7233636c353eSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
7234636c353eSmrg  [lt_cv_path_mainfest_tool=no
7235636c353eSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
7236636c353eSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
7237636c353eSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
7238636c353eSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
7239636c353eSmrg    lt_cv_path_mainfest_tool=yes
7240636c353eSmrg  fi
7241636c353eSmrg  rm -f conftest*])
7242636c353eSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
7243636c353eSmrg  MANIFEST_TOOL=:
7244636c353eSmrgfi
7245636c353eSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
7246636c353eSmrg])# _LT_PATH_MANIFEST_TOOL
7247e07dc26bSmrg
7248e07dc26bSmrg
7249636c353eSmrg# _LT_DLL_DEF_P([FILE])
7250636c353eSmrg# ---------------------
7251636c353eSmrg# True iff FILE is a Windows DLL '.def' file.
7252636c353eSmrg# Keep in sync with func_dll_def_p in the libtool script
7253636c353eSmrgAC_DEFUN([_LT_DLL_DEF_P],
7254636c353eSmrg[dnl
7255636c353eSmrg  test DEF = "`$SED -n dnl
7256636c353eSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
7257636c353eSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
7258636c353eSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
7259636c353eSmrg    -e q dnl                          Only consider the first "real" line
7260636c353eSmrg    $1`" dnl
7261636c353eSmrg])# _LT_DLL_DEF_P
7262e07dc26bSmrg
7263e07dc26bSmrg
7264636c353eSmrg# LT_LIB_M
7265636c353eSmrg# --------
7266636c353eSmrg# check for math library
7267636c353eSmrgAC_DEFUN([LT_LIB_M],
7268636c353eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7269636c353eSmrgLIBM=
7270636c353eSmrgcase $host in
7271636c353eSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
7272636c353eSmrg  # These system don't have libm, or don't need it
7273636c353eSmrg  ;;
7274636c353eSmrg*-ncr-sysv4.3*)
7275636c353eSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
7276636c353eSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
7277636c353eSmrg  ;;
7278636c353eSmrg*)
7279636c353eSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
7280636c353eSmrg  ;;
7281636c353eSmrgesac
7282636c353eSmrgAC_SUBST([LIBM])
7283636c353eSmrg])# LT_LIB_M
7284e07dc26bSmrg
7285636c353eSmrg# Old name:
7286636c353eSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
7287636c353eSmrgdnl aclocal-1.4 backwards compatibility:
7288636c353eSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
7289e07dc26bSmrg
7290e07dc26bSmrg
7291636c353eSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
7292636c353eSmrg# -------------------------------
7293636c353eSmrgm4_defun([_LT_COMPILER_NO_RTTI],
7294636c353eSmrg[m4_require([_LT_TAG_COMPILER])dnl
7295e07dc26bSmrg
7296636c353eSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7297e07dc26bSmrg
7298636c353eSmrgif test yes = "$GCC"; then
7299636c353eSmrg  case $cc_basename in
7300636c353eSmrg  nvcc*)
7301636c353eSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
7302636c353eSmrg  *)
7303636c353eSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
7304636c353eSmrg  esac
7305e07dc26bSmrg
7306636c353eSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
7307636c353eSmrg    lt_cv_prog_compiler_rtti_exceptions,
7308636c353eSmrg    [-fno-rtti -fno-exceptions], [],
7309636c353eSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
7310e07dc26bSmrgfi
7311636c353eSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
7312636c353eSmrg	[Compiler flag to turn off builtin functions])
7313636c353eSmrg])# _LT_COMPILER_NO_RTTI
7314e07dc26bSmrg
7315e07dc26bSmrg
7316636c353eSmrg# _LT_CMD_GLOBAL_SYMBOLS
7317636c353eSmrg# ----------------------
7318636c353eSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
7319636c353eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7320636c353eSmrgAC_REQUIRE([AC_PROG_CC])dnl
7321636c353eSmrgAC_REQUIRE([AC_PROG_AWK])dnl
7322636c353eSmrgAC_REQUIRE([LT_PATH_NM])dnl
7323636c353eSmrgAC_REQUIRE([LT_PATH_LD])dnl
7324636c353eSmrgm4_require([_LT_DECL_SED])dnl
7325636c353eSmrgm4_require([_LT_DECL_EGREP])dnl
7326636c353eSmrgm4_require([_LT_TAG_COMPILER])dnl
7327e07dc26bSmrg
7328636c353eSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
7329636c353eSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
7330636c353eSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
7331636c353eSmrg[
7332636c353eSmrg# These are sane defaults that work on at least a few old systems.
7333636c353eSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
7334e07dc26bSmrg
7335636c353eSmrg# Character class describing NM global symbol codes.
7336636c353eSmrgsymcode='[[BCDEGRST]]'
7337e07dc26bSmrg
7338636c353eSmrg# Regexp to match symbols that can be accessed directly from C.
7339636c353eSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
7340e07dc26bSmrg
7341636c353eSmrg# Define system-specific variables.
7342636c353eSmrgcase $host_os in
7343636c353eSmrgaix*)
7344636c353eSmrg  symcode='[[BCDT]]'
7345636c353eSmrg  ;;
7346636c353eSmrgcygwin* | mingw* | pw32* | cegcc*)
7347636c353eSmrg  symcode='[[ABCDGISTW]]'
7348636c353eSmrg  ;;
7349636c353eSmrghpux*)
7350636c353eSmrg  if test ia64 = "$host_cpu"; then
7351636c353eSmrg    symcode='[[ABCDEGRST]]'
7352636c353eSmrg  fi
7353636c353eSmrg  ;;
7354636c353eSmrgirix* | nonstopux*)
7355636c353eSmrg  symcode='[[BCDEGRST]]'
7356636c353eSmrg  ;;
7357636c353eSmrgosf*)
7358636c353eSmrg  symcode='[[BCDEGQRST]]'
7359636c353eSmrg  ;;
7360636c353eSmrgsolaris*)
7361636c353eSmrg  symcode='[[BDRT]]'
7362636c353eSmrg  ;;
7363636c353eSmrgsco3.2v5*)
7364636c353eSmrg  symcode='[[DT]]'
7365636c353eSmrg  ;;
7366636c353eSmrgsysv4.2uw2*)
7367636c353eSmrg  symcode='[[DT]]'
7368636c353eSmrg  ;;
7369636c353eSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
7370636c353eSmrg  symcode='[[ABDT]]'
7371636c353eSmrg  ;;
7372636c353eSmrgsysv4)
7373636c353eSmrg  symcode='[[DFNSTU]]'
7374636c353eSmrg  ;;
7375636c353eSmrgesac
7376e07dc26bSmrg
7377636c353eSmrg# If we're using GNU nm, then use its standard symbol codes.
7378636c353eSmrgcase `$NM -V 2>&1` in
7379636c353eSmrg*GNU* | *'with BFD'*)
7380636c353eSmrg  symcode='[[ABCDGIRSTW]]' ;;
7381636c353eSmrgesac
7382e07dc26bSmrg
7383636c353eSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
7384636c353eSmrg  # Gets list of data symbols to import.
7385636c353eSmrg  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
7386636c353eSmrg  # Adjust the below global symbol transforms to fixup imported variables.
7387636c353eSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
7388636c353eSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
7389636c353eSmrg  lt_c_name_lib_hook="\
7390636c353eSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
7391636c353eSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
7392636c353eSmrgelse
7393636c353eSmrg  # Disable hooks by default.
7394636c353eSmrg  lt_cv_sys_global_symbol_to_import=
7395636c353eSmrg  lt_cdecl_hook=
7396636c353eSmrg  lt_c_name_hook=
7397636c353eSmrg  lt_c_name_lib_hook=
7398636c353eSmrgfi
7399e07dc26bSmrg
7400636c353eSmrg# Transform an extracted symbol line into a proper C declaration.
7401636c353eSmrg# Some systems (esp. on ia64) link data and code symbols differently,
7402636c353eSmrg# so use this general approach.
7403636c353eSmrglt_cv_sys_global_symbol_to_cdecl="$SED -n"\
7404636c353eSmrg$lt_cdecl_hook\
7405636c353eSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
7406636c353eSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
7407e07dc26bSmrg
7408636c353eSmrg# Transform an extracted symbol line into symbol name and symbol address
7409636c353eSmrglt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
7410636c353eSmrg$lt_c_name_hook\
7411636c353eSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
7412636c353eSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
7413e07dc26bSmrg
7414636c353eSmrg# Transform an extracted symbol line into symbol name with lib prefix and
7415636c353eSmrg# symbol address.
7416636c353eSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
7417636c353eSmrg$lt_c_name_lib_hook\
7418636c353eSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
7419636c353eSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
7420636c353eSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
7421e07dc26bSmrg
7422636c353eSmrg# Handle CRLF in mingw tool chain
7423636c353eSmrgopt_cr=
7424636c353eSmrgcase $build_os in
7425636c353eSmrgmingw*)
7426636c353eSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
7427636c353eSmrg  ;;
7428636c353eSmrgesac
7429e07dc26bSmrg
7430636c353eSmrg# Try without a prefix underscore, then with it.
7431636c353eSmrgfor ac_symprfx in "" "_"; do
7432e07dc26bSmrg
7433636c353eSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
7434636c353eSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
7435e07dc26bSmrg
7436636c353eSmrg  # Write the raw and C identifiers.
7437636c353eSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
7438636c353eSmrg    # Fake it for dumpbin and say T for any non-static function,
7439636c353eSmrg    # D for any global variable and I for any imported variable.
7440636c353eSmrg    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
7441636c353eSmrg    # which start with @ or ?.
7442636c353eSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
7443636c353eSmrg"     {last_section=section; section=\$ 3};"\
7444636c353eSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
7445636c353eSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
7446636c353eSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
7447636c353eSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
7448636c353eSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
7449636c353eSmrg"     \$ 0!~/External *\|/{next};"\
7450636c353eSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
7451636c353eSmrg"     {if(hide[section]) next};"\
7452636c353eSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
7453636c353eSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
7454636c353eSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
7455636c353eSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
7456636c353eSmrg"     ' prfx=^$ac_symprfx]"
7457636c353eSmrg  else
7458636c353eSmrg    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
7459636c353eSmrg  fi
7460636c353eSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
7461e07dc26bSmrg
7462636c353eSmrg  # Check to see that the pipe works correctly.
7463636c353eSmrg  pipe_works=no
7464e07dc26bSmrg
7465636c353eSmrg  rm -f conftest*
7466636c353eSmrg  cat > conftest.$ac_ext <<_LT_EOF
7467636c353eSmrg#ifdef __cplusplus
7468636c353eSmrgextern "C" {
7469636c353eSmrg#endif
7470636c353eSmrgchar nm_test_var;
7471636c353eSmrgvoid nm_test_func(void);
7472636c353eSmrgvoid nm_test_func(void){}
7473636c353eSmrg#ifdef __cplusplus
7474636c353eSmrg}
7475636c353eSmrg#endif
7476636c353eSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
7477636c353eSmrg_LT_EOF
7478e07dc26bSmrg
7479636c353eSmrg  if AC_TRY_EVAL(ac_compile); then
7480636c353eSmrg    # Now try to grab the symbols.
7481636c353eSmrg    nlist=conftest.nm
7482636c353eSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
7483636c353eSmrg      # Try sorting and uniquifying the output.
7484636c353eSmrg      if sort "$nlist" | uniq > "$nlist"T; then
7485636c353eSmrg	mv -f "$nlist"T "$nlist"
7486636c353eSmrg      else
7487636c353eSmrg	rm -f "$nlist"T
7488636c353eSmrg      fi
7489e07dc26bSmrg
7490636c353eSmrg      # Make sure that we snagged all the symbols we need.
7491636c353eSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
7492636c353eSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
7493636c353eSmrg	  cat <<_LT_EOF > conftest.$ac_ext
7494636c353eSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
7495636c353eSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
7496636c353eSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
7497636c353eSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
7498636c353eSmrg# define LT@&t@_DLSYM_CONST
7499636c353eSmrg#elif defined __osf__
7500636c353eSmrg/* This system does not cope well with relocations in const data.  */
7501636c353eSmrg# define LT@&t@_DLSYM_CONST
7502636c353eSmrg#else
7503636c353eSmrg# define LT@&t@_DLSYM_CONST const
7504636c353eSmrg#endif
7505e07dc26bSmrg
7506636c353eSmrg#ifdef __cplusplus
7507636c353eSmrgextern "C" {
7508636c353eSmrg#endif
7509e07dc26bSmrg
7510636c353eSmrg_LT_EOF
7511636c353eSmrg	  # Now generate the symbol file.
7512636c353eSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
7513e07dc26bSmrg
7514636c353eSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
7515e07dc26bSmrg
7516636c353eSmrg/* The mapping between symbol names and symbols.  */
7517636c353eSmrgLT@&t@_DLSYM_CONST struct {
7518636c353eSmrg  const char *name;
7519636c353eSmrg  void       *address;
7520636c353eSmrg}
7521636c353eSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
7522636c353eSmrg{
7523636c353eSmrg  { "@PROGRAM@", (void *) 0 },
7524636c353eSmrg_LT_EOF
7525636c353eSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
7526636c353eSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
7527636c353eSmrg  {0, (void *) 0}
7528636c353eSmrg};
7529e07dc26bSmrg
7530636c353eSmrg/* This works around a problem in FreeBSD linker */
7531636c353eSmrg#ifdef FREEBSD_WORKAROUND
7532636c353eSmrgstatic const void *lt_preloaded_setup() {
7533636c353eSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
7534636c353eSmrg}
7535636c353eSmrg#endif
7536e07dc26bSmrg
7537636c353eSmrg#ifdef __cplusplus
7538636c353eSmrg}
7539636c353eSmrg#endif
7540636c353eSmrg_LT_EOF
7541636c353eSmrg	  # Now try linking the two files.
7542636c353eSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
7543636c353eSmrg	  lt_globsym_save_LIBS=$LIBS
7544636c353eSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
7545636c353eSmrg	  LIBS=conftstm.$ac_objext
7546636c353eSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
7547636c353eSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
7548636c353eSmrg	    pipe_works=yes
7549636c353eSmrg	  fi
7550636c353eSmrg	  LIBS=$lt_globsym_save_LIBS
7551636c353eSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
7552636c353eSmrg	else
7553636c353eSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
7554636c353eSmrg	fi
7555636c353eSmrg      else
7556636c353eSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
7557636c353eSmrg      fi
7558636c353eSmrg    else
7559636c353eSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
7560636c353eSmrg    fi
7561636c353eSmrg  else
7562636c353eSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
7563636c353eSmrg    cat conftest.$ac_ext >&5
7564636c353eSmrg  fi
7565636c353eSmrg  rm -rf conftest* conftst*
7566e07dc26bSmrg
7567636c353eSmrg  # Do not use the global_symbol_pipe unless it works.
7568636c353eSmrg  if test yes = "$pipe_works"; then
7569636c353eSmrg    break
7570636c353eSmrg  else
7571636c353eSmrg    lt_cv_sys_global_symbol_pipe=
7572636c353eSmrg  fi
7573636c353eSmrgdone
7574636c353eSmrg])
7575636c353eSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
7576636c353eSmrg  lt_cv_sys_global_symbol_to_cdecl=
7577636c353eSmrgfi
7578636c353eSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
7579636c353eSmrg  AC_MSG_RESULT(failed)
7580636c353eSmrgelse
7581636c353eSmrg  AC_MSG_RESULT(ok)
7582636c353eSmrgfi
7583e07dc26bSmrg
7584636c353eSmrg# Response file support.
7585636c353eSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
7586636c353eSmrg  nm_file_list_spec='@'
7587636c353eSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
7588636c353eSmrg  nm_file_list_spec='@'
7589e07dc26bSmrgfi
7590e07dc26bSmrg
7591636c353eSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
7592636c353eSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
7593636c353eSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
7594636c353eSmrg    [Transform the output of nm in a proper C declaration])
7595636c353eSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
7596636c353eSmrg    [Transform the output of nm into a list of symbols to manually relocate])
7597636c353eSmrg_LT_DECL([global_symbol_to_c_name_address],
7598636c353eSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
7599636c353eSmrg    [Transform the output of nm in a C name address pair])
7600636c353eSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
7601636c353eSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
7602636c353eSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
7603636c353eSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
7604636c353eSmrg    [The name lister interface])
7605636c353eSmrg_LT_DECL([], [nm_file_list_spec], [1],
7606636c353eSmrg    [Specify filename containing input files for $NM])
7607636c353eSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
7608e07dc26bSmrg
7609e07dc26bSmrg
7610636c353eSmrg# _LT_COMPILER_PIC([TAGNAME])
7611636c353eSmrg# ---------------------------
7612636c353eSmrgm4_defun([_LT_COMPILER_PIC],
7613636c353eSmrg[m4_require([_LT_TAG_COMPILER])dnl
7614636c353eSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
7615636c353eSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
7616636c353eSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
7617e07dc26bSmrg
7618636c353eSmrgm4_if([$1], [CXX], [
7619636c353eSmrg  # C++ specific cases for pic, static, wl, etc.
7620636c353eSmrg  if test yes = "$GXX"; then
7621636c353eSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7622636c353eSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7623e07dc26bSmrg
7624636c353eSmrg    case $host_os in
7625636c353eSmrg    aix*)
7626636c353eSmrg      # All AIX code is PIC.
7627636c353eSmrg      if test ia64 = "$host_cpu"; then
7628636c353eSmrg	# AIX 5 now supports IA64 processor
7629636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7630636c353eSmrg      fi
7631636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7632636c353eSmrg      ;;
7633e07dc26bSmrg
7634636c353eSmrg    amigaos*)
7635636c353eSmrg      case $host_cpu in
7636636c353eSmrg      powerpc)
7637636c353eSmrg            # see comment about AmigaOS4 .so support
7638636c353eSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7639636c353eSmrg        ;;
7640636c353eSmrg      m68k)
7641636c353eSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
7642636c353eSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
7643636c353eSmrg            # like '-m68040'.
7644636c353eSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7645636c353eSmrg        ;;
7646636c353eSmrg      esac
7647636c353eSmrg      ;;
7648e07dc26bSmrg
7649636c353eSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7650636c353eSmrg      # PIC is the default for these OSes.
7651636c353eSmrg      ;;
7652636c353eSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
7653636c353eSmrg      # This hack is so that the source file can tell whether it is being
7654636c353eSmrg      # built for inclusion in a dll (and should export symbols for example).
7655636c353eSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
7656636c353eSmrg      # (--disable-auto-import) libraries
7657636c353eSmrg      m4_if([$1], [GCJ], [],
7658636c353eSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7659636c353eSmrg      case $host_os in
7660636c353eSmrg      os2*)
7661636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7662636c353eSmrg	;;
7663636c353eSmrg      esac
7664636c353eSmrg      ;;
7665636c353eSmrg    darwin* | rhapsody*)
7666636c353eSmrg      # PIC is the default on this platform
7667636c353eSmrg      # Common symbols not allowed in MH_DYLIB files
7668636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7669636c353eSmrg      ;;
7670636c353eSmrg    *djgpp*)
7671636c353eSmrg      # DJGPP does not support shared libraries at all
7672636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7673636c353eSmrg      ;;
7674636c353eSmrg    haiku*)
7675636c353eSmrg      # PIC is the default for Haiku.
7676636c353eSmrg      # The "-static" flag exists, but is broken.
7677636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
7678636c353eSmrg      ;;
7679636c353eSmrg    interix[[3-9]]*)
7680636c353eSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7681636c353eSmrg      # Instead, we relocate shared libraries at runtime.
7682636c353eSmrg      ;;
7683636c353eSmrg    sysv4*MP*)
7684636c353eSmrg      if test -d /usr/nec; then
7685636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7686636c353eSmrg      fi
7687636c353eSmrg      ;;
7688636c353eSmrg    hpux*)
7689636c353eSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7690636c353eSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
7691636c353eSmrg      # sets the default TLS model and affects inlining.
7692636c353eSmrg      case $host_cpu in
7693636c353eSmrg      hppa*64*)
7694636c353eSmrg	;;
7695636c353eSmrg      *)
7696636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7697636c353eSmrg	;;
7698636c353eSmrg      esac
7699636c353eSmrg      ;;
7700636c353eSmrg    *qnx* | *nto*)
7701636c353eSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
7702636c353eSmrg      # it will coredump.
7703636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7704636c353eSmrg      ;;
7705636c353eSmrg    *)
7706636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7707636c353eSmrg      ;;
7708636c353eSmrg    esac
7709636c353eSmrg  else
7710636c353eSmrg    case $host_os in
7711636c353eSmrg      aix[[4-9]]*)
7712636c353eSmrg	# All AIX code is PIC.
7713636c353eSmrg	if test ia64 = "$host_cpu"; then
7714636c353eSmrg	  # AIX 5 now supports IA64 processor
7715636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7716636c353eSmrg	else
7717636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7718636c353eSmrg	fi
7719636c353eSmrg	;;
7720636c353eSmrg      chorus*)
7721636c353eSmrg	case $cc_basename in
7722636c353eSmrg	cxch68*)
7723636c353eSmrg	  # Green Hills C++ Compiler
7724636c353eSmrg	  # _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"
7725636c353eSmrg	  ;;
7726636c353eSmrg	esac
7727636c353eSmrg	;;
7728636c353eSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
7729636c353eSmrg	# This hack is so that the source file can tell whether it is being
7730636c353eSmrg	# built for inclusion in a dll (and should export symbols for example).
7731636c353eSmrg	m4_if([$1], [GCJ], [],
7732636c353eSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7733636c353eSmrg	;;
7734636c353eSmrg      dgux*)
7735636c353eSmrg	case $cc_basename in
7736636c353eSmrg	  ec++*)
7737636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7738636c353eSmrg	    ;;
7739636c353eSmrg	  ghcx*)
7740636c353eSmrg	    # Green Hills C++ Compiler
7741636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7742636c353eSmrg	    ;;
7743636c353eSmrg	  *)
7744636c353eSmrg	    ;;
7745636c353eSmrg	esac
7746636c353eSmrg	;;
7747636c353eSmrg      freebsd* | dragonfly* | midnightbsd*)
7748636c353eSmrg	# FreeBSD uses GNU C++
7749636c353eSmrg	;;
7750636c353eSmrg      hpux9* | hpux10* | hpux11*)
7751636c353eSmrg	case $cc_basename in
7752636c353eSmrg	  CC*)
7753636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7754636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7755636c353eSmrg	    if test ia64 != "$host_cpu"; then
7756636c353eSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7757636c353eSmrg	    fi
7758636c353eSmrg	    ;;
7759636c353eSmrg	  aCC*)
7760636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7761636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
7762636c353eSmrg	    case $host_cpu in
7763636c353eSmrg	    hppa*64*|ia64*)
7764636c353eSmrg	      # +Z the default
7765636c353eSmrg	      ;;
7766636c353eSmrg	    *)
7767636c353eSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7768636c353eSmrg	      ;;
7769636c353eSmrg	    esac
7770636c353eSmrg	    ;;
7771636c353eSmrg	  *)
7772636c353eSmrg	    ;;
7773636c353eSmrg	esac
7774636c353eSmrg	;;
7775636c353eSmrg      interix*)
7776636c353eSmrg	# This is c89, which is MS Visual C++ (no shared libs)
7777636c353eSmrg	# Anyone wants to do a port?
7778636c353eSmrg	;;
7779636c353eSmrg      irix5* | irix6* | nonstopux*)
7780636c353eSmrg	case $cc_basename in
7781636c353eSmrg	  CC*)
7782636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7783636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7784636c353eSmrg	    # CC pic flag -KPIC is the default.
7785636c353eSmrg	    ;;
7786636c353eSmrg	  *)
7787636c353eSmrg	    ;;
7788636c353eSmrg	esac
7789636c353eSmrg	;;
7790636c353eSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7791636c353eSmrg	case $cc_basename in
7792636c353eSmrg	  KCC*)
7793636c353eSmrg	    # KAI C++ Compiler
7794636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7795636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7796636c353eSmrg	    ;;
7797636c353eSmrg	  ecpc* )
7798636c353eSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
7799636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7800636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7801636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7802636c353eSmrg	    ;;
7803636c353eSmrg	  icpc* )
7804636c353eSmrg	    # Intel C++, used to be incompatible with GCC.
7805636c353eSmrg	    # ICC 10 doesn't accept -KPIC any more.
7806636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7807636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7808636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7809636c353eSmrg	    ;;
7810636c353eSmrg	  pgCC* | pgcpp*)
7811636c353eSmrg	    # Portland Group C++ compiler
7812636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7813636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
7814636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7815636c353eSmrg	    ;;
7816636c353eSmrg	  cxx*)
7817636c353eSmrg	    # Compaq C++
7818636c353eSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
7819636c353eSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
7820636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7821636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7822636c353eSmrg	    ;;
7823636c353eSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
7824636c353eSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
7825636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7826636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
7827636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
7828636c353eSmrg	    ;;
7829636c353eSmrg	  *)
7830636c353eSmrg	    case `$CC -V 2>&1 | $SED 5q` in
7831636c353eSmrg	    *Sun\ C*)
7832636c353eSmrg	      # Sun C++ 5.9
7833636c353eSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7834636c353eSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7835636c353eSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7836636c353eSmrg	      ;;
7837636c353eSmrg	    esac
7838636c353eSmrg	    ;;
7839636c353eSmrg	esac
7840636c353eSmrg	;;
7841636c353eSmrg      lynxos*)
7842636c353eSmrg	;;
7843636c353eSmrg      m88k*)
7844636c353eSmrg	;;
7845636c353eSmrg      mvs*)
7846636c353eSmrg	case $cc_basename in
7847636c353eSmrg	  cxx*)
7848636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
7849636c353eSmrg	    ;;
7850636c353eSmrg	  *)
7851636c353eSmrg	    ;;
7852636c353eSmrg	esac
7853636c353eSmrg	;;
7854636c353eSmrg      netbsd*)
7855636c353eSmrg	;;
7856636c353eSmrg      *qnx* | *nto*)
7857636c353eSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
7858636c353eSmrg        # it will coredump.
7859636c353eSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
7860636c353eSmrg        ;;
7861636c353eSmrg      osf3* | osf4* | osf5*)
7862636c353eSmrg	case $cc_basename in
7863636c353eSmrg	  KCC*)
7864636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7865636c353eSmrg	    ;;
7866636c353eSmrg	  RCC*)
7867636c353eSmrg	    # Rational C++ 2.4.1
7868636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7869636c353eSmrg	    ;;
7870636c353eSmrg	  cxx*)
7871636c353eSmrg	    # Digital/Compaq C++
7872636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7873636c353eSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
7874636c353eSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
7875636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
7876636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7877636c353eSmrg	    ;;
7878636c353eSmrg	  *)
7879636c353eSmrg	    ;;
7880636c353eSmrg	esac
7881636c353eSmrg	;;
7882636c353eSmrg      psos*)
7883636c353eSmrg	;;
7884636c353eSmrg      solaris*)
7885636c353eSmrg	case $cc_basename in
7886636c353eSmrg	  CC* | sunCC*)
7887636c353eSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
7888636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7889636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7890636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7891636c353eSmrg	    ;;
7892636c353eSmrg	  gcx*)
7893636c353eSmrg	    # Green Hills C++ Compiler
7894636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7895636c353eSmrg	    ;;
7896636c353eSmrg	  *)
7897636c353eSmrg	    ;;
7898636c353eSmrg	esac
7899636c353eSmrg	;;
7900636c353eSmrg      sunos4*)
7901636c353eSmrg	case $cc_basename in
7902636c353eSmrg	  CC*)
7903636c353eSmrg	    # Sun C++ 4.x
7904636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7905636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7906636c353eSmrg	    ;;
7907636c353eSmrg	  lcc*)
7908636c353eSmrg	    # Lucid
7909636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7910636c353eSmrg	    ;;
7911636c353eSmrg	  *)
7912636c353eSmrg	    ;;
7913636c353eSmrg	esac
7914636c353eSmrg	;;
7915636c353eSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7916636c353eSmrg	case $cc_basename in
7917636c353eSmrg	  CC*)
7918636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7919636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7920636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7921636c353eSmrg	    ;;
7922636c353eSmrg	esac
7923636c353eSmrg	;;
7924636c353eSmrg      tandem*)
7925636c353eSmrg	case $cc_basename in
7926636c353eSmrg	  NCC*)
7927636c353eSmrg	    # NonStop-UX NCC 3.20
7928636c353eSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7929636c353eSmrg	    ;;
7930636c353eSmrg	  *)
7931636c353eSmrg	    ;;
7932636c353eSmrg	esac
7933636c353eSmrg	;;
7934636c353eSmrg      vxworks*)
7935636c353eSmrg	;;
7936636c353eSmrg      *)
7937636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7938636c353eSmrg	;;
7939636c353eSmrg    esac
7940636c353eSmrg  fi
7941636c353eSmrg],
7942636c353eSmrg[
7943636c353eSmrg  if test yes = "$GCC"; then
7944636c353eSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7945636c353eSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
7946e07dc26bSmrg
7947636c353eSmrg    case $host_os in
7948636c353eSmrg      aix*)
7949636c353eSmrg      # All AIX code is PIC.
7950636c353eSmrg      if test ia64 = "$host_cpu"; then
7951636c353eSmrg	# AIX 5 now supports IA64 processor
7952636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7953636c353eSmrg      fi
7954636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7955636c353eSmrg      ;;
7956e07dc26bSmrg
7957636c353eSmrg    amigaos*)
7958636c353eSmrg      case $host_cpu in
7959636c353eSmrg      powerpc)
7960636c353eSmrg            # see comment about AmigaOS4 .so support
7961636c353eSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7962636c353eSmrg        ;;
7963636c353eSmrg      m68k)
7964636c353eSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
7965636c353eSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
7966636c353eSmrg            # like '-m68040'.
7967636c353eSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7968636c353eSmrg        ;;
7969636c353eSmrg      esac
7970636c353eSmrg      ;;
7971e07dc26bSmrg
7972636c353eSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7973636c353eSmrg      # PIC is the default for these OSes.
7974636c353eSmrg      ;;
7975e07dc26bSmrg
7976636c353eSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
7977636c353eSmrg      # This hack is so that the source file can tell whether it is being
7978636c353eSmrg      # built for inclusion in a dll (and should export symbols for example).
7979636c353eSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
7980636c353eSmrg      # (--disable-auto-import) libraries
7981636c353eSmrg      m4_if([$1], [GCJ], [],
7982636c353eSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
7983636c353eSmrg      case $host_os in
7984636c353eSmrg      os2*)
7985636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
7986636c353eSmrg	;;
7987636c353eSmrg      esac
7988636c353eSmrg      ;;
7989e07dc26bSmrg
7990636c353eSmrg    darwin* | rhapsody*)
7991636c353eSmrg      # PIC is the default on this platform
7992636c353eSmrg      # Common symbols not allowed in MH_DYLIB files
7993636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7994636c353eSmrg      ;;
7995e07dc26bSmrg
7996636c353eSmrg    haiku*)
7997636c353eSmrg      # PIC is the default for Haiku.
7998636c353eSmrg      # The "-static" flag exists, but is broken.
7999636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
8000636c353eSmrg      ;;
8001e07dc26bSmrg
8002636c353eSmrg    hpux*)
8003636c353eSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
8004636c353eSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
8005636c353eSmrg      # sets the default TLS model and affects inlining.
8006636c353eSmrg      case $host_cpu in
8007636c353eSmrg      hppa*64*)
8008636c353eSmrg	# +Z the default
8009636c353eSmrg	;;
8010636c353eSmrg      *)
8011636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8012636c353eSmrg	;;
8013636c353eSmrg      esac
8014636c353eSmrg      ;;
8015e07dc26bSmrg
8016636c353eSmrg    interix[[3-9]]*)
8017636c353eSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8018636c353eSmrg      # Instead, we relocate shared libraries at runtime.
8019636c353eSmrg      ;;
8020e07dc26bSmrg
8021636c353eSmrg    msdosdjgpp*)
8022636c353eSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
8023636c353eSmrg      # on systems that don't support them.
8024636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8025636c353eSmrg      enable_shared=no
8026636c353eSmrg      ;;
8027e07dc26bSmrg
8028636c353eSmrg    *nto* | *qnx*)
8029636c353eSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
8030636c353eSmrg      # it will coredump.
8031636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8032636c353eSmrg      ;;
8033636c353eSmrg
8034636c353eSmrg    sysv4*MP*)
8035636c353eSmrg      if test -d /usr/nec; then
8036636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
8037e07dc26bSmrg      fi
8038636c353eSmrg      ;;
8039e07dc26bSmrg
8040636c353eSmrg    *)
8041636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8042636c353eSmrg      ;;
8043636c353eSmrg    esac
8044e07dc26bSmrg
8045636c353eSmrg    case $cc_basename in
8046636c353eSmrg    nvcc*) # Cuda Compiler Driver 2.2
8047636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
8048636c353eSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8049636c353eSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
8050636c353eSmrg      fi
8051636c353eSmrg      ;;
8052636c353eSmrg    esac
8053636c353eSmrg  else
8054636c353eSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
8055636c353eSmrg    case $host_os in
8056636c353eSmrg    aix*)
8057636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8058636c353eSmrg      if test ia64 = "$host_cpu"; then
8059636c353eSmrg	# AIX 5 now supports IA64 processor
8060636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8061636c353eSmrg      else
8062636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
8063636c353eSmrg      fi
8064636c353eSmrg      ;;
8065e07dc26bSmrg
8066636c353eSmrg    darwin* | rhapsody*)
8067636c353eSmrg      # PIC is the default on this platform
8068636c353eSmrg      # Common symbols not allowed in MH_DYLIB files
8069636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8070636c353eSmrg      case $cc_basename in
8071636c353eSmrg      nagfor*)
8072636c353eSmrg        # NAG Fortran compiler
8073636c353eSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8074636c353eSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8075636c353eSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8076636c353eSmrg        ;;
8077636c353eSmrg      esac
8078636c353eSmrg      ;;
8079e07dc26bSmrg
8080636c353eSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
8081636c353eSmrg      # This hack is so that the source file can tell whether it is being
8082636c353eSmrg      # built for inclusion in a dll (and should export symbols for example).
8083636c353eSmrg      m4_if([$1], [GCJ], [],
8084636c353eSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8085636c353eSmrg      case $host_os in
8086636c353eSmrg      os2*)
8087636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
8088636c353eSmrg	;;
8089636c353eSmrg      esac
8090636c353eSmrg      ;;
8091e07dc26bSmrg
8092636c353eSmrg    hpux9* | hpux10* | hpux11*)
8093636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8094636c353eSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8095636c353eSmrg      # not for PA HP-UX.
8096636c353eSmrg      case $host_cpu in
8097636c353eSmrg      hppa*64*|ia64*)
8098636c353eSmrg	# +Z the default
8099636c353eSmrg	;;
8100636c353eSmrg      *)
8101636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8102636c353eSmrg	;;
8103636c353eSmrg      esac
8104636c353eSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
8105636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
8106636c353eSmrg      ;;
8107e07dc26bSmrg
8108636c353eSmrg    irix5* | irix6* | nonstopux*)
8109636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8110636c353eSmrg      # PIC (with -KPIC) is the default.
8111636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8112636c353eSmrg      ;;
8113636c353eSmrg
8114636c353eSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
8115636c353eSmrg      case $cc_basename in
8116636c353eSmrg      # old Intel for x86_64, which still supported -KPIC.
8117636c353eSmrg      ecc*)
8118636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8119636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8120636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8121e07dc26bSmrg        ;;
8122636c353eSmrg      # icc used to be incompatible with GCC.
8123636c353eSmrg      # ICC 10 doesn't accept -KPIC any more.
8124636c353eSmrg      icc* | ifort*)
8125636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8126636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8127636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8128e07dc26bSmrg        ;;
8129636c353eSmrg      # Lahey Fortran 8.1.
8130636c353eSmrg      lf95*)
8131636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8132636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
8133636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
8134636c353eSmrg	;;
8135636c353eSmrg      nagfor*)
8136636c353eSmrg	# NAG Fortran compiler
8137636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8138636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8139636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8140636c353eSmrg	;;
8141636c353eSmrg      tcc*)
8142636c353eSmrg	# Fabrice Bellard et al's Tiny C Compiler
8143636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8144636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8145636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8146636c353eSmrg	;;
8147636c353eSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
8148636c353eSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
8149636c353eSmrg	# which looks to be a dead project)
8150636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8151636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8152636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8153e07dc26bSmrg        ;;
8154636c353eSmrg      ccc*)
8155636c353eSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8156636c353eSmrg        # All Alpha code is PIC.
8157636c353eSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8158e07dc26bSmrg        ;;
8159636c353eSmrg      xl* | bgxl* | bgf* | mpixl*)
8160636c353eSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
8161636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8162636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
8163636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
8164636c353eSmrg	;;
8165636c353eSmrg      *)
8166636c353eSmrg	case `$CC -V 2>&1 | $SED 5q` in
8167636c353eSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
8168636c353eSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
8169636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8170636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8171636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
8172636c353eSmrg	  ;;
8173636c353eSmrg	*Sun\ F* | *Sun*Fortran*)
8174636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8175636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8176636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8177636c353eSmrg	  ;;
8178636c353eSmrg	*Sun\ C*)
8179636c353eSmrg	  # Sun C 5.9
8180636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8181636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8182636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8183636c353eSmrg	  ;;
8184636c353eSmrg        *Intel*\ [[CF]]*Compiler*)
8185636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8186636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8187636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8188636c353eSmrg	  ;;
8189636c353eSmrg	*Portland\ Group*)
8190636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8191636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8192636c353eSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8193636c353eSmrg	  ;;
8194636c353eSmrg	esac
8195636c353eSmrg	;;
8196636c353eSmrg      esac
8197636c353eSmrg      ;;
8198e07dc26bSmrg
8199636c353eSmrg    newsos6)
8200636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8201636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8202636c353eSmrg      ;;
8203e07dc26bSmrg
8204636c353eSmrg    *nto* | *qnx*)
8205636c353eSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
8206636c353eSmrg      # it will coredump.
8207636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8208636c353eSmrg      ;;
8209e07dc26bSmrg
8210636c353eSmrg    osf3* | osf4* | osf5*)
8211636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8212636c353eSmrg      # All OSF/1 code is PIC.
8213636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8214636c353eSmrg      ;;
8215e07dc26bSmrg
8216636c353eSmrg    rdos*)
8217636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8218636c353eSmrg      ;;
8219e07dc26bSmrg
8220636c353eSmrg    solaris*)
8221636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8222636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8223636c353eSmrg      case $cc_basename in
8224636c353eSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
8225636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
8226636c353eSmrg      *)
8227636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
8228636c353eSmrg      esac
8229636c353eSmrg      ;;
8230e07dc26bSmrg
8231636c353eSmrg    sunos4*)
8232636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8233636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8234636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8235636c353eSmrg      ;;
8236e07dc26bSmrg
8237636c353eSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
8238636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8239636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8240636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8241636c353eSmrg      ;;
8242e07dc26bSmrg
8243636c353eSmrg    sysv4*MP*)
8244636c353eSmrg      if test -d /usr/nec; then
8245636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
8246636c353eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8247636c353eSmrg      fi
8248636c353eSmrg      ;;
8249e07dc26bSmrg
8250636c353eSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8251636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8252636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8253636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8254636c353eSmrg      ;;
8255e07dc26bSmrg
8256636c353eSmrg    unicos*)
8257636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8258636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8259636c353eSmrg      ;;
8260e07dc26bSmrg
8261636c353eSmrg    uts4*)
8262636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8263636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8264636c353eSmrg      ;;
8265e07dc26bSmrg
8266636c353eSmrg    *)
8267636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8268636c353eSmrg      ;;
8269636c353eSmrg    esac
8270636c353eSmrg  fi
8271e07dc26bSmrg])
8272636c353eSmrgcase $host_os in
8273636c353eSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
8274636c353eSmrg  *djgpp*)
8275636c353eSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
8276636c353eSmrg    ;;
8277636c353eSmrg  *)
8278636c353eSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
8279636c353eSmrg    ;;
8280636c353eSmrgesac
8281e07dc26bSmrg
8282636c353eSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
8283636c353eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
8284636c353eSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
8285636c353eSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
8286e07dc26bSmrg
8287636c353eSmrg#
8288636c353eSmrg# Check to make sure the PIC flag actually works.
8289636c353eSmrg#
8290636c353eSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8291636c353eSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
8292636c353eSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
8293636c353eSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
8294636c353eSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
8295636c353eSmrg     "" | " "*) ;;
8296636c353eSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
8297636c353eSmrg     esac],
8298636c353eSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
8299636c353eSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
8300636c353eSmrgfi
8301636c353eSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
8302636c353eSmrg	[Additional compiler flags for building library objects])
8303e07dc26bSmrg
8304636c353eSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
8305636c353eSmrg	[How to pass a linker flag through the compiler])
8306636c353eSmrg#
8307636c353eSmrg# Check to make sure the static flag actually works.
8308636c353eSmrg#
8309636c353eSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
8310636c353eSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
8311636c353eSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
8312636c353eSmrg  $lt_tmp_static_flag,
8313636c353eSmrg  [],
8314636c353eSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
8315636c353eSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
8316636c353eSmrg	[Compiler flag to prevent dynamic linking])
8317636c353eSmrg])# _LT_COMPILER_PIC
8318e07dc26bSmrg
8319e07dc26bSmrg
8320636c353eSmrg# _LT_LINKER_SHLIBS([TAGNAME])
8321636c353eSmrg# ----------------------------
8322636c353eSmrg# See if the linker supports building shared libraries.
8323636c353eSmrgm4_defun([_LT_LINKER_SHLIBS],
8324636c353eSmrg[AC_REQUIRE([LT_PATH_LD])dnl
8325636c353eSmrgAC_REQUIRE([LT_PATH_NM])dnl
8326636c353eSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
8327636c353eSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
8328636c353eSmrgm4_require([_LT_DECL_EGREP])dnl
8329636c353eSmrgm4_require([_LT_DECL_SED])dnl
8330636c353eSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
8331636c353eSmrgm4_require([_LT_TAG_COMPILER])dnl
8332636c353eSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
8333636c353eSmrgm4_if([$1], [CXX], [
8334636c353eSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8335636c353eSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8336636c353eSmrg  case $host_os in
8337636c353eSmrg  aix[[4-9]]*)
8338636c353eSmrg    # If we're using GNU nm, then we don't want the "-C" option.
8339636c353eSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
8340636c353eSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
8341636c353eSmrg    # weak defined symbols like other global defined symbols, whereas
8342636c353eSmrg    # GNU nm marks them as "W".
8343636c353eSmrg    # While the 'weak' keyword is ignored in the Export File, we need
8344636c353eSmrg    # it in the Import File for the 'aix-soname' feature, so we have
8345636c353eSmrg    # to replace the "-B" option with "-P" for AIX nm.
8346636c353eSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8347636c353eSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
8348636c353eSmrg    else
8349636c353eSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
8350636c353eSmrg    fi
8351636c353eSmrg    ;;
8352636c353eSmrg  pw32*)
8353636c353eSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
8354636c353eSmrg    ;;
8355636c353eSmrg  cygwin* | mingw* | cegcc*)
8356636c353eSmrg    case $cc_basename in
8357636c353eSmrg    cl* | icl*)
8358636c353eSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
8359636c353eSmrg      ;;
8360636c353eSmrg    *)
8361636c353eSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
8362636c353eSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
8363636c353eSmrg      ;;
8364636c353eSmrg    esac
8365636c353eSmrg    ;;
8366636c353eSmrg  *)
8367636c353eSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8368636c353eSmrg    ;;
8369636c353eSmrg  esac
8370636c353eSmrg], [
8371636c353eSmrg  runpath_var=
8372636c353eSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
8373636c353eSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
8374636c353eSmrg  _LT_TAGVAR(archive_cmds, $1)=
8375636c353eSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
8376636c353eSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
8377636c353eSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8378636c353eSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8379636c353eSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8380636c353eSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
8381636c353eSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
8382636c353eSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8383636c353eSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8384636c353eSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
8385636c353eSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
8386636c353eSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8387636c353eSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
8388636c353eSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
8389636c353eSmrg  _LT_TAGVAR(module_cmds, $1)=
8390636c353eSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
8391636c353eSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
8392636c353eSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
8393636c353eSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
8394636c353eSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
8395636c353eSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
8396636c353eSmrg  # included in the symbol list
8397636c353eSmrg  _LT_TAGVAR(include_expsyms, $1)=
8398636c353eSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
8399636c353eSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
8400636c353eSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
8401636c353eSmrg  # as well as any symbol that contains 'd'.
8402636c353eSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
8403636c353eSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8404636c353eSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
8405636c353eSmrg  # the symbol is explicitly referenced.  Since portable code cannot
8406636c353eSmrg  # rely on this symbol name, it's probably fine to never include it in
8407636c353eSmrg  # preloaded symbol tables.
8408636c353eSmrg  # Exclude shared library initialization/finalization symbols.
8409636c353eSmrgdnl Note also adjust exclude_expsyms for C++ above.
8410636c353eSmrg  extract_expsyms_cmds=
8411e07dc26bSmrg
8412636c353eSmrg  case $host_os in
8413636c353eSmrg  cygwin* | mingw* | pw32* | cegcc*)
8414636c353eSmrg    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
8415636c353eSmrg    # When not using gcc, we currently assume that we are using
8416636c353eSmrg    # Microsoft Visual C++ or Intel C++ Compiler.
8417636c353eSmrg    if test yes != "$GCC"; then
8418636c353eSmrg      with_gnu_ld=no
8419636c353eSmrg    fi
8420636c353eSmrg    ;;
8421636c353eSmrg  interix*)
8422636c353eSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
8423636c353eSmrg    with_gnu_ld=yes
8424636c353eSmrg    ;;
8425636c353eSmrg  openbsd* | bitrig*)
8426636c353eSmrg    with_gnu_ld=no
8427636c353eSmrg    ;;
8428636c353eSmrg  esac
8429e07dc26bSmrg
8430636c353eSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
8431e07dc26bSmrg
8432636c353eSmrg  # On some targets, GNU ld is compatible enough with the native linker
8433636c353eSmrg  # that we're better off using the native interface for both.
8434636c353eSmrg  lt_use_gnu_ld_interface=no
8435636c353eSmrg  if test yes = "$with_gnu_ld"; then
8436636c353eSmrg    case $host_os in
8437636c353eSmrg      aix*)
8438636c353eSmrg	# The AIX port of GNU ld has always aspired to compatibility
8439636c353eSmrg	# with the native linker.  However, as the warning in the GNU ld
8440636c353eSmrg	# block says, versions before 2.19.5* couldn't really create working
8441636c353eSmrg	# shared libraries, regardless of the interface used.
8442636c353eSmrg	case `$LD -v 2>&1` in
8443636c353eSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
8444636c353eSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
8445636c353eSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
8446636c353eSmrg	  *)
8447636c353eSmrg	    lt_use_gnu_ld_interface=yes
8448636c353eSmrg	    ;;
8449636c353eSmrg	esac
8450636c353eSmrg	;;
8451636c353eSmrg      *)
8452636c353eSmrg	lt_use_gnu_ld_interface=yes
8453636c353eSmrg	;;
8454636c353eSmrg    esac
8455636c353eSmrg  fi
8456e07dc26bSmrg
8457636c353eSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
8458636c353eSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
8459636c353eSmrg    wlarc='$wl'
8460e07dc26bSmrg
8461636c353eSmrg    # Set some defaults for GNU ld with shared library support. These
8462636c353eSmrg    # are reset later if shared libraries are not supported. Putting them
8463636c353eSmrg    # here allows them to be overridden if necessary.
8464636c353eSmrg    runpath_var=LD_RUN_PATH
8465636c353eSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8466636c353eSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
8467636c353eSmrg    # ancient GNU ld didn't support --whole-archive et. al.
8468636c353eSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8469636c353eSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
8470636c353eSmrg    else
8471636c353eSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
8472636c353eSmrg    fi
8473636c353eSmrg    supports_anon_versioning=no
8474636c353eSmrg    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
8475636c353eSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
8476636c353eSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
8477636c353eSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8478636c353eSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8479636c353eSmrg      *\ 2.11.*) ;; # other 2.11 versions
8480636c353eSmrg      *) supports_anon_versioning=yes ;;
8481636c353eSmrg    esac
8482e07dc26bSmrg
8483636c353eSmrg    # See if GNU ld supports shared libraries.
8484636c353eSmrg    case $host_os in
8485636c353eSmrg    aix[[3-9]]*)
8486636c353eSmrg      # On AIX/PPC, the GNU linker is very broken
8487636c353eSmrg      if test ia64 != "$host_cpu"; then
8488636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8489636c353eSmrg	cat <<_LT_EOF 1>&2
8490e07dc26bSmrg
8491636c353eSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
8492636c353eSmrg*** to be unable to reliably create shared libraries on AIX.
8493636c353eSmrg*** Therefore, libtool is disabling shared libraries support.  If you
8494636c353eSmrg*** really care for shared libraries, you may want to install binutils
8495636c353eSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
8496636c353eSmrg*** You will then need to restart the configuration process.
8497e07dc26bSmrg
8498636c353eSmrg_LT_EOF
8499636c353eSmrg      fi
8500636c353eSmrg      ;;
8501e07dc26bSmrg
8502636c353eSmrg    amigaos*)
8503636c353eSmrg      case $host_cpu in
8504636c353eSmrg      powerpc)
8505636c353eSmrg            # see comment about AmigaOS4 .so support
8506636c353eSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8507636c353eSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
8508636c353eSmrg        ;;
8509636c353eSmrg      m68k)
8510636c353eSmrg            _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)'
8511636c353eSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8512636c353eSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
8513636c353eSmrg        ;;
8514636c353eSmrg      esac
8515636c353eSmrg      ;;
8516e07dc26bSmrg
8517636c353eSmrg    beos*)
8518636c353eSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8519636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8520636c353eSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8521636c353eSmrg	# support --undefined.  This deserves some investigation.  FIXME
8522636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8523636c353eSmrg      else
8524636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8525636c353eSmrg      fi
8526636c353eSmrg      ;;
8527e07dc26bSmrg
8528636c353eSmrg    cygwin* | mingw* | pw32* | cegcc*)
8529636c353eSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
8530636c353eSmrg      # as there is no search path for DLLs.
8531636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8532636c353eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
8533636c353eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8534636c353eSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
8535636c353eSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8536636c353eSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
8537636c353eSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
8538e07dc26bSmrg
8539636c353eSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8540636c353eSmrg        _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'
8541636c353eSmrg	# If the export-symbols file already is a .def file, use it as
8542636c353eSmrg	# is; otherwise, prepend EXPORTS...
8543636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
8544636c353eSmrg          cp $export_symbols $output_objdir/$soname.def;
8545636c353eSmrg        else
8546636c353eSmrg          echo EXPORTS > $output_objdir/$soname.def;
8547636c353eSmrg          cat $export_symbols >> $output_objdir/$soname.def;
8548636c353eSmrg        fi~
8549636c353eSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8550636c353eSmrg      else
8551636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8552636c353eSmrg      fi
8553636c353eSmrg      ;;
8554636c353eSmrg
8555636c353eSmrg    haiku*)
8556636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8557636c353eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
8558636c353eSmrg      ;;
8559e07dc26bSmrg
8560636c353eSmrg    os2*)
8561636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8562636c353eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
8563636c353eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8564636c353eSmrg      shrext_cmds=.dll
8565636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8566636c353eSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8567636c353eSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8568636c353eSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
8569636c353eSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
8570636c353eSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8571636c353eSmrg	emximp -o $lib $output_objdir/$libname.def'
8572636c353eSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8573636c353eSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8574636c353eSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8575636c353eSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
8576636c353eSmrg	prefix_cmds="$SED"~
8577636c353eSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
8578636c353eSmrg	  prefix_cmds="$prefix_cmds -e 1d";
8579636c353eSmrg	fi~
8580636c353eSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
8581636c353eSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
8582636c353eSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8583636c353eSmrg	emximp -o $lib $output_objdir/$libname.def'
8584636c353eSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
8585636c353eSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8586636c353eSmrg      _LT_TAGVAR(file_list_spec, $1)='@'
8587636c353eSmrg      ;;
8588e07dc26bSmrg
8589636c353eSmrg    interix[[3-9]]*)
8590636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
8591636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8592636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
8593636c353eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
8594636c353eSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8595636c353eSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
8596636c353eSmrg      # default) and relocated if they conflict, which is a slow very memory
8597636c353eSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
8598636c353eSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8599636c353eSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
8600636c353eSmrg      _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'
8601636c353eSmrg      _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'
8602636c353eSmrg      ;;
8603e07dc26bSmrg
8604636c353eSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
8605636c353eSmrg      tmp_diet=no
8606636c353eSmrg      if test linux-dietlibc = "$host_os"; then
8607636c353eSmrg	case $cc_basename in
8608636c353eSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
8609636c353eSmrg	esac
8610636c353eSmrg      fi
8611636c353eSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8612636c353eSmrg	 && test no = "$tmp_diet"
8613636c353eSmrg      then
8614636c353eSmrg	tmp_addflag=' $pic_flag'
8615636c353eSmrg	tmp_sharedflag='-shared'
8616636c353eSmrg	case $cc_basename,$host_cpu in
8617636c353eSmrg        pgcc*)				# Portland Group C compiler
8618636c353eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8619636c353eSmrg	  tmp_addflag=' $pic_flag'
8620636c353eSmrg	  ;;
8621636c353eSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
8622636c353eSmrg					# Portland Group f77 and f90 compilers
8623636c353eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8624636c353eSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
8625636c353eSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
8626636c353eSmrg	  tmp_addflag=' -i_dynamic' ;;
8627636c353eSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
8628636c353eSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
8629636c353eSmrg	ifc* | ifort*)			# Intel Fortran compiler
8630636c353eSmrg	  tmp_addflag=' -nofor_main' ;;
8631636c353eSmrg	lf95*)				# Lahey Fortran 8.1
8632636c353eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
8633636c353eSmrg	  tmp_sharedflag='--shared' ;;
8634636c353eSmrg        nagfor*)                        # NAGFOR 5.3
8635636c353eSmrg          tmp_sharedflag='-Wl,-shared' ;;
8636636c353eSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8637636c353eSmrg	  tmp_sharedflag='-qmkshrobj'
8638636c353eSmrg	  tmp_addflag= ;;
8639636c353eSmrg	nvcc*)	# Cuda Compiler Driver 2.2
8640636c353eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8641636c353eSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
8642636c353eSmrg	  ;;
8643636c353eSmrg	esac
8644636c353eSmrg	case `$CC -V 2>&1 | $SED 5q` in
8645636c353eSmrg	*Sun\ C*)			# Sun C 5.9
8646636c353eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8647636c353eSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
8648636c353eSmrg	  tmp_sharedflag='-G' ;;
8649636c353eSmrg	*Sun\ F*)			# Sun Fortran 8.3
8650636c353eSmrg	  tmp_sharedflag='-G' ;;
8651636c353eSmrg	esac
8652636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8653e07dc26bSmrg
8654636c353eSmrg        if test yes = "$supports_anon_versioning"; then
8655636c353eSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8656636c353eSmrg            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8657636c353eSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
8658636c353eSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
8659636c353eSmrg        fi
8660e07dc26bSmrg
8661636c353eSmrg	case $cc_basename in
8662636c353eSmrg	tcc*)
8663636c353eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
8664636c353eSmrg	  ;;
8665636c353eSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
8666636c353eSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8667636c353eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
8668636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8669636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
8670636c353eSmrg	  if test yes = "$supports_anon_versioning"; then
8671636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
8672636c353eSmrg              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8673636c353eSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
8674636c353eSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8675636c353eSmrg	  fi
8676636c353eSmrg	  ;;
8677636c353eSmrg	esac
8678636c353eSmrg      else
8679636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
8680636c353eSmrg      fi
8681e07dc26bSmrg      ;;
8682e07dc26bSmrg
8683636c353eSmrg    netbsd*)
8684636c353eSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8685636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8686636c353eSmrg	wlarc=
8687636c353eSmrg      else
8688636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8689636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8690636c353eSmrg      fi
8691636c353eSmrg      ;;
8692e07dc26bSmrg
8693636c353eSmrg    solaris*)
8694636c353eSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8695636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8696636c353eSmrg	cat <<_LT_EOF 1>&2
8697e07dc26bSmrg
8698636c353eSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
8699636c353eSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
8700636c353eSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
8701636c353eSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
8702636c353eSmrg*** your PATH or compiler configuration so that the native linker is
8703636c353eSmrg*** used, and then restart.
8704e07dc26bSmrg
8705636c353eSmrg_LT_EOF
8706636c353eSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8707636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8708636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8709636c353eSmrg      else
8710636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8711636c353eSmrg      fi
8712636c353eSmrg      ;;
8713e07dc26bSmrg
8714636c353eSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8715636c353eSmrg      case `$LD -v 2>&1` in
8716636c353eSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
8717636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8718636c353eSmrg	cat <<_LT_EOF 1>&2
8719e07dc26bSmrg
8720636c353eSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
8721636c353eSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
8722636c353eSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
8723636c353eSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
8724636c353eSmrg*** your PATH or compiler configuration so that the native linker is
8725636c353eSmrg*** used, and then restart.
8726e07dc26bSmrg
8727636c353eSmrg_LT_EOF
8728636c353eSmrg	;;
8729636c353eSmrg	*)
8730636c353eSmrg	  # For security reasons, it is highly recommended that you always
8731636c353eSmrg	  # use absolute paths for naming shared libraries, and exclude the
8732636c353eSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
8733636c353eSmrg	  # requires that you compile everything twice, which is a pain.
8734636c353eSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8735636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
8736636c353eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8737636c353eSmrg	    _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'
8738636c353eSmrg	  else
8739636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
8740636c353eSmrg	  fi
8741636c353eSmrg	;;
8742636c353eSmrg      esac
8743636c353eSmrg      ;;
8744e07dc26bSmrg
8745636c353eSmrg    sunos4*)
8746636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8747636c353eSmrg      wlarc=
8748636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
8749636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
8750e07dc26bSmrg      ;;
8751e07dc26bSmrg
8752636c353eSmrg    *)
8753636c353eSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8754636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8755636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8756636c353eSmrg      else
8757636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
8758636c353eSmrg      fi
8759636c353eSmrg      ;;
8760636c353eSmrg    esac
8761e07dc26bSmrg
8762636c353eSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
8763636c353eSmrg      runpath_var=
8764636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8765636c353eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8766636c353eSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
8767636c353eSmrg    fi
8768636c353eSmrg  else
8769636c353eSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
8770636c353eSmrg    case $host_os in
8771636c353eSmrg    aix3*)
8772636c353eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8773636c353eSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
8774636c353eSmrg      _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'
8775636c353eSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
8776636c353eSmrg      # are no directories specified by -L.
8777636c353eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
8778636c353eSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
8779636c353eSmrg	# Neither direct hardcoding nor static linking is supported with a
8780636c353eSmrg	# broken collect2.
8781636c353eSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
8782636c353eSmrg      fi
8783636c353eSmrg      ;;
8784e07dc26bSmrg
8785636c353eSmrg    aix[[4-9]]*)
8786636c353eSmrg      if test ia64 = "$host_cpu"; then
8787636c353eSmrg	# On IA64, the linker does run time linking by default, so we don't
8788636c353eSmrg	# have to do anything special.
8789636c353eSmrg	aix_use_runtimelinking=no
8790636c353eSmrg	exp_sym_flag='-Bexport'
8791636c353eSmrg	no_entry_flag=
8792636c353eSmrg      else
8793636c353eSmrg	# If we're using GNU nm, then we don't want the "-C" option.
8794636c353eSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
8795636c353eSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
8796636c353eSmrg	# weak defined symbols like other global defined symbols, whereas
8797636c353eSmrg	# GNU nm marks them as "W".
8798636c353eSmrg	# While the 'weak' keyword is ignored in the Export File, we need
8799636c353eSmrg	# it in the Import File for the 'aix-soname' feature, so we have
8800636c353eSmrg	# to replace the "-B" option with "-P" for AIX nm.
8801636c353eSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8802636c353eSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
8803636c353eSmrg	else
8804636c353eSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
8805636c353eSmrg	fi
8806636c353eSmrg	aix_use_runtimelinking=no
8807e07dc26bSmrg
8808636c353eSmrg	# Test if we are trying to use run time linking or normal
8809636c353eSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
8810636c353eSmrg	# have runtime linking enabled, and use it for executables.
8811636c353eSmrg	# For shared libraries, we enable/disable runtime linking
8812636c353eSmrg	# depending on the kind of the shared library created -
8813636c353eSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
8814636c353eSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
8815636c353eSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
8816636c353eSmrg	#            lib.a           static archive
8817636c353eSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
8818636c353eSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
8819636c353eSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
8820636c353eSmrg	#            lib.a(lib.so.V) shared, rtl:no
8821636c353eSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
8822636c353eSmrg	#            lib.a           static archive
8823636c353eSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
8824636c353eSmrg	  for ld_flag in $LDFLAGS; do
8825636c353eSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
8826636c353eSmrg	    aix_use_runtimelinking=yes
8827636c353eSmrg	    break
8828636c353eSmrg	  fi
8829636c353eSmrg	  done
8830636c353eSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
8831636c353eSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
8832636c353eSmrg	    # so we don't have lib.a shared libs to link our executables.
8833636c353eSmrg	    # We have to force runtime linking in this case.
8834636c353eSmrg	    aix_use_runtimelinking=yes
8835636c353eSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
8836636c353eSmrg	  fi
8837636c353eSmrg	  ;;
8838636c353eSmrg	esac
8839e07dc26bSmrg
8840636c353eSmrg	exp_sym_flag='-bexport'
8841636c353eSmrg	no_entry_flag='-bnoentry'
8842636c353eSmrg      fi
8843e07dc26bSmrg
8844636c353eSmrg      # When large executables or shared objects are built, AIX ld can
8845636c353eSmrg      # have problems creating the table of contents.  If linking a library
8846636c353eSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
8847636c353eSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8848636c353eSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8849e07dc26bSmrg
8850636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)=''
8851636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
8852636c353eSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
8853636c353eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
8854636c353eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
8855636c353eSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
8856636c353eSmrg      case $with_aix_soname,$aix_use_runtimelinking in
8857636c353eSmrg      aix,*) ;; # traditional, no import file
8858636c353eSmrg      svr4,* | *,yes) # use import file
8859636c353eSmrg	# The Import File defines what to hardcode.
8860636c353eSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
8861636c353eSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8862636c353eSmrg	;;
8863636c353eSmrg      esac
8864e07dc26bSmrg
8865636c353eSmrg      if test yes = "$GCC"; then
8866636c353eSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
8867636c353eSmrg	# We only want to do this on AIX 4.2 and lower, the check
8868636c353eSmrg	# below for broken collect2 doesn't work under 4.3+
8869636c353eSmrg	  collect2name=`$CC -print-prog-name=collect2`
8870636c353eSmrg	  if test -f "$collect2name" &&
8871636c353eSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8872636c353eSmrg	  then
8873636c353eSmrg	  # We have reworked collect2
8874636c353eSmrg	  :
8875636c353eSmrg	  else
8876636c353eSmrg	  # We have old collect2
8877636c353eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
8878636c353eSmrg	  # It fails to find uninstalled libraries when the uninstalled
8879636c353eSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
8880636c353eSmrg	  # to unsupported forces relinking
8881636c353eSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
8882636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8883636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
8884636c353eSmrg	  fi
8885636c353eSmrg	  ;;
8886636c353eSmrg	esac
8887636c353eSmrg	shared_flag='-shared'
8888636c353eSmrg	if test yes = "$aix_use_runtimelinking"; then
8889636c353eSmrg	  shared_flag="$shared_flag "'$wl-G'
8890e07dc26bSmrg	fi
8891636c353eSmrg	# Need to ensure runtime linking is disabled for the traditional
8892636c353eSmrg	# shared library, or the linker may eventually find shared libraries
8893636c353eSmrg	# /with/ Import File - we do not want to mix them.
8894636c353eSmrg	shared_flag_aix='-shared'
8895636c353eSmrg	shared_flag_svr4='-shared $wl-G'
8896636c353eSmrg      else
8897636c353eSmrg	# not using gcc
8898636c353eSmrg	if test ia64 = "$host_cpu"; then
8899636c353eSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8900636c353eSmrg	# chokes on -Wl,-G. The following line is correct:
8901636c353eSmrg	  shared_flag='-G'
8902636c353eSmrg	else
8903636c353eSmrg	  if test yes = "$aix_use_runtimelinking"; then
8904636c353eSmrg	    shared_flag='$wl-G'
8905636c353eSmrg	  else
8906636c353eSmrg	    shared_flag='$wl-bM:SRE'
8907636c353eSmrg	  fi
8908636c353eSmrg	  shared_flag_aix='$wl-bM:SRE'
8909636c353eSmrg	  shared_flag_svr4='$wl-G'
8910636c353eSmrg	fi
8911636c353eSmrg      fi
8912e07dc26bSmrg
8913636c353eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
8914636c353eSmrg      # It seems that -bexpall does not export symbols beginning with
8915636c353eSmrg      # underscore (_), so it is better to generate a list of symbols to export.
8916636c353eSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
8917636c353eSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
8918636c353eSmrg	# Warning - without using the other runtime loading flags (-brtl),
8919636c353eSmrg	# -berok will link without error, but may produce a broken library.
8920636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
8921636c353eSmrg        # Determine the default libpath from the value encoded in an
8922636c353eSmrg        # empty executable.
8923636c353eSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
8924636c353eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
8925636c353eSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
8926636c353eSmrg      else
8927636c353eSmrg	if test ia64 = "$host_cpu"; then
8928636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
8929636c353eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8930636c353eSmrg	  _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"
8931636c353eSmrg	else
8932636c353eSmrg	 # Determine the default libpath from the value encoded in an
8933636c353eSmrg	 # empty executable.
8934636c353eSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
8935636c353eSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
8936636c353eSmrg	  # Warning - without using the other run time loading flags,
8937636c353eSmrg	  # -berok will link without error, but may produce a broken library.
8938636c353eSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
8939636c353eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
8940636c353eSmrg	  if test yes = "$with_gnu_ld"; then
8941636c353eSmrg	    # We only use this code for GNU lds that support --whole-archive.
8942636c353eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
8943636c353eSmrg	  else
8944636c353eSmrg	    # Exported symbols can be pulled into shared objects from archives
8945636c353eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
8946636c353eSmrg	  fi
8947636c353eSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
8948636c353eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
8949636c353eSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
8950636c353eSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
8951636c353eSmrg	  if test svr4 != "$with_aix_soname"; then
8952636c353eSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
8953636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
8954636c353eSmrg	  fi
8955636c353eSmrg	  if test aix != "$with_aix_soname"; then
8956636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
8957636c353eSmrg	  else
8958636c353eSmrg	    # used by -dlpreopen to get the symbols
8959636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
8960636c353eSmrg	  fi
8961636c353eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
8962636c353eSmrg	fi
8963636c353eSmrg      fi
8964636c353eSmrg      ;;
8965e07dc26bSmrg
8966636c353eSmrg    amigaos*)
8967636c353eSmrg      case $host_cpu in
8968636c353eSmrg      powerpc)
8969636c353eSmrg            # see comment about AmigaOS4 .so support
8970636c353eSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8971636c353eSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
8972636c353eSmrg        ;;
8973636c353eSmrg      m68k)
8974636c353eSmrg            _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)'
8975636c353eSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8976636c353eSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
8977636c353eSmrg        ;;
8978636c353eSmrg      esac
8979636c353eSmrg      ;;
8980e07dc26bSmrg
8981636c353eSmrg    bsdi[[45]]*)
8982636c353eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
8983e07dc26bSmrg      ;;
8984636c353eSmrg
8985636c353eSmrg    cygwin* | mingw* | pw32* | cegcc*)
8986636c353eSmrg      # When not using gcc, we currently assume that we are using
8987636c353eSmrg      # Microsoft Visual C++ or Intel C++ Compiler.
8988636c353eSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
8989636c353eSmrg      # no search path for DLLs.
8990636c353eSmrg      case $cc_basename in
8991636c353eSmrg      cl* | icl*)
8992636c353eSmrg	# Native MSVC or ICC
8993636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
8994636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
8995636c353eSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
8996636c353eSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
8997636c353eSmrg	# Tell ltmain to make .lib files, not .a files.
8998636c353eSmrg	libext=lib
8999636c353eSmrg	# Tell ltmain to make .dll files, not .so files.
9000636c353eSmrg	shrext_cmds=.dll
9001636c353eSmrg	# FIXME: Setting linknames here is a bad hack.
9002636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
9003636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
9004636c353eSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
9005636c353eSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
9006636c353eSmrg          else
9007636c353eSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
9008636c353eSmrg          fi~
9009636c353eSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9010636c353eSmrg          linknames='
9011636c353eSmrg	# The linker will not automatically build a static lib if we build a DLL.
9012636c353eSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9013636c353eSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9014636c353eSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
9015636c353eSmrg	_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'
9016636c353eSmrg	# Don't use ranlib
9017636c353eSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
9018636c353eSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
9019636c353eSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
9020636c353eSmrg          case $lt_outputfile in
9021636c353eSmrg            *.exe|*.EXE) ;;
9022636c353eSmrg            *)
9023636c353eSmrg              lt_outputfile=$lt_outputfile.exe
9024636c353eSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
9025636c353eSmrg              ;;
9026636c353eSmrg          esac~
9027636c353eSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
9028636c353eSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9029636c353eSmrg            $RM "$lt_outputfile.manifest";
9030636c353eSmrg          fi'
9031636c353eSmrg	;;
9032636c353eSmrg      *)
9033636c353eSmrg	# Assume MSVC and ICC wrapper
9034636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9035636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9036636c353eSmrg	# Tell ltmain to make .lib files, not .a files.
9037636c353eSmrg	libext=lib
9038636c353eSmrg	# Tell ltmain to make .dll files, not .so files.
9039636c353eSmrg	shrext_cmds=.dll
9040636c353eSmrg	# FIXME: Setting linknames here is a bad hack.
9041636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
9042636c353eSmrg	# The linker will automatically build a .lib file if we build a DLL.
9043636c353eSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9044636c353eSmrg	# FIXME: Should let the user specify the lib program.
9045636c353eSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
9046636c353eSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9047636c353eSmrg	;;
9048636c353eSmrg      esac
9049e07dc26bSmrg      ;;
9050e07dc26bSmrg
9051636c353eSmrg    darwin* | rhapsody*)
9052636c353eSmrg      _LT_DARWIN_LINKER_FEATURES($1)
9053636c353eSmrg      ;;
9054e07dc26bSmrg
9055636c353eSmrg    dgux*)
9056636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9057636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9058636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9059636c353eSmrg      ;;
9060e07dc26bSmrg
9061636c353eSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
9062636c353eSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
9063636c353eSmrg    # does not break anything, and helps significantly (at the cost of a little
9064636c353eSmrg    # extra space).
9065636c353eSmrg    freebsd2.2*)
9066636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
9067636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9068636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9069636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9070636c353eSmrg      ;;
9071e07dc26bSmrg
9072636c353eSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9073636c353eSmrg    freebsd2.*)
9074636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9075636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9076636c353eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9077636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9078e07dc26bSmrg      ;;
9079e07dc26bSmrg
9080636c353eSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9081636c353eSmrg    freebsd* | dragonfly* | midnightbsd*)
9082636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9083636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9084636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9085636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9086636c353eSmrg      ;;
9087e07dc26bSmrg
9088636c353eSmrg    hpux9*)
9089636c353eSmrg      if test yes = "$GCC"; then
9090636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9091636c353eSmrg      else
9092636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9093636c353eSmrg      fi
9094636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9095636c353eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9096636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9097e07dc26bSmrg
9098636c353eSmrg      # hardcode_minus_L: Not really in the search PATH,
9099636c353eSmrg      # but as the default location of the library.
9100636c353eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9101636c353eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9102636c353eSmrg      ;;
9103e07dc26bSmrg
9104636c353eSmrg    hpux10*)
9105636c353eSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
9106636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9107636c353eSmrg      else
9108636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9109636c353eSmrg      fi
9110636c353eSmrg      if test no = "$with_gnu_ld"; then
9111636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9112636c353eSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9113636c353eSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
9114636c353eSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9115636c353eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9116636c353eSmrg	# hardcode_minus_L: Not really in the search PATH,
9117636c353eSmrg	# but as the default location of the library.
9118636c353eSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
9119636c353eSmrg      fi
9120636c353eSmrg      ;;
9121e07dc26bSmrg
9122636c353eSmrg    hpux11*)
9123636c353eSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
9124636c353eSmrg	case $host_cpu in
9125636c353eSmrg	hppa*64*)
9126636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9127636c353eSmrg	  ;;
9128636c353eSmrg	ia64*)
9129636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9130636c353eSmrg	  ;;
9131636c353eSmrg	*)
9132636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9133636c353eSmrg	  ;;
9134636c353eSmrg	esac
9135636c353eSmrg      else
9136636c353eSmrg	case $host_cpu in
9137636c353eSmrg	hppa*64*)
9138636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9139636c353eSmrg	  ;;
9140636c353eSmrg	ia64*)
9141636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9142636c353eSmrg	  ;;
9143636c353eSmrg	*)
9144636c353eSmrg	m4_if($1, [], [
9145636c353eSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
9146636c353eSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
9147636c353eSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
9148636c353eSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
9149636c353eSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
9150636c353eSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
9151636c353eSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
9152636c353eSmrg	  ;;
9153636c353eSmrg	esac
9154636c353eSmrg      fi
9155636c353eSmrg      if test no = "$with_gnu_ld"; then
9156636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9157636c353eSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9158e07dc26bSmrg
9159636c353eSmrg	case $host_cpu in
9160636c353eSmrg	hppa*64*|ia64*)
9161636c353eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
9162636c353eSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9163636c353eSmrg	  ;;
9164636c353eSmrg	*)
9165636c353eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
9166636c353eSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9167636c353eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9168e07dc26bSmrg
9169636c353eSmrg	  # hardcode_minus_L: Not really in the search PATH,
9170636c353eSmrg	  # but as the default location of the library.
9171636c353eSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
9172636c353eSmrg	  ;;
9173636c353eSmrg	esac
9174636c353eSmrg      fi
9175636c353eSmrg      ;;
9176e07dc26bSmrg
9177636c353eSmrg    irix5* | irix6* | nonstopux*)
9178636c353eSmrg      if test yes = "$GCC"; then
9179636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9180636c353eSmrg	# Try to use the -exported_symbol ld option, if it does not
9181636c353eSmrg	# work, assume that -exports_file does not work either and
9182636c353eSmrg	# implicitly export all symbols.
9183636c353eSmrg	# This should be the same for all languages, so no per-tag cache variable.
9184636c353eSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
9185636c353eSmrg	  [lt_cv_irix_exported_symbol],
9186636c353eSmrg	  [save_LDFLAGS=$LDFLAGS
9187636c353eSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
9188636c353eSmrg	   AC_LINK_IFELSE(
9189636c353eSmrg	     [AC_LANG_SOURCE(
9190636c353eSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
9191636c353eSmrg			      [C++], [[int foo (void) { return 0; }]],
9192636c353eSmrg			      [Fortran 77], [[
9193636c353eSmrg      subroutine foo
9194636c353eSmrg      end]],
9195636c353eSmrg			      [Fortran], [[
9196636c353eSmrg      subroutine foo
9197636c353eSmrg      end]])])],
9198636c353eSmrg	      [lt_cv_irix_exported_symbol=yes],
9199636c353eSmrg	      [lt_cv_irix_exported_symbol=no])
9200636c353eSmrg           LDFLAGS=$save_LDFLAGS])
9201636c353eSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
9202636c353eSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
9203636c353eSmrg	fi
9204636c353eSmrg      else
9205636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9206636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
9207636c353eSmrg      fi
9208636c353eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9209636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9210636c353eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9211636c353eSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
9212636c353eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9213636c353eSmrg      ;;
9214e07dc26bSmrg
9215636c353eSmrg    linux*)
9216636c353eSmrg      case $cc_basename in
9217636c353eSmrg      tcc*)
9218636c353eSmrg	# Fabrice Bellard et al's Tiny C Compiler
9219636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
9220636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9221636c353eSmrg	;;
9222636c353eSmrg      esac
9223636c353eSmrg      ;;
9224e07dc26bSmrg
9225636c353eSmrg    netbsd*)
9226636c353eSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9227636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
9228636c353eSmrg      else
9229636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
9230636c353eSmrg      fi
9231636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9232636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9233636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9234636c353eSmrg      ;;
9235e07dc26bSmrg
9236636c353eSmrg    newsos6)
9237636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9238636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9239636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9240636c353eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9241636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9242636c353eSmrg      ;;
9243e07dc26bSmrg
9244636c353eSmrg    *nto* | *qnx*)
9245636c353eSmrg      ;;
9246e07dc26bSmrg
9247636c353eSmrg    openbsd* | bitrig*)
9248636c353eSmrg      if test -f /usr/libexec/ld.so; then
9249636c353eSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
9250636c353eSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9251636c353eSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9252636c353eSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
9253636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9254636c353eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
9255636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9256636c353eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9257636c353eSmrg	else
9258636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9259636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9260636c353eSmrg	fi
9261636c353eSmrg      else
9262636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
9263636c353eSmrg      fi
9264636c353eSmrg      ;;
9265e07dc26bSmrg
9266636c353eSmrg    os2*)
9267636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9268636c353eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9269636c353eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9270636c353eSmrg      shrext_cmds=.dll
9271636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9272636c353eSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9273636c353eSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9274636c353eSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
9275636c353eSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9276636c353eSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9277636c353eSmrg	emximp -o $lib $output_objdir/$libname.def'
9278636c353eSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9279636c353eSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9280636c353eSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9281636c353eSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
9282636c353eSmrg	prefix_cmds="$SED"~
9283636c353eSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
9284636c353eSmrg	  prefix_cmds="$prefix_cmds -e 1d";
9285636c353eSmrg	fi~
9286636c353eSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9287636c353eSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9288636c353eSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9289636c353eSmrg	emximp -o $lib $output_objdir/$libname.def'
9290636c353eSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9291636c353eSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9292636c353eSmrg      _LT_TAGVAR(file_list_spec, $1)='@'
9293636c353eSmrg      ;;
9294e07dc26bSmrg
9295636c353eSmrg    osf3*)
9296636c353eSmrg      if test yes = "$GCC"; then
9297636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9298636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9299636c353eSmrg      else
9300636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9301636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9302636c353eSmrg      fi
9303636c353eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9304636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9305636c353eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9306636c353eSmrg      ;;
9307e07dc26bSmrg
9308636c353eSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
9309636c353eSmrg      if test yes = "$GCC"; then
9310636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9311636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9312636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9313636c353eSmrg      else
9314636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9315636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9316636c353eSmrg	_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~
9317636c353eSmrg          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
9318e07dc26bSmrg
9319636c353eSmrg	# Both c and cxx compiler support -rpath directly
9320636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9321636c353eSmrg      fi
9322636c353eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9323636c353eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9324636c353eSmrg      ;;
9325e07dc26bSmrg
9326636c353eSmrg    solaris*)
9327636c353eSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
9328636c353eSmrg      if test yes = "$GCC"; then
9329636c353eSmrg	wlarc='$wl'
9330636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9331636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9332636c353eSmrg          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9333636c353eSmrg      else
9334636c353eSmrg	case `$CC -V 2>&1` in
9335636c353eSmrg	*"Compilers 5.0"*)
9336636c353eSmrg	  wlarc=''
9337636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
9338636c353eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9339636c353eSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
9340636c353eSmrg	  ;;
9341636c353eSmrg	*)
9342636c353eSmrg	  wlarc='$wl'
9343636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
9344636c353eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9345636c353eSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9346636c353eSmrg	  ;;
9347636c353eSmrg	esac
9348636c353eSmrg      fi
9349636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9350636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9351636c353eSmrg      case $host_os in
9352636c353eSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
9353636c353eSmrg      *)
9354636c353eSmrg	# The compiler driver will combine and reorder linker options,
9355636c353eSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
9356636c353eSmrg	# but is careful enough not to reorder.
9357636c353eSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
9358636c353eSmrg	if test yes = "$GCC"; then
9359636c353eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
9360636c353eSmrg	else
9361636c353eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
9362636c353eSmrg	fi
9363636c353eSmrg	;;
9364636c353eSmrg      esac
9365636c353eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9366636c353eSmrg      ;;
9367e07dc26bSmrg
9368636c353eSmrg    sunos4*)
9369636c353eSmrg      if test sequent = "$host_vendor"; then
9370636c353eSmrg	# Use $CC to link under sequent, because it throws in some extra .o
9371636c353eSmrg	# files that make .init and .fini sections work.
9372636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
9373636c353eSmrg      else
9374636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
9375636c353eSmrg      fi
9376636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9377636c353eSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
9378636c353eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9379636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9380636c353eSmrg      ;;
9381e07dc26bSmrg
9382636c353eSmrg    sysv4)
9383636c353eSmrg      case $host_vendor in
9384636c353eSmrg	sni)
9385636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9386636c353eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
9387636c353eSmrg	;;
9388636c353eSmrg	siemens)
9389636c353eSmrg	  ## LD is ld it makes a PLAMLIB
9390636c353eSmrg	  ## CC just makes a GrossModule.
9391636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
9392636c353eSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
9393636c353eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
9394636c353eSmrg        ;;
9395636c353eSmrg	motorola)
9396636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9397636c353eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
9398636c353eSmrg	;;
9399636c353eSmrg      esac
9400636c353eSmrg      runpath_var='LD_RUN_PATH'
9401636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9402636c353eSmrg      ;;
9403e07dc26bSmrg
9404636c353eSmrg    sysv4.3*)
9405636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9406636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9407636c353eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
9408636c353eSmrg      ;;
9409e07dc26bSmrg
9410636c353eSmrg    sysv4*MP*)
9411636c353eSmrg      if test -d /usr/nec; then
9412636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9413636c353eSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9414636c353eSmrg	runpath_var=LD_RUN_PATH
9415636c353eSmrg	hardcode_runpath_var=yes
9416636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
9417636c353eSmrg      fi
9418636c353eSmrg      ;;
9419e07dc26bSmrg
9420636c353eSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
9421636c353eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
9422636c353eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9423636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9424636c353eSmrg      runpath_var='LD_RUN_PATH'
9425e07dc26bSmrg
9426636c353eSmrg      if test yes = "$GCC"; then
9427636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9428636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9429636c353eSmrg      else
9430636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9431636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9432636c353eSmrg      fi
9433636c353eSmrg      ;;
9434e07dc26bSmrg
9435636c353eSmrg    sysv5* | sco3.2v5* | sco5v6*)
9436636c353eSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
9437636c353eSmrg      # link with -lc, and that would cause any symbols used from libc to
9438636c353eSmrg      # always be unresolved, which means just about no library would
9439636c353eSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
9440636c353eSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
9441636c353eSmrg      # as -z defs.
9442636c353eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
9443636c353eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
9444636c353eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
9445636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9446636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
9447636c353eSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9448636c353eSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
9449636c353eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
9450636c353eSmrg      runpath_var='LD_RUN_PATH'
9451e07dc26bSmrg
9452636c353eSmrg      if test yes = "$GCC"; then
9453636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9454636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9455636c353eSmrg      else
9456636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9457636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9458636c353eSmrg      fi
9459636c353eSmrg      ;;
9460e07dc26bSmrg
9461636c353eSmrg    uts4*)
9462636c353eSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9463636c353eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9464636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9465636c353eSmrg      ;;
9466e07dc26bSmrg
9467636c353eSmrg    *)
9468636c353eSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
9469636c353eSmrg      ;;
9470636c353eSmrg    esac
9471e07dc26bSmrg
9472636c353eSmrg    if test sni = "$host_vendor"; then
9473636c353eSmrg      case $host in
9474636c353eSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9475636c353eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
9476636c353eSmrg	;;
9477636c353eSmrg      esac
9478636c353eSmrg    fi
9479636c353eSmrg  fi
9480636c353eSmrg])
9481636c353eSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
9482636c353eSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
9483e07dc26bSmrg
9484636c353eSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
9485e07dc26bSmrg
9486636c353eSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
9487636c353eSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
9488636c353eSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
9489636c353eSmrg    [The commands to extract the exported symbol list from a shared archive])
9490e07dc26bSmrg
9491e07dc26bSmrg#
9492636c353eSmrg# Do we need to explicitly link libc?
9493e07dc26bSmrg#
9494636c353eSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
9495636c353eSmrgx|xyes)
9496636c353eSmrg  # Assume -lc should be added
9497636c353eSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9498e07dc26bSmrg
9499636c353eSmrg  if test yes,yes = "$GCC,$enable_shared"; then
9500636c353eSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
9501636c353eSmrg    *'~'*)
9502636c353eSmrg      # FIXME: we may have to deal with multi-command sequences.
9503636c353eSmrg      ;;
9504636c353eSmrg    '$CC '*)
9505636c353eSmrg      # Test whether the compiler implicitly links with -lc since on some
9506636c353eSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
9507636c353eSmrg      # to ld, don't add -lc before -lgcc.
9508636c353eSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
9509636c353eSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
9510636c353eSmrg	[$RM conftest*
9511636c353eSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9512e07dc26bSmrg
9513636c353eSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
9514636c353eSmrg	  soname=conftest
9515636c353eSmrg	  lib=conftest
9516636c353eSmrg	  libobjs=conftest.$ac_objext
9517636c353eSmrg	  deplibs=
9518636c353eSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
9519636c353eSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
9520636c353eSmrg	  compiler_flags=-v
9521636c353eSmrg	  linker_flags=-v
9522636c353eSmrg	  verstring=
9523636c353eSmrg	  output_objdir=.
9524636c353eSmrg	  libname=conftest
9525636c353eSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
9526636c353eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
9527636c353eSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
9528636c353eSmrg	  then
9529636c353eSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9530636c353eSmrg	  else
9531636c353eSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9532636c353eSmrg	  fi
9533636c353eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
9534636c353eSmrg	else
9535636c353eSmrg	  cat conftest.err 1>&5
9536636c353eSmrg	fi
9537636c353eSmrg	$RM conftest*
9538636c353eSmrg	])
9539636c353eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
9540636c353eSmrg      ;;
9541636c353eSmrg    esac
9542636c353eSmrg  fi
9543636c353eSmrg  ;;
9544636c353eSmrgesac
9545e07dc26bSmrg
9546636c353eSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
9547636c353eSmrg    [Whether or not to add -lc for building shared libraries])
9548636c353eSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
9549636c353eSmrg    [enable_shared_with_static_runtimes], [0],
9550636c353eSmrg    [Whether or not to disallow shared libs when runtime libs are static])
9551636c353eSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
9552636c353eSmrg    [Compiler flag to allow reflexive dlopens])
9553636c353eSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
9554636c353eSmrg    [Compiler flag to generate shared objects directly from archives])
9555636c353eSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
9556636c353eSmrg    [Whether the compiler copes with passing no objects directly])
9557636c353eSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
9558636c353eSmrg    [Create an old-style archive from a shared archive])
9559636c353eSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
9560636c353eSmrg    [Create a temporary old-style archive to link instead of a shared archive])
9561636c353eSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
9562636c353eSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
9563636c353eSmrg_LT_TAGDECL([], [module_cmds], [2],
9564636c353eSmrg    [Commands used to build a loadable module if different from building
9565636c353eSmrg    a shared archive.])
9566636c353eSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
9567636c353eSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
9568636c353eSmrg    [Whether we are building with GNU ld or not])
9569636c353eSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
9570636c353eSmrg    [Flag that allows shared libraries with undefined symbols to be built])
9571636c353eSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
9572636c353eSmrg    [Flag that enforces no undefined symbols])
9573636c353eSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
9574636c353eSmrg    [Flag to hardcode $libdir into a binary during linking.
9575636c353eSmrg    This must work even if $libdir does not exist])
9576636c353eSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
9577636c353eSmrg    [Whether we need a single "-rpath" flag with a separated argument])
9578636c353eSmrg_LT_TAGDECL([], [hardcode_direct], [0],
9579636c353eSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
9580636c353eSmrg    DIR into the resulting binary])
9581636c353eSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
9582636c353eSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
9583636c353eSmrg    DIR into the resulting binary and the resulting library dependency is
9584636c353eSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
9585636c353eSmrg    library is relocated])
9586636c353eSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
9587636c353eSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
9588636c353eSmrg    into the resulting binary])
9589636c353eSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
9590636c353eSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
9591636c353eSmrg    into the resulting binary])
9592636c353eSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
9593636c353eSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
9594636c353eSmrg    into the library and all subsequent libraries and executables linked
9595636c353eSmrg    against it])
9596636c353eSmrg_LT_TAGDECL([], [inherit_rpath], [0],
9597636c353eSmrg    [Set to yes if linker adds runtime paths of dependent libraries
9598636c353eSmrg    to runtime path list])
9599636c353eSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
9600636c353eSmrg    [Whether libtool must link a program against all its dependency libraries])
9601636c353eSmrg_LT_TAGDECL([], [always_export_symbols], [0],
9602636c353eSmrg    [Set to "yes" if exported symbols are required])
9603636c353eSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
9604636c353eSmrg    [The commands to list exported symbols])
9605636c353eSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
9606636c353eSmrg    [Symbols that should not be listed in the preloaded symbols])
9607636c353eSmrg_LT_TAGDECL([], [include_expsyms], [1],
9608636c353eSmrg    [Symbols that must always be exported])
9609636c353eSmrg_LT_TAGDECL([], [prelink_cmds], [2],
9610636c353eSmrg    [Commands necessary for linking programs (against libraries) with templates])
9611636c353eSmrg_LT_TAGDECL([], [postlink_cmds], [2],
9612636c353eSmrg    [Commands necessary for finishing linking programs])
9613636c353eSmrg_LT_TAGDECL([], [file_list_spec], [1],
9614636c353eSmrg    [Specify filename containing input files])
9615636c353eSmrgdnl FIXME: Not yet implemented
9616636c353eSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
9617636c353eSmrgdnl    [Compiler flag to generate thread safe objects])
9618636c353eSmrg])# _LT_LINKER_SHLIBS
9619e07dc26bSmrg
9620e07dc26bSmrg
9621636c353eSmrg# _LT_LANG_C_CONFIG([TAG])
9622636c353eSmrg# ------------------------
9623636c353eSmrg# Ensure that the configuration variables for a C compiler are suitably
9624636c353eSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
9625636c353eSmrg# the compiler configuration to 'libtool'.
9626636c353eSmrgm4_defun([_LT_LANG_C_CONFIG],
9627636c353eSmrg[m4_require([_LT_DECL_EGREP])dnl
9628636c353eSmrglt_save_CC=$CC
9629636c353eSmrgAC_LANG_PUSH(C)
9630e07dc26bSmrg
9631636c353eSmrg# Source file extension for C test sources.
9632636c353eSmrgac_ext=c
9633e07dc26bSmrg
9634636c353eSmrg# Object file extension for compiled C test sources.
9635636c353eSmrgobjext=o
9636636c353eSmrg_LT_TAGVAR(objext, $1)=$objext
9637e07dc26bSmrg
9638636c353eSmrg# Code to be used in simple compile tests
9639636c353eSmrglt_simple_compile_test_code="int some_variable = 0;"
9640e07dc26bSmrg
9641636c353eSmrg# Code to be used in simple link tests
9642636c353eSmrglt_simple_link_test_code='int main(){return(0);}'
9643e07dc26bSmrg
9644636c353eSmrg_LT_TAG_COMPILER
9645636c353eSmrg# Save the default compiler, since it gets overwritten when the other
9646636c353eSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
9647636c353eSmrgcompiler_DEFAULT=$CC
9648e07dc26bSmrg
9649636c353eSmrg# save warnings/boilerplate of simple test code
9650636c353eSmrg_LT_COMPILER_BOILERPLATE
9651636c353eSmrg_LT_LINKER_BOILERPLATE
9652e07dc26bSmrg
9653636c353eSmrgif test -n "$compiler"; then
9654636c353eSmrg  _LT_COMPILER_NO_RTTI($1)
9655636c353eSmrg  _LT_COMPILER_PIC($1)
9656636c353eSmrg  _LT_COMPILER_C_O($1)
9657636c353eSmrg  _LT_COMPILER_FILE_LOCKS($1)
9658636c353eSmrg  _LT_LINKER_SHLIBS($1)
9659636c353eSmrg  _LT_SYS_DYNAMIC_LINKER($1)
9660636c353eSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
9661636c353eSmrg  LT_SYS_DLOPEN_SELF
9662636c353eSmrg  _LT_CMD_STRIPLIB
9663e07dc26bSmrg
9664636c353eSmrg  # Report what library types will actually be built
9665636c353eSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
9666636c353eSmrg  AC_MSG_RESULT([$can_build_shared])
9667e07dc26bSmrg
9668636c353eSmrg  AC_MSG_CHECKING([whether to build shared libraries])
9669636c353eSmrg  test no = "$can_build_shared" && enable_shared=no
9670e07dc26bSmrg
9671636c353eSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
9672636c353eSmrg  # are all built from PIC.
9673636c353eSmrg  case $host_os in
9674636c353eSmrg  aix3*)
9675636c353eSmrg    test yes = "$enable_shared" && enable_static=no
9676636c353eSmrg    if test -n "$RANLIB"; then
9677636c353eSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
9678636c353eSmrg      postinstall_cmds='$RANLIB $lib'
9679636c353eSmrg    fi
9680636c353eSmrg    ;;
9681e07dc26bSmrg
9682636c353eSmrg  aix[[4-9]]*)
9683636c353eSmrg    if test ia64 != "$host_cpu"; then
9684636c353eSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
9685636c353eSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
9686636c353eSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
9687636c353eSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
9688636c353eSmrg      esac
9689636c353eSmrg    fi
9690636c353eSmrg    ;;
9691636c353eSmrg  esac
9692636c353eSmrg  AC_MSG_RESULT([$enable_shared])
9693e07dc26bSmrg
9694636c353eSmrg  AC_MSG_CHECKING([whether to build static libraries])
9695636c353eSmrg  # Make sure either enable_shared or enable_static is yes.
9696636c353eSmrg  test yes = "$enable_shared" || enable_static=yes
9697636c353eSmrg  AC_MSG_RESULT([$enable_static])
9698e07dc26bSmrg
9699636c353eSmrg  _LT_CONFIG($1)
9700636c353eSmrgfi
9701636c353eSmrgAC_LANG_POP
9702636c353eSmrgCC=$lt_save_CC
9703636c353eSmrg])# _LT_LANG_C_CONFIG
9704e07dc26bSmrg
9705e07dc26bSmrg
9706636c353eSmrg# _LT_LANG_CXX_CONFIG([TAG])
9707636c353eSmrg# --------------------------
9708636c353eSmrg# Ensure that the configuration variables for a C++ compiler are suitably
9709636c353eSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
9710636c353eSmrg# the compiler configuration to 'libtool'.
9711636c353eSmrgm4_defun([_LT_LANG_CXX_CONFIG],
9712636c353eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
9713636c353eSmrgm4_require([_LT_DECL_EGREP])dnl
9714636c353eSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
9715636c353eSmrgif test -n "$CXX" && ( test no != "$CXX" &&
9716636c353eSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
9717636c353eSmrg    (test g++ != "$CXX"))); then
9718636c353eSmrg  AC_PROG_CXXCPP
9719636c353eSmrgelse
9720636c353eSmrg  _lt_caught_CXX_error=yes
9721636c353eSmrgfi
9722e07dc26bSmrg
9723636c353eSmrgAC_LANG_PUSH(C++)
9724636c353eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
9725636c353eSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
9726636c353eSmrg_LT_TAGVAR(always_export_symbols, $1)=no
9727636c353eSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
9728636c353eSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
9729636c353eSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
9730636c353eSmrg_LT_TAGVAR(hardcode_direct, $1)=no
9731636c353eSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
9732636c353eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9733636c353eSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
9734636c353eSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
9735636c353eSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9736636c353eSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
9737636c353eSmrg_LT_TAGVAR(inherit_rpath, $1)=no
9738636c353eSmrg_LT_TAGVAR(module_cmds, $1)=
9739636c353eSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
9740636c353eSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
9741636c353eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9742636c353eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
9743636c353eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
9744636c353eSmrg_LT_TAGVAR(no_undefined_flag, $1)=
9745636c353eSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
9746636c353eSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9747e07dc26bSmrg
9748636c353eSmrg# Source file extension for C++ test sources.
9749636c353eSmrgac_ext=cpp
9750e07dc26bSmrg
9751636c353eSmrg# Object file extension for compiled C++ test sources.
9752636c353eSmrgobjext=o
9753636c353eSmrg_LT_TAGVAR(objext, $1)=$objext
9754e07dc26bSmrg
9755636c353eSmrg# No sense in running all these tests if we already determined that
9756636c353eSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
9757636c353eSmrg# are currently assumed to apply to all compilers on this platform,
9758636c353eSmrg# and will be corrupted by setting them based on a non-working compiler.
9759636c353eSmrgif test yes != "$_lt_caught_CXX_error"; then
9760636c353eSmrg  # Code to be used in simple compile tests
9761636c353eSmrg  lt_simple_compile_test_code="int some_variable = 0;"
9762e07dc26bSmrg
9763636c353eSmrg  # Code to be used in simple link tests
9764636c353eSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
9765e07dc26bSmrg
9766636c353eSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9767636c353eSmrg  _LT_TAG_COMPILER
9768e07dc26bSmrg
9769636c353eSmrg  # save warnings/boilerplate of simple test code
9770636c353eSmrg  _LT_COMPILER_BOILERPLATE
9771636c353eSmrg  _LT_LINKER_BOILERPLATE
9772636c353eSmrg
9773636c353eSmrg  # Allow CC to be a program name with arguments.
9774636c353eSmrg  lt_save_CC=$CC
9775636c353eSmrg  lt_save_CFLAGS=$CFLAGS
9776636c353eSmrg  lt_save_LD=$LD
9777636c353eSmrg  lt_save_GCC=$GCC
9778636c353eSmrg  GCC=$GXX
9779636c353eSmrg  lt_save_with_gnu_ld=$with_gnu_ld
9780636c353eSmrg  lt_save_path_LD=$lt_cv_path_LD
9781636c353eSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
9782636c353eSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
9783636c353eSmrg  else
9784636c353eSmrg    $as_unset lt_cv_prog_gnu_ld
9785636c353eSmrg  fi
9786636c353eSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
9787636c353eSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
9788636c353eSmrg  else
9789636c353eSmrg    $as_unset lt_cv_path_LD
9790636c353eSmrg  fi
9791636c353eSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
9792636c353eSmrg  CC=${CXX-"c++"}
9793636c353eSmrg  CFLAGS=$CXXFLAGS
9794636c353eSmrg  compiler=$CC
9795636c353eSmrg  _LT_TAGVAR(compiler, $1)=$CC
9796636c353eSmrg  _LT_CC_BASENAME([$compiler])
9797e07dc26bSmrg
9798636c353eSmrg  if test -n "$compiler"; then
9799636c353eSmrg    # We don't want -fno-exception when compiling C++ code, so set the
9800636c353eSmrg    # no_builtin_flag separately
9801636c353eSmrg    if test yes = "$GXX"; then
9802636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
9803636c353eSmrg    else
9804636c353eSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
9805636c353eSmrg    fi
9806e07dc26bSmrg
9807636c353eSmrg    if test yes = "$GXX"; then
9808636c353eSmrg      # Set up default GNU C++ configuration
9809636c353eSmrg
9810636c353eSmrg      LT_PATH_LD
9811e07dc26bSmrg
9812636c353eSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
9813636c353eSmrg      # archiving commands below assume that GNU ld is being used.
9814636c353eSmrg      if test yes = "$with_gnu_ld"; then
9815636c353eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
9816636c353eSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9817e07dc26bSmrg
9818636c353eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9819636c353eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9820e07dc26bSmrg
9821636c353eSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
9822636c353eSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
9823636c353eSmrg        #     investigate it a little bit more. (MM)
9824636c353eSmrg        wlarc='$wl'
9825e07dc26bSmrg
9826636c353eSmrg        # ancient GNU ld didn't support --whole-archive et. al.
9827636c353eSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
9828636c353eSmrg	  $GREP 'no-whole-archive' > /dev/null; then
9829636c353eSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
9830636c353eSmrg        else
9831636c353eSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
9832636c353eSmrg        fi
9833636c353eSmrg      else
9834636c353eSmrg        with_gnu_ld=no
9835636c353eSmrg        wlarc=
9836e07dc26bSmrg
9837636c353eSmrg        # A generic and very simple default shared library creation
9838636c353eSmrg        # command for GNU C++ for the case where it uses the native
9839636c353eSmrg        # linker, instead of GNU ld.  If possible, this setting should
9840636c353eSmrg        # overridden to take advantage of the native linker features on
9841636c353eSmrg        # the platform it is being used on.
9842636c353eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
9843636c353eSmrg      fi
9844e07dc26bSmrg
9845636c353eSmrg      # Commands to make compiler produce verbose output that lists
9846636c353eSmrg      # what "hidden" libraries, object files and flags are used when
9847636c353eSmrg      # linking a shared library.
9848636c353eSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
9849e07dc26bSmrg
9850636c353eSmrg    else
9851636c353eSmrg      GXX=no
9852636c353eSmrg      with_gnu_ld=no
9853636c353eSmrg      wlarc=
9854636c353eSmrg    fi
9855e07dc26bSmrg
9856636c353eSmrg    # PORTME: fill in a description of your system's C++ link characteristics
9857636c353eSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9858636c353eSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
9859636c353eSmrg    case $host_os in
9860636c353eSmrg      aix3*)
9861636c353eSmrg        # FIXME: insert proper C++ library support
9862636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
9863636c353eSmrg        ;;
9864636c353eSmrg      aix[[4-9]]*)
9865636c353eSmrg        if test ia64 = "$host_cpu"; then
9866636c353eSmrg          # On IA64, the linker does run time linking by default, so we don't
9867636c353eSmrg          # have to do anything special.
9868636c353eSmrg          aix_use_runtimelinking=no
9869636c353eSmrg          exp_sym_flag='-Bexport'
9870636c353eSmrg          no_entry_flag=
9871636c353eSmrg        else
9872636c353eSmrg          aix_use_runtimelinking=no
9873e07dc26bSmrg
9874636c353eSmrg          # Test if we are trying to use run time linking or normal
9875636c353eSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
9876636c353eSmrg          # have runtime linking enabled, and use it for executables.
9877636c353eSmrg          # For shared libraries, we enable/disable runtime linking
9878636c353eSmrg          # depending on the kind of the shared library created -
9879636c353eSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
9880636c353eSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
9881636c353eSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
9882636c353eSmrg          #            lib.a           static archive
9883636c353eSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
9884636c353eSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
9885636c353eSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
9886636c353eSmrg          #            lib.a(lib.so.V) shared, rtl:no
9887636c353eSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
9888636c353eSmrg          #            lib.a           static archive
9889636c353eSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
9890636c353eSmrg	    for ld_flag in $LDFLAGS; do
9891636c353eSmrg	      case $ld_flag in
9892636c353eSmrg	      *-brtl*)
9893636c353eSmrg	        aix_use_runtimelinking=yes
9894636c353eSmrg	        break
9895636c353eSmrg	        ;;
9896636c353eSmrg	      esac
9897636c353eSmrg	    done
9898636c353eSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
9899636c353eSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
9900636c353eSmrg	      # so we don't have lib.a shared libs to link our executables.
9901636c353eSmrg	      # We have to force runtime linking in this case.
9902636c353eSmrg	      aix_use_runtimelinking=yes
9903636c353eSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
9904636c353eSmrg	    fi
9905636c353eSmrg	    ;;
9906636c353eSmrg          esac
9907e07dc26bSmrg
9908636c353eSmrg          exp_sym_flag='-bexport'
9909636c353eSmrg          no_entry_flag='-bnoentry'
9910636c353eSmrg        fi
9911636c353eSmrg
9912636c353eSmrg        # When large executables or shared objects are built, AIX ld can
9913636c353eSmrg        # have problems creating the table of contents.  If linking a library
9914636c353eSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
9915636c353eSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
9916636c353eSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9917636c353eSmrg
9918636c353eSmrg        _LT_TAGVAR(archive_cmds, $1)=''
9919636c353eSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
9920636c353eSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9921636c353eSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9922636c353eSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
9923636c353eSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
9924636c353eSmrg        case $with_aix_soname,$aix_use_runtimelinking in
9925636c353eSmrg        aix,*) ;;	# no import file
9926636c353eSmrg        svr4,* | *,yes) # use import file
9927636c353eSmrg          # The Import File defines what to hardcode.
9928636c353eSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
9929636c353eSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
9930636c353eSmrg          ;;
9931636c353eSmrg        esac
9932636c353eSmrg
9933636c353eSmrg        if test yes = "$GXX"; then
9934636c353eSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
9935636c353eSmrg          # We only want to do this on AIX 4.2 and lower, the check
9936636c353eSmrg          # below for broken collect2 doesn't work under 4.3+
9937636c353eSmrg	  collect2name=`$CC -print-prog-name=collect2`
9938636c353eSmrg	  if test -f "$collect2name" &&
9939636c353eSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
9940636c353eSmrg	  then
9941636c353eSmrg	    # We have reworked collect2
9942636c353eSmrg	    :
9943636c353eSmrg	  else
9944636c353eSmrg	    # We have old collect2
9945636c353eSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
9946636c353eSmrg	    # It fails to find uninstalled libraries when the uninstalled
9947636c353eSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
9948636c353eSmrg	    # to unsupported forces relinking
9949636c353eSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
9950636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9951636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
9952636c353eSmrg	  fi
9953636c353eSmrg          esac
9954636c353eSmrg          shared_flag='-shared'
9955636c353eSmrg	  if test yes = "$aix_use_runtimelinking"; then
9956636c353eSmrg	    shared_flag=$shared_flag' $wl-G'
9957636c353eSmrg	  fi
9958636c353eSmrg	  # Need to ensure runtime linking is disabled for the traditional
9959636c353eSmrg	  # shared library, or the linker may eventually find shared libraries
9960636c353eSmrg	  # /with/ Import File - we do not want to mix them.
9961636c353eSmrg	  shared_flag_aix='-shared'
9962636c353eSmrg	  shared_flag_svr4='-shared $wl-G'
9963636c353eSmrg        else
9964636c353eSmrg          # not using gcc
9965636c353eSmrg          if test ia64 = "$host_cpu"; then
9966636c353eSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9967636c353eSmrg	  # chokes on -Wl,-G. The following line is correct:
9968636c353eSmrg	  shared_flag='-G'
9969636c353eSmrg          else
9970636c353eSmrg	    if test yes = "$aix_use_runtimelinking"; then
9971636c353eSmrg	      shared_flag='$wl-G'
9972636c353eSmrg	    else
9973636c353eSmrg	      shared_flag='$wl-bM:SRE'
9974636c353eSmrg	    fi
9975636c353eSmrg	    shared_flag_aix='$wl-bM:SRE'
9976636c353eSmrg	    shared_flag_svr4='$wl-G'
9977636c353eSmrg          fi
9978636c353eSmrg        fi
9979e07dc26bSmrg
9980636c353eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
9981636c353eSmrg        # It seems that -bexpall does not export symbols beginning with
9982636c353eSmrg        # underscore (_), so it is better to generate a list of symbols to
9983636c353eSmrg	# export.
9984636c353eSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
9985636c353eSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
9986636c353eSmrg          # Warning - without using the other runtime loading flags (-brtl),
9987636c353eSmrg          # -berok will link without error, but may produce a broken library.
9988636c353eSmrg          # The "-G" linker flag allows undefined symbols.
9989636c353eSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
9990636c353eSmrg          # Determine the default libpath from the value encoded in an empty
9991636c353eSmrg          # executable.
9992636c353eSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
9993636c353eSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9994e07dc26bSmrg
9995636c353eSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
9996636c353eSmrg        else
9997636c353eSmrg          if test ia64 = "$host_cpu"; then
9998636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
9999636c353eSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
10000636c353eSmrg	    _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"
10001636c353eSmrg          else
10002636c353eSmrg	    # Determine the default libpath from the value encoded in an
10003636c353eSmrg	    # empty executable.
10004636c353eSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
10005636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
10006636c353eSmrg	    # Warning - without using the other run time loading flags,
10007636c353eSmrg	    # -berok will link without error, but may produce a broken library.
10008636c353eSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
10009636c353eSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
10010636c353eSmrg	    if test yes = "$with_gnu_ld"; then
10011636c353eSmrg	      # We only use this code for GNU lds that support --whole-archive.
10012636c353eSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
10013636c353eSmrg	    else
10014636c353eSmrg	      # Exported symbols can be pulled into shared objects from archives
10015636c353eSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
10016636c353eSmrg	    fi
10017636c353eSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10018636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
10019636c353eSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
10020636c353eSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
10021636c353eSmrg	    if test svr4 != "$with_aix_soname"; then
10022636c353eSmrg	      # This is similar to how AIX traditionally builds its shared
10023636c353eSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
10024636c353eSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
10025636c353eSmrg	    fi
10026636c353eSmrg	    if test aix != "$with_aix_soname"; then
10027636c353eSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
10028636c353eSmrg	    else
10029636c353eSmrg	      # used by -dlpreopen to get the symbols
10030636c353eSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
10031636c353eSmrg	    fi
10032636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
10033636c353eSmrg          fi
10034636c353eSmrg        fi
10035636c353eSmrg        ;;
10036e07dc26bSmrg
10037636c353eSmrg      beos*)
10038636c353eSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10039636c353eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10040636c353eSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
10041636c353eSmrg	  # support --undefined.  This deserves some investigation.  FIXME
10042636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10043e07dc26bSmrg	else
10044636c353eSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
10045e07dc26bSmrg	fi
10046636c353eSmrg	;;
10047e07dc26bSmrg
10048636c353eSmrg      chorus*)
10049636c353eSmrg        case $cc_basename in
10050636c353eSmrg          *)
10051636c353eSmrg	  # FIXME: insert proper C++ library support
10052636c353eSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
10053636c353eSmrg	  ;;
10054636c353eSmrg        esac
10055636c353eSmrg        ;;
10056e07dc26bSmrg
10057636c353eSmrg      cygwin* | mingw* | pw32* | cegcc*)
10058636c353eSmrg	case $GXX,$cc_basename in
10059636c353eSmrg	,cl* | no,cl* | ,icl* | no,icl*)
10060636c353eSmrg	  # Native MSVC or ICC
10061636c353eSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
10062636c353eSmrg	  # no search path for DLLs.
10063636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
10064636c353eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10065636c353eSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
10066636c353eSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
10067636c353eSmrg	  # Tell ltmain to make .lib files, not .a files.
10068636c353eSmrg	  libext=lib
10069636c353eSmrg	  # Tell ltmain to make .dll files, not .so files.
10070636c353eSmrg	  shrext_cmds=.dll
10071636c353eSmrg	  # FIXME: Setting linknames here is a bad hack.
10072636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
10073636c353eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10074636c353eSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
10075636c353eSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
10076636c353eSmrg            else
10077636c353eSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
10078636c353eSmrg            fi~
10079636c353eSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
10080636c353eSmrg            linknames='
10081636c353eSmrg	  # The linker will not automatically build a static lib if we build a DLL.
10082636c353eSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
10083636c353eSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10084636c353eSmrg	  # Don't use ranlib
10085636c353eSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
10086636c353eSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
10087636c353eSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
10088636c353eSmrg            case $lt_outputfile in
10089636c353eSmrg              *.exe|*.EXE) ;;
10090636c353eSmrg              *)
10091636c353eSmrg                lt_outputfile=$lt_outputfile.exe
10092636c353eSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
10093636c353eSmrg                ;;
10094636c353eSmrg            esac~
10095636c353eSmrg            func_to_tool_file "$lt_outputfile"~
10096636c353eSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
10097636c353eSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
10098636c353eSmrg              $RM "$lt_outputfile.manifest";
10099636c353eSmrg            fi'
10100636c353eSmrg	  ;;
10101636c353eSmrg	*)
10102636c353eSmrg	  # g++
10103636c353eSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
10104636c353eSmrg	  # as there is no search path for DLLs.
10105636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10106636c353eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
10107636c353eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10108636c353eSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
10109636c353eSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10110e07dc26bSmrg
10111636c353eSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
10112636c353eSmrg	    _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'
10113636c353eSmrg	    # If the export-symbols file already is a .def file, use it as
10114636c353eSmrg	    # is; otherwise, prepend EXPORTS...
10115636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10116636c353eSmrg              cp $export_symbols $output_objdir/$soname.def;
10117636c353eSmrg            else
10118636c353eSmrg              echo EXPORTS > $output_objdir/$soname.def;
10119636c353eSmrg              cat $export_symbols >> $output_objdir/$soname.def;
10120636c353eSmrg            fi~
10121636c353eSmrg            $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'
10122636c353eSmrg	  else
10123636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10124636c353eSmrg	  fi
10125636c353eSmrg	  ;;
10126636c353eSmrg	esac
10127636c353eSmrg	;;
10128636c353eSmrg      darwin* | rhapsody*)
10129636c353eSmrg        _LT_DARWIN_LINKER_FEATURES($1)
10130636c353eSmrg	;;
10131e07dc26bSmrg
10132636c353eSmrg      os2*)
10133636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10134636c353eSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
10135636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10136636c353eSmrg	shrext_cmds=.dll
10137636c353eSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10138636c353eSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10139636c353eSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10140636c353eSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10141636c353eSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
10142636c353eSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10143636c353eSmrg	  emximp -o $lib $output_objdir/$libname.def'
10144636c353eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10145636c353eSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10146636c353eSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10147636c353eSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10148636c353eSmrg	  prefix_cmds="$SED"~
10149636c353eSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
10150636c353eSmrg	    prefix_cmds="$prefix_cmds -e 1d";
10151636c353eSmrg	  fi~
10152636c353eSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
10153636c353eSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
10154636c353eSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10155636c353eSmrg	  emximp -o $lib $output_objdir/$libname.def'
10156636c353eSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
10157636c353eSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10158636c353eSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
10159636c353eSmrg	;;
10160e07dc26bSmrg
10161636c353eSmrg      dgux*)
10162636c353eSmrg        case $cc_basename in
10163636c353eSmrg          ec++*)
10164636c353eSmrg	    # FIXME: insert proper C++ library support
10165636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10166636c353eSmrg	    ;;
10167636c353eSmrg          ghcx*)
10168636c353eSmrg	    # Green Hills C++ Compiler
10169636c353eSmrg	    # FIXME: insert proper C++ library support
10170636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10171636c353eSmrg	    ;;
10172636c353eSmrg          *)
10173636c353eSmrg	    # FIXME: insert proper C++ library support
10174636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10175636c353eSmrg	    ;;
10176636c353eSmrg        esac
10177636c353eSmrg        ;;
10178e07dc26bSmrg
10179636c353eSmrg      freebsd2.*)
10180636c353eSmrg        # C++ shared libraries reported to be fairly broken before
10181636c353eSmrg	# switch to ELF
10182636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
10183636c353eSmrg        ;;
10184e07dc26bSmrg
10185636c353eSmrg      freebsd-elf*)
10186636c353eSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10187636c353eSmrg        ;;
10188e07dc26bSmrg
10189636c353eSmrg      freebsd* | dragonfly* | midnightbsd*)
10190636c353eSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
10191636c353eSmrg        # conventions
10192636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
10193636c353eSmrg        ;;
10194e07dc26bSmrg
10195636c353eSmrg      haiku*)
10196636c353eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10197636c353eSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
10198636c353eSmrg        ;;
10199e07dc26bSmrg
10200636c353eSmrg      hpux9*)
10201636c353eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10202636c353eSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10203636c353eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10204636c353eSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
10205636c353eSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10206636c353eSmrg				             # but as the default
10207636c353eSmrg				             # location of the library.
10208e07dc26bSmrg
10209636c353eSmrg        case $cc_basename in
10210636c353eSmrg          CC*)
10211636c353eSmrg            # FIXME: insert proper C++ library support
10212636c353eSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
10213636c353eSmrg            ;;
10214636c353eSmrg          aCC*)
10215636c353eSmrg            _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
10216636c353eSmrg            # Commands to make compiler produce verbose output that lists
10217636c353eSmrg            # what "hidden" libraries, object files and flags are used when
10218636c353eSmrg            # linking a shared library.
10219636c353eSmrg            #
10220636c353eSmrg            # There doesn't appear to be a way to prevent this compiler from
10221636c353eSmrg            # explicitly linking system object files so we need to strip them
10222636c353eSmrg            # from the output so that they don't get included in the library
10223636c353eSmrg            # dependencies.
10224636c353eSmrg            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
10225636c353eSmrg            ;;
10226636c353eSmrg          *)
10227636c353eSmrg            if test yes = "$GXX"; then
10228636c353eSmrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
10229636c353eSmrg            else
10230636c353eSmrg              # FIXME: insert proper C++ library support
10231636c353eSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
10232636c353eSmrg            fi
10233636c353eSmrg            ;;
10234636c353eSmrg        esac
10235636c353eSmrg        ;;
10236e07dc26bSmrg
10237636c353eSmrg      hpux10*|hpux11*)
10238636c353eSmrg        if test no = "$with_gnu_ld"; then
10239636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10240636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10241e07dc26bSmrg
10242636c353eSmrg          case $host_cpu in
10243636c353eSmrg            hppa*64*|ia64*)
10244636c353eSmrg              ;;
10245636c353eSmrg            *)
10246636c353eSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10247636c353eSmrg              ;;
10248636c353eSmrg          esac
10249636c353eSmrg        fi
10250636c353eSmrg        case $host_cpu in
10251636c353eSmrg          hppa*64*|ia64*)
10252636c353eSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
10253636c353eSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10254636c353eSmrg            ;;
10255636c353eSmrg          *)
10256636c353eSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
10257636c353eSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10258636c353eSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10259636c353eSmrg					         # but as the default
10260636c353eSmrg					         # location of the library.
10261636c353eSmrg            ;;
10262636c353eSmrg        esac
10263e07dc26bSmrg
10264636c353eSmrg        case $cc_basename in
10265636c353eSmrg          CC*)
10266636c353eSmrg	    # FIXME: insert proper C++ library support
10267636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10268636c353eSmrg	    ;;
10269636c353eSmrg          aCC*)
10270636c353eSmrg	    case $host_cpu in
10271636c353eSmrg	      hppa*64*)
10272636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10273636c353eSmrg	        ;;
10274636c353eSmrg	      ia64*)
10275636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10276636c353eSmrg	        ;;
10277636c353eSmrg	      *)
10278636c353eSmrg	        _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'
10279636c353eSmrg	        ;;
10280636c353eSmrg	    esac
10281636c353eSmrg	    # Commands to make compiler produce verbose output that lists
10282636c353eSmrg	    # what "hidden" libraries, object files and flags are used when
10283636c353eSmrg	    # linking a shared library.
10284636c353eSmrg	    #
10285636c353eSmrg	    # There doesn't appear to be a way to prevent this compiler from
10286636c353eSmrg	    # explicitly linking system object files so we need to strip them
10287636c353eSmrg	    # from the output so that they don't get included in the library
10288636c353eSmrg	    # dependencies.
10289636c353eSmrg	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
10290636c353eSmrg	    ;;
10291636c353eSmrg          *)
10292636c353eSmrg	    if test yes = "$GXX"; then
10293636c353eSmrg	      if test no = "$with_gnu_ld"; then
10294636c353eSmrg	        case $host_cpu in
10295636c353eSmrg	          hppa*64*)
10296636c353eSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10297636c353eSmrg	            ;;
10298636c353eSmrg	          ia64*)
10299636c353eSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10300636c353eSmrg	            ;;
10301636c353eSmrg	          *)
10302636c353eSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10303636c353eSmrg	            ;;
10304636c353eSmrg	        esac
10305636c353eSmrg	      fi
10306636c353eSmrg	    else
10307636c353eSmrg	      # FIXME: insert proper C++ library support
10308636c353eSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
10309636c353eSmrg	    fi
10310636c353eSmrg	    ;;
10311636c353eSmrg        esac
10312636c353eSmrg        ;;
10313e07dc26bSmrg
10314636c353eSmrg      interix[[3-9]]*)
10315636c353eSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
10316636c353eSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10317636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10318636c353eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10319636c353eSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
10320636c353eSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
10321636c353eSmrg	# default) and relocated if they conflict, which is a slow very memory
10322636c353eSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
10323636c353eSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
10324636c353eSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
10325636c353eSmrg	_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'
10326636c353eSmrg	_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'
10327636c353eSmrg	;;
10328636c353eSmrg      irix5* | irix6*)
10329636c353eSmrg        case $cc_basename in
10330636c353eSmrg          CC*)
10331636c353eSmrg	    # SGI C++
10332636c353eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
10333e07dc26bSmrg
10334636c353eSmrg	    # Archives containing C++ object files must be created using
10335636c353eSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
10336636c353eSmrg	    # necessary to make sure instantiated templates are included
10337636c353eSmrg	    # in the archive.
10338636c353eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
10339636c353eSmrg	    ;;
10340636c353eSmrg          *)
10341636c353eSmrg	    if test yes = "$GXX"; then
10342636c353eSmrg	      if test no = "$with_gnu_ld"; then
10343636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
10344636c353eSmrg	      else
10345636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
10346636c353eSmrg	      fi
10347636c353eSmrg	    fi
10348636c353eSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
10349636c353eSmrg	    ;;
10350636c353eSmrg        esac
10351636c353eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10352636c353eSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10353636c353eSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
10354636c353eSmrg        ;;
10355e07dc26bSmrg
10356636c353eSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
10357636c353eSmrg        case $cc_basename in
10358636c353eSmrg          KCC*)
10359636c353eSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
10360e07dc26bSmrg
10361636c353eSmrg	    # KCC will only create a shared library if the output file
10362636c353eSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
10363636c353eSmrg	    # to its proper name (with version) after linking.
10364636c353eSmrg	    _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'
10365636c353eSmrg	    _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'
10366636c353eSmrg	    # Commands to make compiler produce verbose output that lists
10367636c353eSmrg	    # what "hidden" libraries, object files and flags are used when
10368636c353eSmrg	    # linking a shared library.
10369636c353eSmrg	    #
10370636c353eSmrg	    # There doesn't appear to be a way to prevent this compiler from
10371636c353eSmrg	    # explicitly linking system object files so we need to strip them
10372636c353eSmrg	    # from the output so that they don't get included in the library
10373636c353eSmrg	    # dependencies.
10374636c353eSmrg	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
10375e07dc26bSmrg
10376636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10377636c353eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10378e07dc26bSmrg
10379636c353eSmrg	    # Archives containing C++ object files must be created using
10380636c353eSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
10381636c353eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
10382636c353eSmrg	    ;;
10383636c353eSmrg	  icpc* | ecpc* )
10384636c353eSmrg	    # Intel C++
10385636c353eSmrg	    with_gnu_ld=yes
10386636c353eSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
10387636c353eSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
10388636c353eSmrg	    # earlier do not add the objects themselves.
10389636c353eSmrg	    case `$CC -V 2>&1` in
10390636c353eSmrg	      *"Version 7."*)
10391636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10392636c353eSmrg		_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'
10393636c353eSmrg		;;
10394636c353eSmrg	      *)  # Version 8.0 or newer
10395636c353eSmrg	        tmp_idyn=
10396636c353eSmrg	        case $host_cpu in
10397636c353eSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
10398636c353eSmrg		esac
10399636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10400636c353eSmrg		_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'
10401636c353eSmrg		;;
10402636c353eSmrg	    esac
10403636c353eSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10404636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10405636c353eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10406636c353eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
10407636c353eSmrg	    ;;
10408636c353eSmrg          pgCC* | pgcpp*)
10409636c353eSmrg            # Portland Group C++ compiler
10410636c353eSmrg	    case `$CC -V` in
10411636c353eSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
10412636c353eSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
10413636c353eSmrg               rm -rf $tpldir~
10414636c353eSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
10415636c353eSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
10416636c353eSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
10417636c353eSmrg                rm -rf $tpldir~
10418636c353eSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
10419636c353eSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
10420636c353eSmrg                $RANLIB $oldlib'
10421636c353eSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
10422636c353eSmrg                rm -rf $tpldir~
10423636c353eSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
10424636c353eSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10425636c353eSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
10426636c353eSmrg                rm -rf $tpldir~
10427636c353eSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
10428636c353eSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
10429636c353eSmrg	      ;;
10430636c353eSmrg	    *) # Version 6 and above use weak symbols
10431636c353eSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10432636c353eSmrg	      _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'
10433636c353eSmrg	      ;;
10434636c353eSmrg	    esac
10435e07dc26bSmrg
10436636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
10437636c353eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10438636c353eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
10439636c353eSmrg            ;;
10440636c353eSmrg	  cxx*)
10441636c353eSmrg	    # Compaq C++
10442636c353eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10443636c353eSmrg	    _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'
10444e07dc26bSmrg
10445636c353eSmrg	    runpath_var=LD_RUN_PATH
10446636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10447636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10448e07dc26bSmrg
10449636c353eSmrg	    # Commands to make compiler produce verbose output that lists
10450636c353eSmrg	    # what "hidden" libraries, object files and flags are used when
10451636c353eSmrg	    # linking a shared library.
10452636c353eSmrg	    #
10453636c353eSmrg	    # There doesn't appear to be a way to prevent this compiler from
10454636c353eSmrg	    # explicitly linking system object files so we need to strip them
10455636c353eSmrg	    # from the output so that they don't get included in the library
10456636c353eSmrg	    # dependencies.
10457636c353eSmrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
10458636c353eSmrg	    ;;
10459636c353eSmrg	  xl* | mpixl* | bgxl*)
10460636c353eSmrg	    # IBM XL 8.0 on PPC, with GNU ld
10461636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10462636c353eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10463636c353eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10464636c353eSmrg	    if test yes = "$supports_anon_versioning"; then
10465636c353eSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
10466636c353eSmrg                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
10467636c353eSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
10468636c353eSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
10469636c353eSmrg	    fi
10470636c353eSmrg	    ;;
10471636c353eSmrg	  *)
10472636c353eSmrg	    case `$CC -V 2>&1 | $SED 5q` in
10473636c353eSmrg	    *Sun\ C*)
10474636c353eSmrg	      # Sun C++ 5.9
10475636c353eSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10476636c353eSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10477636c353eSmrg	      _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'
10478636c353eSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10479636c353eSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
10480636c353eSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
10481e07dc26bSmrg
10482636c353eSmrg	      # Not sure whether something based on
10483636c353eSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
10484636c353eSmrg	      # would be better.
10485636c353eSmrg	      output_verbose_link_cmd='func_echo_all'
10486e07dc26bSmrg
10487636c353eSmrg	      # Archives containing C++ object files must be created using
10488636c353eSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
10489636c353eSmrg	      # necessary to make sure instantiated templates are included
10490636c353eSmrg	      # in the archive.
10491636c353eSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10492636c353eSmrg	      ;;
10493636c353eSmrg	    esac
10494636c353eSmrg	    ;;
10495636c353eSmrg	esac
10496636c353eSmrg	;;
10497e07dc26bSmrg
10498636c353eSmrg      lynxos*)
10499636c353eSmrg        # FIXME: insert proper C++ library support
10500636c353eSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
10501636c353eSmrg	;;
10502e07dc26bSmrg
10503636c353eSmrg      m88k*)
10504636c353eSmrg        # FIXME: insert proper C++ library support
10505636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
10506636c353eSmrg	;;
10507e07dc26bSmrg
10508636c353eSmrg      mvs*)
10509636c353eSmrg        case $cc_basename in
10510636c353eSmrg          cxx*)
10511636c353eSmrg	    # FIXME: insert proper C++ library support
10512636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10513636c353eSmrg	    ;;
10514636c353eSmrg	  *)
10515636c353eSmrg	    # FIXME: insert proper C++ library support
10516636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10517636c353eSmrg	    ;;
10518636c353eSmrg	esac
10519636c353eSmrg	;;
10520e07dc26bSmrg
10521636c353eSmrg      netbsd*)
10522636c353eSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10523636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
10524636c353eSmrg	  wlarc=
10525636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10526636c353eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
10527636c353eSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10528636c353eSmrg	fi
10529636c353eSmrg	# Workaround some broken pre-1.5 toolchains
10530636c353eSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
10531636c353eSmrg	;;
10532e07dc26bSmrg
10533636c353eSmrg      *nto* | *qnx*)
10534636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
10535636c353eSmrg	;;
10536e07dc26bSmrg
10537636c353eSmrg      openbsd* | bitrig*)
10538636c353eSmrg	if test -f /usr/libexec/ld.so; then
10539636c353eSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
10540636c353eSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10541636c353eSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10542636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
10543636c353eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10544636c353eSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
10545636c353eSmrg	    _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'
10546636c353eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10547636c353eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
10548636c353eSmrg	  fi
10549636c353eSmrg	  output_verbose_link_cmd=func_echo_all
10550636c353eSmrg	else
10551636c353eSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
10552636c353eSmrg	fi
10553636c353eSmrg	;;
10554e07dc26bSmrg
10555636c353eSmrg      osf3* | osf4* | osf5*)
10556636c353eSmrg        case $cc_basename in
10557636c353eSmrg          KCC*)
10558636c353eSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
10559636c353eSmrg
10560636c353eSmrg	    # KCC will only create a shared library if the output file
10561636c353eSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
10562636c353eSmrg	    # to its proper name (with version) after linking.
10563636c353eSmrg	    _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'
10564e07dc26bSmrg
10565636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
10566636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10567e07dc26bSmrg
10568636c353eSmrg	    # Archives containing C++ object files must be created using
10569636c353eSmrg	    # the KAI C++ compiler.
10570636c353eSmrg	    case $host in
10571636c353eSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
10572636c353eSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
10573636c353eSmrg	    esac
10574636c353eSmrg	    ;;
10575636c353eSmrg          RCC*)
10576636c353eSmrg	    # Rational C++ 2.4.1
10577636c353eSmrg	    # FIXME: insert proper C++ library support
10578636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10579636c353eSmrg	    ;;
10580636c353eSmrg          cxx*)
10581636c353eSmrg	    case $host in
10582636c353eSmrg	      osf3*)
10583636c353eSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10584636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
10585636c353eSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10586636c353eSmrg		;;
10587636c353eSmrg	      *)
10588636c353eSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10589636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
10590636c353eSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
10591636c353eSmrg                  echo "-hidden">> $lib.exp~
10592636c353eSmrg                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
10593636c353eSmrg                  $RM $lib.exp'
10594636c353eSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10595636c353eSmrg		;;
10596636c353eSmrg	    esac
10597e07dc26bSmrg
10598636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10599e07dc26bSmrg
10600636c353eSmrg	    # Commands to make compiler produce verbose output that lists
10601636c353eSmrg	    # what "hidden" libraries, object files and flags are used when
10602636c353eSmrg	    # linking a shared library.
10603636c353eSmrg	    #
10604636c353eSmrg	    # There doesn't appear to be a way to prevent this compiler from
10605636c353eSmrg	    # explicitly linking system object files so we need to strip them
10606636c353eSmrg	    # from the output so that they don't get included in the library
10607636c353eSmrg	    # dependencies.
10608636c353eSmrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
10609636c353eSmrg	    ;;
10610636c353eSmrg	  *)
10611636c353eSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
10612636c353eSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10613636c353eSmrg	      case $host in
10614636c353eSmrg	        osf3*)
10615636c353eSmrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
10616636c353eSmrg		  ;;
10617636c353eSmrg	        *)
10618636c353eSmrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
10619636c353eSmrg		  ;;
10620636c353eSmrg	      esac
10621e07dc26bSmrg
10622636c353eSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10623636c353eSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10624e07dc26bSmrg
10625636c353eSmrg	      # Commands to make compiler produce verbose output that lists
10626636c353eSmrg	      # what "hidden" libraries, object files and flags are used when
10627636c353eSmrg	      # linking a shared library.
10628636c353eSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10629e07dc26bSmrg
10630636c353eSmrg	    else
10631636c353eSmrg	      # FIXME: insert proper C++ library support
10632636c353eSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
10633636c353eSmrg	    fi
10634636c353eSmrg	    ;;
10635636c353eSmrg        esac
10636636c353eSmrg        ;;
10637e07dc26bSmrg
10638636c353eSmrg      psos*)
10639636c353eSmrg        # FIXME: insert proper C++ library support
10640636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
10641636c353eSmrg        ;;
10642e07dc26bSmrg
10643636c353eSmrg      sunos4*)
10644636c353eSmrg        case $cc_basename in
10645636c353eSmrg          CC*)
10646636c353eSmrg	    # Sun C++ 4.x
10647636c353eSmrg	    # FIXME: insert proper C++ library support
10648636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10649636c353eSmrg	    ;;
10650636c353eSmrg          lcc*)
10651636c353eSmrg	    # Lucid
10652636c353eSmrg	    # FIXME: insert proper C++ library support
10653636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10654636c353eSmrg	    ;;
10655636c353eSmrg          *)
10656636c353eSmrg	    # FIXME: insert proper C++ library support
10657636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10658636c353eSmrg	    ;;
10659636c353eSmrg        esac
10660636c353eSmrg        ;;
10661636c353eSmrg
10662636c353eSmrg      solaris*)
10663636c353eSmrg        case $cc_basename in
10664636c353eSmrg          CC* | sunCC*)
10665636c353eSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
10666636c353eSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
10667636c353eSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
10668636c353eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10669636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10670636c353eSmrg              $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'
10671636c353eSmrg
10672636c353eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10673636c353eSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10674636c353eSmrg	    case $host_os in
10675636c353eSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10676636c353eSmrg	      *)
10677636c353eSmrg		# The compiler driver will combine and reorder linker options,
10678636c353eSmrg		# but understands '-z linker_flag'.
10679636c353eSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
10680636c353eSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
10681636c353eSmrg	        ;;
10682636c353eSmrg	    esac
10683636c353eSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
10684e07dc26bSmrg
10685636c353eSmrg	    output_verbose_link_cmd='func_echo_all'
10686e07dc26bSmrg
10687636c353eSmrg	    # Archives containing C++ object files must be created using
10688636c353eSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
10689636c353eSmrg	    # necessary to make sure instantiated templates are included
10690636c353eSmrg	    # in the archive.
10691636c353eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
10692636c353eSmrg	    ;;
10693636c353eSmrg          gcx*)
10694636c353eSmrg	    # Green Hills C++ Compiler
10695636c353eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10696e07dc26bSmrg
10697636c353eSmrg	    # The C++ compiler must be used to create the archive.
10698636c353eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
10699636c353eSmrg	    ;;
10700636c353eSmrg          *)
10701636c353eSmrg	    # GNU C++ compiler with Solaris linker
10702636c353eSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
10703636c353eSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
10704636c353eSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
10705636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10706636c353eSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10707636c353eSmrg                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
10708e07dc26bSmrg
10709636c353eSmrg	        # Commands to make compiler produce verbose output that lists
10710636c353eSmrg	        # what "hidden" libraries, object files and flags are used when
10711636c353eSmrg	        # linking a shared library.
10712636c353eSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10713636c353eSmrg	      else
10714636c353eSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
10715636c353eSmrg	        # platform.
10716636c353eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
10717636c353eSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10718636c353eSmrg                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
10719e07dc26bSmrg
10720636c353eSmrg	        # Commands to make compiler produce verbose output that lists
10721636c353eSmrg	        # what "hidden" libraries, object files and flags are used when
10722636c353eSmrg	        # linking a shared library.
10723636c353eSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10724636c353eSmrg	      fi
10725e07dc26bSmrg
10726636c353eSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
10727636c353eSmrg	      case $host_os in
10728636c353eSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10729636c353eSmrg		*)
10730636c353eSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
10731636c353eSmrg		  ;;
10732636c353eSmrg	      esac
10733636c353eSmrg	    fi
10734636c353eSmrg	    ;;
10735636c353eSmrg        esac
10736636c353eSmrg        ;;
10737e07dc26bSmrg
10738636c353eSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
10739636c353eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10740636c353eSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10741636c353eSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10742636c353eSmrg      runpath_var='LD_RUN_PATH'
10743636c353eSmrg
10744636c353eSmrg      case $cc_basename in
10745636c353eSmrg        CC*)
10746636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10747636c353eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10748636c353eSmrg	  ;;
10749636c353eSmrg	*)
10750636c353eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10751636c353eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10752636c353eSmrg	  ;;
10753636c353eSmrg      esac
10754636c353eSmrg      ;;
10755636c353eSmrg
10756636c353eSmrg      sysv5* | sco3.2v5* | sco5v6*)
10757636c353eSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
10758636c353eSmrg	# link with -lc, and that would cause any symbols used from libc to
10759636c353eSmrg	# always be unresolved, which means just about no library would
10760636c353eSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
10761636c353eSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
10762636c353eSmrg	# as -z defs.
10763636c353eSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10764636c353eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
10765636c353eSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
10766636c353eSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10767636c353eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
10768636c353eSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10769636c353eSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
10770636c353eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
10771636c353eSmrg	runpath_var='LD_RUN_PATH'
10772636c353eSmrg
10773636c353eSmrg	case $cc_basename in
10774636c353eSmrg          CC*)
10775636c353eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10776636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10777636c353eSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
10778636c353eSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
10779636c353eSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
10780636c353eSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
10781636c353eSmrg	    ;;
10782636c353eSmrg	  *)
10783636c353eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10784636c353eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10785636c353eSmrg	    ;;
10786636c353eSmrg	esac
10787636c353eSmrg      ;;
10788636c353eSmrg
10789636c353eSmrg      tandem*)
10790636c353eSmrg        case $cc_basename in
10791636c353eSmrg          NCC*)
10792636c353eSmrg	    # NonStop-UX NCC 3.20
10793636c353eSmrg	    # FIXME: insert proper C++ library support
10794636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10795636c353eSmrg	    ;;
10796636c353eSmrg          *)
10797636c353eSmrg	    # FIXME: insert proper C++ library support
10798636c353eSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
10799636c353eSmrg	    ;;
10800636c353eSmrg        esac
10801636c353eSmrg        ;;
10802e07dc26bSmrg
10803636c353eSmrg      vxworks*)
10804636c353eSmrg        # FIXME: insert proper C++ library support
10805636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
10806636c353eSmrg        ;;
10807e07dc26bSmrg
10808636c353eSmrg      *)
10809636c353eSmrg        # FIXME: insert proper C++ library support
10810636c353eSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
10811636c353eSmrg        ;;
10812636c353eSmrg    esac
10813e07dc26bSmrg
10814636c353eSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
10815636c353eSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
10816e07dc26bSmrg
10817636c353eSmrg    _LT_TAGVAR(GCC, $1)=$GXX
10818636c353eSmrg    _LT_TAGVAR(LD, $1)=$LD
10819e07dc26bSmrg
10820636c353eSmrg    ## CAVEAT EMPTOR:
10821636c353eSmrg    ## There is no encapsulation within the following macros, do not change
10822636c353eSmrg    ## the running order or otherwise move them around unless you know exactly
10823636c353eSmrg    ## what you are doing...
10824636c353eSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
10825636c353eSmrg    _LT_COMPILER_PIC($1)
10826636c353eSmrg    _LT_COMPILER_C_O($1)
10827636c353eSmrg    _LT_COMPILER_FILE_LOCKS($1)
10828636c353eSmrg    _LT_LINKER_SHLIBS($1)
10829636c353eSmrg    _LT_SYS_DYNAMIC_LINKER($1)
10830636c353eSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
10831e07dc26bSmrg
10832636c353eSmrg    _LT_CONFIG($1)
10833636c353eSmrg  fi # test -n "$compiler"
10834e07dc26bSmrg
10835636c353eSmrg  CC=$lt_save_CC
10836636c353eSmrg  CFLAGS=$lt_save_CFLAGS
10837636c353eSmrg  LDCXX=$LD
10838636c353eSmrg  LD=$lt_save_LD
10839636c353eSmrg  GCC=$lt_save_GCC
10840636c353eSmrg  with_gnu_ld=$lt_save_with_gnu_ld
10841636c353eSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
10842636c353eSmrg  lt_cv_path_LD=$lt_save_path_LD
10843636c353eSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
10844636c353eSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
10845636c353eSmrgfi # test yes != "$_lt_caught_CXX_error"
10846e07dc26bSmrg
10847636c353eSmrgAC_LANG_POP
10848636c353eSmrg])# _LT_LANG_CXX_CONFIG
10849636c353eSmrg
10850636c353eSmrg
10851636c353eSmrg# _LT_FUNC_STRIPNAME_CNF
10852636c353eSmrg# ----------------------
10853636c353eSmrg# func_stripname_cnf prefix suffix name
10854636c353eSmrg# strip PREFIX and SUFFIX off of NAME.
10855636c353eSmrg# PREFIX and SUFFIX must not contain globbing or regex special
10856636c353eSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
10857636c353eSmrg# dot (in which case that matches only a dot).
10858636c353eSmrg#
10859636c353eSmrg# This function is identical to the (non-XSI) version of func_stripname,
10860636c353eSmrg# except this one can be used by m4 code that may be executed by configure,
10861636c353eSmrg# rather than the libtool script.
10862636c353eSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
10863636c353eSmrgAC_REQUIRE([_LT_DECL_SED])
10864636c353eSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
10865636c353eSmrgfunc_stripname_cnf ()
10866636c353eSmrg{
10867636c353eSmrg  case @S|@2 in
10868636c353eSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
10869636c353eSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
10870636c353eSmrg  esac
10871636c353eSmrg} # func_stripname_cnf
10872636c353eSmrg])# _LT_FUNC_STRIPNAME_CNF
10873636c353eSmrg
10874636c353eSmrg
10875636c353eSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
10876636c353eSmrg# ---------------------------------
10877636c353eSmrg# Figure out "hidden" library dependencies from verbose
10878636c353eSmrg# compiler output when linking a shared library.
10879636c353eSmrg# Parse the compiler output and extract the necessary
10880636c353eSmrg# objects, libraries and library flags.
10881636c353eSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
10882636c353eSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
10883636c353eSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
10884636c353eSmrg# Dependencies to place before and after the object being linked:
10885636c353eSmrg_LT_TAGVAR(predep_objects, $1)=
10886636c353eSmrg_LT_TAGVAR(postdep_objects, $1)=
10887636c353eSmrg_LT_TAGVAR(predeps, $1)=
10888636c353eSmrg_LT_TAGVAR(postdeps, $1)=
10889636c353eSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
10890e07dc26bSmrg
10891636c353eSmrgdnl we can't use the lt_simple_compile_test_code here,
10892636c353eSmrgdnl because it contains code intended for an executable,
10893636c353eSmrgdnl not a library.  It's possible we should let each
10894636c353eSmrgdnl tag define a new lt_????_link_test_code variable,
10895636c353eSmrgdnl but it's only used here...
10896636c353eSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
10897636c353eSmrgint a;
10898636c353eSmrgvoid foo (void) { a = 0; }
10899636c353eSmrg_LT_EOF
10900636c353eSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
10901636c353eSmrgclass Foo
10902636c353eSmrg{
10903636c353eSmrgpublic:
10904636c353eSmrg  Foo (void) { a = 0; }
10905636c353eSmrgprivate:
10906636c353eSmrg  int a;
10907636c353eSmrg};
10908636c353eSmrg_LT_EOF
10909636c353eSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
10910636c353eSmrg      subroutine foo
10911636c353eSmrg      implicit none
10912636c353eSmrg      integer*4 a
10913636c353eSmrg      a=0
10914636c353eSmrg      return
10915636c353eSmrg      end
10916636c353eSmrg_LT_EOF
10917636c353eSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
10918636c353eSmrg      subroutine foo
10919636c353eSmrg      implicit none
10920636c353eSmrg      integer a
10921636c353eSmrg      a=0
10922636c353eSmrg      return
10923636c353eSmrg      end
10924636c353eSmrg_LT_EOF
10925636c353eSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
10926636c353eSmrgpublic class foo {
10927636c353eSmrg  private int a;
10928636c353eSmrg  public void bar (void) {
10929636c353eSmrg    a = 0;
10930636c353eSmrg  }
10931636c353eSmrg};
10932636c353eSmrg_LT_EOF
10933636c353eSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
10934636c353eSmrgpackage foo
10935636c353eSmrgfunc foo() {
10936636c353eSmrg}
10937636c353eSmrg_LT_EOF
10938636c353eSmrg])
10939e07dc26bSmrg
10940636c353eSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
10941636c353eSmrgcase "$CC $CFLAGS " in #(
10942636c353eSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
10943636c353eSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
10944636c353eSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
10945636c353eSmrgesac
10946e07dc26bSmrg
10947636c353eSmrgdnl Parse the compiler output and extract the necessary
10948636c353eSmrgdnl objects, libraries and library flags.
10949636c353eSmrgif AC_TRY_EVAL(ac_compile); then
10950636c353eSmrg  # Parse the compiler output and extract the necessary
10951636c353eSmrg  # objects, libraries and library flags.
10952e07dc26bSmrg
10953636c353eSmrg  # Sentinel used to keep track of whether or not we are before
10954636c353eSmrg  # the conftest object file.
10955636c353eSmrg  pre_test_object_deps_done=no
10956e07dc26bSmrg
10957636c353eSmrg  for p in `eval "$output_verbose_link_cmd"`; do
10958636c353eSmrg    case $prev$p in
10959e07dc26bSmrg
10960636c353eSmrg    -L* | -R* | -l*)
10961636c353eSmrg       # Some compilers place space between "-{L,R}" and the path.
10962636c353eSmrg       # Remove the space.
10963636c353eSmrg       if test x-L = "$p" ||
10964636c353eSmrg          test x-R = "$p"; then
10965636c353eSmrg	 prev=$p
10966636c353eSmrg	 continue
10967636c353eSmrg       fi
10968e07dc26bSmrg
10969636c353eSmrg       # Expand the sysroot to ease extracting the directories later.
10970636c353eSmrg       if test -z "$prev"; then
10971636c353eSmrg         case $p in
10972636c353eSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
10973636c353eSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
10974636c353eSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
10975636c353eSmrg         esac
10976636c353eSmrg       fi
10977636c353eSmrg       case $p in
10978636c353eSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
10979636c353eSmrg       esac
10980636c353eSmrg       if test no = "$pre_test_object_deps_done"; then
10981636c353eSmrg	 case $prev in
10982636c353eSmrg	 -L | -R)
10983636c353eSmrg	   # Internal compiler library paths should come after those
10984636c353eSmrg	   # provided the user.  The postdeps already come after the
10985636c353eSmrg	   # user supplied libs so there is no need to process them.
10986636c353eSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
10987636c353eSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
10988636c353eSmrg	   else
10989636c353eSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
10990636c353eSmrg	   fi
10991636c353eSmrg	   ;;
10992636c353eSmrg	 # The "-l" case would never come before the object being
10993636c353eSmrg	 # linked, so don't bother handling this case.
10994636c353eSmrg	 esac
10995636c353eSmrg       else
10996636c353eSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
10997636c353eSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
10998636c353eSmrg	 else
10999636c353eSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
11000636c353eSmrg	 fi
11001636c353eSmrg       fi
11002636c353eSmrg       prev=
11003636c353eSmrg       ;;
11004e07dc26bSmrg
11005636c353eSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
11006636c353eSmrg    *.$objext)
11007636c353eSmrg       # This assumes that the test object file only shows up
11008636c353eSmrg       # once in the compiler output.
11009636c353eSmrg       if test "$p" = "conftest.$objext"; then
11010636c353eSmrg	 pre_test_object_deps_done=yes
11011636c353eSmrg	 continue
11012636c353eSmrg       fi
11013e07dc26bSmrg
11014636c353eSmrg       if test no = "$pre_test_object_deps_done"; then
11015636c353eSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
11016636c353eSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
11017636c353eSmrg	 else
11018636c353eSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
11019636c353eSmrg	 fi
11020636c353eSmrg       else
11021636c353eSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
11022636c353eSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
11023636c353eSmrg	 else
11024636c353eSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
11025636c353eSmrg	 fi
11026636c353eSmrg       fi
11027636c353eSmrg       ;;
11028e07dc26bSmrg
11029636c353eSmrg    *) ;; # Ignore the rest.
11030e07dc26bSmrg
11031636c353eSmrg    esac
11032636c353eSmrg  done
11033e07dc26bSmrg
11034636c353eSmrg  # Clean up.
11035636c353eSmrg  rm -f a.out a.exe
11036636c353eSmrgelse
11037636c353eSmrg  echo "libtool.m4: error: problem compiling $1 test program"
11038636c353eSmrgfi
11039e07dc26bSmrg
11040636c353eSmrg$RM -f confest.$objext
11041636c353eSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
11042e07dc26bSmrg
11043636c353eSmrg# PORTME: override above test on systems where it is broken
11044636c353eSmrgm4_if([$1], [CXX],
11045636c353eSmrg[case $host_os in
11046636c353eSmrginterix[[3-9]]*)
11047636c353eSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
11048636c353eSmrg  # hack all around it, let's just trust "g++" to DTRT.
11049636c353eSmrg  _LT_TAGVAR(predep_objects,$1)=
11050636c353eSmrg  _LT_TAGVAR(postdep_objects,$1)=
11051636c353eSmrg  _LT_TAGVAR(postdeps,$1)=
11052636c353eSmrg  ;;
11053636c353eSmrgesac
11054636c353eSmrg])
11055e07dc26bSmrg
11056636c353eSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
11057636c353eSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
11058636c353eSmrgesac
11059636c353eSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
11060636c353eSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
11061636c353eSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
11062e07dc26bSmrgfi
11063636c353eSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
11064636c353eSmrg    [The directories searched by this compiler when creating a shared library])
11065636c353eSmrg_LT_TAGDECL([], [predep_objects], [1],
11066636c353eSmrg    [Dependencies to place before and after the objects being linked to
11067636c353eSmrg    create a shared library])
11068636c353eSmrg_LT_TAGDECL([], [postdep_objects], [1])
11069636c353eSmrg_LT_TAGDECL([], [predeps], [1])
11070636c353eSmrg_LT_TAGDECL([], [postdeps], [1])
11071636c353eSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
11072636c353eSmrg    [The library search path used internally by the compiler when linking
11073636c353eSmrg    a shared library])
11074636c353eSmrg])# _LT_SYS_HIDDEN_LIBDEPS
11075e07dc26bSmrg
11076e07dc26bSmrg
11077636c353eSmrg# _LT_LANG_F77_CONFIG([TAG])
11078636c353eSmrg# --------------------------
11079636c353eSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
11080636c353eSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
11081636c353eSmrg# to write the compiler configuration to 'libtool'.
11082636c353eSmrgm4_defun([_LT_LANG_F77_CONFIG],
11083636c353eSmrg[AC_LANG_PUSH(Fortran 77)
11084636c353eSmrgif test -z "$F77" || test no = "$F77"; then
11085636c353eSmrg  _lt_disable_F77=yes
11086e07dc26bSmrgfi
11087e07dc26bSmrg
11088636c353eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11089636c353eSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
11090636c353eSmrg_LT_TAGVAR(always_export_symbols, $1)=no
11091636c353eSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
11092636c353eSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11093636c353eSmrg_LT_TAGVAR(hardcode_direct, $1)=no
11094636c353eSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11095636c353eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11096636c353eSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
11097636c353eSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
11098636c353eSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
11099636c353eSmrg_LT_TAGVAR(inherit_rpath, $1)=no
11100636c353eSmrg_LT_TAGVAR(module_cmds, $1)=
11101636c353eSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
11102636c353eSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
11103636c353eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11104636c353eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11105636c353eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11106636c353eSmrg_LT_TAGVAR(no_undefined_flag, $1)=
11107636c353eSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
11108636c353eSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11109e07dc26bSmrg
11110636c353eSmrg# Source file extension for f77 test sources.
11111636c353eSmrgac_ext=f
11112e07dc26bSmrg
11113636c353eSmrg# Object file extension for compiled f77 test sources.
11114636c353eSmrgobjext=o
11115636c353eSmrg_LT_TAGVAR(objext, $1)=$objext
11116e07dc26bSmrg
11117636c353eSmrg# No sense in running all these tests if we already determined that
11118636c353eSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
11119636c353eSmrg# are currently assumed to apply to all compilers on this platform,
11120636c353eSmrg# and will be corrupted by setting them based on a non-working compiler.
11121636c353eSmrgif test yes != "$_lt_disable_F77"; then
11122636c353eSmrg  # Code to be used in simple compile tests
11123636c353eSmrg  lt_simple_compile_test_code="\
11124636c353eSmrg      subroutine t
11125636c353eSmrg      return
11126636c353eSmrg      end
11127636c353eSmrg"
11128e07dc26bSmrg
11129636c353eSmrg  # Code to be used in simple link tests
11130636c353eSmrg  lt_simple_link_test_code="\
11131636c353eSmrg      program t
11132636c353eSmrg      end
11133636c353eSmrg"
11134e07dc26bSmrg
11135636c353eSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11136636c353eSmrg  _LT_TAG_COMPILER
11137e07dc26bSmrg
11138636c353eSmrg  # save warnings/boilerplate of simple test code
11139636c353eSmrg  _LT_COMPILER_BOILERPLATE
11140636c353eSmrg  _LT_LINKER_BOILERPLATE
11141e07dc26bSmrg
11142636c353eSmrg  # Allow CC to be a program name with arguments.
11143636c353eSmrg  lt_save_CC=$CC
11144636c353eSmrg  lt_save_GCC=$GCC
11145636c353eSmrg  lt_save_CFLAGS=$CFLAGS
11146636c353eSmrg  CC=${F77-"f77"}
11147636c353eSmrg  CFLAGS=$FFLAGS
11148636c353eSmrg  compiler=$CC
11149636c353eSmrg  _LT_TAGVAR(compiler, $1)=$CC
11150636c353eSmrg  _LT_CC_BASENAME([$compiler])
11151636c353eSmrg  GCC=$G77
11152636c353eSmrg  if test -n "$compiler"; then
11153636c353eSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
11154636c353eSmrg    AC_MSG_RESULT([$can_build_shared])
11155e07dc26bSmrg
11156636c353eSmrg    AC_MSG_CHECKING([whether to build shared libraries])
11157636c353eSmrg    test no = "$can_build_shared" && enable_shared=no
11158636c353eSmrg
11159636c353eSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
11160636c353eSmrg    # are all built from PIC.
11161636c353eSmrg    case $host_os in
11162636c353eSmrg      aix3*)
11163636c353eSmrg        test yes = "$enable_shared" && enable_static=no
11164636c353eSmrg        if test -n "$RANLIB"; then
11165636c353eSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11166636c353eSmrg          postinstall_cmds='$RANLIB $lib'
11167636c353eSmrg        fi
11168636c353eSmrg        ;;
11169636c353eSmrg      aix[[4-9]]*)
11170636c353eSmrg	if test ia64 != "$host_cpu"; then
11171636c353eSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11172636c353eSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
11173636c353eSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11174636c353eSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11175636c353eSmrg	  esac
11176636c353eSmrg	fi
11177636c353eSmrg        ;;
11178636c353eSmrg    esac
11179636c353eSmrg    AC_MSG_RESULT([$enable_shared])
11180e07dc26bSmrg
11181636c353eSmrg    AC_MSG_CHECKING([whether to build static libraries])
11182636c353eSmrg    # Make sure either enable_shared or enable_static is yes.
11183636c353eSmrg    test yes = "$enable_shared" || enable_static=yes
11184636c353eSmrg    AC_MSG_RESULT([$enable_static])
11185e07dc26bSmrg
11186636c353eSmrg    _LT_TAGVAR(GCC, $1)=$G77
11187636c353eSmrg    _LT_TAGVAR(LD, $1)=$LD
11188e07dc26bSmrg
11189636c353eSmrg    ## CAVEAT EMPTOR:
11190636c353eSmrg    ## There is no encapsulation within the following macros, do not change
11191636c353eSmrg    ## the running order or otherwise move them around unless you know exactly
11192636c353eSmrg    ## what you are doing...
11193636c353eSmrg    _LT_COMPILER_PIC($1)
11194636c353eSmrg    _LT_COMPILER_C_O($1)
11195636c353eSmrg    _LT_COMPILER_FILE_LOCKS($1)
11196636c353eSmrg    _LT_LINKER_SHLIBS($1)
11197636c353eSmrg    _LT_SYS_DYNAMIC_LINKER($1)
11198636c353eSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
11199e07dc26bSmrg
11200636c353eSmrg    _LT_CONFIG($1)
11201636c353eSmrg  fi # test -n "$compiler"
11202e07dc26bSmrg
11203636c353eSmrg  GCC=$lt_save_GCC
11204636c353eSmrg  CC=$lt_save_CC
11205636c353eSmrg  CFLAGS=$lt_save_CFLAGS
11206636c353eSmrgfi # test yes != "$_lt_disable_F77"
11207e07dc26bSmrg
11208636c353eSmrgAC_LANG_POP
11209636c353eSmrg])# _LT_LANG_F77_CONFIG
11210e07dc26bSmrg
11211e07dc26bSmrg
11212636c353eSmrg# _LT_LANG_FC_CONFIG([TAG])
11213636c353eSmrg# -------------------------
11214636c353eSmrg# Ensure that the configuration variables for a Fortran compiler are
11215636c353eSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
11216636c353eSmrg# to write the compiler configuration to 'libtool'.
11217636c353eSmrgm4_defun([_LT_LANG_FC_CONFIG],
11218636c353eSmrg[AC_LANG_PUSH(Fortran)
11219e07dc26bSmrg
11220636c353eSmrgif test -z "$FC" || test no = "$FC"; then
11221636c353eSmrg  _lt_disable_FC=yes
11222e07dc26bSmrgfi
11223e07dc26bSmrg
11224636c353eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11225636c353eSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
11226636c353eSmrg_LT_TAGVAR(always_export_symbols, $1)=no
11227636c353eSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
11228636c353eSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11229636c353eSmrg_LT_TAGVAR(hardcode_direct, $1)=no
11230636c353eSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11231636c353eSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11232636c353eSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
11233636c353eSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
11234636c353eSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
11235636c353eSmrg_LT_TAGVAR(inherit_rpath, $1)=no
11236636c353eSmrg_LT_TAGVAR(module_cmds, $1)=
11237636c353eSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
11238636c353eSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
11239636c353eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11240636c353eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11241636c353eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11242636c353eSmrg_LT_TAGVAR(no_undefined_flag, $1)=
11243636c353eSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
11244636c353eSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11245e07dc26bSmrg
11246636c353eSmrg# Source file extension for fc test sources.
11247636c353eSmrgac_ext=${ac_fc_srcext-f}
11248e07dc26bSmrg
11249636c353eSmrg# Object file extension for compiled fc test sources.
11250636c353eSmrgobjext=o
11251636c353eSmrg_LT_TAGVAR(objext, $1)=$objext
11252e07dc26bSmrg
11253636c353eSmrg# No sense in running all these tests if we already determined that
11254636c353eSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
11255636c353eSmrg# are currently assumed to apply to all compilers on this platform,
11256636c353eSmrg# and will be corrupted by setting them based on a non-working compiler.
11257636c353eSmrgif test yes != "$_lt_disable_FC"; then
11258636c353eSmrg  # Code to be used in simple compile tests
11259636c353eSmrg  lt_simple_compile_test_code="\
11260636c353eSmrg      subroutine t
11261636c353eSmrg      return
11262636c353eSmrg      end
11263636c353eSmrg"
11264e07dc26bSmrg
11265636c353eSmrg  # Code to be used in simple link tests
11266636c353eSmrg  lt_simple_link_test_code="\
11267636c353eSmrg      program t
11268636c353eSmrg      end
11269636c353eSmrg"
11270e07dc26bSmrg
11271636c353eSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11272636c353eSmrg  _LT_TAG_COMPILER
11273e07dc26bSmrg
11274636c353eSmrg  # save warnings/boilerplate of simple test code
11275636c353eSmrg  _LT_COMPILER_BOILERPLATE
11276636c353eSmrg  _LT_LINKER_BOILERPLATE
11277e07dc26bSmrg
11278636c353eSmrg  # Allow CC to be a program name with arguments.
11279636c353eSmrg  lt_save_CC=$CC
11280636c353eSmrg  lt_save_GCC=$GCC
11281636c353eSmrg  lt_save_CFLAGS=$CFLAGS
11282636c353eSmrg  CC=${FC-"f95"}
11283636c353eSmrg  CFLAGS=$FCFLAGS
11284636c353eSmrg  compiler=$CC
11285636c353eSmrg  GCC=$ac_cv_fc_compiler_gnu
11286e07dc26bSmrg
11287636c353eSmrg  _LT_TAGVAR(compiler, $1)=$CC
11288636c353eSmrg  _LT_CC_BASENAME([$compiler])
11289e07dc26bSmrg
11290636c353eSmrg  if test -n "$compiler"; then
11291636c353eSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
11292636c353eSmrg    AC_MSG_RESULT([$can_build_shared])
11293e07dc26bSmrg
11294636c353eSmrg    AC_MSG_CHECKING([whether to build shared libraries])
11295636c353eSmrg    test no = "$can_build_shared" && enable_shared=no
11296e07dc26bSmrg
11297636c353eSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
11298636c353eSmrg    # are all built from PIC.
11299636c353eSmrg    case $host_os in
11300636c353eSmrg      aix3*)
11301636c353eSmrg        test yes = "$enable_shared" && enable_static=no
11302636c353eSmrg        if test -n "$RANLIB"; then
11303636c353eSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11304636c353eSmrg          postinstall_cmds='$RANLIB $lib'
11305636c353eSmrg        fi
11306636c353eSmrg        ;;
11307636c353eSmrg      aix[[4-9]]*)
11308636c353eSmrg	if test ia64 != "$host_cpu"; then
11309636c353eSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11310636c353eSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
11311636c353eSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11312636c353eSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11313636c353eSmrg	  esac
11314e07dc26bSmrg	fi
11315636c353eSmrg        ;;
11316636c353eSmrg    esac
11317636c353eSmrg    AC_MSG_RESULT([$enable_shared])
11318e07dc26bSmrg
11319636c353eSmrg    AC_MSG_CHECKING([whether to build static libraries])
11320636c353eSmrg    # Make sure either enable_shared or enable_static is yes.
11321636c353eSmrg    test yes = "$enable_shared" || enable_static=yes
11322636c353eSmrg    AC_MSG_RESULT([$enable_static])
11323e07dc26bSmrg
11324636c353eSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
11325636c353eSmrg    _LT_TAGVAR(LD, $1)=$LD
11326e07dc26bSmrg
11327636c353eSmrg    ## CAVEAT EMPTOR:
11328636c353eSmrg    ## There is no encapsulation within the following macros, do not change
11329636c353eSmrg    ## the running order or otherwise move them around unless you know exactly
11330636c353eSmrg    ## what you are doing...
11331636c353eSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
11332636c353eSmrg    _LT_COMPILER_PIC($1)
11333636c353eSmrg    _LT_COMPILER_C_O($1)
11334636c353eSmrg    _LT_COMPILER_FILE_LOCKS($1)
11335636c353eSmrg    _LT_LINKER_SHLIBS($1)
11336636c353eSmrg    _LT_SYS_DYNAMIC_LINKER($1)
11337636c353eSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
11338e07dc26bSmrg
11339636c353eSmrg    _LT_CONFIG($1)
11340636c353eSmrg  fi # test -n "$compiler"
11341e07dc26bSmrg
11342636c353eSmrg  GCC=$lt_save_GCC
11343636c353eSmrg  CC=$lt_save_CC
11344636c353eSmrg  CFLAGS=$lt_save_CFLAGS
11345636c353eSmrgfi # test yes != "$_lt_disable_FC"
11346e07dc26bSmrg
11347636c353eSmrgAC_LANG_POP
11348636c353eSmrg])# _LT_LANG_FC_CONFIG
11349e07dc26bSmrg
11350e07dc26bSmrg
11351636c353eSmrg# _LT_LANG_GCJ_CONFIG([TAG])
11352636c353eSmrg# --------------------------
11353636c353eSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
11354636c353eSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11355636c353eSmrg# to write the compiler configuration to 'libtool'.
11356636c353eSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
11357636c353eSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
11358636c353eSmrgAC_LANG_SAVE
11359e07dc26bSmrg
11360636c353eSmrg# Source file extension for Java test sources.
11361636c353eSmrgac_ext=java
11362e07dc26bSmrg
11363636c353eSmrg# Object file extension for compiled Java test sources.
11364636c353eSmrgobjext=o
11365636c353eSmrg_LT_TAGVAR(objext, $1)=$objext
11366e07dc26bSmrg
11367636c353eSmrg# Code to be used in simple compile tests
11368636c353eSmrglt_simple_compile_test_code="class foo {}"
11369e07dc26bSmrg
11370636c353eSmrg# Code to be used in simple link tests
11371636c353eSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
11372e07dc26bSmrg
11373636c353eSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11374636c353eSmrg_LT_TAG_COMPILER
11375e07dc26bSmrg
11376636c353eSmrg# save warnings/boilerplate of simple test code
11377636c353eSmrg_LT_COMPILER_BOILERPLATE
11378636c353eSmrg_LT_LINKER_BOILERPLATE
11379e07dc26bSmrg
11380636c353eSmrg# Allow CC to be a program name with arguments.
11381636c353eSmrglt_save_CC=$CC
11382636c353eSmrglt_save_CFLAGS=$CFLAGS
11383636c353eSmrglt_save_GCC=$GCC
11384636c353eSmrgGCC=yes
11385636c353eSmrgCC=${GCJ-"gcj"}
11386636c353eSmrgCFLAGS=$GCJFLAGS
11387636c353eSmrgcompiler=$CC
11388636c353eSmrg_LT_TAGVAR(compiler, $1)=$CC
11389636c353eSmrg_LT_TAGVAR(LD, $1)=$LD
11390636c353eSmrg_LT_CC_BASENAME([$compiler])
11391636c353eSmrg
11392636c353eSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
11393636c353eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11394636c353eSmrg
11395636c353eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11396636c353eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11397636c353eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11398636c353eSmrg
11399636c353eSmrgif test -n "$compiler"; then
11400636c353eSmrg  _LT_COMPILER_NO_RTTI($1)
11401636c353eSmrg  _LT_COMPILER_PIC($1)
11402636c353eSmrg  _LT_COMPILER_C_O($1)
11403636c353eSmrg  _LT_COMPILER_FILE_LOCKS($1)
11404636c353eSmrg  _LT_LINKER_SHLIBS($1)
11405636c353eSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
11406636c353eSmrg
11407636c353eSmrg  _LT_CONFIG($1)
11408e07dc26bSmrgfi
11409e07dc26bSmrg
11410636c353eSmrgAC_LANG_RESTORE
11411e07dc26bSmrg
11412636c353eSmrgGCC=$lt_save_GCC
11413636c353eSmrgCC=$lt_save_CC
11414636c353eSmrgCFLAGS=$lt_save_CFLAGS
11415636c353eSmrg])# _LT_LANG_GCJ_CONFIG
11416e07dc26bSmrg
11417e07dc26bSmrg
11418636c353eSmrg# _LT_LANG_GO_CONFIG([TAG])
11419636c353eSmrg# --------------------------
11420636c353eSmrg# Ensure that the configuration variables for the GNU Go compiler
11421636c353eSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11422636c353eSmrg# to write the compiler configuration to 'libtool'.
11423636c353eSmrgm4_defun([_LT_LANG_GO_CONFIG],
11424636c353eSmrg[AC_REQUIRE([LT_PROG_GO])dnl
11425636c353eSmrgAC_LANG_SAVE
11426e07dc26bSmrg
11427636c353eSmrg# Source file extension for Go test sources.
11428636c353eSmrgac_ext=go
11429e07dc26bSmrg
11430636c353eSmrg# Object file extension for compiled Go test sources.
11431636c353eSmrgobjext=o
11432636c353eSmrg_LT_TAGVAR(objext, $1)=$objext
11433e07dc26bSmrg
11434636c353eSmrg# Code to be used in simple compile tests
11435636c353eSmrglt_simple_compile_test_code="package main; func main() { }"
11436e07dc26bSmrg
11437636c353eSmrg# Code to be used in simple link tests
11438636c353eSmrglt_simple_link_test_code='package main; func main() { }'
11439e07dc26bSmrg
11440636c353eSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11441636c353eSmrg_LT_TAG_COMPILER
11442e07dc26bSmrg
11443636c353eSmrg# save warnings/boilerplate of simple test code
11444636c353eSmrg_LT_COMPILER_BOILERPLATE
11445636c353eSmrg_LT_LINKER_BOILERPLATE
11446e07dc26bSmrg
11447636c353eSmrg# Allow CC to be a program name with arguments.
11448636c353eSmrglt_save_CC=$CC
11449636c353eSmrglt_save_CFLAGS=$CFLAGS
11450636c353eSmrglt_save_GCC=$GCC
11451636c353eSmrgGCC=yes
11452636c353eSmrgCC=${GOC-"gccgo"}
11453636c353eSmrgCFLAGS=$GOFLAGS
11454636c353eSmrgcompiler=$CC
11455636c353eSmrg_LT_TAGVAR(compiler, $1)=$CC
11456636c353eSmrg_LT_TAGVAR(LD, $1)=$LD
11457636c353eSmrg_LT_CC_BASENAME([$compiler])
11458e07dc26bSmrg
11459636c353eSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
11460636c353eSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11461e07dc26bSmrg
11462636c353eSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11463636c353eSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
11464636c353eSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11465e07dc26bSmrg
11466636c353eSmrgif test -n "$compiler"; then
11467636c353eSmrg  _LT_COMPILER_NO_RTTI($1)
11468636c353eSmrg  _LT_COMPILER_PIC($1)
11469636c353eSmrg  _LT_COMPILER_C_O($1)
11470636c353eSmrg  _LT_COMPILER_FILE_LOCKS($1)
11471636c353eSmrg  _LT_LINKER_SHLIBS($1)
11472636c353eSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
11473636c353eSmrg
11474636c353eSmrg  _LT_CONFIG($1)
11475636c353eSmrgfi
11476636c353eSmrg
11477636c353eSmrgAC_LANG_RESTORE
11478636c353eSmrg
11479636c353eSmrgGCC=$lt_save_GCC
11480636c353eSmrgCC=$lt_save_CC
11481636c353eSmrgCFLAGS=$lt_save_CFLAGS
11482636c353eSmrg])# _LT_LANG_GO_CONFIG
11483636c353eSmrg
11484636c353eSmrg
11485636c353eSmrg# _LT_LANG_RC_CONFIG([TAG])
11486636c353eSmrg# -------------------------
11487636c353eSmrg# Ensure that the configuration variables for the Windows resource compiler
11488636c353eSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
11489636c353eSmrg# to write the compiler configuration to 'libtool'.
11490636c353eSmrgm4_defun([_LT_LANG_RC_CONFIG],
11491636c353eSmrg[AC_REQUIRE([LT_PROG_RC])dnl
11492636c353eSmrgAC_LANG_SAVE
11493e07dc26bSmrg
11494636c353eSmrg# Source file extension for RC test sources.
11495636c353eSmrgac_ext=rc
11496e07dc26bSmrg
11497636c353eSmrg# Object file extension for compiled RC test sources.
11498636c353eSmrgobjext=o
11499636c353eSmrg_LT_TAGVAR(objext, $1)=$objext
11500e07dc26bSmrg
11501636c353eSmrg# Code to be used in simple compile tests
11502636c353eSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
11503e07dc26bSmrg
11504636c353eSmrg# Code to be used in simple link tests
11505636c353eSmrglt_simple_link_test_code=$lt_simple_compile_test_code
11506e07dc26bSmrg
11507636c353eSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
11508636c353eSmrg_LT_TAG_COMPILER
11509e07dc26bSmrg
11510636c353eSmrg# save warnings/boilerplate of simple test code
11511636c353eSmrg_LT_COMPILER_BOILERPLATE
11512636c353eSmrg_LT_LINKER_BOILERPLATE
11513e07dc26bSmrg
11514636c353eSmrg# Allow CC to be a program name with arguments.
11515636c353eSmrglt_save_CC=$CC
11516636c353eSmrglt_save_CFLAGS=$CFLAGS
11517636c353eSmrglt_save_GCC=$GCC
11518636c353eSmrgGCC=
11519636c353eSmrgCC=${RC-"windres"}
11520636c353eSmrgCFLAGS=
11521636c353eSmrgcompiler=$CC
11522636c353eSmrg_LT_TAGVAR(compiler, $1)=$CC
11523636c353eSmrg_LT_CC_BASENAME([$compiler])
11524636c353eSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
11525e07dc26bSmrg
11526636c353eSmrgif test -n "$compiler"; then
11527636c353eSmrg  :
11528636c353eSmrg  _LT_CONFIG($1)
11529636c353eSmrgfi
11530e07dc26bSmrg
11531636c353eSmrgGCC=$lt_save_GCC
11532636c353eSmrgAC_LANG_RESTORE
11533636c353eSmrgCC=$lt_save_CC
11534636c353eSmrgCFLAGS=$lt_save_CFLAGS
11535636c353eSmrg])# _LT_LANG_RC_CONFIG
11536e07dc26bSmrg
11537636c353eSmrg
11538636c353eSmrg# LT_PROG_GCJ
11539636c353eSmrg# -----------
11540636c353eSmrgAC_DEFUN([LT_PROG_GCJ],
11541636c353eSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
11542636c353eSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
11543636c353eSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
11544636c353eSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
11545636c353eSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
11546e07dc26bSmrg])
11547e07dc26bSmrg
11548636c353eSmrg# Old name:
11549636c353eSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
11550636c353eSmrgdnl aclocal-1.4 backwards compatibility:
11551636c353eSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
11552e07dc26bSmrg
11553e07dc26bSmrg
11554636c353eSmrg# LT_PROG_GO
11555636c353eSmrg# ----------
11556636c353eSmrgAC_DEFUN([LT_PROG_GO],
11557636c353eSmrg[AC_CHECK_TOOL(GOC, gccgo,)
11558636c353eSmrg])
11559e07dc26bSmrg
11560e07dc26bSmrg
11561636c353eSmrg# LT_PROG_RC
11562636c353eSmrg# ----------
11563636c353eSmrgAC_DEFUN([LT_PROG_RC],
11564636c353eSmrg[AC_CHECK_TOOL(RC, windres,)
11565636c353eSmrg])
11566e07dc26bSmrg
11567636c353eSmrg# Old name:
11568636c353eSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
11569636c353eSmrgdnl aclocal-1.4 backwards compatibility:
11570636c353eSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
11571e07dc26bSmrg
11572e07dc26bSmrg
11573636c353eSmrg# _LT_DECL_EGREP
11574636c353eSmrg# --------------
11575636c353eSmrg# If we don't have a new enough Autoconf to choose the best grep
11576636c353eSmrg# available, choose the one first in the user's PATH.
11577636c353eSmrgm4_defun([_LT_DECL_EGREP],
11578636c353eSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
11579636c353eSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
11580636c353eSmrgtest -z "$GREP" && GREP=grep
11581636c353eSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
11582636c353eSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
11583636c353eSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
11584636c353eSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
11585636c353eSmrgAC_SUBST([GREP])
11586636c353eSmrg])
11587e07dc26bSmrg
11588e07dc26bSmrg
11589636c353eSmrg# _LT_DECL_OBJDUMP
11590636c353eSmrg# --------------
11591636c353eSmrg# If we don't have a new enough Autoconf to choose the best objdump
11592636c353eSmrg# available, choose the one first in the user's PATH.
11593636c353eSmrgm4_defun([_LT_DECL_OBJDUMP],
11594636c353eSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
11595636c353eSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
11596636c353eSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
11597636c353eSmrgAC_SUBST([OBJDUMP])
11598636c353eSmrg])
11599636c353eSmrg
11600636c353eSmrg# _LT_DECL_DLLTOOL
11601636c353eSmrg# ----------------
11602636c353eSmrg# Ensure DLLTOOL variable is set.
11603636c353eSmrgm4_defun([_LT_DECL_DLLTOOL],
11604636c353eSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
11605636c353eSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
11606636c353eSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
11607636c353eSmrgAC_SUBST([DLLTOOL])
11608636c353eSmrg])
11609636c353eSmrg
11610636c353eSmrg# _LT_DECL_FILECMD
11611636c353eSmrg# ----------------
11612636c353eSmrg# Check for a file(cmd) program that can be used to detect file type and magic
11613636c353eSmrgm4_defun([_LT_DECL_FILECMD],
11614636c353eSmrg[AC_CHECK_TOOL([FILECMD], [file], [:])
11615636c353eSmrg_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
11616636c353eSmrg])# _LD_DECL_FILECMD
11617e07dc26bSmrg
11618636c353eSmrg# _LT_DECL_SED
11619636c353eSmrg# ------------
11620636c353eSmrg# Check for a fully-functional sed program, that truncates
11621636c353eSmrg# as few characters as possible.  Prefer GNU sed if found.
11622636c353eSmrgm4_defun([_LT_DECL_SED],
11623636c353eSmrg[AC_PROG_SED
11624636c353eSmrgtest -z "$SED" && SED=sed
11625636c353eSmrgXsed="$SED -e 1s/^X//"
11626636c353eSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
11627636c353eSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
11628636c353eSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
11629636c353eSmrg])# _LT_DECL_SED
11630e07dc26bSmrg
11631636c353eSmrgm4_ifndef([AC_PROG_SED], [
11632636c353eSmrg# NOTE: This macro has been submitted for inclusion into   #
11633636c353eSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
11634636c353eSmrg#  a released version of Autoconf we should remove this    #
11635636c353eSmrg#  macro and use it instead.                               #
11636e07dc26bSmrg
11637636c353eSmrgm4_defun([AC_PROG_SED],
11638636c353eSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
11639636c353eSmrgAC_CACHE_VAL(lt_cv_path_SED,
11640636c353eSmrg[# Loop through the user's path and test for sed and gsed.
11641636c353eSmrg# Then use that list of sed's as ones to test for truncation.
11642636c353eSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11643636c353eSmrgfor as_dir in $PATH
11644636c353eSmrgdo
11645636c353eSmrg  IFS=$as_save_IFS
11646636c353eSmrg  test -z "$as_dir" && as_dir=.
11647636c353eSmrg  for lt_ac_prog in sed gsed; do
11648636c353eSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
11649636c353eSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
11650636c353eSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
11651e07dc26bSmrg      fi
11652636c353eSmrg    done
11653636c353eSmrg  done
11654636c353eSmrgdone
11655636c353eSmrgIFS=$as_save_IFS
11656636c353eSmrglt_ac_max=0
11657636c353eSmrglt_ac_count=0
11658636c353eSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
11659636c353eSmrg# along with /bin/sed that truncates output.
11660636c353eSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
11661636c353eSmrg  test ! -f "$lt_ac_sed" && continue
11662636c353eSmrg  cat /dev/null > conftest.in
11663636c353eSmrg  lt_ac_count=0
11664636c353eSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
11665636c353eSmrg  # Check for GNU sed and select it if it is found.
11666636c353eSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
11667636c353eSmrg    lt_cv_path_SED=$lt_ac_sed
11668636c353eSmrg    break
11669636c353eSmrg  fi
11670636c353eSmrg  while true; do
11671636c353eSmrg    cat conftest.in conftest.in >conftest.tmp
11672636c353eSmrg    mv conftest.tmp conftest.in
11673636c353eSmrg    cp conftest.in conftest.nl
11674636c353eSmrg    echo >>conftest.nl
11675636c353eSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
11676636c353eSmrg    cmp -s conftest.out conftest.nl || break
11677636c353eSmrg    # 10000 chars as input seems more than enough
11678636c353eSmrg    test 10 -lt "$lt_ac_count" && break
11679636c353eSmrg    lt_ac_count=`expr $lt_ac_count + 1`
11680636c353eSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
11681636c353eSmrg      lt_ac_max=$lt_ac_count
11682636c353eSmrg      lt_cv_path_SED=$lt_ac_sed
11683e07dc26bSmrg    fi
11684e07dc26bSmrg  done
11685636c353eSmrgdone
11686636c353eSmrg])
11687636c353eSmrgSED=$lt_cv_path_SED
11688636c353eSmrgAC_SUBST([SED])
11689636c353eSmrgAC_MSG_RESULT([$SED])
11690636c353eSmrg])#AC_PROG_SED
11691636c353eSmrg])#m4_ifndef
11692e07dc26bSmrg
11693636c353eSmrg# Old name:
11694636c353eSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
11695636c353eSmrgdnl aclocal-1.4 backwards compatibility:
11696636c353eSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
11697636c353eSmrg
11698636c353eSmrg
11699636c353eSmrg# _LT_CHECK_SHELL_FEATURES
11700636c353eSmrg# ------------------------
11701636c353eSmrg# Find out whether the shell is Bourne or XSI compatible,
11702636c353eSmrg# or has some other useful features.
11703636c353eSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
11704636c353eSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
11705636c353eSmrg  lt_unset=unset
11706e07dc26bSmrgelse
11707636c353eSmrg  lt_unset=false
11708e07dc26bSmrgfi
11709636c353eSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
11710636c353eSmrg
11711636c353eSmrg# test EBCDIC or ASCII
11712636c353eSmrgcase `echo X|tr X '\101'` in
11713636c353eSmrg A) # ASCII based system
11714636c353eSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
11715636c353eSmrg  lt_SP2NL='tr \040 \012'
11716636c353eSmrg  lt_NL2SP='tr \015\012 \040\040'
11717636c353eSmrg  ;;
11718636c353eSmrg *) # EBCDIC based system
11719636c353eSmrg  lt_SP2NL='tr \100 \n'
11720636c353eSmrg  lt_NL2SP='tr \r\n \100\100'
11721636c353eSmrg  ;;
11722636c353eSmrgesac
11723636c353eSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
11724636c353eSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
11725636c353eSmrg])# _LT_CHECK_SHELL_FEATURES
11726636c353eSmrg
11727636c353eSmrg
11728636c353eSmrg# _LT_PATH_CONVERSION_FUNCTIONS
11729636c353eSmrg# -----------------------------
11730636c353eSmrg# Determine what file name conversion functions should be used by
11731636c353eSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
11732636c353eSmrg# for certain cross-compile configurations and native mingw.
11733636c353eSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
11734636c353eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11735636c353eSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
11736636c353eSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
11737636c353eSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
11738636c353eSmrg[case $host in
11739636c353eSmrg  *-*-mingw* )
11740636c353eSmrg    case $build in
11741636c353eSmrg      *-*-mingw* ) # actually msys
11742636c353eSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
11743636c353eSmrg        ;;
11744636c353eSmrg      *-*-cygwin* )
11745636c353eSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
11746636c353eSmrg        ;;
11747636c353eSmrg      * ) # otherwise, assume *nix
11748636c353eSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
11749636c353eSmrg        ;;
11750636c353eSmrg    esac
11751636c353eSmrg    ;;
11752636c353eSmrg  *-*-cygwin* )
11753636c353eSmrg    case $build in
11754636c353eSmrg      *-*-mingw* ) # actually msys
11755636c353eSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
11756636c353eSmrg        ;;
11757636c353eSmrg      *-*-cygwin* )
11758636c353eSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
11759636c353eSmrg        ;;
11760636c353eSmrg      * ) # otherwise, assume *nix
11761636c353eSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
11762636c353eSmrg        ;;
11763636c353eSmrg    esac
11764636c353eSmrg    ;;
11765636c353eSmrg  * ) # unhandled hosts (and "normal" native builds)
11766636c353eSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
11767636c353eSmrg    ;;
11768636c353eSmrgesac
11769e07dc26bSmrg])
11770636c353eSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
11771636c353eSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
11772636c353eSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
11773636c353eSmrg         [0], [convert $build file names to $host format])dnl
11774636c353eSmrg
11775636c353eSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
11776636c353eSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
11777636c353eSmrg[#assume ordinary cross tools, or native build.
11778636c353eSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
11779636c353eSmrgcase $host in
11780636c353eSmrg  *-*-mingw* )
11781636c353eSmrg    case $build in
11782636c353eSmrg      *-*-mingw* ) # actually msys
11783636c353eSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
11784636c353eSmrg        ;;
11785636c353eSmrg    esac
11786636c353eSmrg    ;;
11787636c353eSmrgesac
11788e07dc26bSmrg])
11789636c353eSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
11790636c353eSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
11791636c353eSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
11792636c353eSmrg         [0], [convert $build files to toolchain format])dnl
11793636c353eSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
11794e07dc26bSmrg
11795636c353eSmrg# Helper functions for option handling.                    -*- Autoconf -*-
11796636c353eSmrg#
11797636c353eSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
11798636c353eSmrg#   Software Foundation, Inc.
11799636c353eSmrg#   Written by Gary V. Vaughan, 2004
11800636c353eSmrg#
11801636c353eSmrg# This file is free software; the Free Software Foundation gives
11802636c353eSmrg# unlimited permission to copy and/or distribute it, with or without
11803636c353eSmrg# modifications, as long as this notice is preserved.
11804e07dc26bSmrg
11805636c353eSmrg# serial 8 ltoptions.m4
11806636c353eSmrg
11807636c353eSmrg# This is to help aclocal find these macros, as it can't see m4_define.
11808636c353eSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
11809636c353eSmrg
11810636c353eSmrg
11811636c353eSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
11812636c353eSmrg# ------------------------------------------
11813636c353eSmrgm4_define([_LT_MANGLE_OPTION],
11814636c353eSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
11815636c353eSmrg
11816636c353eSmrg
11817636c353eSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
11818636c353eSmrg# ---------------------------------------
11819636c353eSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
11820636c353eSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
11821636c353eSmrg# saved as a flag.
11822636c353eSmrgm4_define([_LT_SET_OPTION],
11823636c353eSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
11824636c353eSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
11825636c353eSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
11826636c353eSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
11827e07dc26bSmrg])
11828e07dc26bSmrg
11829e07dc26bSmrg
11830636c353eSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
11831636c353eSmrg# ------------------------------------------------------------
11832636c353eSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11833636c353eSmrgm4_define([_LT_IF_OPTION],
11834636c353eSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
11835636c353eSmrg
11836636c353eSmrg
11837636c353eSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
11838636c353eSmrg# -------------------------------------------------------
11839636c353eSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
11840636c353eSmrg# are set.
11841636c353eSmrgm4_define([_LT_UNLESS_OPTIONS],
11842636c353eSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11843636c353eSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
11844636c353eSmrg		      [m4_define([$0_found])])])[]dnl
11845636c353eSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
11846636c353eSmrg])[]dnl
11847e07dc26bSmrg])
11848e07dc26bSmrg
11849e07dc26bSmrg
11850636c353eSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
11851636c353eSmrg# ----------------------------------------
11852636c353eSmrg# OPTION-LIST is a space-separated list of Libtool options associated
11853636c353eSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
11854636c353eSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
11855636c353eSmrg# the unknown option and exit.
11856636c353eSmrgm4_defun([_LT_SET_OPTIONS],
11857636c353eSmrg[# Set options
11858636c353eSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
11859636c353eSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
11860636c353eSmrg
11861636c353eSmrgm4_if([$1],[LT_INIT],[
11862636c353eSmrg  dnl
11863636c353eSmrg  dnl Simply set some default values (i.e off) if boolean options were not
11864636c353eSmrg  dnl specified:
11865636c353eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
11866636c353eSmrg  ])
11867636c353eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
11868636c353eSmrg  ])
11869636c353eSmrg  dnl
11870636c353eSmrg  dnl If no reference was made to various pairs of opposing options, then
11871636c353eSmrg  dnl we run the default mode handler for the pair.  For example, if neither
11872636c353eSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
11873636c353eSmrg  dnl archives by default:
11874636c353eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
11875636c353eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
11876636c353eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
11877636c353eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
11878636c353eSmrg		   [_LT_ENABLE_FAST_INSTALL])
11879636c353eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
11880636c353eSmrg		   [_LT_WITH_AIX_SONAME([aix])])
11881636c353eSmrg  ])
11882636c353eSmrg])# _LT_SET_OPTIONS
11883e07dc26bSmrg
11884e07dc26bSmrg
11885e07dc26bSmrg
11886636c353eSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
11887636c353eSmrg# -----------------------------------------
11888636c353eSmrgm4_define([_LT_MANGLE_DEFUN],
11889636c353eSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
11890e07dc26bSmrg
11891636c353eSmrg
11892636c353eSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
11893636c353eSmrg# -----------------------------------------------
11894636c353eSmrgm4_define([LT_OPTION_DEFINE],
11895636c353eSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
11896636c353eSmrg])# LT_OPTION_DEFINE
11897636c353eSmrg
11898636c353eSmrg
11899636c353eSmrg# dlopen
11900636c353eSmrg# ------
11901636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
11902e07dc26bSmrg])
11903e07dc26bSmrg
11904636c353eSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
11905636c353eSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
11906636c353eSmrgAC_DIAGNOSE([obsolete],
11907636c353eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
11908636c353eSmrgput the 'dlopen' option into LT_INIT's first parameter.])
11909636c353eSmrg])
11910e07dc26bSmrg
11911636c353eSmrgdnl aclocal-1.4 backwards compatibility:
11912636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
11913e07dc26bSmrg
11914e07dc26bSmrg
11915636c353eSmrg# win32-dll
11916636c353eSmrg# ---------
11917636c353eSmrg# Declare package support for building win32 dll's.
11918636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
11919636c353eSmrg[enable_win32_dll=yes
11920636c353eSmrg
11921636c353eSmrgcase $host in
11922636c353eSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
11923636c353eSmrg  AC_CHECK_TOOL(AS, as, false)
11924636c353eSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
11925636c353eSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
11926636c353eSmrg  ;;
11927636c353eSmrgesac
11928636c353eSmrg
11929636c353eSmrgtest -z "$AS" && AS=as
11930636c353eSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
11931636c353eSmrg
11932636c353eSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
11933636c353eSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
11934636c353eSmrg
11935636c353eSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
11936636c353eSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
11937636c353eSmrg])# win32-dll
11938636c353eSmrg
11939636c353eSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
11940636c353eSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11941636c353eSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
11942636c353eSmrgAC_DIAGNOSE([obsolete],
11943636c353eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
11944636c353eSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
11945e07dc26bSmrg])
11946e07dc26bSmrg
11947636c353eSmrgdnl aclocal-1.4 backwards compatibility:
11948636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
11949636c353eSmrg
11950636c353eSmrg
11951636c353eSmrg# _LT_ENABLE_SHARED([DEFAULT])
11952636c353eSmrg# ----------------------------
11953636c353eSmrg# implement the --enable-shared flag, and supports the 'shared' and
11954636c353eSmrg# 'disable-shared' LT_INIT options.
11955636c353eSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
11956636c353eSmrgm4_define([_LT_ENABLE_SHARED],
11957636c353eSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
11958636c353eSmrgAC_ARG_ENABLE([shared],
11959636c353eSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
11960636c353eSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
11961636c353eSmrg    [p=${PACKAGE-default}
11962636c353eSmrg    case $enableval in
11963636c353eSmrg    yes) enable_shared=yes ;;
11964636c353eSmrg    no) enable_shared=no ;;
11965636c353eSmrg    *)
11966636c353eSmrg      enable_shared=no
11967636c353eSmrg      # Look at the argument we got.  We use all the common list separators.
11968636c353eSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
11969636c353eSmrg      for pkg in $enableval; do
11970636c353eSmrg	IFS=$lt_save_ifs
11971636c353eSmrg	if test "X$pkg" = "X$p"; then
11972636c353eSmrg	  enable_shared=yes
11973636c353eSmrg	fi
11974636c353eSmrg      done
11975636c353eSmrg      IFS=$lt_save_ifs
11976636c353eSmrg      ;;
11977636c353eSmrg    esac],
11978636c353eSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
11979e07dc26bSmrg
11980636c353eSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
11981636c353eSmrg	[Whether or not to build shared libraries])
11982636c353eSmrg])# _LT_ENABLE_SHARED
11983e07dc26bSmrg
11984636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
11985636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
11986e07dc26bSmrg
11987636c353eSmrg# Old names:
11988636c353eSmrgAC_DEFUN([AC_ENABLE_SHARED],
11989636c353eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
11990636c353eSmrg])
11991e07dc26bSmrg
11992636c353eSmrgAC_DEFUN([AC_DISABLE_SHARED],
11993636c353eSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
11994e07dc26bSmrg])
11995e07dc26bSmrg
11996636c353eSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
11997636c353eSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
11998e07dc26bSmrg
11999636c353eSmrgdnl aclocal-1.4 backwards compatibility:
12000636c353eSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
12001636c353eSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
12002e07dc26bSmrg
12003e07dc26bSmrg
12004e07dc26bSmrg
12005636c353eSmrg# _LT_ENABLE_STATIC([DEFAULT])
12006636c353eSmrg# ----------------------------
12007636c353eSmrg# implement the --enable-static flag, and support the 'static' and
12008636c353eSmrg# 'disable-static' LT_INIT options.
12009636c353eSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
12010636c353eSmrgm4_define([_LT_ENABLE_STATIC],
12011636c353eSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
12012636c353eSmrgAC_ARG_ENABLE([static],
12013636c353eSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
12014636c353eSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
12015636c353eSmrg    [p=${PACKAGE-default}
12016636c353eSmrg    case $enableval in
12017636c353eSmrg    yes) enable_static=yes ;;
12018636c353eSmrg    no) enable_static=no ;;
12019636c353eSmrg    *)
12020636c353eSmrg     enable_static=no
12021636c353eSmrg      # Look at the argument we got.  We use all the common list separators.
12022636c353eSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12023636c353eSmrg      for pkg in $enableval; do
12024636c353eSmrg	IFS=$lt_save_ifs
12025636c353eSmrg	if test "X$pkg" = "X$p"; then
12026636c353eSmrg	  enable_static=yes
12027636c353eSmrg	fi
12028636c353eSmrg      done
12029636c353eSmrg      IFS=$lt_save_ifs
12030636c353eSmrg      ;;
12031636c353eSmrg    esac],
12032636c353eSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
12033e07dc26bSmrg
12034636c353eSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
12035636c353eSmrg	[Whether or not to build static libraries])
12036636c353eSmrg])# _LT_ENABLE_STATIC
12037e07dc26bSmrg
12038636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
12039636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
12040e07dc26bSmrg
12041636c353eSmrg# Old names:
12042636c353eSmrgAC_DEFUN([AC_ENABLE_STATIC],
12043636c353eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
12044636c353eSmrg])
12045e07dc26bSmrg
12046636c353eSmrgAC_DEFUN([AC_DISABLE_STATIC],
12047636c353eSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
12048636c353eSmrg])
12049e07dc26bSmrg
12050636c353eSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
12051636c353eSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
12052e07dc26bSmrg
12053636c353eSmrgdnl aclocal-1.4 backwards compatibility:
12054636c353eSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
12055636c353eSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
12056e07dc26bSmrg
12057e07dc26bSmrg
12058e07dc26bSmrg
12059636c353eSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
12060636c353eSmrg# ----------------------------------
12061636c353eSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
12062636c353eSmrg# and 'disable-fast-install' LT_INIT options.
12063636c353eSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
12064636c353eSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
12065636c353eSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
12066636c353eSmrgAC_ARG_ENABLE([fast-install],
12067636c353eSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
12068636c353eSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
12069636c353eSmrg    [p=${PACKAGE-default}
12070636c353eSmrg    case $enableval in
12071636c353eSmrg    yes) enable_fast_install=yes ;;
12072636c353eSmrg    no) enable_fast_install=no ;;
12073636c353eSmrg    *)
12074636c353eSmrg      enable_fast_install=no
12075636c353eSmrg      # Look at the argument we got.  We use all the common list separators.
12076636c353eSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12077636c353eSmrg      for pkg in $enableval; do
12078636c353eSmrg	IFS=$lt_save_ifs
12079636c353eSmrg	if test "X$pkg" = "X$p"; then
12080636c353eSmrg	  enable_fast_install=yes
12081636c353eSmrg	fi
12082636c353eSmrg      done
12083636c353eSmrg      IFS=$lt_save_ifs
12084636c353eSmrg      ;;
12085636c353eSmrg    esac],
12086636c353eSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
12087e07dc26bSmrg
12088636c353eSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
12089636c353eSmrg	 [Whether or not to optimize for fast installation])dnl
12090636c353eSmrg])# _LT_ENABLE_FAST_INSTALL
12091e07dc26bSmrg
12092636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
12093636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
12094e07dc26bSmrg
12095636c353eSmrg# Old names:
12096636c353eSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
12097636c353eSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
12098636c353eSmrgAC_DIAGNOSE([obsolete],
12099636c353eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
12100636c353eSmrgthe 'fast-install' option into LT_INIT's first parameter.])
12101e07dc26bSmrg])
12102e07dc26bSmrg
12103636c353eSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
12104636c353eSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
12105636c353eSmrgAC_DIAGNOSE([obsolete],
12106636c353eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
12107636c353eSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
12108636c353eSmrg])
12109e07dc26bSmrg
12110636c353eSmrgdnl aclocal-1.4 backwards compatibility:
12111636c353eSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
12112636c353eSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
12113e07dc26bSmrg
12114e07dc26bSmrg
12115636c353eSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
12116636c353eSmrg# ----------------------------------
12117636c353eSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
12118636c353eSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
12119636c353eSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
12120636c353eSmrgm4_define([_LT_WITH_AIX_SONAME],
12121636c353eSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
12122636c353eSmrgshared_archive_member_spec=
12123636c353eSmrgcase $host,$enable_shared in
12124636c353eSmrgpower*-*-aix[[5-9]]*,yes)
12125636c353eSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
12126636c353eSmrg  AC_ARG_WITH([aix-soname],
12127636c353eSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
12128636c353eSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
12129636c353eSmrg    [case $withval in
12130636c353eSmrg    aix|svr4|both)
12131636c353eSmrg      ;;
12132636c353eSmrg    *)
12133636c353eSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
12134636c353eSmrg      ;;
12135636c353eSmrg    esac
12136636c353eSmrg    lt_cv_with_aix_soname=$with_aix_soname],
12137636c353eSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
12138636c353eSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
12139636c353eSmrg    with_aix_soname=$lt_cv_with_aix_soname])
12140636c353eSmrg  AC_MSG_RESULT([$with_aix_soname])
12141636c353eSmrg  if test aix != "$with_aix_soname"; then
12142636c353eSmrg    # For the AIX way of multilib, we name the shared archive member
12143636c353eSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
12144636c353eSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
12145636c353eSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
12146636c353eSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
12147636c353eSmrg    if test 64 = "${OBJECT_MODE-32}"; then
12148636c353eSmrg      shared_archive_member_spec=shr_64
12149636c353eSmrg    else
12150636c353eSmrg      shared_archive_member_spec=shr
12151636c353eSmrg    fi
12152636c353eSmrg  fi
12153636c353eSmrg  ;;
12154636c353eSmrg*)
12155636c353eSmrg  with_aix_soname=aix
12156636c353eSmrg  ;;
12157636c353eSmrgesac
12158e07dc26bSmrg
12159636c353eSmrg_LT_DECL([], [shared_archive_member_spec], [0],
12160636c353eSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
12161636c353eSmrg])# _LT_WITH_AIX_SONAME
12162e07dc26bSmrg
12163636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
12164636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
12165636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
12166e07dc26bSmrg
12167e07dc26bSmrg
12168636c353eSmrg# _LT_WITH_PIC([MODE])
12169e07dc26bSmrg# --------------------
12170636c353eSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
12171636c353eSmrg# LT_INIT options.
12172636c353eSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
12173636c353eSmrgm4_define([_LT_WITH_PIC],
12174636c353eSmrg[AC_ARG_WITH([pic],
12175636c353eSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
12176636c353eSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
12177636c353eSmrg    [lt_p=${PACKAGE-default}
12178636c353eSmrg    case $withval in
12179636c353eSmrg    yes|no) pic_mode=$withval ;;
12180636c353eSmrg    *)
12181636c353eSmrg      pic_mode=default
12182636c353eSmrg      # Look at the argument we got.  We use all the common list separators.
12183636c353eSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
12184636c353eSmrg      for lt_pkg in $withval; do
12185636c353eSmrg	IFS=$lt_save_ifs
12186636c353eSmrg	if test "X$lt_pkg" = "X$lt_p"; then
12187636c353eSmrg	  pic_mode=yes
12188636c353eSmrg	fi
12189636c353eSmrg      done
12190636c353eSmrg      IFS=$lt_save_ifs
12191636c353eSmrg      ;;
12192636c353eSmrg    esac],
12193636c353eSmrg    [pic_mode=m4_default([$1], [default])])
12194e07dc26bSmrg
12195636c353eSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
12196636c353eSmrg])# _LT_WITH_PIC
12197e07dc26bSmrg
12198636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
12199636c353eSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
12200e07dc26bSmrg
12201636c353eSmrg# Old name:
12202636c353eSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
12203636c353eSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
12204636c353eSmrgAC_DIAGNOSE([obsolete],
12205636c353eSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
12206636c353eSmrgput the 'pic-only' option into LT_INIT's first parameter.])
12207636c353eSmrg])
12208e07dc26bSmrg
12209636c353eSmrgdnl aclocal-1.4 backwards compatibility:
12210636c353eSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
12211e07dc26bSmrg
12212e07dc26bSmrg
12213636c353eSmrgm4_define([_LTDL_MODE], [])
12214636c353eSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
12215636c353eSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
12216636c353eSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
12217636c353eSmrg		 [m4_define([_LTDL_MODE], [recursive])])
12218636c353eSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
12219636c353eSmrg		 [m4_define([_LTDL_MODE], [subproject])])
12220636c353eSmrg
12221636c353eSmrgm4_define([_LTDL_TYPE], [])
12222636c353eSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
12223636c353eSmrg		 [m4_define([_LTDL_TYPE], [installable])])
12224636c353eSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
12225636c353eSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
12226636c353eSmrg
12227636c353eSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
12228e07dc26bSmrg#
12229636c353eSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
12230636c353eSmrg# Foundation, Inc.
12231636c353eSmrg# Written by Gary V. Vaughan, 2004
12232636c353eSmrg#
12233636c353eSmrg# This file is free software; the Free Software Foundation gives
12234636c353eSmrg# unlimited permission to copy and/or distribute it, with or without
12235636c353eSmrg# modifications, as long as this notice is preserved.
12236e07dc26bSmrg
12237636c353eSmrg# serial 6 ltsugar.m4
12238e07dc26bSmrg
12239636c353eSmrg# This is to help aclocal find these macros, as it can't see m4_define.
12240636c353eSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
12241e07dc26bSmrg
12242e07dc26bSmrg
12243636c353eSmrg# lt_join(SEP, ARG1, [ARG2...])
12244636c353eSmrg# -----------------------------
12245636c353eSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
12246636c353eSmrg# associated separator.
12247636c353eSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
12248636c353eSmrg# versions in m4sugar had bugs.
12249636c353eSmrgm4_define([lt_join],
12250636c353eSmrg[m4_if([$#], [1], [],
12251636c353eSmrg       [$#], [2], [[$2]],
12252636c353eSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
12253636c353eSmrgm4_define([_lt_join],
12254636c353eSmrg[m4_if([$#$2], [2], [],
12255636c353eSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
12256e07dc26bSmrg
12257e07dc26bSmrg
12258636c353eSmrg# lt_car(LIST)
12259636c353eSmrg# lt_cdr(LIST)
12260636c353eSmrg# ------------
12261636c353eSmrg# Manipulate m4 lists.
12262636c353eSmrg# These macros are necessary as long as will still need to support
12263636c353eSmrg# Autoconf-2.59, which quotes differently.
12264636c353eSmrgm4_define([lt_car], [[$1]])
12265636c353eSmrgm4_define([lt_cdr],
12266636c353eSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
12267636c353eSmrg       [$#], 1, [],
12268636c353eSmrg       [m4_dquote(m4_shift($@))])])
12269636c353eSmrgm4_define([lt_unquote], $1)
12270636c353eSmrg
12271e07dc26bSmrg
12272636c353eSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
12273636c353eSmrg# ------------------------------------------
12274636c353eSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
12275636c353eSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
12276636c353eSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
12277636c353eSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
12278636c353eSmrg# than defined and empty).
12279e07dc26bSmrg#
12280636c353eSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
12281636c353eSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
12282636c353eSmrgm4_define([lt_append],
12283636c353eSmrg[m4_define([$1],
12284636c353eSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
12285e07dc26bSmrg
12286e07dc26bSmrg
12287e07dc26bSmrg
12288636c353eSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
12289636c353eSmrg# ----------------------------------------------------------
12290636c353eSmrg# Produce a SEP delimited list of all paired combinations of elements of
12291636c353eSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
12292636c353eSmrg# has the form PREFIXmINFIXSUFFIXn.
12293636c353eSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
12294636c353eSmrgm4_define([lt_combine],
12295636c353eSmrg[m4_if(m4_eval([$# > 3]), [1],
12296636c353eSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
12297636c353eSmrg[[m4_foreach([_Lt_prefix], [$2],
12298636c353eSmrg	     [m4_foreach([_Lt_suffix],
12299636c353eSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
12300636c353eSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
12301636c353eSmrg
12302636c353eSmrg
12303636c353eSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
12304636c353eSmrg# -----------------------------------------------------------------------
12305636c353eSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
12306636c353eSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
12307636c353eSmrgm4_define([lt_if_append_uniq],
12308636c353eSmrg[m4_ifdef([$1],
12309636c353eSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
12310636c353eSmrg		 [lt_append([$1], [$2], [$3])$4],
12311636c353eSmrg		 [$5])],
12312636c353eSmrg	  [lt_append([$1], [$2], [$3])$4])])
12313636c353eSmrg
12314636c353eSmrg
12315636c353eSmrg# lt_dict_add(DICT, KEY, VALUE)
12316636c353eSmrg# -----------------------------
12317636c353eSmrgm4_define([lt_dict_add],
12318636c353eSmrg[m4_define([$1($2)], [$3])])
12319e07dc26bSmrg
12320e07dc26bSmrg
12321636c353eSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
12322636c353eSmrg# --------------------------------------------
12323636c353eSmrgm4_define([lt_dict_add_subkey],
12324636c353eSmrg[m4_define([$1($2:$3)], [$4])])
12325e07dc26bSmrg
12326e07dc26bSmrg
12327636c353eSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
12328636c353eSmrg# ----------------------------------
12329636c353eSmrgm4_define([lt_dict_fetch],
12330636c353eSmrg[m4_ifval([$3],
12331636c353eSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
12332636c353eSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
12333e07dc26bSmrg
12334e07dc26bSmrg
12335636c353eSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
12336636c353eSmrg# -----------------------------------------------------------------
12337636c353eSmrgm4_define([lt_if_dict_fetch],
12338636c353eSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
12339636c353eSmrg	[$5],
12340636c353eSmrg    [$6])])
12341e07dc26bSmrg
12342e07dc26bSmrg
12343636c353eSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
12344636c353eSmrg# --------------------------------------------------------------
12345636c353eSmrgm4_define([lt_dict_filter],
12346636c353eSmrg[m4_if([$5], [], [],
12347636c353eSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
12348636c353eSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
12349636c353eSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
12350636c353eSmrg])
12351e07dc26bSmrg
12352636c353eSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
12353636c353eSmrg#
12354636c353eSmrg#   Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
12355636c353eSmrg#   Inc.
12356636c353eSmrg#   Written by Scott James Remnant, 2004
12357636c353eSmrg#
12358636c353eSmrg# This file is free software; the Free Software Foundation gives
12359636c353eSmrg# unlimited permission to copy and/or distribute it, with or without
12360636c353eSmrg# modifications, as long as this notice is preserved.
12361e07dc26bSmrg
12362636c353eSmrg# @configure_input@
12363e07dc26bSmrg
12364636c353eSmrg# serial 4245 ltversion.m4
12365636c353eSmrg# This file is part of GNU Libtool
12366e07dc26bSmrg
12367636c353eSmrgm4_define([LT_PACKAGE_VERSION], [2.4.7])
12368636c353eSmrgm4_define([LT_PACKAGE_REVISION], [2.4.7])
12369e07dc26bSmrg
12370636c353eSmrgAC_DEFUN([LTVERSION_VERSION],
12371636c353eSmrg[macro_version='2.4.7'
12372636c353eSmrgmacro_revision='2.4.7'
12373636c353eSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
12374636c353eSmrg_LT_DECL(, macro_revision, 0)
12375636c353eSmrg])
12376e07dc26bSmrg
12377636c353eSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
12378636c353eSmrg#
12379636c353eSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
12380636c353eSmrg#   Software Foundation, Inc.
12381636c353eSmrg#   Written by Scott James Remnant, 2004.
12382636c353eSmrg#
12383636c353eSmrg# This file is free software; the Free Software Foundation gives
12384636c353eSmrg# unlimited permission to copy and/or distribute it, with or without
12385636c353eSmrg# modifications, as long as this notice is preserved.
12386e07dc26bSmrg
12387636c353eSmrg# serial 5 lt~obsolete.m4
12388e07dc26bSmrg
12389636c353eSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
12390636c353eSmrg#
12391636c353eSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
12392636c353eSmrg# which have later been changed to m4_define as they aren't part of the
12393636c353eSmrg# exported API, or moved to Autoconf or Automake where they belong.
12394636c353eSmrg#
12395636c353eSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
12396636c353eSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
12397636c353eSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
12398636c353eSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
12399636c353eSmrg# and doesn't know about Autoconf macros at all.)
12400636c353eSmrg#
12401636c353eSmrg# So we provide this file, which has a silly filename so it's always
12402636c353eSmrg# included after everything else.  This provides aclocal with the
12403636c353eSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
12404636c353eSmrg# because those macros already exist, or will be overwritten later.
12405636c353eSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
12406636c353eSmrg#
12407636c353eSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
12408636c353eSmrg# Yes, that means every name once taken will need to remain here until
12409636c353eSmrg# we give up compatibility with versions before 1.7, at which point
12410636c353eSmrg# we need to keep only those names which we still refer to.
12411e07dc26bSmrg
12412636c353eSmrg# This is to help aclocal find these macros, as it can't see m4_define.
12413636c353eSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
12414e07dc26bSmrg
12415636c353eSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
12416636c353eSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
12417636c353eSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
12418636c353eSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
12419636c353eSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
12420636c353eSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
12421636c353eSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
12422636c353eSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
12423636c353eSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
12424636c353eSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
12425636c353eSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
12426636c353eSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
12427636c353eSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
12428636c353eSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
12429636c353eSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
12430636c353eSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
12431636c353eSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
12432636c353eSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
12433636c353eSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
12434636c353eSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
12435636c353eSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
12436636c353eSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
12437636c353eSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
12438636c353eSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
12439636c353eSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
12440636c353eSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
12441636c353eSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
12442636c353eSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
12443636c353eSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
12444636c353eSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
12445636c353eSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
12446636c353eSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
12447636c353eSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
12448636c353eSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
12449636c353eSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
12450636c353eSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
12451636c353eSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
12452636c353eSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
12453636c353eSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
12454636c353eSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
12455636c353eSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
12456636c353eSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
12457636c353eSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
12458636c353eSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
12459636c353eSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
12460636c353eSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
12461636c353eSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
12462636c353eSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
12463636c353eSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
12464636c353eSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
12465636c353eSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
12466636c353eSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
12467636c353eSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
12468636c353eSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
12469636c353eSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
12470636c353eSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
12471636c353eSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
12472636c353eSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
12473636c353eSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
12474636c353eSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
12475636c353eSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
12476e07dc26bSmrg
12477