aclocal.m4 revision 3c15da26
1555991fdSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2126a8a12Smrg
3126a8a12Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4d656433aSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5126a8a12Smrg# This file is free software; the Free Software Foundation
6126a8a12Smrg# gives unlimited permission to copy and/or distribute it,
7126a8a12Smrg# with or without modifications, as long as this notice is preserved.
8126a8a12Smrg
9126a8a12Smrg# This program is distributed in the hope that it will be useful,
10126a8a12Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11126a8a12Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12126a8a12Smrg# PARTICULAR PURPOSE.
13126a8a12Smrg
14d656433aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15d656433aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16555991fdSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17555991fdSmrg[m4_warning([this file was generated for autoconf 2.68.
18d656433aSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19d656433aSmrgIf you have problems, you may need to regenerate the build system entirely.
20d656433aSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21126a8a12Smrg
22555991fdSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23d656433aSmrg#
24555991fdSmrg# This file is free software; the Free Software Foundation
25555991fdSmrg# gives unlimited permission to copy and/or distribute it,
26555991fdSmrg# with or without modifications, as long as this notice is preserved.
27555991fdSmrg
28555991fdSmrg# AM_AUTOMAKE_VERSION(VERSION)
29555991fdSmrg# ----------------------------
30555991fdSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31555991fdSmrg# generated from the m4 files accompanying Automake X.Y.
32555991fdSmrg# (This private macro should not be called outside this file.)
33555991fdSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34555991fdSmrg[am__api_version='1.11'
35555991fdSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36555991fdSmrgdnl require some minimum version.  Point them to the right macro.
37555991fdSmrgm4_if([$1], [1.11.1], [],
38555991fdSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39555991fdSmrg])
40555991fdSmrg
41555991fdSmrg# _AM_AUTOCONF_VERSION(VERSION)
42555991fdSmrg# -----------------------------
43555991fdSmrg# aclocal traces this macro to find the Autoconf version.
44555991fdSmrg# This is a private macro too.  Using m4_define simplifies
45555991fdSmrg# the logic in aclocal, which can simply ignore this definition.
46555991fdSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47555991fdSmrg
48555991fdSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49555991fdSmrg# -------------------------------
50555991fdSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51555991fdSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52555991fdSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53555991fdSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54555991fdSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55555991fdSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56555991fdSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57555991fdSmrg
58555991fdSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59555991fdSmrg
60555991fdSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61d656433aSmrg#
62555991fdSmrg# This file is free software; the Free Software Foundation
63555991fdSmrg# gives unlimited permission to copy and/or distribute it,
64555991fdSmrg# with or without modifications, as long as this notice is preserved.
65d656433aSmrg
66555991fdSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67555991fdSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68555991fdSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69d656433aSmrg#
70555991fdSmrg# Of course, Automake must honor this variable whenever it calls a
71555991fdSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72555991fdSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73555991fdSmrg# depending on how configure is run.  This is pretty annoying, since
74555991fdSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75555991fdSmrg# source directory, any form will work fine, but in subdirectories a
76555991fdSmrg# relative path needs to be adjusted first.
77d656433aSmrg#
78555991fdSmrg# $ac_aux_dir/missing
79555991fdSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80555991fdSmrg# $top_srcdir/$ac_aux_dir/missing
81555991fdSmrg#    fails if $ac_aux_dir is absolute,
82555991fdSmrg#    fails when called from a subdirectory in a VPATH build with
83555991fdSmrg#          a relative $ac_aux_dir
84d656433aSmrg#
85555991fdSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86555991fdSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
87555991fdSmrg# harmless because $srcdir is `.', but things will broke when you
88555991fdSmrg# start a VPATH build or use an absolute $srcdir.
89d656433aSmrg#
90555991fdSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91555991fdSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92555991fdSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93555991fdSmrg# and then we would define $MISSING as
94555991fdSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95555991fdSmrg# This will work as long as MISSING is not called from configure, because
96555991fdSmrg# unfortunately $(top_srcdir) has no meaning in configure.
97555991fdSmrg# However there are other variables, like CC, which are often used in
98555991fdSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99d656433aSmrg#
100555991fdSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
101555991fdSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
102555991fdSmrg# configured tree to be moved without reconfiguration.
103126a8a12Smrg
104555991fdSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105555991fdSmrg[dnl Rely on autoconf to set up CDPATH properly.
106555991fdSmrgAC_PREREQ([2.50])dnl
107555991fdSmrg# expand $ac_aux_dir to an absolute path
108555991fdSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
109d656433aSmrg])
110d656433aSmrg
111555991fdSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112d656433aSmrg
113555991fdSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114555991fdSmrg# Free Software Foundation, Inc.
115555991fdSmrg#
116555991fdSmrg# This file is free software; the Free Software Foundation
117555991fdSmrg# gives unlimited permission to copy and/or distribute it,
118555991fdSmrg# with or without modifications, as long as this notice is preserved.
119126a8a12Smrg
120555991fdSmrg# serial 9
121126a8a12Smrg
122555991fdSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123555991fdSmrg# -------------------------------------
124555991fdSmrg# Define a conditional.
125555991fdSmrgAC_DEFUN([AM_CONDITIONAL],
126555991fdSmrg[AC_PREREQ(2.52)dnl
127555991fdSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128555991fdSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129555991fdSmrgAC_SUBST([$1_TRUE])dnl
130555991fdSmrgAC_SUBST([$1_FALSE])dnl
131555991fdSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132555991fdSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133555991fdSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134555991fdSmrgif $2; then
135555991fdSmrg  $1_TRUE=
136555991fdSmrg  $1_FALSE='#'
137555991fdSmrgelse
138555991fdSmrg  $1_TRUE='#'
139555991fdSmrg  $1_FALSE=
140555991fdSmrgfi
141555991fdSmrgAC_CONFIG_COMMANDS_PRE(
142555991fdSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143555991fdSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144555991fdSmrgUsually this means the macro was only invoked conditionally.]])
145555991fdSmrgfi])])
146126a8a12Smrg
147555991fdSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148555991fdSmrg# Free Software Foundation, Inc.
149555991fdSmrg#
150555991fdSmrg# This file is free software; the Free Software Foundation
151555991fdSmrg# gives unlimited permission to copy and/or distribute it,
152555991fdSmrg# with or without modifications, as long as this notice is preserved.
153d656433aSmrg
154555991fdSmrg# serial 10
155d656433aSmrg
156555991fdSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157555991fdSmrg# written in clear, in which case automake, when reading aclocal.m4,
158555991fdSmrg# will think it sees a *use*, and therefore will trigger all it's
159555991fdSmrg# C support machinery.  Also note that it means that autoscan, seeing
160555991fdSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161d656433aSmrg
162d656433aSmrg
163555991fdSmrg# _AM_DEPENDENCIES(NAME)
164d656433aSmrg# ----------------------
165555991fdSmrg# See how the compiler implements dependency checking.
166555991fdSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167555991fdSmrg# We try a few techniques and use that to set a single cache variable.
168555991fdSmrg#
169555991fdSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170555991fdSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171555991fdSmrg# dependency, and given that the user is not expected to run this macro,
172555991fdSmrg# just rely on AC_PROG_CC.
173555991fdSmrgAC_DEFUN([_AM_DEPENDENCIES],
174555991fdSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175555991fdSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176555991fdSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177555991fdSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178d656433aSmrg
179555991fdSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180555991fdSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181555991fdSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182555991fdSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183555991fdSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184555991fdSmrg                   [depcc="$$1"   am_compiler_list=])
185d656433aSmrg
186555991fdSmrgAC_CACHE_CHECK([dependency style of $depcc],
187555991fdSmrg               [am_cv_$1_dependencies_compiler_type],
188555991fdSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189555991fdSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
190555991fdSmrg  # making bogus files that we don't know about and never remove.  For
191555991fdSmrg  # instance it was reported that on HP-UX the gcc test will end up
192555991fdSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
193555991fdSmrg  # in D'.
194555991fdSmrg  mkdir conftest.dir
195555991fdSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196555991fdSmrg  # using a relative directory.
197555991fdSmrg  cp "$am_depcomp" conftest.dir
198555991fdSmrg  cd conftest.dir
199555991fdSmrg  # We will build objects and dependencies in a subdirectory because
200555991fdSmrg  # it helps to detect inapplicable dependency modes.  For instance
201555991fdSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202555991fdSmrg  # side effect of compilation, but ICC will put the dependencies in
203555991fdSmrg  # the current directory while Tru64 will put them in the object
204555991fdSmrg  # directory.
205555991fdSmrg  mkdir sub
206126a8a12Smrg
207555991fdSmrg  am_cv_$1_dependencies_compiler_type=none
208555991fdSmrg  if test "$am_compiler_list" = ""; then
209555991fdSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210126a8a12Smrg  fi
211555991fdSmrg  am__universal=false
212555991fdSmrg  m4_case([$1], [CC],
213555991fdSmrg    [case " $depcc " in #(
214555991fdSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215555991fdSmrg     esac],
216555991fdSmrg    [CXX],
217555991fdSmrg    [case " $depcc " in #(
218555991fdSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219555991fdSmrg     esac])
220126a8a12Smrg
221555991fdSmrg  for depmode in $am_compiler_list; do
222555991fdSmrg    # Setup a source with many dependencies, because some compilers
223555991fdSmrg    # like to wrap large dependency lists on column 80 (with \), and
224555991fdSmrg    # we should not choose a depcomp mode which is confused by this.
225555991fdSmrg    #
226555991fdSmrg    # We need to recreate these files for each test, as the compiler may
227555991fdSmrg    # overwrite some of them when testing with obscure command lines.
228555991fdSmrg    # This happens at least with the AIX C compiler.
229555991fdSmrg    : > sub/conftest.c
230555991fdSmrg    for i in 1 2 3 4 5 6; do
231555991fdSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232555991fdSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233555991fdSmrg      # Solaris 8's {/usr,}/bin/sh.
234555991fdSmrg      touch sub/conftst$i.h
235555991fdSmrg    done
236555991fdSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237126a8a12Smrg
238555991fdSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239555991fdSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240555991fdSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241555991fdSmrg    # versions had trouble with output in subdirs
242555991fdSmrg    am__obj=sub/conftest.${OBJEXT-o}
243555991fdSmrg    am__minus_obj="-o $am__obj"
244555991fdSmrg    case $depmode in
245555991fdSmrg    gcc)
246555991fdSmrg      # This depmode causes a compiler race in universal mode.
247555991fdSmrg      test "$am__universal" = false || continue
248555991fdSmrg      ;;
249555991fdSmrg    nosideeffect)
250555991fdSmrg      # after this tag, mechanisms are not by side-effect, so they'll
251555991fdSmrg      # only be used when explicitly requested
252555991fdSmrg      if test "x$enable_dependency_tracking" = xyes; then
253555991fdSmrg	continue
254555991fdSmrg      else
255555991fdSmrg	break
256555991fdSmrg      fi
257555991fdSmrg      ;;
258555991fdSmrg    msvisualcpp | msvcmsys)
259555991fdSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260555991fdSmrg      # not run yet.  These depmodes are late enough in the game, and
261555991fdSmrg      # so weak that their functioning should not be impacted.
262555991fdSmrg      am__obj=conftest.${OBJEXT-o}
263555991fdSmrg      am__minus_obj=
264555991fdSmrg      ;;
265555991fdSmrg    none) break ;;
266555991fdSmrg    esac
267555991fdSmrg    if depmode=$depmode \
268555991fdSmrg       source=sub/conftest.c object=$am__obj \
269555991fdSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270555991fdSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271555991fdSmrg         >/dev/null 2>conftest.err &&
272555991fdSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273555991fdSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274555991fdSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275555991fdSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276555991fdSmrg      # icc doesn't choke on unknown options, it will just issue warnings
277555991fdSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
278555991fdSmrg      # that says an option was ignored or not supported.
279555991fdSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280555991fdSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281555991fdSmrg      # The diagnosis changed in icc 8.0:
282555991fdSmrg      #   icc: Command line remark: option '-MP' not supported
283555991fdSmrg      if (grep 'ignoring option' conftest.err ||
284555991fdSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285555991fdSmrg        am_cv_$1_dependencies_compiler_type=$depmode
286555991fdSmrg        break
287555991fdSmrg      fi
288555991fdSmrg    fi
289555991fdSmrg  done
290126a8a12Smrg
291555991fdSmrg  cd ..
292555991fdSmrg  rm -rf conftest.dir
293555991fdSmrgelse
294555991fdSmrg  am_cv_$1_dependencies_compiler_type=none
295555991fdSmrgfi
296555991fdSmrg])
297555991fdSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298555991fdSmrgAM_CONDITIONAL([am__fastdep$1], [
299555991fdSmrg  test "x$enable_dependency_tracking" != xno \
300555991fdSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301555991fdSmrg])
302126a8a12Smrg
303126a8a12Smrg
304555991fdSmrg# AM_SET_DEPDIR
305555991fdSmrg# -------------
306555991fdSmrg# Choose a directory name for dependency files.
307555991fdSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308555991fdSmrgAC_DEFUN([AM_SET_DEPDIR],
309555991fdSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310555991fdSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311555991fdSmrg])
312126a8a12Smrg
313126a8a12Smrg
314555991fdSmrg# AM_DEP_TRACK
315555991fdSmrg# ------------
316555991fdSmrgAC_DEFUN([AM_DEP_TRACK],
317555991fdSmrg[AC_ARG_ENABLE(dependency-tracking,
318555991fdSmrg[  --disable-dependency-tracking  speeds up one-time build
319555991fdSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320555991fdSmrgif test "x$enable_dependency_tracking" != xno; then
321555991fdSmrg  am_depcomp="$ac_aux_dir/depcomp"
322555991fdSmrg  AMDEPBACKSLASH='\'
323555991fdSmrgfi
324555991fdSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325555991fdSmrgAC_SUBST([AMDEPBACKSLASH])dnl
326555991fdSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327555991fdSmrg])
328126a8a12Smrg
329555991fdSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330126a8a12Smrg
331555991fdSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332555991fdSmrg# Free Software Foundation, Inc.
333555991fdSmrg#
334555991fdSmrg# This file is free software; the Free Software Foundation
335555991fdSmrg# gives unlimited permission to copy and/or distribute it,
336555991fdSmrg# with or without modifications, as long as this notice is preserved.
337126a8a12Smrg
338555991fdSmrg#serial 5
339126a8a12Smrg
340555991fdSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341d656433aSmrg# ------------------------------
342555991fdSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343555991fdSmrg[{
344555991fdSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345555991fdSmrg  # are listed without --file.  Let's play safe and only enable the eval
346555991fdSmrg  # if we detect the quoting.
347555991fdSmrg  case $CONFIG_FILES in
348555991fdSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349555991fdSmrg  *)   set x $CONFIG_FILES ;;
350555991fdSmrg  esac
351555991fdSmrg  shift
352555991fdSmrg  for mf
353555991fdSmrg  do
354555991fdSmrg    # Strip MF so we end up with the name of the file.
355555991fdSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356555991fdSmrg    # Check whether this is an Automake generated Makefile or not.
357555991fdSmrg    # We used to match only the files named `Makefile.in', but
358555991fdSmrg    # some people rename them; so instead we look at the file content.
359555991fdSmrg    # Grep'ing the first line is not enough: some people post-process
360555991fdSmrg    # each Makefile.in and add a new line on top of each file to say so.
361555991fdSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362555991fdSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363555991fdSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364555991fdSmrg      dirpart=`AS_DIRNAME("$mf")`
365555991fdSmrg    else
366555991fdSmrg      continue
367555991fdSmrg    fi
368555991fdSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369555991fdSmrg    # from the Makefile without running `make'.
370555991fdSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371555991fdSmrg    test -z "$DEPDIR" && continue
372555991fdSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373555991fdSmrg    test -z "am__include" && continue
374555991fdSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375555991fdSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376555991fdSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377555991fdSmrg    # Find all dependency output files, they are included files with
378555991fdSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379555991fdSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380555991fdSmrg    # expansion.
381555991fdSmrg    for file in `sed -n "
382555991fdSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383555991fdSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384555991fdSmrg      # Make sure the directory exists.
385555991fdSmrg      test -f "$dirpart/$file" && continue
386555991fdSmrg      fdir=`AS_DIRNAME(["$file"])`
387555991fdSmrg      AS_MKDIR_P([$dirpart/$fdir])
388555991fdSmrg      # echo "creating $dirpart/$file"
389555991fdSmrg      echo '# dummy' > "$dirpart/$file"
390555991fdSmrg    done
391555991fdSmrg  done
392555991fdSmrg}
393555991fdSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394d656433aSmrg
395d656433aSmrg
396555991fdSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397555991fdSmrg# -----------------------------
398555991fdSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
399555991fdSmrg#
400555991fdSmrg# This code is only required when automatic dependency tracking
401555991fdSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
402555991fdSmrg# need in order to bootstrap the dependency handling code.
403555991fdSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404555991fdSmrg[AC_CONFIG_COMMANDS([depfiles],
405555991fdSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406555991fdSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407126a8a12Smrg])
408126a8a12Smrg
409555991fdSmrg# Do all the work for Automake.                             -*- Autoconf -*-
410d656433aSmrg
411555991fdSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412555991fdSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413555991fdSmrg#
414555991fdSmrg# This file is free software; the Free Software Foundation
415555991fdSmrg# gives unlimited permission to copy and/or distribute it,
416555991fdSmrg# with or without modifications, as long as this notice is preserved.
417d656433aSmrg
418555991fdSmrg# serial 16
419126a8a12Smrg
420555991fdSmrg# This macro actually does too much.  Some checks are only needed if
421555991fdSmrg# your package does certain things.  But this isn't really a big deal.
422126a8a12Smrg
423555991fdSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424555991fdSmrg# AM_INIT_AUTOMAKE([OPTIONS])
425555991fdSmrg# -----------------------------------------------
426555991fdSmrg# The call with PACKAGE and VERSION arguments is the old style
427555991fdSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428555991fdSmrg# and VERSION should now be passed to AC_INIT and removed from
429555991fdSmrg# the call to AM_INIT_AUTOMAKE.
430555991fdSmrg# We support both call styles for the transition.  After
431555991fdSmrg# the next Automake release, Autoconf can make the AC_INIT
432555991fdSmrg# arguments mandatory, and then we can depend on a new Autoconf
433555991fdSmrg# release and drop the old call support.
434555991fdSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435555991fdSmrg[AC_PREREQ([2.62])dnl
436555991fdSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437555991fdSmrgdnl the ones we care about.
438555991fdSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439555991fdSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440555991fdSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441555991fdSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442555991fdSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443555991fdSmrg  # is not polluted with repeated "-I."
444555991fdSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445555991fdSmrg  # test to see if srcdir already configured
446555991fdSmrg  if test -f $srcdir/config.status; then
447555991fdSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448555991fdSmrg  fi
449555991fdSmrgfi
450126a8a12Smrg
451555991fdSmrg# test whether we have cygpath
452555991fdSmrgif test -z "$CYGPATH_W"; then
453555991fdSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454555991fdSmrg    CYGPATH_W='cygpath -w'
455555991fdSmrg  else
456555991fdSmrg    CYGPATH_W=echo
457555991fdSmrg  fi
458555991fdSmrgfi
459555991fdSmrgAC_SUBST([CYGPATH_W])
460126a8a12Smrg
461555991fdSmrg# Define the identity of the package.
462555991fdSmrgdnl Distinguish between old-style and new-style calls.
463555991fdSmrgm4_ifval([$2],
464555991fdSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465555991fdSmrg AC_SUBST([PACKAGE], [$1])dnl
466555991fdSmrg AC_SUBST([VERSION], [$2])],
467555991fdSmrg[_AM_SET_OPTIONS([$1])dnl
468555991fdSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469555991fdSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470555991fdSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471555991fdSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472555991fdSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473126a8a12Smrg
474555991fdSmrg_AM_IF_OPTION([no-define],,
475555991fdSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476555991fdSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477126a8a12Smrg
478555991fdSmrg# Some tools Automake needs.
479555991fdSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480555991fdSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481555991fdSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482555991fdSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483555991fdSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484555991fdSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485555991fdSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486555991fdSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487555991fdSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488555991fdSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489555991fdSmrg# We need awk for the "check" target.  The system "awk" is bad on
490555991fdSmrg# some platforms.
491555991fdSmrgAC_REQUIRE([AC_PROG_AWK])dnl
492555991fdSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493555991fdSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494555991fdSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495555991fdSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496555991fdSmrg			     [_AM_PROG_TAR([v7])])])
497555991fdSmrg_AM_IF_OPTION([no-dependencies],,
498555991fdSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499555991fdSmrg		  [_AM_DEPENDENCIES(CC)],
500555991fdSmrg		  [define([AC_PROG_CC],
501555991fdSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502555991fdSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503555991fdSmrg		  [_AM_DEPENDENCIES(CXX)],
504555991fdSmrg		  [define([AC_PROG_CXX],
505555991fdSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506555991fdSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507555991fdSmrg		  [_AM_DEPENDENCIES(OBJC)],
508555991fdSmrg		  [define([AC_PROG_OBJC],
509555991fdSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510555991fdSmrg])
511555991fdSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512555991fdSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513555991fdSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514555991fdSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515555991fdSmrgAC_CONFIG_COMMANDS_PRE(dnl
516555991fdSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517555991fdSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518d656433aSmrg])
519126a8a12Smrg
520555991fdSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521555991fdSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522555991fdSmrgdnl mangled by Autoconf and run in a shell conditional statement.
523555991fdSmrgm4_define([_AC_COMPILER_EXEEXT],
524555991fdSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525126a8a12Smrg
526126a8a12Smrg
527555991fdSmrg# When config.status generates a header, we must update the stamp-h file.
528555991fdSmrg# This file resides in the same directory as the config header
529555991fdSmrg# that is generated.  The stamp files are numbered to have different names.
530126a8a12Smrg
531555991fdSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532555991fdSmrg# loop where config.status creates the headers, so we can generate
533555991fdSmrg# our stamp files there.
534555991fdSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535555991fdSmrg[# Compute $1's index in $config_headers.
536555991fdSmrg_am_arg=$1
537555991fdSmrg_am_stamp_count=1
538555991fdSmrgfor _am_header in $config_headers :; do
539555991fdSmrg  case $_am_header in
540555991fdSmrg    $_am_arg | $_am_arg:* )
541555991fdSmrg      break ;;
542555991fdSmrg    * )
543555991fdSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544555991fdSmrg  esac
545555991fdSmrgdone
546555991fdSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547126a8a12Smrg
548555991fdSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549555991fdSmrg#
550555991fdSmrg# This file is free software; the Free Software Foundation
551555991fdSmrg# gives unlimited permission to copy and/or distribute it,
552555991fdSmrg# with or without modifications, as long as this notice is preserved.
553126a8a12Smrg
554555991fdSmrg# AM_PROG_INSTALL_SH
555555991fdSmrg# ------------------
556555991fdSmrg# Define $install_sh.
557555991fdSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558555991fdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559555991fdSmrgif test x"${install_sh}" != xset; then
560555991fdSmrg  case $am_aux_dir in
561555991fdSmrg  *\ * | *\	*)
562555991fdSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563555991fdSmrg  *)
564555991fdSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565555991fdSmrg  esac
566555991fdSmrgfi
567555991fdSmrgAC_SUBST(install_sh)])
568126a8a12Smrg
569555991fdSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570555991fdSmrg#
571555991fdSmrg# This file is free software; the Free Software Foundation
572555991fdSmrg# gives unlimited permission to copy and/or distribute it,
573555991fdSmrg# with or without modifications, as long as this notice is preserved.
574126a8a12Smrg
575555991fdSmrg# serial 2
576126a8a12Smrg
577555991fdSmrg# Check whether the underlying file-system supports filenames
578555991fdSmrg# with a leading dot.  For instance MS-DOS doesn't.
579555991fdSmrgAC_DEFUN([AM_SET_LEADING_DOT],
580555991fdSmrg[rm -rf .tst 2>/dev/null
581555991fdSmrgmkdir .tst 2>/dev/null
582555991fdSmrgif test -d .tst; then
583555991fdSmrg  am__leading_dot=.
584555991fdSmrgelse
585555991fdSmrg  am__leading_dot=_
586555991fdSmrgfi
587555991fdSmrgrmdir .tst 2>/dev/null
588555991fdSmrgAC_SUBST([am__leading_dot])])
589126a8a12Smrg
590555991fdSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591555991fdSmrg# From Jim Meyering
592126a8a12Smrg
593555991fdSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594555991fdSmrg# Free Software Foundation, Inc.
595d656433aSmrg#
596555991fdSmrg# This file is free software; the Free Software Foundation
597555991fdSmrg# gives unlimited permission to copy and/or distribute it,
598555991fdSmrg# with or without modifications, as long as this notice is preserved.
599126a8a12Smrg
600555991fdSmrg# serial 5
601126a8a12Smrg
602555991fdSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
603555991fdSmrg# ----------------------------------
604555991fdSmrg# Control maintainer-specific portions of Makefiles.
605555991fdSmrg# Default is to disable them, unless `enable' is passed literally.
606555991fdSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
607555991fdSmrg# can override the default with the --enable/--disable switch.
608555991fdSmrgAC_DEFUN([AM_MAINTAINER_MODE],
609555991fdSmrg[m4_case(m4_default([$1], [disable]),
610555991fdSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
611555991fdSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
612555991fdSmrg       [m4_define([am_maintainer_other], [enable])
613555991fdSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614555991fdSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615555991fdSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616555991fdSmrg  AC_ARG_ENABLE([maintainer-mode],
617555991fdSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618555991fdSmrg			  (and sometimes confusing) to the casual installer],
619555991fdSmrg      [USE_MAINTAINER_MODE=$enableval],
620555991fdSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621555991fdSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622555991fdSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623555991fdSmrg  MAINT=$MAINTAINER_MODE_TRUE
624555991fdSmrg  AC_SUBST([MAINT])dnl
625555991fdSmrg]
626555991fdSmrg)
627d656433aSmrg
628555991fdSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629126a8a12Smrg
630555991fdSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631555991fdSmrg
632555991fdSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633d656433aSmrg#
634555991fdSmrg# This file is free software; the Free Software Foundation
635555991fdSmrg# gives unlimited permission to copy and/or distribute it,
636555991fdSmrg# with or without modifications, as long as this notice is preserved.
637126a8a12Smrg
638555991fdSmrg# serial 4
639126a8a12Smrg
640555991fdSmrg# AM_MAKE_INCLUDE()
641555991fdSmrg# -----------------
642555991fdSmrg# Check to see how make treats includes.
643555991fdSmrgAC_DEFUN([AM_MAKE_INCLUDE],
644555991fdSmrg[am_make=${MAKE-make}
645555991fdSmrgcat > confinc << 'END'
646555991fdSmrgam__doit:
647555991fdSmrg	@echo this is the am__doit target
648555991fdSmrg.PHONY: am__doit
649555991fdSmrgEND
650555991fdSmrg# If we don't find an include directive, just comment out the code.
651555991fdSmrgAC_MSG_CHECKING([for style of include used by $am_make])
652555991fdSmrgam__include="#"
653555991fdSmrgam__quote=
654555991fdSmrg_am_result=none
655555991fdSmrg# First try GNU make style include.
656555991fdSmrgecho "include confinc" > confmf
657555991fdSmrg# Ignore all kinds of additional output from `make'.
658555991fdSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
659555991fdSmrg*the\ am__doit\ target*)
660555991fdSmrg  am__include=include
661555991fdSmrg  am__quote=
662555991fdSmrg  _am_result=GNU
663555991fdSmrg  ;;
664555991fdSmrgesac
665555991fdSmrg# Now try BSD make style include.
666555991fdSmrgif test "$am__include" = "#"; then
667555991fdSmrg   echo '.include "confinc"' > confmf
668555991fdSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
669555991fdSmrg   *the\ am__doit\ target*)
670555991fdSmrg     am__include=.include
671555991fdSmrg     am__quote="\""
672555991fdSmrg     _am_result=BSD
673555991fdSmrg     ;;
674555991fdSmrg   esac
675555991fdSmrgfi
676555991fdSmrgAC_SUBST([am__include])
677555991fdSmrgAC_SUBST([am__quote])
678555991fdSmrgAC_MSG_RESULT([$_am_result])
679555991fdSmrgrm -f confinc confmf
680555991fdSmrg])
681d656433aSmrg
682555991fdSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683d656433aSmrg
684555991fdSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685555991fdSmrg# Free Software Foundation, Inc.
686555991fdSmrg#
687555991fdSmrg# This file is free software; the Free Software Foundation
688555991fdSmrg# gives unlimited permission to copy and/or distribute it,
689555991fdSmrg# with or without modifications, as long as this notice is preserved.
690d656433aSmrg
691555991fdSmrg# serial 6
692d656433aSmrg
693555991fdSmrg# AM_MISSING_PROG(NAME, PROGRAM)
694d656433aSmrg# ------------------------------
695555991fdSmrgAC_DEFUN([AM_MISSING_PROG],
696555991fdSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697555991fdSmrg$1=${$1-"${am_missing_run}$2"}
698555991fdSmrgAC_SUBST($1)])
699d656433aSmrg
700d656433aSmrg
701555991fdSmrg# AM_MISSING_HAS_RUN
702555991fdSmrg# ------------------
703555991fdSmrg# Define MISSING if not defined so far and test if it supports --run.
704555991fdSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705555991fdSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706555991fdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707555991fdSmrgAC_REQUIRE_AUX_FILE([missing])dnl
708555991fdSmrgif test x"${MISSING+set}" != xset; then
709555991fdSmrg  case $am_aux_dir in
710555991fdSmrg  *\ * | *\	*)
711555991fdSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712555991fdSmrg  *)
713555991fdSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714555991fdSmrg  esac
715555991fdSmrgfi
716555991fdSmrg# Use eval to expand $SHELL
717555991fdSmrgif eval "$MISSING --run true"; then
718555991fdSmrg  am_missing_run="$MISSING --run "
719555991fdSmrgelse
720555991fdSmrg  am_missing_run=
721555991fdSmrg  AC_MSG_WARN([`missing' script is too old or missing])
722555991fdSmrgfi
723555991fdSmrg])
724d656433aSmrg
725555991fdSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726555991fdSmrg#
727555991fdSmrg# This file is free software; the Free Software Foundation
728555991fdSmrg# gives unlimited permission to copy and/or distribute it,
729555991fdSmrg# with or without modifications, as long as this notice is preserved.
730126a8a12Smrg
731555991fdSmrg# AM_PROG_MKDIR_P
732555991fdSmrg# ---------------
733555991fdSmrg# Check for `mkdir -p'.
734555991fdSmrgAC_DEFUN([AM_PROG_MKDIR_P],
735555991fdSmrg[AC_PREREQ([2.60])dnl
736555991fdSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737555991fdSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738555991fdSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
739555991fdSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740555991fdSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741555991fdSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742555991fdSmrgdnl adjustment using top_builddir (which is defined more often than
743555991fdSmrgdnl MKDIR_P).
744555991fdSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745555991fdSmrgcase $mkdir_p in
746555991fdSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747555991fdSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748d656433aSmrgesac
749d656433aSmrg])
750126a8a12Smrg
751555991fdSmrg# Helper functions for option handling.                     -*- Autoconf -*-
752126a8a12Smrg
753555991fdSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754555991fdSmrg#
755555991fdSmrg# This file is free software; the Free Software Foundation
756555991fdSmrg# gives unlimited permission to copy and/or distribute it,
757555991fdSmrg# with or without modifications, as long as this notice is preserved.
758d656433aSmrg
759555991fdSmrg# serial 4
760d656433aSmrg
761555991fdSmrg# _AM_MANGLE_OPTION(NAME)
762555991fdSmrg# -----------------------
763555991fdSmrgAC_DEFUN([_AM_MANGLE_OPTION],
764555991fdSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765126a8a12Smrg
766555991fdSmrg# _AM_SET_OPTION(NAME)
767555991fdSmrg# ------------------------------
768555991fdSmrg# Set option NAME.  Presently that only means defining a flag for this option.
769555991fdSmrgAC_DEFUN([_AM_SET_OPTION],
770555991fdSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771126a8a12Smrg
772555991fdSmrg# _AM_SET_OPTIONS(OPTIONS)
773555991fdSmrg# ----------------------------------
774555991fdSmrg# OPTIONS is a space-separated list of Automake options.
775555991fdSmrgAC_DEFUN([_AM_SET_OPTIONS],
776555991fdSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777126a8a12Smrg
778555991fdSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779555991fdSmrg# -------------------------------------------
780555991fdSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781555991fdSmrgAC_DEFUN([_AM_IF_OPTION],
782555991fdSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783126a8a12Smrg
784555991fdSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785126a8a12Smrg
786555991fdSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787555991fdSmrg# Free Software Foundation, Inc.
788555991fdSmrg#
789555991fdSmrg# This file is free software; the Free Software Foundation
790555991fdSmrg# gives unlimited permission to copy and/or distribute it,
791555991fdSmrg# with or without modifications, as long as this notice is preserved.
792126a8a12Smrg
793555991fdSmrg# serial 5
794126a8a12Smrg
795555991fdSmrg# AM_SANITY_CHECK
796555991fdSmrg# ---------------
797555991fdSmrgAC_DEFUN([AM_SANITY_CHECK],
798555991fdSmrg[AC_MSG_CHECKING([whether build environment is sane])
799555991fdSmrg# Just in case
800555991fdSmrgsleep 1
801555991fdSmrgecho timestamp > conftest.file
802555991fdSmrg# Reject unsafe characters in $srcdir or the absolute working directory
803555991fdSmrg# name.  Accept space and tab only in the latter.
804555991fdSmrgam_lf='
805555991fdSmrg'
806555991fdSmrgcase `pwd` in
807555991fdSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808555991fdSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809555991fdSmrgesac
810555991fdSmrgcase $srcdir in
811555991fdSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812555991fdSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813555991fdSmrgesac
814d656433aSmrg
815555991fdSmrg# Do `set' in a subshell so we don't clobber the current shell's
816555991fdSmrg# arguments.  Must try -L first in case configure is actually a
817555991fdSmrg# symlink; some systems play weird games with the mod time of symlinks
818555991fdSmrg# (eg FreeBSD returns the mod time of the symlink's containing
819555991fdSmrg# directory).
820555991fdSmrgif (
821555991fdSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822555991fdSmrg   if test "$[*]" = "X"; then
823555991fdSmrg      # -L didn't work.
824555991fdSmrg      set X `ls -t "$srcdir/configure" conftest.file`
825555991fdSmrg   fi
826555991fdSmrg   rm -f conftest.file
827555991fdSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828555991fdSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829d656433aSmrg
830555991fdSmrg      # If neither matched, then we have a broken ls.  This can happen
831555991fdSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832555991fdSmrg      # broken ls alias from the environment.  This has actually
833555991fdSmrg      # happened.  Such a system could not be considered "sane".
834555991fdSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835555991fdSmrgalias in your environment])
836555991fdSmrg   fi
837126a8a12Smrg
838555991fdSmrg   test "$[2]" = conftest.file
839555991fdSmrg   )
840555991fdSmrgthen
841555991fdSmrg   # Ok.
842555991fdSmrg   :
843555991fdSmrgelse
844555991fdSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
845555991fdSmrgCheck your system clock])
846d656433aSmrgfi
847555991fdSmrgAC_MSG_RESULT(yes)])
848d656433aSmrg
849555991fdSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
850555991fdSmrg#
851555991fdSmrg# This file is free software; the Free Software Foundation
852555991fdSmrg# gives unlimited permission to copy and/or distribute it,
853555991fdSmrg# with or without modifications, as long as this notice is preserved.
854d656433aSmrg
855555991fdSmrg# serial 1
856d656433aSmrg
857555991fdSmrg# AM_SILENT_RULES([DEFAULT])
858555991fdSmrg# --------------------------
859555991fdSmrg# Enable less verbose build rules; with the default set to DEFAULT
860555991fdSmrg# (`yes' being less verbose, `no' or empty being verbose).
861555991fdSmrgAC_DEFUN([AM_SILENT_RULES],
862555991fdSmrg[AC_ARG_ENABLE([silent-rules],
863555991fdSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864555991fdSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
865555991fdSmrgcase $enable_silent_rules in
866555991fdSmrgyes) AM_DEFAULT_VERBOSITY=0;;
867555991fdSmrgno)  AM_DEFAULT_VERBOSITY=1;;
868555991fdSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869555991fdSmrgesac
870555991fdSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871555991fdSmrgAM_BACKSLASH='\'
872555991fdSmrgAC_SUBST([AM_BACKSLASH])dnl
873555991fdSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874555991fdSmrg])
875126a8a12Smrg
876555991fdSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877555991fdSmrg#
878555991fdSmrg# This file is free software; the Free Software Foundation
879555991fdSmrg# gives unlimited permission to copy and/or distribute it,
880555991fdSmrg# with or without modifications, as long as this notice is preserved.
881126a8a12Smrg
882555991fdSmrg# AM_PROG_INSTALL_STRIP
883555991fdSmrg# ---------------------
884555991fdSmrg# One issue with vendor `install' (even GNU) is that you can't
885555991fdSmrg# specify the program used to strip binaries.  This is especially
886555991fdSmrg# annoying in cross-compiling environments, where the build's strip
887555991fdSmrg# is unlikely to handle the host's binaries.
888555991fdSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889555991fdSmrg# always use install-sh in `make install-strip', and initialize
890555991fdSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
891555991fdSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892555991fdSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893555991fdSmrg# Installed binaries are usually stripped using `strip' when the user
894555991fdSmrg# run `make install-strip'.  However `strip' might not be the right
895555991fdSmrg# tool to use in cross-compilation environments, therefore Automake
896555991fdSmrg# will honor the `STRIP' environment variable to overrule this program.
897555991fdSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898555991fdSmrgif test "$cross_compiling" != no; then
899555991fdSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
900555991fdSmrgfi
901555991fdSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902555991fdSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903126a8a12Smrg
904555991fdSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905d656433aSmrg#
906555991fdSmrg# This file is free software; the Free Software Foundation
907555991fdSmrg# gives unlimited permission to copy and/or distribute it,
908555991fdSmrg# with or without modifications, as long as this notice is preserved.
909126a8a12Smrg
910555991fdSmrg# serial 2
911126a8a12Smrg
912555991fdSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
913555991fdSmrg# ---------------------------
914555991fdSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915555991fdSmrg# This macro is traced by Automake.
916555991fdSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917126a8a12Smrg
918555991fdSmrg# AM_SUBST_NOTMAKE(VARIABLE)
919555991fdSmrg# ---------------------------
920555991fdSmrg# Public sister of _AM_SUBST_NOTMAKE.
921555991fdSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922126a8a12Smrg
923555991fdSmrg# Check how to create a tarball.                            -*- Autoconf -*-
924126a8a12Smrg
925555991fdSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926555991fdSmrg#
927555991fdSmrg# This file is free software; the Free Software Foundation
928555991fdSmrg# gives unlimited permission to copy and/or distribute it,
929555991fdSmrg# with or without modifications, as long as this notice is preserved.
930126a8a12Smrg
931555991fdSmrg# serial 2
932126a8a12Smrg
933555991fdSmrg# _AM_PROG_TAR(FORMAT)
934555991fdSmrg# --------------------
935555991fdSmrg# Check how to create a tarball in format FORMAT.
936555991fdSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
937555991fdSmrg#
938555991fdSmrg# Substitute a variable $(am__tar) that is a command
939555991fdSmrg# writing to stdout a FORMAT-tarball containing the directory
940555991fdSmrg# $tardir.
941555991fdSmrg#     tardir=directory && $(am__tar) > result.tar
942555991fdSmrg#
943555991fdSmrg# Substitute a variable $(am__untar) that extract such
944555991fdSmrg# a tarball read from stdin.
945555991fdSmrg#     $(am__untar) < result.tar
946555991fdSmrgAC_DEFUN([_AM_PROG_TAR],
947555991fdSmrg[# Always define AMTAR for backward compatibility.
948555991fdSmrgAM_MISSING_PROG([AMTAR], [tar])
949555991fdSmrgm4_if([$1], [v7],
950555991fdSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951555991fdSmrg     [m4_case([$1], [ustar],, [pax],,
952555991fdSmrg              [m4_fatal([Unknown tar format])])
953555991fdSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
954555991fdSmrg# Loop over all known methods to create a tar archive until one works.
955555991fdSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956555991fdSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957555991fdSmrg# Do not fold the above two line into one, because Tru64 sh and
958555991fdSmrg# Solaris sh will not grok spaces in the rhs of `-'.
959555991fdSmrgfor _am_tool in $_am_tools
960555991fdSmrgdo
961555991fdSmrg  case $_am_tool in
962555991fdSmrg  gnutar)
963555991fdSmrg    for _am_tar in tar gnutar gtar;
964555991fdSmrg    do
965555991fdSmrg      AM_RUN_LOG([$_am_tar --version]) && break
966555991fdSmrg    done
967555991fdSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968555991fdSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969555991fdSmrg    am__untar="$_am_tar -xf -"
970555991fdSmrg    ;;
971555991fdSmrg  plaintar)
972555991fdSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
973555991fdSmrg    # ustar tarball either.
974555991fdSmrg    (tar --version) >/dev/null 2>&1 && continue
975555991fdSmrg    am__tar='tar chf - "$$tardir"'
976555991fdSmrg    am__tar_='tar chf - "$tardir"'
977555991fdSmrg    am__untar='tar xf -'
978555991fdSmrg    ;;
979555991fdSmrg  pax)
980555991fdSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
981555991fdSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
982555991fdSmrg    am__untar='pax -r'
983555991fdSmrg    ;;
984555991fdSmrg  cpio)
985555991fdSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986555991fdSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987555991fdSmrg    am__untar='cpio -i -H $1 -d'
988555991fdSmrg    ;;
989555991fdSmrg  none)
990555991fdSmrg    am__tar=false
991555991fdSmrg    am__tar_=false
992555991fdSmrg    am__untar=false
993555991fdSmrg    ;;
994555991fdSmrg  esac
995126a8a12Smrg
996555991fdSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
997555991fdSmrg  # and am__untar set.
998555991fdSmrg  test -n "${am_cv_prog_tar_$1}" && break
999126a8a12Smrg
1000555991fdSmrg  # tar/untar a dummy directory, and stop if the command works
1001555991fdSmrg  rm -rf conftest.dir
1002555991fdSmrg  mkdir conftest.dir
1003555991fdSmrg  echo GrepMe > conftest.dir/file
1004555991fdSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005555991fdSmrg  rm -rf conftest.dir
1006555991fdSmrg  if test -s conftest.tar; then
1007555991fdSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1008555991fdSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009555991fdSmrg  fi
1010555991fdSmrgdone
1011555991fdSmrgrm -rf conftest.dir
1012126a8a12Smrg
1013555991fdSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014555991fdSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015555991fdSmrgAC_SUBST([am__tar])
1016555991fdSmrgAC_SUBST([am__untar])
1017555991fdSmrg]) # _AM_PROG_TAR
1018126a8a12Smrg
10193c15da26Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
10203c15da26Smrg# 
10213c15da26Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1022555991fdSmrg#
10233c15da26Smrg# This program is free software; you can redistribute it and/or modify
10243c15da26Smrg# it under the terms of the GNU General Public License as published by
10253c15da26Smrg# the Free Software Foundation; either version 2 of the License, or
10263c15da26Smrg# (at your option) any later version.
1027555991fdSmrg#
10283c15da26Smrg# This program is distributed in the hope that it will be useful, but
10293c15da26Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
10303c15da26Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10313c15da26Smrg# General Public License for more details.
1032555991fdSmrg#
10333c15da26Smrg# You should have received a copy of the GNU General Public License
10343c15da26Smrg# along with this program; if not, write to the Free Software
10353c15da26Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1036555991fdSmrg#
10373c15da26Smrg# As a special exception to the GNU General Public License, if you
10383c15da26Smrg# distribute this file as part of a program that contains a
10393c15da26Smrg# configuration script generated by Autoconf, you may include it under
10403c15da26Smrg# the same distribution terms that you use for the rest of that program.
1041126a8a12Smrg
10423c15da26Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
10433c15da26Smrg# ----------------------------------
10443c15da26SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
10453c15da26Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
10463c15da26Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
10473c15da26SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
10483c15da26Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
10493c15da26Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1050555991fdSmrgfi
10513c15da26Smrgif test -n "$PKG_CONFIG"; then
10523c15da26Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
10533c15da26Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
10543c15da26Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1055555991fdSmrg		AC_MSG_RESULT([yes])
1056555991fdSmrg	else
10573c15da26Smrg		AC_MSG_RESULT([no])
10583c15da26Smrg		PKG_CONFIG=""
1059555991fdSmrg	fi
10603c15da26Smrg		
10613c15da26Smrgfi[]dnl
10623c15da26Smrg])# PKG_PROG_PKG_CONFIG
1063d656433aSmrg
10643c15da26Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1065555991fdSmrg#
10663c15da26Smrg# Check to see whether a particular set of modules exists.  Similar
10673c15da26Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
10683c15da26Smrg#
10693c15da26Smrg#
10703c15da26Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
10713c15da26Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
10723c15da26Smrg# PKG_CHECK_EXISTS manually
10733c15da26Smrg# --------------------------------------------------------------
10743c15da26SmrgAC_DEFUN([PKG_CHECK_EXISTS],
10753c15da26Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
10763c15da26Smrgif test -n "$PKG_CONFIG" && \
10773c15da26Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
10783c15da26Smrg  m4_ifval([$2], [$2], [:])
10793c15da26Smrgm4_ifvaln([$3], [else
10803c15da26Smrg  $3])dnl
10813c15da26Smrgfi])
1082126a8a12Smrg
1083126a8a12Smrg
10843c15da26Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
10853c15da26Smrg# ---------------------------------------------
10863c15da26Smrgm4_define([_PKG_CONFIG],
10873c15da26Smrg[if test -n "$$1"; then
10883c15da26Smrg    pkg_cv_[]$1="$$1"
10893c15da26Smrg elif test -n "$PKG_CONFIG"; then
10903c15da26Smrg    PKG_CHECK_EXISTS([$3],
10913c15da26Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
10923c15da26Smrg		     [pkg_failed=yes])
10933c15da26Smrg else
10943c15da26Smrg    pkg_failed=untried
10953c15da26Smrgfi[]dnl
10963c15da26Smrg])# _PKG_CONFIG
1097d656433aSmrg
10983c15da26Smrg# _PKG_SHORT_ERRORS_SUPPORTED
10993c15da26Smrg# -----------------------------
11003c15da26SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
11013c15da26Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11023c15da26Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11033c15da26Smrg        _pkg_short_errors_supported=yes
11043c15da26Smrgelse
11053c15da26Smrg        _pkg_short_errors_supported=no
11063c15da26Smrgfi[]dnl
11073c15da26Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
1108d656433aSmrg
1109d656433aSmrg
11103c15da26Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
11113c15da26Smrg# [ACTION-IF-NOT-FOUND])
11123c15da26Smrg#
11133c15da26Smrg#
11143c15da26Smrg# Note that if there is a possibility the first call to
11153c15da26Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
11163c15da26Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
11173c15da26Smrg#
11183c15da26Smrg#
11193c15da26Smrg# --------------------------------------------------------------
11203c15da26SmrgAC_DEFUN([PKG_CHECK_MODULES],
11213c15da26Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
11223c15da26SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
11233c15da26SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1124d656433aSmrg
11253c15da26Smrgpkg_failed=no
11263c15da26SmrgAC_MSG_CHECKING([for $1])
1127d656433aSmrg
11283c15da26Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
11293c15da26Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1130d656433aSmrg
11313c15da26Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
11323c15da26Smrgand $1[]_LIBS to avoid the need to call pkg-config.
11333c15da26SmrgSee the pkg-config man page for more details.])
1134d656433aSmrg
11353c15da26Smrgif test $pkg_failed = yes; then
11363c15da26Smrg        _PKG_SHORT_ERRORS_SUPPORTED
11373c15da26Smrg        if test $_pkg_short_errors_supported = yes; then
11383c15da26Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
11393c15da26Smrg        else 
11403c15da26Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
11413c15da26Smrg        fi
11423c15da26Smrg	# Put the nasty error message in config.log where it belongs
11433c15da26Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1144126a8a12Smrg
11453c15da26Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
11463c15da26Smrg[Package requirements ($2) were not met:
1147126a8a12Smrg
11483c15da26Smrg$$1_PKG_ERRORS
1149126a8a12Smrg
11503c15da26SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
11513c15da26Smrginstalled software in a non-standard prefix.
1152126a8a12Smrg
11533c15da26Smrg_PKG_TEXT
11543c15da26Smrg])],
11553c15da26Smrg		[AC_MSG_RESULT([no])
11563c15da26Smrg                $4])
11573c15da26Smrgelif test $pkg_failed = untried; then
11583c15da26Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
11593c15da26Smrg[The pkg-config script could not be found or is too old.  Make sure it
11603c15da26Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
11613c15da26Smrgpath to pkg-config.
11623c15da26Smrg
11633c15da26Smrg_PKG_TEXT
11643c15da26Smrg
11653c15da26SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
11663c15da26Smrg		[$4])
1167555991fdSmrgelse
11683c15da26Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
11693c15da26Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
11703c15da26Smrg        AC_MSG_RESULT([yes])
11713c15da26Smrg	ifelse([$3], , :, [$3])
11723c15da26Smrgfi[]dnl
11733c15da26Smrg])# PKG_CHECK_MODULES
1174126a8a12Smrg
11753c15da26Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
11763c15da26Smrg#
11773c15da26Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
11783c15da26Smrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
11793c15da26Smrg#                 Inc.
11803c15da26Smrg#   Written by Gordon Matzigkeit, 1996
11813c15da26Smrg#
11823c15da26Smrg# This file is free software; the Free Software Foundation gives
11833c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
11843c15da26Smrg# modifications, as long as this notice is preserved.
1185126a8a12Smrg
11863c15da26Smrgm4_define([_LT_COPYING], [dnl
11873c15da26Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
11883c15da26Smrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
11893c15da26Smrg#                 Inc.
11903c15da26Smrg#   Written by Gordon Matzigkeit, 1996
1191555991fdSmrg#
11923c15da26Smrg#   This file is part of GNU Libtool.
11933c15da26Smrg#
11943c15da26Smrg# GNU Libtool is free software; you can redistribute it and/or
11953c15da26Smrg# modify it under the terms of the GNU General Public License as
11963c15da26Smrg# published by the Free Software Foundation; either version 2 of
11973c15da26Smrg# the License, or (at your option) any later version.
11983c15da26Smrg#
11993c15da26Smrg# As a special exception to the GNU General Public License,
12003c15da26Smrg# if you distribute this file as part of a program or library that
12013c15da26Smrg# is built using GNU Libtool, you may include this file under the
12023c15da26Smrg# same distribution terms that you use for the rest of that program.
12033c15da26Smrg#
12043c15da26Smrg# GNU Libtool is distributed in the hope that it will be useful,
12053c15da26Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
12063c15da26Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12073c15da26Smrg# GNU General Public License for more details.
12083c15da26Smrg#
12093c15da26Smrg# You should have received a copy of the GNU General Public License
12103c15da26Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
12113c15da26Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
12123c15da26Smrg# obtained by writing to the Free Software Foundation, Inc.,
12133c15da26Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
12143c15da26Smrg])
1215126a8a12Smrg
12163c15da26Smrg# serial 57 LT_INIT
1217126a8a12Smrg
1218126a8a12Smrg
12193c15da26Smrg# LT_PREREQ(VERSION)
12203c15da26Smrg# ------------------
12213c15da26Smrg# Complain and exit if this libtool version is less that VERSION.
12223c15da26Smrgm4_defun([LT_PREREQ],
12233c15da26Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
12243c15da26Smrg       [m4_default([$3],
12253c15da26Smrg		   [m4_fatal([Libtool version $1 or higher is required],
12263c15da26Smrg		             63)])],
12273c15da26Smrg       [$2])])
1228d656433aSmrg
1229126a8a12Smrg
12303c15da26Smrg# _LT_CHECK_BUILDDIR
12313c15da26Smrg# ------------------
12323c15da26Smrg# Complain if the absolute build directory name contains unusual characters
12333c15da26Smrgm4_defun([_LT_CHECK_BUILDDIR],
12343c15da26Smrg[case `pwd` in
12353c15da26Smrg  *\ * | *\	*)
12363c15da26Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
12373c15da26Smrgesac
12383c15da26Smrg])
1239126a8a12Smrg
1240126a8a12Smrg
12413c15da26Smrg# LT_INIT([OPTIONS])
12423c15da26Smrg# ------------------
12433c15da26SmrgAC_DEFUN([LT_INIT],
12443c15da26Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
12453c15da26SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
12463c15da26SmrgAC_BEFORE([$0], [LT_LANG])dnl
12473c15da26SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
12483c15da26SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
12493c15da26Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
1250555991fdSmrg
12513c15da26Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
12523c15da26Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
12533c15da26Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
12543c15da26Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
12553c15da26Smrgdnl unless we require an AC_DEFUNed macro:
12563c15da26SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
12573c15da26SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
12583c15da26SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
12593c15da26SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
12603c15da26Smrgm4_require([_LT_PROG_LTMAIN])dnl
1261126a8a12Smrg
12623c15da26Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1263126a8a12Smrg
12643c15da26Smrgdnl Parse OPTIONS
12653c15da26Smrg_LT_SET_OPTIONS([$0], [$1])
1266555991fdSmrg
12673c15da26Smrg# This can be used to rebuild libtool when needed
12683c15da26SmrgLIBTOOL_DEPS="$ltmain"
1269555991fdSmrg
12703c15da26Smrg# Always use our own libtool.
12713c15da26SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
12723c15da26SmrgAC_SUBST(LIBTOOL)dnl
1273126a8a12Smrg
12743c15da26Smrg_LT_SETUP
1275126a8a12Smrg
12763c15da26Smrg# Only expand once:
12773c15da26Smrgm4_define([LT_INIT])
12783c15da26Smrg])# LT_INIT
1279d656433aSmrg
12803c15da26Smrg# Old names:
12813c15da26SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
12823c15da26SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
12833c15da26Smrgdnl aclocal-1.4 backwards compatibility:
12843c15da26Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
12853c15da26Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1286126a8a12Smrg
1287126a8a12Smrg
12883c15da26Smrg# _LT_CC_BASENAME(CC)
12893c15da26Smrg# -------------------
12903c15da26Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
12913c15da26Smrgm4_defun([_LT_CC_BASENAME],
12923c15da26Smrg[for cc_temp in $1""; do
12933c15da26Smrg  case $cc_temp in
12943c15da26Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
12953c15da26Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
12963c15da26Smrg    \-*) ;;
12973c15da26Smrg    *) break;;
12983c15da26Smrg  esac
12993c15da26Smrgdone
13003c15da26Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
13013c15da26Smrg])
1302126a8a12Smrg
1303126a8a12Smrg
13043c15da26Smrg# _LT_FILEUTILS_DEFAULTS
13053c15da26Smrg# ----------------------
13063c15da26Smrg# It is okay to use these file commands and assume they have been set
13073c15da26Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
13083c15da26Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
13093c15da26Smrg[: ${CP="cp -f"}
13103c15da26Smrg: ${MV="mv -f"}
13113c15da26Smrg: ${RM="rm -f"}
13123c15da26Smrg])# _LT_FILEUTILS_DEFAULTS
1313126a8a12Smrg
1314126a8a12Smrg
13153c15da26Smrg# _LT_SETUP
13163c15da26Smrg# ---------
13173c15da26Smrgm4_defun([_LT_SETUP],
13183c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
13193c15da26SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
13203c15da26SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
13213c15da26SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1322555991fdSmrg
13233c15da26Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
13243c15da26Smrg_LT_DECL([], [host], [0])dnl
13253c15da26Smrg_LT_DECL([], [host_os], [0])dnl
13263c15da26Smrgdnl
13273c15da26Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
13283c15da26Smrg_LT_DECL([], [build], [0])dnl
13293c15da26Smrg_LT_DECL([], [build_os], [0])dnl
13303c15da26Smrgdnl
13313c15da26SmrgAC_REQUIRE([AC_PROG_CC])dnl
13323c15da26SmrgAC_REQUIRE([LT_PATH_LD])dnl
13333c15da26SmrgAC_REQUIRE([LT_PATH_NM])dnl
13343c15da26Smrgdnl
13353c15da26SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
13363c15da26Smrgtest -z "$LN_S" && LN_S="ln -s"
13373c15da26Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
13383c15da26Smrgdnl
13393c15da26SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
13403c15da26Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
13413c15da26Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
13423c15da26Smrgdnl
13433c15da26Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
13443c15da26Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
13453c15da26Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
13463c15da26Smrgm4_require([_LT_CMD_RELOAD])dnl
13473c15da26Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
13483c15da26Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
13493c15da26Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
13503c15da26Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
13513c15da26Smrgm4_require([_LT_WITH_SYSROOT])dnl
13523c15da26Smrg
13533c15da26Smrg_LT_CONFIG_LIBTOOL_INIT([
13543c15da26Smrg# See if we are running on zsh, and set the options which allow our
13553c15da26Smrg# commands through without removal of \ escapes INIT.
13563c15da26Smrgif test -n "\${ZSH_VERSION+set}" ; then
13573c15da26Smrg   setopt NO_GLOB_SUBST
13583c15da26Smrgfi
13593c15da26Smrg])
13603c15da26Smrgif test -n "${ZSH_VERSION+set}" ; then
13613c15da26Smrg   setopt NO_GLOB_SUBST
1362555991fdSmrgfi
1363126a8a12Smrg
13643c15da26Smrg_LT_CHECK_OBJDIR
1365126a8a12Smrg
13663c15da26Smrgm4_require([_LT_TAG_COMPILER])dnl
1367555991fdSmrg
13683c15da26Smrgcase $host_os in
13693c15da26Smrgaix3*)
13703c15da26Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
13713c15da26Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
13723c15da26Smrg  # vanish in a puff of smoke.
13733c15da26Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
13743c15da26Smrg    COLLECT_NAMES=
13753c15da26Smrg    export COLLECT_NAMES
13763c15da26Smrg  fi
13773c15da26Smrg  ;;
13783c15da26Smrgesac
1379555991fdSmrg
13803c15da26Smrg# Global variables:
13813c15da26Smrgofile=libtool
13823c15da26Smrgcan_build_shared=yes
1383126a8a12Smrg
13843c15da26Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
13853c15da26Smrg# which needs '.lib').
13863c15da26Smrglibext=a
1387555991fdSmrg
13883c15da26Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1389555991fdSmrg
13903c15da26Smrgold_CC="$CC"
13913c15da26Smrgold_CFLAGS="$CFLAGS"
1392d656433aSmrg
13933c15da26Smrg# Set sane defaults for various variables
13943c15da26Smrgtest -z "$CC" && CC=cc
13953c15da26Smrgtest -z "$LTCC" && LTCC=$CC
13963c15da26Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
13973c15da26Smrgtest -z "$LD" && LD=ld
13983c15da26Smrgtest -z "$ac_objext" && ac_objext=o
1399126a8a12Smrg
14003c15da26Smrg_LT_CC_BASENAME([$compiler])
1401126a8a12Smrg
14023c15da26Smrg# Only perform the check for file, if the check method requires it
14033c15da26Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
14043c15da26Smrgcase $deplibs_check_method in
14053c15da26Smrgfile_magic*)
14063c15da26Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
14073c15da26Smrg    _LT_PATH_MAGIC
14083c15da26Smrg  fi
14093c15da26Smrg  ;;
14103c15da26Smrgesac
1411126a8a12Smrg
14123c15da26Smrg# Use C for the default configuration in the libtool script
14133c15da26SmrgLT_SUPPORTED_TAG([CC])
14143c15da26Smrg_LT_LANG_C_CONFIG
14153c15da26Smrg_LT_LANG_DEFAULT_CONFIG
14163c15da26Smrg_LT_CONFIG_COMMANDS
14173c15da26Smrg])# _LT_SETUP
1418555991fdSmrg
1419126a8a12Smrg
14203c15da26Smrg# _LT_PREPARE_SED_QUOTE_VARS
14213c15da26Smrg# --------------------------
14223c15da26Smrg# Define a few sed substitution that help us do robust quoting.
14233c15da26Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
14243c15da26Smrg[# Backslashify metacharacters that are still active within
14253c15da26Smrg# double-quoted strings.
14263c15da26Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1427555991fdSmrg
14283c15da26Smrg# Same as above, but do not quote variable references.
14293c15da26Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
1430126a8a12Smrg
14313c15da26Smrg# Sed substitution to delay expansion of an escaped shell variable in a
14323c15da26Smrg# double_quote_subst'ed string.
14333c15da26Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1434555991fdSmrg
14353c15da26Smrg# Sed substitution to delay expansion of an escaped single quote.
14363c15da26Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1437555991fdSmrg
14383c15da26Smrg# Sed substitution to avoid accidental globbing in evaled expressions
14393c15da26Smrgno_glob_subst='s/\*/\\\*/g'
14403c15da26Smrg])
1441d656433aSmrg
14423c15da26Smrg# _LT_PROG_LTMAIN
14433c15da26Smrg# ---------------
14443c15da26Smrg# Note that this code is called both from `configure', and `config.status'
14453c15da26Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
14463c15da26Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
14473c15da26Smrg# so we pass a copy along to make sure it has a sensible value anyway.
14483c15da26Smrgm4_defun([_LT_PROG_LTMAIN],
14493c15da26Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
14503c15da26Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
14513c15da26Smrgltmain="$ac_aux_dir/ltmain.sh"
14523c15da26Smrg])# _LT_PROG_LTMAIN
1453d656433aSmrg
1454d656433aSmrg
1455126a8a12Smrg
14563c15da26Smrg# So that we can recreate a full libtool script including additional
14573c15da26Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
14583c15da26Smrg# in macros and then make a single call at the end using the `libtool'
14593c15da26Smrg# label.
1460126a8a12Smrg
1461126a8a12Smrg
14623c15da26Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
14633c15da26Smrg# ----------------------------------------
14643c15da26Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
14653c15da26Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
14663c15da26Smrg[m4_ifval([$1],
14673c15da26Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
14683c15da26Smrg                     [$1
14693c15da26Smrg])])])
1470126a8a12Smrg
14713c15da26Smrg# Initialize.
14723c15da26Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
1473d656433aSmrg
1474d656433aSmrg
14753c15da26Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
14763c15da26Smrg# ------------------------------
14773c15da26Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
14783c15da26Smrgm4_define([_LT_CONFIG_LIBTOOL],
14793c15da26Smrg[m4_ifval([$1],
14803c15da26Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
14813c15da26Smrg                     [$1
14823c15da26Smrg])])])
1483d656433aSmrg
14843c15da26Smrg# Initialize.
14853c15da26Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1486d656433aSmrg
1487d656433aSmrg
14883c15da26Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
14893c15da26Smrg# -----------------------------------------------------
14903c15da26Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
14913c15da26Smrg[_LT_CONFIG_LIBTOOL([$1])
14923c15da26Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
14933c15da26Smrg])
1494d656433aSmrg
1495126a8a12Smrg
14963c15da26Smrg# _LT_FORMAT_COMMENT([COMMENT])
14973c15da26Smrg# -----------------------------
14983c15da26Smrg# Add leading comment marks to the start of each line, and a trailing
14993c15da26Smrg# full-stop to the whole comment if one is not present already.
15003c15da26Smrgm4_define([_LT_FORMAT_COMMENT],
15013c15da26Smrg[m4_ifval([$1], [
15023c15da26Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
15033c15da26Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
15043c15da26Smrg)])
1505126a8a12Smrg
1506126a8a12Smrg
1507126a8a12Smrg
1508126a8a12Smrg
1509555991fdSmrg
15103c15da26Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
15113c15da26Smrg# -------------------------------------------------------------------
15123c15da26Smrg# CONFIGNAME is the name given to the value in the libtool script.
15133c15da26Smrg# VARNAME is the (base) name used in the configure script.
15143c15da26Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
15153c15da26Smrg# VARNAME.  Any other value will be used directly.
15163c15da26Smrgm4_define([_LT_DECL],
15173c15da26Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
15183c15da26Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
15193c15da26Smrg	[m4_ifval([$1], [$1], [$2])])
15203c15da26Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
15213c15da26Smrg    m4_ifval([$4],
15223c15da26Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
15233c15da26Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
15243c15da26Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
15253c15da26Smrg])
1526126a8a12Smrg
1527555991fdSmrg
15283c15da26Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
15293c15da26Smrg# --------------------------------------------------------
15303c15da26Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1531126a8a12Smrg
15323c15da26Smrg
15333c15da26Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
15343c15da26Smrg# ------------------------------------------------
15353c15da26Smrgm4_define([lt_decl_tag_varnames],
15363c15da26Smrg[_lt_decl_filter([tagged?], [yes], $@)])
15373c15da26Smrg
15383c15da26Smrg
15393c15da26Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
15403c15da26Smrg# ---------------------------------------------------------
15413c15da26Smrgm4_define([_lt_decl_filter],
15423c15da26Smrg[m4_case([$#],
15433c15da26Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
15443c15da26Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
15453c15da26Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
15463c15da26Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
15473c15da26Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1548555991fdSmrg])
1549126a8a12Smrg
1550126a8a12Smrg
15513c15da26Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
15523c15da26Smrg# --------------------------------------------------
15533c15da26Smrgm4_define([lt_decl_quote_varnames],
15543c15da26Smrg[_lt_decl_filter([value], [1], $@)])
1555126a8a12Smrg
1556126a8a12Smrg
15573c15da26Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
15583c15da26Smrg# ---------------------------------------------------
15593c15da26Smrgm4_define([lt_decl_dquote_varnames],
15603c15da26Smrg[_lt_decl_filter([value], [2], $@)])
1561126a8a12Smrg
1562d656433aSmrg
15633c15da26Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
15643c15da26Smrg# ---------------------------------------------------
15653c15da26Smrgm4_define([lt_decl_varnames_tagged],
15663c15da26Smrg[m4_assert([$# <= 2])dnl
15673c15da26Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
15683c15da26Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
15693c15da26Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
15703c15da26Smrgm4_define([_lt_decl_varnames_tagged],
15713c15da26Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1572d656433aSmrg
1573126a8a12Smrg
15743c15da26Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
15753c15da26Smrg# ------------------------------------------------
15763c15da26Smrgm4_define([lt_decl_all_varnames],
15773c15da26Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
15783c15da26Smrg     m4_if([$2], [],
15793c15da26Smrg	   m4_quote(lt_decl_varnames),
15803c15da26Smrg	m4_quote(m4_shift($@))))[]dnl
15813c15da26Smrg])
15823c15da26Smrgm4_define([_lt_decl_all_varnames],
15833c15da26Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
15843c15da26Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
15853c15da26Smrg])
1586126a8a12Smrg
1587126a8a12Smrg
15883c15da26Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
15893c15da26Smrg# ------------------------------------
15903c15da26Smrg# Quote a variable value, and forward it to `config.status' so that its
15913c15da26Smrg# declaration there will have the same value as in `configure'.  VARNAME
15923c15da26Smrg# must have a single quote delimited value for this to work.
15933c15da26Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
15943c15da26Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1595126a8a12Smrg
1596126a8a12Smrg
15973c15da26Smrg# _LT_CONFIG_STATUS_DECLARATIONS
15983c15da26Smrg# ------------------------------
15993c15da26Smrg# We delimit libtool config variables with single quotes, so when
16003c15da26Smrg# we write them to config.status, we have to be sure to quote all
16013c15da26Smrg# embedded single quotes properly.  In configure, this macro expands
16023c15da26Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1603555991fdSmrg#
16043c15da26Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
16053c15da26Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
16063c15da26Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
16073c15da26Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1608126a8a12Smrg
1609126a8a12Smrg
16103c15da26Smrg# _LT_LIBTOOL_TAGS
16113c15da26Smrg# ----------------
16123c15da26Smrg# Output comment and list of tags supported by the script
16133c15da26Smrgm4_defun([_LT_LIBTOOL_TAGS],
16143c15da26Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
16153c15da26Smrgavailable_tags="_LT_TAGS"dnl
16163c15da26Smrg])
1617126a8a12Smrg
1618126a8a12Smrg
16193c15da26Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
16203c15da26Smrg# -----------------------------------
16213c15da26Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
16223c15da26Smrg# expand to a commented shell variable setting:
1623555991fdSmrg#
16243c15da26Smrg#    # Some comment about what VAR is for.
16253c15da26Smrg#    visible_name=$lt_internal_name
16263c15da26Smrgm4_define([_LT_LIBTOOL_DECLARE],
16273c15da26Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
16283c15da26Smrg					   [description])))[]dnl
16293c15da26Smrgm4_pushdef([_libtool_name],
16303c15da26Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
16313c15da26Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
16323c15da26Smrg    [0], [_libtool_name=[$]$1],
16333c15da26Smrg    [1], [_libtool_name=$lt_[]$1],
16343c15da26Smrg    [2], [_libtool_name=$lt_[]$1],
16353c15da26Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
16363c15da26Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
16373c15da26Smrg])
1638126a8a12Smrg
1639126a8a12Smrg
16403c15da26Smrg# _LT_LIBTOOL_CONFIG_VARS
16413c15da26Smrg# -----------------------
16423c15da26Smrg# Produce commented declarations of non-tagged libtool config variables
16433c15da26Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
16443c15da26Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
16453c15da26Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
16463c15da26Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
16473c15da26Smrg[m4_foreach([_lt_var],
16483c15da26Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
16493c15da26Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1650126a8a12Smrg
1651126a8a12Smrg
16523c15da26Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
16533c15da26Smrg# -------------------------
16543c15da26Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
16553c15da26Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
16563c15da26Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1657126a8a12Smrg
1658126a8a12Smrg
16593c15da26Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
16603c15da26Smrg# ------------------------------
16613c15da26Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1662126a8a12Smrg
1663126a8a12Smrg
16643c15da26Smrg# _LT_CONFIG_COMMANDS
16653c15da26Smrg# -------------------
16663c15da26Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
16673c15da26Smrg# variables for single and double quote escaping we saved from calls
16683c15da26Smrg# to _LT_DECL, we can put quote escaped variables declarations
16693c15da26Smrg# into `config.status', and then the shell code to quote escape them in
16703c15da26Smrg# for loops in `config.status'.  Finally, any additional code accumulated
16713c15da26Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
16723c15da26Smrgm4_defun([_LT_CONFIG_COMMANDS],
16733c15da26Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
16743c15da26Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
16753c15da26Smrg	dnl instead of duplicating it all over again into config.status,
16763c15da26Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
16773c15da26Smrg	dnl needs to know what name is stored there:
16783c15da26Smrg        [AC_CONFIG_COMMANDS([libtool],
16793c15da26Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
16803c15da26Smrg    dnl If the libtool generation code is destined for config.status,
16813c15da26Smrg    dnl expand the accumulated commands and init code now:
16823c15da26Smrg    [AC_CONFIG_COMMANDS([libtool],
16833c15da26Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
16843c15da26Smrg])#_LT_CONFIG_COMMANDS
1685555991fdSmrg
1686555991fdSmrg
16873c15da26Smrg# Initialize.
16883c15da26Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
16893c15da26Smrg[
1690555991fdSmrg
16913c15da26Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
16923c15da26Smrg# if CDPATH is set.
16933c15da26Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1694126a8a12Smrg
16953c15da26Smrgsed_quote_subst='$sed_quote_subst'
16963c15da26Smrgdouble_quote_subst='$double_quote_subst'
16973c15da26Smrgdelay_variable_subst='$delay_variable_subst'
16983c15da26Smrg_LT_CONFIG_STATUS_DECLARATIONS
16993c15da26SmrgLTCC='$LTCC'
17003c15da26SmrgLTCFLAGS='$LTCFLAGS'
17013c15da26Smrgcompiler='$compiler_DEFAULT'
1702126a8a12Smrg
17033c15da26Smrg# A function that is used when there is no print builtin or printf.
17043c15da26Smrgfunc_fallback_echo ()
17053c15da26Smrg{
17063c15da26Smrg  eval 'cat <<_LTECHO_EOF
17073c15da26Smrg\$[]1
17083c15da26Smrg_LTECHO_EOF'
17093c15da26Smrg}
1710126a8a12Smrg
17113c15da26Smrg# Quote evaled strings.
17123c15da26Smrgfor var in lt_decl_all_varnames([[ \
17133c15da26Smrg]], lt_decl_quote_varnames); do
17143c15da26Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
17153c15da26Smrg    *[[\\\\\\\`\\"\\\$]]*)
17163c15da26Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
17173c15da26Smrg      ;;
17183c15da26Smrg    *)
17193c15da26Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
17203c15da26Smrg      ;;
17213c15da26Smrg    esac
17223c15da26Smrgdone
1723126a8a12Smrg
17243c15da26Smrg# Double-quote double-evaled strings.
17253c15da26Smrgfor var in lt_decl_all_varnames([[ \
17263c15da26Smrg]], lt_decl_dquote_varnames); do
17273c15da26Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
17283c15da26Smrg    *[[\\\\\\\`\\"\\\$]]*)
17293c15da26Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
17303c15da26Smrg      ;;
17313c15da26Smrg    *)
17323c15da26Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
17333c15da26Smrg      ;;
17343c15da26Smrg    esac
17353c15da26Smrgdone
1736126a8a12Smrg
17373c15da26Smrg_LT_OUTPUT_LIBTOOL_INIT
1738555991fdSmrg])
1739126a8a12Smrg
17403c15da26Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
17413c15da26Smrg# ------------------------------------
17423c15da26Smrg# Generate a child script FILE with all initialization necessary to
17433c15da26Smrg# reuse the environment learned by the parent script, and make the
17443c15da26Smrg# file executable.  If COMMENT is supplied, it is inserted after the
17453c15da26Smrg# `#!' sequence but before initialization text begins.  After this
17463c15da26Smrg# macro, additional text can be appended to FILE to form the body of
17473c15da26Smrg# the child script.  The macro ends with non-zero status if the
17483c15da26Smrg# file could not be fully written (such as if the disk is full).
17493c15da26Smrgm4_ifdef([AS_INIT_GENERATED],
17503c15da26Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
17513c15da26Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
17523c15da26Smrg[m4_require([AS_PREPARE])]dnl
17533c15da26Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
17543c15da26Smrg[lt_write_fail=0
17553c15da26Smrgcat >$1 <<_ASEOF || lt_write_fail=1
17563c15da26Smrg#! $SHELL
17573c15da26Smrg# Generated by $as_me.
17583c15da26Smrg$2
17593c15da26SmrgSHELL=\${CONFIG_SHELL-$SHELL}
17603c15da26Smrgexport SHELL
17613c15da26Smrg_ASEOF
17623c15da26Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
17633c15da26SmrgAS_SHELL_SANITIZE
17643c15da26Smrg_AS_PREPARE
17653c15da26Smrgexec AS_MESSAGE_FD>&1
17663c15da26Smrg_ASEOF
17673c15da26Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
17683c15da26Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1769126a8a12Smrg
17703c15da26Smrg# LT_OUTPUT
17713c15da26Smrg# ---------
17723c15da26Smrg# This macro allows early generation of the libtool script (before
17733c15da26Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
17743c15da26Smrg# tests.
17753c15da26SmrgAC_DEFUN([LT_OUTPUT],
17763c15da26Smrg[: ${CONFIG_LT=./config.lt}
17773c15da26SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
17783c15da26Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
17793c15da26Smrg[# Run this file to recreate a libtool stub with the current configuration.])
1780126a8a12Smrg
17813c15da26Smrgcat >>"$CONFIG_LT" <<\_LTEOF
17823c15da26Smrglt_cl_silent=false
17833c15da26Smrgexec AS_MESSAGE_LOG_FD>>config.log
17843c15da26Smrg{
17853c15da26Smrg  echo
17863c15da26Smrg  AS_BOX([Running $as_me.])
17873c15da26Smrg} >&AS_MESSAGE_LOG_FD
1788126a8a12Smrg
17893c15da26Smrglt_cl_help="\
17903c15da26Smrg\`$as_me' creates a local libtool stub from the current configuration,
17913c15da26Smrgfor use in further configure time tests before the real libtool is
17923c15da26Smrggenerated.
1793126a8a12Smrg
17943c15da26SmrgUsage: $[0] [[OPTIONS]]
1795126a8a12Smrg
17963c15da26Smrg  -h, --help      print this help, then exit
17973c15da26Smrg  -V, --version   print version number, then exit
17983c15da26Smrg  -q, --quiet     do not print progress messages
17993c15da26Smrg  -d, --debug     don't remove temporary files
1800126a8a12Smrg
18013c15da26SmrgReport bugs to <bug-libtool@gnu.org>."
1802126a8a12Smrg
18033c15da26Smrglt_cl_version="\
18043c15da26Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
18053c15da26Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
18063c15da26Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
1807555991fdSmrg
18083c15da26SmrgCopyright (C) 2010 Free Software Foundation, Inc.
18093c15da26SmrgThis config.lt script is free software; the Free Software Foundation
18103c15da26Smrggives unlimited permision to copy, distribute and modify it."
1811555991fdSmrg
18123c15da26Smrgwhile test $[#] != 0
18133c15da26Smrgdo
18143c15da26Smrg  case $[1] in
18153c15da26Smrg    --version | --v* | -V )
18163c15da26Smrg      echo "$lt_cl_version"; exit 0 ;;
18173c15da26Smrg    --help | --h* | -h )
18183c15da26Smrg      echo "$lt_cl_help"; exit 0 ;;
18193c15da26Smrg    --debug | --d* | -d )
18203c15da26Smrg      debug=: ;;
18213c15da26Smrg    --quiet | --q* | --silent | --s* | -q )
18223c15da26Smrg      lt_cl_silent=: ;;
1823555991fdSmrg
18243c15da26Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
18253c15da26SmrgTry \`$[0] --help' for more information.]) ;;
1826555991fdSmrg
18273c15da26Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
18283c15da26SmrgTry \`$[0] --help' for more information.]) ;;
1829d656433aSmrg  esac
18303c15da26Smrg  shift
1831555991fdSmrgdone
1832555991fdSmrg
18333c15da26Smrgif $lt_cl_silent; then
18343c15da26Smrg  exec AS_MESSAGE_FD>/dev/null
1835555991fdSmrgfi
18363c15da26Smrg_LTEOF
1837555991fdSmrg
18383c15da26Smrgcat >>"$CONFIG_LT" <<_LTEOF
18393c15da26Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
18403c15da26Smrg_LTEOF
1841555991fdSmrg
18423c15da26Smrgcat >>"$CONFIG_LT" <<\_LTEOF
18433c15da26SmrgAC_MSG_NOTICE([creating $ofile])
18443c15da26Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
18453c15da26SmrgAS_EXIT(0)
18463c15da26Smrg_LTEOF
18473c15da26Smrgchmod +x "$CONFIG_LT"
1848126a8a12Smrg
18493c15da26Smrg# configure is writing to config.log, but config.lt does its own redirection,
18503c15da26Smrg# appending to config.log, which fails on DOS, as config.log is still kept
18513c15da26Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
18523c15da26Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
18533c15da26Smrglt_cl_success=:
18543c15da26Smrgtest "$silent" = yes &&
18553c15da26Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
18563c15da26Smrgexec AS_MESSAGE_LOG_FD>/dev/null
18573c15da26Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
18583c15da26Smrgexec AS_MESSAGE_LOG_FD>>config.log
18593c15da26Smrg$lt_cl_success || AS_EXIT(1)
18603c15da26Smrg])# LT_OUTPUT
1861126a8a12Smrg
1862126a8a12Smrg
18633c15da26Smrg# _LT_CONFIG(TAG)
18643c15da26Smrg# ---------------
18653c15da26Smrg# If TAG is the built-in tag, create an initial libtool script with a
18663c15da26Smrg# default configuration from the untagged config vars.  Otherwise add code
18673c15da26Smrg# to config.status for appending the configuration named by TAG from the
18683c15da26Smrg# matching tagged config vars.
18693c15da26Smrgm4_defun([_LT_CONFIG],
18703c15da26Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
18713c15da26Smrg_LT_CONFIG_SAVE_COMMANDS([
18723c15da26Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
18733c15da26Smrg  m4_if(_LT_TAG, [C], [
18743c15da26Smrg    # See if we are running on zsh, and set the options which allow our
18753c15da26Smrg    # commands through without removal of \ escapes.
18763c15da26Smrg    if test -n "${ZSH_VERSION+set}" ; then
18773c15da26Smrg      setopt NO_GLOB_SUBST
18783c15da26Smrg    fi
1879126a8a12Smrg
18803c15da26Smrg    cfgfile="${ofile}T"
18813c15da26Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
18823c15da26Smrg    $RM "$cfgfile"
1883126a8a12Smrg
18843c15da26Smrg    cat <<_LT_EOF >> "$cfgfile"
18853c15da26Smrg#! $SHELL
1886d656433aSmrg
18873c15da26Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
18883c15da26Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
18893c15da26Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
18903c15da26Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
18913c15da26Smrg#
18923c15da26Smrg_LT_COPYING
18933c15da26Smrg_LT_LIBTOOL_TAGS
1894d656433aSmrg
18953c15da26Smrg# ### BEGIN LIBTOOL CONFIG
18963c15da26Smrg_LT_LIBTOOL_CONFIG_VARS
18973c15da26Smrg_LT_LIBTOOL_TAG_VARS
18983c15da26Smrg# ### END LIBTOOL CONFIG
1899126a8a12Smrg
19003c15da26Smrg_LT_EOF
1901126a8a12Smrg
19023c15da26Smrg  case $host_os in
19033c15da26Smrg  aix3*)
19043c15da26Smrg    cat <<\_LT_EOF >> "$cfgfile"
19053c15da26Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
19063c15da26Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
19073c15da26Smrg# vanish in a puff of smoke.
19083c15da26Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
19093c15da26Smrg  COLLECT_NAMES=
19103c15da26Smrg  export COLLECT_NAMES
19113c15da26Smrgfi
19123c15da26Smrg_LT_EOF
19133c15da26Smrg    ;;
19143c15da26Smrg  esac
1915126a8a12Smrg
19163c15da26Smrg  _LT_PROG_LTMAIN
1917126a8a12Smrg
19183c15da26Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
19193c15da26Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
19203c15da26Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
19213c15da26Smrg  # is reportedly fixed, but why not run on old versions too?
19223c15da26Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
19233c15da26Smrg     || (rm -f "$cfgfile"; exit 1)
1924d656433aSmrg
19253c15da26Smrg  _LT_PROG_REPLACE_SHELLFNS
1926126a8a12Smrg
19273c15da26Smrg   mv -f "$cfgfile" "$ofile" ||
19283c15da26Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
19293c15da26Smrg  chmod +x "$ofile"
19303c15da26Smrg],
19313c15da26Smrg[cat <<_LT_EOF >> "$ofile"
1932126a8a12Smrg
19333c15da26Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
19343c15da26Smrgdnl in a comment (ie after a #).
19353c15da26Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
19363c15da26Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
19373c15da26Smrg# ### END LIBTOOL TAG CONFIG: $1
19383c15da26Smrg_LT_EOF
19393c15da26Smrg])dnl /m4_if
19403c15da26Smrg],
19413c15da26Smrg[m4_if([$1], [], [
19423c15da26Smrg    PACKAGE='$PACKAGE'
19433c15da26Smrg    VERSION='$VERSION'
19443c15da26Smrg    TIMESTAMP='$TIMESTAMP'
19453c15da26Smrg    RM='$RM'
19463c15da26Smrg    ofile='$ofile'], [])
19473c15da26Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
19483c15da26Smrg])# _LT_CONFIG
1949126a8a12Smrg
1950126a8a12Smrg
19513c15da26Smrg# LT_SUPPORTED_TAG(TAG)
19523c15da26Smrg# ---------------------
19533c15da26Smrg# Trace this macro to discover what tags are supported by the libtool
19543c15da26Smrg# --tag option, using:
19553c15da26Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
19563c15da26SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
1957d656433aSmrg
1958126a8a12Smrg
19593c15da26Smrg# C support is built-in for now
19603c15da26Smrgm4_define([_LT_LANG_C_enabled], [])
19613c15da26Smrgm4_define([_LT_TAGS], [])
1962d656433aSmrg
1963d656433aSmrg
19643c15da26Smrg# LT_LANG(LANG)
19653c15da26Smrg# -------------
19663c15da26Smrg# Enable libtool support for the given language if not already enabled.
19673c15da26SmrgAC_DEFUN([LT_LANG],
19683c15da26Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
19693c15da26Smrgm4_case([$1],
19703c15da26Smrg  [C],			[_LT_LANG(C)],
19713c15da26Smrg  [C++],		[_LT_LANG(CXX)],
19723c15da26Smrg  [Java],		[_LT_LANG(GCJ)],
19733c15da26Smrg  [Fortran 77],		[_LT_LANG(F77)],
19743c15da26Smrg  [Fortran],		[_LT_LANG(FC)],
19753c15da26Smrg  [Windows Resource],	[_LT_LANG(RC)],
19763c15da26Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
19773c15da26Smrg    [_LT_LANG($1)],
19783c15da26Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
19793c15da26Smrg])# LT_LANG
1980d656433aSmrg
1981d656433aSmrg
19823c15da26Smrg# _LT_LANG(LANGNAME)
19833c15da26Smrg# ------------------
19843c15da26Smrgm4_defun([_LT_LANG],
19853c15da26Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
19863c15da26Smrg  [LT_SUPPORTED_TAG([$1])dnl
19873c15da26Smrg  m4_append([_LT_TAGS], [$1 ])dnl
19883c15da26Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
19893c15da26Smrg  _LT_LANG_$1_CONFIG($1)])dnl
19903c15da26Smrg])# _LT_LANG
1991126a8a12Smrg
1992126a8a12Smrg
19933c15da26Smrg# _LT_LANG_DEFAULT_CONFIG
19943c15da26Smrg# -----------------------
19953c15da26Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
19963c15da26Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
19973c15da26Smrg  [LT_LANG(CXX)],
19983c15da26Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1999126a8a12Smrg
20003c15da26SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
20013c15da26Smrg  [LT_LANG(F77)],
20023c15da26Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
2003d656433aSmrg
20043c15da26SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
20053c15da26Smrg  [LT_LANG(FC)],
20063c15da26Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
2007d656433aSmrg
20083c15da26Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
20093c15da26Smrgdnl pulling things in needlessly.
20103c15da26SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
20113c15da26Smrg  [LT_LANG(GCJ)],
20123c15da26Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
20133c15da26Smrg    [LT_LANG(GCJ)],
20143c15da26Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
20153c15da26Smrg      [LT_LANG(GCJ)],
20163c15da26Smrg      [m4_ifdef([AC_PROG_GCJ],
20173c15da26Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
20183c15da26Smrg       m4_ifdef([A][M_PROG_GCJ],
20193c15da26Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
20203c15da26Smrg       m4_ifdef([LT_PROG_GCJ],
20213c15da26Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
2022126a8a12Smrg
20233c15da26SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
20243c15da26Smrg  [LT_LANG(RC)],
20253c15da26Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
20263c15da26Smrg])# _LT_LANG_DEFAULT_CONFIG
2027126a8a12Smrg
20283c15da26Smrg# Obsolete macros:
20293c15da26SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
20303c15da26SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
20313c15da26SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
20323c15da26SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
20333c15da26SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
20343c15da26Smrgdnl aclocal-1.4 backwards compatibility:
20353c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
20363c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
20373c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
20383c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
20393c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
2040126a8a12Smrg
2041126a8a12Smrg
20423c15da26Smrg# _LT_TAG_COMPILER
20433c15da26Smrg# ----------------
20443c15da26Smrgm4_defun([_LT_TAG_COMPILER],
20453c15da26Smrg[AC_REQUIRE([AC_PROG_CC])dnl
2046126a8a12Smrg
20473c15da26Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
20483c15da26Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
20493c15da26Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
20503c15da26Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
2051126a8a12Smrg
20523c15da26Smrg# If no C compiler was specified, use CC.
20533c15da26SmrgLTCC=${LTCC-"$CC"}
2054126a8a12Smrg
20553c15da26Smrg# If no C compiler flags were specified, use CFLAGS.
20563c15da26SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2057126a8a12Smrg
20583c15da26Smrg# Allow CC to be a program name with arguments.
20593c15da26Smrgcompiler=$CC
20603c15da26Smrg])# _LT_TAG_COMPILER
2061126a8a12Smrg
2062126a8a12Smrg
20633c15da26Smrg# _LT_COMPILER_BOILERPLATE
20643c15da26Smrg# ------------------------
20653c15da26Smrg# Check for compiler boilerplate output or warnings with
20663c15da26Smrg# the simple compiler test code.
20673c15da26Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
20683c15da26Smrg[m4_require([_LT_DECL_SED])dnl
20693c15da26Smrgac_outfile=conftest.$ac_objext
20703c15da26Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
20713c15da26Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
20723c15da26Smrg_lt_compiler_boilerplate=`cat conftest.err`
20733c15da26Smrg$RM conftest*
20743c15da26Smrg])# _LT_COMPILER_BOILERPLATE
2075126a8a12Smrg
2076126a8a12Smrg
20773c15da26Smrg# _LT_LINKER_BOILERPLATE
20783c15da26Smrg# ----------------------
20793c15da26Smrg# Check for linker boilerplate output or warnings with
20803c15da26Smrg# the simple link test code.
20813c15da26Smrgm4_defun([_LT_LINKER_BOILERPLATE],
20823c15da26Smrg[m4_require([_LT_DECL_SED])dnl
20833c15da26Smrgac_outfile=conftest.$ac_objext
20843c15da26Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
20853c15da26Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
20863c15da26Smrg_lt_linker_boilerplate=`cat conftest.err`
20873c15da26Smrg$RM -r conftest*
20883c15da26Smrg])# _LT_LINKER_BOILERPLATE
2089126a8a12Smrg
20903c15da26Smrg# _LT_REQUIRED_DARWIN_CHECKS
20913c15da26Smrg# -------------------------
20923c15da26Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
20933c15da26Smrg  case $host_os in
20943c15da26Smrg    rhapsody* | darwin*)
20953c15da26Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
20963c15da26Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
20973c15da26Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
20983c15da26Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
20993c15da26Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
21003c15da26Smrg    _LT_DECL([], [DSYMUTIL], [1],
21013c15da26Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
21023c15da26Smrg    _LT_DECL([], [NMEDIT], [1],
21033c15da26Smrg      [Tool to change global to local symbols on Mac OS X])
21043c15da26Smrg    _LT_DECL([], [LIPO], [1],
21053c15da26Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
21063c15da26Smrg    _LT_DECL([], [OTOOL], [1],
21073c15da26Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
21083c15da26Smrg    _LT_DECL([], [OTOOL64], [1],
21093c15da26Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2110126a8a12Smrg
21113c15da26Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
21123c15da26Smrg      [lt_cv_apple_cc_single_mod=no
21133c15da26Smrg      if test -z "${LT_MULTI_MODULE}"; then
21143c15da26Smrg	# By default we will add the -single_module flag. You can override
21153c15da26Smrg	# by either setting the environment variable LT_MULTI_MODULE
21163c15da26Smrg	# non-empty at configure time, or by adding -multi_module to the
21173c15da26Smrg	# link flags.
21183c15da26Smrg	rm -rf libconftest.dylib*
21193c15da26Smrg	echo "int foo(void){return 1;}" > conftest.c
21203c15da26Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
21213c15da26Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
21223c15da26Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
21233c15da26Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
21243c15da26Smrg        _lt_result=$?
21253c15da26Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
21263c15da26Smrg	  lt_cv_apple_cc_single_mod=yes
21273c15da26Smrg	else
21283c15da26Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
21293c15da26Smrg	fi
21303c15da26Smrg	rm -rf libconftest.dylib*
21313c15da26Smrg	rm -f conftest.*
21323c15da26Smrg      fi])
21333c15da26Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
21343c15da26Smrg      [lt_cv_ld_exported_symbols_list],
21353c15da26Smrg      [lt_cv_ld_exported_symbols_list=no
21363c15da26Smrg      save_LDFLAGS=$LDFLAGS
21373c15da26Smrg      echo "_main" > conftest.sym
21383c15da26Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
21393c15da26Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
21403c15da26Smrg	[lt_cv_ld_exported_symbols_list=yes],
21413c15da26Smrg	[lt_cv_ld_exported_symbols_list=no])
21423c15da26Smrg	LDFLAGS="$save_LDFLAGS"
21433c15da26Smrg    ])
21443c15da26Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
21453c15da26Smrg      [lt_cv_ld_force_load=no
21463c15da26Smrg      cat > conftest.c << _LT_EOF
21473c15da26Smrgint forced_loaded() { return 2;}
21483c15da26Smrg_LT_EOF
21493c15da26Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
21503c15da26Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
21513c15da26Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
21523c15da26Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
21533c15da26Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
21543c15da26Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
21553c15da26Smrg      cat > conftest.c << _LT_EOF
21563c15da26Smrgint main() { return 0;}
21573c15da26Smrg_LT_EOF
21583c15da26Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
21593c15da26Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
21603c15da26Smrg      _lt_result=$?
21613c15da26Smrg      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
21623c15da26Smrg	lt_cv_ld_force_load=yes
21633c15da26Smrg      else
21643c15da26Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
21653c15da26Smrg      fi
21663c15da26Smrg        rm -f conftest.err libconftest.a conftest conftest.c
21673c15da26Smrg        rm -rf conftest.dSYM
21683c15da26Smrg    ])
21693c15da26Smrg    case $host_os in
21703c15da26Smrg    rhapsody* | darwin1.[[012]])
21713c15da26Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
21723c15da26Smrg    darwin1.*)
21733c15da26Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
21743c15da26Smrg    darwin*) # darwin 5.x on
21753c15da26Smrg      # if running on 10.5 or later, the deployment target defaults
21763c15da26Smrg      # to the OS version, if on x86, and 10.4, the deployment
21773c15da26Smrg      # target defaults to 10.4. Don't you love it?
21783c15da26Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
21793c15da26Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
21803c15da26Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
21813c15da26Smrg	10.[[012]]*)
21823c15da26Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
21833c15da26Smrg	10.*)
21843c15da26Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
21853c15da26Smrg      esac
21863c15da26Smrg    ;;
21873c15da26Smrg  esac
21883c15da26Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
21893c15da26Smrg      _lt_dar_single_mod='$single_module'
21903c15da26Smrg    fi
21913c15da26Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
21923c15da26Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
21933c15da26Smrg    else
21943c15da26Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
21953c15da26Smrg    fi
21963c15da26Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
21973c15da26Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
21983c15da26Smrg    else
21993c15da26Smrg      _lt_dsymutil=
22003c15da26Smrg    fi
22013c15da26Smrg    ;;
22023c15da26Smrg  esac
2203555991fdSmrg])
2204126a8a12Smrg
2205126a8a12Smrg
22063c15da26Smrg# _LT_DARWIN_LINKER_FEATURES
22073c15da26Smrg# --------------------------
22083c15da26Smrg# Checks for linker and compiler features on darwin
22093c15da26Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
22103c15da26Smrg[
22113c15da26Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
22123c15da26Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
22133c15da26Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
22143c15da26Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
22153c15da26Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
22163c15da26Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
22173c15da26Smrg    _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\"`'
22183c15da26Smrg  else
22193c15da26Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
22203c15da26Smrg  fi
22213c15da26Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
22223c15da26Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
22233c15da26Smrg  case $cc_basename in
22243c15da26Smrg     ifort*) _lt_dar_can_shared=yes ;;
22253c15da26Smrg     *) _lt_dar_can_shared=$GCC ;;
22263c15da26Smrg  esac
22273c15da26Smrg  if test "$_lt_dar_can_shared" = "yes"; then
22283c15da26Smrg    output_verbose_link_cmd=func_echo_all
22293c15da26Smrg    _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}"
22303c15da26Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
22313c15da26Smrg    _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}"
22323c15da26Smrg    _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}"
22333c15da26Smrg    m4_if([$1], [CXX],
22343c15da26Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
22353c15da26Smrg      _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}"
22363c15da26Smrg      _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}"
22373c15da26Smrg    fi
22383c15da26Smrg],[])
22393c15da26Smrg  else
22403c15da26Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
22413c15da26Smrg  fi
22423c15da26Smrg])
2243126a8a12Smrg
22443c15da26Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
22453c15da26Smrg# ----------------------------------
22463c15da26Smrg# Links a minimal program and checks the executable
22473c15da26Smrg# for the system default hardcoded library path. In most cases,
22483c15da26Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
22493c15da26Smrg# the location of the communication and MPI libs are included too.
22503c15da26Smrg# If we don't find anything, use the default library path according
22513c15da26Smrg# to the aix ld manual.
22523c15da26Smrg# Store the results from the different compilers for each TAGNAME.
22533c15da26Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
22543c15da26Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
22553c15da26Smrg[m4_require([_LT_DECL_SED])dnl
22563c15da26Smrgif test "${lt_cv_aix_libpath+set}" = set; then
22573c15da26Smrg  aix_libpath=$lt_cv_aix_libpath
22583c15da26Smrgelse
22593c15da26Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
22603c15da26Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
22613c15da26Smrg  lt_aix_libpath_sed='[
22623c15da26Smrg      /Import File Strings/,/^$/ {
22633c15da26Smrg	  /^0/ {
22643c15da26Smrg	      s/^0  *\([^ ]*\) *$/\1/
22653c15da26Smrg	      p
22663c15da26Smrg	  }
22673c15da26Smrg      }]'
22683c15da26Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
22693c15da26Smrg  # Check for a 64-bit object if we didn't find anything.
22703c15da26Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
22713c15da26Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
22723c15da26Smrg  fi],[])
22733c15da26Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
22743c15da26Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
22753c15da26Smrg  fi
22763c15da26Smrg  ])
22773c15da26Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
22783c15da26Smrgfi
22793c15da26Smrg])# _LT_SYS_MODULE_PATH_AIX
2280126a8a12Smrg
2281126a8a12Smrg
22823c15da26Smrg# _LT_SHELL_INIT(ARG)
2283555991fdSmrg# -------------------
22843c15da26Smrgm4_define([_LT_SHELL_INIT],
22853c15da26Smrg[m4_divert_text([M4SH-INIT], [$1
22863c15da26Smrg])])# _LT_SHELL_INIT
2287126a8a12Smrg
2288126a8a12Smrg
2289126a8a12Smrg
22903c15da26Smrg# _LT_PROG_ECHO_BACKSLASH
22913c15da26Smrg# -----------------------
22923c15da26Smrg# Find how we can fake an echo command that does not interpret backslash.
22933c15da26Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
22943c15da26Smrg# of the generated configure script which will find a shell with a builtin
22953c15da26Smrg# printf (which we can use as an echo command).
22963c15da26Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
22973c15da26Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
22983c15da26SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
22993c15da26SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2300555991fdSmrg
23013c15da26SmrgAC_MSG_CHECKING([how to print strings])
23023c15da26Smrg# Test print first, because it will be a builtin if present.
23033c15da26Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
23043c15da26Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
23053c15da26Smrg  ECHO='print -r --'
23063c15da26Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
23073c15da26Smrg  ECHO='printf %s\n'
23083c15da26Smrgelse
23093c15da26Smrg  # Use this function as a fallback that always works.
23103c15da26Smrg  func_fallback_echo ()
23113c15da26Smrg  {
23123c15da26Smrg    eval 'cat <<_LTECHO_EOF
23133c15da26Smrg$[]1
23143c15da26Smrg_LTECHO_EOF'
23153c15da26Smrg  }
23163c15da26Smrg  ECHO='func_fallback_echo'
23173c15da26Smrgfi
2318555991fdSmrg
23193c15da26Smrg# func_echo_all arg...
23203c15da26Smrg# Invoke $ECHO with all args, space-separated.
23213c15da26Smrgfunc_echo_all ()
2322555991fdSmrg{
23233c15da26Smrg    $ECHO "$*" 
2324555991fdSmrg}
2325555991fdSmrg
23263c15da26Smrgcase "$ECHO" in
23273c15da26Smrg  printf*) AC_MSG_RESULT([printf]) ;;
23283c15da26Smrg  print*) AC_MSG_RESULT([print -r]) ;;
23293c15da26Smrg  *) AC_MSG_RESULT([cat]) ;;
23303c15da26Smrgesac
2331126a8a12Smrg
23323c15da26Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
23333c15da26Smrg[_AS_DETECT_SUGGESTED([
23343c15da26Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
23353c15da26Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
23363c15da26Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
23373c15da26Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
23383c15da26Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
23393c15da26Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
23403c15da26Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2341126a8a12Smrg
23423c15da26Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
23433c15da26Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
23443c15da26Smrg])# _LT_PROG_ECHO_BACKSLASH
2345126a8a12Smrg
2346126a8a12Smrg
23473c15da26Smrg# _LT_WITH_SYSROOT
23483c15da26Smrg# ----------------
23493c15da26SmrgAC_DEFUN([_LT_WITH_SYSROOT],
23503c15da26Smrg[AC_MSG_CHECKING([for sysroot])
23513c15da26SmrgAC_ARG_WITH([sysroot],
23523c15da26Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
23533c15da26Smrg                        (or the compiler's sysroot if not specified).],
23543c15da26Smrg[], [with_sysroot=no])
23553c15da26Smrg
23563c15da26Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
23573c15da26Smrgdnl in case the user passed a directory name.
23583c15da26Smrglt_sysroot=
23593c15da26Smrgcase ${with_sysroot} in #(
23603c15da26Smrg yes)
23613c15da26Smrg   if test "$GCC" = yes; then
23623c15da26Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
23633c15da26Smrg   fi
23643c15da26Smrg   ;; #(
23653c15da26Smrg /*)
23663c15da26Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
23673c15da26Smrg   ;; #(
23683c15da26Smrg no|'')
23693c15da26Smrg   ;; #(
23703c15da26Smrg *)
23713c15da26Smrg   AC_MSG_RESULT([${with_sysroot}])
23723c15da26Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
23733c15da26Smrg   ;;
23743c15da26Smrgesac
2375126a8a12Smrg
23763c15da26Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
23773c15da26Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
23783c15da26Smrg[dependent libraries, and in which our libraries should be installed.])])
2379126a8a12Smrg
23803c15da26Smrg# _LT_ENABLE_LOCK
23813c15da26Smrg# ---------------
23823c15da26Smrgm4_defun([_LT_ENABLE_LOCK],
23833c15da26Smrg[AC_ARG_ENABLE([libtool-lock],
23843c15da26Smrg  [AS_HELP_STRING([--disable-libtool-lock],
23853c15da26Smrg    [avoid locking (might break parallel builds)])])
23863c15da26Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2387126a8a12Smrg
23883c15da26Smrg# Some flags need to be propagated to the compiler or linker for good
23893c15da26Smrg# libtool support.
23903c15da26Smrgcase $host in
23913c15da26Smrgia64-*-hpux*)
23923c15da26Smrg  # Find out which ABI we are using.
23933c15da26Smrg  echo 'int i;' > conftest.$ac_ext
23943c15da26Smrg  if AC_TRY_EVAL(ac_compile); then
23953c15da26Smrg    case `/usr/bin/file conftest.$ac_objext` in
23963c15da26Smrg      *ELF-32*)
23973c15da26Smrg	HPUX_IA64_MODE="32"
23983c15da26Smrg	;;
23993c15da26Smrg      *ELF-64*)
24003c15da26Smrg	HPUX_IA64_MODE="64"
24013c15da26Smrg	;;
24023c15da26Smrg    esac
24033c15da26Smrg  fi
24043c15da26Smrg  rm -rf conftest*
24053c15da26Smrg  ;;
24063c15da26Smrg*-*-irix6*)
24073c15da26Smrg  # Find out which ABI we are using.
24083c15da26Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
24093c15da26Smrg  if AC_TRY_EVAL(ac_compile); then
24103c15da26Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
24113c15da26Smrg      case `/usr/bin/file conftest.$ac_objext` in
24123c15da26Smrg	*32-bit*)
24133c15da26Smrg	  LD="${LD-ld} -melf32bsmip"
24143c15da26Smrg	  ;;
24153c15da26Smrg	*N32*)
24163c15da26Smrg	  LD="${LD-ld} -melf32bmipn32"
24173c15da26Smrg	  ;;
24183c15da26Smrg	*64-bit*)
24193c15da26Smrg	  LD="${LD-ld} -melf64bmip"
24203c15da26Smrg	;;
24213c15da26Smrg      esac
24223c15da26Smrg    else
24233c15da26Smrg      case `/usr/bin/file conftest.$ac_objext` in
24243c15da26Smrg	*32-bit*)
24253c15da26Smrg	  LD="${LD-ld} -32"
24263c15da26Smrg	  ;;
24273c15da26Smrg	*N32*)
24283c15da26Smrg	  LD="${LD-ld} -n32"
24293c15da26Smrg	  ;;
24303c15da26Smrg	*64-bit*)
24313c15da26Smrg	  LD="${LD-ld} -64"
24323c15da26Smrg	  ;;
24333c15da26Smrg      esac
24343c15da26Smrg    fi
24353c15da26Smrg  fi
24363c15da26Smrg  rm -rf conftest*
24373c15da26Smrg  ;;
2438126a8a12Smrg
24393c15da26Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
24403c15da26Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
24413c15da26Smrg  # Find out which ABI we are using.
24423c15da26Smrg  echo 'int i;' > conftest.$ac_ext
24433c15da26Smrg  if AC_TRY_EVAL(ac_compile); then
24443c15da26Smrg    case `/usr/bin/file conftest.o` in
24453c15da26Smrg      *32-bit*)
24463c15da26Smrg	case $host in
24473c15da26Smrg	  x86_64-*kfreebsd*-gnu)
24483c15da26Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
24493c15da26Smrg	    ;;
24503c15da26Smrg	  x86_64-*linux*)
24513c15da26Smrg	    LD="${LD-ld} -m elf_i386"
24523c15da26Smrg	    ;;
24533c15da26Smrg	  ppc64-*linux*|powerpc64-*linux*)
24543c15da26Smrg	    LD="${LD-ld} -m elf32ppclinux"
24553c15da26Smrg	    ;;
24563c15da26Smrg	  s390x-*linux*)
24573c15da26Smrg	    LD="${LD-ld} -m elf_s390"
24583c15da26Smrg	    ;;
24593c15da26Smrg	  sparc64-*linux*)
24603c15da26Smrg	    LD="${LD-ld} -m elf32_sparc"
24613c15da26Smrg	    ;;
24623c15da26Smrg	esac
24633c15da26Smrg	;;
24643c15da26Smrg      *64-bit*)
24653c15da26Smrg	case $host in
24663c15da26Smrg	  x86_64-*kfreebsd*-gnu)
24673c15da26Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
24683c15da26Smrg	    ;;
24693c15da26Smrg	  x86_64-*linux*)
24703c15da26Smrg	    LD="${LD-ld} -m elf_x86_64"
24713c15da26Smrg	    ;;
24723c15da26Smrg	  ppc*-*linux*|powerpc*-*linux*)
24733c15da26Smrg	    LD="${LD-ld} -m elf64ppc"
24743c15da26Smrg	    ;;
24753c15da26Smrg	  s390*-*linux*|s390*-*tpf*)
24763c15da26Smrg	    LD="${LD-ld} -m elf64_s390"
24773c15da26Smrg	    ;;
24783c15da26Smrg	  sparc*-*linux*)
24793c15da26Smrg	    LD="${LD-ld} -m elf64_sparc"
24803c15da26Smrg	    ;;
24813c15da26Smrg	esac
24823c15da26Smrg	;;
24833c15da26Smrg    esac
24843c15da26Smrg  fi
24853c15da26Smrg  rm -rf conftest*
24863c15da26Smrg  ;;
2487126a8a12Smrg
24883c15da26Smrg*-*-sco3.2v5*)
24893c15da26Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
24903c15da26Smrg  SAVE_CFLAGS="$CFLAGS"
24913c15da26Smrg  CFLAGS="$CFLAGS -belf"
24923c15da26Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
24933c15da26Smrg    [AC_LANG_PUSH(C)
24943c15da26Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
24953c15da26Smrg     AC_LANG_POP])
24963c15da26Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
24973c15da26Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
24983c15da26Smrg    CFLAGS="$SAVE_CFLAGS"
24993c15da26Smrg  fi
25003c15da26Smrg  ;;
25013c15da26Smrgsparc*-*solaris*)
25023c15da26Smrg  # Find out which ABI we are using.
25033c15da26Smrg  echo 'int i;' > conftest.$ac_ext
25043c15da26Smrg  if AC_TRY_EVAL(ac_compile); then
25053c15da26Smrg    case `/usr/bin/file conftest.o` in
25063c15da26Smrg    *64-bit*)
25073c15da26Smrg      case $lt_cv_prog_gnu_ld in
25083c15da26Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
25093c15da26Smrg      *)
25103c15da26Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
25113c15da26Smrg	  LD="${LD-ld} -64"
25123c15da26Smrg	fi
25133c15da26Smrg	;;
25143c15da26Smrg      esac
25153c15da26Smrg      ;;
25163c15da26Smrg    esac
25173c15da26Smrg  fi
25183c15da26Smrg  rm -rf conftest*
25193c15da26Smrg  ;;
25203c15da26Smrgesac
2521126a8a12Smrg
25223c15da26Smrgneed_locks="$enable_libtool_lock"
25233c15da26Smrg])# _LT_ENABLE_LOCK
2524126a8a12Smrg
2525126a8a12Smrg
25263c15da26Smrg# _LT_PROG_AR
25273c15da26Smrg# -----------
25283c15da26Smrgm4_defun([_LT_PROG_AR],
25293c15da26Smrg[AC_CHECK_TOOLS(AR, [ar], false)
25303c15da26Smrg: ${AR=ar}
25313c15da26Smrg: ${AR_FLAGS=cru}
25323c15da26Smrg_LT_DECL([], [AR], [1], [The archiver])
25333c15da26Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
25343c15da26Smrg
25353c15da26SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
25363c15da26Smrg  [lt_cv_ar_at_file=no
25373c15da26Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
25383c15da26Smrg     [echo conftest.$ac_objext > conftest.lst
25393c15da26Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
25403c15da26Smrg      AC_TRY_EVAL([lt_ar_try])
25413c15da26Smrg      if test "$ac_status" -eq 0; then
25423c15da26Smrg	# Ensure the archiver fails upon bogus file names.
25433c15da26Smrg	rm -f conftest.$ac_objext libconftest.a
25443c15da26Smrg	AC_TRY_EVAL([lt_ar_try])
25453c15da26Smrg	if test "$ac_status" -ne 0; then
25463c15da26Smrg          lt_cv_ar_at_file=@
25473c15da26Smrg        fi
25483c15da26Smrg      fi
25493c15da26Smrg      rm -f conftest.* libconftest.a
25503c15da26Smrg     ])
25513c15da26Smrg  ])
2552126a8a12Smrg
25533c15da26Smrgif test "x$lt_cv_ar_at_file" = xno; then
25543c15da26Smrg  archiver_list_spec=
25553c15da26Smrgelse
25563c15da26Smrg  archiver_list_spec=$lt_cv_ar_at_file
2557555991fdSmrgfi
25583c15da26Smrg_LT_DECL([], [archiver_list_spec], [1],
25593c15da26Smrg  [How to feed a file listing to the archiver])
25603c15da26Smrg])# _LT_PROG_AR
2561126a8a12Smrg
2562126a8a12Smrg
25633c15da26Smrg# _LT_CMD_OLD_ARCHIVE
25643c15da26Smrg# -------------------
25653c15da26Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
25663c15da26Smrg[_LT_PROG_AR
2567126a8a12Smrg
25683c15da26SmrgAC_CHECK_TOOL(STRIP, strip, :)
25693c15da26Smrgtest -z "$STRIP" && STRIP=:
25703c15da26Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2571126a8a12Smrg
25723c15da26SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
25733c15da26Smrgtest -z "$RANLIB" && RANLIB=:
25743c15da26Smrg_LT_DECL([], [RANLIB], [1],
25753c15da26Smrg    [Commands used to install an old-style archive])
2576126a8a12Smrg
25773c15da26Smrg# Determine commands to create old-style static archives.
25783c15da26Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
25793c15da26Smrgold_postinstall_cmds='chmod 644 $oldlib'
25803c15da26Smrgold_postuninstall_cmds=
2581126a8a12Smrg
25823c15da26Smrgif test -n "$RANLIB"; then
2583555991fdSmrg  case $host_os in
25843c15da26Smrg  openbsd*)
25853c15da26Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
25863c15da26Smrg    ;;
25873c15da26Smrg  *)
25883c15da26Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
2589555991fdSmrg    ;;
2590555991fdSmrg  esac
25913c15da26Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
25923c15da26Smrgfi
2593126a8a12Smrg
25943c15da26Smrgcase $host_os in
25953c15da26Smrg  darwin*)
25963c15da26Smrg    lock_old_archive_extraction=yes ;;
25973c15da26Smrg  *)
25983c15da26Smrg    lock_old_archive_extraction=no ;;
25993c15da26Smrgesac
26003c15da26Smrg_LT_DECL([], [old_postinstall_cmds], [2])
26013c15da26Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
26023c15da26Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
26033c15da26Smrg    [Commands used to build an old-style archive])
26043c15da26Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
26053c15da26Smrg    [Whether to use a lock for old archive extraction])
26063c15da26Smrg])# _LT_CMD_OLD_ARCHIVE
2607126a8a12Smrg
2608126a8a12Smrg
26093c15da26Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
26103c15da26Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
26113c15da26Smrg# ----------------------------------------------------------------
26123c15da26Smrg# Check whether the given compiler option works
26133c15da26SmrgAC_DEFUN([_LT_COMPILER_OPTION],
26143c15da26Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
26153c15da26Smrgm4_require([_LT_DECL_SED])dnl
26163c15da26SmrgAC_CACHE_CHECK([$1], [$2],
26173c15da26Smrg  [$2=no
26183c15da26Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
26193c15da26Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
26203c15da26Smrg   lt_compiler_flag="$3"
26213c15da26Smrg   # Insert the option either (1) after the last *FLAGS variable, or
26223c15da26Smrg   # (2) before a word containing "conftest.", or (3) at the end.
26233c15da26Smrg   # Note that $ac_compile itself does not contain backslashes and begins
26243c15da26Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
26253c15da26Smrg   # The option is referenced via a variable to avoid confusing sed.
26263c15da26Smrg   lt_compile=`echo "$ac_compile" | $SED \
26273c15da26Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
26283c15da26Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
26293c15da26Smrg   -e 's:$: $lt_compiler_flag:'`
26303c15da26Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
26313c15da26Smrg   (eval "$lt_compile" 2>conftest.err)
26323c15da26Smrg   ac_status=$?
26333c15da26Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
26343c15da26Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
26353c15da26Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
26363c15da26Smrg     # The compiler can only warn and ignore the option if not recognized
26373c15da26Smrg     # So say no if there are warnings other than the usual output.
26383c15da26Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
26393c15da26Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
26403c15da26Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
26413c15da26Smrg       $2=yes
26423c15da26Smrg     fi
26433c15da26Smrg   fi
26443c15da26Smrg   $RM conftest*
26453c15da26Smrg])
2646126a8a12Smrg
26473c15da26Smrgif test x"[$]$2" = xyes; then
26483c15da26Smrg    m4_if([$5], , :, [$5])
26493c15da26Smrgelse
26503c15da26Smrg    m4_if([$6], , :, [$6])
26513c15da26Smrgfi
26523c15da26Smrg])# _LT_COMPILER_OPTION
2653126a8a12Smrg
26543c15da26Smrg# Old name:
26553c15da26SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
26563c15da26Smrgdnl aclocal-1.4 backwards compatibility:
26573c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2658126a8a12Smrg
2659126a8a12Smrg
26603c15da26Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
26613c15da26Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
26623c15da26Smrg# ----------------------------------------------------
26633c15da26Smrg# Check whether the given linker option works
26643c15da26SmrgAC_DEFUN([_LT_LINKER_OPTION],
26653c15da26Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
26663c15da26Smrgm4_require([_LT_DECL_SED])dnl
26673c15da26SmrgAC_CACHE_CHECK([$1], [$2],
26683c15da26Smrg  [$2=no
26693c15da26Smrg   save_LDFLAGS="$LDFLAGS"
26703c15da26Smrg   LDFLAGS="$LDFLAGS $3"
26713c15da26Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
26723c15da26Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
26733c15da26Smrg     # The linker can only warn and ignore the option if not recognized
26743c15da26Smrg     # So say no if there are warnings
26753c15da26Smrg     if test -s conftest.err; then
26763c15da26Smrg       # Append any errors to the config.log.
26773c15da26Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
26783c15da26Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
26793c15da26Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
26803c15da26Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
26813c15da26Smrg         $2=yes
26823c15da26Smrg       fi
26833c15da26Smrg     else
26843c15da26Smrg       $2=yes
26853c15da26Smrg     fi
26863c15da26Smrg   fi
26873c15da26Smrg   $RM -r conftest*
26883c15da26Smrg   LDFLAGS="$save_LDFLAGS"
26893c15da26Smrg])
2690126a8a12Smrg
26913c15da26Smrgif test x"[$]$2" = xyes; then
26923c15da26Smrg    m4_if([$4], , :, [$4])
26933c15da26Smrgelse
26943c15da26Smrg    m4_if([$5], , :, [$5])
26953c15da26Smrgfi
26963c15da26Smrg])# _LT_LINKER_OPTION
2697126a8a12Smrg
26983c15da26Smrg# Old name:
26993c15da26SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
27003c15da26Smrgdnl aclocal-1.4 backwards compatibility:
27013c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2702126a8a12Smrg
2703126a8a12Smrg
27043c15da26Smrg# LT_CMD_MAX_LEN
27053c15da26Smrg#---------------
27063c15da26SmrgAC_DEFUN([LT_CMD_MAX_LEN],
27073c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
27083c15da26Smrg# find the maximum length of command line arguments
27093c15da26SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
27103c15da26SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
27113c15da26Smrg  i=0
27123c15da26Smrg  teststring="ABCD"
2713126a8a12Smrg
27143c15da26Smrg  case $build_os in
27153c15da26Smrg  msdosdjgpp*)
27163c15da26Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
27173c15da26Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
27183c15da26Smrg    # during glob expansion).  Even if it were fixed, the result of this
27193c15da26Smrg    # check would be larger than it should be.
27203c15da26Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
27213c15da26Smrg    ;;
2722126a8a12Smrg
27233c15da26Smrg  gnu*)
27243c15da26Smrg    # Under GNU Hurd, this test is not required because there is
27253c15da26Smrg    # no limit to the length of command line arguments.
27263c15da26Smrg    # Libtool will interpret -1 as no limit whatsoever
27273c15da26Smrg    lt_cv_sys_max_cmd_len=-1;
27283c15da26Smrg    ;;
2729126a8a12Smrg
27303c15da26Smrg  cygwin* | mingw* | cegcc*)
27313c15da26Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
27323c15da26Smrg    # about 5 minutes as the teststring grows exponentially.
27333c15da26Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
27343c15da26Smrg    # you end up with a "frozen" computer, even though with patience
27353c15da26Smrg    # the test eventually succeeds (with a max line length of 256k).
27363c15da26Smrg    # Instead, let's just punt: use the minimum linelength reported by
27373c15da26Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
27383c15da26Smrg    lt_cv_sys_max_cmd_len=8192;
27393c15da26Smrg    ;;
2740126a8a12Smrg
27413c15da26Smrg  mint*)
27423c15da26Smrg    # On MiNT this can take a long time and run out of memory.
27433c15da26Smrg    lt_cv_sys_max_cmd_len=8192;
27443c15da26Smrg    ;;
2745126a8a12Smrg
27463c15da26Smrg  amigaos*)
27473c15da26Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
27483c15da26Smrg    # So we just punt and use a minimum line length of 8192.
27493c15da26Smrg    lt_cv_sys_max_cmd_len=8192;
27503c15da26Smrg    ;;
2751126a8a12Smrg
27523c15da26Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
27533c15da26Smrg    # This has been around since 386BSD, at least.  Likely further.
27543c15da26Smrg    if test -x /sbin/sysctl; then
27553c15da26Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
27563c15da26Smrg    elif test -x /usr/sbin/sysctl; then
27573c15da26Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
27583c15da26Smrg    else
27593c15da26Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
27603c15da26Smrg    fi
27613c15da26Smrg    # And add a safety zone
27623c15da26Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
27633c15da26Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
27643c15da26Smrg    ;;
2765126a8a12Smrg
27663c15da26Smrg  interix*)
27673c15da26Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
27683c15da26Smrg    lt_cv_sys_max_cmd_len=196608
27693c15da26Smrg    ;;
2770126a8a12Smrg
27713c15da26Smrg  osf*)
27723c15da26Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
27733c15da26Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
27743c15da26Smrg    # nice to cause kernel panics so lets avoid the loop below.
27753c15da26Smrg    # First set a reasonable default.
27763c15da26Smrg    lt_cv_sys_max_cmd_len=16384
27773c15da26Smrg    #
27783c15da26Smrg    if test -x /sbin/sysconfig; then
27793c15da26Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
27803c15da26Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
27813c15da26Smrg      esac
27823c15da26Smrg    fi
27833c15da26Smrg    ;;
27843c15da26Smrg  sco3.2v5*)
27853c15da26Smrg    lt_cv_sys_max_cmd_len=102400
27863c15da26Smrg    ;;
27873c15da26Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
27883c15da26Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
27893c15da26Smrg    if test -n "$kargmax"; then
27903c15da26Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
27913c15da26Smrg    else
27923c15da26Smrg      lt_cv_sys_max_cmd_len=32768
27933c15da26Smrg    fi
27943c15da26Smrg    ;;
27953c15da26Smrg  *)
27963c15da26Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
27973c15da26Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
27983c15da26Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
27993c15da26Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
28003c15da26Smrg    else
28013c15da26Smrg      # Make teststring a little bigger before we do anything with it.
28023c15da26Smrg      # a 1K string should be a reasonable start.
28033c15da26Smrg      for i in 1 2 3 4 5 6 7 8 ; do
28043c15da26Smrg        teststring=$teststring$teststring
28053c15da26Smrg      done
28063c15da26Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
28073c15da26Smrg      # If test is not a shell built-in, we'll probably end up computing a
28083c15da26Smrg      # maximum length that is only half of the actual maximum length, but
28093c15da26Smrg      # we can't tell.
28103c15da26Smrg      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
28113c15da26Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
28123c15da26Smrg	      test $i != 17 # 1/2 MB should be enough
28133c15da26Smrg      do
28143c15da26Smrg        i=`expr $i + 1`
28153c15da26Smrg        teststring=$teststring$teststring
28163c15da26Smrg      done
28173c15da26Smrg      # Only check the string length outside the loop.
28183c15da26Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
28193c15da26Smrg      teststring=
28203c15da26Smrg      # Add a significant safety factor because C++ compilers can tack on
28213c15da26Smrg      # massive amounts of additional arguments before passing them to the
28223c15da26Smrg      # linker.  It appears as though 1/2 is a usable value.
28233c15da26Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
28243c15da26Smrg    fi
28253c15da26Smrg    ;;
28263c15da26Smrg  esac
28273c15da26Smrg])
28283c15da26Smrgif test -n $lt_cv_sys_max_cmd_len ; then
28293c15da26Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
28303c15da26Smrgelse
28313c15da26Smrg  AC_MSG_RESULT(none)
28323c15da26Smrgfi
28333c15da26Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
28343c15da26Smrg_LT_DECL([], [max_cmd_len], [0],
28353c15da26Smrg    [What is the maximum length of a command?])
28363c15da26Smrg])# LT_CMD_MAX_LEN
2837126a8a12Smrg
28383c15da26Smrg# Old name:
28393c15da26SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2840555991fdSmrgdnl aclocal-1.4 backwards compatibility:
28413c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2842126a8a12Smrg
2843126a8a12Smrg
28443c15da26Smrg# _LT_HEADER_DLFCN
2845555991fdSmrg# ----------------
28463c15da26Smrgm4_defun([_LT_HEADER_DLFCN],
28473c15da26Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
28483c15da26Smrg])# _LT_HEADER_DLFCN
2849555991fdSmrg
2850555991fdSmrg
28513c15da26Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
28523c15da26Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
28533c15da26Smrg# ----------------------------------------------------------------
28543c15da26Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
28553c15da26Smrg[m4_require([_LT_HEADER_DLFCN])dnl
28563c15da26Smrgif test "$cross_compiling" = yes; then :
28573c15da26Smrg  [$4]
28583c15da26Smrgelse
28593c15da26Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
28603c15da26Smrg  lt_status=$lt_dlunknown
28613c15da26Smrg  cat > conftest.$ac_ext <<_LT_EOF
28623c15da26Smrg[#line $LINENO "configure"
28633c15da26Smrg#include "confdefs.h"
2864555991fdSmrg
28653c15da26Smrg#if HAVE_DLFCN_H
28663c15da26Smrg#include <dlfcn.h>
28673c15da26Smrg#endif
2868555991fdSmrg
28693c15da26Smrg#include <stdio.h>
2870555991fdSmrg
28713c15da26Smrg#ifdef RTLD_GLOBAL
28723c15da26Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
28733c15da26Smrg#else
28743c15da26Smrg#  ifdef DL_GLOBAL
28753c15da26Smrg#    define LT_DLGLOBAL		DL_GLOBAL
28763c15da26Smrg#  else
28773c15da26Smrg#    define LT_DLGLOBAL		0
28783c15da26Smrg#  endif
28793c15da26Smrg#endif
2880555991fdSmrg
28813c15da26Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
28823c15da26Smrg   find out it does not work in some platform. */
28833c15da26Smrg#ifndef LT_DLLAZY_OR_NOW
28843c15da26Smrg#  ifdef RTLD_LAZY
28853c15da26Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
28863c15da26Smrg#  else
28873c15da26Smrg#    ifdef DL_LAZY
28883c15da26Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
28893c15da26Smrg#    else
28903c15da26Smrg#      ifdef RTLD_NOW
28913c15da26Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
28923c15da26Smrg#      else
28933c15da26Smrg#        ifdef DL_NOW
28943c15da26Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
28953c15da26Smrg#        else
28963c15da26Smrg#          define LT_DLLAZY_OR_NOW	0
28973c15da26Smrg#        endif
28983c15da26Smrg#      endif
28993c15da26Smrg#    endif
29003c15da26Smrg#  endif
29013c15da26Smrg#endif
2902555991fdSmrg
29033c15da26Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
29043c15da26Smrg   correspondingly for the symbols needed.  */
29053c15da26Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
29063c15da26Smrgint fnord () __attribute__((visibility("default")));
29073c15da26Smrg#endif
2908126a8a12Smrg
29093c15da26Smrgint fnord () { return 42; }
29103c15da26Smrgint main ()
29113c15da26Smrg{
29123c15da26Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
29133c15da26Smrg  int status = $lt_dlunknown;
2914126a8a12Smrg
29153c15da26Smrg  if (self)
29163c15da26Smrg    {
29173c15da26Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
29183c15da26Smrg      else
29193c15da26Smrg        {
29203c15da26Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
29213c15da26Smrg          else puts (dlerror ());
29223c15da26Smrg	}
29233c15da26Smrg      /* dlclose (self); */
29243c15da26Smrg    }
2925555991fdSmrg  else
29263c15da26Smrg    puts (dlerror ());
29273c15da26Smrg
29283c15da26Smrg  return status;
29293c15da26Smrg}]
29303c15da26Smrg_LT_EOF
29313c15da26Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
29323c15da26Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
29333c15da26Smrg    lt_status=$?
29343c15da26Smrg    case x$lt_status in
29353c15da26Smrg      x$lt_dlno_uscore) $1 ;;
29363c15da26Smrg      x$lt_dlneed_uscore) $2 ;;
29373c15da26Smrg      x$lt_dlunknown|x*) $3 ;;
29383c15da26Smrg    esac
29393c15da26Smrg  else :
29403c15da26Smrg    # compilation failed
29413c15da26Smrg    $3
2942555991fdSmrg  fi
29433c15da26Smrgfi
29443c15da26Smrgrm -fr conftest*
29453c15da26Smrg])# _LT_TRY_DLOPEN_SELF
2946126a8a12Smrg
2947126a8a12Smrg
29483c15da26Smrg# LT_SYS_DLOPEN_SELF
29493c15da26Smrg# ------------------
29503c15da26SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
29513c15da26Smrg[m4_require([_LT_HEADER_DLFCN])dnl
29523c15da26Smrgif test "x$enable_dlopen" != xyes; then
29533c15da26Smrg  enable_dlopen=unknown
29543c15da26Smrg  enable_dlopen_self=unknown
29553c15da26Smrg  enable_dlopen_self_static=unknown
29563c15da26Smrgelse
29573c15da26Smrg  lt_cv_dlopen=no
29583c15da26Smrg  lt_cv_dlopen_libs=
2959126a8a12Smrg
29603c15da26Smrg  case $host_os in
29613c15da26Smrg  beos*)
29623c15da26Smrg    lt_cv_dlopen="load_add_on"
29633c15da26Smrg    lt_cv_dlopen_libs=
29643c15da26Smrg    lt_cv_dlopen_self=yes
29653c15da26Smrg    ;;
2966126a8a12Smrg
29673c15da26Smrg  mingw* | pw32* | cegcc*)
29683c15da26Smrg    lt_cv_dlopen="LoadLibrary"
29693c15da26Smrg    lt_cv_dlopen_libs=
29703c15da26Smrg    ;;
2971555991fdSmrg
29723c15da26Smrg  cygwin*)
29733c15da26Smrg    lt_cv_dlopen="dlopen"
29743c15da26Smrg    lt_cv_dlopen_libs=
29753c15da26Smrg    ;;
2976555991fdSmrg
29773c15da26Smrg  darwin*)
29783c15da26Smrg  # if libdl is installed we need to link against it
29793c15da26Smrg    AC_CHECK_LIB([dl], [dlopen],
29803c15da26Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
29813c15da26Smrg    lt_cv_dlopen="dyld"
29823c15da26Smrg    lt_cv_dlopen_libs=
29833c15da26Smrg    lt_cv_dlopen_self=yes
29843c15da26Smrg    ])
29853c15da26Smrg    ;;
2986555991fdSmrg
29873c15da26Smrg  *)
29883c15da26Smrg    AC_CHECK_FUNC([shl_load],
29893c15da26Smrg	  [lt_cv_dlopen="shl_load"],
29903c15da26Smrg      [AC_CHECK_LIB([dld], [shl_load],
29913c15da26Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
29923c15da26Smrg	[AC_CHECK_FUNC([dlopen],
29933c15da26Smrg	      [lt_cv_dlopen="dlopen"],
29943c15da26Smrg	  [AC_CHECK_LIB([dl], [dlopen],
29953c15da26Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
29963c15da26Smrg	    [AC_CHECK_LIB([svld], [dlopen],
29973c15da26Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
29983c15da26Smrg	      [AC_CHECK_LIB([dld], [dld_link],
29993c15da26Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
30003c15da26Smrg	      ])
30013c15da26Smrg	    ])
30023c15da26Smrg	  ])
30033c15da26Smrg	])
30043c15da26Smrg      ])
30053c15da26Smrg    ;;
30063c15da26Smrg  esac
3007555991fdSmrg
30083c15da26Smrg  if test "x$lt_cv_dlopen" != xno; then
30093c15da26Smrg    enable_dlopen=yes
30103c15da26Smrg  else
30113c15da26Smrg    enable_dlopen=no
30123c15da26Smrg  fi
3013555991fdSmrg
30143c15da26Smrg  case $lt_cv_dlopen in
30153c15da26Smrg  dlopen)
30163c15da26Smrg    save_CPPFLAGS="$CPPFLAGS"
30173c15da26Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
3018555991fdSmrg
30193c15da26Smrg    save_LDFLAGS="$LDFLAGS"
30203c15da26Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
3021555991fdSmrg
30223c15da26Smrg    save_LIBS="$LIBS"
30233c15da26Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
3024555991fdSmrg
30253c15da26Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
30263c15da26Smrg	  lt_cv_dlopen_self, [dnl
30273c15da26Smrg	  _LT_TRY_DLOPEN_SELF(
30283c15da26Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
30293c15da26Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
30303c15da26Smrg    ])
3031555991fdSmrg
30323c15da26Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
30333c15da26Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
30343c15da26Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
30353c15da26Smrg	  lt_cv_dlopen_self_static, [dnl
30363c15da26Smrg	  _LT_TRY_DLOPEN_SELF(
30373c15da26Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
30383c15da26Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
30393c15da26Smrg      ])
3040555991fdSmrg    fi
3041555991fdSmrg
30423c15da26Smrg    CPPFLAGS="$save_CPPFLAGS"
30433c15da26Smrg    LDFLAGS="$save_LDFLAGS"
30443c15da26Smrg    LIBS="$save_LIBS"
30453c15da26Smrg    ;;
30463c15da26Smrg  esac
3047555991fdSmrg
30483c15da26Smrg  case $lt_cv_dlopen_self in
30493c15da26Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
30503c15da26Smrg  *) enable_dlopen_self=unknown ;;
30513c15da26Smrg  esac
3052126a8a12Smrg
30533c15da26Smrg  case $lt_cv_dlopen_self_static in
30543c15da26Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
30553c15da26Smrg  *) enable_dlopen_self_static=unknown ;;
30563c15da26Smrg  esac
30573c15da26Smrgfi
30583c15da26Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
30593c15da26Smrg	 [Whether dlopen is supported])
30603c15da26Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
30613c15da26Smrg	 [Whether dlopen of programs is supported])
30623c15da26Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
30633c15da26Smrg	 [Whether dlopen of statically linked programs is supported])
30643c15da26Smrg])# LT_SYS_DLOPEN_SELF
3065126a8a12Smrg
30663c15da26Smrg# Old name:
30673c15da26SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
30683c15da26Smrgdnl aclocal-1.4 backwards compatibility:
30693c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
3070126a8a12Smrg
3071126a8a12Smrg
30723c15da26Smrg# _LT_COMPILER_C_O([TAGNAME])
30733c15da26Smrg# ---------------------------
30743c15da26Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
30753c15da26Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
30763c15da26Smrgm4_defun([_LT_COMPILER_C_O],
30773c15da26Smrg[m4_require([_LT_DECL_SED])dnl
30783c15da26Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
30793c15da26Smrgm4_require([_LT_TAG_COMPILER])dnl
30803c15da26SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
30813c15da26Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
30823c15da26Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
30833c15da26Smrg   $RM -r conftest 2>/dev/null
30843c15da26Smrg   mkdir conftest
30853c15da26Smrg   cd conftest
30863c15da26Smrg   mkdir out
3087555991fdSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
30883c15da26Smrg
30893c15da26Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
3090555991fdSmrg   # Insert the option either (1) after the last *FLAGS variable, or
3091555991fdSmrg   # (2) before a word containing "conftest.", or (3) at the end.
3092555991fdSmrg   # Note that $ac_compile itself does not contain backslashes and begins
3093555991fdSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
3094555991fdSmrg   lt_compile=`echo "$ac_compile" | $SED \
3095555991fdSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3096555991fdSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3097555991fdSmrg   -e 's:$: $lt_compiler_flag:'`
3098555991fdSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
30993c15da26Smrg   (eval "$lt_compile" 2>out/conftest.err)
3100555991fdSmrg   ac_status=$?
31013c15da26Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3102555991fdSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
31033c15da26Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
31043c15da26Smrg   then
3105555991fdSmrg     # The compiler can only warn and ignore the option if not recognized
31063c15da26Smrg     # So say no if there are warnings
31073c15da26Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
31083c15da26Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
31093c15da26Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
31103c15da26Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3111555991fdSmrg     fi
3112555991fdSmrg   fi
31133c15da26Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
31143c15da26Smrg   $RM conftest*
31153c15da26Smrg   # SGI C++ compiler will create directory out/ii_files/ for
31163c15da26Smrg   # template instantiation
31173c15da26Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
31183c15da26Smrg   $RM out/* && rmdir out
31193c15da26Smrg   cd ..
31203c15da26Smrg   $RM -r conftest
3121555991fdSmrg   $RM conftest*
3122555991fdSmrg])
31233c15da26Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
31243c15da26Smrg	[Does compiler simultaneously support -c and -o options?])
31253c15da26Smrg])# _LT_COMPILER_C_O
3126126a8a12Smrg
3127126a8a12Smrg
31283c15da26Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
31293c15da26Smrg# ----------------------------------
31303c15da26Smrg# Check to see if we can do hard links to lock some files if needed
31313c15da26Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
31323c15da26Smrg[m4_require([_LT_ENABLE_LOCK])dnl
31333c15da26Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
31343c15da26Smrg_LT_COMPILER_C_O([$1])
3135126a8a12Smrg
31363c15da26Smrghard_links="nottested"
31373c15da26Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
31383c15da26Smrg  # do not overwrite the value of need_locks provided by the user
31393c15da26Smrg  AC_MSG_CHECKING([if we can lock with hard links])
31403c15da26Smrg  hard_links=yes
31413c15da26Smrg  $RM conftest*
31423c15da26Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
31433c15da26Smrg  touch conftest.a
31443c15da26Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
31453c15da26Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
31463c15da26Smrg  AC_MSG_RESULT([$hard_links])
31473c15da26Smrg  if test "$hard_links" = no; then
31483c15da26Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
31493c15da26Smrg    need_locks=warn
31503c15da26Smrg  fi
31513c15da26Smrgelse
31523c15da26Smrg  need_locks=no
31533c15da26Smrgfi
31543c15da26Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
31553c15da26Smrg])# _LT_COMPILER_FILE_LOCKS
3156126a8a12Smrg
3157126a8a12Smrg
31583c15da26Smrg# _LT_CHECK_OBJDIR
31593c15da26Smrg# ----------------
31603c15da26Smrgm4_defun([_LT_CHECK_OBJDIR],
31613c15da26Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
31623c15da26Smrg[rm -f .libs 2>/dev/null
31633c15da26Smrgmkdir .libs 2>/dev/null
31643c15da26Smrgif test -d .libs; then
31653c15da26Smrg  lt_cv_objdir=.libs
3166555991fdSmrgelse
31673c15da26Smrg  # MS-DOS does not allow filenames that begin with a dot.
31683c15da26Smrg  lt_cv_objdir=_libs
3169555991fdSmrgfi
31703c15da26Smrgrmdir .libs 2>/dev/null])
31713c15da26Smrgobjdir=$lt_cv_objdir
31723c15da26Smrg_LT_DECL([], [objdir], [0],
31733c15da26Smrg         [The name of the directory that contains temporary libtool files])dnl
31743c15da26Smrgm4_pattern_allow([LT_OBJDIR])dnl
31753c15da26SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
31763c15da26Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
31773c15da26Smrg])# _LT_CHECK_OBJDIR
3178126a8a12Smrg
3179126a8a12Smrg
31803c15da26Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
31813c15da26Smrg# --------------------------------------
31823c15da26Smrg# Check hardcoding attributes.
31833c15da26Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
31843c15da26Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
31853c15da26Smrg_LT_TAGVAR(hardcode_action, $1)=
31863c15da26Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
31873c15da26Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
31883c15da26Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3189126a8a12Smrg
31903c15da26Smrg  # We can hardcode non-existent directories.
31913c15da26Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
31923c15da26Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
31933c15da26Smrg     # have to relink, otherwise we might link with an installed library
31943c15da26Smrg     # when we should be linking with a yet-to-be-installed one
31953c15da26Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
31963c15da26Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
31973c15da26Smrg    # Linking always hardcodes the temporary library directory.
31983c15da26Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
31993c15da26Smrg  else
32003c15da26Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
32013c15da26Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
32023c15da26Smrg  fi
32033c15da26Smrgelse
32043c15da26Smrg  # We cannot hardcode anything, or else we can only hardcode existing
32053c15da26Smrg  # directories.
32063c15da26Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
32073c15da26Smrgfi
32083c15da26SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3209126a8a12Smrg
32103c15da26Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
32113c15da26Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
32123c15da26Smrg  # Fast installation is not supported
32133c15da26Smrg  enable_fast_install=no
32143c15da26Smrgelif test "$shlibpath_overrides_runpath" = yes ||
32153c15da26Smrg     test "$enable_shared" = no; then
32163c15da26Smrg  # Fast installation is not necessary
32173c15da26Smrg  enable_fast_install=needless
32183c15da26Smrgfi
32193c15da26Smrg_LT_TAGDECL([], [hardcode_action], [0],
32203c15da26Smrg    [How to hardcode a shared library path into an executable])
32213c15da26Smrg])# _LT_LINKER_HARDCODE_LIBPATH
3222126a8a12Smrg
3223126a8a12Smrg
32243c15da26Smrg# _LT_CMD_STRIPLIB
32253c15da26Smrg# ----------------
32263c15da26Smrgm4_defun([_LT_CMD_STRIPLIB],
32273c15da26Smrg[m4_require([_LT_DECL_EGREP])
32283c15da26Smrgstriplib=
32293c15da26Smrgold_striplib=
32303c15da26SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
32313c15da26Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
32323c15da26Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
32333c15da26Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
32343c15da26Smrg  AC_MSG_RESULT([yes])
32353c15da26Smrgelse
32363c15da26Smrg# FIXME - insert some real tests, host_os isn't really good enough
32373c15da26Smrg  case $host_os in
32383c15da26Smrg  darwin*)
32393c15da26Smrg    if test -n "$STRIP" ; then
32403c15da26Smrg      striplib="$STRIP -x"
32413c15da26Smrg      old_striplib="$STRIP -S"
32423c15da26Smrg      AC_MSG_RESULT([yes])
3243555991fdSmrg    else
32443c15da26Smrg      AC_MSG_RESULT([no])
3245555991fdSmrg    fi
3246555991fdSmrg    ;;
32473c15da26Smrg  *)
32483c15da26Smrg    AC_MSG_RESULT([no])
3249555991fdSmrg    ;;
32503c15da26Smrg  esac
32513c15da26Smrgfi
32523c15da26Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
32533c15da26Smrg_LT_DECL([], [striplib], [1])
32543c15da26Smrg])# _LT_CMD_STRIPLIB
3255d656433aSmrg
32563c15da26Smrg
32573c15da26Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
32583c15da26Smrg# -----------------------------
32593c15da26Smrg# PORTME Fill in your ld.so characteristics
32603c15da26Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
32613c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
32623c15da26Smrgm4_require([_LT_DECL_EGREP])dnl
32633c15da26Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
32643c15da26Smrgm4_require([_LT_DECL_OBJDUMP])dnl
32653c15da26Smrgm4_require([_LT_DECL_SED])dnl
32663c15da26Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
32673c15da26SmrgAC_MSG_CHECKING([dynamic linker characteristics])
32683c15da26Smrgm4_if([$1],
32693c15da26Smrg	[], [
32703c15da26Smrgif test "$GCC" = yes; then
32713c15da26Smrg  case $host_os in
32723c15da26Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
32733c15da26Smrg    *) lt_awk_arg="/^libraries:/" ;;
32743c15da26Smrg  esac
32753c15da26Smrg  case $host_os in
32763c15da26Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
32773c15da26Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
32783c15da26Smrg  esac
32793c15da26Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
32803c15da26Smrg  case $lt_search_path_spec in
32813c15da26Smrg  *\;*)
32823c15da26Smrg    # if the path contains ";" then we assume it to be the separator
32833c15da26Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
32843c15da26Smrg    # assumed that no part of a normal pathname contains ";" but that should
32853c15da26Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
32863c15da26Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3287d656433aSmrg    ;;
3288d656433aSmrg  *)
32893c15da26Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
32903c15da26Smrg    ;;
32913c15da26Smrg  esac
32923c15da26Smrg  # Ok, now we have the path, separated by spaces, we can step through it
32933c15da26Smrg  # and add multilib dir if necessary.
32943c15da26Smrg  lt_tmp_lt_search_path_spec=
32953c15da26Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
32963c15da26Smrg  for lt_sys_path in $lt_search_path_spec; do
32973c15da26Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
32983c15da26Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3299555991fdSmrg    else
33003c15da26Smrg      test -d "$lt_sys_path" && \
33013c15da26Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3302555991fdSmrg    fi
33033c15da26Smrg  done
33043c15da26Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
33053c15da26SmrgBEGIN {RS=" "; FS="/|\n";} {
33063c15da26Smrg  lt_foo="";
33073c15da26Smrg  lt_count=0;
33083c15da26Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
33093c15da26Smrg    if ($lt_i != "" && $lt_i != ".") {
33103c15da26Smrg      if ($lt_i == "..") {
33113c15da26Smrg        lt_count++;
33123c15da26Smrg      } else {
33133c15da26Smrg        if (lt_count == 0) {
33143c15da26Smrg          lt_foo="/" $lt_i lt_foo;
33153c15da26Smrg        } else {
33163c15da26Smrg          lt_count--;
33173c15da26Smrg        }
33183c15da26Smrg      }
33193c15da26Smrg    }
33203c15da26Smrg  }
33213c15da26Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
33223c15da26Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
33233c15da26Smrg}'`
33243c15da26Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
33253c15da26Smrg  # for these hosts.
33263c15da26Smrg  case $host_os in
33273c15da26Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
33283c15da26Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3329d656433aSmrg  esac
33303c15da26Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3331555991fdSmrgelse
33323c15da26Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
33333c15da26Smrgfi])
33343c15da26Smrglibrary_names_spec=
33353c15da26Smrglibname_spec='lib$name'
33363c15da26Smrgsoname_spec=
33373c15da26Smrgshrext_cmds=".so"
33383c15da26Smrgpostinstall_cmds=
33393c15da26Smrgpostuninstall_cmds=
33403c15da26Smrgfinish_cmds=
33413c15da26Smrgfinish_eval=
33423c15da26Smrgshlibpath_var=
33433c15da26Smrgshlibpath_overrides_runpath=unknown
33443c15da26Smrgversion_type=none
33453c15da26Smrgdynamic_linker="$host_os ld.so"
33463c15da26Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
33473c15da26Smrgneed_lib_prefix=unknown
33483c15da26Smrghardcode_into_libs=no
3349126a8a12Smrg
33503c15da26Smrg# when you set need_version to no, make sure it does not cause -set_version
33513c15da26Smrg# flags to be left without arguments
33523c15da26Smrgneed_version=unknown
3353126a8a12Smrg
33543c15da26Smrgcase $host_os in
33553c15da26Smrgaix3*)
33563c15da26Smrg  version_type=linux
33573c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
33583c15da26Smrg  shlibpath_var=LIBPATH
3359126a8a12Smrg
33603c15da26Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
33613c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
33623c15da26Smrg  ;;
3363126a8a12Smrg
33643c15da26Smrgaix[[4-9]]*)
33653c15da26Smrg  version_type=linux
33663c15da26Smrg  need_lib_prefix=no
33673c15da26Smrg  need_version=no
33683c15da26Smrg  hardcode_into_libs=yes
33693c15da26Smrg  if test "$host_cpu" = ia64; then
33703c15da26Smrg    # AIX 5 supports IA64
33713c15da26Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
33723c15da26Smrg    shlibpath_var=LD_LIBRARY_PATH
3373555991fdSmrg  else
33743c15da26Smrg    # With GCC up to 2.95.x, collect2 would create an import file
33753c15da26Smrg    # for dependence libraries.  The import file would start with
33763c15da26Smrg    # the line `#! .'.  This would cause the generated library to
33773c15da26Smrg    # depend on `.', always an invalid library.  This was fixed in
33783c15da26Smrg    # development snapshots of GCC prior to 3.0.
33793c15da26Smrg    case $host_os in
33803c15da26Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
33813c15da26Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
33823c15da26Smrg	   echo ' yes '
33833c15da26Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
33843c15da26Smrg	:
33853c15da26Smrg      else
33863c15da26Smrg	can_build_shared=no
33873c15da26Smrg      fi
33883c15da26Smrg      ;;
3389555991fdSmrg    esac
33903c15da26Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
33913c15da26Smrg    # soname into executable. Probably we can add versioning support to
33923c15da26Smrg    # collect2, so additional links can be useful in future.
33933c15da26Smrg    if test "$aix_use_runtimelinking" = yes; then
33943c15da26Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
33953c15da26Smrg      # instead of lib<name>.a to let people know that these are not
33963c15da26Smrg      # typical AIX shared libraries.
33973c15da26Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
33983c15da26Smrg    else
33993c15da26Smrg      # We preserve .a as extension for shared libraries through AIX4.2
34003c15da26Smrg      # and later when we are not doing run time linking.
34013c15da26Smrg      library_names_spec='${libname}${release}.a $libname.a'
34023c15da26Smrg      soname_spec='${libname}${release}${shared_ext}$major'
34033c15da26Smrg    fi
34043c15da26Smrg    shlibpath_var=LIBPATH
3405555991fdSmrg  fi
34063c15da26Smrg  ;;
3407126a8a12Smrg
34083c15da26Smrgamigaos*)
34093c15da26Smrg  case $host_cpu in
34103c15da26Smrg  powerpc)
34113c15da26Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
34123c15da26Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
34133c15da26Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
34143c15da26Smrg    ;;
34153c15da26Smrg  m68k)
34163c15da26Smrg    library_names_spec='$libname.ixlibrary $libname.a'
34173c15da26Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
34183c15da26Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
34193c15da26Smrg    ;;
34203c15da26Smrg  esac
34213c15da26Smrg  ;;
3422126a8a12Smrg
34233c15da26Smrgbeos*)
34243c15da26Smrg  library_names_spec='${libname}${shared_ext}'
34253c15da26Smrg  dynamic_linker="$host_os ld.so"
34263c15da26Smrg  shlibpath_var=LIBRARY_PATH
34273c15da26Smrg  ;;
3428126a8a12Smrg
34293c15da26Smrgbsdi[[45]]*)
34303c15da26Smrg  version_type=linux
34313c15da26Smrg  need_version=no
34323c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
34333c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
34343c15da26Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
34353c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
34363c15da26Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
34373c15da26Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
34383c15da26Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
34393c15da26Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
34403c15da26Smrg  # libtool to hard-code these into programs
34413c15da26Smrg  ;;
3442126a8a12Smrg
34433c15da26Smrgcygwin* | mingw* | pw32* | cegcc*)
34443c15da26Smrg  version_type=windows
34453c15da26Smrg  shrext_cmds=".dll"
34463c15da26Smrg  need_version=no
34473c15da26Smrg  need_lib_prefix=no
3448126a8a12Smrg
34493c15da26Smrg  case $GCC,$cc_basename in
34503c15da26Smrg  yes,*)
34513c15da26Smrg    # gcc
34523c15da26Smrg    library_names_spec='$libname.dll.a'
34533c15da26Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
34543c15da26Smrg    postinstall_cmds='base_file=`basename \${file}`~
34553c15da26Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
34563c15da26Smrg      dldir=$destdir/`dirname \$dlpath`~
34573c15da26Smrg      test -d \$dldir || mkdir -p \$dldir~
34583c15da26Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
34593c15da26Smrg      chmod a+x \$dldir/$dlname~
34603c15da26Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
34613c15da26Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
34623c15da26Smrg      fi'
34633c15da26Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
34643c15da26Smrg      dlpath=$dir/\$dldll~
34653c15da26Smrg       $RM \$dlpath'
34663c15da26Smrg    shlibpath_overrides_runpath=yes
34673c15da26Smrg
34683c15da26Smrg    case $host_os in
34693c15da26Smrg    cygwin*)
34703c15da26Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
34713c15da26Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34723c15da26Smrgm4_if([$1], [],[
34733c15da26Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
34743c15da26Smrg      ;;
34753c15da26Smrg    mingw* | cegcc*)
34763c15da26Smrg      # MinGW DLLs use traditional 'lib' prefix
34773c15da26Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34783c15da26Smrg      ;;
34793c15da26Smrg    pw32*)
34803c15da26Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
34813c15da26Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34823c15da26Smrg      ;;
34833c15da26Smrg    esac
34843c15da26Smrg    dynamic_linker='Win32 ld.exe'
3485555991fdSmrg    ;;
3486126a8a12Smrg
34873c15da26Smrg  *,cl*)
34883c15da26Smrg    # Native MSVC
34893c15da26Smrg    libname_spec='$name'
34903c15da26Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34913c15da26Smrg    library_names_spec='${libname}.dll.lib'
34923c15da26Smrg
34933c15da26Smrg    case $build_os in
34943c15da26Smrg    mingw*)
34953c15da26Smrg      sys_lib_search_path_spec=
34963c15da26Smrg      lt_save_ifs=$IFS
34973c15da26Smrg      IFS=';'
34983c15da26Smrg      for lt_path in $LIB
34993c15da26Smrg      do
35003c15da26Smrg        IFS=$lt_save_ifs
35013c15da26Smrg        # Let DOS variable expansion print the short 8.3 style file name.
35023c15da26Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
35033c15da26Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
35043c15da26Smrg      done
35053c15da26Smrg      IFS=$lt_save_ifs
35063c15da26Smrg      # Convert to MSYS style.
35073c15da26Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
35083c15da26Smrg      ;;
35093c15da26Smrg    cygwin*)
35103c15da26Smrg      # Convert to unix form, then to dos form, then back to unix form
35113c15da26Smrg      # but this time dos style (no spaces!) so that the unix form looks
35123c15da26Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
35133c15da26Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
35143c15da26Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
35153c15da26Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
35163c15da26Smrg      ;;
35173c15da26Smrg    *)
35183c15da26Smrg      sys_lib_search_path_spec="$LIB"
35193c15da26Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
35203c15da26Smrg        # It is most probably a Windows format PATH.
35213c15da26Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
35223c15da26Smrg      else
35233c15da26Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
35243c15da26Smrg      fi
35253c15da26Smrg      # FIXME: find the short name or the path components, as spaces are
35263c15da26Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
35273c15da26Smrg      ;;
35283c15da26Smrg    esac
35293c15da26Smrg
35303c15da26Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
35313c15da26Smrg    postinstall_cmds='base_file=`basename \${file}`~
35323c15da26Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
35333c15da26Smrg      dldir=$destdir/`dirname \$dlpath`~
35343c15da26Smrg      test -d \$dldir || mkdir -p \$dldir~
35353c15da26Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
35363c15da26Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
35373c15da26Smrg      dlpath=$dir/\$dldll~
35383c15da26Smrg       $RM \$dlpath'
35393c15da26Smrg    shlibpath_overrides_runpath=yes
35403c15da26Smrg    dynamic_linker='Win32 link.exe'
3541555991fdSmrg    ;;
3542126a8a12Smrg
3543555991fdSmrg  *)
35443c15da26Smrg    # Assume MSVC wrapper
35453c15da26Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
35463c15da26Smrg    dynamic_linker='Win32 ld.exe'
3547555991fdSmrg    ;;
3548555991fdSmrg  esac
35493c15da26Smrg  # FIXME: first we should search . and the directory the executable is in
35503c15da26Smrg  shlibpath_var=PATH
35513c15da26Smrg  ;;
3552126a8a12Smrg
35533c15da26Smrgdarwin* | rhapsody*)
35543c15da26Smrg  dynamic_linker="$host_os dyld"
35553c15da26Smrg  version_type=darwin
35563c15da26Smrg  need_lib_prefix=no
35573c15da26Smrg  need_version=no
35583c15da26Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
35593c15da26Smrg  soname_spec='${libname}${release}${major}$shared_ext'
35603c15da26Smrg  shlibpath_overrides_runpath=yes
35613c15da26Smrg  shlibpath_var=DYLD_LIBRARY_PATH
35623c15da26Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
35633c15da26Smrgm4_if([$1], [],[
35643c15da26Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
35653c15da26Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
35663c15da26Smrg  ;;
3567126a8a12Smrg
35683c15da26Smrgdgux*)
35693c15da26Smrg  version_type=linux
35703c15da26Smrg  need_lib_prefix=no
35713c15da26Smrg  need_version=no
35723c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
35733c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
35743c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
35753c15da26Smrg  ;;
3576126a8a12Smrg
35773c15da26Smrgfreebsd1*)
35783c15da26Smrg  dynamic_linker=no
35793c15da26Smrg  ;;
3580126a8a12Smrg
35813c15da26Smrgfreebsd* | dragonfly*)
35823c15da26Smrg  # DragonFly does not have aout.  When/if they implement a new
35833c15da26Smrg  # versioning mechanism, adjust this.
35843c15da26Smrg  if test -x /usr/bin/objformat; then
35853c15da26Smrg    objformat=`/usr/bin/objformat`
35863c15da26Smrg  else
35873c15da26Smrg    case $host_os in
35883c15da26Smrg    freebsd[[123]]*) objformat=aout ;;
35893c15da26Smrg    *) objformat=elf ;;
35903c15da26Smrg    esac
35913c15da26Smrg  fi
35923c15da26Smrg  version_type=freebsd-$objformat
35933c15da26Smrg  case $version_type in
35943c15da26Smrg    freebsd-elf*)
35953c15da26Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
35963c15da26Smrg      need_version=no
35973c15da26Smrg      need_lib_prefix=no
35983c15da26Smrg      ;;
35993c15da26Smrg    freebsd-*)
36003c15da26Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
36013c15da26Smrg      need_version=yes
36023c15da26Smrg      ;;
36033c15da26Smrg  esac
36043c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
36053c15da26Smrg  case $host_os in
36063c15da26Smrg  freebsd2*)
36073c15da26Smrg    shlibpath_overrides_runpath=yes
36083c15da26Smrg    ;;
36093c15da26Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
36103c15da26Smrg    shlibpath_overrides_runpath=yes
36113c15da26Smrg    hardcode_into_libs=yes
36123c15da26Smrg    ;;
36133c15da26Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
36143c15da26Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
36153c15da26Smrg    shlibpath_overrides_runpath=no
36163c15da26Smrg    hardcode_into_libs=yes
36173c15da26Smrg    ;;
36183c15da26Smrg  *) # from 4.6 on, and DragonFly
36193c15da26Smrg    shlibpath_overrides_runpath=yes
36203c15da26Smrg    hardcode_into_libs=yes
36213c15da26Smrg    ;;
36223c15da26Smrg  esac
36233c15da26Smrg  ;;
3624126a8a12Smrg
36253c15da26Smrggnu*)
36263c15da26Smrg  version_type=linux
36273c15da26Smrg  need_lib_prefix=no
36283c15da26Smrg  need_version=no
36293c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
36303c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
36313c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
36323c15da26Smrg  hardcode_into_libs=yes
36333c15da26Smrg  ;;
3634126a8a12Smrg
36353c15da26Smrghaiku*)
36363c15da26Smrg  version_type=linux
36373c15da26Smrg  need_lib_prefix=no
36383c15da26Smrg  need_version=no
36393c15da26Smrg  dynamic_linker="$host_os runtime_loader"
36403c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
36413c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
36423c15da26Smrg  shlibpath_var=LIBRARY_PATH
36433c15da26Smrg  shlibpath_overrides_runpath=yes
36443c15da26Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
36453c15da26Smrg  hardcode_into_libs=yes
36463c15da26Smrg  ;;
3647126a8a12Smrg
36483c15da26Smrghpux9* | hpux10* | hpux11*)
36493c15da26Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
36503c15da26Smrg  # link against other versions.
36513c15da26Smrg  version_type=sunos
36523c15da26Smrg  need_lib_prefix=no
36533c15da26Smrg  need_version=no
36543c15da26Smrg  case $host_cpu in
36553c15da26Smrg  ia64*)
36563c15da26Smrg    shrext_cmds='.so'
36573c15da26Smrg    hardcode_into_libs=yes
36583c15da26Smrg    dynamic_linker="$host_os dld.so"
36593c15da26Smrg    shlibpath_var=LD_LIBRARY_PATH
36603c15da26Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
36613c15da26Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36623c15da26Smrg    soname_spec='${libname}${release}${shared_ext}$major'
36633c15da26Smrg    if test "X$HPUX_IA64_MODE" = X32; then
36643c15da26Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
36653c15da26Smrg    else
36663c15da26Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
36673c15da26Smrg    fi
36683c15da26Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
36693c15da26Smrg    ;;
36703c15da26Smrg  hppa*64*)
36713c15da26Smrg    shrext_cmds='.sl'
36723c15da26Smrg    hardcode_into_libs=yes
36733c15da26Smrg    dynamic_linker="$host_os dld.sl"
36743c15da26Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
36753c15da26Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
36763c15da26Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36773c15da26Smrg    soname_spec='${libname}${release}${shared_ext}$major'
36783c15da26Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
36793c15da26Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
36803c15da26Smrg    ;;
36813c15da26Smrg  *)
36823c15da26Smrg    shrext_cmds='.sl'
36833c15da26Smrg    dynamic_linker="$host_os dld.sl"
36843c15da26Smrg    shlibpath_var=SHLIB_PATH
36853c15da26Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
36863c15da26Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36873c15da26Smrg    soname_spec='${libname}${release}${shared_ext}$major'
3688555991fdSmrg    ;;
3689555991fdSmrg  esac
36903c15da26Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
36913c15da26Smrg  postinstall_cmds='chmod 555 $lib'
36923c15da26Smrg  # or fails outright, so override atomically:
36933c15da26Smrg  install_override_mode=555
36943c15da26Smrg  ;;
3695126a8a12Smrg
36963c15da26Smrginterix[[3-9]]*)
36973c15da26Smrg  version_type=linux
36983c15da26Smrg  need_lib_prefix=no
36993c15da26Smrg  need_version=no
37003c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
37013c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
37023c15da26Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
37033c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
37043c15da26Smrg  shlibpath_overrides_runpath=no
37053c15da26Smrg  hardcode_into_libs=yes
37063c15da26Smrg  ;;
3707126a8a12Smrg
37083c15da26Smrgirix5* | irix6* | nonstopux*)
37093c15da26Smrg  case $host_os in
37103c15da26Smrg    nonstopux*) version_type=nonstopux ;;
37113c15da26Smrg    *)
37123c15da26Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
37133c15da26Smrg		version_type=linux
37143c15da26Smrg	else
37153c15da26Smrg		version_type=irix
37163c15da26Smrg	fi ;;
3717555991fdSmrg  esac
37183c15da26Smrg  need_lib_prefix=no
37193c15da26Smrg  need_version=no
37203c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
37213c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
37223c15da26Smrg  case $host_os in
37233c15da26Smrg  irix5* | nonstopux*)
37243c15da26Smrg    libsuff= shlibsuff=
37253c15da26Smrg    ;;
37263c15da26Smrg  *)
37273c15da26Smrg    case $LD in # libtool.m4 will add one of these switches to LD
37283c15da26Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
37293c15da26Smrg      libsuff= shlibsuff= libmagic=32-bit;;
37303c15da26Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
37313c15da26Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
37323c15da26Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
37333c15da26Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
37343c15da26Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
37353c15da26Smrg    esac
37363c15da26Smrg    ;;
37373c15da26Smrg  esac
37383c15da26Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
37393c15da26Smrg  shlibpath_overrides_runpath=no
37403c15da26Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
37413c15da26Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
37423c15da26Smrg  hardcode_into_libs=yes
37433c15da26Smrg  ;;
3744126a8a12Smrg
37453c15da26Smrg# No shared lib support for Linux oldld, aout, or coff.
37463c15da26Smrglinux*oldld* | linux*aout* | linux*coff*)
37473c15da26Smrg  dynamic_linker=no
37483c15da26Smrg  ;;
3749126a8a12Smrg
37503c15da26Smrg# This must be Linux ELF.
37513c15da26Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
37523c15da26Smrg  version_type=linux
37533c15da26Smrg  need_lib_prefix=no
37543c15da26Smrg  need_version=no
37553c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37563c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
37573c15da26Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
37583c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
37593c15da26Smrg  shlibpath_overrides_runpath=no
3760126a8a12Smrg
37613c15da26Smrg  # Some binutils ld are patched to set DT_RUNPATH
37623c15da26Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
37633c15da26Smrg    [lt_cv_shlibpath_overrides_runpath=no
37643c15da26Smrg    save_LDFLAGS=$LDFLAGS
37653c15da26Smrg    save_libdir=$libdir
37663c15da26Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
37673c15da26Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
37683c15da26Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
37693c15da26Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
37703c15da26Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
37713c15da26Smrg    LDFLAGS=$save_LDFLAGS
37723c15da26Smrg    libdir=$save_libdir
37733c15da26Smrg    ])
37743c15da26Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3775126a8a12Smrg
37763c15da26Smrg  # This implies no fast_install, which is unacceptable.
37773c15da26Smrg  # Some rework will be needed to allow for fast_install
37783c15da26Smrg  # before this can be enabled.
37793c15da26Smrg  hardcode_into_libs=yes
3780126a8a12Smrg
37813c15da26Smrg  # Append ld.so.conf contents to the search path
37823c15da26Smrg  if test -f /etc/ld.so.conf; then
37833c15da26Smrg    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' ' '`
37843c15da26Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3785555991fdSmrg  fi
3786126a8a12Smrg
37873c15da26Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
37883c15da26Smrg  # powerpc, because MkLinux only supported shared libraries with the
37893c15da26Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
37903c15da26Smrg  # most powerpc-linux boxes support dynamic linking these days and
37913c15da26Smrg  # people can always --disable-shared, the test was removed, and we
37923c15da26Smrg  # assume the GNU/Linux dynamic linker is in use.
37933c15da26Smrg  dynamic_linker='GNU/Linux ld.so'
37943c15da26Smrg  ;;
3795126a8a12Smrg
37963c15da26Smrgnetbsd*)
37973c15da26Smrg  version_type=sunos
37983c15da26Smrg  need_lib_prefix=no
37993c15da26Smrg  need_version=no
38003c15da26Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
38013c15da26Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
38023c15da26Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
38033c15da26Smrg    dynamic_linker='NetBSD (a.out) ld.so'
3804555991fdSmrg  else
38053c15da26Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
38063c15da26Smrg    soname_spec='${libname}${release}${shared_ext}$major'
38073c15da26Smrg    dynamic_linker='NetBSD ld.elf_so'
3808555991fdSmrg  fi
38093c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
38103c15da26Smrg  shlibpath_overrides_runpath=yes
38113c15da26Smrg  hardcode_into_libs=yes
38123c15da26Smrg  ;;
3813126a8a12Smrg
38143c15da26Smrgnewsos6)
38153c15da26Smrg  version_type=linux
38163c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38173c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
38183c15da26Smrg  shlibpath_overrides_runpath=yes
38193c15da26Smrg  ;;
3820126a8a12Smrg
38213c15da26Smrg*nto* | *qnx*)
38223c15da26Smrg  version_type=qnx
38233c15da26Smrg  need_lib_prefix=no
38243c15da26Smrg  need_version=no
38253c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38263c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
38273c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
38283c15da26Smrg  shlibpath_overrides_runpath=no
38293c15da26Smrg  hardcode_into_libs=yes
38303c15da26Smrg  dynamic_linker='ldqnx.so'
38313c15da26Smrg  ;;
3832126a8a12Smrg
38333c15da26Smrgopenbsd*)
38343c15da26Smrg  version_type=sunos
38353c15da26Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
38363c15da26Smrg  need_lib_prefix=no
38373c15da26Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3838555991fdSmrg  case $host_os in
38393c15da26Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
38403c15da26Smrg    *)				need_version=no  ;;
3841555991fdSmrg  esac
38423c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
38433c15da26Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
38443c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
38453c15da26Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
38463c15da26Smrg    case $host_os in
38473c15da26Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
38483c15da26Smrg	shlibpath_overrides_runpath=no
38493c15da26Smrg	;;
38503c15da26Smrg      *)
38513c15da26Smrg	shlibpath_overrides_runpath=yes
38523c15da26Smrg	;;
38533c15da26Smrg      esac
38543c15da26Smrg  else
38553c15da26Smrg    shlibpath_overrides_runpath=yes
38563c15da26Smrg  fi
38573c15da26Smrg  ;;
3858555991fdSmrg
38593c15da26Smrgos2*)
38603c15da26Smrg  libname_spec='$name'
38613c15da26Smrg  shrext_cmds=".dll"
38623c15da26Smrg  need_lib_prefix=no
38633c15da26Smrg  library_names_spec='$libname${shared_ext} $libname.a'
38643c15da26Smrg  dynamic_linker='OS/2 ld.exe'
38653c15da26Smrg  shlibpath_var=LIBPATH
38663c15da26Smrg  ;;
3867555991fdSmrg
38683c15da26Smrgosf3* | osf4* | osf5*)
38693c15da26Smrg  version_type=osf
38703c15da26Smrg  need_lib_prefix=no
38713c15da26Smrg  need_version=no
38723c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
38733c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38743c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
38753c15da26Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
38763c15da26Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
38773c15da26Smrg  ;;
3878555991fdSmrg
38793c15da26Smrgrdos*)
38803c15da26Smrg  dynamic_linker=no
38813c15da26Smrg  ;;
3882555991fdSmrg
38833c15da26Smrgsolaris*)
3884555991fdSmrg  version_type=linux
38853c15da26Smrg  need_lib_prefix=no
38863c15da26Smrg  need_version=no
38873c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3888555991fdSmrg  soname_spec='${libname}${release}${shared_ext}$major'
38893c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
38903c15da26Smrg  shlibpath_overrides_runpath=yes
38913c15da26Smrg  hardcode_into_libs=yes
38923c15da26Smrg  # ldd complains unless libraries are executable
38933c15da26Smrg  postinstall_cmds='chmod +x $lib'
3894555991fdSmrg  ;;
3895555991fdSmrg
38963c15da26Smrgsunos4*)
38973c15da26Smrg  version_type=sunos
38983c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
38993c15da26Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
39003c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
39013c15da26Smrg  shlibpath_overrides_runpath=yes
39023c15da26Smrg  if test "$with_gnu_ld" = yes; then
39033c15da26Smrg    need_lib_prefix=no
39043c15da26Smrg  fi
39053c15da26Smrg  need_version=yes
39063c15da26Smrg  ;;
39073c15da26Smrg
39083c15da26Smrgsysv4 | sysv4.3*)
3909555991fdSmrg  version_type=linux
39103c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
39113c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
39123c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
39133c15da26Smrg  case $host_vendor in
39143c15da26Smrg    sni)
39153c15da26Smrg      shlibpath_overrides_runpath=no
39163c15da26Smrg      need_lib_prefix=no
39173c15da26Smrg      runpath_var=LD_RUN_PATH
39183c15da26Smrg      ;;
39193c15da26Smrg    siemens)
39203c15da26Smrg      need_lib_prefix=no
39213c15da26Smrg      ;;
39223c15da26Smrg    motorola)
39233c15da26Smrg      need_lib_prefix=no
39243c15da26Smrg      need_version=no
39253c15da26Smrg      shlibpath_overrides_runpath=no
39263c15da26Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
39273c15da26Smrg      ;;
39283c15da26Smrg  esac
39293c15da26Smrg  ;;
39303c15da26Smrg
39313c15da26Smrgsysv4*MP*)
39323c15da26Smrg  if test -d /usr/nec ;then
39333c15da26Smrg    version_type=linux
39343c15da26Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
39353c15da26Smrg    soname_spec='$libname${shared_ext}.$major'
39363c15da26Smrg    shlibpath_var=LD_LIBRARY_PATH
39373c15da26Smrg  fi
39383c15da26Smrg  ;;
39393c15da26Smrg
39403c15da26Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
39413c15da26Smrg  version_type=freebsd-elf
3942555991fdSmrg  need_lib_prefix=no
3943555991fdSmrg  need_version=no
39443c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
39453c15da26Smrg  soname_spec='${libname}${release}${shared_ext}$major'
39463c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
39473c15da26Smrg  shlibpath_overrides_runpath=yes
3948555991fdSmrg  hardcode_into_libs=yes
39493c15da26Smrg  if test "$with_gnu_ld" = yes; then
39503c15da26Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3951555991fdSmrg  else
39523c15da26Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3953555991fdSmrg    case $host_os in
39543c15da26Smrg      sco3.2v5*)
39553c15da26Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
39563c15da26Smrg	;;
3957555991fdSmrg    esac
3958555991fdSmrg  fi
39593c15da26Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
3960555991fdSmrg  ;;
3961555991fdSmrg
39623c15da26Smrgtpf*)
39633c15da26Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
39643c15da26Smrg  version_type=linux
39653c15da26Smrg  need_lib_prefix=no
39663c15da26Smrg  need_version=no
39673c15da26Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
39683c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
39693c15da26Smrg  shlibpath_overrides_runpath=no
39703c15da26Smrg  hardcode_into_libs=yes
3971555991fdSmrg  ;;
3972555991fdSmrg
39733c15da26Smrguts4*)
3974555991fdSmrg  version_type=linux
3975555991fdSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3976555991fdSmrg  soname_spec='${libname}${release}${shared_ext}$major'
3977555991fdSmrg  shlibpath_var=LD_LIBRARY_PATH
3978555991fdSmrg  ;;
3979555991fdSmrg
39803c15da26Smrg*)
39813c15da26Smrg  dynamic_linker=no
39823c15da26Smrg  ;;
39833c15da26Smrgesac
39843c15da26SmrgAC_MSG_RESULT([$dynamic_linker])
39853c15da26Smrgtest "$dynamic_linker" = no && can_build_shared=no
3986555991fdSmrg
39873c15da26Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
39883c15da26Smrgif test "$GCC" = yes; then
39893c15da26Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
39903c15da26Smrgfi
3991555991fdSmrg
39923c15da26Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
39933c15da26Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
39943c15da26Smrgfi
39953c15da26Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
39963c15da26Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
39973c15da26Smrgfi
3998555991fdSmrg
39993c15da26Smrg_LT_DECL([], [variables_saved_for_relink], [1],
40003c15da26Smrg    [Variables whose values should be saved in libtool wrapper scripts and
40013c15da26Smrg    restored at link time])
40023c15da26Smrg_LT_DECL([], [need_lib_prefix], [0],
40033c15da26Smrg    [Do we need the "lib" prefix for modules?])
40043c15da26Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
40053c15da26Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
40063c15da26Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
40073c15da26Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
40083c15da26Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
40093c15da26Smrg    [Is shlibpath searched before the hard-coded library search path?])
40103c15da26Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
40113c15da26Smrg_LT_DECL([], [library_names_spec], [1],
40123c15da26Smrg    [[List of archive names.  First name is the real one, the rest are links.
40133c15da26Smrg    The last name is the one that the linker finds with -lNAME]])
40143c15da26Smrg_LT_DECL([], [soname_spec], [1],
40153c15da26Smrg    [[The coded name of the library, if different from the real name]])
40163c15da26Smrg_LT_DECL([], [install_override_mode], [1],
40173c15da26Smrg    [Permission mode override for installation of shared libraries])
40183c15da26Smrg_LT_DECL([], [postinstall_cmds], [2],
40193c15da26Smrg    [Command to use after installation of a shared archive])
40203c15da26Smrg_LT_DECL([], [postuninstall_cmds], [2],
40213c15da26Smrg    [Command to use after uninstallation of a shared archive])
40223c15da26Smrg_LT_DECL([], [finish_cmds], [2],
40233c15da26Smrg    [Commands used to finish a libtool library installation in a directory])
40243c15da26Smrg_LT_DECL([], [finish_eval], [1],
40253c15da26Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
40263c15da26Smrg    not shown]])
40273c15da26Smrg_LT_DECL([], [hardcode_into_libs], [0],
40283c15da26Smrg    [Whether we should hardcode library paths into libraries])
40293c15da26Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
40303c15da26Smrg    [Compile-time system search path for libraries])
40313c15da26Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
40323c15da26Smrg    [Run-time system search path for libraries])
40333c15da26Smrg])# _LT_SYS_DYNAMIC_LINKER
4034555991fdSmrg
4035555991fdSmrg
40363c15da26Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
40373c15da26Smrg# --------------------------
40383c15da26Smrg# find a file program which can recognize shared library
40393c15da26SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
40403c15da26Smrg[m4_require([_LT_DECL_EGREP])dnl
40413c15da26SmrgAC_MSG_CHECKING([for $1])
40423c15da26SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
40433c15da26Smrg[case $MAGIC_CMD in
40443c15da26Smrg[[\\/*] |  ?:[\\/]*])
40453c15da26Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4046555991fdSmrg  ;;
40473c15da26Smrg*)
40483c15da26Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
40493c15da26Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
40503c15da26Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
40513c15da26Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
40523c15da26Smrgdnl not every word.  This closes a longstanding sh security hole.
40533c15da26Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
40543c15da26Smrg  for ac_dir in $ac_dummy; do
40553c15da26Smrg    IFS="$lt_save_ifs"
40563c15da26Smrg    test -z "$ac_dir" && ac_dir=.
40573c15da26Smrg    if test -f $ac_dir/$1; then
40583c15da26Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
40593c15da26Smrg      if test -n "$file_magic_test_file"; then
40603c15da26Smrg	case $deplibs_check_method in
40613c15da26Smrg	"file_magic "*)
40623c15da26Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
40633c15da26Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
40643c15da26Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
40653c15da26Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
40663c15da26Smrg	    :
40673c15da26Smrg	  else
40683c15da26Smrg	    cat <<_LT_EOF 1>&2
4069555991fdSmrg
40703c15da26Smrg*** Warning: the command libtool uses to detect shared libraries,
40713c15da26Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
40723c15da26Smrg*** The result is that libtool may fail to recognize shared libraries
40733c15da26Smrg*** as such.  This will affect the creation of libtool libraries that
40743c15da26Smrg*** depend on shared libraries, but programs linked with such libtool
40753c15da26Smrg*** libraries will work regardless of this problem.  Nevertheless, you
40763c15da26Smrg*** may want to report the problem to your system manager and/or to
40773c15da26Smrg*** bug-libtool@gnu.org
40783c15da26Smrg
40793c15da26Smrg_LT_EOF
40803c15da26Smrg	  fi ;;
40813c15da26Smrg	esac
40823c15da26Smrg      fi
40833c15da26Smrg      break
40843c15da26Smrg    fi
40853c15da26Smrg  done
40863c15da26Smrg  IFS="$lt_save_ifs"
40873c15da26Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
4088555991fdSmrg  ;;
40893c15da26Smrgesac])
40903c15da26SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
40913c15da26Smrgif test -n "$MAGIC_CMD"; then
40923c15da26Smrg  AC_MSG_RESULT($MAGIC_CMD)
40933c15da26Smrgelse
40943c15da26Smrg  AC_MSG_RESULT(no)
40953c15da26Smrgfi
40963c15da26Smrg_LT_DECL([], [MAGIC_CMD], [0],
40973c15da26Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
40983c15da26Smrg])# _LT_PATH_TOOL_PREFIX
4099555991fdSmrg
41003c15da26Smrg# Old name:
41013c15da26SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
41023c15da26Smrgdnl aclocal-1.4 backwards compatibility:
41033c15da26Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
41043c15da26Smrg
41053c15da26Smrg
41063c15da26Smrg# _LT_PATH_MAGIC
41073c15da26Smrg# --------------
41083c15da26Smrg# find a file program which can recognize a shared library
41093c15da26Smrgm4_defun([_LT_PATH_MAGIC],
41103c15da26Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
41113c15da26Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
41123c15da26Smrg  if test -n "$ac_tool_prefix"; then
41133c15da26Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4114555991fdSmrg  else
41153c15da26Smrg    MAGIC_CMD=:
4116555991fdSmrg  fi
41173c15da26Smrgfi
41183c15da26Smrg])# _LT_PATH_MAGIC
4119555991fdSmrg
4120555991fdSmrg
41213c15da26Smrg# LT_PATH_LD
41223c15da26Smrg# ----------
41233c15da26Smrg# find the pathname to the GNU or non-GNU linker
41243c15da26SmrgAC_DEFUN([LT_PATH_LD],
41253c15da26Smrg[AC_REQUIRE([AC_PROG_CC])dnl
41263c15da26SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
41273c15da26SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
41283c15da26Smrgm4_require([_LT_DECL_SED])dnl
41293c15da26Smrgm4_require([_LT_DECL_EGREP])dnl
41303c15da26Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4131555991fdSmrg
41323c15da26SmrgAC_ARG_WITH([gnu-ld],
41333c15da26Smrg    [AS_HELP_STRING([--with-gnu-ld],
41343c15da26Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
41353c15da26Smrg    [test "$withval" = no || with_gnu_ld=yes],
41363c15da26Smrg    [with_gnu_ld=no])dnl
4137555991fdSmrg
41383c15da26Smrgac_prog=ld
41393c15da26Smrgif test "$GCC" = yes; then
41403c15da26Smrg  # Check if gcc -print-prog-name=ld gives a path.
41413c15da26Smrg  AC_MSG_CHECKING([for ld used by $CC])
41423c15da26Smrg  case $host in
41433c15da26Smrg  *-*-mingw*)
41443c15da26Smrg    # gcc leaves a trailing carriage return which upsets mingw
41453c15da26Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
41463c15da26Smrg  *)
41473c15da26Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4148555991fdSmrg  esac
41493c15da26Smrg  case $ac_prog in
41503c15da26Smrg    # Accept absolute paths.
41513c15da26Smrg    [[\\/]]* | ?:[[\\/]]*)
41523c15da26Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
41533c15da26Smrg      # Canonicalize the pathname of ld
41543c15da26Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
41553c15da26Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
41563c15da26Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
41573c15da26Smrg      done
41583c15da26Smrg      test -z "$LD" && LD="$ac_prog"
41593c15da26Smrg      ;;
41603c15da26Smrg  "")
41613c15da26Smrg    # If it fails, then pretend we aren't using GCC.
41623c15da26Smrg    ac_prog=ld
4163555991fdSmrg    ;;
4164555991fdSmrg  *)
41653c15da26Smrg    # If it is relative, then search for the first ld in PATH.
41663c15da26Smrg    with_gnu_ld=unknown
4167555991fdSmrg    ;;
4168555991fdSmrg  esac
41693c15da26Smrgelif test "$with_gnu_ld" = yes; then
41703c15da26Smrg  AC_MSG_CHECKING([for GNU ld])
41713c15da26Smrgelse
41723c15da26Smrg  AC_MSG_CHECKING([for non-GNU ld])
41733c15da26Smrgfi
41743c15da26SmrgAC_CACHE_VAL(lt_cv_path_LD,
41753c15da26Smrg[if test -z "$LD"; then
41763c15da26Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
41773c15da26Smrg  for ac_dir in $PATH; do
41783c15da26Smrg    IFS="$lt_save_ifs"
41793c15da26Smrg    test -z "$ac_dir" && ac_dir=.
41803c15da26Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
41813c15da26Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
41823c15da26Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
41833c15da26Smrg      # but apparently some variants of GNU ld only accept -v.
41843c15da26Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
41853c15da26Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
41863c15da26Smrg      *GNU* | *'with BFD'*)
41873c15da26Smrg	test "$with_gnu_ld" != no && break
41883c15da26Smrg	;;
41893c15da26Smrg      *)
41903c15da26Smrg	test "$with_gnu_ld" != yes && break
41913c15da26Smrg	;;
41923c15da26Smrg      esac
41933c15da26Smrg    fi
41943c15da26Smrg  done
41953c15da26Smrg  IFS="$lt_save_ifs"
41963c15da26Smrgelse
41973c15da26Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
41983c15da26Smrgfi])
41993c15da26SmrgLD="$lt_cv_path_LD"
42003c15da26Smrgif test -n "$LD"; then
42013c15da26Smrg  AC_MSG_RESULT($LD)
42023c15da26Smrgelse
42033c15da26Smrg  AC_MSG_RESULT(no)
42043c15da26Smrgfi
42053c15da26Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
42063c15da26Smrg_LT_PATH_LD_GNU
42073c15da26SmrgAC_SUBST([LD])
4208126a8a12Smrg
42093c15da26Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
42103c15da26Smrg])# LT_PATH_LD
4211126a8a12Smrg
42123c15da26Smrg# Old names:
42133c15da26SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
42143c15da26SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
42153c15da26Smrgdnl aclocal-1.4 backwards compatibility:
42163c15da26Smrgdnl AC_DEFUN([AM_PROG_LD], [])
42173c15da26Smrgdnl AC_DEFUN([AC_PROG_LD], [])
4218126a8a12Smrg
4219126a8a12Smrg
42203c15da26Smrg# _LT_PATH_LD_GNU
42213c15da26Smrg#- --------------
42223c15da26Smrgm4_defun([_LT_PATH_LD_GNU],
42233c15da26Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
42243c15da26Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
42253c15da26Smrgcase `$LD -v 2>&1 </dev/null` in
42263c15da26Smrg*GNU* | *'with BFD'*)
42273c15da26Smrg  lt_cv_prog_gnu_ld=yes
4228555991fdSmrg  ;;
42293c15da26Smrg*)
42303c15da26Smrg  lt_cv_prog_gnu_ld=no
4231555991fdSmrg  ;;
42323c15da26Smrgesac])
42333c15da26Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
42343c15da26Smrg])# _LT_PATH_LD_GNU
4235126a8a12Smrg
4236126a8a12Smrg
42373c15da26Smrg# _LT_CMD_RELOAD
42383c15da26Smrg# --------------
42393c15da26Smrg# find reload flag for linker
42403c15da26Smrg#   -- PORTME Some linkers may need a different reload flag.
42413c15da26Smrgm4_defun([_LT_CMD_RELOAD],
42423c15da26Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
42433c15da26Smrg  lt_cv_ld_reload_flag,
42443c15da26Smrg  [lt_cv_ld_reload_flag='-r'])
42453c15da26Smrgreload_flag=$lt_cv_ld_reload_flag
42463c15da26Smrgcase $reload_flag in
42473c15da26Smrg"" | " "*) ;;
42483c15da26Smrg*) reload_flag=" $reload_flag" ;;
42493c15da26Smrgesac
42503c15da26Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
42513c15da26Smrgcase $host_os in
42523c15da26Smrg  cygwin* | mingw* | pw32* | cegcc*)
42533c15da26Smrg    if test "$GCC" != yes; then
42543c15da26Smrg      reload_cmds=false
42553c15da26Smrg    fi
42563c15da26Smrg    ;;
42573c15da26Smrg  darwin*)
42583c15da26Smrg    if test "$GCC" = yes; then
42593c15da26Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
42603c15da26Smrg    else
42613c15da26Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
42623c15da26Smrg    fi
42633c15da26Smrg    ;;
42643c15da26Smrgesac
42653c15da26Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
42663c15da26Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
42673c15da26Smrg])# _LT_CMD_RELOAD
4268126a8a12Smrg
4269126a8a12Smrg
42703c15da26Smrg# _LT_CHECK_MAGIC_METHOD
42713c15da26Smrg# ----------------------
42723c15da26Smrg# how to check for library dependencies
42733c15da26Smrg#  -- PORTME fill in with the dynamic library characteristics
42743c15da26Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
42753c15da26Smrg[m4_require([_LT_DECL_EGREP])
42763c15da26Smrgm4_require([_LT_DECL_OBJDUMP])
42773c15da26SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
42783c15da26Smrglt_cv_deplibs_check_method,
42793c15da26Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
42803c15da26Smrglt_cv_file_magic_test_file=
42813c15da26Smrglt_cv_deplibs_check_method='unknown'
42823c15da26Smrg# Need to set the preceding variable on all platforms that support
42833c15da26Smrg# interlibrary dependencies.
42843c15da26Smrg# 'none' -- dependencies not supported.
42853c15da26Smrg# `unknown' -- same as none, but documents that we really don't know.
42863c15da26Smrg# 'pass_all' -- all dependencies passed with no checks.
42873c15da26Smrg# 'test_compile' -- check by making test program.
42883c15da26Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
42893c15da26Smrg# which responds to the $file_magic_cmd with a given extended regex.
42903c15da26Smrg# If you have `file' or equivalent on your system and you're not sure
42913c15da26Smrg# whether `pass_all' will *always* work, you probably want this one.
42923c15da26Smrg
42933c15da26Smrgcase $host_os in
42943c15da26Smrgaix[[4-9]]*)
42953c15da26Smrg  lt_cv_deplibs_check_method=pass_all
4296555991fdSmrg  ;;
4297126a8a12Smrg
42983c15da26Smrgbeos*)
42993c15da26Smrg  lt_cv_deplibs_check_method=pass_all
4300555991fdSmrg  ;;
4301555991fdSmrg
43023c15da26Smrgbsdi[[45]]*)
43033c15da26Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
43043c15da26Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
43053c15da26Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
4306555991fdSmrg  ;;
4307555991fdSmrg
43083c15da26Smrgcygwin*)
43093c15da26Smrg  # func_win32_libid is a shell function defined in ltmain.sh
43103c15da26Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
43113c15da26Smrg  lt_cv_file_magic_cmd='func_win32_libid'
4312555991fdSmrg  ;;
4313555991fdSmrg
43143c15da26Smrgmingw* | pw32*)
43153c15da26Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
43163c15da26Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
43173c15da26Smrg  # unless we find 'file', for example because we are cross-compiling.
43183c15da26Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
43193c15da26Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
43203c15da26Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
43213c15da26Smrg    lt_cv_file_magic_cmd='func_win32_libid'
43223c15da26Smrg  else
43233c15da26Smrg    # Keep this pattern in sync with the one in func_win32_libid.
43243c15da26Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
43253c15da26Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
4326555991fdSmrg  fi
4327555991fdSmrg  ;;
4328555991fdSmrg
43293c15da26Smrgcegcc*)
43303c15da26Smrg  # use the weaker test based on 'objdump'. See mingw*.
43313c15da26Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
43323c15da26Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
4333555991fdSmrg  ;;
4334126a8a12Smrg
43353c15da26Smrgdarwin* | rhapsody*)
43363c15da26Smrg  lt_cv_deplibs_check_method=pass_all
4337555991fdSmrg  ;;
4338126a8a12Smrg
43393c15da26Smrgfreebsd* | dragonfly*)
43403c15da26Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
43413c15da26Smrg    case $host_cpu in
43423c15da26Smrg    i*86 )
43433c15da26Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
43443c15da26Smrg      # Let's accept both of them until this is cleared up.
43453c15da26Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
43463c15da26Smrg      lt_cv_file_magic_cmd=/usr/bin/file
43473c15da26Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
43483c15da26Smrg      ;;
4349555991fdSmrg    esac
43503c15da26Smrg  else
43513c15da26Smrg    lt_cv_deplibs_check_method=pass_all
4352555991fdSmrg  fi
4353555991fdSmrg  ;;
4354126a8a12Smrg
43553c15da26Smrggnu*)
43563c15da26Smrg  lt_cv_deplibs_check_method=pass_all
4357555991fdSmrg  ;;
4358126a8a12Smrg
43593c15da26Smrghaiku*)
43603c15da26Smrg  lt_cv_deplibs_check_method=pass_all
4361555991fdSmrg  ;;
4362126a8a12Smrg
43633c15da26Smrghpux10.20* | hpux11*)
43643c15da26Smrg  lt_cv_file_magic_cmd=/usr/bin/file
43653c15da26Smrg  case $host_cpu in
43663c15da26Smrg  ia64*)
43673c15da26Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
43683c15da26Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
43693c15da26Smrg    ;;
43703c15da26Smrg  hppa*64*)
43713c15da26Smrg    [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]']
43723c15da26Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
43733c15da26Smrg    ;;
43743c15da26Smrg  *)
43753c15da26Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
43763c15da26Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
43773c15da26Smrg    ;;
43783c15da26Smrg  esac
4379555991fdSmrg  ;;
4380126a8a12Smrg
43813c15da26Smrginterix[[3-9]]*)
43823c15da26Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
43833c15da26Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
43843c15da26Smrg  ;;
4385126a8a12Smrg
43863c15da26Smrgirix5* | irix6* | nonstopux*)
43873c15da26Smrg  case $LD in
43883c15da26Smrg  *-32|*"-32 ") libmagic=32-bit;;
43893c15da26Smrg  *-n32|*"-n32 ") libmagic=N32;;
43903c15da26Smrg  *-64|*"-64 ") libmagic=64-bit;;
43913c15da26Smrg  *) libmagic=never-match;;
43923c15da26Smrg  esac
43933c15da26Smrg  lt_cv_deplibs_check_method=pass_all
4394555991fdSmrg  ;;
4395126a8a12Smrg
43963c15da26Smrg# This must be Linux ELF.
43973c15da26Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
43983c15da26Smrg  lt_cv_deplibs_check_method=pass_all
43993c15da26Smrg  ;;
4400555991fdSmrg
44013c15da26Smrgnetbsd*)
44023c15da26Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
44033c15da26Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
44043c15da26Smrg  else
44053c15da26Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
44063c15da26Smrg  fi
4407555991fdSmrg  ;;
4408126a8a12Smrg
44093c15da26Smrgnewos6*)
44103c15da26Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
44113c15da26Smrg  lt_cv_file_magic_cmd=/usr/bin/file
44123c15da26Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
44133c15da26Smrg  ;;
4414126a8a12Smrg
44153c15da26Smrg*nto* | *qnx*)
44163c15da26Smrg  lt_cv_deplibs_check_method=pass_all
44173c15da26Smrg  ;;
4418126a8a12Smrg
44193c15da26Smrgopenbsd*)
44203c15da26Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
44213c15da26Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4422555991fdSmrg  else
44233c15da26Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4424d656433aSmrg  fi
44253c15da26Smrg  ;;
4426126a8a12Smrg
44273c15da26Smrgosf3* | osf4* | osf5*)
44283c15da26Smrg  lt_cv_deplibs_check_method=pass_all
44293c15da26Smrg  ;;
4430126a8a12Smrg
44313c15da26Smrgrdos*)
44323c15da26Smrg  lt_cv_deplibs_check_method=pass_all
44333c15da26Smrg  ;;
4434126a8a12Smrg
44353c15da26Smrgsolaris*)
44363c15da26Smrg  lt_cv_deplibs_check_method=pass_all
44373c15da26Smrg  ;;
4438126a8a12Smrg
44393c15da26Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
44403c15da26Smrg  lt_cv_deplibs_check_method=pass_all
44413c15da26Smrg  ;;
44423c15da26Smrg
44433c15da26Smrgsysv4 | sysv4.3*)
44443c15da26Smrg  case $host_vendor in
44453c15da26Smrg  motorola)
44463c15da26Smrg    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]]'
44473c15da26Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4448555991fdSmrg    ;;
44493c15da26Smrg  ncr)
44503c15da26Smrg    lt_cv_deplibs_check_method=pass_all
44513c15da26Smrg    ;;
44523c15da26Smrg  sequent)
44533c15da26Smrg    lt_cv_file_magic_cmd='/bin/file'
44543c15da26Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
44553c15da26Smrg    ;;
44563c15da26Smrg  sni)
44573c15da26Smrg    lt_cv_file_magic_cmd='/bin/file'
44583c15da26Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
44593c15da26Smrg    lt_cv_file_magic_test_file=/lib/libc.so
44603c15da26Smrg    ;;
44613c15da26Smrg  siemens)
44623c15da26Smrg    lt_cv_deplibs_check_method=pass_all
44633c15da26Smrg    ;;
44643c15da26Smrg  pc)
44653c15da26Smrg    lt_cv_deplibs_check_method=pass_all
44663c15da26Smrg    ;;
44673c15da26Smrg  esac
44683c15da26Smrg  ;;
44693c15da26Smrg
44703c15da26Smrgtpf*)
44713c15da26Smrg  lt_cv_deplibs_check_method=pass_all
44723c15da26Smrg  ;;
44733c15da26Smrgesac
44743c15da26Smrg])
44753c15da26Smrg
44763c15da26Smrgfile_magic_glob=
44773c15da26Smrgwant_nocaseglob=no
44783c15da26Smrgif test "$build" = "$host"; then
44793c15da26Smrg  case $host_os in
44803c15da26Smrg  mingw* | pw32*)
44813c15da26Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
44823c15da26Smrg      want_nocaseglob=yes
44833c15da26Smrg    else
44843c15da26Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
44853c15da26Smrg    fi
4486555991fdSmrg    ;;
4487555991fdSmrg  esac
4488555991fdSmrgfi
44893c15da26Smrg
44903c15da26Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
44913c15da26Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
44923c15da26Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
44933c15da26Smrg
44943c15da26Smrg_LT_DECL([], [deplibs_check_method], [1],
44953c15da26Smrg    [Method to check whether dependent libraries are shared objects])
44963c15da26Smrg_LT_DECL([], [file_magic_cmd], [1],
44973c15da26Smrg    [Command to use when deplibs_check_method = "file_magic"])
44983c15da26Smrg_LT_DECL([], [file_magic_glob], [1],
44993c15da26Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
45003c15da26Smrg_LT_DECL([], [want_nocaseglob], [1],
45013c15da26Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
45023c15da26Smrg])# _LT_CHECK_MAGIC_METHOD
45033c15da26Smrg
45043c15da26Smrg
45053c15da26Smrg# LT_PATH_NM
45063c15da26Smrg# ----------
45073c15da26Smrg# find the pathname to a BSD- or MS-compatible name lister
45083c15da26SmrgAC_DEFUN([LT_PATH_NM],
45093c15da26Smrg[AC_REQUIRE([AC_PROG_CC])dnl
45103c15da26SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
45113c15da26Smrg[if test -n "$NM"; then
45123c15da26Smrg  # Let the user override the test.
45133c15da26Smrg  lt_cv_path_NM="$NM"
4514555991fdSmrgelse
45153c15da26Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
45163c15da26Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
45173c15da26Smrg    lt_nm_to_check="$lt_nm_to_check nm"
45183c15da26Smrg  fi
45193c15da26Smrg  for lt_tmp_nm in $lt_nm_to_check; do
45203c15da26Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
45213c15da26Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
45223c15da26Smrg      IFS="$lt_save_ifs"
45233c15da26Smrg      test -z "$ac_dir" && ac_dir=.
45243c15da26Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
45253c15da26Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
45263c15da26Smrg	# Check to see if the nm accepts a BSD-compat flag.
45273c15da26Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
45283c15da26Smrg	#   nm: unknown option "B" ignored
45293c15da26Smrg	# Tru64's nm complains that /dev/null is an invalid object file
45303c15da26Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
45313c15da26Smrg	*/dev/null* | *'Invalid file or object type'*)
45323c15da26Smrg	  lt_cv_path_NM="$tmp_nm -B"
45333c15da26Smrg	  break
45343c15da26Smrg	  ;;
45353c15da26Smrg	*)
45363c15da26Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
45373c15da26Smrg	  */dev/null*)
45383c15da26Smrg	    lt_cv_path_NM="$tmp_nm -p"
45393c15da26Smrg	    break
45403c15da26Smrg	    ;;
45413c15da26Smrg	  *)
45423c15da26Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
45433c15da26Smrg	    continue # so that we can try to find one that supports BSD flags
45443c15da26Smrg	    ;;
45453c15da26Smrg	  esac
45463c15da26Smrg	  ;;
45473c15da26Smrg	esac
45483c15da26Smrg      fi
45493c15da26Smrg    done
45503c15da26Smrg    IFS="$lt_save_ifs"
45513c15da26Smrg  done
45523c15da26Smrg  : ${lt_cv_path_NM=no}
4553555991fdSmrgfi])
45543c15da26Smrgif test "$lt_cv_path_NM" != "no"; then
45553c15da26Smrg  NM="$lt_cv_path_NM"
4556555991fdSmrgelse
45573c15da26Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
45583c15da26Smrg  if test -n "$DUMPBIN"; then :
45593c15da26Smrg    # Let the user override the test.
45603c15da26Smrg  else
45613c15da26Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
45623c15da26Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
45633c15da26Smrg    *COFF*)
45643c15da26Smrg      DUMPBIN="$DUMPBIN -symbols"
45653c15da26Smrg      ;;
45663c15da26Smrg    *)
45673c15da26Smrg      DUMPBIN=:
45683c15da26Smrg      ;;
45693c15da26Smrg    esac
45703c15da26Smrg  fi
45713c15da26Smrg  AC_SUBST([DUMPBIN])
45723c15da26Smrg  if test "$DUMPBIN" != ":"; then
45733c15da26Smrg    NM="$DUMPBIN"
45743c15da26Smrg  fi
4575555991fdSmrgfi
45763c15da26Smrgtest -z "$NM" && NM=nm
45773c15da26SmrgAC_SUBST([NM])
45783c15da26Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4579d656433aSmrg
45803c15da26SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
45813c15da26Smrg  [lt_cv_nm_interface="BSD nm"
45823c15da26Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
45833c15da26Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
45843c15da26Smrg  (eval "$ac_compile" 2>conftest.err)
45853c15da26Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
45863c15da26Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
45873c15da26Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
45883c15da26Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
45893c15da26Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
45903c15da26Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
45913c15da26Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
45923c15da26Smrg    lt_cv_nm_interface="MS dumpbin"
45933c15da26Smrg  fi
45943c15da26Smrg  rm -f conftest*])
45953c15da26Smrg])# LT_PATH_NM
4596d656433aSmrg
4597555991fdSmrg# Old names:
45983c15da26SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
45993c15da26SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4600555991fdSmrgdnl aclocal-1.4 backwards compatibility:
46013c15da26Smrgdnl AC_DEFUN([AM_PROG_NM], [])
46023c15da26Smrgdnl AC_DEFUN([AC_PROG_NM], [])
4603126a8a12Smrg
46043c15da26Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
46053c15da26Smrg# --------------------------------
46063c15da26Smrg# how to determine the name of the shared library
46073c15da26Smrg# associated with a specific link library.
46083c15da26Smrg#  -- PORTME fill in with the dynamic library characteristics
46093c15da26Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
46103c15da26Smrg[m4_require([_LT_DECL_EGREP])
46113c15da26Smrgm4_require([_LT_DECL_OBJDUMP])
46123c15da26Smrgm4_require([_LT_DECL_DLLTOOL])
46133c15da26SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
46143c15da26Smrglt_cv_sharedlib_from_linklib_cmd,
46153c15da26Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
4616126a8a12Smrg
46173c15da26Smrgcase $host_os in
46183c15da26Smrgcygwin* | mingw* | pw32* | cegcc*)
46193c15da26Smrg  # two different shell functions defined in ltmain.sh
46203c15da26Smrg  # decide which to use based on capabilities of $DLLTOOL
46213c15da26Smrg  case `$DLLTOOL --help 2>&1` in
46223c15da26Smrg  *--identify-strict*)
46233c15da26Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
46243c15da26Smrg    ;;
46253c15da26Smrg  *)
46263c15da26Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
46273c15da26Smrg    ;;
46283c15da26Smrg  esac
4629555991fdSmrg  ;;
4630555991fdSmrg*)
46313c15da26Smrg  # fallback: assume linklib IS sharedlib
46323c15da26Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4633555991fdSmrg  ;;
4634555991fdSmrgesac
46353c15da26Smrg])
46363c15da26Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
46373c15da26Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4638126a8a12Smrg
46393c15da26Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
46403c15da26Smrg    [Command to associate shared and link libraries])
46413c15da26Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4642126a8a12Smrg
46433c15da26Smrg
46443c15da26Smrg# _LT_PATH_MANIFEST_TOOL
4645555991fdSmrg# ----------------------
46463c15da26Smrg# locate the manifest tool
46473c15da26Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
46483c15da26Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
46493c15da26Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
46503c15da26SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
46513c15da26Smrg  [lt_cv_path_mainfest_tool=no
46523c15da26Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
46533c15da26Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
46543c15da26Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
46553c15da26Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
46563c15da26Smrg    lt_cv_path_mainfest_tool=yes
46573c15da26Smrg  fi
46583c15da26Smrg  rm -f conftest*])
46593c15da26Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
46603c15da26Smrg  MANIFEST_TOOL=:
46613c15da26Smrgfi
46623c15da26Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
46633c15da26Smrg])# _LT_PATH_MANIFEST_TOOL
4664126a8a12Smrg
4665d656433aSmrg
46663c15da26Smrg# LT_LIB_M
46673c15da26Smrg# --------
46683c15da26Smrg# check for math library
46693c15da26SmrgAC_DEFUN([LT_LIB_M],
46703c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
46713c15da26SmrgLIBM=
46723c15da26Smrgcase $host in
46733c15da26Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
46743c15da26Smrg  # These system don't have libm, or don't need it
4675555991fdSmrg  ;;
46763c15da26Smrg*-ncr-sysv4.3*)
46773c15da26Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
46783c15da26Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4679555991fdSmrg  ;;
46803c15da26Smrg*)
46813c15da26Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
4682555991fdSmrg  ;;
46833c15da26Smrgesac
46843c15da26SmrgAC_SUBST([LIBM])
46853c15da26Smrg])# LT_LIB_M
4686126a8a12Smrg
46873c15da26Smrg# Old name:
46883c15da26SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
46893c15da26Smrgdnl aclocal-1.4 backwards compatibility:
46903c15da26Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
4691555991fdSmrg
4692555991fdSmrg
46933c15da26Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
46943c15da26Smrg# -------------------------------
46953c15da26Smrgm4_defun([_LT_COMPILER_NO_RTTI],
46963c15da26Smrg[m4_require([_LT_TAG_COMPILER])dnl
4697555991fdSmrg
46983c15da26Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4699555991fdSmrg
47003c15da26Smrgif test "$GCC" = yes; then
47013c15da26Smrg  case $cc_basename in
47023c15da26Smrg  nvcc*)
47033c15da26Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4704555991fdSmrg  *)
47053c15da26Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4706d656433aSmrg  esac
4707d656433aSmrg
47083c15da26Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
47093c15da26Smrg    lt_cv_prog_compiler_rtti_exceptions,
47103c15da26Smrg    [-fno-rtti -fno-exceptions], [],
47113c15da26Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
47123c15da26Smrgfi
47133c15da26Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
47143c15da26Smrg	[Compiler flag to turn off builtin functions])
47153c15da26Smrg])# _LT_COMPILER_NO_RTTI
4716d656433aSmrg
4717126a8a12Smrg
47183c15da26Smrg# _LT_CMD_GLOBAL_SYMBOLS
47193c15da26Smrg# ----------------------
47203c15da26Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
47213c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
47223c15da26SmrgAC_REQUIRE([AC_PROG_CC])dnl
47233c15da26SmrgAC_REQUIRE([AC_PROG_AWK])dnl
47243c15da26SmrgAC_REQUIRE([LT_PATH_NM])dnl
47253c15da26SmrgAC_REQUIRE([LT_PATH_LD])dnl
47263c15da26Smrgm4_require([_LT_DECL_SED])dnl
47273c15da26Smrgm4_require([_LT_DECL_EGREP])dnl
47283c15da26Smrgm4_require([_LT_TAG_COMPILER])dnl
4729126a8a12Smrg
47303c15da26Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
47313c15da26SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
47323c15da26SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
47333c15da26Smrg[
47343c15da26Smrg# These are sane defaults that work on at least a few old systems.
47353c15da26Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4736555991fdSmrg
47373c15da26Smrg# Character class describing NM global symbol codes.
47383c15da26Smrgsymcode='[[BCDEGRST]]'
4739126a8a12Smrg
47403c15da26Smrg# Regexp to match symbols that can be accessed directly from C.
47413c15da26Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4742126a8a12Smrg
47433c15da26Smrg# Define system-specific variables.
47443c15da26Smrgcase $host_os in
47453c15da26Smrgaix*)
47463c15da26Smrg  symcode='[[BCDT]]'
47473c15da26Smrg  ;;
47483c15da26Smrgcygwin* | mingw* | pw32* | cegcc*)
47493c15da26Smrg  symcode='[[ABCDGISTW]]'
47503c15da26Smrg  ;;
47513c15da26Smrghpux*)
47523c15da26Smrg  if test "$host_cpu" = ia64; then
47533c15da26Smrg    symcode='[[ABCDEGRST]]'
4754555991fdSmrg  fi
4755555991fdSmrg  ;;
47563c15da26Smrgirix* | nonstopux*)
47573c15da26Smrg  symcode='[[BCDEGRST]]'
4758555991fdSmrg  ;;
47593c15da26Smrgosf*)
47603c15da26Smrg  symcode='[[BCDEGQRST]]'
4761555991fdSmrg  ;;
4762555991fdSmrgsolaris*)
47633c15da26Smrg  symcode='[[BDRT]]'
4764555991fdSmrg  ;;
47653c15da26Smrgsco3.2v5*)
47663c15da26Smrg  symcode='[[DT]]'
4767555991fdSmrg  ;;
47683c15da26Smrgsysv4.2uw2*)
47693c15da26Smrg  symcode='[[DT]]'
47703c15da26Smrg  ;;
47713c15da26Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
47723c15da26Smrg  symcode='[[ABDT]]'
47733c15da26Smrg  ;;
47743c15da26Smrgsysv4)
47753c15da26Smrg  symcode='[[DFNSTU]]'
4776555991fdSmrg  ;;
47773c15da26Smrgesac
4778d656433aSmrg
47793c15da26Smrg# If we're using GNU nm, then use its standard symbol codes.
47803c15da26Smrgcase `$NM -V 2>&1` in
47813c15da26Smrg*GNU* | *'with BFD'*)
47823c15da26Smrg  symcode='[[ABCDGIRSTW]]' ;;
47833c15da26Smrgesac
47843c15da26Smrg
47853c15da26Smrg# Transform an extracted symbol line into a proper C declaration.
47863c15da26Smrg# Some systems (esp. on ia64) link data and code symbols differently,
47873c15da26Smrg# so use this general approach.
47883c15da26Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
47893c15da26Smrg
47903c15da26Smrg# Transform an extracted symbol line into symbol name and symbol address
47913c15da26Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
47923c15da26Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
47933c15da26Smrg
47943c15da26Smrg# Handle CRLF in mingw tool chain
47953c15da26Smrgopt_cr=
47963c15da26Smrgcase $build_os in
47973c15da26Smrgmingw*)
47983c15da26Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4799555991fdSmrg  ;;
4800555991fdSmrgesac
4801d656433aSmrg
48023c15da26Smrg# Try without a prefix underscore, then with it.
48033c15da26Smrgfor ac_symprfx in "" "_"; do
4804d656433aSmrg
48053c15da26Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
48063c15da26Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4807d656433aSmrg
48083c15da26Smrg  # Write the raw and C identifiers.
48093c15da26Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
48103c15da26Smrg    # Fake it for dumpbin and say T for any non-static function
48113c15da26Smrg    # and D for any global variable.
48123c15da26Smrg    # Also find C++ and __fastcall symbols from MSVC++,
48133c15da26Smrg    # which start with @ or ?.
48143c15da26Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
48153c15da26Smrg"     {last_section=section; section=\$ 3};"\
48163c15da26Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
48173c15da26Smrg"     \$ 0!~/External *\|/{next};"\
48183c15da26Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
48193c15da26Smrg"     {if(hide[section]) next};"\
48203c15da26Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
48213c15da26Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
48223c15da26Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
48233c15da26Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
48243c15da26Smrg"     ' prfx=^$ac_symprfx]"
48253c15da26Smrg  else
48263c15da26Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4827555991fdSmrg  fi
48283c15da26Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4829d656433aSmrg
4830555991fdSmrg  # Check to see that the pipe works correctly.
4831555991fdSmrg  pipe_works=no
4832d656433aSmrg
4833555991fdSmrg  rm -f conftest*
4834555991fdSmrg  cat > conftest.$ac_ext <<_LT_EOF
4835555991fdSmrg#ifdef __cplusplus
4836555991fdSmrgextern "C" {
4837555991fdSmrg#endif
4838555991fdSmrgchar nm_test_var;
4839555991fdSmrgvoid nm_test_func(void);
4840555991fdSmrgvoid nm_test_func(void){}
4841555991fdSmrg#ifdef __cplusplus
4842555991fdSmrg}
4843555991fdSmrg#endif
4844555991fdSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
4845555991fdSmrg_LT_EOF
4846d656433aSmrg
4847555991fdSmrg  if AC_TRY_EVAL(ac_compile); then
4848555991fdSmrg    # Now try to grab the symbols.
4849555991fdSmrg    nlist=conftest.nm
4850555991fdSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4851555991fdSmrg      # Try sorting and uniquifying the output.
4852555991fdSmrg      if sort "$nlist" | uniq > "$nlist"T; then
4853555991fdSmrg	mv -f "$nlist"T "$nlist"
4854555991fdSmrg      else
4855555991fdSmrg	rm -f "$nlist"T
4856555991fdSmrg      fi
4857d656433aSmrg
4858555991fdSmrg      # Make sure that we snagged all the symbols we need.
4859555991fdSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4860555991fdSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4861555991fdSmrg	  cat <<_LT_EOF > conftest.$ac_ext
48623c15da26Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
48633c15da26Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
48643c15da26Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
48653c15da26Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
48663c15da26Smrg# define LT@&t@_DLSYM_CONST
48673c15da26Smrg#elif defined(__osf__)
48683c15da26Smrg/* This system does not cope well with relocations in const data.  */
48693c15da26Smrg# define LT@&t@_DLSYM_CONST
48703c15da26Smrg#else
48713c15da26Smrg# define LT@&t@_DLSYM_CONST const
48723c15da26Smrg#endif
48733c15da26Smrg
4874555991fdSmrg#ifdef __cplusplus
4875555991fdSmrgextern "C" {
4876555991fdSmrg#endif
4877d656433aSmrg
4878555991fdSmrg_LT_EOF
4879555991fdSmrg	  # Now generate the symbol file.
4880555991fdSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4881d656433aSmrg
4882555991fdSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4883d656433aSmrg
4884555991fdSmrg/* The mapping between symbol names and symbols.  */
48853c15da26SmrgLT@&t@_DLSYM_CONST struct {
4886555991fdSmrg  const char *name;
4887555991fdSmrg  void       *address;
4888555991fdSmrg}
4889555991fdSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4890555991fdSmrg{
4891555991fdSmrg  { "@PROGRAM@", (void *) 0 },
4892555991fdSmrg_LT_EOF
4893555991fdSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4894555991fdSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4895555991fdSmrg  {0, (void *) 0}
4896555991fdSmrg};
4897d656433aSmrg
4898555991fdSmrg/* This works around a problem in FreeBSD linker */
4899555991fdSmrg#ifdef FREEBSD_WORKAROUND
4900555991fdSmrgstatic const void *lt_preloaded_setup() {
4901555991fdSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4902555991fdSmrg}
4903555991fdSmrg#endif
4904d656433aSmrg
4905555991fdSmrg#ifdef __cplusplus
4906555991fdSmrg}
4907555991fdSmrg#endif
4908555991fdSmrg_LT_EOF
4909555991fdSmrg	  # Now try linking the two files.
4910555991fdSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
49113c15da26Smrg	  lt_globsym_save_LIBS=$LIBS
49123c15da26Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
4913555991fdSmrg	  LIBS="conftstm.$ac_objext"
4914555991fdSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4915555991fdSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4916555991fdSmrg	    pipe_works=yes
4917555991fdSmrg	  fi
49183c15da26Smrg	  LIBS=$lt_globsym_save_LIBS
49193c15da26Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
4920555991fdSmrg	else
4921555991fdSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4922555991fdSmrg	fi
4923555991fdSmrg      else
4924555991fdSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4925555991fdSmrg      fi
4926555991fdSmrg    else
4927555991fdSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4928555991fdSmrg    fi
4929555991fdSmrg  else
4930555991fdSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4931555991fdSmrg    cat conftest.$ac_ext >&5
4932555991fdSmrg  fi
4933555991fdSmrg  rm -rf conftest* conftst*
4934d656433aSmrg
4935555991fdSmrg  # Do not use the global_symbol_pipe unless it works.
4936555991fdSmrg  if test "$pipe_works" = yes; then
4937555991fdSmrg    break
4938555991fdSmrg  else
4939555991fdSmrg    lt_cv_sys_global_symbol_pipe=
4940555991fdSmrg  fi
4941555991fdSmrgdone
4942555991fdSmrg])
4943555991fdSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4944555991fdSmrg  lt_cv_sys_global_symbol_to_cdecl=
4945555991fdSmrgfi
4946555991fdSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4947555991fdSmrg  AC_MSG_RESULT(failed)
4948555991fdSmrgelse
4949555991fdSmrg  AC_MSG_RESULT(ok)
4950555991fdSmrgfi
4951d656433aSmrg
49523c15da26Smrg# Response file support.
49533c15da26Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
49543c15da26Smrg  nm_file_list_spec='@'
49553c15da26Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
49563c15da26Smrg  nm_file_list_spec='@'
49573c15da26Smrgfi
49583c15da26Smrg
4959555991fdSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4960555991fdSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4961555991fdSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4962555991fdSmrg    [Transform the output of nm in a proper C declaration])
4963555991fdSmrg_LT_DECL([global_symbol_to_c_name_address],
4964555991fdSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4965555991fdSmrg    [Transform the output of nm in a C name address pair])
4966555991fdSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4967555991fdSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4968555991fdSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
49693c15da26Smrg_LT_DECL([], [nm_file_list_spec], [1],
49703c15da26Smrg    [Specify filename containing input files for $NM])
4971555991fdSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
4972d656433aSmrg
4973d656433aSmrg
4974555991fdSmrg# _LT_COMPILER_PIC([TAGNAME])
4975555991fdSmrg# ---------------------------
4976555991fdSmrgm4_defun([_LT_COMPILER_PIC],
4977555991fdSmrg[m4_require([_LT_TAG_COMPILER])dnl
4978555991fdSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4979555991fdSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4980555991fdSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4981555991fdSmrg
4982555991fdSmrgm4_if([$1], [CXX], [
4983555991fdSmrg  # C++ specific cases for pic, static, wl, etc.
4984555991fdSmrg  if test "$GXX" = yes; then
4985555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4986555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4987555991fdSmrg
4988555991fdSmrg    case $host_os in
4989555991fdSmrg    aix*)
4990555991fdSmrg      # All AIX code is PIC.
4991555991fdSmrg      if test "$host_cpu" = ia64; then
4992555991fdSmrg	# AIX 5 now supports IA64 processor
4993555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4994555991fdSmrg      fi
4995555991fdSmrg      ;;
4996d656433aSmrg
4997555991fdSmrg    amigaos*)
4998555991fdSmrg      case $host_cpu in
4999555991fdSmrg      powerpc)
5000555991fdSmrg            # see comment about AmigaOS4 .so support
5001555991fdSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5002555991fdSmrg        ;;
5003555991fdSmrg      m68k)
5004555991fdSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
5005555991fdSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
5006555991fdSmrg            # like `-m68040'.
5007555991fdSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5008d656433aSmrg        ;;
5009555991fdSmrg      esac
5010555991fdSmrg      ;;
5011d656433aSmrg
5012555991fdSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5013555991fdSmrg      # PIC is the default for these OSes.
5014555991fdSmrg      ;;
5015555991fdSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
5016555991fdSmrg      # This hack is so that the source file can tell whether it is being
5017555991fdSmrg      # built for inclusion in a dll (and should export symbols for example).
5018555991fdSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5019555991fdSmrg      # (--disable-auto-import) libraries
5020555991fdSmrg      m4_if([$1], [GCJ], [],
5021555991fdSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5022555991fdSmrg      ;;
5023555991fdSmrg    darwin* | rhapsody*)
5024555991fdSmrg      # PIC is the default on this platform
5025555991fdSmrg      # Common symbols not allowed in MH_DYLIB files
5026555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5027555991fdSmrg      ;;
5028555991fdSmrg    *djgpp*)
5029555991fdSmrg      # DJGPP does not support shared libraries at all
5030555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5031555991fdSmrg      ;;
5032555991fdSmrg    haiku*)
5033555991fdSmrg      # PIC is the default for Haiku.
5034555991fdSmrg      # The "-static" flag exists, but is broken.
5035555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5036555991fdSmrg      ;;
5037555991fdSmrg    interix[[3-9]]*)
5038555991fdSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5039555991fdSmrg      # Instead, we relocate shared libraries at runtime.
5040555991fdSmrg      ;;
5041555991fdSmrg    sysv4*MP*)
5042555991fdSmrg      if test -d /usr/nec; then
5043555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5044555991fdSmrg      fi
5045555991fdSmrg      ;;
5046555991fdSmrg    hpux*)
5047555991fdSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5048555991fdSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5049555991fdSmrg      # sets the default TLS model and affects inlining.
5050555991fdSmrg      case $host_cpu in
5051555991fdSmrg      hppa*64*)
5052126a8a12Smrg	;;
5053555991fdSmrg      *)
5054555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5055555991fdSmrg	;;
5056555991fdSmrg      esac
5057555991fdSmrg      ;;
5058555991fdSmrg    *qnx* | *nto*)
5059555991fdSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5060555991fdSmrg      # it will coredump.
5061555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5062555991fdSmrg      ;;
5063555991fdSmrg    *)
5064555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5065555991fdSmrg      ;;
5066555991fdSmrg    esac
5067555991fdSmrg  else
5068555991fdSmrg    case $host_os in
5069555991fdSmrg      aix[[4-9]]*)
5070555991fdSmrg	# All AIX code is PIC.
5071555991fdSmrg	if test "$host_cpu" = ia64; then
5072555991fdSmrg	  # AIX 5 now supports IA64 processor
5073555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5074555991fdSmrg	else
5075555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5076555991fdSmrg	fi
5077555991fdSmrg	;;
5078555991fdSmrg      chorus*)
5079555991fdSmrg	case $cc_basename in
5080555991fdSmrg	cxch68*)
5081555991fdSmrg	  # Green Hills C++ Compiler
5082555991fdSmrg	  # _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"
5083555991fdSmrg	  ;;
5084555991fdSmrg	esac
5085555991fdSmrg	;;
50863c15da26Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
50873c15da26Smrg	# This hack is so that the source file can tell whether it is being
50883c15da26Smrg	# built for inclusion in a dll (and should export symbols for example).
50893c15da26Smrg	m4_if([$1], [GCJ], [],
50903c15da26Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
50913c15da26Smrg	;;
5092555991fdSmrg      dgux*)
5093555991fdSmrg	case $cc_basename in
5094555991fdSmrg	  ec++*)
5095555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5096126a8a12Smrg	    ;;
5097555991fdSmrg	  ghcx*)
5098555991fdSmrg	    # Green Hills C++ Compiler
5099555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5100126a8a12Smrg	    ;;
5101555991fdSmrg	  *)
5102126a8a12Smrg	    ;;
5103555991fdSmrg	esac
5104555991fdSmrg	;;
5105555991fdSmrg      freebsd* | dragonfly*)
5106555991fdSmrg	# FreeBSD uses GNU C++
5107555991fdSmrg	;;
5108555991fdSmrg      hpux9* | hpux10* | hpux11*)
5109555991fdSmrg	case $cc_basename in
5110555991fdSmrg	  CC*)
5111555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5112555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5113555991fdSmrg	    if test "$host_cpu" != ia64; then
5114555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5115555991fdSmrg	    fi
5116126a8a12Smrg	    ;;
5117555991fdSmrg	  aCC*)
5118555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5119555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5120555991fdSmrg	    case $host_cpu in
5121555991fdSmrg	    hppa*64*|ia64*)
5122555991fdSmrg	      # +Z the default
5123d656433aSmrg	      ;;
5124555991fdSmrg	    *)
5125555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5126d656433aSmrg	      ;;
5127d656433aSmrg	    esac
5128126a8a12Smrg	    ;;
5129126a8a12Smrg	  *)
5130126a8a12Smrg	    ;;
5131126a8a12Smrg	esac
5132126a8a12Smrg	;;
5133555991fdSmrg      interix*)
5134555991fdSmrg	# This is c89, which is MS Visual C++ (no shared libs)
5135555991fdSmrg	# Anyone wants to do a port?
5136126a8a12Smrg	;;
5137555991fdSmrg      irix5* | irix6* | nonstopux*)
5138555991fdSmrg	case $cc_basename in
5139555991fdSmrg	  CC*)
5140555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5141555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5142555991fdSmrg	    # CC pic flag -KPIC is the default.
5143126a8a12Smrg	    ;;
5144126a8a12Smrg	  *)
5145126a8a12Smrg	    ;;
5146126a8a12Smrg	esac
5147126a8a12Smrg	;;
5148555991fdSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5149555991fdSmrg	case $cc_basename in
5150555991fdSmrg	  KCC*)
5151555991fdSmrg	    # KAI C++ Compiler
5152555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5153555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5154126a8a12Smrg	    ;;
5155555991fdSmrg	  ecpc* )
5156555991fdSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
5157555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5158555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5159555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5160126a8a12Smrg	    ;;
5161555991fdSmrg	  icpc* )
5162555991fdSmrg	    # Intel C++, used to be incompatible with GCC.
5163555991fdSmrg	    # ICC 10 doesn't accept -KPIC any more.
5164555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5165555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5166555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5167555991fdSmrg	    ;;
5168555991fdSmrg	  pgCC* | pgcpp*)
5169555991fdSmrg	    # Portland Group C++ compiler
5170555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5171555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5172555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5173555991fdSmrg	    ;;
5174555991fdSmrg	  cxx*)
5175555991fdSmrg	    # Compaq C++
5176555991fdSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5177555991fdSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5178555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5179555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5180555991fdSmrg	    ;;
5181555991fdSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5182555991fdSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5183555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5184555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5185555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5186126a8a12Smrg	    ;;
5187126a8a12Smrg	  *)
5188555991fdSmrg	    case `$CC -V 2>&1 | sed 5q` in
5189555991fdSmrg	    *Sun\ C*)
5190555991fdSmrg	      # Sun C++ 5.9
5191555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5192555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5193555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5194555991fdSmrg	      ;;
5195555991fdSmrg	    esac
5196126a8a12Smrg	    ;;
5197555991fdSmrg	esac
5198555991fdSmrg	;;
5199555991fdSmrg      lynxos*)
5200555991fdSmrg	;;
5201555991fdSmrg      m88k*)
5202555991fdSmrg	;;
5203555991fdSmrg      mvs*)
5204555991fdSmrg	case $cc_basename in
5205555991fdSmrg	  cxx*)
5206555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5207555991fdSmrg	    ;;
5208555991fdSmrg	  *)
5209555991fdSmrg	    ;;
5210555991fdSmrg	esac
5211555991fdSmrg	;;
5212555991fdSmrg      netbsd*)
5213555991fdSmrg	;;
5214555991fdSmrg      *qnx* | *nto*)
5215555991fdSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
5216555991fdSmrg        # it will coredump.
5217555991fdSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5218d656433aSmrg        ;;
5219555991fdSmrg      osf3* | osf4* | osf5*)
5220555991fdSmrg	case $cc_basename in
5221555991fdSmrg	  KCC*)
5222555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5223126a8a12Smrg	    ;;
5224555991fdSmrg	  RCC*)
5225555991fdSmrg	    # Rational C++ 2.4.1
5226555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5227126a8a12Smrg	    ;;
5228555991fdSmrg	  cxx*)
5229555991fdSmrg	    # Digital/Compaq C++
5230555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5231555991fdSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5232555991fdSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5233555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5234555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5235d656433aSmrg	    ;;
5236555991fdSmrg	  *)
5237555991fdSmrg	    ;;
5238555991fdSmrg	esac
5239555991fdSmrg	;;
5240555991fdSmrg      psos*)
5241555991fdSmrg	;;
5242d656433aSmrg      solaris*)
5243555991fdSmrg	case $cc_basename in
5244555991fdSmrg	  CC* | sunCC*)
5245d656433aSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
5246555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5247555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5248555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5249d656433aSmrg	    ;;
5250555991fdSmrg	  gcx*)
5251d656433aSmrg	    # Green Hills C++ Compiler
5252555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5253d656433aSmrg	    ;;
5254555991fdSmrg	  *)
5255d656433aSmrg	    ;;
5256555991fdSmrg	esac
5257555991fdSmrg	;;
5258555991fdSmrg      sunos4*)
5259d656433aSmrg	case $cc_basename in
5260555991fdSmrg	  CC*)
5261555991fdSmrg	    # Sun C++ 4.x
5262555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5263555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5264555991fdSmrg	    ;;
5265555991fdSmrg	  lcc*)
5266555991fdSmrg	    # Lucid
5267555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5268d656433aSmrg	    ;;
5269d656433aSmrg	  *)
5270d656433aSmrg	    ;;
5271d656433aSmrg	esac
5272555991fdSmrg	;;
5273555991fdSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5274555991fdSmrg	case $cc_basename in
5275555991fdSmrg	  CC*)
5276555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5277555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5278555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5279555991fdSmrg	    ;;
5280555991fdSmrg	esac
5281555991fdSmrg	;;
5282d656433aSmrg      tandem*)
5283555991fdSmrg	case $cc_basename in
5284555991fdSmrg	  NCC*)
5285d656433aSmrg	    # NonStop-UX NCC 3.20
5286555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5287d656433aSmrg	    ;;
5288555991fdSmrg	  *)
5289d656433aSmrg	    ;;
5290555991fdSmrg	esac
5291555991fdSmrg	;;
5292555991fdSmrg      vxworks*)
5293555991fdSmrg	;;
5294555991fdSmrg      *)
5295555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5296555991fdSmrg	;;
5297555991fdSmrg    esac
5298555991fdSmrg  fi
5299555991fdSmrg],
5300555991fdSmrg[
5301555991fdSmrg  if test "$GCC" = yes; then
5302555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5303555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5304555991fdSmrg
5305555991fdSmrg    case $host_os in
5306555991fdSmrg      aix*)
5307555991fdSmrg      # All AIX code is PIC.
5308555991fdSmrg      if test "$host_cpu" = ia64; then
5309555991fdSmrg	# AIX 5 now supports IA64 processor
5310555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5311555991fdSmrg      fi
5312555991fdSmrg      ;;
5313555991fdSmrg
5314555991fdSmrg    amigaos*)
5315555991fdSmrg      case $host_cpu in
5316555991fdSmrg      powerpc)
5317555991fdSmrg            # see comment about AmigaOS4 .so support
5318555991fdSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5319555991fdSmrg        ;;
5320555991fdSmrg      m68k)
5321555991fdSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
5322555991fdSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
5323555991fdSmrg            # like `-m68040'.
5324555991fdSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5325d656433aSmrg        ;;
5326555991fdSmrg      esac
5327555991fdSmrg      ;;
5328555991fdSmrg
5329555991fdSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5330555991fdSmrg      # PIC is the default for these OSes.
5331555991fdSmrg      ;;
5332126a8a12Smrg
5333555991fdSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
5334555991fdSmrg      # This hack is so that the source file can tell whether it is being
5335555991fdSmrg      # built for inclusion in a dll (and should export symbols for example).
5336555991fdSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5337555991fdSmrg      # (--disable-auto-import) libraries
5338555991fdSmrg      m4_if([$1], [GCJ], [],
5339555991fdSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5340555991fdSmrg      ;;
5341126a8a12Smrg
5342555991fdSmrg    darwin* | rhapsody*)
5343555991fdSmrg      # PIC is the default on this platform
5344555991fdSmrg      # Common symbols not allowed in MH_DYLIB files
5345555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5346555991fdSmrg      ;;
5347126a8a12Smrg
5348555991fdSmrg    haiku*)
5349555991fdSmrg      # PIC is the default for Haiku.
5350555991fdSmrg      # The "-static" flag exists, but is broken.
5351555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5352555991fdSmrg      ;;
5353d656433aSmrg
5354555991fdSmrg    hpux*)
5355555991fdSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5356555991fdSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5357555991fdSmrg      # sets the default TLS model and affects inlining.
5358555991fdSmrg      case $host_cpu in
5359555991fdSmrg      hppa*64*)
5360555991fdSmrg	# +Z the default
5361555991fdSmrg	;;
5362555991fdSmrg      *)
5363555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5364555991fdSmrg	;;
5365555991fdSmrg      esac
5366555991fdSmrg      ;;
5367d656433aSmrg
5368555991fdSmrg    interix[[3-9]]*)
5369555991fdSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5370555991fdSmrg      # Instead, we relocate shared libraries at runtime.
5371555991fdSmrg      ;;
5372d656433aSmrg
5373555991fdSmrg    msdosdjgpp*)
5374555991fdSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
5375555991fdSmrg      # on systems that don't support them.
5376555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5377555991fdSmrg      enable_shared=no
5378555991fdSmrg      ;;
5379d656433aSmrg
5380555991fdSmrg    *nto* | *qnx*)
5381555991fdSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5382555991fdSmrg      # it will coredump.
5383555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5384555991fdSmrg      ;;
5385126a8a12Smrg
5386555991fdSmrg    sysv4*MP*)
5387555991fdSmrg      if test -d /usr/nec; then
5388555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5389555991fdSmrg      fi
5390555991fdSmrg      ;;
5391126a8a12Smrg
5392555991fdSmrg    *)
5393555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5394555991fdSmrg      ;;
5395555991fdSmrg    esac
5396126a8a12Smrg
5397555991fdSmrg    case $cc_basename in
5398555991fdSmrg    nvcc*) # Cuda Compiler Driver 2.2
5399555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5400555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
5401555991fdSmrg      ;;
5402555991fdSmrg    esac
5403555991fdSmrg  else
5404555991fdSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
5405555991fdSmrg    case $host_os in
5406555991fdSmrg    aix*)
5407555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5408555991fdSmrg      if test "$host_cpu" = ia64; then
5409555991fdSmrg	# AIX 5 now supports IA64 processor
5410555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5411555991fdSmrg      else
5412555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5413555991fdSmrg      fi
5414555991fdSmrg      ;;
5415126a8a12Smrg
5416555991fdSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
5417555991fdSmrg      # This hack is so that the source file can tell whether it is being
5418555991fdSmrg      # built for inclusion in a dll (and should export symbols for example).
5419555991fdSmrg      m4_if([$1], [GCJ], [],
5420555991fdSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5421555991fdSmrg      ;;
5422126a8a12Smrg
5423555991fdSmrg    hpux9* | hpux10* | hpux11*)
5424555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5425555991fdSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5426555991fdSmrg      # not for PA HP-UX.
5427555991fdSmrg      case $host_cpu in
5428555991fdSmrg      hppa*64*|ia64*)
5429555991fdSmrg	# +Z the default
5430555991fdSmrg	;;
5431555991fdSmrg      *)
5432555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5433555991fdSmrg	;;
5434555991fdSmrg      esac
5435555991fdSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5436555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5437555991fdSmrg      ;;
5438126a8a12Smrg
5439555991fdSmrg    irix5* | irix6* | nonstopux*)
5440555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5441555991fdSmrg      # PIC (with -KPIC) is the default.
5442555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5443555991fdSmrg      ;;
5444126a8a12Smrg
5445555991fdSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5446555991fdSmrg      case $cc_basename in
5447555991fdSmrg      # old Intel for x86_64 which still supported -KPIC.
5448555991fdSmrg      ecc*)
5449555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5450555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5451555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5452555991fdSmrg        ;;
5453555991fdSmrg      # icc used to be incompatible with GCC.
5454555991fdSmrg      # ICC 10 doesn't accept -KPIC any more.
5455555991fdSmrg      icc* | ifort*)
5456555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5457555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5458555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5459555991fdSmrg        ;;
5460555991fdSmrg      # Lahey Fortran 8.1.
5461555991fdSmrg      lf95*)
5462555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5463555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5464555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5465555991fdSmrg	;;
54663c15da26Smrg      nagfor*)
54673c15da26Smrg	# NAG Fortran compiler
54683c15da26Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
54693c15da26Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
54703c15da26Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54713c15da26Smrg	;;
5472555991fdSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5473555991fdSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
5474555991fdSmrg	# which looks to be a dead project)
5475555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5476555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5477555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5478555991fdSmrg        ;;
5479555991fdSmrg      ccc*)
5480555991fdSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5481555991fdSmrg        # All Alpha code is PIC.
5482555991fdSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5483555991fdSmrg        ;;
5484555991fdSmrg      xl* | bgxl* | bgf* | mpixl*)
5485555991fdSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5486555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5487555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5488555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5489555991fdSmrg	;;
5490555991fdSmrg      *)
5491555991fdSmrg	case `$CC -V 2>&1 | sed 5q` in
5492555991fdSmrg	*Sun\ F* | *Sun*Fortran*)
5493555991fdSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5494555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5495555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5496555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5497555991fdSmrg	  ;;
5498555991fdSmrg	*Sun\ C*)
5499555991fdSmrg	  # Sun C 5.9
5500555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5501555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5502555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5503555991fdSmrg	  ;;
5504555991fdSmrg	esac
5505555991fdSmrg	;;
5506555991fdSmrg      esac
5507555991fdSmrg      ;;
5508126a8a12Smrg
5509555991fdSmrg    newsos6)
5510555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5511555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5512555991fdSmrg      ;;
5513126a8a12Smrg
5514555991fdSmrg    *nto* | *qnx*)
5515555991fdSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5516555991fdSmrg      # it will coredump.
5517555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5518555991fdSmrg      ;;
5519126a8a12Smrg
5520555991fdSmrg    osf3* | osf4* | osf5*)
5521555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5522555991fdSmrg      # All OSF/1 code is PIC.
5523555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5524555991fdSmrg      ;;
5525126a8a12Smrg
5526555991fdSmrg    rdos*)
5527555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5528555991fdSmrg      ;;
5529126a8a12Smrg
5530555991fdSmrg    solaris*)
5531555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5532555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5533555991fdSmrg      case $cc_basename in
5534555991fdSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5535555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5536555991fdSmrg      *)
5537555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5538555991fdSmrg      esac
5539555991fdSmrg      ;;
5540126a8a12Smrg
5541555991fdSmrg    sunos4*)
5542555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5543555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5544555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5545555991fdSmrg      ;;
5546126a8a12Smrg
5547555991fdSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
5548555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5549555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5550555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5551555991fdSmrg      ;;
5552126a8a12Smrg
5553555991fdSmrg    sysv4*MP*)
5554555991fdSmrg      if test -d /usr/nec ;then
5555555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5556555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5557555991fdSmrg      fi
5558555991fdSmrg      ;;
5559126a8a12Smrg
5560555991fdSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5561555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5562555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5563555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5564555991fdSmrg      ;;
5565d656433aSmrg
5566555991fdSmrg    unicos*)
5567555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5568555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5569126a8a12Smrg      ;;
5570126a8a12Smrg
5571555991fdSmrg    uts4*)
5572555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5573555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5574555991fdSmrg      ;;
5575126a8a12Smrg
5576555991fdSmrg    *)
5577555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5578d656433aSmrg      ;;
5579d656433aSmrg    esac
5580555991fdSmrg  fi
5581d656433aSmrg])
5582555991fdSmrgcase $host_os in
5583555991fdSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
5584555991fdSmrg  *djgpp*)
5585555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5586555991fdSmrg    ;;
5587555991fdSmrg  *)
5588555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5589555991fdSmrg    ;;
5590d656433aSmrgesac
55913c15da26Smrg
55923c15da26SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
55933c15da26Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
55943c15da26Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
55953c15da26Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5596d656433aSmrg
5597555991fdSmrg#
5598555991fdSmrg# Check to make sure the PIC flag actually works.
5599555991fdSmrg#
5600555991fdSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5601555991fdSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5602555991fdSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5603555991fdSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5604555991fdSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5605555991fdSmrg     "" | " "*) ;;
5606555991fdSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5607555991fdSmrg     esac],
5608555991fdSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5609555991fdSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5610555991fdSmrgfi
5611555991fdSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5612555991fdSmrg	[Additional compiler flags for building library objects])
5613126a8a12Smrg
56143c15da26Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
56153c15da26Smrg	[How to pass a linker flag through the compiler])
5616555991fdSmrg#
5617555991fdSmrg# Check to make sure the static flag actually works.
5618555991fdSmrg#
5619555991fdSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5620555991fdSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5621555991fdSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5622555991fdSmrg  $lt_tmp_static_flag,
5623555991fdSmrg  [],
5624555991fdSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5625555991fdSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5626555991fdSmrg	[Compiler flag to prevent dynamic linking])
5627555991fdSmrg])# _LT_COMPILER_PIC
5628126a8a12Smrg
5629126a8a12Smrg
5630555991fdSmrg# _LT_LINKER_SHLIBS([TAGNAME])
5631555991fdSmrg# ----------------------------
5632555991fdSmrg# See if the linker supports building shared libraries.
5633555991fdSmrgm4_defun([_LT_LINKER_SHLIBS],
5634555991fdSmrg[AC_REQUIRE([LT_PATH_LD])dnl
5635555991fdSmrgAC_REQUIRE([LT_PATH_NM])dnl
56363c15da26Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5637555991fdSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5638555991fdSmrgm4_require([_LT_DECL_EGREP])dnl
5639555991fdSmrgm4_require([_LT_DECL_SED])dnl
5640555991fdSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5641555991fdSmrgm4_require([_LT_TAG_COMPILER])dnl
5642555991fdSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5643555991fdSmrgm4_if([$1], [CXX], [
5644555991fdSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
56453c15da26Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5646555991fdSmrg  case $host_os in
5647555991fdSmrg  aix[[4-9]]*)
5648555991fdSmrg    # If we're using GNU nm, then we don't want the "-C" option.
5649555991fdSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5650555991fdSmrg    # Also, AIX nm treats weak defined symbols like other global defined
5651555991fdSmrg    # symbols, whereas GNU nm marks them as "W".
5652555991fdSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5653555991fdSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5654555991fdSmrg    else
5655555991fdSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5656555991fdSmrg    fi
5657555991fdSmrg    ;;
5658555991fdSmrg  pw32*)
5659555991fdSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
56603c15da26Smrg    ;;
5661555991fdSmrg  cygwin* | mingw* | cegcc*)
56623c15da26Smrg    case $cc_basename in
56633c15da26Smrg    cl*) ;;
56643c15da26Smrg    *)
56653c15da26Smrg      _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'
56663c15da26Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
56673c15da26Smrg      ;;
56683c15da26Smrg    esac
56693c15da26Smrg    ;;
56703c15da26Smrg  *)
56713c15da26Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
56723c15da26Smrg    ;;
56733c15da26Smrg  esac
5674555991fdSmrg], [
5675555991fdSmrg  runpath_var=
5676555991fdSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
5677555991fdSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
5678555991fdSmrg  _LT_TAGVAR(archive_cmds, $1)=
5679555991fdSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
5680555991fdSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
5681555991fdSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5682555991fdSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5683555991fdSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5684555991fdSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
5685555991fdSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
5686555991fdSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5687555991fdSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5688555991fdSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5689555991fdSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5690555991fdSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
5691555991fdSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5692555991fdSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
5693555991fdSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5694555991fdSmrg  _LT_TAGVAR(module_cmds, $1)=
5695555991fdSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
5696555991fdSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5697555991fdSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5698555991fdSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5699555991fdSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5700555991fdSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
5701555991fdSmrg  # included in the symbol list
5702555991fdSmrg  _LT_TAGVAR(include_expsyms, $1)=
5703555991fdSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5704555991fdSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5705555991fdSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5706555991fdSmrg  # as well as any symbol that contains `d'.
5707555991fdSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5708555991fdSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5709555991fdSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5710555991fdSmrg  # the symbol is explicitly referenced.  Since portable code cannot
5711555991fdSmrg  # rely on this symbol name, it's probably fine to never include it in
5712555991fdSmrg  # preloaded symbol tables.
5713555991fdSmrg  # Exclude shared library initialization/finalization symbols.
5714555991fdSmrgdnl Note also adjust exclude_expsyms for C++ above.
5715555991fdSmrg  extract_expsyms_cmds=
5716126a8a12Smrg
5717555991fdSmrg  case $host_os in
5718555991fdSmrg  cygwin* | mingw* | pw32* | cegcc*)
5719555991fdSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5720555991fdSmrg    # When not using gcc, we currently assume that we are using
5721555991fdSmrg    # Microsoft Visual C++.
5722555991fdSmrg    if test "$GCC" != yes; then
5723555991fdSmrg      with_gnu_ld=no
5724555991fdSmrg    fi
5725555991fdSmrg    ;;
5726555991fdSmrg  interix*)
5727555991fdSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5728555991fdSmrg    with_gnu_ld=yes
5729555991fdSmrg    ;;
5730555991fdSmrg  openbsd*)
5731555991fdSmrg    with_gnu_ld=no
5732555991fdSmrg    ;;
5733555991fdSmrg  esac
5734126a8a12Smrg
5735555991fdSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5736126a8a12Smrg
5737555991fdSmrg  # On some targets, GNU ld is compatible enough with the native linker
5738555991fdSmrg  # that we're better off using the native interface for both.
5739555991fdSmrg  lt_use_gnu_ld_interface=no
5740555991fdSmrg  if test "$with_gnu_ld" = yes; then
5741d656433aSmrg    case $host_os in
5742555991fdSmrg      aix*)
5743555991fdSmrg	# The AIX port of GNU ld has always aspired to compatibility
5744555991fdSmrg	# with the native linker.  However, as the warning in the GNU ld
5745555991fdSmrg	# block says, versions before 2.19.5* couldn't really create working
5746555991fdSmrg	# shared libraries, regardless of the interface used.
5747555991fdSmrg	case `$LD -v 2>&1` in
5748555991fdSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5749555991fdSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5750555991fdSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5751555991fdSmrg	  *)
5752555991fdSmrg	    lt_use_gnu_ld_interface=yes
5753555991fdSmrg	    ;;
5754555991fdSmrg	esac
5755555991fdSmrg	;;
5756555991fdSmrg      *)
5757555991fdSmrg	lt_use_gnu_ld_interface=yes
5758555991fdSmrg	;;
5759d656433aSmrg    esac
5760555991fdSmrg  fi
5761d656433aSmrg
5762555991fdSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
5763555991fdSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5764555991fdSmrg    wlarc='${wl}'
5765126a8a12Smrg
5766555991fdSmrg    # Set some defaults for GNU ld with shared library support. These
5767555991fdSmrg    # are reset later if shared libraries are not supported. Putting them
5768555991fdSmrg    # here allows them to be overridden if necessary.
5769555991fdSmrg    runpath_var=LD_RUN_PATH
5770555991fdSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5771555991fdSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5772555991fdSmrg    # ancient GNU ld didn't support --whole-archive et. al.
5773555991fdSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5774555991fdSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5775555991fdSmrg    else
5776555991fdSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5777555991fdSmrg    fi
5778555991fdSmrg    supports_anon_versioning=no
5779555991fdSmrg    case `$LD -v 2>&1` in
5780555991fdSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
5781555991fdSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5782555991fdSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5783555991fdSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5784555991fdSmrg      *\ 2.11.*) ;; # other 2.11 versions
5785555991fdSmrg      *) supports_anon_versioning=yes ;;
5786555991fdSmrg    esac
5787126a8a12Smrg
5788555991fdSmrg    # See if GNU ld supports shared libraries.
5789555991fdSmrg    case $host_os in
5790555991fdSmrg    aix[[3-9]]*)
5791555991fdSmrg      # On AIX/PPC, the GNU linker is very broken
5792555991fdSmrg      if test "$host_cpu" != ia64; then
5793555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5794555991fdSmrg	cat <<_LT_EOF 1>&2
5795126a8a12Smrg
5796555991fdSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
5797555991fdSmrg*** to be unable to reliably create shared libraries on AIX.
5798555991fdSmrg*** Therefore, libtool is disabling shared libraries support.  If you
5799555991fdSmrg*** really care for shared libraries, you may want to install binutils
5800555991fdSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5801555991fdSmrg*** You will then need to restart the configuration process.
5802126a8a12Smrg
5803555991fdSmrg_LT_EOF
5804555991fdSmrg      fi
5805555991fdSmrg      ;;
5806126a8a12Smrg
5807555991fdSmrg    amigaos*)
5808555991fdSmrg      case $host_cpu in
5809555991fdSmrg      powerpc)
5810555991fdSmrg            # see comment about AmigaOS4 .so support
5811555991fdSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5812555991fdSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5813555991fdSmrg        ;;
5814555991fdSmrg      m68k)
5815555991fdSmrg            _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)'
5816555991fdSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5817555991fdSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5818555991fdSmrg        ;;
5819555991fdSmrg      esac
5820555991fdSmrg      ;;
5821126a8a12Smrg
5822555991fdSmrg    beos*)
5823555991fdSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5824555991fdSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5825555991fdSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5826555991fdSmrg	# support --undefined.  This deserves some investigation.  FIXME
5827555991fdSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5828555991fdSmrg      else
5829555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5830555991fdSmrg      fi
5831555991fdSmrg      ;;
5832d656433aSmrg
5833555991fdSmrg    cygwin* | mingw* | pw32* | cegcc*)
5834555991fdSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5835555991fdSmrg      # as there is no search path for DLLs.
5836555991fdSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5837555991fdSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5838555991fdSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5839555991fdSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
5840555991fdSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
58413c15da26Smrg      _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'
58423c15da26Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5843d656433aSmrg
5844555991fdSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5845555991fdSmrg        _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'
5846555991fdSmrg	# If the export-symbols file already is a .def file (1st line
5847555991fdSmrg	# is EXPORTS), use it as is; otherwise, prepend...
5848555991fdSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5849555991fdSmrg	  cp $export_symbols $output_objdir/$soname.def;
5850555991fdSmrg	else
5851555991fdSmrg	  echo EXPORTS > $output_objdir/$soname.def;
5852555991fdSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
5853555991fdSmrg	fi~
5854555991fdSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5855555991fdSmrg      else
5856555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5857555991fdSmrg      fi
5858555991fdSmrg      ;;
5859d656433aSmrg
5860555991fdSmrg    haiku*)
5861555991fdSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5862555991fdSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5863555991fdSmrg      ;;
5864d656433aSmrg
5865555991fdSmrg    interix[[3-9]]*)
5866555991fdSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
5867555991fdSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5868555991fdSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5869555991fdSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5870555991fdSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5871555991fdSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5872555991fdSmrg      # default) and relocated if they conflict, which is a slow very memory
5873555991fdSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5874555991fdSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5875555991fdSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5876555991fdSmrg      _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'
5877555991fdSmrg      _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'
5878555991fdSmrg      ;;
5879126a8a12Smrg
5880555991fdSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5881555991fdSmrg      tmp_diet=no
5882555991fdSmrg      if test "$host_os" = linux-dietlibc; then
5883555991fdSmrg	case $cc_basename in
5884555991fdSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5885555991fdSmrg	esac
5886555991fdSmrg      fi
5887555991fdSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5888555991fdSmrg	 && test "$tmp_diet" = no
5889555991fdSmrg      then
58903c15da26Smrg	tmp_addflag=' $pic_flag'
5891555991fdSmrg	tmp_sharedflag='-shared'
5892555991fdSmrg	case $cc_basename,$host_cpu in
5893555991fdSmrg        pgcc*)				# Portland Group C compiler
5894555991fdSmrg	  _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'
5895555991fdSmrg	  tmp_addflag=' $pic_flag'
5896555991fdSmrg	  ;;
5897555991fdSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5898555991fdSmrg					# Portland Group f77 and f90 compilers
5899555991fdSmrg	  _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'
5900555991fdSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5901555991fdSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5902555991fdSmrg	  tmp_addflag=' -i_dynamic' ;;
5903555991fdSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5904555991fdSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5905555991fdSmrg	ifc* | ifort*)			# Intel Fortran compiler
5906555991fdSmrg	  tmp_addflag=' -nofor_main' ;;
5907555991fdSmrg	lf95*)				# Lahey Fortran 8.1
5908555991fdSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5909555991fdSmrg	  tmp_sharedflag='--shared' ;;
5910555991fdSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5911555991fdSmrg	  tmp_sharedflag='-qmkshrobj'
5912555991fdSmrg	  tmp_addflag= ;;
5913555991fdSmrg	nvcc*)	# Cuda Compiler Driver 2.2
5914555991fdSmrg	  _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'
5915555991fdSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5916555991fdSmrg	  ;;
5917555991fdSmrg	esac
5918555991fdSmrg	case `$CC -V 2>&1 | sed 5q` in
5919555991fdSmrg	*Sun\ C*)			# Sun C 5.9
5920555991fdSmrg	  _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'
5921555991fdSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5922555991fdSmrg	  tmp_sharedflag='-G' ;;
5923555991fdSmrg	*Sun\ F*)			# Sun Fortran 8.3
5924555991fdSmrg	  tmp_sharedflag='-G' ;;
5925555991fdSmrg	esac
5926555991fdSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5927126a8a12Smrg
5928555991fdSmrg        if test "x$supports_anon_versioning" = xyes; then
5929555991fdSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5930555991fdSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5931555991fdSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
5932555991fdSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5933555991fdSmrg        fi
5934126a8a12Smrg
5935555991fdSmrg	case $cc_basename in
5936555991fdSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
5937555991fdSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5938555991fdSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5939555991fdSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5940555991fdSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
5941555991fdSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5942555991fdSmrg	  if test "x$supports_anon_versioning" = xyes; then
5943555991fdSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5944555991fdSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5945555991fdSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
5946555991fdSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5947555991fdSmrg	  fi
5948555991fdSmrg	  ;;
5949555991fdSmrg	esac
5950555991fdSmrg      else
5951555991fdSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5952555991fdSmrg      fi
5953555991fdSmrg      ;;
5954126a8a12Smrg
5955555991fdSmrg    netbsd*)
5956555991fdSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5957555991fdSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5958555991fdSmrg	wlarc=
5959555991fdSmrg      else
59603c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59613c15da26Smrg	_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'
5962555991fdSmrg      fi
5963555991fdSmrg      ;;
5964126a8a12Smrg
5965555991fdSmrg    solaris*)
5966555991fdSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5967555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5968555991fdSmrg	cat <<_LT_EOF 1>&2
5969126a8a12Smrg
5970555991fdSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5971555991fdSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
5972555991fdSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5973555991fdSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5974555991fdSmrg*** your PATH or compiler configuration so that the native linker is
5975555991fdSmrg*** used, and then restart.
5976126a8a12Smrg
5977555991fdSmrg_LT_EOF
5978555991fdSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
59793c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59803c15da26Smrg	_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'
5981555991fdSmrg      else
5982555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5983555991fdSmrg      fi
5984555991fdSmrg      ;;
5985126a8a12Smrg
5986555991fdSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5987555991fdSmrg      case `$LD -v 2>&1` in
5988555991fdSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5989555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5990555991fdSmrg	cat <<_LT_EOF 1>&2
5991d656433aSmrg
5992555991fdSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5993555991fdSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5994555991fdSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5995555991fdSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5996555991fdSmrg*** your PATH or compiler configuration so that the native linker is
5997555991fdSmrg*** used, and then restart.
5998d656433aSmrg
5999555991fdSmrg_LT_EOF
6000555991fdSmrg	;;
6001555991fdSmrg	*)
6002555991fdSmrg	  # For security reasons, it is highly recommended that you always
6003555991fdSmrg	  # use absolute paths for naming shared libraries, and exclude the
6004555991fdSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
6005555991fdSmrg	  # requires that you compile everything twice, which is a pain.
6006555991fdSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6007555991fdSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6008555991fdSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6009555991fdSmrg	    _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'
6010555991fdSmrg	  else
6011555991fdSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6012555991fdSmrg	  fi
6013555991fdSmrg	;;
6014555991fdSmrg      esac
6015555991fdSmrg      ;;
6016d656433aSmrg
6017555991fdSmrg    sunos4*)
6018555991fdSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6019555991fdSmrg      wlarc=
6020555991fdSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6021555991fdSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6022555991fdSmrg      ;;
6023555991fdSmrg
6024555991fdSmrg    *)
6025555991fdSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
60263c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
60273c15da26Smrg	_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'
6028555991fdSmrg      else
6029555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6030555991fdSmrg      fi
6031555991fdSmrg      ;;
6032555991fdSmrg    esac
6033d656433aSmrg
6034555991fdSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
6035555991fdSmrg      runpath_var=
6036555991fdSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6037555991fdSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6038555991fdSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
6039555991fdSmrg    fi
6040555991fdSmrg  else
6041555991fdSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
6042555991fdSmrg    case $host_os in
6043555991fdSmrg    aix3*)
6044555991fdSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6045555991fdSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
6046555991fdSmrg      _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'
6047555991fdSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
6048555991fdSmrg      # are no directories specified by -L.
6049555991fdSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6050555991fdSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6051555991fdSmrg	# Neither direct hardcoding nor static linking is supported with a
6052555991fdSmrg	# broken collect2.
6053555991fdSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
6054555991fdSmrg      fi
6055555991fdSmrg      ;;
6056d656433aSmrg
6057555991fdSmrg    aix[[4-9]]*)
6058555991fdSmrg      if test "$host_cpu" = ia64; then
6059555991fdSmrg	# On IA64, the linker does run time linking by default, so we don't
6060555991fdSmrg	# have to do anything special.
6061555991fdSmrg	aix_use_runtimelinking=no
6062555991fdSmrg	exp_sym_flag='-Bexport'
6063555991fdSmrg	no_entry_flag=""
6064555991fdSmrg      else
6065555991fdSmrg	# If we're using GNU nm, then we don't want the "-C" option.
6066555991fdSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6067555991fdSmrg	# Also, AIX nm treats weak defined symbols like other global
6068555991fdSmrg	# defined symbols, whereas GNU nm marks them as "W".
6069555991fdSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6070555991fdSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6071555991fdSmrg	else
6072555991fdSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
6073555991fdSmrg	fi
6074555991fdSmrg	aix_use_runtimelinking=no
6075126a8a12Smrg
6076555991fdSmrg	# Test if we are trying to use run time linking or normal
6077555991fdSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6078555991fdSmrg	# need to do runtime linking.
6079555991fdSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6080555991fdSmrg	  for ld_flag in $LDFLAGS; do
6081555991fdSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6082555991fdSmrg	    aix_use_runtimelinking=yes
6083555991fdSmrg	    break
6084555991fdSmrg	  fi
6085555991fdSmrg	  done
6086555991fdSmrg	  ;;
6087555991fdSmrg	esac
6088126a8a12Smrg
6089555991fdSmrg	exp_sym_flag='-bexport'
6090555991fdSmrg	no_entry_flag='-bnoentry'
6091555991fdSmrg      fi
6092126a8a12Smrg
6093555991fdSmrg      # When large executables or shared objects are built, AIX ld can
6094555991fdSmrg      # have problems creating the table of contents.  If linking a library
6095555991fdSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
6096555991fdSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6097555991fdSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6098126a8a12Smrg
6099555991fdSmrg      _LT_TAGVAR(archive_cmds, $1)=''
6100555991fdSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6101555991fdSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6102555991fdSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6103555991fdSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6104555991fdSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6105126a8a12Smrg
6106555991fdSmrg      if test "$GCC" = yes; then
6107555991fdSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6108555991fdSmrg	# We only want to do this on AIX 4.2 and lower, the check
6109555991fdSmrg	# below for broken collect2 doesn't work under 4.3+
6110555991fdSmrg	  collect2name=`${CC} -print-prog-name=collect2`
6111555991fdSmrg	  if test -f "$collect2name" &&
6112555991fdSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6113555991fdSmrg	  then
6114555991fdSmrg	  # We have reworked collect2
6115555991fdSmrg	  :
6116555991fdSmrg	  else
6117555991fdSmrg	  # We have old collect2
6118555991fdSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6119555991fdSmrg	  # It fails to find uninstalled libraries when the uninstalled
6120555991fdSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
6121555991fdSmrg	  # to unsupported forces relinking
6122555991fdSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6123555991fdSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6124555991fdSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6125555991fdSmrg	  fi
6126555991fdSmrg	  ;;
6127555991fdSmrg	esac
6128555991fdSmrg	shared_flag='-shared'
6129555991fdSmrg	if test "$aix_use_runtimelinking" = yes; then
6130555991fdSmrg	  shared_flag="$shared_flag "'${wl}-G'
6131555991fdSmrg	fi
6132555991fdSmrg      else
6133555991fdSmrg	# not using gcc
6134555991fdSmrg	if test "$host_cpu" = ia64; then
6135555991fdSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6136555991fdSmrg	# chokes on -Wl,-G. The following line is correct:
6137555991fdSmrg	  shared_flag='-G'
6138555991fdSmrg	else
6139555991fdSmrg	  if test "$aix_use_runtimelinking" = yes; then
6140555991fdSmrg	    shared_flag='${wl}-G'
6141555991fdSmrg	  else
6142555991fdSmrg	    shared_flag='${wl}-bM:SRE'
6143555991fdSmrg	  fi
6144555991fdSmrg	fi
6145555991fdSmrg      fi
6146126a8a12Smrg
6147555991fdSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6148555991fdSmrg      # It seems that -bexpall does not export symbols beginning with
6149555991fdSmrg      # underscore (_), so it is better to generate a list of symbols to export.
6150555991fdSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
6151555991fdSmrg      if test "$aix_use_runtimelinking" = yes; then
6152555991fdSmrg	# Warning - without using the other runtime loading flags (-brtl),
6153555991fdSmrg	# -berok will link without error, but may produce a broken library.
6154555991fdSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6155555991fdSmrg        # Determine the default libpath from the value encoded in an
6156555991fdSmrg        # empty executable.
61573c15da26Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
6158555991fdSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6159555991fdSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6160555991fdSmrg      else
6161555991fdSmrg	if test "$host_cpu" = ia64; then
6162555991fdSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6163555991fdSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6164555991fdSmrg	  _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"
6165555991fdSmrg	else
6166555991fdSmrg	 # Determine the default libpath from the value encoded in an
6167555991fdSmrg	 # empty executable.
61683c15da26Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
6169555991fdSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6170555991fdSmrg	  # Warning - without using the other run time loading flags,
6171555991fdSmrg	  # -berok will link without error, but may produce a broken library.
6172555991fdSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6173555991fdSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6174555991fdSmrg	  if test "$with_gnu_ld" = yes; then
6175555991fdSmrg	    # We only use this code for GNU lds that support --whole-archive.
6176555991fdSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6177555991fdSmrg	  else
6178555991fdSmrg	    # Exported symbols can be pulled into shared objects from archives
6179555991fdSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6180555991fdSmrg	  fi
6181555991fdSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6182555991fdSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
6183555991fdSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6184555991fdSmrg	fi
6185555991fdSmrg      fi
6186555991fdSmrg      ;;
6187126a8a12Smrg
6188555991fdSmrg    amigaos*)
6189555991fdSmrg      case $host_cpu in
6190555991fdSmrg      powerpc)
6191555991fdSmrg            # see comment about AmigaOS4 .so support
6192555991fdSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6193555991fdSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6194555991fdSmrg        ;;
6195555991fdSmrg      m68k)
6196555991fdSmrg            _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)'
6197555991fdSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6198555991fdSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6199555991fdSmrg        ;;
6200555991fdSmrg      esac
6201555991fdSmrg      ;;
6202126a8a12Smrg
6203555991fdSmrg    bsdi[[45]]*)
6204555991fdSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6205555991fdSmrg      ;;
6206126a8a12Smrg
6207555991fdSmrg    cygwin* | mingw* | pw32* | cegcc*)
6208555991fdSmrg      # When not using gcc, we currently assume that we are using
6209555991fdSmrg      # Microsoft Visual C++.
6210555991fdSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
6211555991fdSmrg      # no search path for DLLs.
62123c15da26Smrg      case $cc_basename in
62133c15da26Smrg      cl*)
62143c15da26Smrg	# Native MSVC
62153c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
62163c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
62173c15da26Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
62183c15da26Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
62193c15da26Smrg	# Tell ltmain to make .lib files, not .a files.
62203c15da26Smrg	libext=lib
62213c15da26Smrg	# Tell ltmain to make .dll files, not .so files.
62223c15da26Smrg	shrext_cmds=".dll"
62233c15da26Smrg	# FIXME: Setting linknames here is a bad hack.
62243c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
62253c15da26Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
62263c15da26Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
62273c15da26Smrg	  else
62283c15da26Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
62293c15da26Smrg	  fi~
62303c15da26Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
62313c15da26Smrg	  linknames='
62323c15da26Smrg	# The linker will not automatically build a static lib if we build a DLL.
62333c15da26Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
62343c15da26Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
62353c15da26Smrg	_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'
62363c15da26Smrg	# Don't use ranlib
62373c15da26Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
62383c15da26Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
62393c15da26Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
62403c15da26Smrg	  case $lt_outputfile in
62413c15da26Smrg	    *.exe|*.EXE) ;;
62423c15da26Smrg	    *)
62433c15da26Smrg	      lt_outputfile="$lt_outputfile.exe"
62443c15da26Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
62453c15da26Smrg	      ;;
62463c15da26Smrg	  esac~
62473c15da26Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
62483c15da26Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
62493c15da26Smrg	    $RM "$lt_outputfile.manifest";
62503c15da26Smrg	  fi'
62513c15da26Smrg	;;
62523c15da26Smrg      *)
62533c15da26Smrg	# Assume MSVC wrapper
62543c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
62553c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
62563c15da26Smrg	# Tell ltmain to make .lib files, not .a files.
62573c15da26Smrg	libext=lib
62583c15da26Smrg	# Tell ltmain to make .dll files, not .so files.
62593c15da26Smrg	shrext_cmds=".dll"
62603c15da26Smrg	# FIXME: Setting linknames here is a bad hack.
62613c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
62623c15da26Smrg	# The linker will automatically build a .lib file if we build a DLL.
62633c15da26Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
62643c15da26Smrg	# FIXME: Should let the user specify the lib program.
62653c15da26Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
62663c15da26Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
62673c15da26Smrg	;;
62683c15da26Smrg      esac
6269555991fdSmrg      ;;
6270126a8a12Smrg
6271555991fdSmrg    darwin* | rhapsody*)
6272555991fdSmrg      _LT_DARWIN_LINKER_FEATURES($1)
6273555991fdSmrg      ;;
6274126a8a12Smrg
6275555991fdSmrg    dgux*)
6276555991fdSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6277555991fdSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6278555991fdSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6279555991fdSmrg      ;;
6280126a8a12Smrg
62813c15da26Smrg    freebsd1*)
62823c15da26Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
62833c15da26Smrg      ;;
62843c15da26Smrg
62853c15da26Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
62863c15da26Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
62873c15da26Smrg    # does not break anything, and helps significantly (at the cost of a little
62883c15da26Smrg    # extra space).
62893c15da26Smrg    freebsd2.2*)
62903c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
62913c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
62923c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62933c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62943c15da26Smrg      ;;
62953c15da26Smrg
62963c15da26Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
62973c15da26Smrg    freebsd2*)
62983c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
62993c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63003c15da26Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
63013c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63023c15da26Smrg      ;;
63033c15da26Smrg
63043c15da26Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
63053c15da26Smrg    freebsd* | dragonfly*)
63063c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
63073c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
63083c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63093c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63103c15da26Smrg      ;;
63113c15da26Smrg
63123c15da26Smrg    hpux9*)
63133c15da26Smrg      if test "$GCC" = yes; then
63143c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
63153c15da26Smrg      else
63163c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
63173c15da26Smrg      fi
63183c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
63193c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63203c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63213c15da26Smrg
63223c15da26Smrg      # hardcode_minus_L: Not really in the search PATH,
63233c15da26Smrg      # but as the default location of the library.
63243c15da26Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
63253c15da26Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63263c15da26Smrg      ;;
63273c15da26Smrg
63283c15da26Smrg    hpux10*)
63293c15da26Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
63303c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
63313c15da26Smrg      else
63323c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
63333c15da26Smrg      fi
63343c15da26Smrg      if test "$with_gnu_ld" = no; then
63353c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
63363c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
63373c15da26Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
63383c15da26Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
63393c15da26Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63403c15da26Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63413c15da26Smrg	# hardcode_minus_L: Not really in the search PATH,
63423c15da26Smrg	# but as the default location of the library.
63433c15da26Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
63443c15da26Smrg      fi
63453c15da26Smrg      ;;
63463c15da26Smrg
63473c15da26Smrg    hpux11*)
63483c15da26Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
63493c15da26Smrg	case $host_cpu in
63503c15da26Smrg	hppa*64*)
63513c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
63523c15da26Smrg	  ;;
63533c15da26Smrg	ia64*)
63543c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
63553c15da26Smrg	  ;;
63563c15da26Smrg	*)
63573c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
63583c15da26Smrg	  ;;
63593c15da26Smrg	esac
63603c15da26Smrg      else
63613c15da26Smrg	case $host_cpu in
63623c15da26Smrg	hppa*64*)
63633c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
63643c15da26Smrg	  ;;
63653c15da26Smrg	ia64*)
63663c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
63673c15da26Smrg	  ;;
63683c15da26Smrg	*)
63693c15da26Smrg	m4_if($1, [], [
63703c15da26Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
63713c15da26Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
63723c15da26Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
63733c15da26Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
63743c15da26Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
63753c15da26Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
63763c15da26Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
63773c15da26Smrg	  ;;
63783c15da26Smrg	esac
63793c15da26Smrg      fi
63803c15da26Smrg      if test "$with_gnu_ld" = no; then
63813c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
63823c15da26Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
63833c15da26Smrg
63843c15da26Smrg	case $host_cpu in
63853c15da26Smrg	hppa*64*|ia64*)
63863c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
63873c15da26Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63883c15da26Smrg	  ;;
63893c15da26Smrg	*)
63903c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
63913c15da26Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63923c15da26Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63933c15da26Smrg
63943c15da26Smrg	  # hardcode_minus_L: Not really in the search PATH,
63953c15da26Smrg	  # but as the default location of the library.
63963c15da26Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
63973c15da26Smrg	  ;;
63983c15da26Smrg	esac
63993c15da26Smrg      fi
64003c15da26Smrg      ;;
64013c15da26Smrg
64023c15da26Smrg    irix5* | irix6* | nonstopux*)
64033c15da26Smrg      if test "$GCC" = yes; then
64043c15da26Smrg	_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'
64053c15da26Smrg	# Try to use the -exported_symbol ld option, if it does not
64063c15da26Smrg	# work, assume that -exports_file does not work either and
64073c15da26Smrg	# implicitly export all symbols.
64083c15da26Smrg	# This should be the same for all languages, so no per-tag cache variable.
64093c15da26Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
64103c15da26Smrg	  [lt_cv_irix_exported_symbol],
64113c15da26Smrg	  [save_LDFLAGS="$LDFLAGS"
64123c15da26Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
64133c15da26Smrg	   AC_LINK_IFELSE(
64143c15da26Smrg	     [AC_LANG_SOURCE(
64153c15da26Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
64163c15da26Smrg			      [C++], [[int foo (void) { return 0; }]],
64173c15da26Smrg			      [Fortran 77], [[
64183c15da26Smrg      subroutine foo
64193c15da26Smrg      end]],
64203c15da26Smrg			      [Fortran], [[
64213c15da26Smrg      subroutine foo
64223c15da26Smrg      end]])])],
64233c15da26Smrg	      [lt_cv_irix_exported_symbol=yes],
64243c15da26Smrg	      [lt_cv_irix_exported_symbol=no])
64253c15da26Smrg           LDFLAGS="$save_LDFLAGS"])
64263c15da26Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
64273c15da26Smrg          _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'
64283c15da26Smrg	fi
64293c15da26Smrg      else
64303c15da26Smrg	_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'
64313c15da26Smrg	_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'
64323c15da26Smrg      fi
64333c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
64343c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64353c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64363c15da26Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
64373c15da26Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
64383c15da26Smrg      ;;
64393c15da26Smrg
64403c15da26Smrg    netbsd*)
64413c15da26Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
64423c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
64433c15da26Smrg      else
64443c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
64453c15da26Smrg      fi
64463c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64473c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
64483c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64493c15da26Smrg      ;;
64503c15da26Smrg
64513c15da26Smrg    newsos6)
64523c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
64533c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
64543c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64553c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64563c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64573c15da26Smrg      ;;
64583c15da26Smrg
64593c15da26Smrg    *nto* | *qnx*)
64603c15da26Smrg      ;;
64613c15da26Smrg
64623c15da26Smrg    openbsd*)
64633c15da26Smrg      if test -f /usr/libexec/ld.so; then
64643c15da26Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
64653c15da26Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64663c15da26Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
64673c15da26Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
64683c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
64693c15da26Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
64703c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64713c15da26Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
64723c15da26Smrg	else
64733c15da26Smrg	  case $host_os in
64743c15da26Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
64753c15da26Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
64763c15da26Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64773c15da26Smrg	     ;;
64783c15da26Smrg	   *)
64793c15da26Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
64803c15da26Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64813c15da26Smrg	     ;;
64823c15da26Smrg	  esac
64833c15da26Smrg	fi
64843c15da26Smrg      else
64853c15da26Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
64863c15da26Smrg      fi
64873c15da26Smrg      ;;
64883c15da26Smrg
64893c15da26Smrg    os2*)
64903c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
64913c15da26Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
64923c15da26Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
64933c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
64943c15da26Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
64953c15da26Smrg      ;;
64963c15da26Smrg
64973c15da26Smrg    osf3*)
64983c15da26Smrg      if test "$GCC" = yes; then
64993c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
65003c15da26Smrg	_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'
65013c15da26Smrg      else
65023c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
65033c15da26Smrg	_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'
65043c15da26Smrg      fi
65053c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
65063c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65073c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
65083c15da26Smrg      ;;
65093c15da26Smrg
65103c15da26Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
65113c15da26Smrg      if test "$GCC" = yes; then
65123c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
65133c15da26Smrg	_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'
65143c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65153c15da26Smrg      else
65163c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
65173c15da26Smrg	_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'
65183c15da26Smrg	_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~
65193c15da26Smrg	$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'
65203c15da26Smrg
65213c15da26Smrg	# Both c and cxx compiler support -rpath directly
65223c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
65233c15da26Smrg      fi
65243c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
65253c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
65263c15da26Smrg      ;;
65273c15da26Smrg
65283c15da26Smrg    solaris*)
65293c15da26Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
65303c15da26Smrg      if test "$GCC" = yes; then
65313c15da26Smrg	wlarc='${wl}'
65323c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
65333c15da26Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
65343c15da26Smrg	  $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'
65353c15da26Smrg      else
65363c15da26Smrg	case `$CC -V 2>&1` in
65373c15da26Smrg	*"Compilers 5.0"*)
65383c15da26Smrg	  wlarc=''
65393c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
65403c15da26Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
65413c15da26Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
65423c15da26Smrg	  ;;
65433c15da26Smrg	*)
65443c15da26Smrg	  wlarc='${wl}'
65453c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
65463c15da26Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
65473c15da26Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
65483c15da26Smrg	  ;;
65493c15da26Smrg	esac
65503c15da26Smrg      fi
65513c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65523c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65533c15da26Smrg      case $host_os in
65543c15da26Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
65553c15da26Smrg      *)
65563c15da26Smrg	# The compiler driver will combine and reorder linker options,
65573c15da26Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
65583c15da26Smrg	# but is careful enough not to reorder.
65593c15da26Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
65603c15da26Smrg	if test "$GCC" = yes; then
65613c15da26Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
65623c15da26Smrg	else
65633c15da26Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
65643c15da26Smrg	fi
65653c15da26Smrg	;;
65663c15da26Smrg      esac
65673c15da26Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
65683c15da26Smrg      ;;
65693c15da26Smrg
65703c15da26Smrg    sunos4*)
65713c15da26Smrg      if test "x$host_vendor" = xsequent; then
65723c15da26Smrg	# Use $CC to link under sequent, because it throws in some extra .o
65733c15da26Smrg	# files that make .init and .fini sections work.
65743c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
65753c15da26Smrg      else
65763c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
65773c15da26Smrg      fi
65783c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65793c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
65803c15da26Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
65813c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65823c15da26Smrg      ;;
65833c15da26Smrg
65843c15da26Smrg    sysv4)
65853c15da26Smrg      case $host_vendor in
65863c15da26Smrg	sni)
65873c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65883c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
65893c15da26Smrg	;;
65903c15da26Smrg	siemens)
65913c15da26Smrg	  ## LD is ld it makes a PLAMLIB
65923c15da26Smrg	  ## CC just makes a GrossModule.
65933c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
65943c15da26Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
65953c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
65963c15da26Smrg        ;;
65973c15da26Smrg	motorola)
65983c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65993c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
66003c15da26Smrg	;;
66013c15da26Smrg      esac
66023c15da26Smrg      runpath_var='LD_RUN_PATH'
66033c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66043c15da26Smrg      ;;
66053c15da26Smrg
66063c15da26Smrg    sysv4.3*)
66073c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66083c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66093c15da26Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
66103c15da26Smrg      ;;
66113c15da26Smrg
66123c15da26Smrg    sysv4*MP*)
66133c15da26Smrg      if test -d /usr/nec; then
66143c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66153c15da26Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66163c15da26Smrg	runpath_var=LD_RUN_PATH
66173c15da26Smrg	hardcode_runpath_var=yes
66183c15da26Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
66193c15da26Smrg      fi
66203c15da26Smrg      ;;
66213c15da26Smrg
66223c15da26Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
66233c15da26Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
66243c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
66253c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66263c15da26Smrg      runpath_var='LD_RUN_PATH'
66273c15da26Smrg
66283c15da26Smrg      if test "$GCC" = yes; then
66293c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66303c15da26Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66313c15da26Smrg      else
66323c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66333c15da26Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66343c15da26Smrg      fi
66353c15da26Smrg      ;;
66363c15da26Smrg
66373c15da26Smrg    sysv5* | sco3.2v5* | sco5v6*)
66383c15da26Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
66393c15da26Smrg      # link with -lc, and that would cause any symbols used from libc to
66403c15da26Smrg      # always be unresolved, which means just about no library would
66413c15da26Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
66423c15da26Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
66433c15da26Smrg      # as -z defs.
66443c15da26Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
66453c15da26Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
66463c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
66473c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66483c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
66493c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
66503c15da26Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
66513c15da26Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
66523c15da26Smrg      runpath_var='LD_RUN_PATH'
66533c15da26Smrg
66543c15da26Smrg      if test "$GCC" = yes; then
66553c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66563c15da26Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66573c15da26Smrg      else
66583c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66593c15da26Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66603c15da26Smrg      fi
66613c15da26Smrg      ;;
66623c15da26Smrg
66633c15da26Smrg    uts4*)
66643c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66653c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
66663c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66673c15da26Smrg      ;;
66683c15da26Smrg
66693c15da26Smrg    *)
66703c15da26Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
66713c15da26Smrg      ;;
66723c15da26Smrg    esac
66733c15da26Smrg
66743c15da26Smrg    if test x$host_vendor = xsni; then
66753c15da26Smrg      case $host in
66763c15da26Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
66773c15da26Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
66783c15da26Smrg	;;
66793c15da26Smrg      esac
66803c15da26Smrg    fi
66813c15da26Smrg  fi
66823c15da26Smrg])
66833c15da26SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
66843c15da26Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
66853c15da26Smrg
66863c15da26Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
66873c15da26Smrg
66883c15da26Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
66893c15da26Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
66903c15da26Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
66913c15da26Smrg    [The commands to extract the exported symbol list from a shared archive])
66923c15da26Smrg
66933c15da26Smrg#
66943c15da26Smrg# Do we need to explicitly link libc?
66953c15da26Smrg#
66963c15da26Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
66973c15da26Smrgx|xyes)
66983c15da26Smrg  # Assume -lc should be added
66993c15da26Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
67003c15da26Smrg
67013c15da26Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
67023c15da26Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
67033c15da26Smrg    *'~'*)
67043c15da26Smrg      # FIXME: we may have to deal with multi-command sequences.
67053c15da26Smrg      ;;
67063c15da26Smrg    '$CC '*)
67073c15da26Smrg      # Test whether the compiler implicitly links with -lc since on some
67083c15da26Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
67093c15da26Smrg      # to ld, don't add -lc before -lgcc.
67103c15da26Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
67113c15da26Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
67123c15da26Smrg	[$RM conftest*
67133c15da26Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
67143c15da26Smrg
67153c15da26Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
67163c15da26Smrg	  soname=conftest
67173c15da26Smrg	  lib=conftest
67183c15da26Smrg	  libobjs=conftest.$ac_objext
67193c15da26Smrg	  deplibs=
67203c15da26Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
67213c15da26Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
67223c15da26Smrg	  compiler_flags=-v
67233c15da26Smrg	  linker_flags=-v
67243c15da26Smrg	  verstring=
67253c15da26Smrg	  output_objdir=.
67263c15da26Smrg	  libname=conftest
67273c15da26Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
67283c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
67293c15da26Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
67303c15da26Smrg	  then
67313c15da26Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
67323c15da26Smrg	  else
67333c15da26Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
67343c15da26Smrg	  fi
67353c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
67363c15da26Smrg	else
67373c15da26Smrg	  cat conftest.err 1>&5
67383c15da26Smrg	fi
67393c15da26Smrg	$RM conftest*
67403c15da26Smrg	])
67413c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
67423c15da26Smrg      ;;
67433c15da26Smrg    esac
67443c15da26Smrg  fi
67453c15da26Smrg  ;;
67463c15da26Smrgesac
67473c15da26Smrg
67483c15da26Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
67493c15da26Smrg    [Whether or not to add -lc for building shared libraries])
67503c15da26Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
67513c15da26Smrg    [enable_shared_with_static_runtimes], [0],
67523c15da26Smrg    [Whether or not to disallow shared libs when runtime libs are static])
67533c15da26Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
67543c15da26Smrg    [Compiler flag to allow reflexive dlopens])
67553c15da26Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
67563c15da26Smrg    [Compiler flag to generate shared objects directly from archives])
67573c15da26Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
67583c15da26Smrg    [Whether the compiler copes with passing no objects directly])
67593c15da26Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
67603c15da26Smrg    [Create an old-style archive from a shared archive])
67613c15da26Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
67623c15da26Smrg    [Create a temporary old-style archive to link instead of a shared archive])
67633c15da26Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
67643c15da26Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
67653c15da26Smrg_LT_TAGDECL([], [module_cmds], [2],
67663c15da26Smrg    [Commands used to build a loadable module if different from building
67673c15da26Smrg    a shared archive.])
67683c15da26Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
67693c15da26Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
67703c15da26Smrg    [Whether we are building with GNU ld or not])
67713c15da26Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
67723c15da26Smrg    [Flag that allows shared libraries with undefined symbols to be built])
67733c15da26Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
67743c15da26Smrg    [Flag that enforces no undefined symbols])
67753c15da26Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
67763c15da26Smrg    [Flag to hardcode $libdir into a binary during linking.
67773c15da26Smrg    This must work even if $libdir does not exist])
67783c15da26Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
67793c15da26Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
67803c15da26Smrg    during linking.  This must work even if $libdir does not exist]])
67813c15da26Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
67823c15da26Smrg    [Whether we need a single "-rpath" flag with a separated argument])
67833c15da26Smrg_LT_TAGDECL([], [hardcode_direct], [0],
67843c15da26Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
67853c15da26Smrg    DIR into the resulting binary])
67863c15da26Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
67873c15da26Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
67883c15da26Smrg    DIR into the resulting binary and the resulting library dependency is
67893c15da26Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
67903c15da26Smrg    library is relocated])
67913c15da26Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
67923c15da26Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
67933c15da26Smrg    into the resulting binary])
67943c15da26Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
67953c15da26Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
67963c15da26Smrg    into the resulting binary])
67973c15da26Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
67983c15da26Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
67993c15da26Smrg    into the library and all subsequent libraries and executables linked
68003c15da26Smrg    against it])
68013c15da26Smrg_LT_TAGDECL([], [inherit_rpath], [0],
68023c15da26Smrg    [Set to yes if linker adds runtime paths of dependent libraries
68033c15da26Smrg    to runtime path list])
68043c15da26Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
68053c15da26Smrg    [Whether libtool must link a program against all its dependency libraries])
68063c15da26Smrg_LT_TAGDECL([], [always_export_symbols], [0],
68073c15da26Smrg    [Set to "yes" if exported symbols are required])
68083c15da26Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
68093c15da26Smrg    [The commands to list exported symbols])
68103c15da26Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
68113c15da26Smrg    [Symbols that should not be listed in the preloaded symbols])
68123c15da26Smrg_LT_TAGDECL([], [include_expsyms], [1],
68133c15da26Smrg    [Symbols that must always be exported])
68143c15da26Smrg_LT_TAGDECL([], [prelink_cmds], [2],
68153c15da26Smrg    [Commands necessary for linking programs (against libraries) with templates])
68163c15da26Smrg_LT_TAGDECL([], [postlink_cmds], [2],
68173c15da26Smrg    [Commands necessary for finishing linking programs])
68183c15da26Smrg_LT_TAGDECL([], [file_list_spec], [1],
68193c15da26Smrg    [Specify filename containing input files])
68203c15da26Smrgdnl FIXME: Not yet implemented
68213c15da26Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
68223c15da26Smrgdnl    [Compiler flag to generate thread safe objects])
68233c15da26Smrg])# _LT_LINKER_SHLIBS
68243c15da26Smrg
68253c15da26Smrg
68263c15da26Smrg# _LT_LANG_C_CONFIG([TAG])
68273c15da26Smrg# ------------------------
68283c15da26Smrg# Ensure that the configuration variables for a C compiler are suitably
68293c15da26Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
68303c15da26Smrg# the compiler configuration to `libtool'.
68313c15da26Smrgm4_defun([_LT_LANG_C_CONFIG],
68323c15da26Smrg[m4_require([_LT_DECL_EGREP])dnl
68333c15da26Smrglt_save_CC="$CC"
68343c15da26SmrgAC_LANG_PUSH(C)
68353c15da26Smrg
68363c15da26Smrg# Source file extension for C test sources.
68373c15da26Smrgac_ext=c
68383c15da26Smrg
68393c15da26Smrg# Object file extension for compiled C test sources.
68403c15da26Smrgobjext=o
68413c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
68423c15da26Smrg
68433c15da26Smrg# Code to be used in simple compile tests
68443c15da26Smrglt_simple_compile_test_code="int some_variable = 0;"
68453c15da26Smrg
68463c15da26Smrg# Code to be used in simple link tests
68473c15da26Smrglt_simple_link_test_code='int main(){return(0);}'
68483c15da26Smrg
68493c15da26Smrg_LT_TAG_COMPILER
68503c15da26Smrg# Save the default compiler, since it gets overwritten when the other
68513c15da26Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
68523c15da26Smrgcompiler_DEFAULT=$CC
68533c15da26Smrg
68543c15da26Smrg# save warnings/boilerplate of simple test code
68553c15da26Smrg_LT_COMPILER_BOILERPLATE
68563c15da26Smrg_LT_LINKER_BOILERPLATE
68573c15da26Smrg
68583c15da26Smrgif test -n "$compiler"; then
68593c15da26Smrg  _LT_COMPILER_NO_RTTI($1)
68603c15da26Smrg  _LT_COMPILER_PIC($1)
68613c15da26Smrg  _LT_COMPILER_C_O($1)
68623c15da26Smrg  _LT_COMPILER_FILE_LOCKS($1)
68633c15da26Smrg  _LT_LINKER_SHLIBS($1)
68643c15da26Smrg  _LT_SYS_DYNAMIC_LINKER($1)
68653c15da26Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
68663c15da26Smrg  LT_SYS_DLOPEN_SELF
68673c15da26Smrg  _LT_CMD_STRIPLIB
68683c15da26Smrg
68693c15da26Smrg  # Report which library types will actually be built
68703c15da26Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
68713c15da26Smrg  AC_MSG_RESULT([$can_build_shared])
68723c15da26Smrg
68733c15da26Smrg  AC_MSG_CHECKING([whether to build shared libraries])
68743c15da26Smrg  test "$can_build_shared" = "no" && enable_shared=no
68753c15da26Smrg
68763c15da26Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
68773c15da26Smrg  # are all built from PIC.
68783c15da26Smrg  case $host_os in
68793c15da26Smrg  aix3*)
68803c15da26Smrg    test "$enable_shared" = yes && enable_static=no
68813c15da26Smrg    if test -n "$RANLIB"; then
68823c15da26Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
68833c15da26Smrg      postinstall_cmds='$RANLIB $lib'
68843c15da26Smrg    fi
68853c15da26Smrg    ;;
68863c15da26Smrg
68873c15da26Smrg  aix[[4-9]]*)
68883c15da26Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
68893c15da26Smrg      test "$enable_shared" = yes && enable_static=no
68903c15da26Smrg    fi
68913c15da26Smrg    ;;
68923c15da26Smrg  esac
68933c15da26Smrg  AC_MSG_RESULT([$enable_shared])
68943c15da26Smrg
68953c15da26Smrg  AC_MSG_CHECKING([whether to build static libraries])
68963c15da26Smrg  # Make sure either enable_shared or enable_static is yes.
68973c15da26Smrg  test "$enable_shared" = yes || enable_static=yes
68983c15da26Smrg  AC_MSG_RESULT([$enable_static])
68993c15da26Smrg
69003c15da26Smrg  _LT_CONFIG($1)
69013c15da26Smrgfi
69023c15da26SmrgAC_LANG_POP
69033c15da26SmrgCC="$lt_save_CC"
69043c15da26Smrg])# _LT_LANG_C_CONFIG
69053c15da26Smrg
69063c15da26Smrg
69073c15da26Smrg# _LT_LANG_CXX_CONFIG([TAG])
69083c15da26Smrg# --------------------------
69093c15da26Smrg# Ensure that the configuration variables for a C++ compiler are suitably
69103c15da26Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
69113c15da26Smrg# the compiler configuration to `libtool'.
69123c15da26Smrgm4_defun([_LT_LANG_CXX_CONFIG],
69133c15da26Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
69143c15da26Smrgm4_require([_LT_DECL_EGREP])dnl
69153c15da26Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
69163c15da26Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
69173c15da26Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
69183c15da26Smrg    (test "X$CXX" != "Xg++"))) ; then
69193c15da26Smrg  AC_PROG_CXXCPP
69203c15da26Smrgelse
69213c15da26Smrg  _lt_caught_CXX_error=yes
69223c15da26Smrgfi
69233c15da26Smrg
69243c15da26SmrgAC_LANG_PUSH(C++)
69253c15da26Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
69263c15da26Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
69273c15da26Smrg_LT_TAGVAR(always_export_symbols, $1)=no
69283c15da26Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
69293c15da26Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
69303c15da26Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
69313c15da26Smrg_LT_TAGVAR(hardcode_direct, $1)=no
69323c15da26Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
69333c15da26Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
69343c15da26Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
69353c15da26Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
69363c15da26Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
69373c15da26Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
69383c15da26Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
69393c15da26Smrg_LT_TAGVAR(inherit_rpath, $1)=no
69403c15da26Smrg_LT_TAGVAR(module_cmds, $1)=
69413c15da26Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
69423c15da26Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
69433c15da26Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
69443c15da26Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
69453c15da26Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
69463c15da26Smrg_LT_TAGVAR(no_undefined_flag, $1)=
69473c15da26Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
69483c15da26Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
69493c15da26Smrg
69503c15da26Smrg# Source file extension for C++ test sources.
69513c15da26Smrgac_ext=cpp
69523c15da26Smrg
69533c15da26Smrg# Object file extension for compiled C++ test sources.
69543c15da26Smrgobjext=o
69553c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
69563c15da26Smrg
69573c15da26Smrg# No sense in running all these tests if we already determined that
69583c15da26Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
69593c15da26Smrg# are currently assumed to apply to all compilers on this platform,
69603c15da26Smrg# and will be corrupted by setting them based on a non-working compiler.
69613c15da26Smrgif test "$_lt_caught_CXX_error" != yes; then
69623c15da26Smrg  # Code to be used in simple compile tests
69633c15da26Smrg  lt_simple_compile_test_code="int some_variable = 0;"
69643c15da26Smrg
69653c15da26Smrg  # Code to be used in simple link tests
69663c15da26Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
69673c15da26Smrg
69683c15da26Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
69693c15da26Smrg  _LT_TAG_COMPILER
69703c15da26Smrg
69713c15da26Smrg  # save warnings/boilerplate of simple test code
69723c15da26Smrg  _LT_COMPILER_BOILERPLATE
69733c15da26Smrg  _LT_LINKER_BOILERPLATE
69743c15da26Smrg
69753c15da26Smrg  # Allow CC to be a program name with arguments.
69763c15da26Smrg  lt_save_CC=$CC
69773c15da26Smrg  lt_save_CFLAGS=$CFLAGS
69783c15da26Smrg  lt_save_LD=$LD
69793c15da26Smrg  lt_save_GCC=$GCC
69803c15da26Smrg  GCC=$GXX
69813c15da26Smrg  lt_save_with_gnu_ld=$with_gnu_ld
69823c15da26Smrg  lt_save_path_LD=$lt_cv_path_LD
69833c15da26Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
69843c15da26Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
69853c15da26Smrg  else
69863c15da26Smrg    $as_unset lt_cv_prog_gnu_ld
69873c15da26Smrg  fi
69883c15da26Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
69893c15da26Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
69903c15da26Smrg  else
69913c15da26Smrg    $as_unset lt_cv_path_LD
69923c15da26Smrg  fi
69933c15da26Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
69943c15da26Smrg  CC=${CXX-"c++"}
69953c15da26Smrg  CFLAGS=$CXXFLAGS
69963c15da26Smrg  compiler=$CC
69973c15da26Smrg  _LT_TAGVAR(compiler, $1)=$CC
69983c15da26Smrg  _LT_CC_BASENAME([$compiler])
69993c15da26Smrg
70003c15da26Smrg  if test -n "$compiler"; then
70013c15da26Smrg    # We don't want -fno-exception when compiling C++ code, so set the
70023c15da26Smrg    # no_builtin_flag separately
70033c15da26Smrg    if test "$GXX" = yes; then
70043c15da26Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
70053c15da26Smrg    else
70063c15da26Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
70073c15da26Smrg    fi
70083c15da26Smrg
70093c15da26Smrg    if test "$GXX" = yes; then
70103c15da26Smrg      # Set up default GNU C++ configuration
70113c15da26Smrg
70123c15da26Smrg      LT_PATH_LD
70133c15da26Smrg
70143c15da26Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
70153c15da26Smrg      # archiving commands below assume that GNU ld is being used.
70163c15da26Smrg      if test "$with_gnu_ld" = yes; then
70173c15da26Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
70183c15da26Smrg        _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'
70193c15da26Smrg
70203c15da26Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
70213c15da26Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
70223c15da26Smrg
70233c15da26Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
70243c15da26Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
70253c15da26Smrg        #     investigate it a little bit more. (MM)
70263c15da26Smrg        wlarc='${wl}'
70273c15da26Smrg
70283c15da26Smrg        # ancient GNU ld didn't support --whole-archive et. al.
70293c15da26Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
70303c15da26Smrg	  $GREP 'no-whole-archive' > /dev/null; then
70313c15da26Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
70323c15da26Smrg        else
70333c15da26Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
70343c15da26Smrg        fi
70353c15da26Smrg      else
70363c15da26Smrg        with_gnu_ld=no
70373c15da26Smrg        wlarc=
70383c15da26Smrg
70393c15da26Smrg        # A generic and very simple default shared library creation
70403c15da26Smrg        # command for GNU C++ for the case where it uses the native
70413c15da26Smrg        # linker, instead of GNU ld.  If possible, this setting should
70423c15da26Smrg        # overridden to take advantage of the native linker features on
70433c15da26Smrg        # the platform it is being used on.
70443c15da26Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
70453c15da26Smrg      fi
70463c15da26Smrg
70473c15da26Smrg      # Commands to make compiler produce verbose output that lists
70483c15da26Smrg      # what "hidden" libraries, object files and flags are used when
70493c15da26Smrg      # linking a shared library.
70503c15da26Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
70513c15da26Smrg
70523c15da26Smrg    else
70533c15da26Smrg      GXX=no
70543c15da26Smrg      with_gnu_ld=no
70553c15da26Smrg      wlarc=
70563c15da26Smrg    fi
70573c15da26Smrg
70583c15da26Smrg    # PORTME: fill in a description of your system's C++ link characteristics
70593c15da26Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
70603c15da26Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
70613c15da26Smrg    case $host_os in
70623c15da26Smrg      aix3*)
70633c15da26Smrg        # FIXME: insert proper C++ library support
70643c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
70653c15da26Smrg        ;;
70663c15da26Smrg      aix[[4-9]]*)
70673c15da26Smrg        if test "$host_cpu" = ia64; then
70683c15da26Smrg          # On IA64, the linker does run time linking by default, so we don't
70693c15da26Smrg          # have to do anything special.
70703c15da26Smrg          aix_use_runtimelinking=no
70713c15da26Smrg          exp_sym_flag='-Bexport'
70723c15da26Smrg          no_entry_flag=""
70733c15da26Smrg        else
70743c15da26Smrg          aix_use_runtimelinking=no
70753c15da26Smrg
70763c15da26Smrg          # Test if we are trying to use run time linking or normal
70773c15da26Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
70783c15da26Smrg          # need to do runtime linking.
70793c15da26Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
70803c15da26Smrg	    for ld_flag in $LDFLAGS; do
70813c15da26Smrg	      case $ld_flag in
70823c15da26Smrg	      *-brtl*)
70833c15da26Smrg	        aix_use_runtimelinking=yes
70843c15da26Smrg	        break
70853c15da26Smrg	        ;;
70863c15da26Smrg	      esac
70873c15da26Smrg	    done
70883c15da26Smrg	    ;;
70893c15da26Smrg          esac
70903c15da26Smrg
70913c15da26Smrg          exp_sym_flag='-bexport'
70923c15da26Smrg          no_entry_flag='-bnoentry'
70933c15da26Smrg        fi
70943c15da26Smrg
70953c15da26Smrg        # When large executables or shared objects are built, AIX ld can
70963c15da26Smrg        # have problems creating the table of contents.  If linking a library
70973c15da26Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
70983c15da26Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
70993c15da26Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
71003c15da26Smrg
71013c15da26Smrg        _LT_TAGVAR(archive_cmds, $1)=''
71023c15da26Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
71033c15da26Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
71043c15da26Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
71053c15da26Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
71063c15da26Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
71073c15da26Smrg
71083c15da26Smrg        if test "$GXX" = yes; then
71093c15da26Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
71103c15da26Smrg          # We only want to do this on AIX 4.2 and lower, the check
71113c15da26Smrg          # below for broken collect2 doesn't work under 4.3+
71123c15da26Smrg	  collect2name=`${CC} -print-prog-name=collect2`
71133c15da26Smrg	  if test -f "$collect2name" &&
71143c15da26Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
71153c15da26Smrg	  then
71163c15da26Smrg	    # We have reworked collect2
71173c15da26Smrg	    :
71183c15da26Smrg	  else
71193c15da26Smrg	    # We have old collect2
71203c15da26Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
71213c15da26Smrg	    # It fails to find uninstalled libraries when the uninstalled
71223c15da26Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
71233c15da26Smrg	    # to unsupported forces relinking
71243c15da26Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
71253c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
71263c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
71273c15da26Smrg	  fi
71283c15da26Smrg          esac
71293c15da26Smrg          shared_flag='-shared'
71303c15da26Smrg	  if test "$aix_use_runtimelinking" = yes; then
71313c15da26Smrg	    shared_flag="$shared_flag "'${wl}-G'
71323c15da26Smrg	  fi
71333c15da26Smrg        else
71343c15da26Smrg          # not using gcc
71353c15da26Smrg          if test "$host_cpu" = ia64; then
71363c15da26Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
71373c15da26Smrg	  # chokes on -Wl,-G. The following line is correct:
71383c15da26Smrg	  shared_flag='-G'
71393c15da26Smrg          else
71403c15da26Smrg	    if test "$aix_use_runtimelinking" = yes; then
71413c15da26Smrg	      shared_flag='${wl}-G'
71423c15da26Smrg	    else
71433c15da26Smrg	      shared_flag='${wl}-bM:SRE'
71443c15da26Smrg	    fi
71453c15da26Smrg          fi
71463c15da26Smrg        fi
71473c15da26Smrg
71483c15da26Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
71493c15da26Smrg        # It seems that -bexpall does not export symbols beginning with
71503c15da26Smrg        # underscore (_), so it is better to generate a list of symbols to
71513c15da26Smrg	# export.
71523c15da26Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
71533c15da26Smrg        if test "$aix_use_runtimelinking" = yes; then
71543c15da26Smrg          # Warning - without using the other runtime loading flags (-brtl),
71553c15da26Smrg          # -berok will link without error, but may produce a broken library.
71563c15da26Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
71573c15da26Smrg          # Determine the default libpath from the value encoded in an empty
71583c15da26Smrg          # executable.
71593c15da26Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
71603c15da26Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
71613c15da26Smrg
71623c15da26Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
71633c15da26Smrg        else
71643c15da26Smrg          if test "$host_cpu" = ia64; then
71653c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
71663c15da26Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
71673c15da26Smrg	    _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"
71683c15da26Smrg          else
71693c15da26Smrg	    # Determine the default libpath from the value encoded in an
71703c15da26Smrg	    # empty executable.
71713c15da26Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
71723c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
71733c15da26Smrg	    # Warning - without using the other run time loading flags,
71743c15da26Smrg	    # -berok will link without error, but may produce a broken library.
71753c15da26Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
71763c15da26Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
71773c15da26Smrg	    if test "$with_gnu_ld" = yes; then
71783c15da26Smrg	      # We only use this code for GNU lds that support --whole-archive.
71793c15da26Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
71803c15da26Smrg	    else
71813c15da26Smrg	      # Exported symbols can be pulled into shared objects from archives
71823c15da26Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
71833c15da26Smrg	    fi
71843c15da26Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
71853c15da26Smrg	    # This is similar to how AIX traditionally builds its shared
71863c15da26Smrg	    # libraries.
71873c15da26Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
71883c15da26Smrg          fi
71893c15da26Smrg        fi
71903c15da26Smrg        ;;
71913c15da26Smrg
71923c15da26Smrg      beos*)
71933c15da26Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
71943c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
71953c15da26Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
71963c15da26Smrg	  # support --undefined.  This deserves some investigation.  FIXME
71973c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
71983c15da26Smrg	else
71993c15da26Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
72003c15da26Smrg	fi
72013c15da26Smrg	;;
72023c15da26Smrg
72033c15da26Smrg      chorus*)
72043c15da26Smrg        case $cc_basename in
72053c15da26Smrg          *)
72063c15da26Smrg	  # FIXME: insert proper C++ library support
72073c15da26Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
72083c15da26Smrg	  ;;
72093c15da26Smrg        esac
72103c15da26Smrg        ;;
72113c15da26Smrg
72123c15da26Smrg      cygwin* | mingw* | pw32* | cegcc*)
72133c15da26Smrg	case $GXX,$cc_basename in
72143c15da26Smrg	,cl* | no,cl*)
72153c15da26Smrg	  # Native MSVC
72163c15da26Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
72173c15da26Smrg	  # no search path for DLLs.
72183c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
72193c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
72203c15da26Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
72213c15da26Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
72223c15da26Smrg	  # Tell ltmain to make .lib files, not .a files.
72233c15da26Smrg	  libext=lib
72243c15da26Smrg	  # Tell ltmain to make .dll files, not .so files.
72253c15da26Smrg	  shrext_cmds=".dll"
72263c15da26Smrg	  # FIXME: Setting linknames here is a bad hack.
72273c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
72283c15da26Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
72293c15da26Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
72303c15da26Smrg	    else
72313c15da26Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
72323c15da26Smrg	    fi~
72333c15da26Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
72343c15da26Smrg	    linknames='
72353c15da26Smrg	  # The linker will not automatically build a static lib if we build a DLL.
72363c15da26Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
72373c15da26Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
72383c15da26Smrg	  # Don't use ranlib
72393c15da26Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
72403c15da26Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
72413c15da26Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
72423c15da26Smrg	    case $lt_outputfile in
72433c15da26Smrg	      *.exe|*.EXE) ;;
72443c15da26Smrg	      *)
72453c15da26Smrg		lt_outputfile="$lt_outputfile.exe"
72463c15da26Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
72473c15da26Smrg		;;
72483c15da26Smrg	    esac~
72493c15da26Smrg	    func_to_tool_file "$lt_outputfile"~
72503c15da26Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
72513c15da26Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
72523c15da26Smrg	      $RM "$lt_outputfile.manifest";
72533c15da26Smrg	    fi'
72543c15da26Smrg	  ;;
72553c15da26Smrg	*)
72563c15da26Smrg	  # g++
72573c15da26Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
72583c15da26Smrg	  # as there is no search path for DLLs.
72593c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
72603c15da26Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
72613c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
72623c15da26Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
72633c15da26Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
72643c15da26Smrg
72653c15da26Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
72663c15da26Smrg	    _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'
72673c15da26Smrg	    # If the export-symbols file already is a .def file (1st line
72683c15da26Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
72693c15da26Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
72703c15da26Smrg	      cp $export_symbols $output_objdir/$soname.def;
72713c15da26Smrg	    else
72723c15da26Smrg	      echo EXPORTS > $output_objdir/$soname.def;
72733c15da26Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
72743c15da26Smrg	    fi~
72753c15da26Smrg	    $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'
72763c15da26Smrg	  else
72773c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72783c15da26Smrg	  fi
72793c15da26Smrg	  ;;
72803c15da26Smrg	esac
72813c15da26Smrg	;;
72823c15da26Smrg      darwin* | rhapsody*)
72833c15da26Smrg        _LT_DARWIN_LINKER_FEATURES($1)
72843c15da26Smrg	;;
72853c15da26Smrg
72863c15da26Smrg      dgux*)
72873c15da26Smrg        case $cc_basename in
72883c15da26Smrg          ec++*)
72893c15da26Smrg	    # FIXME: insert proper C++ library support
72903c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72913c15da26Smrg	    ;;
72923c15da26Smrg          ghcx*)
72933c15da26Smrg	    # Green Hills C++ Compiler
72943c15da26Smrg	    # FIXME: insert proper C++ library support
72953c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72963c15da26Smrg	    ;;
72973c15da26Smrg          *)
72983c15da26Smrg	    # FIXME: insert proper C++ library support
72993c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73003c15da26Smrg	    ;;
73013c15da26Smrg        esac
73023c15da26Smrg        ;;
73033c15da26Smrg
73043c15da26Smrg      freebsd[[12]]*)
73053c15da26Smrg        # C++ shared libraries reported to be fairly broken before
73063c15da26Smrg	# switch to ELF
73073c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
73083c15da26Smrg        ;;
73093c15da26Smrg
73103c15da26Smrg      freebsd-elf*)
73113c15da26Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
73123c15da26Smrg        ;;
73133c15da26Smrg
73143c15da26Smrg      freebsd* | dragonfly*)
73153c15da26Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
73163c15da26Smrg        # conventions
73173c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
73183c15da26Smrg        ;;
73193c15da26Smrg
73203c15da26Smrg      gnu*)
73213c15da26Smrg        ;;
73223c15da26Smrg
73233c15da26Smrg      haiku*)
73243c15da26Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
73253c15da26Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
73263c15da26Smrg        ;;
73273c15da26Smrg
73283c15da26Smrg      hpux9*)
73293c15da26Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
73303c15da26Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
73313c15da26Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73323c15da26Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
73333c15da26Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
73343c15da26Smrg				             # but as the default
73353c15da26Smrg				             # location of the library.
73363c15da26Smrg
73373c15da26Smrg        case $cc_basename in
73383c15da26Smrg          CC*)
73393c15da26Smrg            # FIXME: insert proper C++ library support
73403c15da26Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
73413c15da26Smrg            ;;
73423c15da26Smrg          aCC*)
73433c15da26Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
73443c15da26Smrg            # Commands to make compiler produce verbose output that lists
73453c15da26Smrg            # what "hidden" libraries, object files and flags are used when
73463c15da26Smrg            # linking a shared library.
73473c15da26Smrg            #
73483c15da26Smrg            # There doesn't appear to be a way to prevent this compiler from
73493c15da26Smrg            # explicitly linking system object files so we need to strip them
73503c15da26Smrg            # from the output so that they don't get included in the library
73513c15da26Smrg            # dependencies.
73523c15da26Smrg            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"'
73533c15da26Smrg            ;;
73543c15da26Smrg          *)
73553c15da26Smrg            if test "$GXX" = yes; then
73563c15da26Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
73573c15da26Smrg            else
73583c15da26Smrg              # FIXME: insert proper C++ library support
73593c15da26Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
73603c15da26Smrg            fi
73613c15da26Smrg            ;;
73623c15da26Smrg        esac
73633c15da26Smrg        ;;
73643c15da26Smrg
73653c15da26Smrg      hpux10*|hpux11*)
73663c15da26Smrg        if test $with_gnu_ld = no; then
73673c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
73683c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
73693c15da26Smrg
73703c15da26Smrg          case $host_cpu in
73713c15da26Smrg            hppa*64*|ia64*)
73723c15da26Smrg              ;;
73733c15da26Smrg            *)
73743c15da26Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73753c15da26Smrg              ;;
73763c15da26Smrg          esac
73773c15da26Smrg        fi
73783c15da26Smrg        case $host_cpu in
73793c15da26Smrg          hppa*64*|ia64*)
73803c15da26Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
73813c15da26Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73823c15da26Smrg            ;;
73833c15da26Smrg          *)
73843c15da26Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
73853c15da26Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
73863c15da26Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
73873c15da26Smrg					         # but as the default
73883c15da26Smrg					         # location of the library.
73893c15da26Smrg            ;;
73903c15da26Smrg        esac
73913c15da26Smrg
73923c15da26Smrg        case $cc_basename in
73933c15da26Smrg          CC*)
73943c15da26Smrg	    # FIXME: insert proper C++ library support
73953c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73963c15da26Smrg	    ;;
73973c15da26Smrg          aCC*)
73983c15da26Smrg	    case $host_cpu in
73993c15da26Smrg	      hppa*64*)
74003c15da26Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
74013c15da26Smrg	        ;;
74023c15da26Smrg	      ia64*)
74033c15da26Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
74043c15da26Smrg	        ;;
74053c15da26Smrg	      *)
74063c15da26Smrg	        _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'
74073c15da26Smrg	        ;;
74083c15da26Smrg	    esac
74093c15da26Smrg	    # Commands to make compiler produce verbose output that lists
74103c15da26Smrg	    # what "hidden" libraries, object files and flags are used when
74113c15da26Smrg	    # linking a shared library.
74123c15da26Smrg	    #
74133c15da26Smrg	    # There doesn't appear to be a way to prevent this compiler from
74143c15da26Smrg	    # explicitly linking system object files so we need to strip them
74153c15da26Smrg	    # from the output so that they don't get included in the library
74163c15da26Smrg	    # dependencies.
74173c15da26Smrg	    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"'
74183c15da26Smrg	    ;;
74193c15da26Smrg          *)
74203c15da26Smrg	    if test "$GXX" = yes; then
74213c15da26Smrg	      if test $with_gnu_ld = no; then
74223c15da26Smrg	        case $host_cpu in
74233c15da26Smrg	          hppa*64*)
74243c15da26Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
74253c15da26Smrg	            ;;
74263c15da26Smrg	          ia64*)
74273c15da26Smrg	            _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'
74283c15da26Smrg	            ;;
74293c15da26Smrg	          *)
74303c15da26Smrg	            _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'
74313c15da26Smrg	            ;;
74323c15da26Smrg	        esac
74333c15da26Smrg	      fi
74343c15da26Smrg	    else
74353c15da26Smrg	      # FIXME: insert proper C++ library support
74363c15da26Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
74373c15da26Smrg	    fi
74383c15da26Smrg	    ;;
74393c15da26Smrg        esac
74403c15da26Smrg        ;;
74413c15da26Smrg
74423c15da26Smrg      interix[[3-9]]*)
74433c15da26Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
74443c15da26Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
74453c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
74463c15da26Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
74473c15da26Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
74483c15da26Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
74493c15da26Smrg	# default) and relocated if they conflict, which is a slow very memory
74503c15da26Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
74513c15da26Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
74523c15da26Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
74533c15da26Smrg	_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'
74543c15da26Smrg	_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'
74553c15da26Smrg	;;
74563c15da26Smrg      irix5* | irix6*)
74573c15da26Smrg        case $cc_basename in
74583c15da26Smrg          CC*)
74593c15da26Smrg	    # SGI C++
74603c15da26Smrg	    _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'
74613c15da26Smrg
74623c15da26Smrg	    # Archives containing C++ object files must be created using
74633c15da26Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
74643c15da26Smrg	    # necessary to make sure instantiated templates are included
74653c15da26Smrg	    # in the archive.
74663c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
74673c15da26Smrg	    ;;
74683c15da26Smrg          *)
74693c15da26Smrg	    if test "$GXX" = yes; then
74703c15da26Smrg	      if test "$with_gnu_ld" = no; then
74713c15da26Smrg	        _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'
74723c15da26Smrg	      else
74733c15da26Smrg	        _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'
74743c15da26Smrg	      fi
74753c15da26Smrg	    fi
74763c15da26Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
74773c15da26Smrg	    ;;
74783c15da26Smrg        esac
74793c15da26Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
74803c15da26Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
74813c15da26Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
74823c15da26Smrg        ;;
74833c15da26Smrg
74843c15da26Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
74853c15da26Smrg        case $cc_basename in
74863c15da26Smrg          KCC*)
74873c15da26Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
74883c15da26Smrg
74893c15da26Smrg	    # KCC will only create a shared library if the output file
74903c15da26Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
74913c15da26Smrg	    # to its proper name (with version) after linking.
74923c15da26Smrg	    _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'
74933c15da26Smrg	    _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'
74943c15da26Smrg	    # Commands to make compiler produce verbose output that lists
74953c15da26Smrg	    # what "hidden" libraries, object files and flags are used when
74963c15da26Smrg	    # linking a shared library.
74973c15da26Smrg	    #
74983c15da26Smrg	    # There doesn't appear to be a way to prevent this compiler from
74993c15da26Smrg	    # explicitly linking system object files so we need to strip them
75003c15da26Smrg	    # from the output so that they don't get included in the library
75013c15da26Smrg	    # dependencies.
75023c15da26Smrg	    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"'
75033c15da26Smrg
75043c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
75053c15da26Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75063c15da26Smrg
75073c15da26Smrg	    # Archives containing C++ object files must be created using
75083c15da26Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
75093c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
75103c15da26Smrg	    ;;
75113c15da26Smrg	  icpc* | ecpc* )
75123c15da26Smrg	    # Intel C++
75133c15da26Smrg	    with_gnu_ld=yes
75143c15da26Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
75153c15da26Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
75163c15da26Smrg	    # earlier do not add the objects themselves.
75173c15da26Smrg	    case `$CC -V 2>&1` in
75183c15da26Smrg	      *"Version 7."*)
75193c15da26Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
75203c15da26Smrg		_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'
75213c15da26Smrg		;;
75223c15da26Smrg	      *)  # Version 8.0 or newer
75233c15da26Smrg	        tmp_idyn=
75243c15da26Smrg	        case $host_cpu in
75253c15da26Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
75263c15da26Smrg		esac
75273c15da26Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
75283c15da26Smrg		_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'
75293c15da26Smrg		;;
75303c15da26Smrg	    esac
75313c15da26Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
75323c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
75333c15da26Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75343c15da26Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
75353c15da26Smrg	    ;;
75363c15da26Smrg          pgCC* | pgcpp*)
75373c15da26Smrg            # Portland Group C++ compiler
75383c15da26Smrg	    case `$CC -V` in
75393c15da26Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
75403c15da26Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
75413c15da26Smrg		rm -rf $tpldir~
75423c15da26Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
75433c15da26Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
75443c15da26Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
75453c15da26Smrg		rm -rf $tpldir~
75463c15da26Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
75473c15da26Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
75483c15da26Smrg		$RANLIB $oldlib'
75493c15da26Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
75503c15da26Smrg		rm -rf $tpldir~
75513c15da26Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
75523c15da26Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
75533c15da26Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
75543c15da26Smrg		rm -rf $tpldir~
75553c15da26Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
75563c15da26Smrg		$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'
75573c15da26Smrg	      ;;
75583c15da26Smrg	    *) # Version 6 and above use weak symbols
75593c15da26Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
75603c15da26Smrg	      _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'
75613c15da26Smrg	      ;;
75623c15da26Smrg	    esac
75633c15da26Smrg
75643c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
75653c15da26Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75663c15da26Smrg	    _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'
75673c15da26Smrg            ;;
75683c15da26Smrg	  cxx*)
75693c15da26Smrg	    # Compaq C++
75703c15da26Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
75713c15da26Smrg	    _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'
75723c15da26Smrg
75733c15da26Smrg	    runpath_var=LD_RUN_PATH
75743c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
75753c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
75763c15da26Smrg
75773c15da26Smrg	    # Commands to make compiler produce verbose output that lists
75783c15da26Smrg	    # what "hidden" libraries, object files and flags are used when
75793c15da26Smrg	    # linking a shared library.
75803c15da26Smrg	    #
75813c15da26Smrg	    # There doesn't appear to be a way to prevent this compiler from
75823c15da26Smrg	    # explicitly linking system object files so we need to strip them
75833c15da26Smrg	    # from the output so that they don't get included in the library
75843c15da26Smrg	    # dependencies.
75853c15da26Smrg	    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'
75863c15da26Smrg	    ;;
75873c15da26Smrg	  xl* | mpixl* | bgxl*)
75883c15da26Smrg	    # IBM XL 8.0 on PPC, with GNU ld
75893c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
75903c15da26Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75913c15da26Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
75923c15da26Smrg	    if test "x$supports_anon_versioning" = xyes; then
75933c15da26Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
75943c15da26Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
75953c15da26Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
75963c15da26Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
75973c15da26Smrg	    fi
75983c15da26Smrg	    ;;
75993c15da26Smrg	  *)
76003c15da26Smrg	    case `$CC -V 2>&1 | sed 5q` in
76013c15da26Smrg	    *Sun\ C*)
76023c15da26Smrg	      # Sun C++ 5.9
76033c15da26Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
76043c15da26Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
76053c15da26Smrg	      _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'
76063c15da26Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
76073c15da26Smrg	      _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'
76083c15da26Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
76093c15da26Smrg
76103c15da26Smrg	      # Not sure whether something based on
76113c15da26Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
76123c15da26Smrg	      # would be better.
76133c15da26Smrg	      output_verbose_link_cmd='func_echo_all'
7614126a8a12Smrg
76153c15da26Smrg	      # Archives containing C++ object files must be created using
76163c15da26Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
76173c15da26Smrg	      # necessary to make sure instantiated templates are included
76183c15da26Smrg	      # in the archive.
76193c15da26Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
76203c15da26Smrg	      ;;
76213c15da26Smrg	    esac
76223c15da26Smrg	    ;;
76233c15da26Smrg	esac
76243c15da26Smrg	;;
7625555991fdSmrg
76263c15da26Smrg      lynxos*)
76273c15da26Smrg        # FIXME: insert proper C++ library support
76283c15da26Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
76293c15da26Smrg	;;
7630126a8a12Smrg
76313c15da26Smrg      m88k*)
76323c15da26Smrg        # FIXME: insert proper C++ library support
76333c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
76343c15da26Smrg	;;
7635126a8a12Smrg
76363c15da26Smrg      mvs*)
76373c15da26Smrg        case $cc_basename in
76383c15da26Smrg          cxx*)
76393c15da26Smrg	    # FIXME: insert proper C++ library support
76403c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
76413c15da26Smrg	    ;;
76423c15da26Smrg	  *)
76433c15da26Smrg	    # FIXME: insert proper C++ library support
76443c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
76453c15da26Smrg	    ;;
76463c15da26Smrg	esac
76473c15da26Smrg	;;
7648126a8a12Smrg
76493c15da26Smrg      netbsd*)
76503c15da26Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
76513c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
76523c15da26Smrg	  wlarc=
76533c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
76543c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
76553c15da26Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
76563c15da26Smrg	fi
76573c15da26Smrg	# Workaround some broken pre-1.5 toolchains
76583c15da26Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
76593c15da26Smrg	;;
7660126a8a12Smrg
76613c15da26Smrg      *nto* | *qnx*)
76623c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
76633c15da26Smrg	;;
7664126a8a12Smrg
76653c15da26Smrg      openbsd2*)
76663c15da26Smrg        # C++ shared libraries are fairly broken
76673c15da26Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
76683c15da26Smrg	;;
7669126a8a12Smrg
76703c15da26Smrg      openbsd*)
76713c15da26Smrg	if test -f /usr/libexec/ld.so; then
7672555991fdSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
76733c15da26Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7674555991fdSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
76753c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
76763c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
76773c15da26Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
76783c15da26Smrg	    _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'
76793c15da26Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
76803c15da26Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
76813c15da26Smrg	  fi
76823c15da26Smrg	  output_verbose_link_cmd=func_echo_all
76833c15da26Smrg	else
76843c15da26Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
76853c15da26Smrg	fi
76863c15da26Smrg	;;
7687126a8a12Smrg
76883c15da26Smrg      osf3* | osf4* | osf5*)
76893c15da26Smrg        case $cc_basename in
76903c15da26Smrg          KCC*)
76913c15da26Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7692126a8a12Smrg
76933c15da26Smrg	    # KCC will only create a shared library if the output file
76943c15da26Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
76953c15da26Smrg	    # to its proper name (with version) after linking.
76963c15da26Smrg	    _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'
7697126a8a12Smrg
76983c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
76993c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
77003c15da26Smrg
77013c15da26Smrg	    # Archives containing C++ object files must be created using
77023c15da26Smrg	    # the KAI C++ compiler.
77033c15da26Smrg	    case $host in
77043c15da26Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
77053c15da26Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
77063c15da26Smrg	    esac
77073c15da26Smrg	    ;;
77083c15da26Smrg          RCC*)
77093c15da26Smrg	    # Rational C++ 2.4.1
77103c15da26Smrg	    # FIXME: insert proper C++ library support
77113c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77123c15da26Smrg	    ;;
77133c15da26Smrg          cxx*)
77143c15da26Smrg	    case $host in
77153c15da26Smrg	      osf3*)
77163c15da26Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
77173c15da26Smrg	        _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'
77183c15da26Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
77193c15da26Smrg		;;
77203c15da26Smrg	      *)
77213c15da26Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
77223c15da26Smrg	        _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'
77233c15da26Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
77243c15da26Smrg	          echo "-hidden">> $lib.exp~
77253c15da26Smrg	          $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~
77263c15da26Smrg	          $RM $lib.exp'
77273c15da26Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
77283c15da26Smrg		;;
77293c15da26Smrg	    esac
77303c15da26Smrg
77313c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
77323c15da26Smrg
77333c15da26Smrg	    # Commands to make compiler produce verbose output that lists
77343c15da26Smrg	    # what "hidden" libraries, object files and flags are used when
77353c15da26Smrg	    # linking a shared library.
77363c15da26Smrg	    #
77373c15da26Smrg	    # There doesn't appear to be a way to prevent this compiler from
77383c15da26Smrg	    # explicitly linking system object files so we need to strip them
77393c15da26Smrg	    # from the output so that they don't get included in the library
77403c15da26Smrg	    # dependencies.
77413c15da26Smrg	    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"'
77423c15da26Smrg	    ;;
77433c15da26Smrg	  *)
77443c15da26Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
77453c15da26Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
77463c15da26Smrg	      case $host in
77473c15da26Smrg	        osf3*)
77483c15da26Smrg	          _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'
77493c15da26Smrg		  ;;
77503c15da26Smrg	        *)
77513c15da26Smrg	          _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'
77523c15da26Smrg		  ;;
77533c15da26Smrg	      esac
7754126a8a12Smrg
77553c15da26Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
77563c15da26Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7757126a8a12Smrg
77583c15da26Smrg	      # Commands to make compiler produce verbose output that lists
77593c15da26Smrg	      # what "hidden" libraries, object files and flags are used when
77603c15da26Smrg	      # linking a shared library.
77613c15da26Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7762126a8a12Smrg
77633c15da26Smrg	    else
77643c15da26Smrg	      # FIXME: insert proper C++ library support
77653c15da26Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
77663c15da26Smrg	    fi
77673c15da26Smrg	    ;;
77683c15da26Smrg        esac
77693c15da26Smrg        ;;
7770126a8a12Smrg
77713c15da26Smrg      psos*)
77723c15da26Smrg        # FIXME: insert proper C++ library support
77733c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
77743c15da26Smrg        ;;
7775126a8a12Smrg
77763c15da26Smrg      sunos4*)
77773c15da26Smrg        case $cc_basename in
77783c15da26Smrg          CC*)
77793c15da26Smrg	    # Sun C++ 4.x
77803c15da26Smrg	    # FIXME: insert proper C++ library support
77813c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77823c15da26Smrg	    ;;
77833c15da26Smrg          lcc*)
77843c15da26Smrg	    # Lucid
77853c15da26Smrg	    # FIXME: insert proper C++ library support
77863c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77873c15da26Smrg	    ;;
77883c15da26Smrg          *)
77893c15da26Smrg	    # FIXME: insert proper C++ library support
77903c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77913c15da26Smrg	    ;;
77923c15da26Smrg        esac
77933c15da26Smrg        ;;
7794126a8a12Smrg
77953c15da26Smrg      solaris*)
77963c15da26Smrg        case $cc_basename in
77973c15da26Smrg          CC* | sunCC*)
77983c15da26Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
77993c15da26Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
78003c15da26Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
78013c15da26Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
78023c15da26Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
78033c15da26Smrg	      $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'
7804126a8a12Smrg
78053c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
78063c15da26Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
78073c15da26Smrg	    case $host_os in
78083c15da26Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
78093c15da26Smrg	      *)
78103c15da26Smrg		# The compiler driver will combine and reorder linker options,
78113c15da26Smrg		# but understands `-z linker_flag'.
78123c15da26Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
78133c15da26Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
78143c15da26Smrg	        ;;
78153c15da26Smrg	    esac
78163c15da26Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7817d656433aSmrg
78183c15da26Smrg	    output_verbose_link_cmd='func_echo_all'
7819126a8a12Smrg
78203c15da26Smrg	    # Archives containing C++ object files must be created using
78213c15da26Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
78223c15da26Smrg	    # necessary to make sure instantiated templates are included
78233c15da26Smrg	    # in the archive.
78243c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
78253c15da26Smrg	    ;;
78263c15da26Smrg          gcx*)
78273c15da26Smrg	    # Green Hills C++ Compiler
78283c15da26Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7829126a8a12Smrg
78303c15da26Smrg	    # The C++ compiler must be used to create the archive.
78313c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
78323c15da26Smrg	    ;;
78333c15da26Smrg          *)
78343c15da26Smrg	    # GNU C++ compiler with Solaris linker
78353c15da26Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
78363c15da26Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
78373c15da26Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
78383c15da26Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
78393c15da26Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
78403c15da26Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7841126a8a12Smrg
78423c15da26Smrg	        # Commands to make compiler produce verbose output that lists
78433c15da26Smrg	        # what "hidden" libraries, object files and flags are used when
78443c15da26Smrg	        # linking a shared library.
78453c15da26Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
78463c15da26Smrg	      else
78473c15da26Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
78483c15da26Smrg	        # platform.
78493c15da26Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
78503c15da26Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
78513c15da26Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7852126a8a12Smrg
78533c15da26Smrg	        # Commands to make compiler produce verbose output that lists
78543c15da26Smrg	        # what "hidden" libraries, object files and flags are used when
78553c15da26Smrg	        # linking a shared library.
78563c15da26Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
78573c15da26Smrg	      fi
78583c15da26Smrg
78593c15da26Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
78603c15da26Smrg	      case $host_os in
78613c15da26Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
78623c15da26Smrg		*)
78633c15da26Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
78643c15da26Smrg		  ;;
78653c15da26Smrg	      esac
78663c15da26Smrg	    fi
78673c15da26Smrg	    ;;
78683c15da26Smrg        esac
78693c15da26Smrg        ;;
7870126a8a12Smrg
7871555991fdSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7872555991fdSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7873555991fdSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7874555991fdSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7875555991fdSmrg      runpath_var='LD_RUN_PATH'
7876126a8a12Smrg
78773c15da26Smrg      case $cc_basename in
78783c15da26Smrg        CC*)
78793c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78803c15da26Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78813c15da26Smrg	  ;;
78823c15da26Smrg	*)
78833c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78843c15da26Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78853c15da26Smrg	  ;;
78863c15da26Smrg      esac
7887555991fdSmrg      ;;
7888d656433aSmrg
78893c15da26Smrg      sysv5* | sco3.2v5* | sco5v6*)
78903c15da26Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
78913c15da26Smrg	# link with -lc, and that would cause any symbols used from libc to
78923c15da26Smrg	# always be unresolved, which means just about no library would
78933c15da26Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
78943c15da26Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
78953c15da26Smrg	# as -z defs.
78963c15da26Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
78973c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
78983c15da26Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78993c15da26Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
79003c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
79013c15da26Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
79023c15da26Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
79033c15da26Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
79043c15da26Smrg	runpath_var='LD_RUN_PATH'
7905126a8a12Smrg
79063c15da26Smrg	case $cc_basename in
79073c15da26Smrg          CC*)
79083c15da26Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79093c15da26Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79103c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
79113c15da26Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
79123c15da26Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
79133c15da26Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
79143c15da26Smrg	    ;;
79153c15da26Smrg	  *)
79163c15da26Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79173c15da26Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79183c15da26Smrg	    ;;
79193c15da26Smrg	esac
7920555991fdSmrg      ;;
7921d656433aSmrg
79223c15da26Smrg      tandem*)
79233c15da26Smrg        case $cc_basename in
79243c15da26Smrg          NCC*)
79253c15da26Smrg	    # NonStop-UX NCC 3.20
79263c15da26Smrg	    # FIXME: insert proper C++ library support
79273c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
79283c15da26Smrg	    ;;
79293c15da26Smrg          *)
79303c15da26Smrg	    # FIXME: insert proper C++ library support
79313c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
79323c15da26Smrg	    ;;
79333c15da26Smrg        esac
79343c15da26Smrg        ;;
7935d656433aSmrg
79363c15da26Smrg      vxworks*)
79373c15da26Smrg        # FIXME: insert proper C++ library support
79383c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
79393c15da26Smrg        ;;
79403c15da26Smrg
79413c15da26Smrg      *)
79423c15da26Smrg        # FIXME: insert proper C++ library support
79433c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
79443c15da26Smrg        ;;
7945555991fdSmrg    esac
7946d656433aSmrg
79473c15da26Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
79483c15da26Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7949d656433aSmrg
79503c15da26Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
79513c15da26Smrg    _LT_TAGVAR(LD, $1)="$LD"
7952d656433aSmrg
79533c15da26Smrg    ## CAVEAT EMPTOR:
79543c15da26Smrg    ## There is no encapsulation within the following macros, do not change
79553c15da26Smrg    ## the running order or otherwise move them around unless you know exactly
79563c15da26Smrg    ## what you are doing...
79573c15da26Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
79583c15da26Smrg    _LT_COMPILER_PIC($1)
79593c15da26Smrg    _LT_COMPILER_C_O($1)
79603c15da26Smrg    _LT_COMPILER_FILE_LOCKS($1)
79613c15da26Smrg    _LT_LINKER_SHLIBS($1)
79623c15da26Smrg    _LT_SYS_DYNAMIC_LINKER($1)
79633c15da26Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7964555991fdSmrg
79653c15da26Smrg    _LT_CONFIG($1)
79663c15da26Smrg  fi # test -n "$compiler"
79673c15da26Smrg
79683c15da26Smrg  CC=$lt_save_CC
79693c15da26Smrg  CFLAGS=$lt_save_CFLAGS
79703c15da26Smrg  LDCXX=$LD
79713c15da26Smrg  LD=$lt_save_LD
79723c15da26Smrg  GCC=$lt_save_GCC
79733c15da26Smrg  with_gnu_ld=$lt_save_with_gnu_ld
79743c15da26Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
79753c15da26Smrg  lt_cv_path_LD=$lt_save_path_LD
79763c15da26Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
79773c15da26Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
79783c15da26Smrgfi # test "$_lt_caught_CXX_error" != yes
79793c15da26Smrg
79803c15da26SmrgAC_LANG_POP
79813c15da26Smrg])# _LT_LANG_CXX_CONFIG
79823c15da26Smrg
79833c15da26Smrg
79843c15da26Smrg# _LT_FUNC_STRIPNAME_CNF
79853c15da26Smrg# ----------------------
79863c15da26Smrg# func_stripname_cnf prefix suffix name
79873c15da26Smrg# strip PREFIX and SUFFIX off of NAME.
79883c15da26Smrg# PREFIX and SUFFIX must not contain globbing or regex special
79893c15da26Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
79903c15da26Smrg# dot (in which case that matches only a dot).
7991555991fdSmrg#
79923c15da26Smrg# This function is identical to the (non-XSI) version of func_stripname,
79933c15da26Smrg# except this one can be used by m4 code that may be executed by configure,
79943c15da26Smrg# rather than the libtool script.
79953c15da26Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
79963c15da26SmrgAC_REQUIRE([_LT_DECL_SED])
79973c15da26SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
79983c15da26Smrgfunc_stripname_cnf ()
79993c15da26Smrg{
80003c15da26Smrg  case ${2} in
80013c15da26Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
80023c15da26Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
80033c15da26Smrg  esac
80043c15da26Smrg} # func_stripname_cnf
80053c15da26Smrg])# _LT_FUNC_STRIPNAME_CNF
8006555991fdSmrg
80073c15da26Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
80083c15da26Smrg# ---------------------------------
80093c15da26Smrg# Figure out "hidden" library dependencies from verbose
80103c15da26Smrg# compiler output when linking a shared library.
80113c15da26Smrg# Parse the compiler output and extract the necessary
80123c15da26Smrg# objects, libraries and library flags.
80133c15da26Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
80143c15da26Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
80153c15da26SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
80163c15da26Smrg# Dependencies to place before and after the object being linked:
80173c15da26Smrg_LT_TAGVAR(predep_objects, $1)=
80183c15da26Smrg_LT_TAGVAR(postdep_objects, $1)=
80193c15da26Smrg_LT_TAGVAR(predeps, $1)=
80203c15da26Smrg_LT_TAGVAR(postdeps, $1)=
80213c15da26Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
8022555991fdSmrg
80233c15da26Smrgdnl we can't use the lt_simple_compile_test_code here,
80243c15da26Smrgdnl because it contains code intended for an executable,
80253c15da26Smrgdnl not a library.  It's possible we should let each
80263c15da26Smrgdnl tag define a new lt_????_link_test_code variable,
80273c15da26Smrgdnl but it's only used here...
80283c15da26Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
80293c15da26Smrgint a;
80303c15da26Smrgvoid foo (void) { a = 0; }
80313c15da26Smrg_LT_EOF
80323c15da26Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
80333c15da26Smrgclass Foo
80343c15da26Smrg{
80353c15da26Smrgpublic:
80363c15da26Smrg  Foo (void) { a = 0; }
80373c15da26Smrgprivate:
80383c15da26Smrg  int a;
80393c15da26Smrg};
80403c15da26Smrg_LT_EOF
80413c15da26Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
80423c15da26Smrg      subroutine foo
80433c15da26Smrg      implicit none
80443c15da26Smrg      integer*4 a
80453c15da26Smrg      a=0
80463c15da26Smrg      return
80473c15da26Smrg      end
80483c15da26Smrg_LT_EOF
80493c15da26Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
80503c15da26Smrg      subroutine foo
80513c15da26Smrg      implicit none
80523c15da26Smrg      integer a
80533c15da26Smrg      a=0
80543c15da26Smrg      return
80553c15da26Smrg      end
80563c15da26Smrg_LT_EOF
80573c15da26Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
80583c15da26Smrgpublic class foo {
80593c15da26Smrg  private int a;
80603c15da26Smrg  public void bar (void) {
80613c15da26Smrg    a = 0;
80623c15da26Smrg  }
80633c15da26Smrg};
80643c15da26Smrg_LT_EOF
80653c15da26Smrg])
80663c15da26Smrg
80673c15da26Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
80683c15da26Smrgcase "$CC $CFLAGS " in #(
80693c15da26Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
80703c15da26Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8071d656433aSmrgesac
8072555991fdSmrg
80733c15da26Smrgdnl Parse the compiler output and extract the necessary
80743c15da26Smrgdnl objects, libraries and library flags.
80753c15da26Smrgif AC_TRY_EVAL(ac_compile); then
80763c15da26Smrg  # Parse the compiler output and extract the necessary
80773c15da26Smrg  # objects, libraries and library flags.
8078d656433aSmrg
80793c15da26Smrg  # Sentinel used to keep track of whether or not we are before
80803c15da26Smrg  # the conftest object file.
80813c15da26Smrg  pre_test_object_deps_done=no
8082d656433aSmrg
80833c15da26Smrg  for p in `eval "$output_verbose_link_cmd"`; do
80843c15da26Smrg    case ${prev}${p} in
8085d656433aSmrg
80863c15da26Smrg    -L* | -R* | -l*)
80873c15da26Smrg       # Some compilers place space between "-{L,R}" and the path.
80883c15da26Smrg       # Remove the space.
80893c15da26Smrg       if test $p = "-L" ||
80903c15da26Smrg          test $p = "-R"; then
80913c15da26Smrg	 prev=$p
80923c15da26Smrg	 continue
80933c15da26Smrg       fi
8094d656433aSmrg
80953c15da26Smrg       # Expand the sysroot to ease extracting the directories later.
80963c15da26Smrg       if test -z "$prev"; then
80973c15da26Smrg         case $p in
80983c15da26Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
80993c15da26Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
81003c15da26Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
81013c15da26Smrg         esac
81023c15da26Smrg       fi
81033c15da26Smrg       case $p in
81043c15da26Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
81053c15da26Smrg       esac
81063c15da26Smrg       if test "$pre_test_object_deps_done" = no; then
81073c15da26Smrg	 case ${prev} in
81083c15da26Smrg	 -L | -R)
81093c15da26Smrg	   # Internal compiler library paths should come after those
81103c15da26Smrg	   # provided the user.  The postdeps already come after the
81113c15da26Smrg	   # user supplied libs so there is no need to process them.
81123c15da26Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
81133c15da26Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
81143c15da26Smrg	   else
81153c15da26Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
81163c15da26Smrg	   fi
81173c15da26Smrg	   ;;
81183c15da26Smrg	 # The "-l" case would never come before the object being
81193c15da26Smrg	 # linked, so don't bother handling this case.
81203c15da26Smrg	 esac
81213c15da26Smrg       else
81223c15da26Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
81233c15da26Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
81243c15da26Smrg	 else
81253c15da26Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
81263c15da26Smrg	 fi
81273c15da26Smrg       fi
81283c15da26Smrg       prev=
81293c15da26Smrg       ;;
8130d656433aSmrg
81313c15da26Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
81323c15da26Smrg    *.$objext)
81333c15da26Smrg       # This assumes that the test object file only shows up
81343c15da26Smrg       # once in the compiler output.
81353c15da26Smrg       if test "$p" = "conftest.$objext"; then
81363c15da26Smrg	 pre_test_object_deps_done=yes
81373c15da26Smrg	 continue
81383c15da26Smrg       fi
8139d656433aSmrg
81403c15da26Smrg       if test "$pre_test_object_deps_done" = no; then
81413c15da26Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
81423c15da26Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
81433c15da26Smrg	 else
81443c15da26Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
81453c15da26Smrg	 fi
81463c15da26Smrg       else
81473c15da26Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
81483c15da26Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
81493c15da26Smrg	 else
81503c15da26Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
81513c15da26Smrg	 fi
81523c15da26Smrg       fi
81533c15da26Smrg       ;;
8154d656433aSmrg
81553c15da26Smrg    *) ;; # Ignore the rest.
8156d656433aSmrg
81573c15da26Smrg    esac
81583c15da26Smrg  done
8159d656433aSmrg
81603c15da26Smrg  # Clean up.
81613c15da26Smrg  rm -f a.out a.exe
81623c15da26Smrgelse
81633c15da26Smrg  echo "libtool.m4: error: problem compiling $1 test program"
81643c15da26Smrgfi
8165d656433aSmrg
81663c15da26Smrg$RM -f confest.$objext
81673c15da26SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
8168d656433aSmrg
81693c15da26Smrg# PORTME: override above test on systems where it is broken
81703c15da26Smrgm4_if([$1], [CXX],
81713c15da26Smrg[case $host_os in
81723c15da26Smrginterix[[3-9]]*)
81733c15da26Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
81743c15da26Smrg  # hack all around it, let's just trust "g++" to DTRT.
81753c15da26Smrg  _LT_TAGVAR(predep_objects,$1)=
81763c15da26Smrg  _LT_TAGVAR(postdep_objects,$1)=
81773c15da26Smrg  _LT_TAGVAR(postdeps,$1)=
81783c15da26Smrg  ;;
8179555991fdSmrg
81803c15da26Smrglinux*)
81813c15da26Smrg  case `$CC -V 2>&1 | sed 5q` in
81823c15da26Smrg  *Sun\ C*)
81833c15da26Smrg    # Sun C++ 5.9
81843c15da26Smrg
81853c15da26Smrg    # The more standards-conforming stlport4 library is
81863c15da26Smrg    # incompatible with the Cstd library. Avoid specifying
81873c15da26Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
81883c15da26Smrg    # -library=stlport4 depends on it.
81893c15da26Smrg    case " $CXX $CXXFLAGS " in
81903c15da26Smrg    *" -library=stlport4 "*)
81913c15da26Smrg      solaris_use_stlport4=yes
81923c15da26Smrg      ;;
81933c15da26Smrg    esac
81943c15da26Smrg
81953c15da26Smrg    if test "$solaris_use_stlport4" != yes; then
81963c15da26Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8197555991fdSmrg    fi
8198555991fdSmrg    ;;
81993c15da26Smrg  esac
82003c15da26Smrg  ;;
8201d656433aSmrg
82023c15da26Smrgsolaris*)
82033c15da26Smrg  case $cc_basename in
82043c15da26Smrg  CC* | sunCC*)
82053c15da26Smrg    # The more standards-conforming stlport4 library is
82063c15da26Smrg    # incompatible with the Cstd library. Avoid specifying
82073c15da26Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
82083c15da26Smrg    # -library=stlport4 depends on it.
82093c15da26Smrg    case " $CXX $CXXFLAGS " in
82103c15da26Smrg    *" -library=stlport4 "*)
82113c15da26Smrg      solaris_use_stlport4=yes
82123c15da26Smrg      ;;
82133c15da26Smrg    esac
82143c15da26Smrg
82153c15da26Smrg    # Adding this requires a known-good setup of shared libraries for
82163c15da26Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
82173c15da26Smrg    # archive will be linked into the output, leading to subtle bugs.
82183c15da26Smrg    if test "$solaris_use_stlport4" != yes; then
82193c15da26Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8220555991fdSmrg    fi
8221d656433aSmrg    ;;
8222555991fdSmrg  esac
82233c15da26Smrg  ;;
82243c15da26Smrgesac
82253c15da26Smrg])
8226d656433aSmrg
82273c15da26Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
82283c15da26Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
82293c15da26Smrgesac
82303c15da26Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
82313c15da26Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
82323c15da26Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8233555991fdSmrgfi
82343c15da26Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
82353c15da26Smrg    [The directories searched by this compiler when creating a shared library])
82363c15da26Smrg_LT_TAGDECL([], [predep_objects], [1],
82373c15da26Smrg    [Dependencies to place before and after the objects being linked to
82383c15da26Smrg    create a shared library])
82393c15da26Smrg_LT_TAGDECL([], [postdep_objects], [1])
82403c15da26Smrg_LT_TAGDECL([], [predeps], [1])
82413c15da26Smrg_LT_TAGDECL([], [postdeps], [1])
82423c15da26Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
82433c15da26Smrg    [The library search path used internally by the compiler when linking
82443c15da26Smrg    a shared library])
82453c15da26Smrg])# _LT_SYS_HIDDEN_LIBDEPS
8246d656433aSmrg
8247d656433aSmrg
82483c15da26Smrg# _LT_LANG_F77_CONFIG([TAG])
8249555991fdSmrg# --------------------------
82503c15da26Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
82513c15da26Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
82523c15da26Smrg# to write the compiler configuration to `libtool'.
82533c15da26Smrgm4_defun([_LT_LANG_F77_CONFIG],
82543c15da26Smrg[AC_LANG_PUSH(Fortran 77)
82553c15da26Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
82563c15da26Smrg  _lt_disable_F77=yes
8257555991fdSmrgfi
8258d656433aSmrg
8259555991fdSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8260555991fdSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
8261555991fdSmrg_LT_TAGVAR(always_export_symbols, $1)=no
8262555991fdSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8263555991fdSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8264555991fdSmrg_LT_TAGVAR(hardcode_direct, $1)=no
8265555991fdSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8266555991fdSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8267555991fdSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8268555991fdSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8269555991fdSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8270555991fdSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
8271555991fdSmrg_LT_TAGVAR(inherit_rpath, $1)=no
8272555991fdSmrg_LT_TAGVAR(module_cmds, $1)=
8273555991fdSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
8274555991fdSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8275555991fdSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8276555991fdSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8277555991fdSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8278555991fdSmrg_LT_TAGVAR(no_undefined_flag, $1)=
8279555991fdSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8280555991fdSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8281d656433aSmrg
82823c15da26Smrg# Source file extension for f77 test sources.
82833c15da26Smrgac_ext=f
8284d656433aSmrg
82853c15da26Smrg# Object file extension for compiled f77 test sources.
8286555991fdSmrgobjext=o
8287555991fdSmrg_LT_TAGVAR(objext, $1)=$objext
8288d656433aSmrg
8289555991fdSmrg# No sense in running all these tests if we already determined that
82903c15da26Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
8291555991fdSmrg# are currently assumed to apply to all compilers on this platform,
8292555991fdSmrg# and will be corrupted by setting them based on a non-working compiler.
82933c15da26Smrgif test "$_lt_disable_F77" != yes; then
8294555991fdSmrg  # Code to be used in simple compile tests
82953c15da26Smrg  lt_simple_compile_test_code="\
82963c15da26Smrg      subroutine t
82973c15da26Smrg      return
82983c15da26Smrg      end
82993c15da26Smrg"
8300d656433aSmrg
8301555991fdSmrg  # Code to be used in simple link tests
83023c15da26Smrg  lt_simple_link_test_code="\
83033c15da26Smrg      program t
83043c15da26Smrg      end
83053c15da26Smrg"
8306d656433aSmrg
8307555991fdSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8308555991fdSmrg  _LT_TAG_COMPILER
8309d656433aSmrg
8310555991fdSmrg  # save warnings/boilerplate of simple test code
8311555991fdSmrg  _LT_COMPILER_BOILERPLATE
8312555991fdSmrg  _LT_LINKER_BOILERPLATE
8313d656433aSmrg
8314555991fdSmrg  # Allow CC to be a program name with arguments.
83153c15da26Smrg  lt_save_CC="$CC"
8316555991fdSmrg  lt_save_GCC=$GCC
83173c15da26Smrg  lt_save_CFLAGS=$CFLAGS
83183c15da26Smrg  CC=${F77-"f77"}
83193c15da26Smrg  CFLAGS=$FFLAGS
83203c15da26Smrg  compiler=$CC
83213c15da26Smrg  _LT_TAGVAR(compiler, $1)=$CC
83223c15da26Smrg  _LT_CC_BASENAME([$compiler])
83233c15da26Smrg  GCC=$G77
83243c15da26Smrg  if test -n "$compiler"; then
83253c15da26Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
83263c15da26Smrg    AC_MSG_RESULT([$can_build_shared])
8327d656433aSmrg
83283c15da26Smrg    AC_MSG_CHECKING([whether to build shared libraries])
83293c15da26Smrg    test "$can_build_shared" = "no" && enable_shared=no
83303c15da26Smrg
83313c15da26Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
83323c15da26Smrg    # are all built from PIC.
83333c15da26Smrg    case $host_os in
83343c15da26Smrg      aix3*)
83353c15da26Smrg        test "$enable_shared" = yes && enable_static=no
83363c15da26Smrg        if test -n "$RANLIB"; then
83373c15da26Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
83383c15da26Smrg          postinstall_cmds='$RANLIB $lib'
8339555991fdSmrg        fi
8340555991fdSmrg        ;;
83413c15da26Smrg      aix[[4-9]]*)
83423c15da26Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
83433c15da26Smrg	  test "$enable_shared" = yes && enable_static=no
8344555991fdSmrg	fi
8345555991fdSmrg        ;;
83463c15da26Smrg    esac
83473c15da26Smrg    AC_MSG_RESULT([$enable_shared])
8348d656433aSmrg
83493c15da26Smrg    AC_MSG_CHECKING([whether to build static libraries])
83503c15da26Smrg    # Make sure either enable_shared or enable_static is yes.
83513c15da26Smrg    test "$enable_shared" = yes || enable_static=yes
83523c15da26Smrg    AC_MSG_RESULT([$enable_static])
8353d656433aSmrg
83543c15da26Smrg    _LT_TAGVAR(GCC, $1)="$G77"
83553c15da26Smrg    _LT_TAGVAR(LD, $1)="$LD"
8356d656433aSmrg
83573c15da26Smrg    ## CAVEAT EMPTOR:
83583c15da26Smrg    ## There is no encapsulation within the following macros, do not change
83593c15da26Smrg    ## the running order or otherwise move them around unless you know exactly
83603c15da26Smrg    ## what you are doing...
83613c15da26Smrg    _LT_COMPILER_PIC($1)
83623c15da26Smrg    _LT_COMPILER_C_O($1)
83633c15da26Smrg    _LT_COMPILER_FILE_LOCKS($1)
83643c15da26Smrg    _LT_LINKER_SHLIBS($1)
83653c15da26Smrg    _LT_SYS_DYNAMIC_LINKER($1)
83663c15da26Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8367d656433aSmrg
83683c15da26Smrg    _LT_CONFIG($1)
83693c15da26Smrg  fi # test -n "$compiler"
8370d656433aSmrg
83713c15da26Smrg  GCC=$lt_save_GCC
83723c15da26Smrg  CC="$lt_save_CC"
83733c15da26Smrg  CFLAGS="$lt_save_CFLAGS"
83743c15da26Smrgfi # test "$_lt_disable_F77" != yes
8375d656433aSmrg
83763c15da26SmrgAC_LANG_POP
83773c15da26Smrg])# _LT_LANG_F77_CONFIG
8378d656433aSmrg
8379d656433aSmrg
83803c15da26Smrg# _LT_LANG_FC_CONFIG([TAG])
83813c15da26Smrg# -------------------------
83823c15da26Smrg# Ensure that the configuration variables for a Fortran compiler are
83833c15da26Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
83843c15da26Smrg# to write the compiler configuration to `libtool'.
83853c15da26Smrgm4_defun([_LT_LANG_FC_CONFIG],
83863c15da26Smrg[AC_LANG_PUSH(Fortran)
8387d656433aSmrg
83883c15da26Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
83893c15da26Smrg  _lt_disable_FC=yes
83903c15da26Smrgfi
8391d656433aSmrg
83923c15da26Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
83933c15da26Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
83943c15da26Smrg_LT_TAGVAR(always_export_symbols, $1)=no
83953c15da26Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
83963c15da26Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
83973c15da26Smrg_LT_TAGVAR(hardcode_direct, $1)=no
83983c15da26Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
83993c15da26Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
84003c15da26Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
84013c15da26Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
84023c15da26Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
84033c15da26Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
84043c15da26Smrg_LT_TAGVAR(inherit_rpath, $1)=no
84053c15da26Smrg_LT_TAGVAR(module_cmds, $1)=
84063c15da26Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
84073c15da26Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
84083c15da26Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
84093c15da26Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
84103c15da26Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
84113c15da26Smrg_LT_TAGVAR(no_undefined_flag, $1)=
84123c15da26Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
84133c15da26Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8414d656433aSmrg
84153c15da26Smrg# Source file extension for fc test sources.
84163c15da26Smrgac_ext=${ac_fc_srcext-f}
84173c15da26Smrg
84183c15da26Smrg# Object file extension for compiled fc test sources.
84193c15da26Smrgobjext=o
84203c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
84213c15da26Smrg
84223c15da26Smrg# No sense in running all these tests if we already determined that
84233c15da26Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
84243c15da26Smrg# are currently assumed to apply to all compilers on this platform,
84253c15da26Smrg# and will be corrupted by setting them based on a non-working compiler.
84263c15da26Smrgif test "$_lt_disable_FC" != yes; then
84273c15da26Smrg  # Code to be used in simple compile tests
84283c15da26Smrg  lt_simple_compile_test_code="\
84293c15da26Smrg      subroutine t
84303c15da26Smrg      return
84313c15da26Smrg      end
84323c15da26Smrg"
84333c15da26Smrg
84343c15da26Smrg  # Code to be used in simple link tests
84353c15da26Smrg  lt_simple_link_test_code="\
84363c15da26Smrg      program t
84373c15da26Smrg      end
84383c15da26Smrg"
84393c15da26Smrg
84403c15da26Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
84413c15da26Smrg  _LT_TAG_COMPILER
84423c15da26Smrg
84433c15da26Smrg  # save warnings/boilerplate of simple test code
84443c15da26Smrg  _LT_COMPILER_BOILERPLATE
84453c15da26Smrg  _LT_LINKER_BOILERPLATE
8446d656433aSmrg
84473c15da26Smrg  # Allow CC to be a program name with arguments.
84483c15da26Smrg  lt_save_CC="$CC"
84493c15da26Smrg  lt_save_GCC=$GCC
84503c15da26Smrg  lt_save_CFLAGS=$CFLAGS
84513c15da26Smrg  CC=${FC-"f95"}
84523c15da26Smrg  CFLAGS=$FCFLAGS
84533c15da26Smrg  compiler=$CC
84543c15da26Smrg  GCC=$ac_cv_fc_compiler_gnu
8455d656433aSmrg
84563c15da26Smrg  _LT_TAGVAR(compiler, $1)=$CC
84573c15da26Smrg  _LT_CC_BASENAME([$compiler])
8458d656433aSmrg
84593c15da26Smrg  if test -n "$compiler"; then
84603c15da26Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
84613c15da26Smrg    AC_MSG_RESULT([$can_build_shared])
8462d656433aSmrg
84633c15da26Smrg    AC_MSG_CHECKING([whether to build shared libraries])
84643c15da26Smrg    test "$can_build_shared" = "no" && enable_shared=no
8465555991fdSmrg
84663c15da26Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
84673c15da26Smrg    # are all built from PIC.
84683c15da26Smrg    case $host_os in
84693c15da26Smrg      aix3*)
84703c15da26Smrg        test "$enable_shared" = yes && enable_static=no
84713c15da26Smrg        if test -n "$RANLIB"; then
84723c15da26Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
84733c15da26Smrg          postinstall_cmds='$RANLIB $lib'
84743c15da26Smrg        fi
84753c15da26Smrg        ;;
84763c15da26Smrg      aix[[4-9]]*)
84773c15da26Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
84783c15da26Smrg	  test "$enable_shared" = yes && enable_static=no
84793c15da26Smrg	fi
84803c15da26Smrg        ;;
84813c15da26Smrg    esac
84823c15da26Smrg    AC_MSG_RESULT([$enable_shared])
8483d656433aSmrg
84843c15da26Smrg    AC_MSG_CHECKING([whether to build static libraries])
84853c15da26Smrg    # Make sure either enable_shared or enable_static is yes.
84863c15da26Smrg    test "$enable_shared" = yes || enable_static=yes
84873c15da26Smrg    AC_MSG_RESULT([$enable_static])
8488d656433aSmrg
84893c15da26Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
84903c15da26Smrg    _LT_TAGVAR(LD, $1)="$LD"
8491d656433aSmrg
84923c15da26Smrg    ## CAVEAT EMPTOR:
84933c15da26Smrg    ## There is no encapsulation within the following macros, do not change
84943c15da26Smrg    ## the running order or otherwise move them around unless you know exactly
84953c15da26Smrg    ## what you are doing...
84963c15da26Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
84973c15da26Smrg    _LT_COMPILER_PIC($1)
84983c15da26Smrg    _LT_COMPILER_C_O($1)
84993c15da26Smrg    _LT_COMPILER_FILE_LOCKS($1)
85003c15da26Smrg    _LT_LINKER_SHLIBS($1)
85013c15da26Smrg    _LT_SYS_DYNAMIC_LINKER($1)
85023c15da26Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8503d656433aSmrg
85043c15da26Smrg    _LT_CONFIG($1)
85053c15da26Smrg  fi # test -n "$compiler"
8506d656433aSmrg
85073c15da26Smrg  GCC=$lt_save_GCC
85083c15da26Smrg  CC=$lt_save_CC
85093c15da26Smrg  CFLAGS=$lt_save_CFLAGS
85103c15da26Smrgfi # test "$_lt_disable_FC" != yes
8511d656433aSmrg
85123c15da26SmrgAC_LANG_POP
85133c15da26Smrg])# _LT_LANG_FC_CONFIG
8514d656433aSmrg
8515d656433aSmrg
85163c15da26Smrg# _LT_LANG_GCJ_CONFIG([TAG])
85173c15da26Smrg# --------------------------
85183c15da26Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
85193c15da26Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
85203c15da26Smrg# to write the compiler configuration to `libtool'.
85213c15da26Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
85223c15da26Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
85233c15da26SmrgAC_LANG_SAVE
8524d656433aSmrg
85253c15da26Smrg# Source file extension for Java test sources.
85263c15da26Smrgac_ext=java
8527d656433aSmrg
85283c15da26Smrg# Object file extension for compiled Java test sources.
85293c15da26Smrgobjext=o
85303c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
8531d656433aSmrg
85323c15da26Smrg# Code to be used in simple compile tests
85333c15da26Smrglt_simple_compile_test_code="class foo {}"
8534d656433aSmrg
85353c15da26Smrg# Code to be used in simple link tests
85363c15da26Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8537d656433aSmrg
85383c15da26Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
85393c15da26Smrg_LT_TAG_COMPILER
8540d656433aSmrg
85413c15da26Smrg# save warnings/boilerplate of simple test code
85423c15da26Smrg_LT_COMPILER_BOILERPLATE
85433c15da26Smrg_LT_LINKER_BOILERPLATE
8544d656433aSmrg
85453c15da26Smrg# Allow CC to be a program name with arguments.
85463c15da26Smrglt_save_CC=$CC
85473c15da26Smrglt_save_CFLAGS=$CFLAGS
85483c15da26Smrglt_save_GCC=$GCC
85493c15da26SmrgGCC=yes
85503c15da26SmrgCC=${GCJ-"gcj"}
85513c15da26SmrgCFLAGS=$GCJFLAGS
85523c15da26Smrgcompiler=$CC
85533c15da26Smrg_LT_TAGVAR(compiler, $1)=$CC
85543c15da26Smrg_LT_TAGVAR(LD, $1)="$LD"
85553c15da26Smrg_LT_CC_BASENAME([$compiler])
8556d656433aSmrg
85573c15da26Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
85583c15da26Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8559d656433aSmrg
85603c15da26Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
85613c15da26Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
85623c15da26Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8563d656433aSmrg
85643c15da26Smrgif test -n "$compiler"; then
85653c15da26Smrg  _LT_COMPILER_NO_RTTI($1)
85663c15da26Smrg  _LT_COMPILER_PIC($1)
85673c15da26Smrg  _LT_COMPILER_C_O($1)
85683c15da26Smrg  _LT_COMPILER_FILE_LOCKS($1)
85693c15da26Smrg  _LT_LINKER_SHLIBS($1)
85703c15da26Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8571d656433aSmrg
85723c15da26Smrg  _LT_CONFIG($1)
85733c15da26Smrgfi
8574d656433aSmrg
85753c15da26SmrgAC_LANG_RESTORE
8576d656433aSmrg
85773c15da26SmrgGCC=$lt_save_GCC
85783c15da26SmrgCC=$lt_save_CC
85793c15da26SmrgCFLAGS=$lt_save_CFLAGS
85803c15da26Smrg])# _LT_LANG_GCJ_CONFIG
8581d656433aSmrg
8582d656433aSmrg
85833c15da26Smrg# _LT_LANG_RC_CONFIG([TAG])
85843c15da26Smrg# -------------------------
85853c15da26Smrg# Ensure that the configuration variables for the Windows resource compiler
85863c15da26Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
85873c15da26Smrg# to write the compiler configuration to `libtool'.
85883c15da26Smrgm4_defun([_LT_LANG_RC_CONFIG],
85893c15da26Smrg[AC_REQUIRE([LT_PROG_RC])dnl
85903c15da26SmrgAC_LANG_SAVE
8591d656433aSmrg
85923c15da26Smrg# Source file extension for RC test sources.
85933c15da26Smrgac_ext=rc
8594d656433aSmrg
85953c15da26Smrg# Object file extension for compiled RC test sources.
85963c15da26Smrgobjext=o
85973c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
8598d656433aSmrg
85993c15da26Smrg# Code to be used in simple compile tests
86003c15da26Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
86013c15da26Smrg
86023c15da26Smrg# Code to be used in simple link tests
86033c15da26Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
86043c15da26Smrg
86053c15da26Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
86063c15da26Smrg_LT_TAG_COMPILER
86073c15da26Smrg
86083c15da26Smrg# save warnings/boilerplate of simple test code
86093c15da26Smrg_LT_COMPILER_BOILERPLATE
86103c15da26Smrg_LT_LINKER_BOILERPLATE
86113c15da26Smrg
86123c15da26Smrg# Allow CC to be a program name with arguments.
86133c15da26Smrglt_save_CC="$CC"
86143c15da26Smrglt_save_CFLAGS=$CFLAGS
86153c15da26Smrglt_save_GCC=$GCC
86163c15da26SmrgGCC=
86173c15da26SmrgCC=${RC-"windres"}
86183c15da26SmrgCFLAGS=
86193c15da26Smrgcompiler=$CC
86203c15da26Smrg_LT_TAGVAR(compiler, $1)=$CC
86213c15da26Smrg_LT_CC_BASENAME([$compiler])
86223c15da26Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8623d656433aSmrg
86243c15da26Smrgif test -n "$compiler"; then
86253c15da26Smrg  :
86263c15da26Smrg  _LT_CONFIG($1)
86273c15da26Smrgfi
8628d656433aSmrg
86293c15da26SmrgGCC=$lt_save_GCC
86303c15da26SmrgAC_LANG_RESTORE
86313c15da26SmrgCC=$lt_save_CC
86323c15da26SmrgCFLAGS=$lt_save_CFLAGS
86333c15da26Smrg])# _LT_LANG_RC_CONFIG
8634d656433aSmrg
8635d656433aSmrg
86363c15da26Smrg# LT_PROG_GCJ
86373c15da26Smrg# -----------
86383c15da26SmrgAC_DEFUN([LT_PROG_GCJ],
86393c15da26Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
86403c15da26Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
86413c15da26Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
86423c15da26Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
86433c15da26Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
86443c15da26Smrg])
8645d656433aSmrg
86463c15da26Smrg# Old name:
86473c15da26SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
86483c15da26Smrgdnl aclocal-1.4 backwards compatibility:
86493c15da26Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8650d656433aSmrg
8651d656433aSmrg
86523c15da26Smrg# LT_PROG_RC
86533c15da26Smrg# ----------
86543c15da26SmrgAC_DEFUN([LT_PROG_RC],
86553c15da26Smrg[AC_CHECK_TOOL(RC, windres,)
86563c15da26Smrg])
8657d656433aSmrg
86583c15da26Smrg# Old name:
86593c15da26SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
86603c15da26Smrgdnl aclocal-1.4 backwards compatibility:
86613c15da26Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8662d656433aSmrg
8663d656433aSmrg
86643c15da26Smrg# _LT_DECL_EGREP
86653c15da26Smrg# --------------
86663c15da26Smrg# If we don't have a new enough Autoconf to choose the best grep
86673c15da26Smrg# available, choose the one first in the user's PATH.
86683c15da26Smrgm4_defun([_LT_DECL_EGREP],
86693c15da26Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
86703c15da26SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
86713c15da26Smrgtest -z "$GREP" && GREP=grep
86723c15da26Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
86733c15da26Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
86743c15da26Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
86753c15da26Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
86763c15da26SmrgAC_SUBST([GREP])
86773c15da26Smrg])
8678d656433aSmrg
8679d656433aSmrg
86803c15da26Smrg# _LT_DECL_OBJDUMP
86813c15da26Smrg# --------------
86823c15da26Smrg# If we don't have a new enough Autoconf to choose the best objdump
86833c15da26Smrg# available, choose the one first in the user's PATH.
86843c15da26Smrgm4_defun([_LT_DECL_OBJDUMP],
86853c15da26Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
86863c15da26Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
86873c15da26Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
86883c15da26SmrgAC_SUBST([OBJDUMP])
86893c15da26Smrg])
8690d656433aSmrg
86913c15da26Smrg# _LT_DECL_DLLTOOL
86923c15da26Smrg# ----------------
86933c15da26Smrg# Ensure DLLTOOL variable is set.
86943c15da26Smrgm4_defun([_LT_DECL_DLLTOOL],
86953c15da26Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
86963c15da26Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
86973c15da26Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
86983c15da26SmrgAC_SUBST([DLLTOOL])
86993c15da26Smrg])
8700d656433aSmrg
87013c15da26Smrg# _LT_DECL_SED
87023c15da26Smrg# ------------
87033c15da26Smrg# Check for a fully-functional sed program, that truncates
87043c15da26Smrg# as few characters as possible.  Prefer GNU sed if found.
87053c15da26Smrgm4_defun([_LT_DECL_SED],
87063c15da26Smrg[AC_PROG_SED
87073c15da26Smrgtest -z "$SED" && SED=sed
87083c15da26SmrgXsed="$SED -e 1s/^X//"
87093c15da26Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
87103c15da26Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
87113c15da26Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
87123c15da26Smrg])# _LT_DECL_SED
8713d656433aSmrg
87143c15da26Smrgm4_ifndef([AC_PROG_SED], [
87153c15da26Smrg# NOTE: This macro has been submitted for inclusion into   #
87163c15da26Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
87173c15da26Smrg#  a released version of Autoconf we should remove this    #
87183c15da26Smrg#  macro and use it instead.                               #
87193c15da26Smrg
87203c15da26Smrgm4_defun([AC_PROG_SED],
87213c15da26Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
87223c15da26SmrgAC_CACHE_VAL(lt_cv_path_SED,
87233c15da26Smrg[# Loop through the user's path and test for sed and gsed.
87243c15da26Smrg# Then use that list of sed's as ones to test for truncation.
87253c15da26Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
87263c15da26Smrgfor as_dir in $PATH
87273c15da26Smrgdo
87283c15da26Smrg  IFS=$as_save_IFS
87293c15da26Smrg  test -z "$as_dir" && as_dir=.
87303c15da26Smrg  for lt_ac_prog in sed gsed; do
87313c15da26Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
87323c15da26Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
87333c15da26Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
87343c15da26Smrg      fi
87353c15da26Smrg    done
87363c15da26Smrg  done
87373c15da26Smrgdone
87383c15da26SmrgIFS=$as_save_IFS
87393c15da26Smrglt_ac_max=0
87403c15da26Smrglt_ac_count=0
87413c15da26Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
87423c15da26Smrg# along with /bin/sed that truncates output.
87433c15da26Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
87443c15da26Smrg  test ! -f $lt_ac_sed && continue
87453c15da26Smrg  cat /dev/null > conftest.in
87463c15da26Smrg  lt_ac_count=0
87473c15da26Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
87483c15da26Smrg  # Check for GNU sed and select it if it is found.
87493c15da26Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
87503c15da26Smrg    lt_cv_path_SED=$lt_ac_sed
87513c15da26Smrg    break
87523c15da26Smrg  fi
87533c15da26Smrg  while true; do
87543c15da26Smrg    cat conftest.in conftest.in >conftest.tmp
87553c15da26Smrg    mv conftest.tmp conftest.in
87563c15da26Smrg    cp conftest.in conftest.nl
87573c15da26Smrg    echo >>conftest.nl
87583c15da26Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
87593c15da26Smrg    cmp -s conftest.out conftest.nl || break
87603c15da26Smrg    # 10000 chars as input seems more than enough
87613c15da26Smrg    test $lt_ac_count -gt 10 && break
87623c15da26Smrg    lt_ac_count=`expr $lt_ac_count + 1`
87633c15da26Smrg    if test $lt_ac_count -gt $lt_ac_max; then
87643c15da26Smrg      lt_ac_max=$lt_ac_count
87653c15da26Smrg      lt_cv_path_SED=$lt_ac_sed
87663c15da26Smrg    fi
87673c15da26Smrg  done
87683c15da26Smrgdone
87693c15da26Smrg])
87703c15da26SmrgSED=$lt_cv_path_SED
87713c15da26SmrgAC_SUBST([SED])
87723c15da26SmrgAC_MSG_RESULT([$SED])
87733c15da26Smrg])#AC_PROG_SED
87743c15da26Smrg])#m4_ifndef
8775d656433aSmrg
87763c15da26Smrg# Old name:
87773c15da26SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
87783c15da26Smrgdnl aclocal-1.4 backwards compatibility:
87793c15da26Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8780d656433aSmrg
8781d656433aSmrg
87823c15da26Smrg# _LT_CHECK_SHELL_FEATURES
87833c15da26Smrg# ------------------------
87843c15da26Smrg# Find out whether the shell is Bourne or XSI compatible,
87853c15da26Smrg# or has some other useful features.
87863c15da26Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
87873c15da26Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
87883c15da26Smrg# Try some XSI features
87893c15da26Smrgxsi_shell=no
87903c15da26Smrg( _lt_dummy="a/b/c"
87913c15da26Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
87923c15da26Smrg      = c,a/b,b/c, \
87933c15da26Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
87943c15da26Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
87953c15da26Smrg  && xsi_shell=yes
87963c15da26SmrgAC_MSG_RESULT([$xsi_shell])
87973c15da26Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8798d656433aSmrg
87993c15da26SmrgAC_MSG_CHECKING([whether the shell understands "+="])
88003c15da26Smrglt_shell_append=no
88013c15da26Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
88023c15da26Smrg    >/dev/null 2>&1 \
88033c15da26Smrg  && lt_shell_append=yes
88043c15da26SmrgAC_MSG_RESULT([$lt_shell_append])
88053c15da26Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8806d656433aSmrg
88073c15da26Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
88083c15da26Smrg  lt_unset=unset
88093c15da26Smrgelse
88103c15da26Smrg  lt_unset=false
88113c15da26Smrgfi
88123c15da26Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8813d656433aSmrg
88143c15da26Smrg# test EBCDIC or ASCII
88153c15da26Smrgcase `echo X|tr X '\101'` in
88163c15da26Smrg A) # ASCII based system
88173c15da26Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
88183c15da26Smrg  lt_SP2NL='tr \040 \012'
88193c15da26Smrg  lt_NL2SP='tr \015\012 \040\040'
88203c15da26Smrg  ;;
88213c15da26Smrg *) # EBCDIC based system
88223c15da26Smrg  lt_SP2NL='tr \100 \n'
88233c15da26Smrg  lt_NL2SP='tr \r\n \100\100'
88243c15da26Smrg  ;;
88253c15da26Smrgesac
88263c15da26Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
88273c15da26Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
88283c15da26Smrg])# _LT_CHECK_SHELL_FEATURES
8829d656433aSmrg
8830d656433aSmrg
88313c15da26Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
88323c15da26Smrg# ------------------------------------------------------
88333c15da26Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
88343c15da26Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
88353c15da26Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
88363c15da26Smrg[dnl {
88373c15da26Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
88383c15da26Smrg$1 ()\
88393c15da26Smrg{\
88403c15da26Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
88413c15da26Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
88423c15da26Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
88433c15da26Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
88443c15da26Smrgtest 0 -eq $? || _lt_function_replace_fail=:
8845555991fdSmrg])
8846d656433aSmrg
8847d656433aSmrg
88483c15da26Smrg# _LT_PROG_REPLACE_SHELLFNS
88493c15da26Smrg# -------------------------
88503c15da26Smrg# Replace existing portable implementations of several shell functions with
88513c15da26Smrg# equivalent extended shell implementations where those features are available..
88523c15da26Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
88533c15da26Smrg[if test x"$xsi_shell" = xyes; then
88543c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
88553c15da26Smrg    case ${1} in
88563c15da26Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
88573c15da26Smrg      *  ) func_dirname_result="${3}" ;;
88583c15da26Smrg    esac])
88593c15da26Smrg
88603c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
88613c15da26Smrg    func_basename_result="${1##*/}"])
88623c15da26Smrg
88633c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
88643c15da26Smrg    case ${1} in
88653c15da26Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
88663c15da26Smrg      *  ) func_dirname_result="${3}" ;;
88673c15da26Smrg    esac
88683c15da26Smrg    func_basename_result="${1##*/}"])
8869d656433aSmrg
88703c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
88713c15da26Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
88723c15da26Smrg    # positional parameters, so assign one to ordinary parameter first.
88733c15da26Smrg    func_stripname_result=${3}
88743c15da26Smrg    func_stripname_result=${func_stripname_result#"${1}"}
88753c15da26Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
8876d656433aSmrg
88773c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
88783c15da26Smrg    func_split_long_opt_name=${1%%=*}
88793c15da26Smrg    func_split_long_opt_arg=${1#*=}])
8880d656433aSmrg
88813c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
88823c15da26Smrg    func_split_short_opt_arg=${1#??}
88833c15da26Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8884d656433aSmrg
88853c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
88863c15da26Smrg    case ${1} in
88873c15da26Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
88883c15da26Smrg      *)    func_lo2o_result=${1} ;;
88893c15da26Smrg    esac])
8890d656433aSmrg
88913c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8892d656433aSmrg
88933c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8894d656433aSmrg
88953c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8896555991fdSmrgfi
8897d656433aSmrg
88983c15da26Smrgif test x"$lt_shell_append" = xyes; then
88993c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8900d656433aSmrg
89013c15da26Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
89023c15da26Smrg    func_quote_for_eval "${2}"
89033c15da26Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
89043c15da26Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8905d656433aSmrg
89063c15da26Smrg  # Save a `func_append' function call where possible by direct use of '+='
89073c15da26Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
89083c15da26Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
89093c15da26Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
89103c15da26Smrg  test 0 -eq $? || _lt_function_replace_fail=:
89113c15da26Smrgelse
89123c15da26Smrg  # Save a `func_append' function call even when '+=' is not available
89133c15da26Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
89143c15da26Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
89153c15da26Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
89163c15da26Smrg  test 0 -eq $? || _lt_function_replace_fail=:
89173c15da26Smrgfi
8918d656433aSmrg
89193c15da26Smrgif test x"$_lt_function_replace_fail" = x":"; then
89203c15da26Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
89213c15da26Smrgfi
89223c15da26Smrg])
8923d656433aSmrg
89243c15da26Smrg# _LT_PATH_CONVERSION_FUNCTIONS
89253c15da26Smrg# -----------------------------
89263c15da26Smrg# Determine which file name conversion functions should be used by
89273c15da26Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
89283c15da26Smrg# for certain cross-compile configurations and native mingw.
89293c15da26Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
89303c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
89313c15da26SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
89323c15da26SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
89333c15da26SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
89343c15da26Smrg[case $host in
89353c15da26Smrg  *-*-mingw* )
89363c15da26Smrg    case $build in
89373c15da26Smrg      *-*-mingw* ) # actually msys
89383c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
89393c15da26Smrg        ;;
89403c15da26Smrg      *-*-cygwin* )
89413c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
89423c15da26Smrg        ;;
89433c15da26Smrg      * ) # otherwise, assume *nix
89443c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
89453c15da26Smrg        ;;
89463c15da26Smrg    esac
8947555991fdSmrg    ;;
89483c15da26Smrg  *-*-cygwin* )
89493c15da26Smrg    case $build in
89503c15da26Smrg      *-*-mingw* ) # actually msys
89513c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
89523c15da26Smrg        ;;
89533c15da26Smrg      *-*-cygwin* )
89543c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
89553c15da26Smrg        ;;
89563c15da26Smrg      * ) # otherwise, assume *nix
89573c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
89583c15da26Smrg        ;;
8959555991fdSmrg    esac
8960555991fdSmrg    ;;
89613c15da26Smrg  * ) # unhandled hosts (and "normal" native builds)
89623c15da26Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
89633c15da26Smrg    ;;
8964555991fdSmrgesac
8965555991fdSmrg])
89663c15da26Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
89673c15da26SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
89683c15da26Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
89693c15da26Smrg         [0], [convert $build file names to $host format])dnl
89703c15da26Smrg
89713c15da26SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
89723c15da26SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
89733c15da26Smrg[#assume ordinary cross tools, or native build.
89743c15da26Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
89753c15da26Smrgcase $host in
89763c15da26Smrg  *-*-mingw* )
89773c15da26Smrg    case $build in
89783c15da26Smrg      *-*-mingw* ) # actually msys
89793c15da26Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
89803c15da26Smrg        ;;
89813c15da26Smrg    esac
89823c15da26Smrg    ;;
8983555991fdSmrgesac
89843c15da26Smrg])
89853c15da26Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
89863c15da26SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
89873c15da26Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
89883c15da26Smrg         [0], [convert $build files to toolchain format])dnl
89893c15da26Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
8990d656433aSmrg
89913c15da26Smrg# Helper functions for option handling.                    -*- Autoconf -*-
89923c15da26Smrg#
89933c15da26Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
89943c15da26Smrg#   Inc.
89953c15da26Smrg#   Written by Gary V. Vaughan, 2004
89963c15da26Smrg#
89973c15da26Smrg# This file is free software; the Free Software Foundation gives
89983c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
89993c15da26Smrg# modifications, as long as this notice is preserved.
9000d656433aSmrg
90013c15da26Smrg# serial 7 ltoptions.m4
9002d656433aSmrg
90033c15da26Smrg# This is to help aclocal find these macros, as it can't see m4_define.
90043c15da26SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9005d656433aSmrg
9006126a8a12Smrg
90073c15da26Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
90083c15da26Smrg# ------------------------------------------
90093c15da26Smrgm4_define([_LT_MANGLE_OPTION],
90103c15da26Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9011126a8a12Smrg
9012126a8a12Smrg
90133c15da26Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
90143c15da26Smrg# ---------------------------------------
90153c15da26Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
90163c15da26Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
90173c15da26Smrg# saved as a flag.
90183c15da26Smrgm4_define([_LT_SET_OPTION],
90193c15da26Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
90203c15da26Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
90213c15da26Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
90223c15da26Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
90233c15da26Smrg])
9024126a8a12Smrg
9025126a8a12Smrg
90263c15da26Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
90273c15da26Smrg# ------------------------------------------------------------
90283c15da26Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
90293c15da26Smrgm4_define([_LT_IF_OPTION],
90303c15da26Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9031126a8a12Smrg
9032126a8a12Smrg
90333c15da26Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
90343c15da26Smrg# -------------------------------------------------------
90353c15da26Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
90363c15da26Smrg# are set.
90373c15da26Smrgm4_define([_LT_UNLESS_OPTIONS],
90383c15da26Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
90393c15da26Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
90403c15da26Smrg		      [m4_define([$0_found])])])[]dnl
90413c15da26Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
90423c15da26Smrg])[]dnl
90433c15da26Smrg])
9044126a8a12Smrg
9045126a8a12Smrg
90463c15da26Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
90473c15da26Smrg# ----------------------------------------
90483c15da26Smrg# OPTION-LIST is a space-separated list of Libtool options associated
90493c15da26Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
90503c15da26Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
90513c15da26Smrg# the unknown option and exit.
90523c15da26Smrgm4_defun([_LT_SET_OPTIONS],
90533c15da26Smrg[# Set options
90543c15da26Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
90553c15da26Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
9056126a8a12Smrg
90573c15da26Smrgm4_if([$1],[LT_INIT],[
90583c15da26Smrg  dnl
90593c15da26Smrg  dnl Simply set some default values (i.e off) if boolean options were not
90603c15da26Smrg  dnl specified:
90613c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
90623c15da26Smrg  ])
90633c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
90643c15da26Smrg  ])
90653c15da26Smrg  dnl
90663c15da26Smrg  dnl If no reference was made to various pairs of opposing options, then
90673c15da26Smrg  dnl we run the default mode handler for the pair.  For example, if neither
90683c15da26Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
90693c15da26Smrg  dnl archives by default:
90703c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
90713c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
90723c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
90733c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
90743c15da26Smrg  		   [_LT_ENABLE_FAST_INSTALL])
90753c15da26Smrg  ])
90763c15da26Smrg])# _LT_SET_OPTIONS
9077126a8a12Smrg
9078126a8a12Smrg
9079126a8a12Smrg
90803c15da26Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
90813c15da26Smrg# -----------------------------------------
90823c15da26Smrgm4_define([_LT_MANGLE_DEFUN],
90833c15da26Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
90843c15da26Smrg
90853c15da26Smrg
90863c15da26Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
90873c15da26Smrg# -----------------------------------------------
90883c15da26Smrgm4_define([LT_OPTION_DEFINE],
90893c15da26Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
90903c15da26Smrg])# LT_OPTION_DEFINE
90913c15da26Smrg
90923c15da26Smrg
90933c15da26Smrg# dlopen
90943c15da26Smrg# ------
90953c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
90963c15da26Smrg])
90973c15da26Smrg
90983c15da26SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
90993c15da26Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
91003c15da26SmrgAC_DIAGNOSE([obsolete],
91013c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
91023c15da26Smrgput the `dlopen' option into LT_INIT's first parameter.])
91033c15da26Smrg])
91043c15da26Smrg
91053c15da26Smrgdnl aclocal-1.4 backwards compatibility:
91063c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
91073c15da26Smrg
91083c15da26Smrg
91093c15da26Smrg# win32-dll
91103c15da26Smrg# ---------
91113c15da26Smrg# Declare package support for building win32 dll's.
91123c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
91133c15da26Smrg[enable_win32_dll=yes
91143c15da26Smrg
91153c15da26Smrgcase $host in
91163c15da26Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
91173c15da26Smrg  AC_CHECK_TOOL(AS, as, false)
91183c15da26Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
91193c15da26Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
91203c15da26Smrg  ;;
91213c15da26Smrgesac
9122126a8a12Smrg
91233c15da26Smrgtest -z "$AS" && AS=as
91243c15da26Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
9125126a8a12Smrg
91263c15da26Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
91273c15da26Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9128126a8a12Smrg
91293c15da26Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
91303c15da26Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
91313c15da26Smrg])# win32-dll
9132126a8a12Smrg
91333c15da26SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
91343c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
91353c15da26Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
91363c15da26SmrgAC_DIAGNOSE([obsolete],
91373c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
91383c15da26Smrgput the `win32-dll' option into LT_INIT's first parameter.])
91393c15da26Smrg])
9140126a8a12Smrg
91413c15da26Smrgdnl aclocal-1.4 backwards compatibility:
91423c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9143d656433aSmrg
9144d656433aSmrg
91453c15da26Smrg# _LT_ENABLE_SHARED([DEFAULT])
91463c15da26Smrg# ----------------------------
91473c15da26Smrg# implement the --enable-shared flag, and supports the `shared' and
91483c15da26Smrg# `disable-shared' LT_INIT options.
91493c15da26Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
91503c15da26Smrgm4_define([_LT_ENABLE_SHARED],
91513c15da26Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
91523c15da26SmrgAC_ARG_ENABLE([shared],
91533c15da26Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
91543c15da26Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
91553c15da26Smrg    [p=${PACKAGE-default}
91563c15da26Smrg    case $enableval in
91573c15da26Smrg    yes) enable_shared=yes ;;
91583c15da26Smrg    no) enable_shared=no ;;
91593c15da26Smrg    *)
91603c15da26Smrg      enable_shared=no
91613c15da26Smrg      # Look at the argument we got.  We use all the common list separators.
91623c15da26Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
91633c15da26Smrg      for pkg in $enableval; do
91643c15da26Smrg	IFS="$lt_save_ifs"
91653c15da26Smrg	if test "X$pkg" = "X$p"; then
91663c15da26Smrg	  enable_shared=yes
91673c15da26Smrg	fi
91683c15da26Smrg      done
91693c15da26Smrg      IFS="$lt_save_ifs"
91703c15da26Smrg      ;;
91713c15da26Smrg    esac],
91723c15da26Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9173d656433aSmrg
91743c15da26Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
91753c15da26Smrg	[Whether or not to build shared libraries])
91763c15da26Smrg])# _LT_ENABLE_SHARED
9177555991fdSmrg
91783c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
91793c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9180d656433aSmrg
91813c15da26Smrg# Old names:
91823c15da26SmrgAC_DEFUN([AC_ENABLE_SHARED],
91833c15da26Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
91843c15da26Smrg])
9185d656433aSmrg
91863c15da26SmrgAC_DEFUN([AC_DISABLE_SHARED],
91873c15da26Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
91883c15da26Smrg])
9189d656433aSmrg
91903c15da26SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
91913c15da26SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9192d656433aSmrg
91933c15da26Smrgdnl aclocal-1.4 backwards compatibility:
91943c15da26Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
91953c15da26Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
9196d656433aSmrg
9197d656433aSmrg
9198d656433aSmrg
91993c15da26Smrg# _LT_ENABLE_STATIC([DEFAULT])
92003c15da26Smrg# ----------------------------
92013c15da26Smrg# implement the --enable-static flag, and support the `static' and
92023c15da26Smrg# `disable-static' LT_INIT options.
92033c15da26Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
92043c15da26Smrgm4_define([_LT_ENABLE_STATIC],
92053c15da26Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
92063c15da26SmrgAC_ARG_ENABLE([static],
92073c15da26Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
92083c15da26Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
92093c15da26Smrg    [p=${PACKAGE-default}
92103c15da26Smrg    case $enableval in
92113c15da26Smrg    yes) enable_static=yes ;;
92123c15da26Smrg    no) enable_static=no ;;
92133c15da26Smrg    *)
92143c15da26Smrg     enable_static=no
92153c15da26Smrg      # Look at the argument we got.  We use all the common list separators.
92163c15da26Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
92173c15da26Smrg      for pkg in $enableval; do
92183c15da26Smrg	IFS="$lt_save_ifs"
92193c15da26Smrg	if test "X$pkg" = "X$p"; then
92203c15da26Smrg	  enable_static=yes
9221555991fdSmrg	fi
92223c15da26Smrg      done
92233c15da26Smrg      IFS="$lt_save_ifs"
92243c15da26Smrg      ;;
92253c15da26Smrg    esac],
92263c15da26Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9227d656433aSmrg
92283c15da26Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
92293c15da26Smrg	[Whether or not to build static libraries])
92303c15da26Smrg])# _LT_ENABLE_STATIC
9231d656433aSmrg
92323c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
92333c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9234d656433aSmrg
92353c15da26Smrg# Old names:
92363c15da26SmrgAC_DEFUN([AC_ENABLE_STATIC],
92373c15da26Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
92383c15da26Smrg])
9239d656433aSmrg
92403c15da26SmrgAC_DEFUN([AC_DISABLE_STATIC],
92413c15da26Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
92423c15da26Smrg])
9243d656433aSmrg
92443c15da26SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
92453c15da26SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9246d656433aSmrg
92473c15da26Smrgdnl aclocal-1.4 backwards compatibility:
92483c15da26Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
92493c15da26Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
9250d656433aSmrg
9251d656433aSmrg
9252d656433aSmrg
92533c15da26Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
92543c15da26Smrg# ----------------------------------
92553c15da26Smrg# implement the --enable-fast-install flag, and support the `fast-install'
92563c15da26Smrg# and `disable-fast-install' LT_INIT options.
92573c15da26Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
92583c15da26Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
92593c15da26Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
92603c15da26SmrgAC_ARG_ENABLE([fast-install],
92613c15da26Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
92623c15da26Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
92633c15da26Smrg    [p=${PACKAGE-default}
92643c15da26Smrg    case $enableval in
92653c15da26Smrg    yes) enable_fast_install=yes ;;
92663c15da26Smrg    no) enable_fast_install=no ;;
92673c15da26Smrg    *)
92683c15da26Smrg      enable_fast_install=no
92693c15da26Smrg      # Look at the argument we got.  We use all the common list separators.
92703c15da26Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
92713c15da26Smrg      for pkg in $enableval; do
92723c15da26Smrg	IFS="$lt_save_ifs"
92733c15da26Smrg	if test "X$pkg" = "X$p"; then
92743c15da26Smrg	  enable_fast_install=yes
92753c15da26Smrg	fi
92763c15da26Smrg      done
92773c15da26Smrg      IFS="$lt_save_ifs"
92783c15da26Smrg      ;;
92793c15da26Smrg    esac],
92803c15da26Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
92813c15da26Smrg
92823c15da26Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
92833c15da26Smrg	 [Whether or not to optimize for fast installation])dnl
92843c15da26Smrg])# _LT_ENABLE_FAST_INSTALL
9285d656433aSmrg
92863c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
92873c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9288d656433aSmrg
92893c15da26Smrg# Old names:
92903c15da26SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
92913c15da26Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
92923c15da26SmrgAC_DIAGNOSE([obsolete],
92933c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
92943c15da26Smrgthe `fast-install' option into LT_INIT's first parameter.])
92953c15da26Smrg])
9296d656433aSmrg
92973c15da26SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
92983c15da26Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
92993c15da26SmrgAC_DIAGNOSE([obsolete],
93003c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
93013c15da26Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
93023c15da26Smrg])
9303d656433aSmrg
93043c15da26Smrgdnl aclocal-1.4 backwards compatibility:
93053c15da26Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
93063c15da26Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9307d656433aSmrg
9308d656433aSmrg
93093c15da26Smrg# _LT_WITH_PIC([MODE])
93103c15da26Smrg# --------------------
93113c15da26Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
93123c15da26Smrg# LT_INIT options.
93133c15da26Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
93143c15da26Smrgm4_define([_LT_WITH_PIC],
93153c15da26Smrg[AC_ARG_WITH([pic],
93163c15da26Smrg    [AS_HELP_STRING([--with-pic],
93173c15da26Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
93183c15da26Smrg    [pic_mode="$withval"],
93193c15da26Smrg    [pic_mode=default])
9320d656433aSmrg
93213c15da26Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9322d656433aSmrg
93233c15da26Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
93243c15da26Smrg])# _LT_WITH_PIC
9325d656433aSmrg
93263c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
93273c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9328555991fdSmrg
93293c15da26Smrg# Old name:
93303c15da26SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
93313c15da26Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
93323c15da26SmrgAC_DIAGNOSE([obsolete],
93333c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
93343c15da26Smrgput the `pic-only' option into LT_INIT's first parameter.])
93353c15da26Smrg])
9336d656433aSmrg
93373c15da26Smrgdnl aclocal-1.4 backwards compatibility:
93383c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9339555991fdSmrg
9340555991fdSmrg
93413c15da26Smrgm4_define([_LTDL_MODE], [])
93423c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
93433c15da26Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
93443c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
93453c15da26Smrg		 [m4_define([_LTDL_MODE], [recursive])])
93463c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
93473c15da26Smrg		 [m4_define([_LTDL_MODE], [subproject])])
9348555991fdSmrg
93493c15da26Smrgm4_define([_LTDL_TYPE], [])
93503c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
93513c15da26Smrg		 [m4_define([_LTDL_TYPE], [installable])])
93523c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
93533c15da26Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
9354555991fdSmrg
93553c15da26Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
93563c15da26Smrg#
93573c15da26Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
93583c15da26Smrg# Written by Gary V. Vaughan, 2004
93593c15da26Smrg#
93603c15da26Smrg# This file is free software; the Free Software Foundation gives
93613c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
93623c15da26Smrg# modifications, as long as this notice is preserved.
9363555991fdSmrg
93643c15da26Smrg# serial 6 ltsugar.m4
9365555991fdSmrg
93663c15da26Smrg# This is to help aclocal find these macros, as it can't see m4_define.
93673c15da26SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9368555991fdSmrg
9369d656433aSmrg
93703c15da26Smrg# lt_join(SEP, ARG1, [ARG2...])
93713c15da26Smrg# -----------------------------
93723c15da26Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
93733c15da26Smrg# associated separator.
93743c15da26Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
93753c15da26Smrg# versions in m4sugar had bugs.
93763c15da26Smrgm4_define([lt_join],
93773c15da26Smrg[m4_if([$#], [1], [],
93783c15da26Smrg       [$#], [2], [[$2]],
93793c15da26Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
93803c15da26Smrgm4_define([_lt_join],
93813c15da26Smrg[m4_if([$#$2], [2], [],
93823c15da26Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9383d656433aSmrg
9384d656433aSmrg
93853c15da26Smrg# lt_car(LIST)
93863c15da26Smrg# lt_cdr(LIST)
93873c15da26Smrg# ------------
93883c15da26Smrg# Manipulate m4 lists.
93893c15da26Smrg# These macros are necessary as long as will still need to support
93903c15da26Smrg# Autoconf-2.59 which quotes differently.
93913c15da26Smrgm4_define([lt_car], [[$1]])
93923c15da26Smrgm4_define([lt_cdr],
93933c15da26Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
93943c15da26Smrg       [$#], 1, [],
93953c15da26Smrg       [m4_dquote(m4_shift($@))])])
93963c15da26Smrgm4_define([lt_unquote], $1)
9397d656433aSmrg
9398d656433aSmrg
93993c15da26Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
94003c15da26Smrg# ------------------------------------------
94013c15da26Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
94023c15da26Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
94033c15da26Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
94043c15da26Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
94053c15da26Smrg# than defined and empty).
94063c15da26Smrg#
94073c15da26Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
94083c15da26Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
94093c15da26Smrgm4_define([lt_append],
94103c15da26Smrg[m4_define([$1],
94113c15da26Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9412d656433aSmrg
9413d656433aSmrg
9414d656433aSmrg
94153c15da26Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
94163c15da26Smrg# ----------------------------------------------------------
94173c15da26Smrg# Produce a SEP delimited list of all paired combinations of elements of
94183c15da26Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
94193c15da26Smrg# has the form PREFIXmINFIXSUFFIXn.
94203c15da26Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
94213c15da26Smrgm4_define([lt_combine],
94223c15da26Smrg[m4_if(m4_eval([$# > 3]), [1],
94233c15da26Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
94243c15da26Smrg[[m4_foreach([_Lt_prefix], [$2],
94253c15da26Smrg	     [m4_foreach([_Lt_suffix],
94263c15da26Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
94273c15da26Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9428d656433aSmrg
9429d656433aSmrg
94303c15da26Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
94313c15da26Smrg# -----------------------------------------------------------------------
94323c15da26Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
94333c15da26Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
94343c15da26Smrgm4_define([lt_if_append_uniq],
94353c15da26Smrg[m4_ifdef([$1],
94363c15da26Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
94373c15da26Smrg		 [lt_append([$1], [$2], [$3])$4],
94383c15da26Smrg		 [$5])],
94393c15da26Smrg	  [lt_append([$1], [$2], [$3])$4])])
9440d656433aSmrg
9441d656433aSmrg
94423c15da26Smrg# lt_dict_add(DICT, KEY, VALUE)
94433c15da26Smrg# -----------------------------
94443c15da26Smrgm4_define([lt_dict_add],
94453c15da26Smrg[m4_define([$1($2)], [$3])])
9446d656433aSmrg
94473c15da26Smrg
94483c15da26Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
94493c15da26Smrg# --------------------------------------------
94503c15da26Smrgm4_define([lt_dict_add_subkey],
94513c15da26Smrg[m4_define([$1($2:$3)], [$4])])
9452d656433aSmrg
9453d656433aSmrg
94543c15da26Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
94553c15da26Smrg# ----------------------------------
94563c15da26Smrgm4_define([lt_dict_fetch],
94573c15da26Smrg[m4_ifval([$3],
94583c15da26Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
94593c15da26Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9460d656433aSmrg
9461d656433aSmrg
94623c15da26Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
94633c15da26Smrg# -----------------------------------------------------------------
94643c15da26Smrgm4_define([lt_if_dict_fetch],
94653c15da26Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
94663c15da26Smrg	[$5],
94673c15da26Smrg    [$6])])
9468555991fdSmrg
9469555991fdSmrg
94703c15da26Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
94713c15da26Smrg# --------------------------------------------------------------
94723c15da26Smrgm4_define([lt_dict_filter],
94733c15da26Smrg[m4_if([$5], [], [],
94743c15da26Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
94753c15da26Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
94763c15da26Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9477555991fdSmrg])
9478555991fdSmrg
94793c15da26Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
94803c15da26Smrg#
94813c15da26Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
94823c15da26Smrg#   Written by Scott James Remnant, 2004
94833c15da26Smrg#
94843c15da26Smrg# This file is free software; the Free Software Foundation gives
94853c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
94863c15da26Smrg# modifications, as long as this notice is preserved.
9487d656433aSmrg
94883c15da26Smrg# @configure_input@
9489d656433aSmrg
94903c15da26Smrg# serial 3293 ltversion.m4
94913c15da26Smrg# This file is part of GNU Libtool
9492126a8a12Smrg
94933c15da26Smrgm4_define([LT_PACKAGE_VERSION], [2.4])
94943c15da26Smrgm4_define([LT_PACKAGE_REVISION], [1.3293])
9495126a8a12Smrg
94963c15da26SmrgAC_DEFUN([LTVERSION_VERSION],
94973c15da26Smrg[macro_version='2.4'
94983c15da26Smrgmacro_revision='1.3293'
94993c15da26Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
95003c15da26Smrg_LT_DECL(, macro_revision, 0)
95013c15da26Smrg])
9502d656433aSmrg
95033c15da26Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
95043c15da26Smrg#
95053c15da26Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
95063c15da26Smrg#   Written by Scott James Remnant, 2004.
95073c15da26Smrg#
95083c15da26Smrg# This file is free software; the Free Software Foundation gives
95093c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
95103c15da26Smrg# modifications, as long as this notice is preserved.
9511126a8a12Smrg
95123c15da26Smrg# serial 5 lt~obsolete.m4
9513126a8a12Smrg
95143c15da26Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
95153c15da26Smrg#
95163c15da26Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
95173c15da26Smrg# which have later been changed to m4_define as they aren't part of the
95183c15da26Smrg# exported API, or moved to Autoconf or Automake where they belong.
95193c15da26Smrg#
95203c15da26Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
95213c15da26Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
95223c15da26Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
95233c15da26Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
95243c15da26Smrg# and doesn't know about Autoconf macros at all.)
95253c15da26Smrg#
95263c15da26Smrg# So we provide this file, which has a silly filename so it's always
95273c15da26Smrg# included after everything else.  This provides aclocal with the
95283c15da26Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
95293c15da26Smrg# because those macros already exist, or will be overwritten later.
95303c15da26Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
95313c15da26Smrg#
95323c15da26Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
95333c15da26Smrg# Yes, that means every name once taken will need to remain here until
95343c15da26Smrg# we give up compatibility with versions before 1.7, at which point
95353c15da26Smrg# we need to keep only those names which we still refer to.
9536d656433aSmrg
95373c15da26Smrg# This is to help aclocal find these macros, as it can't see m4_define.
95383c15da26SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9539126a8a12Smrg
95403c15da26Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
95413c15da26Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
95423c15da26Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
95433c15da26Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
95443c15da26Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
95453c15da26Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
95463c15da26Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
95473c15da26Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
95483c15da26Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
95493c15da26Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
95503c15da26Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
95513c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
95523c15da26Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
95533c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
95543c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
95553c15da26Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
95563c15da26Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
95573c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
95583c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
95593c15da26Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
95603c15da26Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
95613c15da26Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
95623c15da26Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
95633c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
95643c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
95653c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
95663c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
95673c15da26Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
95683c15da26Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
95693c15da26Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
95703c15da26Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
95713c15da26Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
95723c15da26Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
95733c15da26Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
95743c15da26Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
95753c15da26Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
95763c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
95773c15da26Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
95783c15da26Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
95793c15da26Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
95803c15da26Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
95813c15da26Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
95823c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
95833c15da26Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
95843c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
95853c15da26Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
95863c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
95873c15da26Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
95883c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
95893c15da26Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
95903c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
95913c15da26Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
95923c15da26Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
95933c15da26Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
95943c15da26Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
95953c15da26Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
95963c15da26Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
95973c15da26Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
95983c15da26Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
95993c15da26Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
96003c15da26Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9601126a8a12Smrg
96023c15da26Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
96033c15da26Smrgdnl
96043c15da26Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
96053c15da26Smrgdnl 
96063c15da26Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
96073c15da26Smrgdnl copy of this software and associated documentation files (the "Software"),
96083c15da26Smrgdnl to deal in the Software without restriction, including without limitation
96093c15da26Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
96103c15da26Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
96113c15da26Smrgdnl Software is furnished to do so, subject to the following conditions:
96123c15da26Smrgdnl
96133c15da26Smrgdnl The above copyright notice and this permission notice (including the next
96143c15da26Smrgdnl paragraph) shall be included in all copies or substantial portions of the
96153c15da26Smrgdnl Software.
96163c15da26Smrgdnl
96173c15da26Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
96183c15da26Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
96193c15da26Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
96203c15da26Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
96213c15da26Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
96223c15da26Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
96233c15da26Smrgdnl DEALINGS IN THE SOFTWARE.
9624126a8a12Smrg
96253c15da26Smrg# XORG_MACROS_VERSION(required-version)
96263c15da26Smrg# -------------------------------------
96273c15da26Smrg# Minimum version: 1.1.0
96283c15da26Smrg#
96293c15da26Smrg# If you're using a macro added in Version 1.1 or newer, include this in
96303c15da26Smrg# your configure.ac with the minimum required version, such as:
96313c15da26Smrg# XORG_MACROS_VERSION(1.1)
96323c15da26Smrg#
96333c15da26Smrg# To ensure that this macro is defined, also add:
96343c15da26Smrg# m4_ifndef([XORG_MACROS_VERSION],
96353c15da26Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
96363c15da26Smrg#
96373c15da26Smrg#
96383c15da26Smrg# See the "minimum version" comment for each macro you use to see what 
96393c15da26Smrg# version you require.
96403c15da26Smrgm4_defun([XORG_MACROS_VERSION],[
96413c15da26Smrgm4_define([vers_have], [1.16.1])
96423c15da26Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
96433c15da26Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
96443c15da26Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
96453c15da26Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
96463c15da26Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
96473c15da26Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
96483c15da26Smrgm4_undefine([vers_have])
96493c15da26Smrgm4_undefine([maj_have])
96503c15da26Smrgm4_undefine([maj_needed])
96513c15da26Smrg]) # XORG_MACROS_VERSION
9652126a8a12Smrg
96533c15da26Smrg# XORG_PROG_RAWCPP()
96543c15da26Smrg# ------------------
96553c15da26Smrg# Minimum version: 1.0.0
96563c15da26Smrg#
96573c15da26Smrg# Find cpp program and necessary flags for use in pre-processing text files
96583c15da26Smrg# such as man pages and config files
96593c15da26SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
96603c15da26SmrgAC_REQUIRE([AC_PROG_CPP])
96613c15da26SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
96623c15da26Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9663126a8a12Smrg
96643c15da26Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
96653c15da26Smrg# which is not the best choice for supporting other OS'es, but covers most
96663c15da26Smrg# of the ones we need for now.
96673c15da26SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
96683c15da26SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
96693c15da26Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
96703c15da26Smrg	AC_MSG_RESULT([no])
96713c15da26Smrgelse
96723c15da26Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
96733c15da26Smrg		RAWCPPFLAGS=-undef
96743c15da26Smrg		AC_MSG_RESULT([yes])
96753c15da26Smrg	# under Cygwin unix is still defined even with -undef
96763c15da26Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
96773c15da26Smrg		RAWCPPFLAGS="-undef -ansi"
96783c15da26Smrg		AC_MSG_RESULT([yes, with -ansi])
96793c15da26Smrg	else
96803c15da26Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
96813c15da26Smrg	fi
96823c15da26Smrgfi
96833c15da26Smrgrm -f conftest.$ac_ext
9684126a8a12Smrg
96853c15da26SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
96863c15da26SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
96873c15da26Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
96883c15da26Smrg	AC_MSG_RESULT([no])
96893c15da26Smrgelse
96903c15da26Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
96913c15da26Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
96923c15da26Smrg		AC_MSG_RESULT([yes])
96933c15da26Smrg	else
96943c15da26Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
96953c15da26Smrg	fi
96963c15da26Smrgfi
96973c15da26Smrgrm -f conftest.$ac_ext
96983c15da26SmrgAC_SUBST(RAWCPPFLAGS)
96993c15da26Smrg]) # XORG_PROG_RAWCPP
9700126a8a12Smrg
97013c15da26Smrg# XORG_MANPAGE_SECTIONS()
97023c15da26Smrg# -----------------------
97033c15da26Smrg# Minimum version: 1.0.0
97043c15da26Smrg#
97053c15da26Smrg# Determine which sections man pages go in for the different man page types
97063c15da26Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
97073c15da26Smrg# Not sure if there's any better way than just hardcoding by OS name.
97083c15da26Smrg# Override default settings by setting environment variables
97093c15da26Smrg# Added MAN_SUBSTS in version 1.8
97103c15da26Smrg# Added AC_PROG_SED in version 1.8
9711126a8a12Smrg
97123c15da26SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
97133c15da26SmrgAC_REQUIRE([AC_CANONICAL_HOST])
97143c15da26SmrgAC_REQUIRE([AC_PROG_SED])
9715126a8a12Smrg
97163c15da26Smrgif test x$APP_MAN_SUFFIX = x    ; then
97173c15da26Smrg    APP_MAN_SUFFIX=1
97183c15da26Smrgfi
97193c15da26Smrgif test x$APP_MAN_DIR = x    ; then
97203c15da26Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
97213c15da26Smrgfi
9722126a8a12Smrg
97233c15da26Smrgif test x$LIB_MAN_SUFFIX = x    ; then
97243c15da26Smrg    LIB_MAN_SUFFIX=3
97253c15da26Smrgfi
97263c15da26Smrgif test x$LIB_MAN_DIR = x    ; then
97273c15da26Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
97283c15da26Smrgfi
9729126a8a12Smrg
97303c15da26Smrgif test x$FILE_MAN_SUFFIX = x    ; then
97313c15da26Smrg    case $host_os in
97323c15da26Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
97333c15da26Smrg	*)		FILE_MAN_SUFFIX=5  ;;
97343c15da26Smrg    esac
97353c15da26Smrgfi
97363c15da26Smrgif test x$FILE_MAN_DIR = x    ; then
97373c15da26Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
97383c15da26Smrgfi
9739126a8a12Smrg
97403c15da26Smrgif test x$MISC_MAN_SUFFIX = x    ; then
97413c15da26Smrg    case $host_os in
97423c15da26Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
97433c15da26Smrg	*)		MISC_MAN_SUFFIX=7  ;;
97443c15da26Smrg    esac
97453c15da26Smrgfi
97463c15da26Smrgif test x$MISC_MAN_DIR = x    ; then
97473c15da26Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
97483c15da26Smrgfi
9749126a8a12Smrg
97503c15da26Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
97513c15da26Smrg    case $host_os in
97523c15da26Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
97533c15da26Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
97543c15da26Smrg    esac
97553c15da26Smrgfi
97563c15da26Smrgif test x$DRIVER_MAN_DIR = x    ; then
97573c15da26Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
97583c15da26Smrgfi
9759126a8a12Smrg
97603c15da26Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
97613c15da26Smrg    case $host_os in
97623c15da26Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
97633c15da26Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
97643c15da26Smrg    esac
97653c15da26Smrgfi
97663c15da26Smrgif test x$ADMIN_MAN_DIR = x    ; then
97673c15da26Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
97683c15da26Smrgfi
9769126a8a12Smrg
9770126a8a12Smrg
97713c15da26SmrgAC_SUBST([APP_MAN_SUFFIX])
97723c15da26SmrgAC_SUBST([LIB_MAN_SUFFIX])
97733c15da26SmrgAC_SUBST([FILE_MAN_SUFFIX])
97743c15da26SmrgAC_SUBST([MISC_MAN_SUFFIX])
97753c15da26SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
97763c15da26SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
97773c15da26SmrgAC_SUBST([APP_MAN_DIR])
97783c15da26SmrgAC_SUBST([LIB_MAN_DIR])
97793c15da26SmrgAC_SUBST([FILE_MAN_DIR])
97803c15da26SmrgAC_SUBST([MISC_MAN_DIR])
97813c15da26SmrgAC_SUBST([DRIVER_MAN_DIR])
97823c15da26SmrgAC_SUBST([ADMIN_MAN_DIR])
9783126a8a12Smrg
97843c15da26SmrgXORG_MAN_PAGE="X Version 11"
97853c15da26SmrgAC_SUBST([XORG_MAN_PAGE])
97863c15da26SmrgMAN_SUBSTS="\
97873c15da26Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
97883c15da26Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
97893c15da26Smrg	-e 's|__xservername__|Xorg|g' \
97903c15da26Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
97913c15da26Smrg	-e 's|__projectroot__|\$(prefix)|g' \
97923c15da26Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
97933c15da26Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
97943c15da26Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
97953c15da26Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
97963c15da26Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
97973c15da26Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
97983c15da26Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
97993c15da26SmrgAC_SUBST([MAN_SUBSTS])
9800555991fdSmrg
98013c15da26Smrg]) # XORG_MANPAGE_SECTIONS
9802126a8a12Smrg
98033c15da26Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
98043c15da26Smrg# ------------------------
98053c15da26Smrg# Minimum version: 1.7.0
98063c15da26Smrg#
98073c15da26Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
98083c15da26Smrg# provided by xorg-sgml-doctools, if installed.
98093c15da26SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
98103c15da26SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
98113c15da26SmrgXORG_SGML_PATH=
98123c15da26SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
98133c15da26Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
98143c15da26Smrg    [m4_ifval([$1],[:],
98153c15da26Smrg        [if test x"$cross_compiling" != x"yes" ; then
98163c15da26Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
98173c15da26Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
98183c15da26Smrg         fi])
98193c15da26Smrg    ])
9820126a8a12Smrg
98213c15da26Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
98223c15da26Smrg# the path and the name of the doc stylesheet
98233c15da26Smrgif test "x$XORG_SGML_PATH" != "x" ; then
98243c15da26Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
98253c15da26Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
98263c15da26Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
98273c15da26Smrgelse
98283c15da26Smrg   AC_MSG_RESULT([no])
98293c15da26Smrgfi
9830126a8a12Smrg
98313c15da26SmrgAC_SUBST(XORG_SGML_PATH)
98323c15da26SmrgAC_SUBST(STYLESHEET_SRCDIR)
98333c15da26SmrgAC_SUBST(XSL_STYLESHEET)
98343c15da26SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
98353c15da26Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9836555991fdSmrg
98373c15da26Smrg# XORG_CHECK_LINUXDOC
98383c15da26Smrg# -------------------
98393c15da26Smrg# Minimum version: 1.0.0
98403c15da26Smrg#
98413c15da26Smrg# Defines the variable MAKE_TEXT if the necessary tools and
98423c15da26Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
98433c15da26Smrg# Whether or not the necessary tools and files are found can be checked
98443c15da26Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
98453c15da26SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
98463c15da26SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
98473c15da26SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9848126a8a12Smrg
98493c15da26SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9850126a8a12Smrg
98513c15da26SmrgAC_MSG_CHECKING([whether to build documentation])
9852126a8a12Smrg
98533c15da26Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
98543c15da26Smrg   BUILDDOC=yes
98553c15da26Smrgelse
98563c15da26Smrg   BUILDDOC=no
98573c15da26Smrgfi
9858126a8a12Smrg
98593c15da26SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9860126a8a12Smrg
98613c15da26SmrgAC_MSG_RESULT([$BUILDDOC])
9862d656433aSmrg
98633c15da26SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9864126a8a12Smrg
98653c15da26Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
98663c15da26Smrg   BUILDPDFDOC=yes
98673c15da26Smrgelse
98683c15da26Smrg   BUILDPDFDOC=no
98693c15da26Smrgfi
9870126a8a12Smrg
98713c15da26SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9872126a8a12Smrg
98733c15da26SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9874126a8a12Smrg
98753c15da26SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
98763c15da26SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
98773c15da26SmrgMAKE_PDF="$PS2PDF"
98783c15da26SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9879126a8a12Smrg
98803c15da26SmrgAC_SUBST(MAKE_TEXT)
98813c15da26SmrgAC_SUBST(MAKE_PS)
98823c15da26SmrgAC_SUBST(MAKE_PDF)
98833c15da26SmrgAC_SUBST(MAKE_HTML)
98843c15da26Smrg]) # XORG_CHECK_LINUXDOC
9885126a8a12Smrg
98863c15da26Smrg# XORG_CHECK_DOCBOOK
98873c15da26Smrg# -------------------
98883c15da26Smrg# Minimum version: 1.0.0
98893c15da26Smrg#
98903c15da26Smrg# Checks for the ability to build output formats from SGML DocBook source.
98913c15da26Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
98923c15da26Smrg# indicates whether the necessary tools and files are found and, if set,
98933c15da26Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
98943c15da26SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
98953c15da26SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9896126a8a12Smrg
98973c15da26SmrgBUILDTXTDOC=no
98983c15da26SmrgBUILDPDFDOC=no
98993c15da26SmrgBUILDPSDOC=no
99003c15da26SmrgBUILDHTMLDOC=no
9901126a8a12Smrg
99023c15da26SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
99033c15da26SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
99043c15da26SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
99053c15da26SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9906555991fdSmrg
99073c15da26SmrgAC_MSG_CHECKING([whether to build text documentation])
99083c15da26Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
99093c15da26Smrg   test x$BUILD_TXTDOC != xno; then
99103c15da26Smrg	BUILDTXTDOC=yes
99113c15da26Smrgfi
99123c15da26SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
99133c15da26SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9914555991fdSmrg
99153c15da26SmrgAC_MSG_CHECKING([whether to build PDF documentation])
99163c15da26Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
99173c15da26Smrg   test x$BUILD_PDFDOC != xno; then
99183c15da26Smrg	BUILDPDFDOC=yes
99193c15da26Smrgfi
99203c15da26SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
99213c15da26SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9922555991fdSmrg
99233c15da26SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
99243c15da26Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
99253c15da26Smrg   test x$BUILD_PSDOC != xno; then
99263c15da26Smrg	BUILDPSDOC=yes
99273c15da26Smrgfi
99283c15da26SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
99293c15da26SmrgAC_MSG_RESULT([$BUILDPSDOC])
9930126a8a12Smrg
99313c15da26SmrgAC_MSG_CHECKING([whether to build HTML documentation])
99323c15da26Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
99333c15da26Smrg   test x$BUILD_HTMLDOC != xno; then
99343c15da26Smrg	BUILDHTMLDOC=yes
99353c15da26Smrgfi
99363c15da26SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
99373c15da26SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9938126a8a12Smrg
99393c15da26SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
99403c15da26SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
99413c15da26SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
99423c15da26SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9943126a8a12Smrg
99443c15da26SmrgAC_SUBST(MAKE_TEXT)
99453c15da26SmrgAC_SUBST(MAKE_PS)
99463c15da26SmrgAC_SUBST(MAKE_PDF)
99473c15da26SmrgAC_SUBST(MAKE_HTML)
99483c15da26Smrg]) # XORG_CHECK_DOCBOOK
9949126a8a12Smrg
99503c15da26Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
99513c15da26Smrg# ----------------
99523c15da26Smrg# Minimum version: 1.5.0
99533c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
99543c15da26Smrg#
99553c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
99563c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
99573c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
99583c15da26Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
99593c15da26Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
99603c15da26Smrg# --with-xmlto assumes 'auto'.
99613c15da26Smrg#
99623c15da26Smrg# Interface to module:
99633c15da26Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
99643c15da26Smrg# XMLTO:	returns the path of the xmlto program found
99653c15da26Smrg#		returns the path set by the user in the environment
99663c15da26Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
99673c15da26Smrg#		'no' user instructs the module not to use xmlto
99683c15da26Smrg#
99693c15da26Smrg# Added in version 1.10.0
99703c15da26Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
99713c15da26Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
99723c15da26Smrg#
99733c15da26Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
99743c15da26Smrg#
99753c15da26SmrgAC_DEFUN([XORG_WITH_XMLTO],[
99763c15da26SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
99773c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
99783c15da26SmrgAC_ARG_WITH(xmlto,
99793c15da26Smrg	AS_HELP_STRING([--with-xmlto],
99803c15da26Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
99813c15da26Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
99823c15da26Smrgm4_undefine([_defopt])
9983555991fdSmrg
99843c15da26Smrgif test "x$use_xmlto" = x"auto"; then
99853c15da26Smrg   AC_PATH_PROG([XMLTO], [xmlto])
99863c15da26Smrg   if test "x$XMLTO" = "x"; then
99873c15da26Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
99883c15da26Smrg	have_xmlto=no
99893c15da26Smrg   else
99903c15da26Smrg        have_xmlto=yes
99913c15da26Smrg   fi
99923c15da26Smrgelif test "x$use_xmlto" = x"yes" ; then
99933c15da26Smrg   AC_PATH_PROG([XMLTO], [xmlto])
99943c15da26Smrg   if test "x$XMLTO" = "x"; then
99953c15da26Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
99963c15da26Smrg   fi
99973c15da26Smrg   have_xmlto=yes
99983c15da26Smrgelif test "x$use_xmlto" = x"no" ; then
99993c15da26Smrg   if test "x$XMLTO" != "x"; then
100003c15da26Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
100013c15da26Smrg   fi
100023c15da26Smrg   have_xmlto=no
100033c15da26Smrgelse
100043c15da26Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
100053c15da26Smrgfi
10006126a8a12Smrg
100073c15da26Smrg# Test for a minimum version of xmlto, if provided.
100083c15da26Smrgm4_ifval([$1],
100093c15da26Smrg[if test "$have_xmlto" = yes; then
100103c15da26Smrg    # scrape the xmlto version
100113c15da26Smrg    AC_MSG_CHECKING([the xmlto version])
100123c15da26Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
100133c15da26Smrg    AC_MSG_RESULT([$xmlto_version])
100143c15da26Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
100153c15da26Smrg        [if test "x$use_xmlto" = xauto; then
100163c15da26Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
100173c15da26Smrg            have_xmlto=no
100183c15da26Smrg        else
100193c15da26Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
100203c15da26Smrg        fi])
100213c15da26Smrgfi])
10022126a8a12Smrg
100233c15da26Smrg# Test for the ability of xmlto to generate a text target
100243c15da26Smrghave_xmlto_text=no
100253c15da26Smrgcat > conftest.xml << "EOF"
100263c15da26SmrgEOF
100273c15da26SmrgAS_IF([test "$have_xmlto" = yes],
100283c15da26Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
100293c15da26Smrg             [have_xmlto_text=yes],
100303c15da26Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
100313c15da26Smrgrm -f conftest.xml
100323c15da26SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
100333c15da26SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
100343c15da26Smrg]) # XORG_WITH_XMLTO
10035126a8a12Smrg
100363c15da26Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
100373c15da26Smrg# --------------------------------------------
100383c15da26Smrg# Minimum version: 1.12.0
100393c15da26Smrg# Minimum version for optional DEFAULT argument: 1.12.0
100403c15da26Smrg#
100413c15da26Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
100423c15da26Smrg# XML-based language used for the transformation of XML documents.
100433c15da26Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
100443c15da26Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
100453c15da26Smrg# The XSLT processor is often used as a standalone tool for transformations.
100463c15da26Smrg# It should not be assumed that this tool is used only to work with documnetation.
100473c15da26Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
100483c15da26Smrg#
100493c15da26Smrg# Interface to module:
100503c15da26Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
100513c15da26Smrg# XSLTPROC:	 returns the path of the xsltproc program found
100523c15da26Smrg#		 returns the path set by the user in the environment
100533c15da26Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
100543c15da26Smrg#		  'no' user instructs the module not to use xsltproc
100553c15da26Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
100563c15da26Smrg#
100573c15da26Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
100583c15da26Smrg#
100593c15da26SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
100603c15da26SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
100613c15da26Smrg# Preserves the interface, should it be implemented later
100623c15da26Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
100633c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
100643c15da26SmrgAC_ARG_WITH(xsltproc,
100653c15da26Smrg	AS_HELP_STRING([--with-xsltproc],
100663c15da26Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
100673c15da26Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
100683c15da26Smrgm4_undefine([_defopt])
100693c15da26Smrg
100703c15da26Smrgif test "x$use_xsltproc" = x"auto"; then
100713c15da26Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
100723c15da26Smrg   if test "x$XSLTPROC" = "x"; then
100733c15da26Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
100743c15da26Smrg	have_xsltproc=no
100753c15da26Smrg   else
100763c15da26Smrg        have_xsltproc=yes
100773c15da26Smrg   fi
100783c15da26Smrgelif test "x$use_xsltproc" = x"yes" ; then
100793c15da26Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
100803c15da26Smrg   if test "x$XSLTPROC" = "x"; then
100813c15da26Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
100823c15da26Smrg   fi
100833c15da26Smrg   have_xsltproc=yes
100843c15da26Smrgelif test "x$use_xsltproc" = x"no" ; then
100853c15da26Smrg   if test "x$XSLTPROC" != "x"; then
100863c15da26Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
100873c15da26Smrg   fi
100883c15da26Smrg   have_xsltproc=no
100893c15da26Smrgelse
100903c15da26Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
100913c15da26Smrgfi
10092126a8a12Smrg
100933c15da26SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
100943c15da26Smrg]) # XORG_WITH_XSLTPROC
10095126a8a12Smrg
100963c15da26Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
100973c15da26Smrg# ----------------------------------------
100983c15da26Smrg# Minimum version: 1.15.0
100993c15da26Smrg#
101003c15da26Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
101013c15da26Smrg# scanning arbitrary text files, extracting information from those text files,
101023c15da26Smrg# and printing reports based on that information.
101033c15da26Smrg#
101043c15da26Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
101053c15da26Smrg#
101063c15da26Smrg# Interface to module:
101073c15da26Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
101083c15da26Smrg# PERL:	     returns the path of the perl program found
101093c15da26Smrg#	     returns the path set by the user in the environment
101103c15da26Smrg# --with-perl: 'yes' user instructs the module to use perl
101113c15da26Smrg#	       'no' user instructs the module not to use perl
101123c15da26Smrg# have_perl: returns yes if perl found in PATH or no
101133c15da26Smrg#
101143c15da26Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
101153c15da26Smrg#
101163c15da26SmrgAC_DEFUN([XORG_WITH_PERL],[
101173c15da26SmrgAC_ARG_VAR([PERL], [Path to perl command])
101183c15da26Smrg# Preserves the interface, should it be implemented later
101193c15da26Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
101203c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
101213c15da26SmrgAC_ARG_WITH(perl,
101223c15da26Smrg	AS_HELP_STRING([--with-perl],
101233c15da26Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
101243c15da26Smrg	   [use_perl=$withval], [use_perl=]_defopt)
101253c15da26Smrgm4_undefine([_defopt])
101263c15da26Smrg
101273c15da26Smrgif test "x$use_perl" = x"auto"; then
101283c15da26Smrg   AC_PATH_PROG([PERL], [perl])
101293c15da26Smrg   if test "x$PERL" = "x"; then
101303c15da26Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
101313c15da26Smrg	have_perl=no
101323c15da26Smrg   else
101333c15da26Smrg        have_perl=yes
101343c15da26Smrg   fi
101353c15da26Smrgelif test "x$use_perl" = x"yes" ; then
101363c15da26Smrg   AC_PATH_PROG([PERL], [perl])
101373c15da26Smrg   if test "x$PERL" = "x"; then
101383c15da26Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
101393c15da26Smrg   fi
101403c15da26Smrg   have_perl=yes
101413c15da26Smrgelif test "x$use_perl" = x"no" ; then
101423c15da26Smrg   if test "x$PERL" != "x"; then
101433c15da26Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
101443c15da26Smrg   fi
101453c15da26Smrg   have_perl=no
101463c15da26Smrgelse
101473c15da26Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
101483c15da26Smrgfi
10149126a8a12Smrg
101503c15da26SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
101513c15da26Smrg]) # XORG_WITH_PERL
10152126a8a12Smrg
101533c15da26Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
101543c15da26Smrg# ----------------
101553c15da26Smrg# Minimum version: 1.5.0
101563c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
101573c15da26Smrg#
101583c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
101593c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
101603c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
101613c15da26Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
101623c15da26Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
101633c15da26Smrg# --with-asciidoc assumes 'auto'.
101643c15da26Smrg#
101653c15da26Smrg# Interface to module:
101663c15da26Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
101673c15da26Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
101683c15da26Smrg#		 returns the path set by the user in the environment
101693c15da26Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
101703c15da26Smrg#		  'no' user instructs the module not to use asciidoc
101713c15da26Smrg#
101723c15da26Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
101733c15da26Smrg#
101743c15da26SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
101753c15da26SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
101763c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
101773c15da26SmrgAC_ARG_WITH(asciidoc,
101783c15da26Smrg	AS_HELP_STRING([--with-asciidoc],
101793c15da26Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
101803c15da26Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
101813c15da26Smrgm4_undefine([_defopt])
10182126a8a12Smrg
101833c15da26Smrgif test "x$use_asciidoc" = x"auto"; then
101843c15da26Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
101853c15da26Smrg   if test "x$ASCIIDOC" = "x"; then
101863c15da26Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
101873c15da26Smrg	have_asciidoc=no
101883c15da26Smrg   else
101893c15da26Smrg        have_asciidoc=yes
101903c15da26Smrg   fi
101913c15da26Smrgelif test "x$use_asciidoc" = x"yes" ; then
101923c15da26Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
101933c15da26Smrg   if test "x$ASCIIDOC" = "x"; then
101943c15da26Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
101953c15da26Smrg   fi
101963c15da26Smrg   have_asciidoc=yes
101973c15da26Smrgelif test "x$use_asciidoc" = x"no" ; then
101983c15da26Smrg   if test "x$ASCIIDOC" != "x"; then
101993c15da26Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
102003c15da26Smrg   fi
102013c15da26Smrg   have_asciidoc=no
102023c15da26Smrgelse
102033c15da26Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
102043c15da26Smrgfi
102053c15da26Smrgm4_ifval([$1],
102063c15da26Smrg[if test "$have_asciidoc" = yes; then
102073c15da26Smrg    # scrape the asciidoc version
102083c15da26Smrg    AC_MSG_CHECKING([the asciidoc version])
102093c15da26Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
102103c15da26Smrg    AC_MSG_RESULT([$asciidoc_version])
102113c15da26Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
102123c15da26Smrg        [if test "x$use_asciidoc" = xauto; then
102133c15da26Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
102143c15da26Smrg            have_asciidoc=no
102153c15da26Smrg        else
102163c15da26Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
102173c15da26Smrg        fi])
102183c15da26Smrgfi])
102193c15da26SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
102203c15da26Smrg]) # XORG_WITH_ASCIIDOC
10221126a8a12Smrg
102223c15da26Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
102233c15da26Smrg# --------------------------------
102243c15da26Smrg# Minimum version: 1.5.0
102253c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
102263c15da26Smrg#
102273c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
102283c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
102293c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
102303c15da26Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
102313c15da26Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
102323c15da26Smrg# --with-doxygen assumes 'auto'.
102333c15da26Smrg#
102343c15da26Smrg# Interface to module:
102353c15da26Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
102363c15da26Smrg# DOXYGEN:	 returns the path of the doxygen program found
102373c15da26Smrg#		 returns the path set by the user in the environment
102383c15da26Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
102393c15da26Smrg#		  'no' user instructs the module not to use doxygen
102403c15da26Smrg#
102413c15da26Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
102423c15da26Smrg#
102433c15da26SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
102443c15da26SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
102453c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
102463c15da26SmrgAC_ARG_WITH(doxygen,
102473c15da26Smrg	AS_HELP_STRING([--with-doxygen],
102483c15da26Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
102493c15da26Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
102503c15da26Smrgm4_undefine([_defopt])
10251126a8a12Smrg
102523c15da26Smrgif test "x$use_doxygen" = x"auto"; then
102533c15da26Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
102543c15da26Smrg   if test "x$DOXYGEN" = "x"; then
102553c15da26Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
102563c15da26Smrg	have_doxygen=no
102573c15da26Smrg   else
102583c15da26Smrg        have_doxygen=yes
102593c15da26Smrg   fi
102603c15da26Smrgelif test "x$use_doxygen" = x"yes" ; then
102613c15da26Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
102623c15da26Smrg   if test "x$DOXYGEN" = "x"; then
102633c15da26Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
102643c15da26Smrg   fi
102653c15da26Smrg   have_doxygen=yes
102663c15da26Smrgelif test "x$use_doxygen" = x"no" ; then
102673c15da26Smrg   if test "x$DOXYGEN" != "x"; then
102683c15da26Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
102693c15da26Smrg   fi
102703c15da26Smrg   have_doxygen=no
102713c15da26Smrgelse
102723c15da26Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
102733c15da26Smrgfi
102743c15da26Smrgm4_ifval([$1],
102753c15da26Smrg[if test "$have_doxygen" = yes; then
102763c15da26Smrg    # scrape the doxygen version
102773c15da26Smrg    AC_MSG_CHECKING([the doxygen version])
102783c15da26Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
102793c15da26Smrg    AC_MSG_RESULT([$doxygen_version])
102803c15da26Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
102813c15da26Smrg        [if test "x$use_doxygen" = xauto; then
102823c15da26Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
102833c15da26Smrg            have_doxygen=no
102843c15da26Smrg        else
102853c15da26Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
102863c15da26Smrg        fi])
102873c15da26Smrgfi])
102883c15da26SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
102893c15da26Smrg]) # XORG_WITH_DOXYGEN
10290126a8a12Smrg
102913c15da26Smrg# XORG_WITH_GROFF([DEFAULT])
102923c15da26Smrg# ----------------
102933c15da26Smrg# Minimum version: 1.6.0
102943c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
102953c15da26Smrg#
102963c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
102973c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
102983c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
102993c15da26Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
103003c15da26Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
103013c15da26Smrg# --with-groff assumes 'auto'.
103023c15da26Smrg#
103033c15da26Smrg# Interface to module:
103043c15da26Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
103053c15da26Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
103063c15da26Smrg# HAVE_GROFF_MS: the -ms macros package
103073c15da26Smrg# GROFF:	 returns the path of the groff program found
103083c15da26Smrg#		 returns the path set by the user in the environment
103093c15da26Smrg# --with-groff:	 'yes' user instructs the module to use groff
103103c15da26Smrg#		 'no' user instructs the module not to use groff
103113c15da26Smrg#
103123c15da26Smrg# Added in version 1.9.0:
103133c15da26Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
103143c15da26Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
103153c15da26Smrg#		   psselect from the psutils package.
103163c15da26Smrg#		   the ghostcript package. Refer to the grohtml man pages
103173c15da26Smrg#
103183c15da26Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
103193c15da26Smrg#
103203c15da26Smrg# OS and distros often splits groff in a basic and full package, the former
103213c15da26Smrg# having the groff program and the later having devices, fonts and macros
103223c15da26Smrg# Checking for the groff executable is not enough.
103233c15da26Smrg#
103243c15da26Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
103253c15da26Smrg# unset HAVE_GROFF or GROFF env variables.
103263c15da26Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
103273c15da26Smrg#
103283c15da26SmrgAC_DEFUN([XORG_WITH_GROFF],[
103293c15da26SmrgAC_ARG_VAR([GROFF], [Path to groff command])
103303c15da26Smrgm4_define([_defopt], m4_default([$1], [auto]))
103313c15da26SmrgAC_ARG_WITH(groff,
103323c15da26Smrg	AS_HELP_STRING([--with-groff],
103333c15da26Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
103343c15da26Smrg	   [use_groff=$withval], [use_groff=]_defopt)
103353c15da26Smrgm4_undefine([_defopt])
10336126a8a12Smrg
103373c15da26Smrgif test "x$use_groff" = x"auto"; then
103383c15da26Smrg   AC_PATH_PROG([GROFF], [groff])
103393c15da26Smrg   if test "x$GROFF" = "x"; then
103403c15da26Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
103413c15da26Smrg	have_groff=no
103423c15da26Smrg   else
103433c15da26Smrg        have_groff=yes
103443c15da26Smrg   fi
103453c15da26Smrgelif test "x$use_groff" = x"yes" ; then
103463c15da26Smrg   AC_PATH_PROG([GROFF], [groff])
103473c15da26Smrg   if test "x$GROFF" = "x"; then
103483c15da26Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
103493c15da26Smrg   fi
103503c15da26Smrg   have_groff=yes
103513c15da26Smrgelif test "x$use_groff" = x"no" ; then
103523c15da26Smrg   if test "x$GROFF" != "x"; then
103533c15da26Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
103543c15da26Smrg   fi
103553c15da26Smrg   have_groff=no
103563c15da26Smrgelse
103573c15da26Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
103583c15da26Smrgfi
10359555991fdSmrg
103603c15da26Smrg# We have groff, test for the presence of the macro packages
103613c15da26Smrgif test "x$have_groff" = x"yes"; then
103623c15da26Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
103633c15da26Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
103643c15da26Smrg        groff_ms_works=yes
103653c15da26Smrg    else
103663c15da26Smrg        groff_ms_works=no
103673c15da26Smrg    fi
103683c15da26Smrg    AC_MSG_RESULT([$groff_ms_works])
103693c15da26Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
103703c15da26Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
103713c15da26Smrg        groff_mm_works=yes
103723c15da26Smrg    else
103733c15da26Smrg        groff_mm_works=no
103743c15da26Smrg    fi
103753c15da26Smrg    AC_MSG_RESULT([$groff_mm_works])
103763c15da26Smrgfi
10377555991fdSmrg
103783c15da26Smrg# We have groff, test for HTML dependencies, one command per package
103793c15da26Smrgif test "x$have_groff" = x"yes"; then
103803c15da26Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
103813c15da26Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
103823c15da26Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
103833c15da26Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
103843c15da26Smrg      have_groff_html=yes
103853c15da26Smrg   else
103863c15da26Smrg      have_groff_html=no
103873c15da26Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
103883c15da26Smrg   fi
103893c15da26Smrgfi
10390555991fdSmrg
103913c15da26Smrg# Set Automake conditionals for Makefiles
103923c15da26SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
103933c15da26SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
103943c15da26SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
103953c15da26SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
103963c15da26Smrg]) # XORG_WITH_GROFF
10397555991fdSmrg
103983c15da26Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
103993c15da26Smrg# ---------------------------------------
104003c15da26Smrg# Minimum version: 1.6.0
104013c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
104023c15da26Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
104033c15da26Smrg#
104043c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
104053c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
104063c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
104073c15da26Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
104083c15da26Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
104093c15da26Smrg# --with-fop assumes 'auto'.
104103c15da26Smrg#
104113c15da26Smrg# Interface to module:
104123c15da26Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
104133c15da26Smrg# FOP:	 	returns the path of the fop program found
104143c15da26Smrg#		returns the path set by the user in the environment
104153c15da26Smrg# --with-fop: 	'yes' user instructs the module to use fop
104163c15da26Smrg#		'no' user instructs the module not to use fop
104173c15da26Smrg#
104183c15da26Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
104193c15da26Smrg#
104203c15da26SmrgAC_DEFUN([XORG_WITH_FOP],[
104213c15da26SmrgAC_ARG_VAR([FOP], [Path to fop command])
104223c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
104233c15da26SmrgAC_ARG_WITH(fop,
104243c15da26Smrg	AS_HELP_STRING([--with-fop],
104253c15da26Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
104263c15da26Smrg	   [use_fop=$withval], [use_fop=]_defopt)
104273c15da26Smrgm4_undefine([_defopt])
10428126a8a12Smrg
104293c15da26Smrgif test "x$use_fop" = x"auto"; then
104303c15da26Smrg   AC_PATH_PROG([FOP], [fop])
104313c15da26Smrg   if test "x$FOP" = "x"; then
104323c15da26Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
104333c15da26Smrg	have_fop=no
104343c15da26Smrg   else
104353c15da26Smrg        have_fop=yes
104363c15da26Smrg   fi
104373c15da26Smrgelif test "x$use_fop" = x"yes" ; then
104383c15da26Smrg   AC_PATH_PROG([FOP], [fop])
104393c15da26Smrg   if test "x$FOP" = "x"; then
104403c15da26Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
104413c15da26Smrg   fi
104423c15da26Smrg   have_fop=yes
104433c15da26Smrgelif test "x$use_fop" = x"no" ; then
104443c15da26Smrg   if test "x$FOP" != "x"; then
104453c15da26Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
104463c15da26Smrg   fi
104473c15da26Smrg   have_fop=no
104483c15da26Smrgelse
104493c15da26Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
104503c15da26Smrgfi
10451d656433aSmrg
104523c15da26Smrg# Test for a minimum version of fop, if provided.
104533c15da26Smrgm4_ifval([$1],
104543c15da26Smrg[if test "$have_fop" = yes; then
104553c15da26Smrg    # scrape the fop version
104563c15da26Smrg    AC_MSG_CHECKING([for fop minimum version])
104573c15da26Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
104583c15da26Smrg    AC_MSG_RESULT([$fop_version])
104593c15da26Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
104603c15da26Smrg        [if test "x$use_fop" = xauto; then
104613c15da26Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
104623c15da26Smrg            have_fop=no
104633c15da26Smrg        else
104643c15da26Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
104653c15da26Smrg        fi])
104663c15da26Smrgfi])
104673c15da26SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
104683c15da26Smrg]) # XORG_WITH_FOP
10469126a8a12Smrg
104703c15da26Smrg# XORG_WITH_PS2PDF([DEFAULT])
104713c15da26Smrg# ----------------
104723c15da26Smrg# Minimum version: 1.6.0
104733c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
104743c15da26Smrg#
104753c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
104763c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
104773c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
104783c15da26Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
104793c15da26Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
104803c15da26Smrg# --with-ps2pdf assumes 'auto'.
104813c15da26Smrg#
104823c15da26Smrg# Interface to module:
104833c15da26Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
104843c15da26Smrg# PS2PDF:	returns the path of the ps2pdf program found
104853c15da26Smrg#		returns the path set by the user in the environment
104863c15da26Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
104873c15da26Smrg#		 'no' user instructs the module not to use ps2pdf
104883c15da26Smrg#
104893c15da26Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
104903c15da26Smrg#
104913c15da26SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
104923c15da26SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
104933c15da26Smrgm4_define([_defopt], m4_default([$1], [auto]))
104943c15da26SmrgAC_ARG_WITH(ps2pdf,
104953c15da26Smrg	AS_HELP_STRING([--with-ps2pdf],
104963c15da26Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
104973c15da26Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
104983c15da26Smrgm4_undefine([_defopt])
10499126a8a12Smrg
105003c15da26Smrgif test "x$use_ps2pdf" = x"auto"; then
105013c15da26Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
105023c15da26Smrg   if test "x$PS2PDF" = "x"; then
105033c15da26Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
105043c15da26Smrg	have_ps2pdf=no
105053c15da26Smrg   else
105063c15da26Smrg        have_ps2pdf=yes
105073c15da26Smrg   fi
105083c15da26Smrgelif test "x$use_ps2pdf" = x"yes" ; then
105093c15da26Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
105103c15da26Smrg   if test "x$PS2PDF" = "x"; then
105113c15da26Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
105123c15da26Smrg   fi
105133c15da26Smrg   have_ps2pdf=yes
105143c15da26Smrgelif test "x$use_ps2pdf" = x"no" ; then
105153c15da26Smrg   if test "x$PS2PDF" != "x"; then
105163c15da26Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
105173c15da26Smrg   fi
105183c15da26Smrg   have_ps2pdf=no
105193c15da26Smrgelse
105203c15da26Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
105213c15da26Smrgfi
105223c15da26SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
105233c15da26Smrg]) # XORG_WITH_PS2PDF
10524126a8a12Smrg
105253c15da26Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
105263c15da26Smrg# ----------------
105273c15da26Smrg# Minimum version: 1.6.0
105283c15da26Smrg#
105293c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
105303c15da26Smrg# not at the appropriate level. This macro enables a builder to skip all
105313c15da26Smrg# documentation targets except traditional man pages.
105323c15da26Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
105333c15da26Smrg# maximum flexibilty in controlling documentation building.
105343c15da26Smrg# Refer to:
105353c15da26Smrg# XORG_WITH_XMLTO         --with-xmlto
105363c15da26Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
105373c15da26Smrg# XORG_WITH_DOXYGEN       --with-doxygen
105383c15da26Smrg# XORG_WITH_FOP           --with-fop
105393c15da26Smrg# XORG_WITH_GROFF         --with-groff
105403c15da26Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
105413c15da26Smrg#
105423c15da26Smrg# Interface to module:
105433c15da26Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
105443c15da26Smrg# --enable-docs: 'yes' user instructs the module to generate docs
105453c15da26Smrg#		 'no' user instructs the module not to generate docs
105463c15da26Smrg# parm1:	specify the default value, yes or no.
105473c15da26Smrg#
105483c15da26SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
105493c15da26Smrgm4_define([docs_default], m4_default([$1], [yes]))
105503c15da26SmrgAC_ARG_ENABLE(docs,
105513c15da26Smrg	AS_HELP_STRING([--enable-docs],
105523c15da26Smrg	   [Enable building the documentation (default: ]docs_default[)]),
105533c15da26Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
105543c15da26Smrgm4_undefine([docs_default])
105553c15da26SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
105563c15da26SmrgAC_MSG_CHECKING([whether to build documentation])
105573c15da26SmrgAC_MSG_RESULT([$build_docs])
105583c15da26Smrg]) # XORG_ENABLE_DOCS
10559126a8a12Smrg
105603c15da26Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
105613c15da26Smrg# ----------------
105623c15da26Smrg# Minimum version: 1.6.0
105633c15da26Smrg#
105643c15da26Smrg# This macro enables a builder to skip all developer documentation.
105653c15da26Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
105663c15da26Smrg# maximum flexibilty in controlling documentation building.
105673c15da26Smrg# Refer to:
105683c15da26Smrg# XORG_WITH_XMLTO         --with-xmlto
105693c15da26Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
105703c15da26Smrg# XORG_WITH_DOXYGEN       --with-doxygen
105713c15da26Smrg# XORG_WITH_FOP           --with-fop
105723c15da26Smrg# XORG_WITH_GROFF         --with-groff
105733c15da26Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
105743c15da26Smrg#
105753c15da26Smrg# Interface to module:
105763c15da26Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
105773c15da26Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
105783c15da26Smrg#			'no' user instructs the module not to generate developer docs
105793c15da26Smrg# parm1:		specify the default value, yes or no.
105803c15da26Smrg#
105813c15da26SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
105823c15da26Smrgm4_define([devel_default], m4_default([$1], [yes]))
105833c15da26SmrgAC_ARG_ENABLE(devel-docs,
105843c15da26Smrg	AS_HELP_STRING([--enable-devel-docs],
105853c15da26Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
105863c15da26Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
105873c15da26Smrgm4_undefine([devel_default])
105883c15da26SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
105893c15da26SmrgAC_MSG_CHECKING([whether to build developer documentation])
105903c15da26SmrgAC_MSG_RESULT([$build_devel_docs])
105913c15da26Smrg]) # XORG_ENABLE_DEVEL_DOCS
10592126a8a12Smrg
105933c15da26Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
105943c15da26Smrg# ----------------
105953c15da26Smrg# Minimum version: 1.6.0
105963c15da26Smrg#
105973c15da26Smrg# This macro enables a builder to skip all functional specification targets.
105983c15da26Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
105993c15da26Smrg# maximum flexibilty in controlling documentation building.
106003c15da26Smrg# Refer to:
106013c15da26Smrg# XORG_WITH_XMLTO         --with-xmlto
106023c15da26Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
106033c15da26Smrg# XORG_WITH_DOXYGEN       --with-doxygen
106043c15da26Smrg# XORG_WITH_FOP           --with-fop
106053c15da26Smrg# XORG_WITH_GROFF         --with-groff
106063c15da26Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
106073c15da26Smrg#
106083c15da26Smrg# Interface to module:
106093c15da26Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
106103c15da26Smrg# --enable-specs:	'yes' user instructs the module to generate specs
106113c15da26Smrg#			'no' user instructs the module not to generate specs
106123c15da26Smrg# parm1:		specify the default value, yes or no.
106133c15da26Smrg#
106143c15da26SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
106153c15da26Smrgm4_define([spec_default], m4_default([$1], [yes]))
106163c15da26SmrgAC_ARG_ENABLE(specs,
106173c15da26Smrg	AS_HELP_STRING([--enable-specs],
106183c15da26Smrg	   [Enable building the specs (default: ]spec_default[)]),
106193c15da26Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
106203c15da26Smrgm4_undefine([spec_default])
106213c15da26SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
106223c15da26SmrgAC_MSG_CHECKING([whether to build functional specifications])
106233c15da26SmrgAC_MSG_RESULT([$build_specs])
106243c15da26Smrg]) # XORG_ENABLE_SPECS
10625126a8a12Smrg
106263c15da26Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
106273c15da26Smrg# ----------------------------------------------
106283c15da26Smrg# Minimum version: 1.13.0
106293c15da26Smrg#
106303c15da26Smrg# This macro enables a builder to enable/disable unit testing
106313c15da26Smrg# It makes no assumption about the test cases implementation
106323c15da26Smrg# Test cases may or may not use Automake "Support for test suites"
106333c15da26Smrg# They may or may not use the software utility library GLib
106343c15da26Smrg#
106353c15da26Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
106363c15da26Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
106373c15da26Smrg# The variable enable_unit_tests is used by other macros in this file.
106383c15da26Smrg#
106393c15da26Smrg# Interface to module:
106403c15da26Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
106413c15da26Smrg# enable_unit_tests:    used in configure.ac for additional configuration
106423c15da26Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
106433c15da26Smrg#			'no' user instructs the module not to build tests
106443c15da26Smrg# parm1:		specify the default value, yes or no.
106453c15da26Smrg#
106463c15da26SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
106473c15da26SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
106483c15da26SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
106493c15da26SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
106503c15da26Smrgm4_define([_defopt], m4_default([$1], [auto]))
106513c15da26SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
106523c15da26Smrg	[Enable building unit test cases (default: ]_defopt[)]),
106533c15da26Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
106543c15da26Smrgm4_undefine([_defopt])
106553c15da26SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
106563c15da26SmrgAC_MSG_CHECKING([whether to build unit test cases])
106573c15da26SmrgAC_MSG_RESULT([$enable_unit_tests])
106583c15da26Smrg]) # XORG_ENABLE_UNIT_TESTS
106593c15da26Smrg
106603c15da26Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
106613c15da26Smrg# ----------------------------------------
106623c15da26Smrg# Minimum version: 1.13.0
106633c15da26Smrg#
106643c15da26Smrg# GLib is a library which provides advanced data structures and functions.
106653c15da26Smrg# This macro enables a module to test for the presence of Glib.
106663c15da26Smrg#
106673c15da26Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
106683c15da26Smrg# Otherwise the value of $enable_unit_tests is blank.
106693c15da26Smrg#
106703c15da26Smrg# Interface to module:
106713c15da26Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
106723c15da26Smrg# with_glib: used in configure.ac to know if GLib has been found
106733c15da26Smrg# --with-glib:	'yes' user instructs the module to use glib
106743c15da26Smrg#		'no' user instructs the module not to use glib
106753c15da26Smrg#
106763c15da26SmrgAC_DEFUN([XORG_WITH_GLIB],[
106773c15da26SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
106783c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
106793c15da26SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
106803c15da26Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
106813c15da26Smrg	[with_glib=$withval], [with_glib=]_defopt)
106823c15da26Smrgm4_undefine([_defopt])
106833c15da26Smrg
106843c15da26Smrghave_glib=no
106853c15da26Smrg# Do not probe GLib if user explicitly disabled unit testing
106863c15da26Smrgif test "x$enable_unit_tests" != x"no"; then
106873c15da26Smrg  # Do not probe GLib if user explicitly disabled it
106883c15da26Smrg  if test "x$with_glib" != x"no"; then
106893c15da26Smrg    m4_ifval(
106903c15da26Smrg      [$1],
106913c15da26Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
106923c15da26Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
106933c15da26Smrg    )
106943c15da26Smrg  fi
106953c15da26Smrgfi
10696126a8a12Smrg
106973c15da26Smrg# Not having GLib when unit testing has been explicitly requested is an error
106983c15da26Smrgif test "x$enable_unit_tests" = x"yes"; then
106993c15da26Smrg  if test "x$have_glib" = x"no"; then
107003c15da26Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
107013c15da26Smrg  fi
107023c15da26Smrgfi
10703126a8a12Smrg
107043c15da26Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
107053c15da26Smrgif test "x$enable_unit_tests" = x"no"; then
107063c15da26Smrg  if test "x$with_glib" = x"yes"; then
107073c15da26Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
107083c15da26Smrg  fi
107093c15da26Smrgfi
10710126a8a12Smrg
107113c15da26Smrg# Not having GLib when it has been explicitly requested is an error
107123c15da26Smrgif test "x$with_glib" = x"yes"; then
107133c15da26Smrg  if test "x$have_glib" = x"no"; then
107143c15da26Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
107153c15da26Smrg  fi
107163c15da26Smrgfi
10717126a8a12Smrg
107183c15da26SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
107193c15da26Smrg]) # XORG_WITH_GLIB
10720126a8a12Smrg
107213c15da26Smrg# XORG_LD_WRAP([required|optional])
107223c15da26Smrg# ---------------------------------
107233c15da26Smrg# Minimum version: 1.13.0
107243c15da26Smrg#
107253c15da26Smrg# Check if linker supports -wrap, passed via compiler flags
107263c15da26Smrg#
107273c15da26Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
107283c15da26Smrg# Otherwise the value of $enable_unit_tests is blank.
107293c15da26Smrg#
107303c15da26Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
107313c15da26Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
107323c15da26Smrg# available, an argument of "optional" allows use when some unit tests require
107333c15da26Smrg# ld -wrap and others do not.
107343c15da26Smrg#
107353c15da26SmrgAC_DEFUN([XORG_LD_WRAP],[
107363c15da26SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
107373c15da26Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
107383c15da26Smrg                      void __wrap_exit(int status) { return; }],
107393c15da26Smrg                     [exit(0);])])
107403c15da26Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
107413c15da26Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
107423c15da26Smrg  if test "x$have_ld_wrap" = x"no"; then
107433c15da26Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
107443c15da26Smrg  fi
107453c15da26Smrgfi
107463c15da26SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
107473c15da26Smrg#
107483c15da26Smrg]) # XORG_LD_WRAP
10749126a8a12Smrg
107503c15da26Smrg# XORG_CHECK_LINKER_FLAGS
107513c15da26Smrg# -----------------------
107523c15da26Smrg# SYNOPSIS
107533c15da26Smrg#
107543c15da26Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
107553c15da26Smrg#
107563c15da26Smrg# DESCRIPTION
107573c15da26Smrg#
107583c15da26Smrg#   Check whether the given linker FLAGS work with the current language's
107593c15da26Smrg#   linker, or whether they give an error.
107603c15da26Smrg#
107613c15da26Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
107623c15da26Smrg#   success/failure.
107633c15da26Smrg#
107643c15da26Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
107653c15da26Smrg#
107663c15da26Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
107673c15da26Smrg#
107683c15da26Smrg# LICENSE
107693c15da26Smrg#
107703c15da26Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
107713c15da26Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
107723c15da26Smrg#   Copyright (c) 2009 Matteo Frigo
107733c15da26Smrg#
107743c15da26Smrg#   This program is free software: you can redistribute it and/or modify it
107753c15da26Smrg#   under the terms of the GNU General Public License as published by the
107763c15da26Smrg#   Free Software Foundation, either version 3 of the License, or (at your
107773c15da26Smrg#   option) any later version.
107783c15da26Smrg#
107793c15da26Smrg#   This program is distributed in the hope that it will be useful, but
107803c15da26Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
107813c15da26Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
107823c15da26Smrg#   Public License for more details.
107833c15da26Smrg#
107843c15da26Smrg#   You should have received a copy of the GNU General Public License along
107853c15da26Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
107863c15da26Smrg#
107873c15da26Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
107883c15da26Smrg#   gives unlimited permission to copy, distribute and modify the configure
107893c15da26Smrg#   scripts that are the output of Autoconf when processing the Macro. You
107903c15da26Smrg#   need not follow the terms of the GNU General Public License when using
107913c15da26Smrg#   or distributing such scripts, even though portions of the text of the
107923c15da26Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
107933c15da26Smrg#   all other use of the material that constitutes the Autoconf Macro.
107943c15da26Smrg#
107953c15da26Smrg#   This special exception to the GPL applies to versions of the Autoconf
107963c15da26Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
107973c15da26Smrg#   modified version of the Autoconf Macro, you may extend this special
107983c15da26Smrg#   exception to the GPL to apply to your modified version as well.#
107993c15da26SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
108003c15da26Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
108013c15da26Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
108023c15da26SmrgAS_LITERAL_IF([$1],
108033c15da26Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
108043c15da26Smrg      ax_save_FLAGS=$LDFLAGS
108053c15da26Smrg      LDFLAGS="$1"
108063c15da26Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
108073c15da26Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
108083c15da26Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
108093c15da26Smrg      LDFLAGS=$ax_save_FLAGS])],
108103c15da26Smrg  [ax_save_FLAGS=$LDFLAGS
108113c15da26Smrg   LDFLAGS="$1"
108123c15da26Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
108133c15da26Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
108143c15da26Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
108153c15da26Smrg   LDFLAGS=$ax_save_FLAGS])
108163c15da26Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
108173c15da26SmrgAC_MSG_RESULT($xorg_check_linker_flags)
108183c15da26Smrgif test "x$xorg_check_linker_flags" = xyes; then
108193c15da26Smrg	m4_default([$2], :)
108203c15da26Smrgelse
108213c15da26Smrg	m4_default([$3], :)
108223c15da26Smrgfi
108233c15da26Smrg]) # XORG_CHECK_LINKER_FLAGS
10824126a8a12Smrg
108253c15da26Smrg# XORG_MEMORY_CHECK_FLAGS
108263c15da26Smrg# -----------------------
108273c15da26Smrg# Minimum version: 1.16.0
108283c15da26Smrg#
108293c15da26Smrg# This macro attempts to find appropriate memory checking functionality
108303c15da26Smrg# for various platforms which unit testing code may use to catch various
108313c15da26Smrg# forms of memory allocation and access errors in testing.
108323c15da26Smrg#
108333c15da26Smrg# Interface to module:
108343c15da26Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
108353c15da26Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
108363c15da26Smrg#
108373c15da26Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
108383c15da26Smrg#
108393c15da26SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10840126a8a12Smrg
108413c15da26SmrgAC_REQUIRE([AC_CANONICAL_HOST])
108423c15da26SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
108433c15da26Smrg           [Environment variables to enable memory checking in tests])
10844126a8a12Smrg
108453c15da26Smrg# Check for different types of support on different platforms
108463c15da26Smrgcase $host_os in
108473c15da26Smrg    solaris*)
108483c15da26Smrg        AC_CHECK_LIB([umem], [umem_alloc],
108493c15da26Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
108503c15da26Smrg        ;;
108513c15da26Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
108523c15da26Smrg        # both directly and inverted, so should not be 0 or 255.
108533c15da26Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
108543c15da26Smrg        ;;
108553c15da26Smrg    darwin*)
108563c15da26Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
108573c15da26Smrg        ;;
108583c15da26Smrg    *bsd*)
108593c15da26Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
108603c15da26Smrg        ;;
108613c15da26Smrgesac
10862126a8a12Smrg
108633c15da26Smrg# User supplied flags override default flags
108643c15da26Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
108653c15da26Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
108663c15da26Smrgfi
10867126a8a12Smrg
108683c15da26SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
108693c15da26Smrg]) # XORG_WITH_LINT
10870126a8a12Smrg
108713c15da26Smrg# XORG_CHECK_MALLOC_ZERO
108723c15da26Smrg# ----------------------
108733c15da26Smrg# Minimum version: 1.0.0
108743c15da26Smrg#
108753c15da26Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
108763c15da26Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
108773c15da26Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
108783c15da26SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
108793c15da26SmrgAC_ARG_ENABLE(malloc0returnsnull,
108803c15da26Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
108813c15da26Smrg		       [malloc(0) returns NULL (default: auto)]),
108823c15da26Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
108833c15da26Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10884126a8a12Smrg
108853c15da26SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
108863c15da26Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
108873c15da26Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
108883c15da26Smrg#include <stdlib.h>
108893c15da26Smrg],[
108903c15da26Smrg    char *m0, *r0, *c0, *p;
108913c15da26Smrg    m0 = malloc(0);
108923c15da26Smrg    p = malloc(10);
108933c15da26Smrg    r0 = realloc(p,0);
108943c15da26Smrg    c0 = calloc(0,10);
108953c15da26Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
108963c15da26Smrg])],
108973c15da26Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
108983c15da26Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
108993c15da26Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
109003c15da26Smrgfi
109013c15da26SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10902126a8a12Smrg
109033c15da26Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
109043c15da26Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
109053c15da26Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
109063c15da26Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
109073c15da26Smrgelse
109083c15da26Smrg	MALLOC_ZERO_CFLAGS=""
109093c15da26Smrg	XMALLOC_ZERO_CFLAGS=""
109103c15da26Smrg	XTMALLOC_ZERO_CFLAGS=""
109113c15da26Smrgfi
10912126a8a12Smrg
109133c15da26SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
109143c15da26SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
109153c15da26SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
109163c15da26Smrg]) # XORG_CHECK_MALLOC_ZERO
10917126a8a12Smrg
109183c15da26Smrg# XORG_WITH_LINT()
109193c15da26Smrg# ----------------
109203c15da26Smrg# Minimum version: 1.1.0
109213c15da26Smrg#
109223c15da26Smrg# This macro enables the use of a tool that flags some suspicious and
109233c15da26Smrg# non-portable constructs (likely to be bugs) in C language source code.
109243c15da26Smrg# It will attempt to locate the tool and use appropriate options.
109253c15da26Smrg# There are various lint type tools on different platforms.
109263c15da26Smrg#
109273c15da26Smrg# Interface to module:
109283c15da26Smrg# LINT:		returns the path to the tool found on the platform
109293c15da26Smrg#		or the value set to LINT on the configure cmd line
109303c15da26Smrg#		also an Automake conditional
109313c15da26Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
109323c15da26Smrg#
109333c15da26Smrg# --with-lint:	'yes' user instructs the module to use lint
109343c15da26Smrg#		'no' user instructs the module not to use lint (default)
109353c15da26Smrg#
109363c15da26Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
109373c15da26Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
109383c15da26Smrg#
109393c15da26SmrgAC_DEFUN([XORG_WITH_LINT],[
10940555991fdSmrg
109413c15da26SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
109423c15da26SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
109433c15da26SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
109443c15da26Smrg		[Use a lint-style source code checker (default: disabled)])],
109453c15da26Smrg		[use_lint=$withval], [use_lint=no])
10946126a8a12Smrg
109473c15da26Smrg# Obtain platform specific info like program name and options
109483c15da26Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
109493c15da26Smrgcase $host_os in
109503c15da26Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
109513c15da26Smrg	lint_name=splint
109523c15da26Smrg	lint_options="-badflag"
109533c15da26Smrg	;;
109543c15da26Smrg  *freebsd* | *netbsd*)
109553c15da26Smrg	lint_name=lint
109563c15da26Smrg	lint_options="-u -b"
109573c15da26Smrg	;;
109583c15da26Smrg  *solaris*)
109593c15da26Smrg	lint_name=lint
109603c15da26Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
109613c15da26Smrg	;;
109623c15da26Smrgesac
109633c15da26Smrg
109643c15da26Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
109653c15da26Smrgif test "x$use_lint" = x"yes" ; then
109663c15da26Smrg   AC_PATH_PROG([LINT], [$lint_name])
109673c15da26Smrg   if test "x$LINT" = "x"; then
109683c15da26Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
109693c15da26Smrg   fi
109703c15da26Smrgelif test "x$use_lint" = x"no" ; then
109713c15da26Smrg   if test "x$LINT" != "x"; then
109723c15da26Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
109733c15da26Smrg   fi
109743c15da26Smrgelse
109753c15da26Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
109763c15da26Smrgfi
10977126a8a12Smrg
109783c15da26Smrg# User supplied flags override default flags
109793c15da26Smrgif test "x$LINT_FLAGS" != "x"; then
109803c15da26Smrg   lint_options=$LINT_FLAGS
109813c15da26Smrgfi
10982126a8a12Smrg
109833c15da26SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
109843c15da26SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10985126a8a12Smrg
109863c15da26Smrg]) # XORG_WITH_LINT
10987555991fdSmrg
109883c15da26Smrg# XORG_LINT_LIBRARY(LIBNAME)
109893c15da26Smrg# --------------------------
109903c15da26Smrg# Minimum version: 1.1.0
10991126a8a12Smrg#
109923c15da26Smrg# Sets up flags for building lint libraries for checking programs that call
109933c15da26Smrg# functions in the library.
10994555991fdSmrg#
109953c15da26Smrg# Interface to module:
109963c15da26Smrg# LINTLIB		- Automake variable with the name of lint library file to make
109973c15da26Smrg# MAKE_LINT_LIB		- Automake conditional
109983c15da26Smrg#
109993c15da26Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
110003c15da26Smrg#			  - 'no' user instructs the module not to create a lint library (default)
11001126a8a12Smrg
110023c15da26SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
110033c15da26SmrgAC_REQUIRE([XORG_WITH_LINT])
110043c15da26SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
110053c15da26Smrg	[Create lint library (default: disabled)])],
110063c15da26Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11007126a8a12Smrg
110083c15da26Smrgif test "x$make_lint_lib" = x"yes" ; then
110093c15da26Smrg   LINTLIB=llib-l$1.ln
110103c15da26Smrg   if test "x$LINT" = "x"; then
110113c15da26Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
110123c15da26Smrg   fi
110133c15da26Smrgelif test "x$make_lint_lib" != x"no" ; then
110143c15da26Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
110153c15da26Smrgfi
11016126a8a12Smrg
110173c15da26SmrgAC_SUBST(LINTLIB)
110183c15da26SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11019126a8a12Smrg
110203c15da26Smrg]) # XORG_LINT_LIBRARY
11021126a8a12Smrg
110223c15da26Smrg# XORG_COMPILER_BRAND
110233c15da26Smrg# -------------------
110243c15da26Smrg# Minimum version: 1.14.0
110253c15da26Smrg#
110263c15da26Smrg# Checks for various brands of compilers and sets flags as appropriate:
110273c15da26Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
110283c15da26Smrg#   clang compiler - sets CLANGCC to "yes"
110293c15da26Smrg#   Intel compiler - sets INTELCC to "yes"
110303c15da26Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
110313c15da26Smrg#
110323c15da26SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
110333c15da26SmrgAC_REQUIRE([AC_PROG_CC_C99])
110343c15da26SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
110353c15da26SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
110363c15da26SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
110373c15da26Smrg]) # XORG_COMPILER_BRAND
11038555991fdSmrg
110393c15da26Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
110403c15da26Smrg# ---------------
110413c15da26Smrg# Minimum version: 1.16.0
11042126a8a12Smrg#
110433c15da26Smrg# Test if the compiler works when passed the given flag as a command line argument.
110443c15da26Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
110453c15da26Smrg# next flag in the list until there are no more options.
110463c15da26Smrg#
110473c15da26Smrg# Note that this does not guarantee that the compiler supports the flag as some
110483c15da26Smrg# compilers will simply ignore arguments that they do not understand, but we do
110493c15da26Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
110503c15da26Smrg# -Werror=unused-command-line-argument
110513c15da26Smrg#
110523c15da26SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
110533c15da26SmrgAC_REQUIRE([AC_PROG_CC_C99])
110543c15da26Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
110553c15da26Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
110563c15da26Smrg
110573c15da26Smrgxorg_testset_save_CFLAGS="$CFLAGS"
110583c15da26Smrg
110593c15da26Smrgif test "x$xorg_testset_unknown_warning_option" = "x" ; then
110603c15da26Smrg	CFLAGS="$CFLAGS -Werror=unknown-warning-option"
110613c15da26Smrg	AC_CACHE_CHECK([if $CC supports -Werror=unknown-warning-option],
110623c15da26Smrg			xorg_cv_cc_flag_unknown_warning_option,
110633c15da26Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
110643c15da26Smrg					  [xorg_cv_cc_flag_unknown_warning_option=yes],
110653c15da26Smrg					  [xorg_cv_cc_flag_unknown_warning_option=no]))
110663c15da26Smrg	xorg_testset_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option
110673c15da26Smrg	CFLAGS="$xorg_testset_save_CFLAGS"
110683c15da26Smrgfi
11069126a8a12Smrg
110703c15da26Smrgif test "x$xorg_testset_unused_command_line_argument" = "x" ; then
110713c15da26Smrg	if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
110723c15da26Smrg		CFLAGS="$CFLAGS -Werror=unknown-warning-option"
110733c15da26Smrg	fi
110743c15da26Smrg	CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
110753c15da26Smrg	AC_CACHE_CHECK([if $CC supports -Werror=unused-command-line-argument],
110763c15da26Smrg			xorg_cv_cc_flag_unused_command_line_argument,
110773c15da26Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
110783c15da26Smrg					  [xorg_cv_cc_flag_unused_command_line_argument=yes],
110793c15da26Smrg					  [xorg_cv_cc_flag_unused_command_line_argument=no]))
110803c15da26Smrg	xorg_testset_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument
110813c15da26Smrg	CFLAGS="$xorg_testset_save_CFLAGS"
110823c15da26Smrgfi
11083126a8a12Smrg
110843c15da26Smrgfound="no"
110853c15da26Smrgm4_foreach([flag], m4_cdr($@), [
110863c15da26Smrg	if test $found = "no" ; then
110873c15da26Smrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
110883c15da26Smrg			CFLAGS="$CFLAGS -Werror=unknown-warning-option"
110893c15da26Smrg		fi
110903c15da26Smrg
110913c15da26Smrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
110923c15da26Smrg			CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
110933c15da26Smrg		fi
110943c15da26Smrg
110953c15da26Smrg		CFLAGS="$CFLAGS ]flag["
110963c15da26Smrg
110973c15da26Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
110983c15da26Smrg		AC_MSG_CHECKING([if $CC supports ]flag[])
110993c15da26Smrg		cacheid=`AS_ECHO([xorg_cv_cc_flag_]flag[])`
111003c15da26Smrg		AC_CACHE_VAL(AS_TR_SH($cacheid),
111013c15da26Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
111023c15da26Smrg					     [eval AS_TR_SH($cacheid)=yes],
111033c15da26Smrg					     [eval AS_TR_SH($cacheid)=no])])
111043c15da26Smrg
111053c15da26Smrg		CFLAGS="$xorg_testset_save_CFLAGS"
111063c15da26Smrg
111073c15da26Smrg		eval supported=$AS_TR_SH($cacheid)
111083c15da26Smrg		AC_MSG_RESULT([$supported])
111093c15da26Smrg		if test "$supported" = "yes" ; then
111103c15da26Smrg			$1="$$1 ]flag["
111113c15da26Smrg			found="yes"
111123c15da26Smrg		fi
111133c15da26Smrg	fi
111143c15da26Smrg])
111153c15da26Smrg]) # XORG_TESTSET_CFLAG
11116d656433aSmrg
111173c15da26Smrg# XORG_COMPILER_FLAGS
111183c15da26Smrg# ---------------
111193c15da26Smrg# Minimum version: 1.16.0
111203c15da26Smrg#
111213c15da26Smrg# Defines BASE_CFLAGS to contain a set of command line arguments supported
111223c15da26Smrg# by the selected compiler which do NOT alter the generated code.  These
111233c15da26Smrg# arguments will cause the compiler to print various warnings during
111243c15da26Smrg# compilation AND turn a conservative set of warnings into errors.
111253c15da26Smrg#
111263c15da26Smrg# The set of flags supported by BASE_CFLAGS will grow in future
111273c15da26Smrg# versions of util-macros as options are added to new compilers.
111283c15da26Smrg#
111293c15da26SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
111303c15da26SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11131555991fdSmrg
111323c15da26SmrgAC_ARG_ENABLE(selective-werror,
111333c15da26Smrg              AS_HELP_STRING([--disable-selective-werror],
111343c15da26Smrg                             [Turn off selective compiler errors. (default: enabled)]),
111353c15da26Smrg              [SELECTIVE_WERROR=$enableval],
111363c15da26Smrg              [SELECTIVE_WERROR=yes])
11137555991fdSmrg
111383c15da26Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
111393c15da26Smrgif test "x$SUNCC" = "xyes"; then
111403c15da26Smrg    BASE_CFLAGS="-v"
111413c15da26Smrgelse
111423c15da26Smrg    BASE_CFLAGS=""
111433c15da26Smrgfi
11144555991fdSmrg
111453c15da26Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
111463c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wall])
111473c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wpointer-arith])
111483c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wstrict-prototypes])
111493c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-prototypes])
111503c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-declarations])
111513c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wnested-externs])
111523c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wbad-function-cast])
111533c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wformat=2], [-Wformat])
111543c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wold-style-definition])
111553c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wdeclaration-after-statement])
111563c15da26Smrg
111573c15da26Smrg# This chunk adds additional warnings that could catch undesired effects.
111583c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wunused])
111593c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wuninitialized])
111603c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wshadow])
111613c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wcast-qual])
111623c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-noreturn])
111633c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-format-attribute])
111643c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wredundant-decls])
111653c15da26Smrg
111663c15da26Smrg# These are currently disabled because they are noisy.  They will be enabled
111673c15da26Smrg# in the future once the codebase is sufficiently modernized to silence
111683c15da26Smrg# them.  For now, I don't want them to drown out the other warnings.
111693c15da26Smrg# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wlogical-op])
111703c15da26Smrg# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wparentheses])
111713c15da26Smrg# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wcast-align])
111723c15da26Smrg
111733c15da26Smrg# Turn some warnings into errors, so we don't accidently get successful builds
111743c15da26Smrg# when there are problems that should be fixed.
111753c15da26Smrg
111763c15da26Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
111773c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
111783c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=nonnull])
111793c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=init-self])
111803c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=main])
111813c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=missing-braces])
111823c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=sequence-point])
111833c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
111843c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=trigraphs])
111853c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=array-bounds])
111863c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=write-strings])
111873c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=address])
111883c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
111893c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
111903c15da26Smrgelse
111913c15da26SmrgAC_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])
111923c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wimplicit])
111933c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wnonnull])
111943c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Winit-self])
111953c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmain])
111963c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-braces])
111973c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wsequence-point])
111983c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wreturn-type])
111993c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wtrigraphs])
112003c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Warray-bounds])
112013c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wwrite-strings])
112023c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Waddress])
112033c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wint-to-pointer-cast])
112043c15da26SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wpointer-to-int-cast])
112053c15da26Smrgfi
11206555991fdSmrg
112073c15da26SmrgAC_SUBST([BASE_CFLAGS])
112083c15da26Smrg]) # XORG_COMPILER_FLAGS
11209555991fdSmrg
112103c15da26Smrg# XORG_CWARNFLAGS
112113c15da26Smrg# ---------------
112123c15da26Smrg# Minimum version: 1.2.0
112133c15da26Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
112143c15da26Smrg#
112153c15da26Smrg# Defines CWARNFLAGS to enable C compiler warnings.
112163c15da26Smrg#
112173c15da26Smrg# This function is deprecated because it defines -fno-strict-aliasing
112183c15da26Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
112193c15da26Smrg# is needed, then it should be added explicitly in the module when
112203c15da26Smrg# it is updated to use BASE_CFLAGS.
112213c15da26Smrg#
112223c15da26SmrgAC_DEFUN([XORG_CWARNFLAGS], [
112233c15da26SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
112243c15da26SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
112253c15da26SmrgCWARNFLAGS="$BASE_CFLAGS"
112263c15da26Smrgif  test "x$GCC" = xyes ; then
112273c15da26Smrg    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
112283c15da26Smrgfi
112293c15da26SmrgAC_SUBST(CWARNFLAGS)
112303c15da26Smrg]) # XORG_CWARNFLAGS
11231555991fdSmrg
112323c15da26Smrg# XORG_STRICT_OPTION
112333c15da26Smrg# -----------------------
112343c15da26Smrg# Minimum version: 1.3.0
112353c15da26Smrg#
112363c15da26Smrg# Add configure option to enable strict compilation flags, such as treating
112373c15da26Smrg# warnings as fatal errors.
112383c15da26Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
112393c15da26Smrg# $BASE_CFLAGS and the deprecated $CWARNFLAGS.
112403c15da26Smrg#
112413c15da26Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
112423c15da26Smrg# when strict compilation is unconditionally desired.
112433c15da26SmrgAC_DEFUN([XORG_STRICT_OPTION], [
112443c15da26SmrgAC_REQUIRE([XORG_CWARNFLAGS])
112453c15da26SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11246555991fdSmrg
112473c15da26SmrgAC_ARG_ENABLE(strict-compilation,
112483c15da26Smrg			  AS_HELP_STRING([--enable-strict-compilation],
112493c15da26Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
112503c15da26Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11251555991fdSmrg
112523c15da26SmrgSTRICT_CFLAGS=""
112533c15da26SmrgXORG_TESTSET_CFLAG([STRICT_CFLAGS], [-pedantic])
112543c15da26SmrgXORG_TESTSET_CFLAG([STRICT_CFLAGS], [-Werror], [-errwarn])
11255126a8a12Smrg
112563c15da26Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
112573c15da26Smrg# activate it with -Werror, so we add it here explicitly.
112583c15da26SmrgXORG_TESTSET_CFLAG([STRICT_CFLAGS], [-Werror=attributes])
11259126a8a12Smrg
112603c15da26Smrgif test "x$STRICT_COMPILE" = "xyes"; then
112613c15da26Smrg    BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS"
112623c15da26Smrg    CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
112633c15da26Smrgfi
112643c15da26SmrgAC_SUBST([STRICT_CFLAGS])
112653c15da26SmrgAC_SUBST([BASE_CFLAGS])
112663c15da26SmrgAC_SUBST([CWARNFLAGS])
112673c15da26Smrg]) # XORG_STRICT_OPTION
112683c15da26Smrg
112693c15da26Smrg# XORG_DEFAULT_OPTIONS
112703c15da26Smrg# --------------------
112713c15da26Smrg# Minimum version: 1.3.0
112723c15da26Smrg#
112733c15da26Smrg# Defines default options for X.Org modules.
112743c15da26Smrg#
112753c15da26SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
112763c15da26SmrgAC_REQUIRE([AC_PROG_INSTALL])
112773c15da26SmrgXORG_COMPILER_FLAGS
112783c15da26SmrgXORG_CWARNFLAGS
112793c15da26SmrgXORG_STRICT_OPTION
112803c15da26SmrgXORG_RELEASE_VERSION
112813c15da26SmrgXORG_CHANGELOG
112823c15da26SmrgXORG_INSTALL
112833c15da26SmrgXORG_MANPAGE_SECTIONS
112843c15da26Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
112853c15da26Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
112863c15da26Smrg]) # XORG_DEFAULT_OPTIONS
11287126a8a12Smrg
112883c15da26Smrg# XORG_INSTALL()
112893c15da26Smrg# ----------------
112903c15da26Smrg# Minimum version: 1.4.0
112913c15da26Smrg#
112923c15da26Smrg# Defines the variable INSTALL_CMD as the command to copy
112933c15da26Smrg# INSTALL from $prefix/share/util-macros.
112943c15da26Smrg#
112953c15da26SmrgAC_DEFUN([XORG_INSTALL], [
112963c15da26SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
112973c15da26Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
112983c15da26SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
112993c15da26Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
113003c15da26Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
113013c15da26Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
113023c15da26SmrgAC_SUBST([INSTALL_CMD])
113033c15da26Smrg]) # XORG_INSTALL
113043c15da26Smrgdnl Copyright 2005 Red Hat, Inc
113053c15da26Smrgdnl
113063c15da26Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
113073c15da26Smrgdnl documentation for any purpose is hereby granted without fee, provided that
113083c15da26Smrgdnl the above copyright notice appear in all copies and that both that
113093c15da26Smrgdnl copyright notice and this permission notice appear in supporting
113103c15da26Smrgdnl documentation.
113113c15da26Smrgdnl
113123c15da26Smrgdnl The above copyright notice and this permission notice shall be included
113133c15da26Smrgdnl in all copies or substantial portions of the Software.
113143c15da26Smrgdnl
113153c15da26Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
113163c15da26Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
113173c15da26Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
113183c15da26Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
113193c15da26Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
113203c15da26Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
113213c15da26Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
113223c15da26Smrgdnl
113233c15da26Smrgdnl Except as contained in this notice, the name of the copyright holders shall
113243c15da26Smrgdnl not be used in advertising or otherwise to promote the sale, use or
113253c15da26Smrgdnl other dealings in this Software without prior written authorization
113263c15da26Smrgdnl from the copyright holders.
113273c15da26Smrgdnl
11328126a8a12Smrg
113293c15da26Smrg# XORG_RELEASE_VERSION
113303c15da26Smrg# --------------------
113313c15da26Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
113323c15da26Smrg 
113333c15da26SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
113343c15da26Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
113353c15da26Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
113363c15da26Smrg		[Major version of this package])
113373c15da26Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
113383c15da26Smrg	if test "x$PVM" = "x"; then
113393c15da26Smrg		PVM="0"
113403c15da26Smrg	fi
113413c15da26Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
113423c15da26Smrg		[$PVM],
113433c15da26Smrg		[Minor version of this package])
113443c15da26Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
113453c15da26Smrg	if test "x$PVP" = "x"; then
113463c15da26Smrg		PVP="0"
113473c15da26Smrg	fi
113483c15da26Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
113493c15da26Smrg		[$PVP],
113503c15da26Smrg		[Patch version of this package])
11351555991fdSmrg])
11352126a8a12Smrg
113533c15da26Smrg# XORG_CHANGELOG()
113543c15da26Smrg# ----------------
113553c15da26Smrg# Minimum version: 1.2.0
11356126a8a12Smrg#
113573c15da26Smrg# Defines the variable CHANGELOG_CMD as the command to generate
113583c15da26Smrg# ChangeLog from git.
11359555991fdSmrg#
113603c15da26Smrg#
113613c15da26SmrgAC_DEFUN([XORG_CHANGELOG], [
113623c15da26SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
113633c15da26Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
113643c15da26Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
113653c15da26Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
113663c15da26SmrgAC_SUBST([CHANGELOG_CMD])
113673c15da26Smrg]) # XORG_CHANGELOG
11368126a8a12Smrg
113693c15da26Smrgdnl
113703c15da26Smrgdnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
113713c15da26Smrgdnl
113723c15da26Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
113733c15da26Smrgdnl copy of this software and associated documentation files (the "Software"),
113743c15da26Smrgdnl to deal in the Software without restriction, including without limitation
113753c15da26Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
113763c15da26Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
113773c15da26Smrgdnl Software is furnished to do so, subject to the following conditions:
113783c15da26Smrgdnl
113793c15da26Smrgdnl The above copyright notice and this permission notice (including the next
113803c15da26Smrgdnl paragraph) shall be included in all copies or substantial portions of the
113813c15da26Smrgdnl Software.
113823c15da26Smrgdnl
113833c15da26Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
113843c15da26Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
113853c15da26Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
113863c15da26Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
113873c15da26Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
113883c15da26Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
113893c15da26Smrgdnl DEALINGS IN THE SOFTWARE.
113903c15da26Smrgdnl
11391d656433aSmrg
113923c15da26Smrg# XTRANS_TCP_FLAGS()
113933c15da26Smrg# ------------------
113943c15da26Smrg# Find needed libraries for TCP sockets, and check for IPv6 support
113953c15da26SmrgAC_DEFUN([XTRANS_TCP_FLAGS],[
113963c15da26Smrg # SVR4 hides these in libraries other than libc
113973c15da26Smrg AC_SEARCH_LIBS(socket, [socket])
113983c15da26Smrg AC_SEARCH_LIBS(gethostbyname, [nsl])
113993c15da26Smrg if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
114003c15da26Smrg   AC_HAVE_LIBRARY([ws2_32])
114013c15da26Smrg fi
11402126a8a12Smrg
114033c15da26Smrg # Needs to come after above checks for libsocket & libnsl for SVR4 systems
114043c15da26Smrg AC_ARG_ENABLE(ipv6,
114053c15da26Smrg	AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
114063c15da26Smrg	[IPV6CONN=$enableval],
114073c15da26Smrg	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
114083c15da26Smrg AC_MSG_CHECKING([if IPv6 support should be built])
114093c15da26Smrg if test "$IPV6CONN" = "yes"; then
114103c15da26Smrg	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
114113c15da26Smrg fi
114123c15da26Smrg AC_MSG_RESULT($IPV6CONN)
11413d656433aSmrg
114143c15da26Smrg # 4.3BSD-Reno added a new member to struct sockaddr_in
114153c15da26Smrg AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
114163c15da26Smrg	AC_DEFINE([BSD44SOCKETS],1,
114173c15da26Smrg 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
114183c15da26Smrg#include <sys/types.h>
114193c15da26Smrg#include <sys/socket.h>
114203c15da26Smrg#include <netinet/in.h>
114213c15da26Smrg ])
11422126a8a12Smrg
114233c15da26Smrg # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
114243c15da26Smrg AC_CHECK_TYPES([socklen_t], [], [], [
114253c15da26SmrgAC_INCLUDES_DEFAULT
114263c15da26Smrg#include <sys/socket.h>])
11427126a8a12Smrg
114283c15da26Smrg]) # XTRANS_TCP_FLAGS
11429126a8a12Smrg
114303c15da26Smrg# XTRANS_CONNECTION_FLAGS()
114313c15da26Smrg# -------------------------
114323c15da26Smrg# Standard checks for which Xtrans transports to use by the Xorg packages
114333c15da26Smrg# that use Xtrans functions
114343c15da26SmrgAC_DEFUN([XTRANS_CONNECTION_FLAGS],[
114353c15da26Smrg AC_REQUIRE([AC_CANONICAL_HOST])
114363c15da26Smrg AC_REQUIRE([AC_TYPE_SIGNAL])
114373c15da26Smrg [case $host_os in
114383c15da26Smrg	mingw*)	unixdef="no"   ;;
114393c15da26Smrg	*)	unixdef="yes"  ;;
114403c15da26Smrg esac]
114413c15da26Smrg AC_ARG_ENABLE(unix-transport,
114423c15da26Smrg	AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
114433c15da26Smrg	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
114443c15da26Smrg AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
114453c15da26Smrg if test "$UNIXCONN" = "yes"; then
114463c15da26Smrg	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
114473c15da26Smrg fi
114483c15da26Smrg AC_MSG_RESULT($UNIXCONN)
114493c15da26Smrg AC_ARG_ENABLE(tcp-transport,
114503c15da26Smrg	AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
114513c15da26Smrg	[TCPCONN=$enableval], [TCPCONN=yes])
114523c15da26Smrg AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
114533c15da26Smrg AC_MSG_RESULT($TCPCONN)
114543c15da26Smrg if test "$TCPCONN" = "yes"; then
114553c15da26Smrg	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
114563c15da26Smrg	XTRANS_TCP_FLAGS
114573c15da26Smrg fi
114583c15da26Smrg [case $host_os in
114593c15da26Smrg	solaris*|sco*|sysv4*)	localdef="yes" ;;
114603c15da26Smrg	*)			localdef="no"  ;;
114613c15da26Smrg esac]
114623c15da26Smrg AC_ARG_ENABLE(local-transport,
114633c15da26Smrg	AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
114643c15da26Smrg	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
114653c15da26Smrg AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
114663c15da26Smrg AC_MSG_RESULT($LOCALCONN)
114673c15da26Smrg if test "$LOCALCONN" = "yes"; then
114683c15da26Smrg	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
114693c15da26Smrg fi
11470126a8a12Smrg
114713c15da26Smrg]) # XTRANS_CONNECTION_FLAGS
114723c15da26Smrg
114733c15da26Smrg
114743c15da26Smrg# XTRANS_SECURE_RPC_FLAGS()
114753c15da26Smrg# -------------------------
114763c15da26Smrg# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
114773c15da26Smrg# so that any necessary networking libraries are already found
114783c15da26SmrgAC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
114793c15da26Smrg[AC_REQUIRE([XTRANS_TCP_FLAGS])
114803c15da26Smrg AC_ARG_ENABLE(secure-rpc,
114813c15da26Smrg	AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
114823c15da26Smrg        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
114833c15da26Smrg
114843c15da26Smrg if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
114853c15da26Smrg	FOUND_SECURE_RPC="no"
114863c15da26Smrg	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
114873c15da26Smrg			[FOUND_SECURE_RPC="yes"])
114883c15da26Smrg	if test "x$FOUND_SECURE_RPC" = "xno" ; then
114893c15da26Smrg		if test "x$SECURE_RPC" = "xyes" ; then
114903c15da26Smrg	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
114913c15da26Smrg		fi
114923c15da26Smrg		SECURE_RPC="no"
114933c15da26Smrg	else
114943c15da26Smrg		dnl FreeBSD keeps getsecretkey in librpcsvc
114953c15da26Smrg		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
114963c15da26Smrg		SECURE_RPC="yes"
114973c15da26Smrg	fi
114983c15da26Smrg fi
114993c15da26Smrg AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
115003c15da26Smrg if test "x$SECURE_RPC" = "xyes" ; then
115013c15da26Smrg	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
115023c15da26Smrg fi
115033c15da26Smrg AC_MSG_RESULT($SECURE_RPC)
115043c15da26Smrg]) # XTRANS_SECURE_RPC_FLAGS
11505126a8a12Smrg
11506126a8a12Smrg
11507