aclocal.m4 revision 6af7124f
16af7124fSmrg# generated automatically by aclocal 1.14 -*- Autoconf -*-
21bedbe3fSmrg
31bedbe3fSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4ba6a1819Smrg
5ba6a1819Smrg# This file is free software; the Free Software Foundation
6ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
7ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
8ba6a1819Smrg
9ba6a1819Smrg# This program is distributed in the hope that it will be useful,
10ba6a1819Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ba6a1819Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ba6a1819Smrg# PARTICULAR PURPOSE.
13ba6a1819Smrg
141bedbe3fSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15549e21daSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16549e21daSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17549e21daSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18549e21daSmrg[m4_warning([this file was generated for autoconf 2.68.
19549e21daSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20549e21daSmrgIf you have problems, you may need to regenerate the build system entirely.
211bedbe3fSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22ba6a1819Smrg
231bedbe3fSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
24549e21daSmrg#
25549e21daSmrg# This file is free software; the Free Software Foundation
26549e21daSmrg# gives unlimited permission to copy and/or distribute it,
27549e21daSmrg# with or without modifications, as long as this notice is preserved.
282d8abe4fSmrg
29549e21daSmrg# AM_AUTOMAKE_VERSION(VERSION)
30549e21daSmrg# ----------------------------
31549e21daSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32549e21daSmrg# generated from the m4 files accompanying Automake X.Y.
33549e21daSmrg# (This private macro should not be called outside this file.)
34549e21daSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
356af7124fSmrg[am__api_version='1.14'
36549e21daSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37549e21daSmrgdnl require some minimum version.  Point them to the right macro.
386af7124fSmrgm4_if([$1], [1.14], [],
39549e21daSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40549e21daSmrg])
41549e21daSmrg
42549e21daSmrg# _AM_AUTOCONF_VERSION(VERSION)
43549e21daSmrg# -----------------------------
44549e21daSmrg# aclocal traces this macro to find the Autoconf version.
45549e21daSmrg# This is a private macro too.  Using m4_define simplifies
46549e21daSmrg# the logic in aclocal, which can simply ignore this definition.
47549e21daSmrgm4_define([_AM_AUTOCONF_VERSION], [])
48549e21daSmrg
49549e21daSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50549e21daSmrg# -------------------------------
51549e21daSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52549e21daSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53549e21daSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
546af7124fSmrg[AM_AUTOMAKE_VERSION([1.14])dnl
55549e21daSmrgm4_ifndef([AC_AUTOCONF_VERSION],
56549e21daSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57549e21daSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58549e21daSmrg
59549e21daSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60549e21daSmrg
611bedbe3fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
622d8abe4fSmrg#
63549e21daSmrg# This file is free software; the Free Software Foundation
64549e21daSmrg# gives unlimited permission to copy and/or distribute it,
65549e21daSmrg# with or without modifications, as long as this notice is preserved.
66549e21daSmrg
67549e21daSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
681bedbe3fSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
691bedbe3fSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70549e21daSmrg#
71549e21daSmrg# Of course, Automake must honor this variable whenever it calls a
72549e21daSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73549e21daSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74549e21daSmrg# depending on how configure is run.  This is pretty annoying, since
75549e21daSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76549e21daSmrg# source directory, any form will work fine, but in subdirectories a
77549e21daSmrg# relative path needs to be adjusted first.
782d8abe4fSmrg#
79549e21daSmrg# $ac_aux_dir/missing
80549e21daSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81549e21daSmrg# $top_srcdir/$ac_aux_dir/missing
82549e21daSmrg#    fails if $ac_aux_dir is absolute,
83549e21daSmrg#    fails when called from a subdirectory in a VPATH build with
84549e21daSmrg#          a relative $ac_aux_dir
852d8abe4fSmrg#
86549e21daSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87549e21daSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
881bedbe3fSmrg# harmless because $srcdir is '.', but things will broke when you
89549e21daSmrg# start a VPATH build or use an absolute $srcdir.
902d8abe4fSmrg#
91549e21daSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92549e21daSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93549e21daSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94549e21daSmrg# and then we would define $MISSING as
95549e21daSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96549e21daSmrg# This will work as long as MISSING is not called from configure, because
97549e21daSmrg# unfortunately $(top_srcdir) has no meaning in configure.
98549e21daSmrg# However there are other variables, like CC, which are often used in
99549e21daSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1002d8abe4fSmrg#
101549e21daSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
102549e21daSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
103549e21daSmrg# configured tree to be moved without reconfiguration.
1042d8abe4fSmrg
105549e21daSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
106549e21daSmrg[dnl Rely on autoconf to set up CDPATH properly.
107549e21daSmrgAC_PREREQ([2.50])dnl
108549e21daSmrg# expand $ac_aux_dir to an absolute path
109549e21daSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
110549e21daSmrg])
1112d8abe4fSmrg
112549e21daSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1132d8abe4fSmrg
1141bedbe3fSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
1152d8abe4fSmrg#
116549e21daSmrg# This file is free software; the Free Software Foundation
117549e21daSmrg# gives unlimited permission to copy and/or distribute it,
118549e21daSmrg# with or without modifications, as long as this notice is preserved.
1192d8abe4fSmrg
120549e21daSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
121549e21daSmrg# -------------------------------------
122549e21daSmrg# Define a conditional.
123549e21daSmrgAC_DEFUN([AM_CONDITIONAL],
1241bedbe3fSmrg[AC_PREREQ([2.52])dnl
1251bedbe3fSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1261bedbe3fSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
127549e21daSmrgAC_SUBST([$1_TRUE])dnl
128549e21daSmrgAC_SUBST([$1_FALSE])dnl
129549e21daSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
130549e21daSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
131549e21daSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
132549e21daSmrgif $2; then
133549e21daSmrg  $1_TRUE=
134549e21daSmrg  $1_FALSE='#'
135549e21daSmrgelse
136549e21daSmrg  $1_TRUE='#'
137549e21daSmrg  $1_FALSE=
1382d8abe4fSmrgfi
139549e21daSmrgAC_CONFIG_COMMANDS_PRE(
140549e21daSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
141549e21daSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
142549e21daSmrgUsually this means the macro was only invoked conditionally.]])
143549e21daSmrgfi])])
1442d8abe4fSmrg
1451bedbe3fSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
146549e21daSmrg#
147549e21daSmrg# This file is free software; the Free Software Foundation
148549e21daSmrg# gives unlimited permission to copy and/or distribute it,
149549e21daSmrg# with or without modifications, as long as this notice is preserved.
1502d8abe4fSmrg
1512d8abe4fSmrg
1521bedbe3fSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
153549e21daSmrg# written in clear, in which case automake, when reading aclocal.m4,
154549e21daSmrg# will think it sees a *use*, and therefore will trigger all it's
155549e21daSmrg# C support machinery.  Also note that it means that autoscan, seeing
156549e21daSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1572d8abe4fSmrg
1582d8abe4fSmrg
159549e21daSmrg# _AM_DEPENDENCIES(NAME)
160549e21daSmrg# ----------------------
161549e21daSmrg# See how the compiler implements dependency checking.
1621bedbe3fSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
163549e21daSmrg# We try a few techniques and use that to set a single cache variable.
164549e21daSmrg#
165549e21daSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
166549e21daSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
167549e21daSmrg# dependency, and given that the user is not expected to run this macro,
168549e21daSmrg# just rely on AC_PROG_CC.
169549e21daSmrgAC_DEFUN([_AM_DEPENDENCIES],
170549e21daSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
171549e21daSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
172549e21daSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
173549e21daSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1742d8abe4fSmrg
1751bedbe3fSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1761bedbe3fSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1771bedbe3fSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1781bedbe3fSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1791bedbe3fSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1801bedbe3fSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1811bedbe3fSmrg                    [depcc="$$1"   am_compiler_list=])
1822d8abe4fSmrg
183549e21daSmrgAC_CACHE_CHECK([dependency style of $depcc],
184549e21daSmrg               [am_cv_$1_dependencies_compiler_type],
185549e21daSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
186549e21daSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
187549e21daSmrg  # making bogus files that we don't know about and never remove.  For
188549e21daSmrg  # instance it was reported that on HP-UX the gcc test will end up
1891bedbe3fSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1901bedbe3fSmrg  # in D".
1911bedbe3fSmrg  rm -rf conftest.dir
192549e21daSmrg  mkdir conftest.dir
193549e21daSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
194549e21daSmrg  # using a relative directory.
195549e21daSmrg  cp "$am_depcomp" conftest.dir
196549e21daSmrg  cd conftest.dir
197549e21daSmrg  # We will build objects and dependencies in a subdirectory because
198549e21daSmrg  # it helps to detect inapplicable dependency modes.  For instance
199549e21daSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
200549e21daSmrg  # side effect of compilation, but ICC will put the dependencies in
201549e21daSmrg  # the current directory while Tru64 will put them in the object
202549e21daSmrg  # directory.
203549e21daSmrg  mkdir sub
2042d8abe4fSmrg
205549e21daSmrg  am_cv_$1_dependencies_compiler_type=none
206549e21daSmrg  if test "$am_compiler_list" = ""; then
207549e21daSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
208549e21daSmrg  fi
209549e21daSmrg  am__universal=false
210549e21daSmrg  m4_case([$1], [CC],
211549e21daSmrg    [case " $depcc " in #(
212549e21daSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
213549e21daSmrg     esac],
214549e21daSmrg    [CXX],
215549e21daSmrg    [case " $depcc " in #(
216549e21daSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
217549e21daSmrg     esac])
2182d8abe4fSmrg
219549e21daSmrg  for depmode in $am_compiler_list; do
220549e21daSmrg    # Setup a source with many dependencies, because some compilers
221549e21daSmrg    # like to wrap large dependency lists on column 80 (with \), and
222549e21daSmrg    # we should not choose a depcomp mode which is confused by this.
223549e21daSmrg    #
224549e21daSmrg    # We need to recreate these files for each test, as the compiler may
225549e21daSmrg    # overwrite some of them when testing with obscure command lines.
226549e21daSmrg    # This happens at least with the AIX C compiler.
227549e21daSmrg    : > sub/conftest.c
228549e21daSmrg    for i in 1 2 3 4 5 6; do
229549e21daSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2301bedbe3fSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2311bedbe3fSmrg      # Solaris 10 /bin/sh.
2321bedbe3fSmrg      echo '/* dummy */' > sub/conftst$i.h
233549e21daSmrg    done
234549e21daSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2352d8abe4fSmrg
2361bedbe3fSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
237549e21daSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2381bedbe3fSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
2391bedbe3fSmrg    # versions had trouble with output in subdirs.
240549e21daSmrg    am__obj=sub/conftest.${OBJEXT-o}
241549e21daSmrg    am__minus_obj="-o $am__obj"
242549e21daSmrg    case $depmode in
243549e21daSmrg    gcc)
244549e21daSmrg      # This depmode causes a compiler race in universal mode.
245549e21daSmrg      test "$am__universal" = false || continue
246549e21daSmrg      ;;
247549e21daSmrg    nosideeffect)
2481bedbe3fSmrg      # After this tag, mechanisms are not by side-effect, so they'll
2491bedbe3fSmrg      # only be used when explicitly requested.
250549e21daSmrg      if test "x$enable_dependency_tracking" = xyes; then
251549e21daSmrg	continue
252549e21daSmrg      else
253549e21daSmrg	break
254549e21daSmrg      fi
255549e21daSmrg      ;;
2561bedbe3fSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2571bedbe3fSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
258549e21daSmrg      # not run yet.  These depmodes are late enough in the game, and
259549e21daSmrg      # so weak that their functioning should not be impacted.
260549e21daSmrg      am__obj=conftest.${OBJEXT-o}
261549e21daSmrg      am__minus_obj=
262549e21daSmrg      ;;
263549e21daSmrg    none) break ;;
264549e21daSmrg    esac
265549e21daSmrg    if depmode=$depmode \
266549e21daSmrg       source=sub/conftest.c object=$am__obj \
267549e21daSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
268549e21daSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
269549e21daSmrg         >/dev/null 2>conftest.err &&
270549e21daSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
271549e21daSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
272549e21daSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
273549e21daSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
274549e21daSmrg      # icc doesn't choke on unknown options, it will just issue warnings
275549e21daSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
276549e21daSmrg      # that says an option was ignored or not supported.
277549e21daSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
278549e21daSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
279549e21daSmrg      # The diagnosis changed in icc 8.0:
280549e21daSmrg      #   icc: Command line remark: option '-MP' not supported
281549e21daSmrg      if (grep 'ignoring option' conftest.err ||
282549e21daSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
283549e21daSmrg        am_cv_$1_dependencies_compiler_type=$depmode
284549e21daSmrg        break
285549e21daSmrg      fi
286549e21daSmrg    fi
287549e21daSmrg  done
2882d8abe4fSmrg
289549e21daSmrg  cd ..
290549e21daSmrg  rm -rf conftest.dir
2912d8abe4fSmrgelse
292549e21daSmrg  am_cv_$1_dependencies_compiler_type=none
2932d8abe4fSmrgfi
294549e21daSmrg])
295549e21daSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
296549e21daSmrgAM_CONDITIONAL([am__fastdep$1], [
297549e21daSmrg  test "x$enable_dependency_tracking" != xno \
298549e21daSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
299549e21daSmrg])
3002d8abe4fSmrg
3012d8abe4fSmrg
302549e21daSmrg# AM_SET_DEPDIR
303549e21daSmrg# -------------
304549e21daSmrg# Choose a directory name for dependency files.
3051bedbe3fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
306549e21daSmrgAC_DEFUN([AM_SET_DEPDIR],
307549e21daSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
308549e21daSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
309549e21daSmrg])
3102d8abe4fSmrg
3112d8abe4fSmrg
312549e21daSmrg# AM_DEP_TRACK
313549e21daSmrg# ------------
314549e21daSmrgAC_DEFUN([AM_DEP_TRACK],
3151bedbe3fSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
3161bedbe3fSmrgAS_HELP_STRING(
3171bedbe3fSmrg  [--enable-dependency-tracking],
3181bedbe3fSmrg  [do not reject slow dependency extractors])
3191bedbe3fSmrgAS_HELP_STRING(
3201bedbe3fSmrg  [--disable-dependency-tracking],
3211bedbe3fSmrg  [speeds up one-time build])])
322549e21daSmrgif test "x$enable_dependency_tracking" != xno; then
323549e21daSmrg  am_depcomp="$ac_aux_dir/depcomp"
324549e21daSmrg  AMDEPBACKSLASH='\'
3251bedbe3fSmrg  am__nodep='_no'
3262d8abe4fSmrgfi
327549e21daSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
328549e21daSmrgAC_SUBST([AMDEPBACKSLASH])dnl
329549e21daSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3301bedbe3fSmrgAC_SUBST([am__nodep])dnl
3311bedbe3fSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
332549e21daSmrg])
3332d8abe4fSmrg
334549e21daSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3352d8abe4fSmrg
3361bedbe3fSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
3372d8abe4fSmrg#
338549e21daSmrg# This file is free software; the Free Software Foundation
339549e21daSmrg# gives unlimited permission to copy and/or distribute it,
340549e21daSmrg# with or without modifications, as long as this notice is preserved.
3412d8abe4fSmrg
3422d8abe4fSmrg
343549e21daSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
344549e21daSmrg# ------------------------------
345549e21daSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
346549e21daSmrg[{
3471bedbe3fSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
348549e21daSmrg  # are listed without --file.  Let's play safe and only enable the eval
349549e21daSmrg  # if we detect the quoting.
350549e21daSmrg  case $CONFIG_FILES in
351549e21daSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
352549e21daSmrg  *)   set x $CONFIG_FILES ;;
353549e21daSmrg  esac
354549e21daSmrg  shift
355549e21daSmrg  for mf
356549e21daSmrg  do
357549e21daSmrg    # Strip MF so we end up with the name of the file.
358549e21daSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
359549e21daSmrg    # Check whether this is an Automake generated Makefile or not.
3601bedbe3fSmrg    # We used to match only the files named 'Makefile.in', but
361549e21daSmrg    # some people rename them; so instead we look at the file content.
362549e21daSmrg    # Grep'ing the first line is not enough: some people post-process
363549e21daSmrg    # each Makefile.in and add a new line on top of each file to say so.
364549e21daSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
365549e21daSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
366549e21daSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
367549e21daSmrg      dirpart=`AS_DIRNAME("$mf")`
368549e21daSmrg    else
369549e21daSmrg      continue
370549e21daSmrg    fi
371549e21daSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3721bedbe3fSmrg    # from the Makefile without running 'make'.
373549e21daSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
374549e21daSmrg    test -z "$DEPDIR" && continue
375549e21daSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3761bedbe3fSmrg    test -z "$am__include" && continue
377549e21daSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
378549e21daSmrg    # Find all dependency output files, they are included files with
379549e21daSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
380549e21daSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
381549e21daSmrg    # expansion.
382549e21daSmrg    for file in `sed -n "
383549e21daSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3841bedbe3fSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
385549e21daSmrg      # Make sure the directory exists.
386549e21daSmrg      test -f "$dirpart/$file" && continue
387549e21daSmrg      fdir=`AS_DIRNAME(["$file"])`
388549e21daSmrg      AS_MKDIR_P([$dirpart/$fdir])
389549e21daSmrg      # echo "creating $dirpart/$file"
390549e21daSmrg      echo '# dummy' > "$dirpart/$file"
391549e21daSmrg    done
392549e21daSmrg  done
393549e21daSmrg}
394549e21daSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3952d8abe4fSmrg
3962d8abe4fSmrg
397549e21daSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
398549e21daSmrg# -----------------------------
399549e21daSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
400549e21daSmrg#
401549e21daSmrg# This code is only required when automatic dependency tracking
4021bedbe3fSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
403549e21daSmrg# need in order to bootstrap the dependency handling code.
404549e21daSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
405549e21daSmrg[AC_CONFIG_COMMANDS([depfiles],
406549e21daSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
407549e21daSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
408549e21daSmrg])
4092d8abe4fSmrg
410549e21daSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4112d8abe4fSmrg
4121bedbe3fSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4132d8abe4fSmrg#
414549e21daSmrg# This file is free software; the Free Software Foundation
415549e21daSmrg# gives unlimited permission to copy and/or distribute it,
416549e21daSmrg# with or without modifications, as long as this notice is preserved.
4172d8abe4fSmrg
418549e21daSmrg# This macro actually does too much.  Some checks are only needed if
419549e21daSmrg# your package does certain things.  But this isn't really a big deal.
420549e21daSmrg
4216af7124fSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
4226af7124fSmrgm4_define([AC_PROG_CC],
4236af7124fSmrgm4_defn([AC_PROG_CC])
4246af7124fSmrg[_AM_PROG_CC_C_O
4256af7124fSmrg])
4266af7124fSmrg
427549e21daSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
428549e21daSmrg# AM_INIT_AUTOMAKE([OPTIONS])
429549e21daSmrg# -----------------------------------------------
430549e21daSmrg# The call with PACKAGE and VERSION arguments is the old style
431549e21daSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
432549e21daSmrg# and VERSION should now be passed to AC_INIT and removed from
433549e21daSmrg# the call to AM_INIT_AUTOMAKE.
434549e21daSmrg# We support both call styles for the transition.  After
435549e21daSmrg# the next Automake release, Autoconf can make the AC_INIT
436549e21daSmrg# arguments mandatory, and then we can depend on a new Autoconf
437549e21daSmrg# release and drop the old call support.
438549e21daSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4391bedbe3fSmrg[AC_PREREQ([2.65])dnl
440549e21daSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
441549e21daSmrgdnl the ones we care about.
442549e21daSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
443549e21daSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
444549e21daSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
445549e21daSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
446549e21daSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
447549e21daSmrg  # is not polluted with repeated "-I."
448549e21daSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
449549e21daSmrg  # test to see if srcdir already configured
450549e21daSmrg  if test -f $srcdir/config.status; then
451549e21daSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
452549e21daSmrg  fi
4532d8abe4fSmrgfi
4542d8abe4fSmrg
455549e21daSmrg# test whether we have cygpath
456549e21daSmrgif test -z "$CYGPATH_W"; then
457549e21daSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
458549e21daSmrg    CYGPATH_W='cygpath -w'
459549e21daSmrg  else
460549e21daSmrg    CYGPATH_W=echo
461549e21daSmrg  fi
4622d8abe4fSmrgfi
463549e21daSmrgAC_SUBST([CYGPATH_W])
4642d8abe4fSmrg
465549e21daSmrg# Define the identity of the package.
466549e21daSmrgdnl Distinguish between old-style and new-style calls.
467549e21daSmrgm4_ifval([$2],
4681bedbe3fSmrg[AC_DIAGNOSE([obsolete],
4691bedbe3fSmrg             [$0: two- and three-arguments forms are deprecated.])
4701bedbe3fSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
471549e21daSmrg AC_SUBST([PACKAGE], [$1])dnl
472549e21daSmrg AC_SUBST([VERSION], [$2])],
473549e21daSmrg[_AM_SET_OPTIONS([$1])dnl
474549e21daSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4751bedbe3fSmrgm4_if(
4761bedbe3fSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
4771bedbe3fSmrg  [ok:ok],,
478549e21daSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
479549e21daSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
480549e21daSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4812d8abe4fSmrg
482549e21daSmrg_AM_IF_OPTION([no-define],,
4831bedbe3fSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4841bedbe3fSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4852d8abe4fSmrg
486549e21daSmrg# Some tools Automake needs.
487549e21daSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
488549e21daSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4891bedbe3fSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4901bedbe3fSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
4911bedbe3fSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4921bedbe3fSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
4931bedbe3fSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
494549e21daSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
495549e21daSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4961bedbe3fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
4971bedbe3fSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
4981bedbe3fSmrg# dies out for good.  For more background, see:
4991bedbe3fSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
5001bedbe3fSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
5011bedbe3fSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
502549e21daSmrg# We need awk for the "check" target.  The system "awk" is bad on
503549e21daSmrg# some platforms.
504549e21daSmrgAC_REQUIRE([AC_PROG_AWK])dnl
505549e21daSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
506549e21daSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
507549e21daSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
508549e21daSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
509549e21daSmrg			     [_AM_PROG_TAR([v7])])])
510549e21daSmrg_AM_IF_OPTION([no-dependencies],,
511549e21daSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5121bedbe3fSmrg		  [_AM_DEPENDENCIES([CC])],
5131bedbe3fSmrg		  [m4_define([AC_PROG_CC],
5141bedbe3fSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
515549e21daSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5161bedbe3fSmrg		  [_AM_DEPENDENCIES([CXX])],
5171bedbe3fSmrg		  [m4_define([AC_PROG_CXX],
5181bedbe3fSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
519549e21daSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5201bedbe3fSmrg		  [_AM_DEPENDENCIES([OBJC])],
5211bedbe3fSmrg		  [m4_define([AC_PROG_OBJC],
5221bedbe3fSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
5231bedbe3fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
5241bedbe3fSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
5251bedbe3fSmrg		  [m4_define([AC_PROG_OBJCXX],
5261bedbe3fSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
527549e21daSmrg])
5281bedbe3fSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
5291bedbe3fSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
5301bedbe3fSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
5311bedbe3fSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
532549e21daSmrgAC_CONFIG_COMMANDS_PRE(dnl
533549e21daSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
534549e21daSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5356af7124fSmrg
5366af7124fSmrg# POSIX will say in a future version that running "rm -f" with no argument
5376af7124fSmrg# is OK; and we want to be able to make that assumption in our Makefile
5386af7124fSmrg# recipes.  So use an aggressive probe to check that the usage we want is
5396af7124fSmrg# actually supported "in the wild" to an acceptable degree.
5406af7124fSmrg# See automake bug#10828.
5416af7124fSmrg# To make any issue more visible, cause the running configure to be aborted
5426af7124fSmrg# by default if the 'rm' program in use doesn't match our expectations; the
5436af7124fSmrg# user can still override this though.
5446af7124fSmrgif rm -f && rm -fr && rm -rf; then : OK; else
5456af7124fSmrg  cat >&2 <<'END'
5466af7124fSmrgOops!
5476af7124fSmrg
5486af7124fSmrgYour 'rm' program seems unable to run without file operands specified
5496af7124fSmrgon the command line, even when the '-f' option is present.  This is contrary
5506af7124fSmrgto the behaviour of most rm programs out there, and not conforming with
5516af7124fSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
5526af7124fSmrg
5536af7124fSmrgPlease tell bug-automake@gnu.org about your system, including the value
5546af7124fSmrgof your $PATH and any error possibly output before this message.  This
5556af7124fSmrgcan help us improve future automake versions.
5566af7124fSmrg
5576af7124fSmrgEND
5586af7124fSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
5596af7124fSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
5606af7124fSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
5616af7124fSmrg    echo >&2
5626af7124fSmrg  else
5636af7124fSmrg    cat >&2 <<'END'
5646af7124fSmrgAborting the configuration process, to ensure you take notice of the issue.
5656af7124fSmrg
5666af7124fSmrgYou can download and install GNU coreutils to get an 'rm' implementation
5676af7124fSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
5686af7124fSmrg
5696af7124fSmrgIf you want to complete the configuration process using your problematic
5706af7124fSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
5716af7124fSmrgto "yes", and re-run configure.
5726af7124fSmrg
5736af7124fSmrgEND
5746af7124fSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
5756af7124fSmrg  fi
5766af7124fSmrgfi])
5772d8abe4fSmrg
5781bedbe3fSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
579549e21daSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
580549e21daSmrgdnl mangled by Autoconf and run in a shell conditional statement.
581549e21daSmrgm4_define([_AC_COMPILER_EXEEXT],
582549e21daSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5832d8abe4fSmrg
584549e21daSmrg# When config.status generates a header, we must update the stamp-h file.
585549e21daSmrg# This file resides in the same directory as the config header
586549e21daSmrg# that is generated.  The stamp files are numbered to have different names.
587549e21daSmrg
588549e21daSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
589549e21daSmrg# loop where config.status creates the headers, so we can generate
590549e21daSmrg# our stamp files there.
591549e21daSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
592549e21daSmrg[# Compute $1's index in $config_headers.
593549e21daSmrg_am_arg=$1
594549e21daSmrg_am_stamp_count=1
595549e21daSmrgfor _am_header in $config_headers :; do
596549e21daSmrg  case $_am_header in
597549e21daSmrg    $_am_arg | $_am_arg:* )
598549e21daSmrg      break ;;
599549e21daSmrg    * )
600549e21daSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
601549e21daSmrg  esac
602549e21daSmrgdone
603549e21daSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
604549e21daSmrg
6051bedbe3fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
6062d8abe4fSmrg#
607549e21daSmrg# This file is free software; the Free Software Foundation
608549e21daSmrg# gives unlimited permission to copy and/or distribute it,
609549e21daSmrg# with or without modifications, as long as this notice is preserved.
6102d8abe4fSmrg
611549e21daSmrg# AM_PROG_INSTALL_SH
612549e21daSmrg# ------------------
613549e21daSmrg# Define $install_sh.
614549e21daSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
615549e21daSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
616549e21daSmrgif test x"${install_sh}" != xset; then
617549e21daSmrg  case $am_aux_dir in
618549e21daSmrg  *\ * | *\	*)
619549e21daSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
620549e21daSmrg  *)
621549e21daSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
622549e21daSmrg  esac
6232d8abe4fSmrgfi
6241bedbe3fSmrgAC_SUBST([install_sh])])
6252d8abe4fSmrg
6261bedbe3fSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
6272d8abe4fSmrg#
628549e21daSmrg# This file is free software; the Free Software Foundation
629549e21daSmrg# gives unlimited permission to copy and/or distribute it,
630549e21daSmrg# with or without modifications, as long as this notice is preserved.
631549e21daSmrg
632549e21daSmrg# Check whether the underlying file-system supports filenames
633549e21daSmrg# with a leading dot.  For instance MS-DOS doesn't.
634549e21daSmrgAC_DEFUN([AM_SET_LEADING_DOT],
635549e21daSmrg[rm -rf .tst 2>/dev/null
636549e21daSmrgmkdir .tst 2>/dev/null
637549e21daSmrgif test -d .tst; then
638549e21daSmrg  am__leading_dot=.
6392d8abe4fSmrgelse
640549e21daSmrg  am__leading_dot=_
6412d8abe4fSmrgfi
642549e21daSmrgrmdir .tst 2>/dev/null
643549e21daSmrgAC_SUBST([am__leading_dot])])
6442d8abe4fSmrg
645549e21daSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
646ba6a1819Smrg
6471bedbe3fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
648ba6a1819Smrg#
649ba6a1819Smrg# This file is free software; the Free Software Foundation
650ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
651ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
652ba6a1819Smrg
653549e21daSmrg# AM_MAKE_INCLUDE()
654549e21daSmrg# -----------------
655549e21daSmrg# Check to see how make treats includes.
656549e21daSmrgAC_DEFUN([AM_MAKE_INCLUDE],
657549e21daSmrg[am_make=${MAKE-make}
658549e21daSmrgcat > confinc << 'END'
659549e21daSmrgam__doit:
660549e21daSmrg	@echo this is the am__doit target
661549e21daSmrg.PHONY: am__doit
662549e21daSmrgEND
663549e21daSmrg# If we don't find an include directive, just comment out the code.
664549e21daSmrgAC_MSG_CHECKING([for style of include used by $am_make])
665549e21daSmrgam__include="#"
666549e21daSmrgam__quote=
667549e21daSmrg_am_result=none
668549e21daSmrg# First try GNU make style include.
669549e21daSmrgecho "include confinc" > confmf
6701bedbe3fSmrg# Ignore all kinds of additional output from 'make'.
671549e21daSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
672549e21daSmrg*the\ am__doit\ target*)
673549e21daSmrg  am__include=include
674549e21daSmrg  am__quote=
675549e21daSmrg  _am_result=GNU
676549e21daSmrg  ;;
677549e21daSmrgesac
678549e21daSmrg# Now try BSD make style include.
679549e21daSmrgif test "$am__include" = "#"; then
680549e21daSmrg   echo '.include "confinc"' > confmf
681549e21daSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
682549e21daSmrg   *the\ am__doit\ target*)
683549e21daSmrg     am__include=.include
684549e21daSmrg     am__quote="\""
685549e21daSmrg     _am_result=BSD
686549e21daSmrg     ;;
687549e21daSmrg   esac
688549e21daSmrgfi
689549e21daSmrgAC_SUBST([am__include])
690549e21daSmrgAC_SUBST([am__quote])
691549e21daSmrgAC_MSG_RESULT([$_am_result])
692549e21daSmrgrm -f confinc confmf
693ba6a1819Smrg])
694ba6a1819Smrg
695549e21daSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
696ba6a1819Smrg
6971bedbe3fSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
698ba6a1819Smrg#
699ba6a1819Smrg# This file is free software; the Free Software Foundation
700ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
701ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
702ba6a1819Smrg
703549e21daSmrg# AM_MISSING_PROG(NAME, PROGRAM)
704549e21daSmrg# ------------------------------
705549e21daSmrgAC_DEFUN([AM_MISSING_PROG],
706549e21daSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
707549e21daSmrg$1=${$1-"${am_missing_run}$2"}
708549e21daSmrgAC_SUBST($1)])
709549e21daSmrg
710549e21daSmrg# AM_MISSING_HAS_RUN
711549e21daSmrg# ------------------
7121bedbe3fSmrg# Define MISSING if not defined so far and test if it is modern enough.
7131bedbe3fSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
714549e21daSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
715549e21daSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
716549e21daSmrgAC_REQUIRE_AUX_FILE([missing])dnl
717549e21daSmrgif test x"${MISSING+set}" != xset; then
718549e21daSmrg  case $am_aux_dir in
719549e21daSmrg  *\ * | *\	*)
720549e21daSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
721549e21daSmrg  *)
722549e21daSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
723549e21daSmrg  esac
724549e21daSmrgfi
725549e21daSmrg# Use eval to expand $SHELL
7261bedbe3fSmrgif eval "$MISSING --is-lightweight"; then
7271bedbe3fSmrg  am_missing_run="$MISSING "
728ba6a1819Smrgelse
729549e21daSmrg  am_missing_run=
7301bedbe3fSmrg  AC_MSG_WARN(['missing' script is too old or missing])
731ba6a1819Smrgfi
732549e21daSmrg])
733ba6a1819Smrg
734549e21daSmrg# Helper functions for option handling.                     -*- Autoconf -*-
735ba6a1819Smrg
7361bedbe3fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
737ba6a1819Smrg#
738549e21daSmrg# This file is free software; the Free Software Foundation
739549e21daSmrg# gives unlimited permission to copy and/or distribute it,
740549e21daSmrg# with or without modifications, as long as this notice is preserved.
741ba6a1819Smrg
742549e21daSmrg# _AM_MANGLE_OPTION(NAME)
743549e21daSmrg# -----------------------
744549e21daSmrgAC_DEFUN([_AM_MANGLE_OPTION],
745549e21daSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
746ba6a1819Smrg
747549e21daSmrg# _AM_SET_OPTION(NAME)
7481bedbe3fSmrg# --------------------
749549e21daSmrg# Set option NAME.  Presently that only means defining a flag for this option.
750549e21daSmrgAC_DEFUN([_AM_SET_OPTION],
7511bedbe3fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
752ba6a1819Smrg
753549e21daSmrg# _AM_SET_OPTIONS(OPTIONS)
7541bedbe3fSmrg# ------------------------
755549e21daSmrg# OPTIONS is a space-separated list of Automake options.
756549e21daSmrgAC_DEFUN([_AM_SET_OPTIONS],
757549e21daSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
758ba6a1819Smrg
759549e21daSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
760549e21daSmrg# -------------------------------------------
761549e21daSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
762549e21daSmrgAC_DEFUN([_AM_IF_OPTION],
763549e21daSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
764ba6a1819Smrg
7656af7124fSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
7666af7124fSmrg#
7676af7124fSmrg# This file is free software; the Free Software Foundation
7686af7124fSmrg# gives unlimited permission to copy and/or distribute it,
7696af7124fSmrg# with or without modifications, as long as this notice is preserved.
7706af7124fSmrg
7716af7124fSmrg# _AM_PROG_CC_C_O
7726af7124fSmrg# ---------------
7736af7124fSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
7746af7124fSmrg# to automatically call this.
7756af7124fSmrgAC_DEFUN([_AM_PROG_CC_C_O],
7766af7124fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7776af7124fSmrgAC_REQUIRE_AUX_FILE([compile])dnl
7786af7124fSmrgAC_LANG_PUSH([C])dnl
7796af7124fSmrgAC_CACHE_CHECK(
7806af7124fSmrg  [whether $CC understands -c and -o together],
7816af7124fSmrg  [am_cv_prog_cc_c_o],
7826af7124fSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
7836af7124fSmrg  # Make sure it works both with $CC and with simple cc.
7846af7124fSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
7856af7124fSmrg  # compilers refuse to overwrite an existing .o file with -o,
7866af7124fSmrg  # though they will create one.
7876af7124fSmrg  am_cv_prog_cc_c_o=yes
7886af7124fSmrg  for am_i in 1 2; do
7896af7124fSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
7906af7124fSmrg         && test -f conftest2.$ac_objext; then
7916af7124fSmrg      : OK
7926af7124fSmrg    else
7936af7124fSmrg      am_cv_prog_cc_c_o=no
7946af7124fSmrg      break
7956af7124fSmrg    fi
7966af7124fSmrg  done
7976af7124fSmrg  rm -f core conftest*
7986af7124fSmrg  unset am_i])
7996af7124fSmrgif test "$am_cv_prog_cc_c_o" != yes; then
8006af7124fSmrg   # Losing compiler, so override with the script.
8016af7124fSmrg   # FIXME: It is wrong to rewrite CC.
8026af7124fSmrg   # But if we don't then we get into trouble of one sort or another.
8036af7124fSmrg   # A longer-term fix would be to have automake use am__CC in this case,
8046af7124fSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
8056af7124fSmrg   CC="$am_aux_dir/compile $CC"
8066af7124fSmrgfi
8076af7124fSmrgAC_LANG_POP([C])])
8086af7124fSmrg
8096af7124fSmrg# For backward compatibility.
8106af7124fSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
8116af7124fSmrg
8126af7124fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
8136af7124fSmrg#
8146af7124fSmrg# This file is free software; the Free Software Foundation
8156af7124fSmrg# gives unlimited permission to copy and/or distribute it,
8166af7124fSmrg# with or without modifications, as long as this notice is preserved.
8176af7124fSmrg
8186af7124fSmrg# AM_RUN_LOG(COMMAND)
8196af7124fSmrg# -------------------
8206af7124fSmrg# Run COMMAND, save the exit status in ac_status, and log it.
8216af7124fSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
8226af7124fSmrgAC_DEFUN([AM_RUN_LOG],
8236af7124fSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
8246af7124fSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
8256af7124fSmrg   ac_status=$?
8266af7124fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
8276af7124fSmrg   (exit $ac_status); }])
8286af7124fSmrg
829549e21daSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
830ba6a1819Smrg
8311bedbe3fSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
832ba6a1819Smrg#
833ba6a1819Smrg# This file is free software; the Free Software Foundation
834ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
835ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
836ba6a1819Smrg
837549e21daSmrg# AM_SANITY_CHECK
838549e21daSmrg# ---------------
839549e21daSmrgAC_DEFUN([AM_SANITY_CHECK],
840549e21daSmrg[AC_MSG_CHECKING([whether build environment is sane])
841549e21daSmrg# Reject unsafe characters in $srcdir or the absolute working directory
842549e21daSmrg# name.  Accept space and tab only in the latter.
843549e21daSmrgam_lf='
844549e21daSmrg'
845549e21daSmrgcase `pwd` in
846549e21daSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
847549e21daSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
848549e21daSmrgesac
849549e21daSmrgcase $srcdir in
850549e21daSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8511bedbe3fSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
852549e21daSmrgesac
853ba6a1819Smrg
8541bedbe3fSmrg# Do 'set' in a subshell so we don't clobber the current shell's
855549e21daSmrg# arguments.  Must try -L first in case configure is actually a
856549e21daSmrg# symlink; some systems play weird games with the mod time of symlinks
857549e21daSmrg# (eg FreeBSD returns the mod time of the symlink's containing
858549e21daSmrg# directory).
859549e21daSmrgif (
8601bedbe3fSmrg   am_has_slept=no
8611bedbe3fSmrg   for am_try in 1 2; do
8621bedbe3fSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
8631bedbe3fSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8641bedbe3fSmrg     if test "$[*]" = "X"; then
8651bedbe3fSmrg	# -L didn't work.
8661bedbe3fSmrg	set X `ls -t "$srcdir/configure" conftest.file`
8671bedbe3fSmrg     fi
8681bedbe3fSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
8691bedbe3fSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
8701bedbe3fSmrg
8711bedbe3fSmrg	# If neither matched, then we have a broken ls.  This can happen
8721bedbe3fSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
8731bedbe3fSmrg	# broken ls alias from the environment.  This has actually
8741bedbe3fSmrg	# happened.  Such a system could not be considered "sane".
8751bedbe3fSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8761bedbe3fSmrg  alias in your environment])
8771bedbe3fSmrg     fi
8781bedbe3fSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
8791bedbe3fSmrg       break
8801bedbe3fSmrg     fi
8811bedbe3fSmrg     # Just in case.
8821bedbe3fSmrg     sleep 1
8831bedbe3fSmrg     am_has_slept=yes
8841bedbe3fSmrg   done
885549e21daSmrg   test "$[2]" = conftest.file
886549e21daSmrg   )
887549e21daSmrgthen
888549e21daSmrg   # Ok.
889549e21daSmrg   :
890549e21daSmrgelse
891549e21daSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
892549e21daSmrgCheck your system clock])
893549e21daSmrgfi
8941bedbe3fSmrgAC_MSG_RESULT([yes])
8951bedbe3fSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
8961bedbe3fSmrg# generated files are strictly newer.
8971bedbe3fSmrgam_sleep_pid=
8981bedbe3fSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
8991bedbe3fSmrg  ( sleep 1 ) &
9001bedbe3fSmrg  am_sleep_pid=$!
9011bedbe3fSmrgfi
9021bedbe3fSmrgAC_CONFIG_COMMANDS_PRE(
9031bedbe3fSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
9041bedbe3fSmrg   if test -n "$am_sleep_pid"; then
9051bedbe3fSmrg     # Hide warnings about reused PIDs.
9061bedbe3fSmrg     wait $am_sleep_pid 2>/dev/null
9071bedbe3fSmrg   fi
9081bedbe3fSmrg   AC_MSG_RESULT([done])])
9091bedbe3fSmrgrm -f conftest.file
9101bedbe3fSmrg])
911549e21daSmrg
9121bedbe3fSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
913ba6a1819Smrg#
914ba6a1819Smrg# This file is free software; the Free Software Foundation
915ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
916ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
917ba6a1819Smrg
918549e21daSmrg# AM_SILENT_RULES([DEFAULT])
919549e21daSmrg# --------------------------
920549e21daSmrg# Enable less verbose build rules; with the default set to DEFAULT
9211bedbe3fSmrg# ("yes" being less verbose, "no" or empty being verbose).
922549e21daSmrgAC_DEFUN([AM_SILENT_RULES],
9231bedbe3fSmrg[AC_ARG_ENABLE([silent-rules], [dnl
9241bedbe3fSmrgAS_HELP_STRING(
9251bedbe3fSmrg  [--enable-silent-rules],
9261bedbe3fSmrg  [less verbose build output (undo: "make V=1")])
9271bedbe3fSmrgAS_HELP_STRING(
9281bedbe3fSmrg  [--disable-silent-rules],
9291bedbe3fSmrg  [verbose build output (undo: "make V=0")])dnl
9301bedbe3fSmrg])
9311bedbe3fSmrgcase $enable_silent_rules in @%:@ (((
9321bedbe3fSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
9331bedbe3fSmrg   no) AM_DEFAULT_VERBOSITY=1;;
9341bedbe3fSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
935549e21daSmrgesac
9361bedbe3fSmrgdnl
9371bedbe3fSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9381bedbe3fSmrgdnl do not support nested variable expansions.
9391bedbe3fSmrgdnl See automake bug#9928 and bug#10237.
9401bedbe3fSmrgam_make=${MAKE-make}
9411bedbe3fSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
9421bedbe3fSmrg   [am_cv_make_support_nested_variables],
9431bedbe3fSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
9441bedbe3fSmrgBAR0=false
9451bedbe3fSmrgBAR1=true
9461bedbe3fSmrgV=1
9471bedbe3fSmrgam__doit:
9481bedbe3fSmrg	@$(TRUE)
9491bedbe3fSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9501bedbe3fSmrg  am_cv_make_support_nested_variables=yes
9511bedbe3fSmrgelse
9521bedbe3fSmrg  am_cv_make_support_nested_variables=no
9531bedbe3fSmrgfi])
9541bedbe3fSmrgif test $am_cv_make_support_nested_variables = yes; then
9551bedbe3fSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9561bedbe3fSmrg  AM_V='$(V)'
9571bedbe3fSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9581bedbe3fSmrgelse
9591bedbe3fSmrg  AM_V=$AM_DEFAULT_VERBOSITY
9601bedbe3fSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
9611bedbe3fSmrgfi
9621bedbe3fSmrgAC_SUBST([AM_V])dnl
9631bedbe3fSmrgAM_SUBST_NOTMAKE([AM_V])dnl
9641bedbe3fSmrgAC_SUBST([AM_DEFAULT_V])dnl
9651bedbe3fSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
966549e21daSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
967549e21daSmrgAM_BACKSLASH='\'
968549e21daSmrgAC_SUBST([AM_BACKSLASH])dnl
969549e21daSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
970549e21daSmrg])
971ba6a1819Smrg
9721bedbe3fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
973ba6a1819Smrg#
974ba6a1819Smrg# This file is free software; the Free Software Foundation
975ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
976ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
977ba6a1819Smrg
978549e21daSmrg# AM_PROG_INSTALL_STRIP
979549e21daSmrg# ---------------------
9801bedbe3fSmrg# One issue with vendor 'install' (even GNU) is that you can't
981549e21daSmrg# specify the program used to strip binaries.  This is especially
982549e21daSmrg# annoying in cross-compiling environments, where the build's strip
983549e21daSmrg# is unlikely to handle the host's binaries.
984549e21daSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9851bedbe3fSmrg# always use install-sh in "make install-strip", and initialize
986549e21daSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
987549e21daSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
988549e21daSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9891bedbe3fSmrg# Installed binaries are usually stripped using 'strip' when the user
9901bedbe3fSmrg# run "make install-strip".  However 'strip' might not be the right
991549e21daSmrg# tool to use in cross-compilation environments, therefore Automake
9921bedbe3fSmrg# will honor the 'STRIP' environment variable to overrule this program.
9931bedbe3fSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
994549e21daSmrgif test "$cross_compiling" != no; then
995549e21daSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
996ba6a1819Smrgfi
997549e21daSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
998549e21daSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
999ba6a1819Smrg
10001bedbe3fSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1001549e21daSmrg#
1002549e21daSmrg# This file is free software; the Free Software Foundation
1003549e21daSmrg# gives unlimited permission to copy and/or distribute it,
1004549e21daSmrg# with or without modifications, as long as this notice is preserved.
1005ba6a1819Smrg
1006549e21daSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
1007549e21daSmrg# ---------------------------
1008549e21daSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1009549e21daSmrg# This macro is traced by Automake.
1010549e21daSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1011ba6a1819Smrg
1012549e21daSmrg# AM_SUBST_NOTMAKE(VARIABLE)
10131bedbe3fSmrg# --------------------------
1014549e21daSmrg# Public sister of _AM_SUBST_NOTMAKE.
1015549e21daSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1016ba6a1819Smrg
1017549e21daSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1018ba6a1819Smrg
10191bedbe3fSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1020ba6a1819Smrg#
1021ba6a1819Smrg# This file is free software; the Free Software Foundation
1022ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
1023ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
1024ba6a1819Smrg
1025549e21daSmrg# _AM_PROG_TAR(FORMAT)
1026549e21daSmrg# --------------------
1027549e21daSmrg# Check how to create a tarball in format FORMAT.
10281bedbe3fSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1029ba6a1819Smrg#
1030549e21daSmrg# Substitute a variable $(am__tar) that is a command
1031549e21daSmrg# writing to stdout a FORMAT-tarball containing the directory
1032549e21daSmrg# $tardir.
1033549e21daSmrg#     tardir=directory && $(am__tar) > result.tar
1034549e21daSmrg#
1035549e21daSmrg# Substitute a variable $(am__untar) that extract such
1036549e21daSmrg# a tarball read from stdin.
1037549e21daSmrg#     $(am__untar) < result.tar
10381bedbe3fSmrg#
1039549e21daSmrgAC_DEFUN([_AM_PROG_TAR],
10401bedbe3fSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
10411bedbe3fSmrg# in the wild :-(  We should find a proper way to deprecate it ...
10421bedbe3fSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
10431bedbe3fSmrg
10441bedbe3fSmrg# We'll loop over all known methods to create a tar archive until one works.
1045549e21daSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1046ba6a1819Smrg
10471bedbe3fSmrgm4_if([$1], [v7],
10481bedbe3fSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
10491bedbe3fSmrg
10501bedbe3fSmrg  [m4_case([$1],
10511bedbe3fSmrg    [ustar],
10521bedbe3fSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
10531bedbe3fSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
10541bedbe3fSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
10551bedbe3fSmrg      # and bug#13588).
10561bedbe3fSmrg      am_max_uid=2097151 # 2^21 - 1
10571bedbe3fSmrg      am_max_gid=$am_max_uid
10581bedbe3fSmrg      # The $UID and $GID variables are not portable, so we need to resort
10591bedbe3fSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
10601bedbe3fSmrg      # below are definitely unexpected, so allow the users to see them
10611bedbe3fSmrg      # (that is, avoid stderr redirection).
10621bedbe3fSmrg      am_uid=`id -u || echo unknown`
10631bedbe3fSmrg      am_gid=`id -g || echo unknown`
10641bedbe3fSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
10651bedbe3fSmrg      if test $am_uid -le $am_max_uid; then
10661bedbe3fSmrg         AC_MSG_RESULT([yes])
10671bedbe3fSmrg      else
10681bedbe3fSmrg         AC_MSG_RESULT([no])
10691bedbe3fSmrg         _am_tools=none
10701bedbe3fSmrg      fi
10711bedbe3fSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
10721bedbe3fSmrg      if test $am_gid -le $am_max_gid; then
10731bedbe3fSmrg         AC_MSG_RESULT([yes])
10741bedbe3fSmrg      else
10751bedbe3fSmrg        AC_MSG_RESULT([no])
10761bedbe3fSmrg        _am_tools=none
10771bedbe3fSmrg      fi],
10781bedbe3fSmrg
10791bedbe3fSmrg  [pax],
10801bedbe3fSmrg    [],
1081ba6a1819Smrg
10821bedbe3fSmrg  [m4_fatal([Unknown tar format])])
10831bedbe3fSmrg
10841bedbe3fSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
10851bedbe3fSmrg
10861bedbe3fSmrg  # Go ahead even if we have the value already cached.  We do so because we
10871bedbe3fSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
10881bedbe3fSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
10891bedbe3fSmrg
10901bedbe3fSmrg  for _am_tool in $_am_tools; do
10911bedbe3fSmrg    case $_am_tool in
10921bedbe3fSmrg    gnutar)
10931bedbe3fSmrg      for _am_tar in tar gnutar gtar; do
10941bedbe3fSmrg        AM_RUN_LOG([$_am_tar --version]) && break
10951bedbe3fSmrg      done
10961bedbe3fSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
10971bedbe3fSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
10981bedbe3fSmrg      am__untar="$_am_tar -xf -"
10991bedbe3fSmrg      ;;
11001bedbe3fSmrg    plaintar)
11011bedbe3fSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
11021bedbe3fSmrg      # ustar tarball either.
11031bedbe3fSmrg      (tar --version) >/dev/null 2>&1 && continue
11041bedbe3fSmrg      am__tar='tar chf - "$$tardir"'
11051bedbe3fSmrg      am__tar_='tar chf - "$tardir"'
11061bedbe3fSmrg      am__untar='tar xf -'
11071bedbe3fSmrg      ;;
11081bedbe3fSmrg    pax)
11091bedbe3fSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
11101bedbe3fSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
11111bedbe3fSmrg      am__untar='pax -r'
11121bedbe3fSmrg      ;;
11131bedbe3fSmrg    cpio)
11141bedbe3fSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11151bedbe3fSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11161bedbe3fSmrg      am__untar='cpio -i -H $1 -d'
11171bedbe3fSmrg      ;;
11181bedbe3fSmrg    none)
11191bedbe3fSmrg      am__tar=false
11201bedbe3fSmrg      am__tar_=false
11211bedbe3fSmrg      am__untar=false
11221bedbe3fSmrg      ;;
11231bedbe3fSmrg    esac
11241bedbe3fSmrg
11251bedbe3fSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
11261bedbe3fSmrg    # and am__untar set.
11271bedbe3fSmrg    test -n "${am_cv_prog_tar_$1}" && break
11281bedbe3fSmrg
11291bedbe3fSmrg    # tar/untar a dummy directory, and stop if the command works.
11301bedbe3fSmrg    rm -rf conftest.dir
11311bedbe3fSmrg    mkdir conftest.dir
11321bedbe3fSmrg    echo GrepMe > conftest.dir/file
11331bedbe3fSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11341bedbe3fSmrg    rm -rf conftest.dir
11351bedbe3fSmrg    if test -s conftest.tar; then
11361bedbe3fSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
11371bedbe3fSmrg      AM_RUN_LOG([cat conftest.dir/file])
11381bedbe3fSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11391bedbe3fSmrg    fi
11401bedbe3fSmrg  done
1141549e21daSmrg  rm -rf conftest.dir
1142ba6a1819Smrg
11431bedbe3fSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11441bedbe3fSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
11451bedbe3fSmrg
1146549e21daSmrgAC_SUBST([am__tar])
1147549e21daSmrgAC_SUBST([am__untar])
1148549e21daSmrg]) # _AM_PROG_TAR
1149ba6a1819Smrg
11501bedbe3fSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
11511bedbe3fSmrg#
11521bedbe3fSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
11531bedbe3fSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
11541bedbe3fSmrg#                 Foundation, Inc.
11551bedbe3fSmrg#   Written by Gordon Matzigkeit, 1996
11561bedbe3fSmrg#
11571bedbe3fSmrg# This file is free software; the Free Software Foundation gives
11581bedbe3fSmrg# unlimited permission to copy and/or distribute it, with or without
11591bedbe3fSmrg# modifications, as long as this notice is preserved.
1160ba6a1819Smrg
11611bedbe3fSmrgm4_define([_LT_COPYING], [dnl
11621bedbe3fSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
11631bedbe3fSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
11641bedbe3fSmrg#                 Foundation, Inc.
11651bedbe3fSmrg#   Written by Gordon Matzigkeit, 1996
1166549e21daSmrg#
11671bedbe3fSmrg#   This file is part of GNU Libtool.
1168549e21daSmrg#
11691bedbe3fSmrg# GNU Libtool is free software; you can redistribute it and/or
11701bedbe3fSmrg# modify it under the terms of the GNU General Public License as
11711bedbe3fSmrg# published by the Free Software Foundation; either version 2 of
11721bedbe3fSmrg# the License, or (at your option) any later version.
1173549e21daSmrg#
11741bedbe3fSmrg# As a special exception to the GNU General Public License,
11751bedbe3fSmrg# if you distribute this file as part of a program or library that
11761bedbe3fSmrg# is built using GNU Libtool, you may include this file under the
11771bedbe3fSmrg# same distribution terms that you use for the rest of that program.
1178549e21daSmrg#
11791bedbe3fSmrg# GNU Libtool is distributed in the hope that it will be useful,
11801bedbe3fSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
11811bedbe3fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11821bedbe3fSmrg# GNU General Public License for more details.
1183549e21daSmrg#
11841bedbe3fSmrg# You should have received a copy of the GNU General Public License
11851bedbe3fSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
11861bedbe3fSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
11871bedbe3fSmrg# obtained by writing to the Free Software Foundation, Inc.,
11881bedbe3fSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
11891bedbe3fSmrg])
1190ba6a1819Smrg
11911bedbe3fSmrg# serial 57 LT_INIT
1192ba6a1819Smrg
1193ba6a1819Smrg
11941bedbe3fSmrg# LT_PREREQ(VERSION)
11951bedbe3fSmrg# ------------------
11961bedbe3fSmrg# Complain and exit if this libtool version is less that VERSION.
11971bedbe3fSmrgm4_defun([LT_PREREQ],
11981bedbe3fSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
11991bedbe3fSmrg       [m4_default([$3],
12001bedbe3fSmrg		   [m4_fatal([Libtool version $1 or higher is required],
12011bedbe3fSmrg		             63)])],
12021bedbe3fSmrg       [$2])])
1203ba6a1819Smrg
1204ba6a1819Smrg
12051bedbe3fSmrg# _LT_CHECK_BUILDDIR
12061bedbe3fSmrg# ------------------
12071bedbe3fSmrg# Complain if the absolute build directory name contains unusual characters
12081bedbe3fSmrgm4_defun([_LT_CHECK_BUILDDIR],
12091bedbe3fSmrg[case `pwd` in
12101bedbe3fSmrg  *\ * | *\	*)
12111bedbe3fSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
12121bedbe3fSmrgesac
12131bedbe3fSmrg])
1214ba6a1819Smrg
1215ba6a1819Smrg
12161bedbe3fSmrg# LT_INIT([OPTIONS])
12171bedbe3fSmrg# ------------------
12181bedbe3fSmrgAC_DEFUN([LT_INIT],
12191bedbe3fSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
12201bedbe3fSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
12211bedbe3fSmrgAC_BEFORE([$0], [LT_LANG])dnl
12221bedbe3fSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
12231bedbe3fSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
12241bedbe3fSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
1225ba6a1819Smrg
12261bedbe3fSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
12271bedbe3fSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
12281bedbe3fSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
12291bedbe3fSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
12301bedbe3fSmrgdnl unless we require an AC_DEFUNed macro:
12311bedbe3fSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
12321bedbe3fSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
12331bedbe3fSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
12341bedbe3fSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
12351bedbe3fSmrgm4_require([_LT_PROG_LTMAIN])dnl
1236ba6a1819Smrg
12371bedbe3fSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1238ba6a1819Smrg
12391bedbe3fSmrgdnl Parse OPTIONS
12401bedbe3fSmrg_LT_SET_OPTIONS([$0], [$1])
1241ba6a1819Smrg
12421bedbe3fSmrg# This can be used to rebuild libtool when needed
12431bedbe3fSmrgLIBTOOL_DEPS="$ltmain"
1244ba6a1819Smrg
12451bedbe3fSmrg# Always use our own libtool.
12461bedbe3fSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
12471bedbe3fSmrgAC_SUBST(LIBTOOL)dnl
1248ba6a1819Smrg
12491bedbe3fSmrg_LT_SETUP
1250ba6a1819Smrg
12511bedbe3fSmrg# Only expand once:
12521bedbe3fSmrgm4_define([LT_INIT])
12531bedbe3fSmrg])# LT_INIT
1254ba6a1819Smrg
12551bedbe3fSmrg# Old names:
12561bedbe3fSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
12571bedbe3fSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
12581bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
12591bedbe3fSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
12601bedbe3fSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1261ba6a1819Smrg
1262ba6a1819Smrg
12631bedbe3fSmrg# _LT_CC_BASENAME(CC)
1264549e21daSmrg# -------------------
12651bedbe3fSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
12661bedbe3fSmrgm4_defun([_LT_CC_BASENAME],
12671bedbe3fSmrg[for cc_temp in $1""; do
12681bedbe3fSmrg  case $cc_temp in
12691bedbe3fSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
12701bedbe3fSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
12711bedbe3fSmrg    \-*) ;;
12721bedbe3fSmrg    *) break;;
12731bedbe3fSmrg  esac
12741bedbe3fSmrgdone
12751bedbe3fSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
12761bedbe3fSmrg])
1277ba6a1819Smrg
1278ba6a1819Smrg
12791bedbe3fSmrg# _LT_FILEUTILS_DEFAULTS
12801bedbe3fSmrg# ----------------------
12811bedbe3fSmrg# It is okay to use these file commands and assume they have been set
12821bedbe3fSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
12831bedbe3fSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
12841bedbe3fSmrg[: ${CP="cp -f"}
12851bedbe3fSmrg: ${MV="mv -f"}
12861bedbe3fSmrg: ${RM="rm -f"}
12871bedbe3fSmrg])# _LT_FILEUTILS_DEFAULTS
1288ba6a1819Smrg
1289ba6a1819Smrg
12901bedbe3fSmrg# _LT_SETUP
12911bedbe3fSmrg# ---------
12921bedbe3fSmrgm4_defun([_LT_SETUP],
12931bedbe3fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
12941bedbe3fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
12951bedbe3fSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
12961bedbe3fSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1297ba6a1819Smrg
12981bedbe3fSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
12991bedbe3fSmrgdnl
13001bedbe3fSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
13011bedbe3fSmrg_LT_DECL([], [host], [0])dnl
13021bedbe3fSmrg_LT_DECL([], [host_os], [0])dnl
13031bedbe3fSmrgdnl
13041bedbe3fSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
13051bedbe3fSmrg_LT_DECL([], [build], [0])dnl
13061bedbe3fSmrg_LT_DECL([], [build_os], [0])dnl
13071bedbe3fSmrgdnl
13081bedbe3fSmrgAC_REQUIRE([AC_PROG_CC])dnl
13091bedbe3fSmrgAC_REQUIRE([LT_PATH_LD])dnl
13101bedbe3fSmrgAC_REQUIRE([LT_PATH_NM])dnl
13111bedbe3fSmrgdnl
13121bedbe3fSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
13131bedbe3fSmrgtest -z "$LN_S" && LN_S="ln -s"
13141bedbe3fSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
13151bedbe3fSmrgdnl
13161bedbe3fSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
13171bedbe3fSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
13181bedbe3fSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
13191bedbe3fSmrgdnl
13201bedbe3fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
13211bedbe3fSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
13221bedbe3fSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
13231bedbe3fSmrgm4_require([_LT_CMD_RELOAD])dnl
13241bedbe3fSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
13251bedbe3fSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
13261bedbe3fSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
13271bedbe3fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
13281bedbe3fSmrgm4_require([_LT_WITH_SYSROOT])dnl
1329ba6a1819Smrg
13301bedbe3fSmrg_LT_CONFIG_LIBTOOL_INIT([
13311bedbe3fSmrg# See if we are running on zsh, and set the options which allow our
13321bedbe3fSmrg# commands through without removal of \ escapes INIT.
13331bedbe3fSmrgif test -n "\${ZSH_VERSION+set}" ; then
13341bedbe3fSmrg   setopt NO_GLOB_SUBST
13351bedbe3fSmrgfi
13361bedbe3fSmrg])
13371bedbe3fSmrgif test -n "${ZSH_VERSION+set}" ; then
13381bedbe3fSmrg   setopt NO_GLOB_SUBST
1339ba6a1819Smrgfi
1340ba6a1819Smrg
13411bedbe3fSmrg_LT_CHECK_OBJDIR
1342ba6a1819Smrg
13431bedbe3fSmrgm4_require([_LT_TAG_COMPILER])dnl
1344ba6a1819Smrg
13451bedbe3fSmrgcase $host_os in
13461bedbe3fSmrgaix3*)
13471bedbe3fSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
13481bedbe3fSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
13491bedbe3fSmrg  # vanish in a puff of smoke.
13501bedbe3fSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
13511bedbe3fSmrg    COLLECT_NAMES=
13521bedbe3fSmrg    export COLLECT_NAMES
13531bedbe3fSmrg  fi
13541bedbe3fSmrg  ;;
13551bedbe3fSmrgesac
1356ba6a1819Smrg
13571bedbe3fSmrg# Global variables:
13581bedbe3fSmrgofile=libtool
13591bedbe3fSmrgcan_build_shared=yes
1360ba6a1819Smrg
13611bedbe3fSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
13621bedbe3fSmrg# which needs '.lib').
13631bedbe3fSmrglibext=a
1364ba6a1819Smrg
13651bedbe3fSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1366ba6a1819Smrg
13671bedbe3fSmrgold_CC="$CC"
13681bedbe3fSmrgold_CFLAGS="$CFLAGS"
1369ba6a1819Smrg
13701bedbe3fSmrg# Set sane defaults for various variables
13711bedbe3fSmrgtest -z "$CC" && CC=cc
13721bedbe3fSmrgtest -z "$LTCC" && LTCC=$CC
13731bedbe3fSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
13741bedbe3fSmrgtest -z "$LD" && LD=ld
13751bedbe3fSmrgtest -z "$ac_objext" && ac_objext=o
1376ba6a1819Smrg
13771bedbe3fSmrg_LT_CC_BASENAME([$compiler])
1378ba6a1819Smrg
13791bedbe3fSmrg# Only perform the check for file, if the check method requires it
13801bedbe3fSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
13811bedbe3fSmrgcase $deplibs_check_method in
13821bedbe3fSmrgfile_magic*)
13831bedbe3fSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
13841bedbe3fSmrg    _LT_PATH_MAGIC
13851bedbe3fSmrg  fi
13861bedbe3fSmrg  ;;
13871bedbe3fSmrgesac
1388ba6a1819Smrg
13891bedbe3fSmrg# Use C for the default configuration in the libtool script
13901bedbe3fSmrgLT_SUPPORTED_TAG([CC])
13911bedbe3fSmrg_LT_LANG_C_CONFIG
13921bedbe3fSmrg_LT_LANG_DEFAULT_CONFIG
13931bedbe3fSmrg_LT_CONFIG_COMMANDS
13941bedbe3fSmrg])# _LT_SETUP
1395549e21daSmrg
1396549e21daSmrg
13971bedbe3fSmrg# _LT_PREPARE_SED_QUOTE_VARS
13981bedbe3fSmrg# --------------------------
13991bedbe3fSmrg# Define a few sed substitution that help us do robust quoting.
14001bedbe3fSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
14011bedbe3fSmrg[# Backslashify metacharacters that are still active within
14021bedbe3fSmrg# double-quoted strings.
14031bedbe3fSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1404549e21daSmrg
14051bedbe3fSmrg# Same as above, but do not quote variable references.
14061bedbe3fSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
1407549e21daSmrg
14081bedbe3fSmrg# Sed substitution to delay expansion of an escaped shell variable in a
14091bedbe3fSmrg# double_quote_subst'ed string.
14101bedbe3fSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1411ba6a1819Smrg
14121bedbe3fSmrg# Sed substitution to delay expansion of an escaped single quote.
14131bedbe3fSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1414549e21daSmrg
14151bedbe3fSmrg# Sed substitution to avoid accidental globbing in evaled expressions
14161bedbe3fSmrgno_glob_subst='s/\*/\\\*/g'
14171bedbe3fSmrg])
1418549e21daSmrg
14191bedbe3fSmrg# _LT_PROG_LTMAIN
14201bedbe3fSmrg# ---------------
14211bedbe3fSmrg# Note that this code is called both from `configure', and `config.status'
14221bedbe3fSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
14231bedbe3fSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
14241bedbe3fSmrg# so we pass a copy along to make sure it has a sensible value anyway.
14251bedbe3fSmrgm4_defun([_LT_PROG_LTMAIN],
14261bedbe3fSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
14271bedbe3fSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
14281bedbe3fSmrgltmain="$ac_aux_dir/ltmain.sh"
14291bedbe3fSmrg])# _LT_PROG_LTMAIN
1430549e21daSmrg
1431ba6a1819Smrg
1432549e21daSmrg
14331bedbe3fSmrg# So that we can recreate a full libtool script including additional
14341bedbe3fSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
14351bedbe3fSmrg# in macros and then make a single call at the end using the `libtool'
14361bedbe3fSmrg# label.
1437ba6a1819Smrg
1438549e21daSmrg
14391bedbe3fSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
14401bedbe3fSmrg# ----------------------------------------
14411bedbe3fSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
14421bedbe3fSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
14431bedbe3fSmrg[m4_ifval([$1],
14441bedbe3fSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
14451bedbe3fSmrg                     [$1
14461bedbe3fSmrg])])])
1447549e21daSmrg
14481bedbe3fSmrg# Initialize.
14491bedbe3fSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
1450ba6a1819Smrg
1451ba6a1819Smrg
14521bedbe3fSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
14531bedbe3fSmrg# ------------------------------
14541bedbe3fSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
14551bedbe3fSmrgm4_define([_LT_CONFIG_LIBTOOL],
14561bedbe3fSmrg[m4_ifval([$1],
14571bedbe3fSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
14581bedbe3fSmrg                     [$1
14591bedbe3fSmrg])])])
1460ba6a1819Smrg
14611bedbe3fSmrg# Initialize.
14621bedbe3fSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1463549e21daSmrg
1464ba6a1819Smrg
14651bedbe3fSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
14661bedbe3fSmrg# -----------------------------------------------------
14671bedbe3fSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
14681bedbe3fSmrg[_LT_CONFIG_LIBTOOL([$1])
14691bedbe3fSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
14701bedbe3fSmrg])
1471549e21daSmrg
1472ba6a1819Smrg
14731bedbe3fSmrg# _LT_FORMAT_COMMENT([COMMENT])
14741bedbe3fSmrg# -----------------------------
14751bedbe3fSmrg# Add leading comment marks to the start of each line, and a trailing
14761bedbe3fSmrg# full-stop to the whole comment if one is not present already.
14771bedbe3fSmrgm4_define([_LT_FORMAT_COMMENT],
14781bedbe3fSmrg[m4_ifval([$1], [
14791bedbe3fSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
14801bedbe3fSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
14811bedbe3fSmrg)])
1482549e21daSmrg
1483549e21daSmrg
1484ba6a1819Smrg
1485ba6a1819Smrg
1486ba6a1819Smrg
14871bedbe3fSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
14881bedbe3fSmrg# -------------------------------------------------------------------
14891bedbe3fSmrg# CONFIGNAME is the name given to the value in the libtool script.
14901bedbe3fSmrg# VARNAME is the (base) name used in the configure script.
14911bedbe3fSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
14921bedbe3fSmrg# VARNAME.  Any other value will be used directly.
14931bedbe3fSmrgm4_define([_LT_DECL],
14941bedbe3fSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
14951bedbe3fSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
14961bedbe3fSmrg	[m4_ifval([$1], [$1], [$2])])
14971bedbe3fSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
14981bedbe3fSmrg    m4_ifval([$4],
14991bedbe3fSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
15001bedbe3fSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
15011bedbe3fSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
15021bedbe3fSmrg])
1503ba6a1819Smrg
1504ba6a1819Smrg
15051bedbe3fSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
15061bedbe3fSmrg# --------------------------------------------------------
15071bedbe3fSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1508ba6a1819Smrg
1509549e21daSmrg
15101bedbe3fSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
15111bedbe3fSmrg# ------------------------------------------------
15121bedbe3fSmrgm4_define([lt_decl_tag_varnames],
15131bedbe3fSmrg[_lt_decl_filter([tagged?], [yes], $@)])
1514549e21daSmrg
1515549e21daSmrg
15161bedbe3fSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
15171bedbe3fSmrg# ---------------------------------------------------------
15181bedbe3fSmrgm4_define([_lt_decl_filter],
15191bedbe3fSmrg[m4_case([$#],
15201bedbe3fSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
15211bedbe3fSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
15221bedbe3fSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
15231bedbe3fSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
15241bedbe3fSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
15251bedbe3fSmrg])
1526ba6a1819Smrg
1527ba6a1819Smrg
15281bedbe3fSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
15291bedbe3fSmrg# --------------------------------------------------
15301bedbe3fSmrgm4_define([lt_decl_quote_varnames],
15311bedbe3fSmrg[_lt_decl_filter([value], [1], $@)])
1532ba6a1819Smrg
1533ba6a1819Smrg
15341bedbe3fSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
15351bedbe3fSmrg# ---------------------------------------------------
15361bedbe3fSmrgm4_define([lt_decl_dquote_varnames],
15371bedbe3fSmrg[_lt_decl_filter([value], [2], $@)])
1538549e21daSmrg
1539549e21daSmrg
15401bedbe3fSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
15411bedbe3fSmrg# ---------------------------------------------------
15421bedbe3fSmrgm4_define([lt_decl_varnames_tagged],
15431bedbe3fSmrg[m4_assert([$# <= 2])dnl
15441bedbe3fSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
15451bedbe3fSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
15461bedbe3fSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
15471bedbe3fSmrgm4_define([_lt_decl_varnames_tagged],
15481bedbe3fSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1549ba6a1819Smrg
1550ba6a1819Smrg
15511bedbe3fSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
15521bedbe3fSmrg# ------------------------------------------------
15531bedbe3fSmrgm4_define([lt_decl_all_varnames],
15541bedbe3fSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
15551bedbe3fSmrg     m4_if([$2], [],
15561bedbe3fSmrg	   m4_quote(lt_decl_varnames),
15571bedbe3fSmrg	m4_quote(m4_shift($@))))[]dnl
15581bedbe3fSmrg])
15591bedbe3fSmrgm4_define([_lt_decl_all_varnames],
15601bedbe3fSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
15611bedbe3fSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
15621bedbe3fSmrg])
1563549e21daSmrg
1564549e21daSmrg
15651bedbe3fSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
15661bedbe3fSmrg# ------------------------------------
15671bedbe3fSmrg# Quote a variable value, and forward it to `config.status' so that its
15681bedbe3fSmrg# declaration there will have the same value as in `configure'.  VARNAME
15691bedbe3fSmrg# must have a single quote delimited value for this to work.
15701bedbe3fSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
15711bedbe3fSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1572549e21daSmrg
1573549e21daSmrg
15741bedbe3fSmrg# _LT_CONFIG_STATUS_DECLARATIONS
15751bedbe3fSmrg# ------------------------------
15761bedbe3fSmrg# We delimit libtool config variables with single quotes, so when
15771bedbe3fSmrg# we write them to config.status, we have to be sure to quote all
15781bedbe3fSmrg# embedded single quotes properly.  In configure, this macro expands
15791bedbe3fSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1580549e21daSmrg#
15811bedbe3fSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
15821bedbe3fSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
15831bedbe3fSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
15841bedbe3fSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1585ba6a1819Smrg
1586ba6a1819Smrg
15871bedbe3fSmrg# _LT_LIBTOOL_TAGS
15882d8abe4fSmrg# ----------------
15891bedbe3fSmrg# Output comment and list of tags supported by the script
15901bedbe3fSmrgm4_defun([_LT_LIBTOOL_TAGS],
15911bedbe3fSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
15921bedbe3fSmrgavailable_tags="_LT_TAGS"dnl
15931bedbe3fSmrg])
15942d8abe4fSmrg
1595ba6a1819Smrg
15961bedbe3fSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
15971bedbe3fSmrg# -----------------------------------
15981bedbe3fSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
15991bedbe3fSmrg# expand to a commented shell variable setting:
16001bedbe3fSmrg#
16011bedbe3fSmrg#    # Some comment about what VAR is for.
16021bedbe3fSmrg#    visible_name=$lt_internal_name
16031bedbe3fSmrgm4_define([_LT_LIBTOOL_DECLARE],
16041bedbe3fSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
16051bedbe3fSmrg					   [description])))[]dnl
16061bedbe3fSmrgm4_pushdef([_libtool_name],
16071bedbe3fSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
16081bedbe3fSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
16091bedbe3fSmrg    [0], [_libtool_name=[$]$1],
16101bedbe3fSmrg    [1], [_libtool_name=$lt_[]$1],
16111bedbe3fSmrg    [2], [_libtool_name=$lt_[]$1],
16121bedbe3fSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
16131bedbe3fSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
16141bedbe3fSmrg])
1615ba6a1819Smrg
1616ba6a1819Smrg
16171bedbe3fSmrg# _LT_LIBTOOL_CONFIG_VARS
16181bedbe3fSmrg# -----------------------
16191bedbe3fSmrg# Produce commented declarations of non-tagged libtool config variables
16201bedbe3fSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
16211bedbe3fSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
16221bedbe3fSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
16231bedbe3fSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
16241bedbe3fSmrg[m4_foreach([_lt_var],
16251bedbe3fSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
16261bedbe3fSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1627ba6a1819Smrg
1628ba6a1819Smrg
16291bedbe3fSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
1630ba6a1819Smrg# -------------------------
16311bedbe3fSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
16321bedbe3fSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
16331bedbe3fSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1634ba6a1819Smrg
1635ba6a1819Smrg
16361bedbe3fSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
16371bedbe3fSmrg# ------------------------------
16381bedbe3fSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1639549e21daSmrg
1640549e21daSmrg
16411bedbe3fSmrg# _LT_CONFIG_COMMANDS
16421bedbe3fSmrg# -------------------
16431bedbe3fSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
16441bedbe3fSmrg# variables for single and double quote escaping we saved from calls
16451bedbe3fSmrg# to _LT_DECL, we can put quote escaped variables declarations
16461bedbe3fSmrg# into `config.status', and then the shell code to quote escape them in
16471bedbe3fSmrg# for loops in `config.status'.  Finally, any additional code accumulated
16481bedbe3fSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
16491bedbe3fSmrgm4_defun([_LT_CONFIG_COMMANDS],
16501bedbe3fSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
16511bedbe3fSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
16521bedbe3fSmrg	dnl instead of duplicating it all over again into config.status,
16531bedbe3fSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
16541bedbe3fSmrg	dnl needs to know what name is stored there:
16551bedbe3fSmrg        [AC_CONFIG_COMMANDS([libtool],
16561bedbe3fSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
16571bedbe3fSmrg    dnl If the libtool generation code is destined for config.status,
16581bedbe3fSmrg    dnl expand the accumulated commands and init code now:
16591bedbe3fSmrg    [AC_CONFIG_COMMANDS([libtool],
16601bedbe3fSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
16611bedbe3fSmrg])#_LT_CONFIG_COMMANDS
1662549e21daSmrg
1663549e21daSmrg
16641bedbe3fSmrg# Initialize.
16651bedbe3fSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
16661bedbe3fSmrg[
1667549e21daSmrg
16681bedbe3fSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
16691bedbe3fSmrg# if CDPATH is set.
16701bedbe3fSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1671549e21daSmrg
16721bedbe3fSmrgsed_quote_subst='$sed_quote_subst'
16731bedbe3fSmrgdouble_quote_subst='$double_quote_subst'
16741bedbe3fSmrgdelay_variable_subst='$delay_variable_subst'
16751bedbe3fSmrg_LT_CONFIG_STATUS_DECLARATIONS
16761bedbe3fSmrgLTCC='$LTCC'
16771bedbe3fSmrgLTCFLAGS='$LTCFLAGS'
16781bedbe3fSmrgcompiler='$compiler_DEFAULT'
1679549e21daSmrg
16801bedbe3fSmrg# A function that is used when there is no print builtin or printf.
16811bedbe3fSmrgfunc_fallback_echo ()
16821bedbe3fSmrg{
16831bedbe3fSmrg  eval 'cat <<_LTECHO_EOF
16841bedbe3fSmrg\$[]1
16851bedbe3fSmrg_LTECHO_EOF'
16861bedbe3fSmrg}
1687549e21daSmrg
16881bedbe3fSmrg# Quote evaled strings.
16891bedbe3fSmrgfor var in lt_decl_all_varnames([[ \
16901bedbe3fSmrg]], lt_decl_quote_varnames); do
16911bedbe3fSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
16921bedbe3fSmrg    *[[\\\\\\\`\\"\\\$]]*)
16931bedbe3fSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
16941bedbe3fSmrg      ;;
16951bedbe3fSmrg    *)
16961bedbe3fSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
16971bedbe3fSmrg      ;;
16981bedbe3fSmrg    esac
16991bedbe3fSmrgdone
1700549e21daSmrg
17011bedbe3fSmrg# Double-quote double-evaled strings.
17021bedbe3fSmrgfor var in lt_decl_all_varnames([[ \
17031bedbe3fSmrg]], lt_decl_dquote_varnames); do
17041bedbe3fSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
17051bedbe3fSmrg    *[[\\\\\\\`\\"\\\$]]*)
17061bedbe3fSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
17071bedbe3fSmrg      ;;
17081bedbe3fSmrg    *)
17091bedbe3fSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
17101bedbe3fSmrg      ;;
17111bedbe3fSmrg    esac
17121bedbe3fSmrgdone
1713549e21daSmrg
17141bedbe3fSmrg_LT_OUTPUT_LIBTOOL_INIT
17151bedbe3fSmrg])
1716549e21daSmrg
17171bedbe3fSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
17181bedbe3fSmrg# ------------------------------------
17191bedbe3fSmrg# Generate a child script FILE with all initialization necessary to
17201bedbe3fSmrg# reuse the environment learned by the parent script, and make the
17211bedbe3fSmrg# file executable.  If COMMENT is supplied, it is inserted after the
17221bedbe3fSmrg# `#!' sequence but before initialization text begins.  After this
17231bedbe3fSmrg# macro, additional text can be appended to FILE to form the body of
17241bedbe3fSmrg# the child script.  The macro ends with non-zero status if the
17251bedbe3fSmrg# file could not be fully written (such as if the disk is full).
17261bedbe3fSmrgm4_ifdef([AS_INIT_GENERATED],
17271bedbe3fSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
17281bedbe3fSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
17291bedbe3fSmrg[m4_require([AS_PREPARE])]dnl
17301bedbe3fSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
17311bedbe3fSmrg[lt_write_fail=0
17321bedbe3fSmrgcat >$1 <<_ASEOF || lt_write_fail=1
17331bedbe3fSmrg#! $SHELL
17341bedbe3fSmrg# Generated by $as_me.
17351bedbe3fSmrg$2
17361bedbe3fSmrgSHELL=\${CONFIG_SHELL-$SHELL}
17371bedbe3fSmrgexport SHELL
17381bedbe3fSmrg_ASEOF
17391bedbe3fSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
17401bedbe3fSmrgAS_SHELL_SANITIZE
17411bedbe3fSmrg_AS_PREPARE
17421bedbe3fSmrgexec AS_MESSAGE_FD>&1
17431bedbe3fSmrg_ASEOF
17441bedbe3fSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
17451bedbe3fSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1746549e21daSmrg
17471bedbe3fSmrg# LT_OUTPUT
17481bedbe3fSmrg# ---------
17491bedbe3fSmrg# This macro allows early generation of the libtool script (before
17501bedbe3fSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
17511bedbe3fSmrg# tests.
17521bedbe3fSmrgAC_DEFUN([LT_OUTPUT],
17531bedbe3fSmrg[: ${CONFIG_LT=./config.lt}
17541bedbe3fSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
17551bedbe3fSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
17561bedbe3fSmrg[# Run this file to recreate a libtool stub with the current configuration.])
1757549e21daSmrg
17581bedbe3fSmrgcat >>"$CONFIG_LT" <<\_LTEOF
17591bedbe3fSmrglt_cl_silent=false
17601bedbe3fSmrgexec AS_MESSAGE_LOG_FD>>config.log
17611bedbe3fSmrg{
17621bedbe3fSmrg  echo
17631bedbe3fSmrg  AS_BOX([Running $as_me.])
17641bedbe3fSmrg} >&AS_MESSAGE_LOG_FD
1765549e21daSmrg
17661bedbe3fSmrglt_cl_help="\
17671bedbe3fSmrg\`$as_me' creates a local libtool stub from the current configuration,
17681bedbe3fSmrgfor use in further configure time tests before the real libtool is
17691bedbe3fSmrggenerated.
1770549e21daSmrg
17711bedbe3fSmrgUsage: $[0] [[OPTIONS]]
1772549e21daSmrg
17731bedbe3fSmrg  -h, --help      print this help, then exit
17741bedbe3fSmrg  -V, --version   print version number, then exit
17751bedbe3fSmrg  -q, --quiet     do not print progress messages
17761bedbe3fSmrg  -d, --debug     don't remove temporary files
1777549e21daSmrg
17781bedbe3fSmrgReport bugs to <bug-libtool@gnu.org>."
1779549e21daSmrg
17801bedbe3fSmrglt_cl_version="\
17811bedbe3fSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
17821bedbe3fSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
17831bedbe3fSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
1784549e21daSmrg
17851bedbe3fSmrgCopyright (C) 2011 Free Software Foundation, Inc.
17861bedbe3fSmrgThis config.lt script is free software; the Free Software Foundation
17871bedbe3fSmrggives unlimited permision to copy, distribute and modify it."
1788549e21daSmrg
17891bedbe3fSmrgwhile test $[#] != 0
17901bedbe3fSmrgdo
17911bedbe3fSmrg  case $[1] in
17921bedbe3fSmrg    --version | --v* | -V )
17931bedbe3fSmrg      echo "$lt_cl_version"; exit 0 ;;
17941bedbe3fSmrg    --help | --h* | -h )
17951bedbe3fSmrg      echo "$lt_cl_help"; exit 0 ;;
17961bedbe3fSmrg    --debug | --d* | -d )
17971bedbe3fSmrg      debug=: ;;
17981bedbe3fSmrg    --quiet | --q* | --silent | --s* | -q )
17991bedbe3fSmrg      lt_cl_silent=: ;;
1800549e21daSmrg
18011bedbe3fSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
18021bedbe3fSmrgTry \`$[0] --help' for more information.]) ;;
1803549e21daSmrg
18041bedbe3fSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
18051bedbe3fSmrgTry \`$[0] --help' for more information.]) ;;
18061bedbe3fSmrg  esac
18071bedbe3fSmrg  shift
18081bedbe3fSmrgdone
1809549e21daSmrg
18101bedbe3fSmrgif $lt_cl_silent; then
18111bedbe3fSmrg  exec AS_MESSAGE_FD>/dev/null
18121bedbe3fSmrgfi
18131bedbe3fSmrg_LTEOF
1814549e21daSmrg
18151bedbe3fSmrgcat >>"$CONFIG_LT" <<_LTEOF
18161bedbe3fSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
18171bedbe3fSmrg_LTEOF
1818549e21daSmrg
18191bedbe3fSmrgcat >>"$CONFIG_LT" <<\_LTEOF
18201bedbe3fSmrgAC_MSG_NOTICE([creating $ofile])
18211bedbe3fSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
18221bedbe3fSmrgAS_EXIT(0)
18231bedbe3fSmrg_LTEOF
18241bedbe3fSmrgchmod +x "$CONFIG_LT"
1825549e21daSmrg
18261bedbe3fSmrg# configure is writing to config.log, but config.lt does its own redirection,
18271bedbe3fSmrg# appending to config.log, which fails on DOS, as config.log is still kept
18281bedbe3fSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
18291bedbe3fSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
18301bedbe3fSmrglt_cl_success=:
18311bedbe3fSmrgtest "$silent" = yes &&
18321bedbe3fSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
18331bedbe3fSmrgexec AS_MESSAGE_LOG_FD>/dev/null
18341bedbe3fSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
18351bedbe3fSmrgexec AS_MESSAGE_LOG_FD>>config.log
18361bedbe3fSmrg$lt_cl_success || AS_EXIT(1)
18371bedbe3fSmrg])# LT_OUTPUT
1838549e21daSmrg
1839549e21daSmrg
18401bedbe3fSmrg# _LT_CONFIG(TAG)
18411bedbe3fSmrg# ---------------
18421bedbe3fSmrg# If TAG is the built-in tag, create an initial libtool script with a
18431bedbe3fSmrg# default configuration from the untagged config vars.  Otherwise add code
18441bedbe3fSmrg# to config.status for appending the configuration named by TAG from the
18451bedbe3fSmrg# matching tagged config vars.
18461bedbe3fSmrgm4_defun([_LT_CONFIG],
18471bedbe3fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
18481bedbe3fSmrg_LT_CONFIG_SAVE_COMMANDS([
18491bedbe3fSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
18501bedbe3fSmrg  m4_if(_LT_TAG, [C], [
18511bedbe3fSmrg    # See if we are running on zsh, and set the options which allow our
18521bedbe3fSmrg    # commands through without removal of \ escapes.
18531bedbe3fSmrg    if test -n "${ZSH_VERSION+set}" ; then
18541bedbe3fSmrg      setopt NO_GLOB_SUBST
18551bedbe3fSmrg    fi
1856549e21daSmrg
18571bedbe3fSmrg    cfgfile="${ofile}T"
18581bedbe3fSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
18591bedbe3fSmrg    $RM "$cfgfile"
1860549e21daSmrg
18611bedbe3fSmrg    cat <<_LT_EOF >> "$cfgfile"
18621bedbe3fSmrg#! $SHELL
1863549e21daSmrg
18641bedbe3fSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
18651bedbe3fSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
18661bedbe3fSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
18671bedbe3fSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
18681bedbe3fSmrg#
18691bedbe3fSmrg_LT_COPYING
18701bedbe3fSmrg_LT_LIBTOOL_TAGS
1871ba6a1819Smrg
18721bedbe3fSmrg# ### BEGIN LIBTOOL CONFIG
18731bedbe3fSmrg_LT_LIBTOOL_CONFIG_VARS
18741bedbe3fSmrg_LT_LIBTOOL_TAG_VARS
18751bedbe3fSmrg# ### END LIBTOOL CONFIG
1876ba6a1819Smrg
18771bedbe3fSmrg_LT_EOF
1878ba6a1819Smrg
18791bedbe3fSmrg  case $host_os in
18801bedbe3fSmrg  aix3*)
18811bedbe3fSmrg    cat <<\_LT_EOF >> "$cfgfile"
18821bedbe3fSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
18831bedbe3fSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
18841bedbe3fSmrg# vanish in a puff of smoke.
18851bedbe3fSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
18861bedbe3fSmrg  COLLECT_NAMES=
18871bedbe3fSmrg  export COLLECT_NAMES
18881bedbe3fSmrgfi
18891bedbe3fSmrg_LT_EOF
18901bedbe3fSmrg    ;;
1891549e21daSmrg  esac
1892549e21daSmrg
18931bedbe3fSmrg  _LT_PROG_LTMAIN
1894549e21daSmrg
18951bedbe3fSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
18961bedbe3fSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
18971bedbe3fSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
18981bedbe3fSmrg  # is reportedly fixed, but why not run on old versions too?
18991bedbe3fSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
19001bedbe3fSmrg     || (rm -f "$cfgfile"; exit 1)
1901549e21daSmrg
19021bedbe3fSmrg  _LT_PROG_REPLACE_SHELLFNS
1903ba6a1819Smrg
19041bedbe3fSmrg   mv -f "$cfgfile" "$ofile" ||
19051bedbe3fSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
19061bedbe3fSmrg  chmod +x "$ofile"
19071bedbe3fSmrg],
19081bedbe3fSmrg[cat <<_LT_EOF >> "$ofile"
1909549e21daSmrg
19101bedbe3fSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
19111bedbe3fSmrgdnl in a comment (ie after a #).
19121bedbe3fSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
19131bedbe3fSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
19141bedbe3fSmrg# ### END LIBTOOL TAG CONFIG: $1
19151bedbe3fSmrg_LT_EOF
19161bedbe3fSmrg])dnl /m4_if
19171bedbe3fSmrg],
19181bedbe3fSmrg[m4_if([$1], [], [
19191bedbe3fSmrg    PACKAGE='$PACKAGE'
19201bedbe3fSmrg    VERSION='$VERSION'
19211bedbe3fSmrg    TIMESTAMP='$TIMESTAMP'
19221bedbe3fSmrg    RM='$RM'
19231bedbe3fSmrg    ofile='$ofile'], [])
19241bedbe3fSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
19251bedbe3fSmrg])# _LT_CONFIG
1926ba6a1819Smrg
1927ba6a1819Smrg
19281bedbe3fSmrg# LT_SUPPORTED_TAG(TAG)
19291bedbe3fSmrg# ---------------------
19301bedbe3fSmrg# Trace this macro to discover what tags are supported by the libtool
19311bedbe3fSmrg# --tag option, using:
19321bedbe3fSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
19331bedbe3fSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
1934ba6a1819Smrg
1935ba6a1819Smrg
19361bedbe3fSmrg# C support is built-in for now
19371bedbe3fSmrgm4_define([_LT_LANG_C_enabled], [])
19381bedbe3fSmrgm4_define([_LT_TAGS], [])
1939ba6a1819Smrg
1940ba6a1819Smrg
19411bedbe3fSmrg# LT_LANG(LANG)
19421bedbe3fSmrg# -------------
19431bedbe3fSmrg# Enable libtool support for the given language if not already enabled.
19441bedbe3fSmrgAC_DEFUN([LT_LANG],
19451bedbe3fSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
19461bedbe3fSmrgm4_case([$1],
19471bedbe3fSmrg  [C],			[_LT_LANG(C)],
19481bedbe3fSmrg  [C++],		[_LT_LANG(CXX)],
19491bedbe3fSmrg  [Go],			[_LT_LANG(GO)],
19501bedbe3fSmrg  [Java],		[_LT_LANG(GCJ)],
19511bedbe3fSmrg  [Fortran 77],		[_LT_LANG(F77)],
19521bedbe3fSmrg  [Fortran],		[_LT_LANG(FC)],
19531bedbe3fSmrg  [Windows Resource],	[_LT_LANG(RC)],
19541bedbe3fSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
19551bedbe3fSmrg    [_LT_LANG($1)],
19561bedbe3fSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
19571bedbe3fSmrg])# LT_LANG
1958ba6a1819Smrg
1959ba6a1819Smrg
19601bedbe3fSmrg# _LT_LANG(LANGNAME)
19611bedbe3fSmrg# ------------------
19621bedbe3fSmrgm4_defun([_LT_LANG],
19631bedbe3fSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
19641bedbe3fSmrg  [LT_SUPPORTED_TAG([$1])dnl
19651bedbe3fSmrg  m4_append([_LT_TAGS], [$1 ])dnl
19661bedbe3fSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
19671bedbe3fSmrg  _LT_LANG_$1_CONFIG($1)])dnl
19681bedbe3fSmrg])# _LT_LANG
1969ba6a1819Smrg
1970ba6a1819Smrg
19711bedbe3fSmrgm4_ifndef([AC_PROG_GO], [
19721bedbe3fSmrg# NOTE: This macro has been submitted for inclusion into   #
19731bedbe3fSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
19741bedbe3fSmrg#  a released version of Autoconf we should remove this    #
19751bedbe3fSmrg#  macro and use it instead.                               #
19761bedbe3fSmrgm4_defun([AC_PROG_GO],
19771bedbe3fSmrg[AC_LANG_PUSH(Go)dnl
19781bedbe3fSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
19791bedbe3fSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
19801bedbe3fSmrg_AC_ARG_VAR_LDFLAGS()dnl
19811bedbe3fSmrgAC_CHECK_TOOL(GOC, gccgo)
19821bedbe3fSmrgif test -z "$GOC"; then
19831bedbe3fSmrg  if test -n "$ac_tool_prefix"; then
19841bedbe3fSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1985ba6a1819Smrg  fi
19861bedbe3fSmrgfi
19871bedbe3fSmrgif test -z "$GOC"; then
19881bedbe3fSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
19891bedbe3fSmrgfi
19901bedbe3fSmrg])#m4_defun
19911bedbe3fSmrg])#m4_ifndef
1992ba6a1819Smrg
1993ba6a1819Smrg
19941bedbe3fSmrg# _LT_LANG_DEFAULT_CONFIG
19951bedbe3fSmrg# -----------------------
19961bedbe3fSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
19971bedbe3fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
19981bedbe3fSmrg  [LT_LANG(CXX)],
19991bedbe3fSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
2000ba6a1819Smrg
20011bedbe3fSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
20021bedbe3fSmrg  [LT_LANG(F77)],
20031bedbe3fSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
2004ba6a1819Smrg
20051bedbe3fSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
20061bedbe3fSmrg  [LT_LANG(FC)],
20071bedbe3fSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
2008ba6a1819Smrg
20091bedbe3fSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
20101bedbe3fSmrgdnl pulling things in needlessly.
20111bedbe3fSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
20121bedbe3fSmrg  [LT_LANG(GCJ)],
20131bedbe3fSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
20141bedbe3fSmrg    [LT_LANG(GCJ)],
20151bedbe3fSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
20161bedbe3fSmrg      [LT_LANG(GCJ)],
20171bedbe3fSmrg      [m4_ifdef([AC_PROG_GCJ],
20181bedbe3fSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
20191bedbe3fSmrg       m4_ifdef([A][M_PROG_GCJ],
20201bedbe3fSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
20211bedbe3fSmrg       m4_ifdef([LT_PROG_GCJ],
20221bedbe3fSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
2023ba6a1819Smrg
20241bedbe3fSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
20251bedbe3fSmrg  [LT_LANG(GO)],
20261bedbe3fSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
2027ba6a1819Smrg
20281bedbe3fSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
20291bedbe3fSmrg  [LT_LANG(RC)],
20301bedbe3fSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
20311bedbe3fSmrg])# _LT_LANG_DEFAULT_CONFIG
2032ba6a1819Smrg
20331bedbe3fSmrg# Obsolete macros:
20341bedbe3fSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
20351bedbe3fSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
20361bedbe3fSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
20371bedbe3fSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
20381bedbe3fSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
20391bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
20401bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
20411bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
20421bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
20431bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
20441bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
2045549e21daSmrg
2046549e21daSmrg
20471bedbe3fSmrg# _LT_TAG_COMPILER
20481bedbe3fSmrg# ----------------
20491bedbe3fSmrgm4_defun([_LT_TAG_COMPILER],
20501bedbe3fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
2051549e21daSmrg
20521bedbe3fSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
20531bedbe3fSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
20541bedbe3fSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
20551bedbe3fSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
2056549e21daSmrg
20571bedbe3fSmrg# If no C compiler was specified, use CC.
20581bedbe3fSmrgLTCC=${LTCC-"$CC"}
2059549e21daSmrg
20601bedbe3fSmrg# If no C compiler flags were specified, use CFLAGS.
20611bedbe3fSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2062549e21daSmrg
20631bedbe3fSmrg# Allow CC to be a program name with arguments.
20641bedbe3fSmrgcompiler=$CC
20651bedbe3fSmrg])# _LT_TAG_COMPILER
2066549e21daSmrg
2067549e21daSmrg
20681bedbe3fSmrg# _LT_COMPILER_BOILERPLATE
20691bedbe3fSmrg# ------------------------
20701bedbe3fSmrg# Check for compiler boilerplate output or warnings with
20711bedbe3fSmrg# the simple compiler test code.
20721bedbe3fSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
20731bedbe3fSmrg[m4_require([_LT_DECL_SED])dnl
20741bedbe3fSmrgac_outfile=conftest.$ac_objext
20751bedbe3fSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
20761bedbe3fSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
20771bedbe3fSmrg_lt_compiler_boilerplate=`cat conftest.err`
20781bedbe3fSmrg$RM conftest*
20791bedbe3fSmrg])# _LT_COMPILER_BOILERPLATE
2080549e21daSmrg
2081549e21daSmrg
20821bedbe3fSmrg# _LT_LINKER_BOILERPLATE
20831bedbe3fSmrg# ----------------------
20841bedbe3fSmrg# Check for linker boilerplate output or warnings with
20851bedbe3fSmrg# the simple link test code.
20861bedbe3fSmrgm4_defun([_LT_LINKER_BOILERPLATE],
20871bedbe3fSmrg[m4_require([_LT_DECL_SED])dnl
20881bedbe3fSmrgac_outfile=conftest.$ac_objext
20891bedbe3fSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
20901bedbe3fSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
20911bedbe3fSmrg_lt_linker_boilerplate=`cat conftest.err`
20921bedbe3fSmrg$RM -r conftest*
20931bedbe3fSmrg])# _LT_LINKER_BOILERPLATE
2094549e21daSmrg
20951bedbe3fSmrg# _LT_REQUIRED_DARWIN_CHECKS
20961bedbe3fSmrg# -------------------------
20971bedbe3fSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
20981bedbe3fSmrg  case $host_os in
20991bedbe3fSmrg    rhapsody* | darwin*)
21001bedbe3fSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
21011bedbe3fSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
21021bedbe3fSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
21031bedbe3fSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
21041bedbe3fSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
21051bedbe3fSmrg    _LT_DECL([], [DSYMUTIL], [1],
21061bedbe3fSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
21071bedbe3fSmrg    _LT_DECL([], [NMEDIT], [1],
21081bedbe3fSmrg      [Tool to change global to local symbols on Mac OS X])
21091bedbe3fSmrg    _LT_DECL([], [LIPO], [1],
21101bedbe3fSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
21111bedbe3fSmrg    _LT_DECL([], [OTOOL], [1],
21121bedbe3fSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
21131bedbe3fSmrg    _LT_DECL([], [OTOOL64], [1],
21141bedbe3fSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2115549e21daSmrg
21161bedbe3fSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
21171bedbe3fSmrg      [lt_cv_apple_cc_single_mod=no
21181bedbe3fSmrg      if test -z "${LT_MULTI_MODULE}"; then
21191bedbe3fSmrg	# By default we will add the -single_module flag. You can override
21201bedbe3fSmrg	# by either setting the environment variable LT_MULTI_MODULE
21211bedbe3fSmrg	# non-empty at configure time, or by adding -multi_module to the
21221bedbe3fSmrg	# link flags.
21231bedbe3fSmrg	rm -rf libconftest.dylib*
21241bedbe3fSmrg	echo "int foo(void){return 1;}" > conftest.c
21251bedbe3fSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
21261bedbe3fSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
21271bedbe3fSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
21281bedbe3fSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
21291bedbe3fSmrg        _lt_result=$?
21301bedbe3fSmrg	# If there is a non-empty error log, and "single_module"
21311bedbe3fSmrg	# appears in it, assume the flag caused a linker warning
21321bedbe3fSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
21331bedbe3fSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
21341bedbe3fSmrg	# Otherwise, if the output was created with a 0 exit code from
21351bedbe3fSmrg	# the compiler, it worked.
21361bedbe3fSmrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
21371bedbe3fSmrg	  lt_cv_apple_cc_single_mod=yes
21381bedbe3fSmrg	else
21391bedbe3fSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
21401bedbe3fSmrg	fi
21411bedbe3fSmrg	rm -rf libconftest.dylib*
21421bedbe3fSmrg	rm -f conftest.*
21431bedbe3fSmrg      fi])
2144549e21daSmrg
21451bedbe3fSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
21461bedbe3fSmrg      [lt_cv_ld_exported_symbols_list],
21471bedbe3fSmrg      [lt_cv_ld_exported_symbols_list=no
21481bedbe3fSmrg      save_LDFLAGS=$LDFLAGS
21491bedbe3fSmrg      echo "_main" > conftest.sym
21501bedbe3fSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
21511bedbe3fSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
21521bedbe3fSmrg	[lt_cv_ld_exported_symbols_list=yes],
21531bedbe3fSmrg	[lt_cv_ld_exported_symbols_list=no])
21541bedbe3fSmrg	LDFLAGS="$save_LDFLAGS"
21551bedbe3fSmrg    ])
2156549e21daSmrg
21571bedbe3fSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
21581bedbe3fSmrg      [lt_cv_ld_force_load=no
21591bedbe3fSmrg      cat > conftest.c << _LT_EOF
21601bedbe3fSmrgint forced_loaded() { return 2;}
21611bedbe3fSmrg_LT_EOF
21621bedbe3fSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
21631bedbe3fSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
21641bedbe3fSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
21651bedbe3fSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
21661bedbe3fSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
21671bedbe3fSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
21681bedbe3fSmrg      cat > conftest.c << _LT_EOF
21691bedbe3fSmrgint main() { return 0;}
21701bedbe3fSmrg_LT_EOF
21711bedbe3fSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
21721bedbe3fSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
21731bedbe3fSmrg      _lt_result=$?
21741bedbe3fSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
21751bedbe3fSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
21761bedbe3fSmrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
21771bedbe3fSmrg	lt_cv_ld_force_load=yes
21781bedbe3fSmrg      else
21791bedbe3fSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
21801bedbe3fSmrg      fi
21811bedbe3fSmrg        rm -f conftest.err libconftest.a conftest conftest.c
21821bedbe3fSmrg        rm -rf conftest.dSYM
21831bedbe3fSmrg    ])
21841bedbe3fSmrg    case $host_os in
21851bedbe3fSmrg    rhapsody* | darwin1.[[012]])
21861bedbe3fSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
21871bedbe3fSmrg    darwin1.*)
21881bedbe3fSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
21891bedbe3fSmrg    darwin*) # darwin 5.x on
21901bedbe3fSmrg      # if running on 10.5 or later, the deployment target defaults
21911bedbe3fSmrg      # to the OS version, if on x86, and 10.4, the deployment
21921bedbe3fSmrg      # target defaults to 10.4. Don't you love it?
21931bedbe3fSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
21941bedbe3fSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
21951bedbe3fSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
21961bedbe3fSmrg	10.[[012]]*)
21971bedbe3fSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
21981bedbe3fSmrg	10.*)
21991bedbe3fSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
22001bedbe3fSmrg      esac
22011bedbe3fSmrg    ;;
22021bedbe3fSmrg  esac
22031bedbe3fSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
22041bedbe3fSmrg      _lt_dar_single_mod='$single_module'
22051bedbe3fSmrg    fi
22061bedbe3fSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
22071bedbe3fSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
22081bedbe3fSmrg    else
22091bedbe3fSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
22101bedbe3fSmrg    fi
22111bedbe3fSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
22121bedbe3fSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
22131bedbe3fSmrg    else
22141bedbe3fSmrg      _lt_dsymutil=
22151bedbe3fSmrg    fi
22161bedbe3fSmrg    ;;
22171bedbe3fSmrg  esac
2218549e21daSmrg])
2219549e21daSmrg
2220549e21daSmrg
22211bedbe3fSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
22221bedbe3fSmrg# ---------------------------------
22231bedbe3fSmrg# Checks for linker and compiler features on darwin
22241bedbe3fSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
22251bedbe3fSmrg[
22261bedbe3fSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
22271bedbe3fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
22281bedbe3fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
22291bedbe3fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
22301bedbe3fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
22311bedbe3fSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
22321bedbe3fSmrg    _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\"`'
22331bedbe3fSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
22341bedbe3fSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
22351bedbe3fSmrg  else
22361bedbe3fSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
22371bedbe3fSmrg  fi
22381bedbe3fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
22391bedbe3fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
22401bedbe3fSmrg  case $cc_basename in
22411bedbe3fSmrg     ifort*) _lt_dar_can_shared=yes ;;
22421bedbe3fSmrg     *) _lt_dar_can_shared=$GCC ;;
22431bedbe3fSmrg  esac
22441bedbe3fSmrg  if test "$_lt_dar_can_shared" = "yes"; then
22451bedbe3fSmrg    output_verbose_link_cmd=func_echo_all
22461bedbe3fSmrg    _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}"
22471bedbe3fSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
22481bedbe3fSmrg    _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}"
22491bedbe3fSmrg    _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}"
22501bedbe3fSmrg    m4_if([$1], [CXX],
22511bedbe3fSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
22521bedbe3fSmrg      _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}"
22531bedbe3fSmrg      _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}"
22541bedbe3fSmrg    fi
22551bedbe3fSmrg],[])
22561bedbe3fSmrg  else
22571bedbe3fSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
22581bedbe3fSmrg  fi
22591bedbe3fSmrg])
2260549e21daSmrg
22611bedbe3fSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
22621bedbe3fSmrg# ----------------------------------
22631bedbe3fSmrg# Links a minimal program and checks the executable
22641bedbe3fSmrg# for the system default hardcoded library path. In most cases,
22651bedbe3fSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
22661bedbe3fSmrg# the location of the communication and MPI libs are included too.
22671bedbe3fSmrg# If we don't find anything, use the default library path according
22681bedbe3fSmrg# to the aix ld manual.
22691bedbe3fSmrg# Store the results from the different compilers for each TAGNAME.
22701bedbe3fSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
22711bedbe3fSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
22721bedbe3fSmrg[m4_require([_LT_DECL_SED])dnl
22731bedbe3fSmrgif test "${lt_cv_aix_libpath+set}" = set; then
22741bedbe3fSmrg  aix_libpath=$lt_cv_aix_libpath
22751bedbe3fSmrgelse
22761bedbe3fSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
22771bedbe3fSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
22781bedbe3fSmrg  lt_aix_libpath_sed='[
22791bedbe3fSmrg      /Import File Strings/,/^$/ {
22801bedbe3fSmrg	  /^0/ {
22811bedbe3fSmrg	      s/^0  *\([^ ]*\) *$/\1/
22821bedbe3fSmrg	      p
22831bedbe3fSmrg	  }
22841bedbe3fSmrg      }]'
22851bedbe3fSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
22861bedbe3fSmrg  # Check for a 64-bit object if we didn't find anything.
22871bedbe3fSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
22881bedbe3fSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
22891bedbe3fSmrg  fi],[])
22901bedbe3fSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
22911bedbe3fSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
22921bedbe3fSmrg  fi
22931bedbe3fSmrg  ])
22941bedbe3fSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
22951bedbe3fSmrgfi
22961bedbe3fSmrg])# _LT_SYS_MODULE_PATH_AIX
2297549e21daSmrg
2298549e21daSmrg
22991bedbe3fSmrg# _LT_SHELL_INIT(ARG)
23001bedbe3fSmrg# -------------------
23011bedbe3fSmrgm4_define([_LT_SHELL_INIT],
23021bedbe3fSmrg[m4_divert_text([M4SH-INIT], [$1
23031bedbe3fSmrg])])# _LT_SHELL_INIT
2304549e21daSmrg
2305549e21daSmrg
2306549e21daSmrg
23071bedbe3fSmrg# _LT_PROG_ECHO_BACKSLASH
23081bedbe3fSmrg# -----------------------
23091bedbe3fSmrg# Find how we can fake an echo command that does not interpret backslash.
23101bedbe3fSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
23111bedbe3fSmrg# of the generated configure script which will find a shell with a builtin
23121bedbe3fSmrg# printf (which we can use as an echo command).
23131bedbe3fSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
23141bedbe3fSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
23151bedbe3fSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
23161bedbe3fSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2317549e21daSmrg
23181bedbe3fSmrgAC_MSG_CHECKING([how to print strings])
23191bedbe3fSmrg# Test print first, because it will be a builtin if present.
23201bedbe3fSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
23211bedbe3fSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
23221bedbe3fSmrg  ECHO='print -r --'
23231bedbe3fSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
23241bedbe3fSmrg  ECHO='printf %s\n'
23251bedbe3fSmrgelse
23261bedbe3fSmrg  # Use this function as a fallback that always works.
23271bedbe3fSmrg  func_fallback_echo ()
23281bedbe3fSmrg  {
23291bedbe3fSmrg    eval 'cat <<_LTECHO_EOF
23301bedbe3fSmrg$[]1
23311bedbe3fSmrg_LTECHO_EOF'
23321bedbe3fSmrg  }
23331bedbe3fSmrg  ECHO='func_fallback_echo'
23341bedbe3fSmrgfi
2335549e21daSmrg
23361bedbe3fSmrg# func_echo_all arg...
23371bedbe3fSmrg# Invoke $ECHO with all args, space-separated.
23381bedbe3fSmrgfunc_echo_all ()
23391bedbe3fSmrg{
23401bedbe3fSmrg    $ECHO "$*" 
23411bedbe3fSmrg}
2342549e21daSmrg
23431bedbe3fSmrgcase "$ECHO" in
23441bedbe3fSmrg  printf*) AC_MSG_RESULT([printf]) ;;
23451bedbe3fSmrg  print*) AC_MSG_RESULT([print -r]) ;;
23461bedbe3fSmrg  *) AC_MSG_RESULT([cat]) ;;
23471bedbe3fSmrgesac
2348549e21daSmrg
23491bedbe3fSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
23501bedbe3fSmrg[_AS_DETECT_SUGGESTED([
23511bedbe3fSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
23521bedbe3fSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
23531bedbe3fSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
23541bedbe3fSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
23551bedbe3fSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
23561bedbe3fSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
23571bedbe3fSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2358549e21daSmrg
23591bedbe3fSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
23601bedbe3fSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
23611bedbe3fSmrg])# _LT_PROG_ECHO_BACKSLASH
2362549e21daSmrg
2363549e21daSmrg
23641bedbe3fSmrg# _LT_WITH_SYSROOT
2365549e21daSmrg# ----------------
23661bedbe3fSmrgAC_DEFUN([_LT_WITH_SYSROOT],
23671bedbe3fSmrg[AC_MSG_CHECKING([for sysroot])
23681bedbe3fSmrgAC_ARG_WITH([sysroot],
23691bedbe3fSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
23701bedbe3fSmrg                        (or the compiler's sysroot if not specified).],
23711bedbe3fSmrg[], [with_sysroot=no])
23721bedbe3fSmrg
23731bedbe3fSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
23741bedbe3fSmrgdnl in case the user passed a directory name.
23751bedbe3fSmrglt_sysroot=
23761bedbe3fSmrgcase ${with_sysroot} in #(
23771bedbe3fSmrg yes)
23781bedbe3fSmrg   if test "$GCC" = yes; then
23791bedbe3fSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
23801bedbe3fSmrg   fi
23811bedbe3fSmrg   ;; #(
23821bedbe3fSmrg /*)
23831bedbe3fSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
23841bedbe3fSmrg   ;; #(
23851bedbe3fSmrg no|'')
23861bedbe3fSmrg   ;; #(
23871bedbe3fSmrg *)
23881bedbe3fSmrg   AC_MSG_RESULT([${with_sysroot}])
23891bedbe3fSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
23901bedbe3fSmrg   ;;
23911bedbe3fSmrgesac
2392549e21daSmrg
23931bedbe3fSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
23941bedbe3fSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
23951bedbe3fSmrg[dependent libraries, and in which our libraries should be installed.])])
2396549e21daSmrg
23971bedbe3fSmrg# _LT_ENABLE_LOCK
23981bedbe3fSmrg# ---------------
23991bedbe3fSmrgm4_defun([_LT_ENABLE_LOCK],
24001bedbe3fSmrg[AC_ARG_ENABLE([libtool-lock],
24011bedbe3fSmrg  [AS_HELP_STRING([--disable-libtool-lock],
24021bedbe3fSmrg    [avoid locking (might break parallel builds)])])
24031bedbe3fSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2404549e21daSmrg
24051bedbe3fSmrg# Some flags need to be propagated to the compiler or linker for good
24061bedbe3fSmrg# libtool support.
24071bedbe3fSmrgcase $host in
24081bedbe3fSmrgia64-*-hpux*)
24091bedbe3fSmrg  # Find out which ABI we are using.
24101bedbe3fSmrg  echo 'int i;' > conftest.$ac_ext
24111bedbe3fSmrg  if AC_TRY_EVAL(ac_compile); then
24121bedbe3fSmrg    case `/usr/bin/file conftest.$ac_objext` in
24131bedbe3fSmrg      *ELF-32*)
24141bedbe3fSmrg	HPUX_IA64_MODE="32"
24151bedbe3fSmrg	;;
24161bedbe3fSmrg      *ELF-64*)
24171bedbe3fSmrg	HPUX_IA64_MODE="64"
24181bedbe3fSmrg	;;
24191bedbe3fSmrg    esac
24201bedbe3fSmrg  fi
24211bedbe3fSmrg  rm -rf conftest*
24221bedbe3fSmrg  ;;
24231bedbe3fSmrg*-*-irix6*)
24241bedbe3fSmrg  # Find out which ABI we are using.
24251bedbe3fSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
24261bedbe3fSmrg  if AC_TRY_EVAL(ac_compile); then
24271bedbe3fSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
24281bedbe3fSmrg      case `/usr/bin/file conftest.$ac_objext` in
24291bedbe3fSmrg	*32-bit*)
24301bedbe3fSmrg	  LD="${LD-ld} -melf32bsmip"
24311bedbe3fSmrg	  ;;
24321bedbe3fSmrg	*N32*)
24331bedbe3fSmrg	  LD="${LD-ld} -melf32bmipn32"
24341bedbe3fSmrg	  ;;
24351bedbe3fSmrg	*64-bit*)
24361bedbe3fSmrg	  LD="${LD-ld} -melf64bmip"
24371bedbe3fSmrg	;;
24381bedbe3fSmrg      esac
24391bedbe3fSmrg    else
24401bedbe3fSmrg      case `/usr/bin/file conftest.$ac_objext` in
24411bedbe3fSmrg	*32-bit*)
24421bedbe3fSmrg	  LD="${LD-ld} -32"
24431bedbe3fSmrg	  ;;
24441bedbe3fSmrg	*N32*)
24451bedbe3fSmrg	  LD="${LD-ld} -n32"
24461bedbe3fSmrg	  ;;
24471bedbe3fSmrg	*64-bit*)
24481bedbe3fSmrg	  LD="${LD-ld} -64"
24491bedbe3fSmrg	  ;;
24501bedbe3fSmrg      esac
24511bedbe3fSmrg    fi
24521bedbe3fSmrg  fi
24531bedbe3fSmrg  rm -rf conftest*
24541bedbe3fSmrg  ;;
2455549e21daSmrg
24561bedbe3fSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
24571bedbe3fSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
24581bedbe3fSmrg  # Find out which ABI we are using.
24591bedbe3fSmrg  echo 'int i;' > conftest.$ac_ext
24601bedbe3fSmrg  if AC_TRY_EVAL(ac_compile); then
24611bedbe3fSmrg    case `/usr/bin/file conftest.o` in
24621bedbe3fSmrg      *32-bit*)
24631bedbe3fSmrg	case $host in
24641bedbe3fSmrg	  x86_64-*kfreebsd*-gnu)
24651bedbe3fSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
24661bedbe3fSmrg	    ;;
24671bedbe3fSmrg	  x86_64-*linux*)
24681bedbe3fSmrg	    LD="${LD-ld} -m elf_i386"
24691bedbe3fSmrg	    ;;
24701bedbe3fSmrg	  ppc64-*linux*|powerpc64-*linux*)
24711bedbe3fSmrg	    LD="${LD-ld} -m elf32ppclinux"
24721bedbe3fSmrg	    ;;
24731bedbe3fSmrg	  s390x-*linux*)
24741bedbe3fSmrg	    LD="${LD-ld} -m elf_s390"
24751bedbe3fSmrg	    ;;
24761bedbe3fSmrg	  sparc64-*linux*)
24771bedbe3fSmrg	    LD="${LD-ld} -m elf32_sparc"
24781bedbe3fSmrg	    ;;
24791bedbe3fSmrg	esac
24801bedbe3fSmrg	;;
24811bedbe3fSmrg      *64-bit*)
24821bedbe3fSmrg	case $host in
24831bedbe3fSmrg	  x86_64-*kfreebsd*-gnu)
24841bedbe3fSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
24851bedbe3fSmrg	    ;;
24861bedbe3fSmrg	  x86_64-*linux*)
24871bedbe3fSmrg	    LD="${LD-ld} -m elf_x86_64"
24881bedbe3fSmrg	    ;;
24891bedbe3fSmrg	  ppc*-*linux*|powerpc*-*linux*)
24901bedbe3fSmrg	    LD="${LD-ld} -m elf64ppc"
24911bedbe3fSmrg	    ;;
24921bedbe3fSmrg	  s390*-*linux*|s390*-*tpf*)
24931bedbe3fSmrg	    LD="${LD-ld} -m elf64_s390"
24941bedbe3fSmrg	    ;;
24951bedbe3fSmrg	  sparc*-*linux*)
24961bedbe3fSmrg	    LD="${LD-ld} -m elf64_sparc"
24971bedbe3fSmrg	    ;;
24981bedbe3fSmrg	esac
24991bedbe3fSmrg	;;
2500549e21daSmrg    esac
25011bedbe3fSmrg  fi
25021bedbe3fSmrg  rm -rf conftest*
25031bedbe3fSmrg  ;;
2504549e21daSmrg
25051bedbe3fSmrg*-*-sco3.2v5*)
25061bedbe3fSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
25071bedbe3fSmrg  SAVE_CFLAGS="$CFLAGS"
25081bedbe3fSmrg  CFLAGS="$CFLAGS -belf"
25091bedbe3fSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
25101bedbe3fSmrg    [AC_LANG_PUSH(C)
25111bedbe3fSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
25121bedbe3fSmrg     AC_LANG_POP])
25131bedbe3fSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
25141bedbe3fSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
25151bedbe3fSmrg    CFLAGS="$SAVE_CFLAGS"
25161bedbe3fSmrg  fi
25171bedbe3fSmrg  ;;
25181bedbe3fSmrg*-*solaris*)
25191bedbe3fSmrg  # Find out which ABI we are using.
25201bedbe3fSmrg  echo 'int i;' > conftest.$ac_ext
25211bedbe3fSmrg  if AC_TRY_EVAL(ac_compile); then
25221bedbe3fSmrg    case `/usr/bin/file conftest.o` in
25231bedbe3fSmrg    *64-bit*)
25241bedbe3fSmrg      case $lt_cv_prog_gnu_ld in
25251bedbe3fSmrg      yes*)
25261bedbe3fSmrg        case $host in
25271bedbe3fSmrg        i?86-*-solaris*)
25281bedbe3fSmrg          LD="${LD-ld} -m elf_x86_64"
25291bedbe3fSmrg          ;;
25301bedbe3fSmrg        sparc*-*-solaris*)
25311bedbe3fSmrg          LD="${LD-ld} -m elf64_sparc"
25321bedbe3fSmrg          ;;
25331bedbe3fSmrg        esac
25341bedbe3fSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
25351bedbe3fSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
25361bedbe3fSmrg          LD="${LD-ld}_sol2"
25371bedbe3fSmrg        fi
25381bedbe3fSmrg        ;;
25391bedbe3fSmrg      *)
25401bedbe3fSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
25411bedbe3fSmrg	  LD="${LD-ld} -64"
25421bedbe3fSmrg	fi
25431bedbe3fSmrg	;;
25441bedbe3fSmrg      esac
2545549e21daSmrg      ;;
2546549e21daSmrg    esac
25471bedbe3fSmrg  fi
25481bedbe3fSmrg  rm -rf conftest*
25491bedbe3fSmrg  ;;
25501bedbe3fSmrgesac
2551549e21daSmrg
25521bedbe3fSmrgneed_locks="$enable_libtool_lock"
25531bedbe3fSmrg])# _LT_ENABLE_LOCK
2554549e21daSmrg
2555549e21daSmrg
25561bedbe3fSmrg# _LT_PROG_AR
25571bedbe3fSmrg# -----------
25581bedbe3fSmrgm4_defun([_LT_PROG_AR],
25591bedbe3fSmrg[AC_CHECK_TOOLS(AR, [ar], false)
25601bedbe3fSmrg: ${AR=ar}
25611bedbe3fSmrg: ${AR_FLAGS=cru}
25621bedbe3fSmrg_LT_DECL([], [AR], [1], [The archiver])
25631bedbe3fSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
25641bedbe3fSmrg
25651bedbe3fSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
25661bedbe3fSmrg  [lt_cv_ar_at_file=no
25671bedbe3fSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
25681bedbe3fSmrg     [echo conftest.$ac_objext > conftest.lst
25691bedbe3fSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
25701bedbe3fSmrg      AC_TRY_EVAL([lt_ar_try])
25711bedbe3fSmrg      if test "$ac_status" -eq 0; then
25721bedbe3fSmrg	# Ensure the archiver fails upon bogus file names.
25731bedbe3fSmrg	rm -f conftest.$ac_objext libconftest.a
25741bedbe3fSmrg	AC_TRY_EVAL([lt_ar_try])
25751bedbe3fSmrg	if test "$ac_status" -ne 0; then
25761bedbe3fSmrg          lt_cv_ar_at_file=@
25771bedbe3fSmrg        fi
25781bedbe3fSmrg      fi
25791bedbe3fSmrg      rm -f conftest.* libconftest.a
25801bedbe3fSmrg     ])
25811bedbe3fSmrg  ])
2582549e21daSmrg
25831bedbe3fSmrgif test "x$lt_cv_ar_at_file" = xno; then
25841bedbe3fSmrg  archiver_list_spec=
25851bedbe3fSmrgelse
25861bedbe3fSmrg  archiver_list_spec=$lt_cv_ar_at_file
25871bedbe3fSmrgfi
25881bedbe3fSmrg_LT_DECL([], [archiver_list_spec], [1],
25891bedbe3fSmrg  [How to feed a file listing to the archiver])
25901bedbe3fSmrg])# _LT_PROG_AR
2591549e21daSmrg
2592549e21daSmrg
25931bedbe3fSmrg# _LT_CMD_OLD_ARCHIVE
25941bedbe3fSmrg# -------------------
25951bedbe3fSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
25961bedbe3fSmrg[_LT_PROG_AR
2597549e21daSmrg
25981bedbe3fSmrgAC_CHECK_TOOL(STRIP, strip, :)
25991bedbe3fSmrgtest -z "$STRIP" && STRIP=:
26001bedbe3fSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2601549e21daSmrg
26021bedbe3fSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
26031bedbe3fSmrgtest -z "$RANLIB" && RANLIB=:
26041bedbe3fSmrg_LT_DECL([], [RANLIB], [1],
26051bedbe3fSmrg    [Commands used to install an old-style archive])
2606549e21daSmrg
26071bedbe3fSmrg# Determine commands to create old-style static archives.
26081bedbe3fSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
26091bedbe3fSmrgold_postinstall_cmds='chmod 644 $oldlib'
26101bedbe3fSmrgold_postuninstall_cmds=
2611549e21daSmrg
26121bedbe3fSmrgif test -n "$RANLIB"; then
26131bedbe3fSmrg  case $host_os in
26141bedbe3fSmrg  openbsd*)
26151bedbe3fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
26161bedbe3fSmrg    ;;
26171bedbe3fSmrg  *)
26181bedbe3fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
26191bedbe3fSmrg    ;;
2620549e21daSmrg  esac
26211bedbe3fSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2622549e21daSmrgfi
2623549e21daSmrg
26241bedbe3fSmrgcase $host_os in
26251bedbe3fSmrg  darwin*)
26261bedbe3fSmrg    lock_old_archive_extraction=yes ;;
26271bedbe3fSmrg  *)
26281bedbe3fSmrg    lock_old_archive_extraction=no ;;
26291bedbe3fSmrgesac
26301bedbe3fSmrg_LT_DECL([], [old_postinstall_cmds], [2])
26311bedbe3fSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
26321bedbe3fSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
26331bedbe3fSmrg    [Commands used to build an old-style archive])
26341bedbe3fSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
26351bedbe3fSmrg    [Whether to use a lock for old archive extraction])
26361bedbe3fSmrg])# _LT_CMD_OLD_ARCHIVE
2637549e21daSmrg
2638549e21daSmrg
26391bedbe3fSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
26401bedbe3fSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
26411bedbe3fSmrg# ----------------------------------------------------------------
26421bedbe3fSmrg# Check whether the given compiler option works
26431bedbe3fSmrgAC_DEFUN([_LT_COMPILER_OPTION],
2644549e21daSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
26451bedbe3fSmrgm4_require([_LT_DECL_SED])dnl
26461bedbe3fSmrgAC_CACHE_CHECK([$1], [$2],
26471bedbe3fSmrg  [$2=no
26481bedbe3fSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
26491bedbe3fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
26501bedbe3fSmrg   lt_compiler_flag="$3"
26511bedbe3fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
26521bedbe3fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
26531bedbe3fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
26541bedbe3fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
26551bedbe3fSmrg   # The option is referenced via a variable to avoid confusing sed.
26561bedbe3fSmrg   lt_compile=`echo "$ac_compile" | $SED \
26571bedbe3fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
26581bedbe3fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
26591bedbe3fSmrg   -e 's:$: $lt_compiler_flag:'`
26601bedbe3fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
26611bedbe3fSmrg   (eval "$lt_compile" 2>conftest.err)
26621bedbe3fSmrg   ac_status=$?
26631bedbe3fSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
26641bedbe3fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
26651bedbe3fSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
26661bedbe3fSmrg     # The compiler can only warn and ignore the option if not recognized
26671bedbe3fSmrg     # So say no if there are warnings other than the usual output.
26681bedbe3fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
26691bedbe3fSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
26701bedbe3fSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
26711bedbe3fSmrg       $2=yes
26721bedbe3fSmrg     fi
26731bedbe3fSmrg   fi
26741bedbe3fSmrg   $RM conftest*
26751bedbe3fSmrg])
2676549e21daSmrg
26771bedbe3fSmrgif test x"[$]$2" = xyes; then
26781bedbe3fSmrg    m4_if([$5], , :, [$5])
26791bedbe3fSmrgelse
26801bedbe3fSmrg    m4_if([$6], , :, [$6])
26811bedbe3fSmrgfi
26821bedbe3fSmrg])# _LT_COMPILER_OPTION
2683549e21daSmrg
26841bedbe3fSmrg# Old name:
26851bedbe3fSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
26861bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
26871bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2688549e21daSmrg
2689549e21daSmrg
26901bedbe3fSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
26911bedbe3fSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
26921bedbe3fSmrg# ----------------------------------------------------
26931bedbe3fSmrg# Check whether the given linker option works
26941bedbe3fSmrgAC_DEFUN([_LT_LINKER_OPTION],
26951bedbe3fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
26961bedbe3fSmrgm4_require([_LT_DECL_SED])dnl
26971bedbe3fSmrgAC_CACHE_CHECK([$1], [$2],
26981bedbe3fSmrg  [$2=no
26991bedbe3fSmrg   save_LDFLAGS="$LDFLAGS"
27001bedbe3fSmrg   LDFLAGS="$LDFLAGS $3"
27011bedbe3fSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
27021bedbe3fSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
27031bedbe3fSmrg     # The linker can only warn and ignore the option if not recognized
27041bedbe3fSmrg     # So say no if there are warnings
27051bedbe3fSmrg     if test -s conftest.err; then
27061bedbe3fSmrg       # Append any errors to the config.log.
27071bedbe3fSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
27081bedbe3fSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
27091bedbe3fSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
27101bedbe3fSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
27111bedbe3fSmrg         $2=yes
27121bedbe3fSmrg       fi
27131bedbe3fSmrg     else
27141bedbe3fSmrg       $2=yes
27151bedbe3fSmrg     fi
27161bedbe3fSmrg   fi
27171bedbe3fSmrg   $RM -r conftest*
27181bedbe3fSmrg   LDFLAGS="$save_LDFLAGS"
27191bedbe3fSmrg])
2720549e21daSmrg
27211bedbe3fSmrgif test x"[$]$2" = xyes; then
27221bedbe3fSmrg    m4_if([$4], , :, [$4])
27231bedbe3fSmrgelse
27241bedbe3fSmrg    m4_if([$5], , :, [$5])
2725549e21daSmrgfi
27261bedbe3fSmrg])# _LT_LINKER_OPTION
2727549e21daSmrg
27281bedbe3fSmrg# Old name:
27291bedbe3fSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
27301bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
27311bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2732549e21daSmrg
2733549e21daSmrg
27341bedbe3fSmrg# LT_CMD_MAX_LEN
27351bedbe3fSmrg#---------------
27361bedbe3fSmrgAC_DEFUN([LT_CMD_MAX_LEN],
27371bedbe3fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
27381bedbe3fSmrg# find the maximum length of command line arguments
27391bedbe3fSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
27401bedbe3fSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
27411bedbe3fSmrg  i=0
27421bedbe3fSmrg  teststring="ABCD"
2743549e21daSmrg
27441bedbe3fSmrg  case $build_os in
27451bedbe3fSmrg  msdosdjgpp*)
27461bedbe3fSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
27471bedbe3fSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
27481bedbe3fSmrg    # during glob expansion).  Even if it were fixed, the result of this
27491bedbe3fSmrg    # check would be larger than it should be.
27501bedbe3fSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
27511bedbe3fSmrg    ;;
2752549e21daSmrg
27531bedbe3fSmrg  gnu*)
27541bedbe3fSmrg    # Under GNU Hurd, this test is not required because there is
27551bedbe3fSmrg    # no limit to the length of command line arguments.
27561bedbe3fSmrg    # Libtool will interpret -1 as no limit whatsoever
27571bedbe3fSmrg    lt_cv_sys_max_cmd_len=-1;
27581bedbe3fSmrg    ;;
2759549e21daSmrg
27601bedbe3fSmrg  cygwin* | mingw* | cegcc*)
27611bedbe3fSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
27621bedbe3fSmrg    # about 5 minutes as the teststring grows exponentially.
27631bedbe3fSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
27641bedbe3fSmrg    # you end up with a "frozen" computer, even though with patience
27651bedbe3fSmrg    # the test eventually succeeds (with a max line length of 256k).
27661bedbe3fSmrg    # Instead, let's just punt: use the minimum linelength reported by
27671bedbe3fSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
27681bedbe3fSmrg    lt_cv_sys_max_cmd_len=8192;
27691bedbe3fSmrg    ;;
2770549e21daSmrg
27711bedbe3fSmrg  mint*)
27721bedbe3fSmrg    # On MiNT this can take a long time and run out of memory.
27731bedbe3fSmrg    lt_cv_sys_max_cmd_len=8192;
27741bedbe3fSmrg    ;;
2775549e21daSmrg
27761bedbe3fSmrg  amigaos*)
27771bedbe3fSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
27781bedbe3fSmrg    # So we just punt and use a minimum line length of 8192.
27791bedbe3fSmrg    lt_cv_sys_max_cmd_len=8192;
27801bedbe3fSmrg    ;;
2781549e21daSmrg
27821bedbe3fSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
27831bedbe3fSmrg    # This has been around since 386BSD, at least.  Likely further.
27841bedbe3fSmrg    if test -x /sbin/sysctl; then
27851bedbe3fSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
27861bedbe3fSmrg    elif test -x /usr/sbin/sysctl; then
27871bedbe3fSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
27881bedbe3fSmrg    else
27891bedbe3fSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
27901bedbe3fSmrg    fi
27911bedbe3fSmrg    # And add a safety zone
27921bedbe3fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
27931bedbe3fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
27941bedbe3fSmrg    ;;
2795549e21daSmrg
27961bedbe3fSmrg  interix*)
27971bedbe3fSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
27981bedbe3fSmrg    lt_cv_sys_max_cmd_len=196608
27991bedbe3fSmrg    ;;
2800549e21daSmrg
28011bedbe3fSmrg  os2*)
28021bedbe3fSmrg    # The test takes a long time on OS/2.
28031bedbe3fSmrg    lt_cv_sys_max_cmd_len=8192
28041bedbe3fSmrg    ;;
2805549e21daSmrg
28061bedbe3fSmrg  osf*)
28071bedbe3fSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
28081bedbe3fSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
28091bedbe3fSmrg    # nice to cause kernel panics so lets avoid the loop below.
28101bedbe3fSmrg    # First set a reasonable default.
28111bedbe3fSmrg    lt_cv_sys_max_cmd_len=16384
28121bedbe3fSmrg    #
28131bedbe3fSmrg    if test -x /sbin/sysconfig; then
28141bedbe3fSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
28151bedbe3fSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
28161bedbe3fSmrg      esac
28171bedbe3fSmrg    fi
28181bedbe3fSmrg    ;;
28191bedbe3fSmrg  sco3.2v5*)
28201bedbe3fSmrg    lt_cv_sys_max_cmd_len=102400
28211bedbe3fSmrg    ;;
28221bedbe3fSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
28231bedbe3fSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
28241bedbe3fSmrg    if test -n "$kargmax"; then
28251bedbe3fSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
28261bedbe3fSmrg    else
28271bedbe3fSmrg      lt_cv_sys_max_cmd_len=32768
28281bedbe3fSmrg    fi
28291bedbe3fSmrg    ;;
28301bedbe3fSmrg  *)
28311bedbe3fSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
28321bedbe3fSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
28331bedbe3fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
28341bedbe3fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
28351bedbe3fSmrg    else
28361bedbe3fSmrg      # Make teststring a little bigger before we do anything with it.
28371bedbe3fSmrg      # a 1K string should be a reasonable start.
28381bedbe3fSmrg      for i in 1 2 3 4 5 6 7 8 ; do
28391bedbe3fSmrg        teststring=$teststring$teststring
28401bedbe3fSmrg      done
28411bedbe3fSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
28421bedbe3fSmrg      # If test is not a shell built-in, we'll probably end up computing a
28431bedbe3fSmrg      # maximum length that is only half of the actual maximum length, but
28441bedbe3fSmrg      # we can't tell.
28451bedbe3fSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
28461bedbe3fSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
28471bedbe3fSmrg	      test $i != 17 # 1/2 MB should be enough
28481bedbe3fSmrg      do
28491bedbe3fSmrg        i=`expr $i + 1`
28501bedbe3fSmrg        teststring=$teststring$teststring
28511bedbe3fSmrg      done
28521bedbe3fSmrg      # Only check the string length outside the loop.
28531bedbe3fSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
28541bedbe3fSmrg      teststring=
28551bedbe3fSmrg      # Add a significant safety factor because C++ compilers can tack on
28561bedbe3fSmrg      # massive amounts of additional arguments before passing them to the
28571bedbe3fSmrg      # linker.  It appears as though 1/2 is a usable value.
28581bedbe3fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
28591bedbe3fSmrg    fi
28601bedbe3fSmrg    ;;
28611bedbe3fSmrg  esac
28621bedbe3fSmrg])
28631bedbe3fSmrgif test -n $lt_cv_sys_max_cmd_len ; then
28641bedbe3fSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
28651bedbe3fSmrgelse
28661bedbe3fSmrg  AC_MSG_RESULT(none)
28671bedbe3fSmrgfi
28681bedbe3fSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
28691bedbe3fSmrg_LT_DECL([], [max_cmd_len], [0],
28701bedbe3fSmrg    [What is the maximum length of a command?])
28711bedbe3fSmrg])# LT_CMD_MAX_LEN
2872549e21daSmrg
28731bedbe3fSmrg# Old name:
28741bedbe3fSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
28751bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
28761bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2877549e21daSmrg
2878549e21daSmrg
28791bedbe3fSmrg# _LT_HEADER_DLFCN
28801bedbe3fSmrg# ----------------
28811bedbe3fSmrgm4_defun([_LT_HEADER_DLFCN],
28821bedbe3fSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
28831bedbe3fSmrg])# _LT_HEADER_DLFCN
2884549e21daSmrg
2885549e21daSmrg
28861bedbe3fSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
28871bedbe3fSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
28881bedbe3fSmrg# ----------------------------------------------------------------
28891bedbe3fSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
28901bedbe3fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
28911bedbe3fSmrgif test "$cross_compiling" = yes; then :
28921bedbe3fSmrg  [$4]
28931bedbe3fSmrgelse
28941bedbe3fSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
28951bedbe3fSmrg  lt_status=$lt_dlunknown
28961bedbe3fSmrg  cat > conftest.$ac_ext <<_LT_EOF
28971bedbe3fSmrg[#line $LINENO "configure"
28981bedbe3fSmrg#include "confdefs.h"
2899549e21daSmrg
29001bedbe3fSmrg#if HAVE_DLFCN_H
29011bedbe3fSmrg#include <dlfcn.h>
29021bedbe3fSmrg#endif
2903549e21daSmrg
29041bedbe3fSmrg#include <stdio.h>
2905549e21daSmrg
29061bedbe3fSmrg#ifdef RTLD_GLOBAL
29071bedbe3fSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
29081bedbe3fSmrg#else
29091bedbe3fSmrg#  ifdef DL_GLOBAL
29101bedbe3fSmrg#    define LT_DLGLOBAL		DL_GLOBAL
29111bedbe3fSmrg#  else
29121bedbe3fSmrg#    define LT_DLGLOBAL		0
29131bedbe3fSmrg#  endif
29141bedbe3fSmrg#endif
2915549e21daSmrg
29161bedbe3fSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
29171bedbe3fSmrg   find out it does not work in some platform. */
29181bedbe3fSmrg#ifndef LT_DLLAZY_OR_NOW
29191bedbe3fSmrg#  ifdef RTLD_LAZY
29201bedbe3fSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
29211bedbe3fSmrg#  else
29221bedbe3fSmrg#    ifdef DL_LAZY
29231bedbe3fSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
29241bedbe3fSmrg#    else
29251bedbe3fSmrg#      ifdef RTLD_NOW
29261bedbe3fSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
29271bedbe3fSmrg#      else
29281bedbe3fSmrg#        ifdef DL_NOW
29291bedbe3fSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
29301bedbe3fSmrg#        else
29311bedbe3fSmrg#          define LT_DLLAZY_OR_NOW	0
29321bedbe3fSmrg#        endif
29331bedbe3fSmrg#      endif
29341bedbe3fSmrg#    endif
29351bedbe3fSmrg#  endif
29361bedbe3fSmrg#endif
2937549e21daSmrg
29381bedbe3fSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
29391bedbe3fSmrg   correspondingly for the symbols needed.  */
29401bedbe3fSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
29411bedbe3fSmrgint fnord () __attribute__((visibility("default")));
29421bedbe3fSmrg#endif
2943549e21daSmrg
29441bedbe3fSmrgint fnord () { return 42; }
29451bedbe3fSmrgint main ()
29461bedbe3fSmrg{
29471bedbe3fSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
29481bedbe3fSmrg  int status = $lt_dlunknown;
2949549e21daSmrg
29501bedbe3fSmrg  if (self)
29511bedbe3fSmrg    {
29521bedbe3fSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
29531bedbe3fSmrg      else
29541bedbe3fSmrg        {
29551bedbe3fSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
29561bedbe3fSmrg          else puts (dlerror ());
29571bedbe3fSmrg	}
29581bedbe3fSmrg      /* dlclose (self); */
29591bedbe3fSmrg    }
29601bedbe3fSmrg  else
29611bedbe3fSmrg    puts (dlerror ());
2962549e21daSmrg
29631bedbe3fSmrg  return status;
29641bedbe3fSmrg}]
29651bedbe3fSmrg_LT_EOF
29661bedbe3fSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
29671bedbe3fSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
29681bedbe3fSmrg    lt_status=$?
29691bedbe3fSmrg    case x$lt_status in
29701bedbe3fSmrg      x$lt_dlno_uscore) $1 ;;
29711bedbe3fSmrg      x$lt_dlneed_uscore) $2 ;;
29721bedbe3fSmrg      x$lt_dlunknown|x*) $3 ;;
29731bedbe3fSmrg    esac
29741bedbe3fSmrg  else :
29751bedbe3fSmrg    # compilation failed
29761bedbe3fSmrg    $3
29771bedbe3fSmrg  fi
29781bedbe3fSmrgfi
29791bedbe3fSmrgrm -fr conftest*
29801bedbe3fSmrg])# _LT_TRY_DLOPEN_SELF
2981549e21daSmrg
2982549e21daSmrg
29831bedbe3fSmrg# LT_SYS_DLOPEN_SELF
29841bedbe3fSmrg# ------------------
29851bedbe3fSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
29861bedbe3fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
29871bedbe3fSmrgif test "x$enable_dlopen" != xyes; then
29881bedbe3fSmrg  enable_dlopen=unknown
29891bedbe3fSmrg  enable_dlopen_self=unknown
29901bedbe3fSmrg  enable_dlopen_self_static=unknown
29911bedbe3fSmrgelse
29921bedbe3fSmrg  lt_cv_dlopen=no
29931bedbe3fSmrg  lt_cv_dlopen_libs=
2994549e21daSmrg
29951bedbe3fSmrg  case $host_os in
29961bedbe3fSmrg  beos*)
29971bedbe3fSmrg    lt_cv_dlopen="load_add_on"
29981bedbe3fSmrg    lt_cv_dlopen_libs=
29991bedbe3fSmrg    lt_cv_dlopen_self=yes
30001bedbe3fSmrg    ;;
3001ba6a1819Smrg
30021bedbe3fSmrg  mingw* | pw32* | cegcc*)
30031bedbe3fSmrg    lt_cv_dlopen="LoadLibrary"
30041bedbe3fSmrg    lt_cv_dlopen_libs=
30051bedbe3fSmrg    ;;
3006ba6a1819Smrg
30071bedbe3fSmrg  cygwin*)
30081bedbe3fSmrg    lt_cv_dlopen="dlopen"
30091bedbe3fSmrg    lt_cv_dlopen_libs=
30101bedbe3fSmrg    ;;
3011549e21daSmrg
30121bedbe3fSmrg  darwin*)
30131bedbe3fSmrg  # if libdl is installed we need to link against it
30141bedbe3fSmrg    AC_CHECK_LIB([dl], [dlopen],
30151bedbe3fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
30161bedbe3fSmrg    lt_cv_dlopen="dyld"
30171bedbe3fSmrg    lt_cv_dlopen_libs=
30181bedbe3fSmrg    lt_cv_dlopen_self=yes
3019549e21daSmrg    ])
3020549e21daSmrg    ;;
30211bedbe3fSmrg
30221bedbe3fSmrg  *)
30231bedbe3fSmrg    AC_CHECK_FUNC([shl_load],
30241bedbe3fSmrg	  [lt_cv_dlopen="shl_load"],
30251bedbe3fSmrg      [AC_CHECK_LIB([dld], [shl_load],
30261bedbe3fSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
30271bedbe3fSmrg	[AC_CHECK_FUNC([dlopen],
30281bedbe3fSmrg	      [lt_cv_dlopen="dlopen"],
30291bedbe3fSmrg	  [AC_CHECK_LIB([dl], [dlopen],
30301bedbe3fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
30311bedbe3fSmrg	    [AC_CHECK_LIB([svld], [dlopen],
30321bedbe3fSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
30331bedbe3fSmrg	      [AC_CHECK_LIB([dld], [dld_link],
30341bedbe3fSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
30351bedbe3fSmrg	      ])
30361bedbe3fSmrg	    ])
30371bedbe3fSmrg	  ])
30381bedbe3fSmrg	])
30391bedbe3fSmrg      ])
3040549e21daSmrg    ;;
3041549e21daSmrg  esac
3042ba6a1819Smrg
30431bedbe3fSmrg  if test "x$lt_cv_dlopen" != xno; then
30441bedbe3fSmrg    enable_dlopen=yes
3045549e21daSmrg  else
30461bedbe3fSmrg    enable_dlopen=no
3047549e21daSmrg  fi
3048ba6a1819Smrg
30491bedbe3fSmrg  case $lt_cv_dlopen in
30501bedbe3fSmrg  dlopen)
30511bedbe3fSmrg    save_CPPFLAGS="$CPPFLAGS"
30521bedbe3fSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
3053ba6a1819Smrg
30541bedbe3fSmrg    save_LDFLAGS="$LDFLAGS"
30551bedbe3fSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
3056ba6a1819Smrg
30571bedbe3fSmrg    save_LIBS="$LIBS"
30581bedbe3fSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
3059ba6a1819Smrg
30601bedbe3fSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
30611bedbe3fSmrg	  lt_cv_dlopen_self, [dnl
30621bedbe3fSmrg	  _LT_TRY_DLOPEN_SELF(
30631bedbe3fSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
30641bedbe3fSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
30651bedbe3fSmrg    ])
3066ba6a1819Smrg
30671bedbe3fSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
30681bedbe3fSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
30691bedbe3fSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
30701bedbe3fSmrg	  lt_cv_dlopen_self_static, [dnl
30711bedbe3fSmrg	  _LT_TRY_DLOPEN_SELF(
30721bedbe3fSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
30731bedbe3fSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
30741bedbe3fSmrg      ])
30751bedbe3fSmrg    fi
3076549e21daSmrg
30771bedbe3fSmrg    CPPFLAGS="$save_CPPFLAGS"
30781bedbe3fSmrg    LDFLAGS="$save_LDFLAGS"
30791bedbe3fSmrg    LIBS="$save_LIBS"
30801bedbe3fSmrg    ;;
30811bedbe3fSmrg  esac
30821bedbe3fSmrg
30831bedbe3fSmrg  case $lt_cv_dlopen_self in
30841bedbe3fSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
30851bedbe3fSmrg  *) enable_dlopen_self=unknown ;;
30861bedbe3fSmrg  esac
30871bedbe3fSmrg
30881bedbe3fSmrg  case $lt_cv_dlopen_self_static in
30891bedbe3fSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
30901bedbe3fSmrg  *) enable_dlopen_self_static=unknown ;;
30911bedbe3fSmrg  esac
3092ba6a1819Smrgfi
30931bedbe3fSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
30941bedbe3fSmrg	 [Whether dlopen is supported])
30951bedbe3fSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
30961bedbe3fSmrg	 [Whether dlopen of programs is supported])
30971bedbe3fSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
30981bedbe3fSmrg	 [Whether dlopen of statically linked programs is supported])
30991bedbe3fSmrg])# LT_SYS_DLOPEN_SELF
3100ba6a1819Smrg
31011bedbe3fSmrg# Old name:
31021bedbe3fSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
31031bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
31041bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
3105ba6a1819Smrg
3106ba6a1819Smrg
31071bedbe3fSmrg# _LT_COMPILER_C_O([TAGNAME])
31081bedbe3fSmrg# ---------------------------
31091bedbe3fSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
31101bedbe3fSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
31111bedbe3fSmrgm4_defun([_LT_COMPILER_C_O],
31121bedbe3fSmrg[m4_require([_LT_DECL_SED])dnl
31131bedbe3fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
31141bedbe3fSmrgm4_require([_LT_TAG_COMPILER])dnl
31151bedbe3fSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
31161bedbe3fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
31171bedbe3fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
31181bedbe3fSmrg   $RM -r conftest 2>/dev/null
31191bedbe3fSmrg   mkdir conftest
31201bedbe3fSmrg   cd conftest
31211bedbe3fSmrg   mkdir out
31221bedbe3fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3123ba6a1819Smrg
31241bedbe3fSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
31251bedbe3fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
31261bedbe3fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
31271bedbe3fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
31281bedbe3fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
31291bedbe3fSmrg   lt_compile=`echo "$ac_compile" | $SED \
31301bedbe3fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
31311bedbe3fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
31321bedbe3fSmrg   -e 's:$: $lt_compiler_flag:'`
31331bedbe3fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
31341bedbe3fSmrg   (eval "$lt_compile" 2>out/conftest.err)
31351bedbe3fSmrg   ac_status=$?
31361bedbe3fSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
31371bedbe3fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
31381bedbe3fSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
31391bedbe3fSmrg   then
31401bedbe3fSmrg     # The compiler can only warn and ignore the option if not recognized
31411bedbe3fSmrg     # So say no if there are warnings
31421bedbe3fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
31431bedbe3fSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
31441bedbe3fSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
31451bedbe3fSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
31461bedbe3fSmrg     fi
31471bedbe3fSmrg   fi
31481bedbe3fSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
31491bedbe3fSmrg   $RM conftest*
31501bedbe3fSmrg   # SGI C++ compiler will create directory out/ii_files/ for
31511bedbe3fSmrg   # template instantiation
31521bedbe3fSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
31531bedbe3fSmrg   $RM out/* && rmdir out
31541bedbe3fSmrg   cd ..
31551bedbe3fSmrg   $RM -r conftest
31561bedbe3fSmrg   $RM conftest*
31571bedbe3fSmrg])
31581bedbe3fSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
31591bedbe3fSmrg	[Does compiler simultaneously support -c and -o options?])
31601bedbe3fSmrg])# _LT_COMPILER_C_O
3161ba6a1819Smrg
3162ba6a1819Smrg
31631bedbe3fSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
31641bedbe3fSmrg# ----------------------------------
31651bedbe3fSmrg# Check to see if we can do hard links to lock some files if needed
31661bedbe3fSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
31671bedbe3fSmrg[m4_require([_LT_ENABLE_LOCK])dnl
31681bedbe3fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
31691bedbe3fSmrg_LT_COMPILER_C_O([$1])
3170ba6a1819Smrg
31711bedbe3fSmrghard_links="nottested"
31721bedbe3fSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
31731bedbe3fSmrg  # do not overwrite the value of need_locks provided by the user
31741bedbe3fSmrg  AC_MSG_CHECKING([if we can lock with hard links])
31751bedbe3fSmrg  hard_links=yes
31761bedbe3fSmrg  $RM conftest*
31771bedbe3fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
31781bedbe3fSmrg  touch conftest.a
31791bedbe3fSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
31801bedbe3fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
31811bedbe3fSmrg  AC_MSG_RESULT([$hard_links])
31821bedbe3fSmrg  if test "$hard_links" = no; then
31831bedbe3fSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
31841bedbe3fSmrg    need_locks=warn
3185ba6a1819Smrg  fi
31861bedbe3fSmrgelse
31871bedbe3fSmrg  need_locks=no
31881bedbe3fSmrgfi
31891bedbe3fSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
31901bedbe3fSmrg])# _LT_COMPILER_FILE_LOCKS
3191ba6a1819Smrg
3192ba6a1819Smrg
31931bedbe3fSmrg# _LT_CHECK_OBJDIR
31941bedbe3fSmrg# ----------------
31951bedbe3fSmrgm4_defun([_LT_CHECK_OBJDIR],
31961bedbe3fSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
31971bedbe3fSmrg[rm -f .libs 2>/dev/null
31981bedbe3fSmrgmkdir .libs 2>/dev/null
31991bedbe3fSmrgif test -d .libs; then
32001bedbe3fSmrg  lt_cv_objdir=.libs
32011bedbe3fSmrgelse
32021bedbe3fSmrg  # MS-DOS does not allow filenames that begin with a dot.
32031bedbe3fSmrg  lt_cv_objdir=_libs
32041bedbe3fSmrgfi
32051bedbe3fSmrgrmdir .libs 2>/dev/null])
32061bedbe3fSmrgobjdir=$lt_cv_objdir
32071bedbe3fSmrg_LT_DECL([], [objdir], [0],
32081bedbe3fSmrg         [The name of the directory that contains temporary libtool files])dnl
32091bedbe3fSmrgm4_pattern_allow([LT_OBJDIR])dnl
32101bedbe3fSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
32111bedbe3fSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
32121bedbe3fSmrg])# _LT_CHECK_OBJDIR
3213549e21daSmrg
3214549e21daSmrg
32151bedbe3fSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
32161bedbe3fSmrg# --------------------------------------
32171bedbe3fSmrg# Check hardcoding attributes.
32181bedbe3fSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
32191bedbe3fSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
32201bedbe3fSmrg_LT_TAGVAR(hardcode_action, $1)=
32211bedbe3fSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
32221bedbe3fSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
32231bedbe3fSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3224549e21daSmrg
32251bedbe3fSmrg  # We can hardcode non-existent directories.
32261bedbe3fSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
32271bedbe3fSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
32281bedbe3fSmrg     # have to relink, otherwise we might link with an installed library
32291bedbe3fSmrg     # when we should be linking with a yet-to-be-installed one
32301bedbe3fSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
32311bedbe3fSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
32321bedbe3fSmrg    # Linking always hardcodes the temporary library directory.
32331bedbe3fSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
32341bedbe3fSmrg  else
32351bedbe3fSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
32361bedbe3fSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
32371bedbe3fSmrg  fi
32381bedbe3fSmrgelse
32391bedbe3fSmrg  # We cannot hardcode anything, or else we can only hardcode existing
32401bedbe3fSmrg  # directories.
32411bedbe3fSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
32421bedbe3fSmrgfi
32431bedbe3fSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3244549e21daSmrg
32451bedbe3fSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
32461bedbe3fSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
32471bedbe3fSmrg  # Fast installation is not supported
32481bedbe3fSmrg  enable_fast_install=no
32491bedbe3fSmrgelif test "$shlibpath_overrides_runpath" = yes ||
32501bedbe3fSmrg     test "$enable_shared" = no; then
32511bedbe3fSmrg  # Fast installation is not necessary
32521bedbe3fSmrg  enable_fast_install=needless
32531bedbe3fSmrgfi
32541bedbe3fSmrg_LT_TAGDECL([], [hardcode_action], [0],
32551bedbe3fSmrg    [How to hardcode a shared library path into an executable])
32561bedbe3fSmrg])# _LT_LINKER_HARDCODE_LIBPATH
3257549e21daSmrg
3258549e21daSmrg
32591bedbe3fSmrg# _LT_CMD_STRIPLIB
32601bedbe3fSmrg# ----------------
32611bedbe3fSmrgm4_defun([_LT_CMD_STRIPLIB],
32621bedbe3fSmrg[m4_require([_LT_DECL_EGREP])
32631bedbe3fSmrgstriplib=
32641bedbe3fSmrgold_striplib=
32651bedbe3fSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
32661bedbe3fSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
32671bedbe3fSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
32681bedbe3fSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
32691bedbe3fSmrg  AC_MSG_RESULT([yes])
32701bedbe3fSmrgelse
32711bedbe3fSmrg# FIXME - insert some real tests, host_os isn't really good enough
3272549e21daSmrg  case $host_os in
32731bedbe3fSmrg  darwin*)
32741bedbe3fSmrg    if test -n "$STRIP" ; then
32751bedbe3fSmrg      striplib="$STRIP -x"
32761bedbe3fSmrg      old_striplib="$STRIP -S"
32771bedbe3fSmrg      AC_MSG_RESULT([yes])
32781bedbe3fSmrg    else
32791bedbe3fSmrg      AC_MSG_RESULT([no])
32801bedbe3fSmrg    fi
3281549e21daSmrg    ;;
3282549e21daSmrg  *)
32831bedbe3fSmrg    AC_MSG_RESULT([no])
3284549e21daSmrg    ;;
3285549e21daSmrg  esac
3286549e21daSmrgfi
32871bedbe3fSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
32881bedbe3fSmrg_LT_DECL([], [striplib], [1])
32891bedbe3fSmrg])# _LT_CMD_STRIPLIB
3290ba6a1819Smrg
3291ba6a1819Smrg
32921bedbe3fSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
32931bedbe3fSmrg# -----------------------------
32941bedbe3fSmrg# PORTME Fill in your ld.so characteristics
32951bedbe3fSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
32961bedbe3fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
32971bedbe3fSmrgm4_require([_LT_DECL_EGREP])dnl
32981bedbe3fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
32991bedbe3fSmrgm4_require([_LT_DECL_OBJDUMP])dnl
3300549e21daSmrgm4_require([_LT_DECL_SED])dnl
33011bedbe3fSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
33021bedbe3fSmrgAC_MSG_CHECKING([dynamic linker characteristics])
33031bedbe3fSmrgm4_if([$1],
33041bedbe3fSmrg	[], [
33051bedbe3fSmrgif test "$GCC" = yes; then
33061bedbe3fSmrg  case $host_os in
33071bedbe3fSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
33081bedbe3fSmrg    *) lt_awk_arg="/^libraries:/" ;;
33091bedbe3fSmrg  esac
33101bedbe3fSmrg  case $host_os in
33111bedbe3fSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
33121bedbe3fSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
33131bedbe3fSmrg  esac
33141bedbe3fSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
33151bedbe3fSmrg  case $lt_search_path_spec in
33161bedbe3fSmrg  *\;*)
33171bedbe3fSmrg    # if the path contains ";" then we assume it to be the separator
33181bedbe3fSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
33191bedbe3fSmrg    # assumed that no part of a normal pathname contains ";" but that should
33201bedbe3fSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
33211bedbe3fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
33221bedbe3fSmrg    ;;
33231bedbe3fSmrg  *)
33241bedbe3fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
33251bedbe3fSmrg    ;;
33261bedbe3fSmrg  esac
33271bedbe3fSmrg  # Ok, now we have the path, separated by spaces, we can step through it
33281bedbe3fSmrg  # and add multilib dir if necessary.
33291bedbe3fSmrg  lt_tmp_lt_search_path_spec=
33301bedbe3fSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
33311bedbe3fSmrg  for lt_sys_path in $lt_search_path_spec; do
33321bedbe3fSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
33331bedbe3fSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
33341bedbe3fSmrg    else
33351bedbe3fSmrg      test -d "$lt_sys_path" && \
33361bedbe3fSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
33371bedbe3fSmrg    fi
33381bedbe3fSmrg  done
33391bedbe3fSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
33401bedbe3fSmrgBEGIN {RS=" "; FS="/|\n";} {
33411bedbe3fSmrg  lt_foo="";
33421bedbe3fSmrg  lt_count=0;
33431bedbe3fSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
33441bedbe3fSmrg    if ($lt_i != "" && $lt_i != ".") {
33451bedbe3fSmrg      if ($lt_i == "..") {
33461bedbe3fSmrg        lt_count++;
33471bedbe3fSmrg      } else {
33481bedbe3fSmrg        if (lt_count == 0) {
33491bedbe3fSmrg          lt_foo="/" $lt_i lt_foo;
33501bedbe3fSmrg        } else {
33511bedbe3fSmrg          lt_count--;
33521bedbe3fSmrg        }
33531bedbe3fSmrg      }
33541bedbe3fSmrg    }
33551bedbe3fSmrg  }
33561bedbe3fSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
33571bedbe3fSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
33581bedbe3fSmrg}'`
33591bedbe3fSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
33601bedbe3fSmrg  # for these hosts.
33611bedbe3fSmrg  case $host_os in
33621bedbe3fSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
33631bedbe3fSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
33641bedbe3fSmrg  esac
33651bedbe3fSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3366ba6a1819Smrgelse
33671bedbe3fSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
33681bedbe3fSmrgfi])
33691bedbe3fSmrglibrary_names_spec=
33701bedbe3fSmrglibname_spec='lib$name'
33711bedbe3fSmrgsoname_spec=
33721bedbe3fSmrgshrext_cmds=".so"
33731bedbe3fSmrgpostinstall_cmds=
33741bedbe3fSmrgpostuninstall_cmds=
33751bedbe3fSmrgfinish_cmds=
33761bedbe3fSmrgfinish_eval=
33771bedbe3fSmrgshlibpath_var=
33781bedbe3fSmrgshlibpath_overrides_runpath=unknown
33791bedbe3fSmrgversion_type=none
33801bedbe3fSmrgdynamic_linker="$host_os ld.so"
33811bedbe3fSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
33821bedbe3fSmrgneed_lib_prefix=unknown
33831bedbe3fSmrghardcode_into_libs=no
3384ba6a1819Smrg
33851bedbe3fSmrg# when you set need_version to no, make sure it does not cause -set_version
33861bedbe3fSmrg# flags to be left without arguments
33871bedbe3fSmrgneed_version=unknown
3388549e21daSmrg
33891bedbe3fSmrgcase $host_os in
33901bedbe3fSmrgaix3*)
33911bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
33921bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
33931bedbe3fSmrg  shlibpath_var=LIBPATH
3394ba6a1819Smrg
33951bedbe3fSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
33961bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
33971bedbe3fSmrg  ;;
3398ba6a1819Smrg
33991bedbe3fSmrgaix[[4-9]]*)
34001bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
34011bedbe3fSmrg  need_lib_prefix=no
34021bedbe3fSmrg  need_version=no
34031bedbe3fSmrg  hardcode_into_libs=yes
34041bedbe3fSmrg  if test "$host_cpu" = ia64; then
34051bedbe3fSmrg    # AIX 5 supports IA64
34061bedbe3fSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
34071bedbe3fSmrg    shlibpath_var=LD_LIBRARY_PATH
34081bedbe3fSmrg  else
34091bedbe3fSmrg    # With GCC up to 2.95.x, collect2 would create an import file
34101bedbe3fSmrg    # for dependence libraries.  The import file would start with
34111bedbe3fSmrg    # the line `#! .'.  This would cause the generated library to
34121bedbe3fSmrg    # depend on `.', always an invalid library.  This was fixed in
34131bedbe3fSmrg    # development snapshots of GCC prior to 3.0.
34141bedbe3fSmrg    case $host_os in
34151bedbe3fSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
34161bedbe3fSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
34171bedbe3fSmrg	   echo ' yes '
34181bedbe3fSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
34191bedbe3fSmrg	:
34201bedbe3fSmrg      else
34211bedbe3fSmrg	can_build_shared=no
34221bedbe3fSmrg      fi
34231bedbe3fSmrg      ;;
34241bedbe3fSmrg    esac
34251bedbe3fSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
34261bedbe3fSmrg    # soname into executable. Probably we can add versioning support to
34271bedbe3fSmrg    # collect2, so additional links can be useful in future.
34281bedbe3fSmrg    if test "$aix_use_runtimelinking" = yes; then
34291bedbe3fSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
34301bedbe3fSmrg      # instead of lib<name>.a to let people know that these are not
34311bedbe3fSmrg      # typical AIX shared libraries.
34321bedbe3fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
34331bedbe3fSmrg    else
34341bedbe3fSmrg      # We preserve .a as extension for shared libraries through AIX4.2
34351bedbe3fSmrg      # and later when we are not doing run time linking.
34361bedbe3fSmrg      library_names_spec='${libname}${release}.a $libname.a'
34371bedbe3fSmrg      soname_spec='${libname}${release}${shared_ext}$major'
34381bedbe3fSmrg    fi
34391bedbe3fSmrg    shlibpath_var=LIBPATH
34401bedbe3fSmrg  fi
34411bedbe3fSmrg  ;;
3442ba6a1819Smrg
34431bedbe3fSmrgamigaos*)
34441bedbe3fSmrg  case $host_cpu in
34451bedbe3fSmrg  powerpc)
34461bedbe3fSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
34471bedbe3fSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
34481bedbe3fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
34491bedbe3fSmrg    ;;
34501bedbe3fSmrg  m68k)
34511bedbe3fSmrg    library_names_spec='$libname.ixlibrary $libname.a'
34521bedbe3fSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
34531bedbe3fSmrg    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'
34541bedbe3fSmrg    ;;
34551bedbe3fSmrg  esac
34561bedbe3fSmrg  ;;
3457549e21daSmrg
34581bedbe3fSmrgbeos*)
34591bedbe3fSmrg  library_names_spec='${libname}${shared_ext}'
34601bedbe3fSmrg  dynamic_linker="$host_os ld.so"
34611bedbe3fSmrg  shlibpath_var=LIBRARY_PATH
34621bedbe3fSmrg  ;;
3463ba6a1819Smrg
34641bedbe3fSmrgbsdi[[45]]*)
34651bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
34661bedbe3fSmrg  need_version=no
34671bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
34681bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
34691bedbe3fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
34701bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
34711bedbe3fSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
34721bedbe3fSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
34731bedbe3fSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
34741bedbe3fSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
34751bedbe3fSmrg  # libtool to hard-code these into programs
34761bedbe3fSmrg  ;;
3477ba6a1819Smrg
34781bedbe3fSmrgcygwin* | mingw* | pw32* | cegcc*)
34791bedbe3fSmrg  version_type=windows
34801bedbe3fSmrg  shrext_cmds=".dll"
34811bedbe3fSmrg  need_version=no
34821bedbe3fSmrg  need_lib_prefix=no
3483ba6a1819Smrg
34841bedbe3fSmrg  case $GCC,$cc_basename in
34851bedbe3fSmrg  yes,*)
34861bedbe3fSmrg    # gcc
34871bedbe3fSmrg    library_names_spec='$libname.dll.a'
34881bedbe3fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
34891bedbe3fSmrg    postinstall_cmds='base_file=`basename \${file}`~
34901bedbe3fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
34911bedbe3fSmrg      dldir=$destdir/`dirname \$dlpath`~
34921bedbe3fSmrg      test -d \$dldir || mkdir -p \$dldir~
34931bedbe3fSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
34941bedbe3fSmrg      chmod a+x \$dldir/$dlname~
34951bedbe3fSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
34961bedbe3fSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
34971bedbe3fSmrg      fi'
34981bedbe3fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
34991bedbe3fSmrg      dlpath=$dir/\$dldll~
35001bedbe3fSmrg       $RM \$dlpath'
35011bedbe3fSmrg    shlibpath_overrides_runpath=yes
3502ba6a1819Smrg
35031bedbe3fSmrg    case $host_os in
35041bedbe3fSmrg    cygwin*)
35051bedbe3fSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
35061bedbe3fSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
35071bedbe3fSmrgm4_if([$1], [],[
35081bedbe3fSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
35091bedbe3fSmrg      ;;
35101bedbe3fSmrg    mingw* | cegcc*)
35111bedbe3fSmrg      # MinGW DLLs use traditional 'lib' prefix
35121bedbe3fSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
35131bedbe3fSmrg      ;;
35141bedbe3fSmrg    pw32*)
35151bedbe3fSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
35161bedbe3fSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
35171bedbe3fSmrg      ;;
35181bedbe3fSmrg    esac
35191bedbe3fSmrg    dynamic_linker='Win32 ld.exe'
3520549e21daSmrg    ;;
3521549e21daSmrg
35221bedbe3fSmrg  *,cl*)
35231bedbe3fSmrg    # Native MSVC
35241bedbe3fSmrg    libname_spec='$name'
35251bedbe3fSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
35261bedbe3fSmrg    library_names_spec='${libname}.dll.lib'
35271bedbe3fSmrg
35281bedbe3fSmrg    case $build_os in
35291bedbe3fSmrg    mingw*)
35301bedbe3fSmrg      sys_lib_search_path_spec=
35311bedbe3fSmrg      lt_save_ifs=$IFS
35321bedbe3fSmrg      IFS=';'
35331bedbe3fSmrg      for lt_path in $LIB
35341bedbe3fSmrg      do
35351bedbe3fSmrg        IFS=$lt_save_ifs
35361bedbe3fSmrg        # Let DOS variable expansion print the short 8.3 style file name.
35371bedbe3fSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
35381bedbe3fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
35391bedbe3fSmrg      done
35401bedbe3fSmrg      IFS=$lt_save_ifs
35411bedbe3fSmrg      # Convert to MSYS style.
35421bedbe3fSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
35431bedbe3fSmrg      ;;
35441bedbe3fSmrg    cygwin*)
35451bedbe3fSmrg      # Convert to unix form, then to dos form, then back to unix form
35461bedbe3fSmrg      # but this time dos style (no spaces!) so that the unix form looks
35471bedbe3fSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
35481bedbe3fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
35491bedbe3fSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
35501bedbe3fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
35511bedbe3fSmrg      ;;
35521bedbe3fSmrg    *)
35531bedbe3fSmrg      sys_lib_search_path_spec="$LIB"
35541bedbe3fSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
35551bedbe3fSmrg        # It is most probably a Windows format PATH.
35561bedbe3fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
35571bedbe3fSmrg      else
35581bedbe3fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
35591bedbe3fSmrg      fi
35601bedbe3fSmrg      # FIXME: find the short name or the path components, as spaces are
35611bedbe3fSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
35621bedbe3fSmrg      ;;
35631bedbe3fSmrg    esac
3564ba6a1819Smrg
35651bedbe3fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
35661bedbe3fSmrg    postinstall_cmds='base_file=`basename \${file}`~
35671bedbe3fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
35681bedbe3fSmrg      dldir=$destdir/`dirname \$dlpath`~
35691bedbe3fSmrg      test -d \$dldir || mkdir -p \$dldir~
35701bedbe3fSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
35711bedbe3fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
35721bedbe3fSmrg      dlpath=$dir/\$dldll~
35731bedbe3fSmrg       $RM \$dlpath'
35741bedbe3fSmrg    shlibpath_overrides_runpath=yes
35751bedbe3fSmrg    dynamic_linker='Win32 link.exe'
3576ba6a1819Smrg    ;;
3577ba6a1819Smrg
3578ba6a1819Smrg  *)
35791bedbe3fSmrg    # Assume MSVC wrapper
35801bedbe3fSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
35811bedbe3fSmrg    dynamic_linker='Win32 ld.exe'
3582ba6a1819Smrg    ;;
3583ba6a1819Smrg  esac
35841bedbe3fSmrg  # FIXME: first we should search . and the directory the executable is in
35851bedbe3fSmrg  shlibpath_var=PATH
35861bedbe3fSmrg  ;;
3587ba6a1819Smrg
35881bedbe3fSmrgdarwin* | rhapsody*)
35891bedbe3fSmrg  dynamic_linker="$host_os dyld"
35901bedbe3fSmrg  version_type=darwin
35911bedbe3fSmrg  need_lib_prefix=no
35921bedbe3fSmrg  need_version=no
35931bedbe3fSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
35941bedbe3fSmrg  soname_spec='${libname}${release}${major}$shared_ext'
35951bedbe3fSmrg  shlibpath_overrides_runpath=yes
35961bedbe3fSmrg  shlibpath_var=DYLD_LIBRARY_PATH
35971bedbe3fSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
35981bedbe3fSmrgm4_if([$1], [],[
35991bedbe3fSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
36001bedbe3fSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
36011bedbe3fSmrg  ;;
3602ba6a1819Smrg
36031bedbe3fSmrgdgux*)
36041bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
36051bedbe3fSmrg  need_lib_prefix=no
36061bedbe3fSmrg  need_version=no
36071bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
36081bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36091bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
36101bedbe3fSmrg  ;;
3611ba6a1819Smrg
36121bedbe3fSmrgfreebsd* | dragonfly*)
36131bedbe3fSmrg  # DragonFly does not have aout.  When/if they implement a new
36141bedbe3fSmrg  # versioning mechanism, adjust this.
36151bedbe3fSmrg  if test -x /usr/bin/objformat; then
36161bedbe3fSmrg    objformat=`/usr/bin/objformat`
3617ba6a1819Smrg  else
36181bedbe3fSmrg    case $host_os in
36191bedbe3fSmrg    freebsd[[23]].*) objformat=aout ;;
36201bedbe3fSmrg    *) objformat=elf ;;
3621ba6a1819Smrg    esac
3622ba6a1819Smrg  fi
36231bedbe3fSmrg  version_type=freebsd-$objformat
36241bedbe3fSmrg  case $version_type in
36251bedbe3fSmrg    freebsd-elf*)
36261bedbe3fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
36271bedbe3fSmrg      need_version=no
36281bedbe3fSmrg      need_lib_prefix=no
36291bedbe3fSmrg      ;;
36301bedbe3fSmrg    freebsd-*)
36311bedbe3fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
36321bedbe3fSmrg      need_version=yes
36331bedbe3fSmrg      ;;
36341bedbe3fSmrg  esac
36351bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
3636ba6a1819Smrg  case $host_os in
36371bedbe3fSmrg  freebsd2.*)
36381bedbe3fSmrg    shlibpath_overrides_runpath=yes
3639ba6a1819Smrg    ;;
36401bedbe3fSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
36411bedbe3fSmrg    shlibpath_overrides_runpath=yes
36421bedbe3fSmrg    hardcode_into_libs=yes
3643549e21daSmrg    ;;
36441bedbe3fSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
36451bedbe3fSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
36461bedbe3fSmrg    shlibpath_overrides_runpath=no
36471bedbe3fSmrg    hardcode_into_libs=yes
3648549e21daSmrg    ;;
36491bedbe3fSmrg  *) # from 4.6 on, and DragonFly
36501bedbe3fSmrg    shlibpath_overrides_runpath=yes
36511bedbe3fSmrg    hardcode_into_libs=yes
36521bedbe3fSmrg    ;;
36531bedbe3fSmrg  esac
36541bedbe3fSmrg  ;;
36551bedbe3fSmrg
36561bedbe3fSmrggnu*)
36571bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
36581bedbe3fSmrg  need_lib_prefix=no
36591bedbe3fSmrg  need_version=no
36601bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
36611bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36621bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
36631bedbe3fSmrg  shlibpath_overrides_runpath=no
36641bedbe3fSmrg  hardcode_into_libs=yes
36651bedbe3fSmrg  ;;
36661bedbe3fSmrg
36671bedbe3fSmrghaiku*)
36681bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
36691bedbe3fSmrg  need_lib_prefix=no
36701bedbe3fSmrg  need_version=no
36711bedbe3fSmrg  dynamic_linker="$host_os runtime_loader"
36721bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
36731bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36741bedbe3fSmrg  shlibpath_var=LIBRARY_PATH
36751bedbe3fSmrg  shlibpath_overrides_runpath=yes
36761bedbe3fSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
36771bedbe3fSmrg  hardcode_into_libs=yes
36781bedbe3fSmrg  ;;
36791bedbe3fSmrg
36801bedbe3fSmrghpux9* | hpux10* | hpux11*)
36811bedbe3fSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
36821bedbe3fSmrg  # link against other versions.
36831bedbe3fSmrg  version_type=sunos
36841bedbe3fSmrg  need_lib_prefix=no
36851bedbe3fSmrg  need_version=no
36861bedbe3fSmrg  case $host_cpu in
36871bedbe3fSmrg  ia64*)
36881bedbe3fSmrg    shrext_cmds='.so'
36891bedbe3fSmrg    hardcode_into_libs=yes
36901bedbe3fSmrg    dynamic_linker="$host_os dld.so"
36911bedbe3fSmrg    shlibpath_var=LD_LIBRARY_PATH
36921bedbe3fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
36931bedbe3fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36941bedbe3fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
36951bedbe3fSmrg    if test "X$HPUX_IA64_MODE" = X32; then
36961bedbe3fSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
36971bedbe3fSmrg    else
36981bedbe3fSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
36991bedbe3fSmrg    fi
37001bedbe3fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
37011bedbe3fSmrg    ;;
37021bedbe3fSmrg  hppa*64*)
37031bedbe3fSmrg    shrext_cmds='.sl'
37041bedbe3fSmrg    hardcode_into_libs=yes
37051bedbe3fSmrg    dynamic_linker="$host_os dld.sl"
37061bedbe3fSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
37071bedbe3fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
37081bedbe3fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37091bedbe3fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
37101bedbe3fSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
37111bedbe3fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3712549e21daSmrg    ;;
3713ba6a1819Smrg  *)
37141bedbe3fSmrg    shrext_cmds='.sl'
37151bedbe3fSmrg    dynamic_linker="$host_os dld.sl"
37161bedbe3fSmrg    shlibpath_var=SHLIB_PATH
37171bedbe3fSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
37181bedbe3fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37191bedbe3fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
3720ba6a1819Smrg    ;;
3721ba6a1819Smrg  esac
37221bedbe3fSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
37231bedbe3fSmrg  postinstall_cmds='chmod 555 $lib'
37241bedbe3fSmrg  # or fails outright, so override atomically:
37251bedbe3fSmrg  install_override_mode=555
37261bedbe3fSmrg  ;;
3727ba6a1819Smrg
37281bedbe3fSmrginterix[[3-9]]*)
37291bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
37301bedbe3fSmrg  need_lib_prefix=no
37311bedbe3fSmrg  need_version=no
37321bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
37331bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
37341bedbe3fSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
37351bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
37361bedbe3fSmrg  shlibpath_overrides_runpath=no
37371bedbe3fSmrg  hardcode_into_libs=yes
37381bedbe3fSmrg  ;;
3739ba6a1819Smrg
37401bedbe3fSmrgirix5* | irix6* | nonstopux*)
37411bedbe3fSmrg  case $host_os in
37421bedbe3fSmrg    nonstopux*) version_type=nonstopux ;;
37431bedbe3fSmrg    *)
37441bedbe3fSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
37451bedbe3fSmrg		version_type=linux # correct to gnu/linux during the next big refactor
37461bedbe3fSmrg	else
37471bedbe3fSmrg		version_type=irix
37481bedbe3fSmrg	fi ;;
37491bedbe3fSmrg  esac
37501bedbe3fSmrg  need_lib_prefix=no
37511bedbe3fSmrg  need_version=no
37521bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
37531bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
37541bedbe3fSmrg  case $host_os in
37551bedbe3fSmrg  irix5* | nonstopux*)
37561bedbe3fSmrg    libsuff= shlibsuff=
37571bedbe3fSmrg    ;;
37581bedbe3fSmrg  *)
37591bedbe3fSmrg    case $LD in # libtool.m4 will add one of these switches to LD
37601bedbe3fSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
37611bedbe3fSmrg      libsuff= shlibsuff= libmagic=32-bit;;
37621bedbe3fSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
37631bedbe3fSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
37641bedbe3fSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
37651bedbe3fSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
37661bedbe3fSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
37671bedbe3fSmrg    esac
37681bedbe3fSmrg    ;;
37691bedbe3fSmrg  esac
37701bedbe3fSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
37711bedbe3fSmrg  shlibpath_overrides_runpath=no
37721bedbe3fSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
37731bedbe3fSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
37741bedbe3fSmrg  hardcode_into_libs=yes
37751bedbe3fSmrg  ;;
3776ba6a1819Smrg
37771bedbe3fSmrg# No shared lib support for Linux oldld, aout, or coff.
37781bedbe3fSmrglinux*oldld* | linux*aout* | linux*coff*)
37791bedbe3fSmrg  dynamic_linker=no
37801bedbe3fSmrg  ;;
3781ba6a1819Smrg
37821bedbe3fSmrg# This must be glibc/ELF.
37831bedbe3fSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
37841bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
37851bedbe3fSmrg  need_lib_prefix=no
37861bedbe3fSmrg  need_version=no
37871bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37881bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
37891bedbe3fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
37901bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
37911bedbe3fSmrg  shlibpath_overrides_runpath=no
3792ba6a1819Smrg
37931bedbe3fSmrg  # Some binutils ld are patched to set DT_RUNPATH
37941bedbe3fSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
37951bedbe3fSmrg    [lt_cv_shlibpath_overrides_runpath=no
37961bedbe3fSmrg    save_LDFLAGS=$LDFLAGS
37971bedbe3fSmrg    save_libdir=$libdir
37981bedbe3fSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
37991bedbe3fSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
38001bedbe3fSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
38011bedbe3fSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
38021bedbe3fSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
38031bedbe3fSmrg    LDFLAGS=$save_LDFLAGS
38041bedbe3fSmrg    libdir=$save_libdir
3805ba6a1819Smrg    ])
38061bedbe3fSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3807ba6a1819Smrg
38081bedbe3fSmrg  # This implies no fast_install, which is unacceptable.
38091bedbe3fSmrg  # Some rework will be needed to allow for fast_install
38101bedbe3fSmrg  # before this can be enabled.
38111bedbe3fSmrg  hardcode_into_libs=yes
3812ba6a1819Smrg
38131bedbe3fSmrg  # Append ld.so.conf contents to the search path
38141bedbe3fSmrg  if test -f /etc/ld.so.conf; then
38151bedbe3fSmrg    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' ' '`
38161bedbe3fSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
38171bedbe3fSmrg  fi
3818ba6a1819Smrg
38191bedbe3fSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
38201bedbe3fSmrg  # powerpc, because MkLinux only supported shared libraries with the
38211bedbe3fSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
38221bedbe3fSmrg  # most powerpc-linux boxes support dynamic linking these days and
38231bedbe3fSmrg  # people can always --disable-shared, the test was removed, and we
38241bedbe3fSmrg  # assume the GNU/Linux dynamic linker is in use.
38251bedbe3fSmrg  dynamic_linker='GNU/Linux ld.so'
38261bedbe3fSmrg  ;;
3827ba6a1819Smrg
38281bedbe3fSmrgnetbsd*)
38291bedbe3fSmrg  version_type=sunos
38301bedbe3fSmrg  need_lib_prefix=no
38311bedbe3fSmrg  need_version=no
38321bedbe3fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
38331bedbe3fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
38341bedbe3fSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
38351bedbe3fSmrg    dynamic_linker='NetBSD (a.out) ld.so'
38361bedbe3fSmrg  else
38371bedbe3fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
38381bedbe3fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
38391bedbe3fSmrg    dynamic_linker='NetBSD ld.elf_so'
38401bedbe3fSmrg  fi
38411bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
38421bedbe3fSmrg  shlibpath_overrides_runpath=yes
38431bedbe3fSmrg  hardcode_into_libs=yes
38441bedbe3fSmrg  ;;
3845ba6a1819Smrg
38461bedbe3fSmrgnewsos6)
38471bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38481bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38491bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
38501bedbe3fSmrg  shlibpath_overrides_runpath=yes
38511bedbe3fSmrg  ;;
3852549e21daSmrg
38531bedbe3fSmrg*nto* | *qnx*)
38541bedbe3fSmrg  version_type=qnx
38551bedbe3fSmrg  need_lib_prefix=no
38561bedbe3fSmrg  need_version=no
38571bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38581bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
38591bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
38601bedbe3fSmrg  shlibpath_overrides_runpath=no
38611bedbe3fSmrg  hardcode_into_libs=yes
38621bedbe3fSmrg  dynamic_linker='ldqnx.so'
38631bedbe3fSmrg  ;;
3864ba6a1819Smrg
38651bedbe3fSmrgopenbsd*)
38661bedbe3fSmrg  version_type=sunos
38671bedbe3fSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
38681bedbe3fSmrg  need_lib_prefix=no
38691bedbe3fSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
38701bedbe3fSmrg  case $host_os in
38711bedbe3fSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
38721bedbe3fSmrg    *)				need_version=no  ;;
38731bedbe3fSmrg  esac
38741bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
38751bedbe3fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
38761bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
38771bedbe3fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
38781bedbe3fSmrg    case $host_os in
38791bedbe3fSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
38801bedbe3fSmrg	shlibpath_overrides_runpath=no
38811bedbe3fSmrg	;;
38821bedbe3fSmrg      *)
38831bedbe3fSmrg	shlibpath_overrides_runpath=yes
38841bedbe3fSmrg	;;
38851bedbe3fSmrg      esac
38861bedbe3fSmrg  else
38871bedbe3fSmrg    shlibpath_overrides_runpath=yes
38881bedbe3fSmrg  fi
38891bedbe3fSmrg  ;;
3890ba6a1819Smrg
38911bedbe3fSmrgos2*)
38921bedbe3fSmrg  libname_spec='$name'
38931bedbe3fSmrg  shrext_cmds=".dll"
38941bedbe3fSmrg  need_lib_prefix=no
38951bedbe3fSmrg  library_names_spec='$libname${shared_ext} $libname.a'
38961bedbe3fSmrg  dynamic_linker='OS/2 ld.exe'
38971bedbe3fSmrg  shlibpath_var=LIBPATH
38981bedbe3fSmrg  ;;
3899ba6a1819Smrg
39001bedbe3fSmrgosf3* | osf4* | osf5*)
39011bedbe3fSmrg  version_type=osf
39021bedbe3fSmrg  need_lib_prefix=no
39031bedbe3fSmrg  need_version=no
39041bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
39051bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
39061bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
39071bedbe3fSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
39081bedbe3fSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
39091bedbe3fSmrg  ;;
3910ba6a1819Smrg
39111bedbe3fSmrgrdos*)
39121bedbe3fSmrg  dynamic_linker=no
39131bedbe3fSmrg  ;;
3914ba6a1819Smrg
39151bedbe3fSmrgsolaris*)
39161bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
39171bedbe3fSmrg  need_lib_prefix=no
39181bedbe3fSmrg  need_version=no
39191bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
39201bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
39211bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
39221bedbe3fSmrg  shlibpath_overrides_runpath=yes
39231bedbe3fSmrg  hardcode_into_libs=yes
39241bedbe3fSmrg  # ldd complains unless libraries are executable
39251bedbe3fSmrg  postinstall_cmds='chmod +x $lib'
39261bedbe3fSmrg  ;;
3927ba6a1819Smrg
39281bedbe3fSmrgsunos4*)
39291bedbe3fSmrg  version_type=sunos
39301bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
39311bedbe3fSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
39321bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
39331bedbe3fSmrg  shlibpath_overrides_runpath=yes
39341bedbe3fSmrg  if test "$with_gnu_ld" = yes; then
39351bedbe3fSmrg    need_lib_prefix=no
39361bedbe3fSmrg  fi
39371bedbe3fSmrg  need_version=yes
39381bedbe3fSmrg  ;;
3939ba6a1819Smrg
39401bedbe3fSmrgsysv4 | sysv4.3*)
39411bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
39421bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
39431bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
39441bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
39451bedbe3fSmrg  case $host_vendor in
39461bedbe3fSmrg    sni)
39471bedbe3fSmrg      shlibpath_overrides_runpath=no
39481bedbe3fSmrg      need_lib_prefix=no
39491bedbe3fSmrg      runpath_var=LD_RUN_PATH
39501bedbe3fSmrg      ;;
39511bedbe3fSmrg    siemens)
39521bedbe3fSmrg      need_lib_prefix=no
39531bedbe3fSmrg      ;;
39541bedbe3fSmrg    motorola)
39551bedbe3fSmrg      need_lib_prefix=no
39561bedbe3fSmrg      need_version=no
39571bedbe3fSmrg      shlibpath_overrides_runpath=no
39581bedbe3fSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
39591bedbe3fSmrg      ;;
39601bedbe3fSmrg  esac
39611bedbe3fSmrg  ;;
3962ba6a1819Smrg
39631bedbe3fSmrgsysv4*MP*)
39641bedbe3fSmrg  if test -d /usr/nec ;then
39651bedbe3fSmrg    version_type=linux # correct to gnu/linux during the next big refactor
39661bedbe3fSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
39671bedbe3fSmrg    soname_spec='$libname${shared_ext}.$major'
39681bedbe3fSmrg    shlibpath_var=LD_LIBRARY_PATH
39691bedbe3fSmrg  fi
39701bedbe3fSmrg  ;;
3971ba6a1819Smrg
39721bedbe3fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
39731bedbe3fSmrg  version_type=freebsd-elf
39741bedbe3fSmrg  need_lib_prefix=no
39751bedbe3fSmrg  need_version=no
39761bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
39771bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
39781bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
39791bedbe3fSmrg  shlibpath_overrides_runpath=yes
39801bedbe3fSmrg  hardcode_into_libs=yes
39811bedbe3fSmrg  if test "$with_gnu_ld" = yes; then
39821bedbe3fSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3983ba6a1819Smrg  else
39841bedbe3fSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
39851bedbe3fSmrg    case $host_os in
39861bedbe3fSmrg      sco3.2v5*)
39871bedbe3fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
39881bedbe3fSmrg	;;
39891bedbe3fSmrg    esac
3990ba6a1819Smrg  fi
39911bedbe3fSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
39921bedbe3fSmrg  ;;
3993ba6a1819Smrg
39941bedbe3fSmrgtpf*)
39951bedbe3fSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
39961bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
39971bedbe3fSmrg  need_lib_prefix=no
39981bedbe3fSmrg  need_version=no
39991bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
40001bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
40011bedbe3fSmrg  shlibpath_overrides_runpath=no
40021bedbe3fSmrg  hardcode_into_libs=yes
40031bedbe3fSmrg  ;;
4004ba6a1819Smrg
40051bedbe3fSmrguts4*)
40061bedbe3fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
40071bedbe3fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
40081bedbe3fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
40091bedbe3fSmrg  shlibpath_var=LD_LIBRARY_PATH
40101bedbe3fSmrg  ;;
4011ba6a1819Smrg
40121bedbe3fSmrg*)
40131bedbe3fSmrg  dynamic_linker=no
40141bedbe3fSmrg  ;;
40151bedbe3fSmrgesac
40161bedbe3fSmrgAC_MSG_RESULT([$dynamic_linker])
40171bedbe3fSmrgtest "$dynamic_linker" = no && can_build_shared=no
40181bedbe3fSmrg
40191bedbe3fSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
40201bedbe3fSmrgif test "$GCC" = yes; then
40211bedbe3fSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
40221bedbe3fSmrgfi
40231bedbe3fSmrg
40241bedbe3fSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
40251bedbe3fSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
40261bedbe3fSmrgfi
40271bedbe3fSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
40281bedbe3fSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
40291bedbe3fSmrgfi
40301bedbe3fSmrg
40311bedbe3fSmrg_LT_DECL([], [variables_saved_for_relink], [1],
40321bedbe3fSmrg    [Variables whose values should be saved in libtool wrapper scripts and
40331bedbe3fSmrg    restored at link time])
40341bedbe3fSmrg_LT_DECL([], [need_lib_prefix], [0],
40351bedbe3fSmrg    [Do we need the "lib" prefix for modules?])
40361bedbe3fSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
40371bedbe3fSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
40381bedbe3fSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
40391bedbe3fSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
40401bedbe3fSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
40411bedbe3fSmrg    [Is shlibpath searched before the hard-coded library search path?])
40421bedbe3fSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
40431bedbe3fSmrg_LT_DECL([], [library_names_spec], [1],
40441bedbe3fSmrg    [[List of archive names.  First name is the real one, the rest are links.
40451bedbe3fSmrg    The last name is the one that the linker finds with -lNAME]])
40461bedbe3fSmrg_LT_DECL([], [soname_spec], [1],
40471bedbe3fSmrg    [[The coded name of the library, if different from the real name]])
40481bedbe3fSmrg_LT_DECL([], [install_override_mode], [1],
40491bedbe3fSmrg    [Permission mode override for installation of shared libraries])
40501bedbe3fSmrg_LT_DECL([], [postinstall_cmds], [2],
40511bedbe3fSmrg    [Command to use after installation of a shared archive])
40521bedbe3fSmrg_LT_DECL([], [postuninstall_cmds], [2],
40531bedbe3fSmrg    [Command to use after uninstallation of a shared archive])
40541bedbe3fSmrg_LT_DECL([], [finish_cmds], [2],
40551bedbe3fSmrg    [Commands used to finish a libtool library installation in a directory])
40561bedbe3fSmrg_LT_DECL([], [finish_eval], [1],
40571bedbe3fSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
40581bedbe3fSmrg    not shown]])
40591bedbe3fSmrg_LT_DECL([], [hardcode_into_libs], [0],
40601bedbe3fSmrg    [Whether we should hardcode library paths into libraries])
40611bedbe3fSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
40621bedbe3fSmrg    [Compile-time system search path for libraries])
40631bedbe3fSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
40641bedbe3fSmrg    [Run-time system search path for libraries])
40651bedbe3fSmrg])# _LT_SYS_DYNAMIC_LINKER
40661bedbe3fSmrg
40671bedbe3fSmrg
40681bedbe3fSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
40691bedbe3fSmrg# --------------------------
40701bedbe3fSmrg# find a file program which can recognize shared library
40711bedbe3fSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
40721bedbe3fSmrg[m4_require([_LT_DECL_EGREP])dnl
40731bedbe3fSmrgAC_MSG_CHECKING([for $1])
40741bedbe3fSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
40751bedbe3fSmrg[case $MAGIC_CMD in
40761bedbe3fSmrg[[\\/*] |  ?:[\\/]*])
40771bedbe3fSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
40781bedbe3fSmrg  ;;
40791bedbe3fSmrg*)
40801bedbe3fSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
40811bedbe3fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
40821bedbe3fSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
40831bedbe3fSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
40841bedbe3fSmrgdnl not every word.  This closes a longstanding sh security hole.
40851bedbe3fSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
40861bedbe3fSmrg  for ac_dir in $ac_dummy; do
40871bedbe3fSmrg    IFS="$lt_save_ifs"
40881bedbe3fSmrg    test -z "$ac_dir" && ac_dir=.
40891bedbe3fSmrg    if test -f $ac_dir/$1; then
40901bedbe3fSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
40911bedbe3fSmrg      if test -n "$file_magic_test_file"; then
40921bedbe3fSmrg	case $deplibs_check_method in
40931bedbe3fSmrg	"file_magic "*)
40941bedbe3fSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
40951bedbe3fSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
40961bedbe3fSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
40971bedbe3fSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
40981bedbe3fSmrg	    :
40991bedbe3fSmrg	  else
41001bedbe3fSmrg	    cat <<_LT_EOF 1>&2
41011bedbe3fSmrg
41021bedbe3fSmrg*** Warning: the command libtool uses to detect shared libraries,
41031bedbe3fSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
41041bedbe3fSmrg*** The result is that libtool may fail to recognize shared libraries
41051bedbe3fSmrg*** as such.  This will affect the creation of libtool libraries that
41061bedbe3fSmrg*** depend on shared libraries, but programs linked with such libtool
41071bedbe3fSmrg*** libraries will work regardless of this problem.  Nevertheless, you
41081bedbe3fSmrg*** may want to report the problem to your system manager and/or to
41091bedbe3fSmrg*** bug-libtool@gnu.org
41101bedbe3fSmrg
41111bedbe3fSmrg_LT_EOF
41121bedbe3fSmrg	  fi ;;
41131bedbe3fSmrg	esac
41141bedbe3fSmrg      fi
41151bedbe3fSmrg      break
4116549e21daSmrg    fi
41171bedbe3fSmrg  done
41181bedbe3fSmrg  IFS="$lt_save_ifs"
41191bedbe3fSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
41201bedbe3fSmrg  ;;
41211bedbe3fSmrgesac])
41221bedbe3fSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
41231bedbe3fSmrgif test -n "$MAGIC_CMD"; then
41241bedbe3fSmrg  AC_MSG_RESULT($MAGIC_CMD)
41251bedbe3fSmrgelse
41261bedbe3fSmrg  AC_MSG_RESULT(no)
4127ba6a1819Smrgfi
41281bedbe3fSmrg_LT_DECL([], [MAGIC_CMD], [0],
41291bedbe3fSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
41301bedbe3fSmrg])# _LT_PATH_TOOL_PREFIX
4131ba6a1819Smrg
41321bedbe3fSmrg# Old name:
41331bedbe3fSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
41341bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
41351bedbe3fSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4136ba6a1819Smrg
41371bedbe3fSmrg
41381bedbe3fSmrg# _LT_PATH_MAGIC
41391bedbe3fSmrg# --------------
41401bedbe3fSmrg# find a file program which can recognize a shared library
41411bedbe3fSmrgm4_defun([_LT_PATH_MAGIC],
41421bedbe3fSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
41431bedbe3fSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
41441bedbe3fSmrg  if test -n "$ac_tool_prefix"; then
41451bedbe3fSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
41461bedbe3fSmrg  else
41471bedbe3fSmrg    MAGIC_CMD=:
41481bedbe3fSmrg  fi
41491bedbe3fSmrgfi
41501bedbe3fSmrg])# _LT_PATH_MAGIC
41511bedbe3fSmrg
41521bedbe3fSmrg
41531bedbe3fSmrg# LT_PATH_LD
41541bedbe3fSmrg# ----------
41551bedbe3fSmrg# find the pathname to the GNU or non-GNU linker
41561bedbe3fSmrgAC_DEFUN([LT_PATH_LD],
41571bedbe3fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
41581bedbe3fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
41591bedbe3fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
4160549e21daSmrgm4_require([_LT_DECL_SED])dnl
41611bedbe3fSmrgm4_require([_LT_DECL_EGREP])dnl
41621bedbe3fSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
41631bedbe3fSmrg
41641bedbe3fSmrgAC_ARG_WITH([gnu-ld],
41651bedbe3fSmrg    [AS_HELP_STRING([--with-gnu-ld],
41661bedbe3fSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
41671bedbe3fSmrg    [test "$withval" = no || with_gnu_ld=yes],
41681bedbe3fSmrg    [with_gnu_ld=no])dnl
41691bedbe3fSmrg
41701bedbe3fSmrgac_prog=ld
4171549e21daSmrgif test "$GCC" = yes; then
41721bedbe3fSmrg  # Check if gcc -print-prog-name=ld gives a path.
41731bedbe3fSmrg  AC_MSG_CHECKING([for ld used by $CC])
41741bedbe3fSmrg  case $host in
41751bedbe3fSmrg  *-*-mingw*)
41761bedbe3fSmrg    # gcc leaves a trailing carriage return which upsets mingw
41771bedbe3fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
41781bedbe3fSmrg  *)
41791bedbe3fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4180549e21daSmrg  esac
41811bedbe3fSmrg  case $ac_prog in
41821bedbe3fSmrg    # Accept absolute paths.
41831bedbe3fSmrg    [[\\/]]* | ?:[[\\/]]*)
41841bedbe3fSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
41851bedbe3fSmrg      # Canonicalize the pathname of ld
41861bedbe3fSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
41871bedbe3fSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
41881bedbe3fSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
41891bedbe3fSmrg      done
41901bedbe3fSmrg      test -z "$LD" && LD="$ac_prog"
41911bedbe3fSmrg      ;;
41921bedbe3fSmrg  "")
41931bedbe3fSmrg    # If it fails, then pretend we aren't using GCC.
41941bedbe3fSmrg    ac_prog=ld
4195549e21daSmrg    ;;
4196549e21daSmrg  *)
41971bedbe3fSmrg    # If it is relative, then search for the first ld in PATH.
41981bedbe3fSmrg    with_gnu_ld=unknown
4199549e21daSmrg    ;;
4200549e21daSmrg  esac
42011bedbe3fSmrgelif test "$with_gnu_ld" = yes; then
42021bedbe3fSmrg  AC_MSG_CHECKING([for GNU ld])
42031bedbe3fSmrgelse
42041bedbe3fSmrg  AC_MSG_CHECKING([for non-GNU ld])
42051bedbe3fSmrgfi
42061bedbe3fSmrgAC_CACHE_VAL(lt_cv_path_LD,
42071bedbe3fSmrg[if test -z "$LD"; then
42081bedbe3fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
42091bedbe3fSmrg  for ac_dir in $PATH; do
42101bedbe3fSmrg    IFS="$lt_save_ifs"
42111bedbe3fSmrg    test -z "$ac_dir" && ac_dir=.
42121bedbe3fSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
42131bedbe3fSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
42141bedbe3fSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
42151bedbe3fSmrg      # but apparently some variants of GNU ld only accept -v.
42161bedbe3fSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
42171bedbe3fSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
42181bedbe3fSmrg      *GNU* | *'with BFD'*)
42191bedbe3fSmrg	test "$with_gnu_ld" != no && break
42201bedbe3fSmrg	;;
42211bedbe3fSmrg      *)
42221bedbe3fSmrg	test "$with_gnu_ld" != yes && break
42231bedbe3fSmrg	;;
42241bedbe3fSmrg      esac
4225549e21daSmrg    fi
4226549e21daSmrg  done
42271bedbe3fSmrg  IFS="$lt_save_ifs"
4228549e21daSmrgelse
42291bedbe3fSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4230549e21daSmrgfi])
42311bedbe3fSmrgLD="$lt_cv_path_LD"
42321bedbe3fSmrgif test -n "$LD"; then
42331bedbe3fSmrg  AC_MSG_RESULT($LD)
42341bedbe3fSmrgelse
42351bedbe3fSmrg  AC_MSG_RESULT(no)
42361bedbe3fSmrgfi
42371bedbe3fSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
42381bedbe3fSmrg_LT_PATH_LD_GNU
42391bedbe3fSmrgAC_SUBST([LD])
4240ba6a1819Smrg
42411bedbe3fSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
42421bedbe3fSmrg])# LT_PATH_LD
4243ba6a1819Smrg
42441bedbe3fSmrg# Old names:
42451bedbe3fSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
42461bedbe3fSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
42471bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
42481bedbe3fSmrgdnl AC_DEFUN([AM_PROG_LD], [])
42491bedbe3fSmrgdnl AC_DEFUN([AC_PROG_LD], [])
4250ba6a1819Smrg
4251ba6a1819Smrg
42521bedbe3fSmrg# _LT_PATH_LD_GNU
42531bedbe3fSmrg#- --------------
42541bedbe3fSmrgm4_defun([_LT_PATH_LD_GNU],
42551bedbe3fSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
42561bedbe3fSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
42571bedbe3fSmrgcase `$LD -v 2>&1 </dev/null` in
42581bedbe3fSmrg*GNU* | *'with BFD'*)
42591bedbe3fSmrg  lt_cv_prog_gnu_ld=yes
4260ba6a1819Smrg  ;;
42611bedbe3fSmrg*)
42621bedbe3fSmrg  lt_cv_prog_gnu_ld=no
42631bedbe3fSmrg  ;;
42641bedbe3fSmrgesac])
42651bedbe3fSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
42661bedbe3fSmrg])# _LT_PATH_LD_GNU
4267ba6a1819Smrg
42681bedbe3fSmrg
42691bedbe3fSmrg# _LT_CMD_RELOAD
42701bedbe3fSmrg# --------------
42711bedbe3fSmrg# find reload flag for linker
42721bedbe3fSmrg#   -- PORTME Some linkers may need a different reload flag.
42731bedbe3fSmrgm4_defun([_LT_CMD_RELOAD],
42741bedbe3fSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
42751bedbe3fSmrg  lt_cv_ld_reload_flag,
42761bedbe3fSmrg  [lt_cv_ld_reload_flag='-r'])
42771bedbe3fSmrgreload_flag=$lt_cv_ld_reload_flag
42781bedbe3fSmrgcase $reload_flag in
42791bedbe3fSmrg"" | " "*) ;;
42801bedbe3fSmrg*) reload_flag=" $reload_flag" ;;
42811bedbe3fSmrgesac
42821bedbe3fSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
42831bedbe3fSmrgcase $host_os in
42841bedbe3fSmrg  cygwin* | mingw* | pw32* | cegcc*)
42851bedbe3fSmrg    if test "$GCC" != yes; then
42861bedbe3fSmrg      reload_cmds=false
42871bedbe3fSmrg    fi
4288549e21daSmrg    ;;
42891bedbe3fSmrg  darwin*)
42901bedbe3fSmrg    if test "$GCC" = yes; then
42911bedbe3fSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
42921bedbe3fSmrg    else
42931bedbe3fSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
42941bedbe3fSmrg    fi
4295549e21daSmrg    ;;
42961bedbe3fSmrgesac
42971bedbe3fSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
42981bedbe3fSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
42991bedbe3fSmrg])# _LT_CMD_RELOAD
43001bedbe3fSmrg
43011bedbe3fSmrg
43021bedbe3fSmrg# _LT_CHECK_MAGIC_METHOD
43031bedbe3fSmrg# ----------------------
43041bedbe3fSmrg# how to check for library dependencies
43051bedbe3fSmrg#  -- PORTME fill in with the dynamic library characteristics
43061bedbe3fSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
43071bedbe3fSmrg[m4_require([_LT_DECL_EGREP])
43081bedbe3fSmrgm4_require([_LT_DECL_OBJDUMP])
43091bedbe3fSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
43101bedbe3fSmrglt_cv_deplibs_check_method,
43111bedbe3fSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
43121bedbe3fSmrglt_cv_file_magic_test_file=
43131bedbe3fSmrglt_cv_deplibs_check_method='unknown'
43141bedbe3fSmrg# Need to set the preceding variable on all platforms that support
43151bedbe3fSmrg# interlibrary dependencies.
43161bedbe3fSmrg# 'none' -- dependencies not supported.
43171bedbe3fSmrg# `unknown' -- same as none, but documents that we really don't know.
43181bedbe3fSmrg# 'pass_all' -- all dependencies passed with no checks.
43191bedbe3fSmrg# 'test_compile' -- check by making test program.
43201bedbe3fSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
43211bedbe3fSmrg# which responds to the $file_magic_cmd with a given extended regex.
43221bedbe3fSmrg# If you have `file' or equivalent on your system and you're not sure
43231bedbe3fSmrg# whether `pass_all' will *always* work, you probably want this one.
43241bedbe3fSmrg
43251bedbe3fSmrgcase $host_os in
43261bedbe3fSmrgaix[[4-9]]*)
43271bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4328ba6a1819Smrg  ;;
4329ba6a1819Smrg
4330ba6a1819Smrgbeos*)
43311bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4332ba6a1819Smrg  ;;
4333ba6a1819Smrg
4334ba6a1819Smrgbsdi[[45]]*)
43351bedbe3fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
43361bedbe3fSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
43371bedbe3fSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
4338ba6a1819Smrg  ;;
4339ba6a1819Smrg
43401bedbe3fSmrgcygwin*)
43411bedbe3fSmrg  # func_win32_libid is a shell function defined in ltmain.sh
43421bedbe3fSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
43431bedbe3fSmrg  lt_cv_file_magic_cmd='func_win32_libid'
43441bedbe3fSmrg  ;;
4345ba6a1819Smrg
43461bedbe3fSmrgmingw* | pw32*)
43471bedbe3fSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
43481bedbe3fSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
43491bedbe3fSmrg  # unless we find 'file', for example because we are cross-compiling.
43501bedbe3fSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
43511bedbe3fSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
43521bedbe3fSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
43531bedbe3fSmrg    lt_cv_file_magic_cmd='func_win32_libid'
43541bedbe3fSmrg  else
43551bedbe3fSmrg    # Keep this pattern in sync with the one in func_win32_libid.
43561bedbe3fSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
43571bedbe3fSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
43581bedbe3fSmrg  fi
4359ba6a1819Smrg  ;;
4360ba6a1819Smrg
43611bedbe3fSmrgcegcc*)
43621bedbe3fSmrg  # use the weaker test based on 'objdump'. See mingw*.
43631bedbe3fSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
43641bedbe3fSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
4365ba6a1819Smrg  ;;
4366ba6a1819Smrg
43671bedbe3fSmrgdarwin* | rhapsody*)
43681bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4369ba6a1819Smrg  ;;
4370ba6a1819Smrg
4371ba6a1819Smrgfreebsd* | dragonfly*)
43721bedbe3fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
43731bedbe3fSmrg    case $host_cpu in
43741bedbe3fSmrg    i*86 )
43751bedbe3fSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
43761bedbe3fSmrg      # Let's accept both of them until this is cleared up.
43771bedbe3fSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
43781bedbe3fSmrg      lt_cv_file_magic_cmd=/usr/bin/file
43791bedbe3fSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
43801bedbe3fSmrg      ;;
4381ba6a1819Smrg    esac
43821bedbe3fSmrg  else
43831bedbe3fSmrg    lt_cv_deplibs_check_method=pass_all
4384ba6a1819Smrg  fi
4385ba6a1819Smrg  ;;
4386ba6a1819Smrg
4387ba6a1819Smrggnu*)
43881bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4389ba6a1819Smrg  ;;
4390ba6a1819Smrg
4391549e21daSmrghaiku*)
43921bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4393549e21daSmrg  ;;
4394549e21daSmrg
43951bedbe3fSmrghpux10.20* | hpux11*)
43961bedbe3fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
4397ba6a1819Smrg  case $host_cpu in
4398ba6a1819Smrg  ia64*)
43991bedbe3fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
44001bedbe3fSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4401ba6a1819Smrg    ;;
4402549e21daSmrg  hppa*64*)
44031bedbe3fSmrg    [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]']
44041bedbe3fSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4405549e21daSmrg    ;;
4406549e21daSmrg  *)
44071bedbe3fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
44081bedbe3fSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4409ba6a1819Smrg    ;;
4410ba6a1819Smrg  esac
4411ba6a1819Smrg  ;;
4412ba6a1819Smrg
4413549e21daSmrginterix[[3-9]]*)
44141bedbe3fSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
44151bedbe3fSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4416ba6a1819Smrg  ;;
4417ba6a1819Smrg
4418ba6a1819Smrgirix5* | irix6* | nonstopux*)
44191bedbe3fSmrg  case $LD in
44201bedbe3fSmrg  *-32|*"-32 ") libmagic=32-bit;;
44211bedbe3fSmrg  *-n32|*"-n32 ") libmagic=N32;;
44221bedbe3fSmrg  *-64|*"-64 ") libmagic=64-bit;;
44231bedbe3fSmrg  *) libmagic=never-match;;
4424ba6a1819Smrg  esac
44251bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4426ba6a1819Smrg  ;;
4427ba6a1819Smrg
44281bedbe3fSmrg# This must be glibc/ELF.
44291bedbe3fSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
44301bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4431ba6a1819Smrg  ;;
4432ba6a1819Smrg
44331bedbe3fSmrgnetbsd*)
44341bedbe3fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
44351bedbe3fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
44361bedbe3fSmrg  else
44371bedbe3fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
44381bedbe3fSmrg  fi
44391bedbe3fSmrg  ;;
4440549e21daSmrg
44411bedbe3fSmrgnewos6*)
44421bedbe3fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
44431bedbe3fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
44441bedbe3fSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4445ba6a1819Smrg  ;;
4446ba6a1819Smrg
4447549e21daSmrg*nto* | *qnx*)
44481bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4449ba6a1819Smrg  ;;
4450ba6a1819Smrg
4451ba6a1819Smrgopenbsd*)
4452549e21daSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
44531bedbe3fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4454ba6a1819Smrg  else
44551bedbe3fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4456ba6a1819Smrg  fi
4457ba6a1819Smrg  ;;
4458ba6a1819Smrg
4459ba6a1819Smrgosf3* | osf4* | osf5*)
44601bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4461ba6a1819Smrg  ;;
4462ba6a1819Smrg
4463549e21daSmrgrdos*)
44641bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4465549e21daSmrg  ;;
4466549e21daSmrg
4467ba6a1819Smrgsolaris*)
44681bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4469ba6a1819Smrg  ;;
4470ba6a1819Smrg
44711bedbe3fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
44721bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4473ba6a1819Smrg  ;;
4474ba6a1819Smrg
4475ba6a1819Smrgsysv4 | sysv4.3*)
4476ba6a1819Smrg  case $host_vendor in
44771bedbe3fSmrg  motorola)
44781bedbe3fSmrg    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]]'
44791bedbe3fSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
44801bedbe3fSmrg    ;;
44811bedbe3fSmrg  ncr)
44821bedbe3fSmrg    lt_cv_deplibs_check_method=pass_all
44831bedbe3fSmrg    ;;
44841bedbe3fSmrg  sequent)
44851bedbe3fSmrg    lt_cv_file_magic_cmd='/bin/file'
44861bedbe3fSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
44871bedbe3fSmrg    ;;
44881bedbe3fSmrg  sni)
44891bedbe3fSmrg    lt_cv_file_magic_cmd='/bin/file'
44901bedbe3fSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
44911bedbe3fSmrg    lt_cv_file_magic_test_file=/lib/libc.so
44921bedbe3fSmrg    ;;
44931bedbe3fSmrg  siemens)
44941bedbe3fSmrg    lt_cv_deplibs_check_method=pass_all
44951bedbe3fSmrg    ;;
44961bedbe3fSmrg  pc)
44971bedbe3fSmrg    lt_cv_deplibs_check_method=pass_all
44981bedbe3fSmrg    ;;
4499ba6a1819Smrg  esac
4500ba6a1819Smrg  ;;
4501ba6a1819Smrg
4502549e21daSmrgtpf*)
45031bedbe3fSmrg  lt_cv_deplibs_check_method=pass_all
4504ba6a1819Smrg  ;;
4505ba6a1819Smrgesac
45061bedbe3fSmrg])
4507ba6a1819Smrg
45081bedbe3fSmrgfile_magic_glob=
45091bedbe3fSmrgwant_nocaseglob=no
45101bedbe3fSmrgif test "$build" = "$host"; then
45111bedbe3fSmrg  case $host_os in
45121bedbe3fSmrg  mingw* | pw32*)
45131bedbe3fSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
45141bedbe3fSmrg      want_nocaseglob=yes
45151bedbe3fSmrg    else
45161bedbe3fSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
45171bedbe3fSmrg    fi
45181bedbe3fSmrg    ;;
45191bedbe3fSmrg  esac
4520ba6a1819Smrgfi
4521ba6a1819Smrg
45221bedbe3fSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
45231bedbe3fSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
45241bedbe3fSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
4525ba6a1819Smrg
45261bedbe3fSmrg_LT_DECL([], [deplibs_check_method], [1],
45271bedbe3fSmrg    [Method to check whether dependent libraries are shared objects])
45281bedbe3fSmrg_LT_DECL([], [file_magic_cmd], [1],
45291bedbe3fSmrg    [Command to use when deplibs_check_method = "file_magic"])
45301bedbe3fSmrg_LT_DECL([], [file_magic_glob], [1],
45311bedbe3fSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
45321bedbe3fSmrg_LT_DECL([], [want_nocaseglob], [1],
45331bedbe3fSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
45341bedbe3fSmrg])# _LT_CHECK_MAGIC_METHOD
4535ba6a1819Smrg
4536ba6a1819Smrg
45371bedbe3fSmrg# LT_PATH_NM
45381bedbe3fSmrg# ----------
45391bedbe3fSmrg# find the pathname to a BSD- or MS-compatible name lister
45401bedbe3fSmrgAC_DEFUN([LT_PATH_NM],
45411bedbe3fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
45421bedbe3fSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
45431bedbe3fSmrg[if test -n "$NM"; then
45441bedbe3fSmrg  # Let the user override the test.
45451bedbe3fSmrg  lt_cv_path_NM="$NM"
45461bedbe3fSmrgelse
45471bedbe3fSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
45481bedbe3fSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
45491bedbe3fSmrg    lt_nm_to_check="$lt_nm_to_check nm"
45501bedbe3fSmrg  fi
45511bedbe3fSmrg  for lt_tmp_nm in $lt_nm_to_check; do
45521bedbe3fSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
45531bedbe3fSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
45541bedbe3fSmrg      IFS="$lt_save_ifs"
45551bedbe3fSmrg      test -z "$ac_dir" && ac_dir=.
45561bedbe3fSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
45571bedbe3fSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
45581bedbe3fSmrg	# Check to see if the nm accepts a BSD-compat flag.
45591bedbe3fSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
45601bedbe3fSmrg	#   nm: unknown option "B" ignored
45611bedbe3fSmrg	# Tru64's nm complains that /dev/null is an invalid object file
45621bedbe3fSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
45631bedbe3fSmrg	*/dev/null* | *'Invalid file or object type'*)
45641bedbe3fSmrg	  lt_cv_path_NM="$tmp_nm -B"
45651bedbe3fSmrg	  break
45661bedbe3fSmrg	  ;;
45671bedbe3fSmrg	*)
45681bedbe3fSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
45691bedbe3fSmrg	  */dev/null*)
45701bedbe3fSmrg	    lt_cv_path_NM="$tmp_nm -p"
45711bedbe3fSmrg	    break
45721bedbe3fSmrg	    ;;
45731bedbe3fSmrg	  *)
45741bedbe3fSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
45751bedbe3fSmrg	    continue # so that we can try to find one that supports BSD flags
45761bedbe3fSmrg	    ;;
45771bedbe3fSmrg	  esac
45781bedbe3fSmrg	  ;;
4579ba6a1819Smrg	esac
4580ba6a1819Smrg      fi
45811bedbe3fSmrg    done
45821bedbe3fSmrg    IFS="$lt_save_ifs"
4583ba6a1819Smrg  done
45841bedbe3fSmrg  : ${lt_cv_path_NM=no}
45851bedbe3fSmrgfi])
45861bedbe3fSmrgif test "$lt_cv_path_NM" != "no"; then
45871bedbe3fSmrg  NM="$lt_cv_path_NM"
4588ba6a1819Smrgelse
45891bedbe3fSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
45901bedbe3fSmrg  if test -n "$DUMPBIN"; then :
45911bedbe3fSmrg    # Let the user override the test.
4592ba6a1819Smrg  else
45931bedbe3fSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
45941bedbe3fSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
45951bedbe3fSmrg    *COFF*)
45961bedbe3fSmrg      DUMPBIN="$DUMPBIN -symbols"
45971bedbe3fSmrg      ;;
45981bedbe3fSmrg    *)
45991bedbe3fSmrg      DUMPBIN=:
46001bedbe3fSmrg      ;;
46011bedbe3fSmrg    esac
46021bedbe3fSmrg  fi
46031bedbe3fSmrg  AC_SUBST([DUMPBIN])
46041bedbe3fSmrg  if test "$DUMPBIN" != ":"; then
46051bedbe3fSmrg    NM="$DUMPBIN"
4606ba6a1819Smrg  fi
4607ba6a1819Smrgfi
46081bedbe3fSmrgtest -z "$NM" && NM=nm
46091bedbe3fSmrgAC_SUBST([NM])
46101bedbe3fSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4611ba6a1819Smrg
46121bedbe3fSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
46131bedbe3fSmrg  [lt_cv_nm_interface="BSD nm"
46141bedbe3fSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
46151bedbe3fSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
46161bedbe3fSmrg  (eval "$ac_compile" 2>conftest.err)
46171bedbe3fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
46181bedbe3fSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
46191bedbe3fSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
46201bedbe3fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
46211bedbe3fSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
46221bedbe3fSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
46231bedbe3fSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
46241bedbe3fSmrg    lt_cv_nm_interface="MS dumpbin"
46251bedbe3fSmrg  fi
46261bedbe3fSmrg  rm -f conftest*])
46271bedbe3fSmrg])# LT_PATH_NM
4628ba6a1819Smrg
46291bedbe3fSmrg# Old names:
46301bedbe3fSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
46311bedbe3fSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
46321bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
46331bedbe3fSmrgdnl AC_DEFUN([AM_PROG_NM], [])
46341bedbe3fSmrgdnl AC_DEFUN([AC_PROG_NM], [])
4635549e21daSmrg
46361bedbe3fSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
46371bedbe3fSmrg# --------------------------------
46381bedbe3fSmrg# how to determine the name of the shared library
46391bedbe3fSmrg# associated with a specific link library.
46401bedbe3fSmrg#  -- PORTME fill in with the dynamic library characteristics
46411bedbe3fSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
46421bedbe3fSmrg[m4_require([_LT_DECL_EGREP])
46431bedbe3fSmrgm4_require([_LT_DECL_OBJDUMP])
46441bedbe3fSmrgm4_require([_LT_DECL_DLLTOOL])
46451bedbe3fSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
46461bedbe3fSmrglt_cv_sharedlib_from_linklib_cmd,
46471bedbe3fSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
4648549e21daSmrg
46491bedbe3fSmrgcase $host_os in
46501bedbe3fSmrgcygwin* | mingw* | pw32* | cegcc*)
46511bedbe3fSmrg  # two different shell functions defined in ltmain.sh
46521bedbe3fSmrg  # decide which to use based on capabilities of $DLLTOOL
46531bedbe3fSmrg  case `$DLLTOOL --help 2>&1` in
46541bedbe3fSmrg  *--identify-strict*)
46551bedbe3fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4656ba6a1819Smrg    ;;
4657ba6a1819Smrg  *)
46581bedbe3fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4659ba6a1819Smrg    ;;
4660ba6a1819Smrg  esac
46611bedbe3fSmrg  ;;
46621bedbe3fSmrg*)
46631bedbe3fSmrg  # fallback: assume linklib IS sharedlib
46641bedbe3fSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
46651bedbe3fSmrg  ;;
46661bedbe3fSmrgesac
46671bedbe3fSmrg])
46681bedbe3fSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
46691bedbe3fSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
46701bedbe3fSmrg
46711bedbe3fSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
46721bedbe3fSmrg    [Command to associate shared and link libraries])
46731bedbe3fSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
46741bedbe3fSmrg
46751bedbe3fSmrg
46761bedbe3fSmrg# _LT_PATH_MANIFEST_TOOL
46771bedbe3fSmrg# ----------------------
46781bedbe3fSmrg# locate the manifest tool
46791bedbe3fSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
46801bedbe3fSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
46811bedbe3fSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
46821bedbe3fSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
46831bedbe3fSmrg  [lt_cv_path_mainfest_tool=no
46841bedbe3fSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
46851bedbe3fSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
46861bedbe3fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
46871bedbe3fSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
46881bedbe3fSmrg    lt_cv_path_mainfest_tool=yes
46891bedbe3fSmrg  fi
46901bedbe3fSmrg  rm -f conftest*])
46911bedbe3fSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
46921bedbe3fSmrg  MANIFEST_TOOL=:
4693ba6a1819Smrgfi
46941bedbe3fSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
46951bedbe3fSmrg])# _LT_PATH_MANIFEST_TOOL
4696ba6a1819Smrg
4697549e21daSmrg
46981bedbe3fSmrg# LT_LIB_M
46991bedbe3fSmrg# --------
47001bedbe3fSmrg# check for math library
47011bedbe3fSmrgAC_DEFUN([LT_LIB_M],
47021bedbe3fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
47031bedbe3fSmrgLIBM=
47041bedbe3fSmrgcase $host in
47051bedbe3fSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
47061bedbe3fSmrg  # These system don't have libm, or don't need it
47071bedbe3fSmrg  ;;
47081bedbe3fSmrg*-ncr-sysv4.3*)
47091bedbe3fSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
47101bedbe3fSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4711ba6a1819Smrg  ;;
4712ba6a1819Smrg*)
47131bedbe3fSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
4714ba6a1819Smrg  ;;
47151bedbe3fSmrgesac
47161bedbe3fSmrgAC_SUBST([LIBM])
47171bedbe3fSmrg])# LT_LIB_M
4718ba6a1819Smrg
47191bedbe3fSmrg# Old name:
47201bedbe3fSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
47211bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
47221bedbe3fSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
4723ba6a1819Smrg
4724ba6a1819Smrg
47251bedbe3fSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
47261bedbe3fSmrg# -------------------------------
47271bedbe3fSmrgm4_defun([_LT_COMPILER_NO_RTTI],
47281bedbe3fSmrg[m4_require([_LT_TAG_COMPILER])dnl
4729ba6a1819Smrg
47301bedbe3fSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
47311bedbe3fSmrg
47321bedbe3fSmrgif test "$GCC" = yes; then
47331bedbe3fSmrg  case $cc_basename in
47341bedbe3fSmrg  nvcc*)
47351bedbe3fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
47361bedbe3fSmrg  *)
47371bedbe3fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
47381bedbe3fSmrg  esac
47391bedbe3fSmrg
47401bedbe3fSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
47411bedbe3fSmrg    lt_cv_prog_compiler_rtti_exceptions,
47421bedbe3fSmrg    [-fno-rtti -fno-exceptions], [],
47431bedbe3fSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
47441bedbe3fSmrgfi
47451bedbe3fSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
47461bedbe3fSmrg	[Compiler flag to turn off builtin functions])
47471bedbe3fSmrg])# _LT_COMPILER_NO_RTTI
47481bedbe3fSmrg
47491bedbe3fSmrg
47501bedbe3fSmrg# _LT_CMD_GLOBAL_SYMBOLS
4751549e21daSmrg# ----------------------
47521bedbe3fSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
47531bedbe3fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
47541bedbe3fSmrgAC_REQUIRE([AC_PROG_CC])dnl
47551bedbe3fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
47561bedbe3fSmrgAC_REQUIRE([LT_PATH_NM])dnl
47571bedbe3fSmrgAC_REQUIRE([LT_PATH_LD])dnl
47581bedbe3fSmrgm4_require([_LT_DECL_SED])dnl
47591bedbe3fSmrgm4_require([_LT_DECL_EGREP])dnl
47601bedbe3fSmrgm4_require([_LT_TAG_COMPILER])dnl
4761ba6a1819Smrg
47621bedbe3fSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
47631bedbe3fSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
47641bedbe3fSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
47651bedbe3fSmrg[
47661bedbe3fSmrg# These are sane defaults that work on at least a few old systems.
47671bedbe3fSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4768ba6a1819Smrg
47691bedbe3fSmrg# Character class describing NM global symbol codes.
47701bedbe3fSmrgsymcode='[[BCDEGRST]]'
4771ba6a1819Smrg
47721bedbe3fSmrg# Regexp to match symbols that can be accessed directly from C.
47731bedbe3fSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4774ba6a1819Smrg
47751bedbe3fSmrg# Define system-specific variables.
47761bedbe3fSmrgcase $host_os in
47771bedbe3fSmrgaix*)
47781bedbe3fSmrg  symcode='[[BCDT]]'
4779ba6a1819Smrg  ;;
47801bedbe3fSmrgcygwin* | mingw* | pw32* | cegcc*)
47811bedbe3fSmrg  symcode='[[ABCDGISTW]]'
47821bedbe3fSmrg  ;;
47831bedbe3fSmrghpux*)
47841bedbe3fSmrg  if test "$host_cpu" = ia64; then
47851bedbe3fSmrg    symcode='[[ABCDEGRST]]'
4786549e21daSmrg  fi
4787549e21daSmrg  ;;
47881bedbe3fSmrgirix* | nonstopux*)
47891bedbe3fSmrg  symcode='[[BCDEGRST]]'
4790ba6a1819Smrg  ;;
47911bedbe3fSmrgosf*)
47921bedbe3fSmrg  symcode='[[BCDEGQRST]]'
4793ba6a1819Smrg  ;;
47941bedbe3fSmrgsolaris*)
47951bedbe3fSmrg  symcode='[[BDRT]]'
4796ba6a1819Smrg  ;;
47971bedbe3fSmrgsco3.2v5*)
47981bedbe3fSmrg  symcode='[[DT]]'
4799ba6a1819Smrg  ;;
48001bedbe3fSmrgsysv4.2uw2*)
48011bedbe3fSmrg  symcode='[[DT]]'
48021bedbe3fSmrg  ;;
48031bedbe3fSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
48041bedbe3fSmrg  symcode='[[ABDT]]'
4805549e21daSmrg  ;;
48061bedbe3fSmrgsysv4)
48071bedbe3fSmrg  symcode='[[DFNSTU]]'
48081bedbe3fSmrg  ;;
48091bedbe3fSmrgesac
4810549e21daSmrg
48111bedbe3fSmrg# If we're using GNU nm, then use its standard symbol codes.
48121bedbe3fSmrgcase `$NM -V 2>&1` in
48131bedbe3fSmrg*GNU* | *'with BFD'*)
48141bedbe3fSmrg  symcode='[[ABCDGIRSTW]]' ;;
48151bedbe3fSmrgesac
4816ba6a1819Smrg
48171bedbe3fSmrg# Transform an extracted symbol line into a proper C declaration.
48181bedbe3fSmrg# Some systems (esp. on ia64) link data and code symbols differently,
48191bedbe3fSmrg# so use this general approach.
48201bedbe3fSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4821ba6a1819Smrg
48221bedbe3fSmrg# Transform an extracted symbol line into symbol name and symbol address
48231bedbe3fSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
48241bedbe3fSmrglt_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'"
4825ba6a1819Smrg
48261bedbe3fSmrg# Handle CRLF in mingw tool chain
48271bedbe3fSmrgopt_cr=
48281bedbe3fSmrgcase $build_os in
48291bedbe3fSmrgmingw*)
48301bedbe3fSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4831ba6a1819Smrg  ;;
48321bedbe3fSmrgesac
4833ba6a1819Smrg
48341bedbe3fSmrg# Try without a prefix underscore, then with it.
48351bedbe3fSmrgfor ac_symprfx in "" "_"; do
48361bedbe3fSmrg
48371bedbe3fSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
48381bedbe3fSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
48391bedbe3fSmrg
48401bedbe3fSmrg  # Write the raw and C identifiers.
48411bedbe3fSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
48421bedbe3fSmrg    # Fake it for dumpbin and say T for any non-static function
48431bedbe3fSmrg    # and D for any global variable.
48441bedbe3fSmrg    # Also find C++ and __fastcall symbols from MSVC++,
48451bedbe3fSmrg    # which start with @ or ?.
48461bedbe3fSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
48471bedbe3fSmrg"     {last_section=section; section=\$ 3};"\
48481bedbe3fSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
48491bedbe3fSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
48501bedbe3fSmrg"     \$ 0!~/External *\|/{next};"\
48511bedbe3fSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
48521bedbe3fSmrg"     {if(hide[section]) next};"\
48531bedbe3fSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
48541bedbe3fSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
48551bedbe3fSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
48561bedbe3fSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
48571bedbe3fSmrg"     ' prfx=^$ac_symprfx]"
4858ba6a1819Smrg  else
48591bedbe3fSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4860ba6a1819Smrg  fi
48611bedbe3fSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4862ba6a1819Smrg
48631bedbe3fSmrg  # Check to see that the pipe works correctly.
48641bedbe3fSmrg  pipe_works=no
4865ba6a1819Smrg
48661bedbe3fSmrg  rm -f conftest*
48671bedbe3fSmrg  cat > conftest.$ac_ext <<_LT_EOF
48681bedbe3fSmrg#ifdef __cplusplus
48691bedbe3fSmrgextern "C" {
48701bedbe3fSmrg#endif
48711bedbe3fSmrgchar nm_test_var;
48721bedbe3fSmrgvoid nm_test_func(void);
48731bedbe3fSmrgvoid nm_test_func(void){}
48741bedbe3fSmrg#ifdef __cplusplus
48751bedbe3fSmrg}
48761bedbe3fSmrg#endif
48771bedbe3fSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
48781bedbe3fSmrg_LT_EOF
4879ba6a1819Smrg
48801bedbe3fSmrg  if AC_TRY_EVAL(ac_compile); then
48811bedbe3fSmrg    # Now try to grab the symbols.
48821bedbe3fSmrg    nlist=conftest.nm
48831bedbe3fSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
48841bedbe3fSmrg      # Try sorting and uniquifying the output.
48851bedbe3fSmrg      if sort "$nlist" | uniq > "$nlist"T; then
48861bedbe3fSmrg	mv -f "$nlist"T "$nlist"
48871bedbe3fSmrg      else
48881bedbe3fSmrg	rm -f "$nlist"T
48891bedbe3fSmrg      fi
4890ba6a1819Smrg
48911bedbe3fSmrg      # Make sure that we snagged all the symbols we need.
48921bedbe3fSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
48931bedbe3fSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
48941bedbe3fSmrg	  cat <<_LT_EOF > conftest.$ac_ext
48951bedbe3fSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
48961bedbe3fSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
48971bedbe3fSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
48981bedbe3fSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
48991bedbe3fSmrg# define LT@&t@_DLSYM_CONST
49001bedbe3fSmrg#elif defined(__osf__)
49011bedbe3fSmrg/* This system does not cope well with relocations in const data.  */
49021bedbe3fSmrg# define LT@&t@_DLSYM_CONST
49031bedbe3fSmrg#else
49041bedbe3fSmrg# define LT@&t@_DLSYM_CONST const
49051bedbe3fSmrg#endif
4906ba6a1819Smrg
49071bedbe3fSmrg#ifdef __cplusplus
49081bedbe3fSmrgextern "C" {
49091bedbe3fSmrg#endif
4910549e21daSmrg
49111bedbe3fSmrg_LT_EOF
49121bedbe3fSmrg	  # Now generate the symbol file.
49131bedbe3fSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4914ba6a1819Smrg
49151bedbe3fSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4916549e21daSmrg
49171bedbe3fSmrg/* The mapping between symbol names and symbols.  */
49181bedbe3fSmrgLT@&t@_DLSYM_CONST struct {
49191bedbe3fSmrg  const char *name;
49201bedbe3fSmrg  void       *address;
49211bedbe3fSmrg}
49221bedbe3fSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
49231bedbe3fSmrg{
49241bedbe3fSmrg  { "@PROGRAM@", (void *) 0 },
49251bedbe3fSmrg_LT_EOF
49261bedbe3fSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
49271bedbe3fSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
49281bedbe3fSmrg  {0, (void *) 0}
49291bedbe3fSmrg};
4930ba6a1819Smrg
49311bedbe3fSmrg/* This works around a problem in FreeBSD linker */
49321bedbe3fSmrg#ifdef FREEBSD_WORKAROUND
49331bedbe3fSmrgstatic const void *lt_preloaded_setup() {
49341bedbe3fSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
49351bedbe3fSmrg}
49361bedbe3fSmrg#endif
49371bedbe3fSmrg
49381bedbe3fSmrg#ifdef __cplusplus
49391bedbe3fSmrg}
49401bedbe3fSmrg#endif
49411bedbe3fSmrg_LT_EOF
49421bedbe3fSmrg	  # Now try linking the two files.
49431bedbe3fSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
49441bedbe3fSmrg	  lt_globsym_save_LIBS=$LIBS
49451bedbe3fSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
49461bedbe3fSmrg	  LIBS="conftstm.$ac_objext"
49471bedbe3fSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
49481bedbe3fSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
49491bedbe3fSmrg	    pipe_works=yes
49501bedbe3fSmrg	  fi
49511bedbe3fSmrg	  LIBS=$lt_globsym_save_LIBS
49521bedbe3fSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
49531bedbe3fSmrg	else
49541bedbe3fSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
49551bedbe3fSmrg	fi
49561bedbe3fSmrg      else
49571bedbe3fSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
49581bedbe3fSmrg      fi
49591bedbe3fSmrg    else
49601bedbe3fSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
49611bedbe3fSmrg    fi
49621bedbe3fSmrg  else
49631bedbe3fSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
49641bedbe3fSmrg    cat conftest.$ac_ext >&5
49651bedbe3fSmrg  fi
49661bedbe3fSmrg  rm -rf conftest* conftst*
49671bedbe3fSmrg
49681bedbe3fSmrg  # Do not use the global_symbol_pipe unless it works.
49691bedbe3fSmrg  if test "$pipe_works" = yes; then
49701bedbe3fSmrg    break
49711bedbe3fSmrg  else
49721bedbe3fSmrg    lt_cv_sys_global_symbol_pipe=
49731bedbe3fSmrg  fi
49741bedbe3fSmrgdone
4975ba6a1819Smrg])
49761bedbe3fSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
49771bedbe3fSmrg  lt_cv_sys_global_symbol_to_cdecl=
49781bedbe3fSmrgfi
49791bedbe3fSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
49801bedbe3fSmrg  AC_MSG_RESULT(failed)
49811bedbe3fSmrgelse
49821bedbe3fSmrg  AC_MSG_RESULT(ok)
49831bedbe3fSmrgfi
4984549e21daSmrg
49851bedbe3fSmrg# Response file support.
49861bedbe3fSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
49871bedbe3fSmrg  nm_file_list_spec='@'
49881bedbe3fSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
49891bedbe3fSmrg  nm_file_list_spec='@'
49901bedbe3fSmrgfi
4991ba6a1819Smrg
49921bedbe3fSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
49931bedbe3fSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
49941bedbe3fSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
49951bedbe3fSmrg    [Transform the output of nm in a proper C declaration])
49961bedbe3fSmrg_LT_DECL([global_symbol_to_c_name_address],
49971bedbe3fSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
49981bedbe3fSmrg    [Transform the output of nm in a C name address pair])
49991bedbe3fSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
50001bedbe3fSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
50011bedbe3fSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
50021bedbe3fSmrg_LT_DECL([], [nm_file_list_spec], [1],
50031bedbe3fSmrg    [Specify filename containing input files for $NM])
50041bedbe3fSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
5005ba6a1819Smrg
5006ba6a1819Smrg
50071bedbe3fSmrg# _LT_COMPILER_PIC([TAGNAME])
50081bedbe3fSmrg# ---------------------------
50091bedbe3fSmrgm4_defun([_LT_COMPILER_PIC],
5010549e21daSmrg[m4_require([_LT_TAG_COMPILER])dnl
50111bedbe3fSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
50121bedbe3fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
50131bedbe3fSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
5014ba6a1819Smrg
50151bedbe3fSmrgm4_if([$1], [CXX], [
50161bedbe3fSmrg  # C++ specific cases for pic, static, wl, etc.
50171bedbe3fSmrg  if test "$GXX" = yes; then
50181bedbe3fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50191bedbe3fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5020ba6a1819Smrg
50211bedbe3fSmrg    case $host_os in
50221bedbe3fSmrg    aix*)
50231bedbe3fSmrg      # All AIX code is PIC.
50241bedbe3fSmrg      if test "$host_cpu" = ia64; then
50251bedbe3fSmrg	# AIX 5 now supports IA64 processor
50261bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
50271bedbe3fSmrg      fi
50281bedbe3fSmrg      ;;
5029ba6a1819Smrg
50301bedbe3fSmrg    amigaos*)
50311bedbe3fSmrg      case $host_cpu in
50321bedbe3fSmrg      powerpc)
50331bedbe3fSmrg            # see comment about AmigaOS4 .so support
50341bedbe3fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
50351bedbe3fSmrg        ;;
50361bedbe3fSmrg      m68k)
50371bedbe3fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
50381bedbe3fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
50391bedbe3fSmrg            # like `-m68040'.
50401bedbe3fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
50411bedbe3fSmrg        ;;
50421bedbe3fSmrg      esac
50431bedbe3fSmrg      ;;
5044ba6a1819Smrg
5045549e21daSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5046549e21daSmrg      # PIC is the default for these OSes.
5047549e21daSmrg      ;;
5048549e21daSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
5049549e21daSmrg      # This hack is so that the source file can tell whether it is being
5050549e21daSmrg      # built for inclusion in a dll (and should export symbols for example).
5051549e21daSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5052549e21daSmrg      # (--disable-auto-import) libraries
5053549e21daSmrg      m4_if([$1], [GCJ], [],
5054549e21daSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5055549e21daSmrg      ;;
5056549e21daSmrg    darwin* | rhapsody*)
5057549e21daSmrg      # PIC is the default on this platform
5058549e21daSmrg      # Common symbols not allowed in MH_DYLIB files
5059549e21daSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5060549e21daSmrg      ;;
5061549e21daSmrg    *djgpp*)
5062549e21daSmrg      # DJGPP does not support shared libraries at all
5063549e21daSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5064549e21daSmrg      ;;
5065549e21daSmrg    haiku*)
5066549e21daSmrg      # PIC is the default for Haiku.
5067549e21daSmrg      # The "-static" flag exists, but is broken.
5068549e21daSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5069549e21daSmrg      ;;
5070549e21daSmrg    interix[[3-9]]*)
5071549e21daSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5072549e21daSmrg      # Instead, we relocate shared libraries at runtime.
5073549e21daSmrg      ;;
5074549e21daSmrg    sysv4*MP*)
5075549e21daSmrg      if test -d /usr/nec; then
5076549e21daSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5077549e21daSmrg      fi
5078549e21daSmrg      ;;
5079549e21daSmrg    hpux*)
5080549e21daSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5081549e21daSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5082549e21daSmrg      # sets the default TLS model and affects inlining.
5083549e21daSmrg      case $host_cpu in
5084549e21daSmrg      hppa*64*)
5085ba6a1819Smrg	;;
5086549e21daSmrg      *)
5087549e21daSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5088549e21daSmrg	;;
5089549e21daSmrg      esac
5090549e21daSmrg      ;;
5091549e21daSmrg    *qnx* | *nto*)
5092549e21daSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5093549e21daSmrg      # it will coredump.
5094549e21daSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5095549e21daSmrg      ;;
5096549e21daSmrg    *)
5097549e21daSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5098549e21daSmrg      ;;
5099549e21daSmrg    esac
5100549e21daSmrg  else
5101549e21daSmrg    case $host_os in
5102549e21daSmrg      aix[[4-9]]*)
5103549e21daSmrg	# All AIX code is PIC.
5104549e21daSmrg	if test "$host_cpu" = ia64; then
5105549e21daSmrg	  # AIX 5 now supports IA64 processor
5106549e21daSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5107549e21daSmrg	else
5108549e21daSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5109549e21daSmrg	fi
5110549e21daSmrg	;;
5111549e21daSmrg      chorus*)
5112549e21daSmrg	case $cc_basename in
5113549e21daSmrg	cxch68*)
5114549e21daSmrg	  # Green Hills C++ Compiler
5115549e21daSmrg	  # _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"
5116ba6a1819Smrg	  ;;
5117ba6a1819Smrg	esac
5118ba6a1819Smrg	;;
51191bedbe3fSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
51201bedbe3fSmrg	# This hack is so that the source file can tell whether it is being
51211bedbe3fSmrg	# built for inclusion in a dll (and should export symbols for example).
51221bedbe3fSmrg	m4_if([$1], [GCJ], [],
51231bedbe3fSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
51241bedbe3fSmrg	;;
5125549e21daSmrg      dgux*)
5126549e21daSmrg	case $cc_basename in
5127549e21daSmrg	  ec++*)
5128549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5129549e21daSmrg	    ;;
5130549e21daSmrg	  ghcx*)
5131549e21daSmrg	    # Green Hills C++ Compiler
5132549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5133549e21daSmrg	    ;;
5134549e21daSmrg	  *)
5135549e21daSmrg	    ;;
5136549e21daSmrg	esac
5137549e21daSmrg	;;
5138549e21daSmrg      freebsd* | dragonfly*)
5139549e21daSmrg	# FreeBSD uses GNU C++
5140549e21daSmrg	;;
5141549e21daSmrg      hpux9* | hpux10* | hpux11*)
5142549e21daSmrg	case $cc_basename in
5143549e21daSmrg	  CC*)
5144549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5145549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5146549e21daSmrg	    if test "$host_cpu" != ia64; then
5147549e21daSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5148549e21daSmrg	    fi
5149549e21daSmrg	    ;;
5150549e21daSmrg	  aCC*)
5151549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5152549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5153ba6a1819Smrg	    case $host_cpu in
5154549e21daSmrg	    hppa*64*|ia64*)
5155549e21daSmrg	      # +Z the default
5156ba6a1819Smrg	      ;;
5157ba6a1819Smrg	    *)
5158549e21daSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5159ba6a1819Smrg	      ;;
5160ba6a1819Smrg	    esac
5161549e21daSmrg	    ;;
5162549e21daSmrg	  *)
5163549e21daSmrg	    ;;
5164549e21daSmrg	esac
5165ba6a1819Smrg	;;
5166549e21daSmrg      interix*)
5167549e21daSmrg	# This is c89, which is MS Visual C++ (no shared libs)
5168549e21daSmrg	# Anyone wants to do a port?
5169ba6a1819Smrg	;;
5170549e21daSmrg      irix5* | irix6* | nonstopux*)
5171549e21daSmrg	case $cc_basename in
5172549e21daSmrg	  CC*)
5173549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5174549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5175549e21daSmrg	    # CC pic flag -KPIC is the default.
5176549e21daSmrg	    ;;
5177549e21daSmrg	  *)
5178549e21daSmrg	    ;;
5179549e21daSmrg	esac
5180ba6a1819Smrg	;;
5181549e21daSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5182549e21daSmrg	case $cc_basename in
5183549e21daSmrg	  KCC*)
5184549e21daSmrg	    # KAI C++ Compiler
5185549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5186549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5187549e21daSmrg	    ;;
5188549e21daSmrg	  ecpc* )
5189549e21daSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
5190549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5191549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5192549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5193549e21daSmrg	    ;;
5194549e21daSmrg	  icpc* )
5195549e21daSmrg	    # Intel C++, used to be incompatible with GCC.
5196549e21daSmrg	    # ICC 10 doesn't accept -KPIC any more.
5197549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5198549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5199549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5200549e21daSmrg	    ;;
5201549e21daSmrg	  pgCC* | pgcpp*)
5202549e21daSmrg	    # Portland Group C++ compiler
5203549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5204549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5205549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5206549e21daSmrg	    ;;
5207549e21daSmrg	  cxx*)
5208549e21daSmrg	    # Compaq C++
5209549e21daSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5210549e21daSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5211549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5212549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5213549e21daSmrg	    ;;
5214549e21daSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5215549e21daSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5216549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5217549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5218549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5219549e21daSmrg	    ;;
5220549e21daSmrg	  *)
5221549e21daSmrg	    case `$CC -V 2>&1 | sed 5q` in
5222549e21daSmrg	    *Sun\ C*)
5223549e21daSmrg	      # Sun C++ 5.9
5224549e21daSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5225549e21daSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5226549e21daSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5227549e21daSmrg	      ;;
5228549e21daSmrg	    esac
5229549e21daSmrg	    ;;
5230549e21daSmrg	esac
5231ba6a1819Smrg	;;
5232549e21daSmrg      lynxos*)
5233549e21daSmrg	;;
5234549e21daSmrg      m88k*)
5235549e21daSmrg	;;
5236549e21daSmrg      mvs*)
5237549e21daSmrg	case $cc_basename in
5238549e21daSmrg	  cxx*)
5239549e21daSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5240549e21daSmrg	    ;;
5241549e21daSmrg	  *)
5242549e21daSmrg	    ;;
5243ba6a1819Smrg	esac
5244ba6a1819Smrg	;;
52451bedbe3fSmrg      netbsd*)
52461bedbe3fSmrg	;;
52471bedbe3fSmrg      *qnx* | *nto*)
52481bedbe3fSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
52491bedbe3fSmrg        # it will coredump.
52501bedbe3fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
52511bedbe3fSmrg        ;;
52521bedbe3fSmrg      osf3* | osf4* | osf5*)
52531bedbe3fSmrg	case $cc_basename in
52541bedbe3fSmrg	  KCC*)
52551bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
52561bedbe3fSmrg	    ;;
52571bedbe3fSmrg	  RCC*)
52581bedbe3fSmrg	    # Rational C++ 2.4.1
52591bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
52601bedbe3fSmrg	    ;;
52611bedbe3fSmrg	  cxx*)
52621bedbe3fSmrg	    # Digital/Compaq C++
52631bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52641bedbe3fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
52651bedbe3fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
52661bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
52671bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
52681bedbe3fSmrg	    ;;
52691bedbe3fSmrg	  *)
52701bedbe3fSmrg	    ;;
52711bedbe3fSmrg	esac
52721bedbe3fSmrg	;;
52731bedbe3fSmrg      psos*)
52741bedbe3fSmrg	;;
52751bedbe3fSmrg      solaris*)
52761bedbe3fSmrg	case $cc_basename in
52771bedbe3fSmrg	  CC* | sunCC*)
52781bedbe3fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
52791bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52801bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52811bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
52821bedbe3fSmrg	    ;;
52831bedbe3fSmrg	  gcx*)
52841bedbe3fSmrg	    # Green Hills C++ Compiler
52851bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
52861bedbe3fSmrg	    ;;
52871bedbe3fSmrg	  *)
52881bedbe3fSmrg	    ;;
52891bedbe3fSmrg	esac
52901bedbe3fSmrg	;;
52911bedbe3fSmrg      sunos4*)
52921bedbe3fSmrg	case $cc_basename in
52931bedbe3fSmrg	  CC*)
52941bedbe3fSmrg	    # Sun C++ 4.x
52951bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
52961bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52971bedbe3fSmrg	    ;;
52981bedbe3fSmrg	  lcc*)
52991bedbe3fSmrg	    # Lucid
53001bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
53011bedbe3fSmrg	    ;;
53021bedbe3fSmrg	  *)
53031bedbe3fSmrg	    ;;
53041bedbe3fSmrg	esac
53051bedbe3fSmrg	;;
53061bedbe3fSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
53071bedbe3fSmrg	case $cc_basename in
53081bedbe3fSmrg	  CC*)
53091bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53101bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
53111bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
53121bedbe3fSmrg	    ;;
53131bedbe3fSmrg	esac
53141bedbe3fSmrg	;;
53151bedbe3fSmrg      tandem*)
53161bedbe3fSmrg	case $cc_basename in
53171bedbe3fSmrg	  NCC*)
53181bedbe3fSmrg	    # NonStop-UX NCC 3.20
53191bedbe3fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
53201bedbe3fSmrg	    ;;
53211bedbe3fSmrg	  *)
53221bedbe3fSmrg	    ;;
53231bedbe3fSmrg	esac
53241bedbe3fSmrg	;;
53251bedbe3fSmrg      vxworks*)
53261bedbe3fSmrg	;;
53271bedbe3fSmrg      *)
53281bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
53291bedbe3fSmrg	;;
53301bedbe3fSmrg    esac
53311bedbe3fSmrg  fi
53321bedbe3fSmrg],
53331bedbe3fSmrg[
53341bedbe3fSmrg  if test "$GCC" = yes; then
53351bedbe3fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53361bedbe3fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
53371bedbe3fSmrg
53381bedbe3fSmrg    case $host_os in
53391bedbe3fSmrg      aix*)
53401bedbe3fSmrg      # All AIX code is PIC.
53411bedbe3fSmrg      if test "$host_cpu" = ia64; then
53421bedbe3fSmrg	# AIX 5 now supports IA64 processor
53431bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
53441bedbe3fSmrg      fi
53451bedbe3fSmrg      ;;
53461bedbe3fSmrg
53471bedbe3fSmrg    amigaos*)
53481bedbe3fSmrg      case $host_cpu in
53491bedbe3fSmrg      powerpc)
53501bedbe3fSmrg            # see comment about AmigaOS4 .so support
53511bedbe3fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
53521bedbe3fSmrg        ;;
53531bedbe3fSmrg      m68k)
53541bedbe3fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
53551bedbe3fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
53561bedbe3fSmrg            # like `-m68040'.
53571bedbe3fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
53581bedbe3fSmrg        ;;
53591bedbe3fSmrg      esac
53601bedbe3fSmrg      ;;
53611bedbe3fSmrg
53621bedbe3fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
53631bedbe3fSmrg      # PIC is the default for these OSes.
53641bedbe3fSmrg      ;;
53651bedbe3fSmrg
53661bedbe3fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
53671bedbe3fSmrg      # This hack is so that the source file can tell whether it is being
53681bedbe3fSmrg      # built for inclusion in a dll (and should export symbols for example).
53691bedbe3fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
53701bedbe3fSmrg      # (--disable-auto-import) libraries
53711bedbe3fSmrg      m4_if([$1], [GCJ], [],
53721bedbe3fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
53731bedbe3fSmrg      ;;
53741bedbe3fSmrg
53751bedbe3fSmrg    darwin* | rhapsody*)
53761bedbe3fSmrg      # PIC is the default on this platform
53771bedbe3fSmrg      # Common symbols not allowed in MH_DYLIB files
53781bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
53791bedbe3fSmrg      ;;
53801bedbe3fSmrg
53811bedbe3fSmrg    haiku*)
53821bedbe3fSmrg      # PIC is the default for Haiku.
53831bedbe3fSmrg      # The "-static" flag exists, but is broken.
53841bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
53851bedbe3fSmrg      ;;
53861bedbe3fSmrg
53871bedbe3fSmrg    hpux*)
53881bedbe3fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
53891bedbe3fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
53901bedbe3fSmrg      # sets the default TLS model and affects inlining.
53911bedbe3fSmrg      case $host_cpu in
53921bedbe3fSmrg      hppa*64*)
53931bedbe3fSmrg	# +Z the default
53941bedbe3fSmrg	;;
53951bedbe3fSmrg      *)
53961bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
53971bedbe3fSmrg	;;
53981bedbe3fSmrg      esac
53991bedbe3fSmrg      ;;
54001bedbe3fSmrg
54011bedbe3fSmrg    interix[[3-9]]*)
54021bedbe3fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
54031bedbe3fSmrg      # Instead, we relocate shared libraries at runtime.
54041bedbe3fSmrg      ;;
54051bedbe3fSmrg
54061bedbe3fSmrg    msdosdjgpp*)
54071bedbe3fSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
54081bedbe3fSmrg      # on systems that don't support them.
54091bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
54101bedbe3fSmrg      enable_shared=no
54111bedbe3fSmrg      ;;
54121bedbe3fSmrg
54131bedbe3fSmrg    *nto* | *qnx*)
54141bedbe3fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
54151bedbe3fSmrg      # it will coredump.
54161bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
54171bedbe3fSmrg      ;;
54181bedbe3fSmrg
54191bedbe3fSmrg    sysv4*MP*)
54201bedbe3fSmrg      if test -d /usr/nec; then
54211bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
54221bedbe3fSmrg      fi
54231bedbe3fSmrg      ;;
54241bedbe3fSmrg
54251bedbe3fSmrg    *)
54261bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
54271bedbe3fSmrg      ;;
54281bedbe3fSmrg    esac
54291bedbe3fSmrg
54301bedbe3fSmrg    case $cc_basename in
54311bedbe3fSmrg    nvcc*) # Cuda Compiler Driver 2.2
54321bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
54331bedbe3fSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
54341bedbe3fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
54351bedbe3fSmrg      fi
54361bedbe3fSmrg      ;;
54371bedbe3fSmrg    esac
54381bedbe3fSmrg  else
54391bedbe3fSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
54401bedbe3fSmrg    case $host_os in
54411bedbe3fSmrg    aix*)
54421bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54431bedbe3fSmrg      if test "$host_cpu" = ia64; then
54441bedbe3fSmrg	# AIX 5 now supports IA64 processor
54451bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54461bedbe3fSmrg      else
54471bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
54481bedbe3fSmrg      fi
54491bedbe3fSmrg      ;;
54501bedbe3fSmrg
54511bedbe3fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
54521bedbe3fSmrg      # This hack is so that the source file can tell whether it is being
54531bedbe3fSmrg      # built for inclusion in a dll (and should export symbols for example).
54541bedbe3fSmrg      m4_if([$1], [GCJ], [],
54551bedbe3fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
54561bedbe3fSmrg      ;;
54571bedbe3fSmrg
54581bedbe3fSmrg    hpux9* | hpux10* | hpux11*)
54591bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54601bedbe3fSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
54611bedbe3fSmrg      # not for PA HP-UX.
54621bedbe3fSmrg      case $host_cpu in
54631bedbe3fSmrg      hppa*64*|ia64*)
54641bedbe3fSmrg	# +Z the default
54651bedbe3fSmrg	;;
54661bedbe3fSmrg      *)
54671bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
54681bedbe3fSmrg	;;
54691bedbe3fSmrg      esac
54701bedbe3fSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
54711bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
54721bedbe3fSmrg      ;;
54731bedbe3fSmrg
54741bedbe3fSmrg    irix5* | irix6* | nonstopux*)
54751bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54761bedbe3fSmrg      # PIC (with -KPIC) is the default.
54771bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54781bedbe3fSmrg      ;;
54791bedbe3fSmrg
54801bedbe3fSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
54811bedbe3fSmrg      case $cc_basename in
54821bedbe3fSmrg      # old Intel for x86_64 which still supported -KPIC.
54831bedbe3fSmrg      ecc*)
54841bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54851bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54861bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
54871bedbe3fSmrg        ;;
54881bedbe3fSmrg      # icc used to be incompatible with GCC.
54891bedbe3fSmrg      # ICC 10 doesn't accept -KPIC any more.
54901bedbe3fSmrg      icc* | ifort*)
54911bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54921bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
54931bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
54941bedbe3fSmrg        ;;
54951bedbe3fSmrg      # Lahey Fortran 8.1.
54961bedbe3fSmrg      lf95*)
54971bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54981bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
54991bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
55001bedbe3fSmrg	;;
55011bedbe3fSmrg      nagfor*)
55021bedbe3fSmrg	# NAG Fortran compiler
55031bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
55041bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
55051bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55061bedbe3fSmrg	;;
55071bedbe3fSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
55081bedbe3fSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
55091bedbe3fSmrg	# which looks to be a dead project)
55101bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55111bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
55121bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55131bedbe3fSmrg        ;;
55141bedbe3fSmrg      ccc*)
55151bedbe3fSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55161bedbe3fSmrg        # All Alpha code is PIC.
55171bedbe3fSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
55181bedbe3fSmrg        ;;
55191bedbe3fSmrg      xl* | bgxl* | bgf* | mpixl*)
55201bedbe3fSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
55211bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55221bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
55231bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
55241bedbe3fSmrg	;;
55251bedbe3fSmrg      *)
55261bedbe3fSmrg	case `$CC -V 2>&1 | sed 5q` in
55271bedbe3fSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
55281bedbe3fSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
55291bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
55301bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55311bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
55321bedbe3fSmrg	  ;;
55331bedbe3fSmrg	*Sun\ F* | *Sun*Fortran*)
55341bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
55351bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55361bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
55371bedbe3fSmrg	  ;;
55381bedbe3fSmrg	*Sun\ C*)
55391bedbe3fSmrg	  # Sun C 5.9
55401bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
55411bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55421bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55431bedbe3fSmrg	  ;;
55441bedbe3fSmrg        *Intel*\ [[CF]]*Compiler*)
55451bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55461bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
55471bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
55481bedbe3fSmrg	  ;;
55491bedbe3fSmrg	*Portland\ Group*)
55501bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55511bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
55521bedbe3fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55531bedbe3fSmrg	  ;;
55541bedbe3fSmrg	esac
55551bedbe3fSmrg	;;
55561bedbe3fSmrg      esac
55571bedbe3fSmrg      ;;
55581bedbe3fSmrg
55591bedbe3fSmrg    newsos6)
55601bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
55611bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55621bedbe3fSmrg      ;;
55631bedbe3fSmrg
55641bedbe3fSmrg    *nto* | *qnx*)
55651bedbe3fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
55661bedbe3fSmrg      # it will coredump.
55671bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
55681bedbe3fSmrg      ;;
55691bedbe3fSmrg
55701bedbe3fSmrg    osf3* | osf4* | osf5*)
55711bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55721bedbe3fSmrg      # All OSF/1 code is PIC.
55731bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
55741bedbe3fSmrg      ;;
55751bedbe3fSmrg
55761bedbe3fSmrg    rdos*)
55771bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
55781bedbe3fSmrg      ;;
55791bedbe3fSmrg
55801bedbe3fSmrg    solaris*)
55811bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
55821bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55831bedbe3fSmrg      case $cc_basename in
55841bedbe3fSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
55851bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
55861bedbe3fSmrg      *)
55871bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
55881bedbe3fSmrg      esac
55891bedbe3fSmrg      ;;
55901bedbe3fSmrg
55911bedbe3fSmrg    sunos4*)
55921bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
55931bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
55941bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55951bedbe3fSmrg      ;;
55961bedbe3fSmrg
55971bedbe3fSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
55981bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55991bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
56001bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
56011bedbe3fSmrg      ;;
56021bedbe3fSmrg
56031bedbe3fSmrg    sysv4*MP*)
56041bedbe3fSmrg      if test -d /usr/nec ;then
56051bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
56061bedbe3fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
56071bedbe3fSmrg      fi
56081bedbe3fSmrg      ;;
56091bedbe3fSmrg
56101bedbe3fSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
56111bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
56121bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
56131bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
56141bedbe3fSmrg      ;;
56151bedbe3fSmrg
56161bedbe3fSmrg    unicos*)
56171bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
56181bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
56191bedbe3fSmrg      ;;
56201bedbe3fSmrg
56211bedbe3fSmrg    uts4*)
56221bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
56231bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
56241bedbe3fSmrg      ;;
56251bedbe3fSmrg
56261bedbe3fSmrg    *)
56271bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
56281bedbe3fSmrg      ;;
56291bedbe3fSmrg    esac
56301bedbe3fSmrg  fi
56311bedbe3fSmrg])
56321bedbe3fSmrgcase $host_os in
56331bedbe3fSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
56341bedbe3fSmrg  *djgpp*)
56351bedbe3fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
56361bedbe3fSmrg    ;;
56371bedbe3fSmrg  *)
56381bedbe3fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
56391bedbe3fSmrg    ;;
56401bedbe3fSmrgesac
56411bedbe3fSmrg
56421bedbe3fSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
56431bedbe3fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
56441bedbe3fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
56451bedbe3fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
56461bedbe3fSmrg
56471bedbe3fSmrg#
56481bedbe3fSmrg# Check to make sure the PIC flag actually works.
56491bedbe3fSmrg#
56501bedbe3fSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
56511bedbe3fSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
56521bedbe3fSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
56531bedbe3fSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
56541bedbe3fSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
56551bedbe3fSmrg     "" | " "*) ;;
56561bedbe3fSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
56571bedbe3fSmrg     esac],
56581bedbe3fSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
56591bedbe3fSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
56601bedbe3fSmrgfi
56611bedbe3fSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
56621bedbe3fSmrg	[Additional compiler flags for building library objects])
56631bedbe3fSmrg
56641bedbe3fSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
56651bedbe3fSmrg	[How to pass a linker flag through the compiler])
56661bedbe3fSmrg#
56671bedbe3fSmrg# Check to make sure the static flag actually works.
56681bedbe3fSmrg#
56691bedbe3fSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
56701bedbe3fSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
56711bedbe3fSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
56721bedbe3fSmrg  $lt_tmp_static_flag,
56731bedbe3fSmrg  [],
56741bedbe3fSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
56751bedbe3fSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
56761bedbe3fSmrg	[Compiler flag to prevent dynamic linking])
56771bedbe3fSmrg])# _LT_COMPILER_PIC
56781bedbe3fSmrg
56791bedbe3fSmrg
56801bedbe3fSmrg# _LT_LINKER_SHLIBS([TAGNAME])
56811bedbe3fSmrg# ----------------------------
56821bedbe3fSmrg# See if the linker supports building shared libraries.
56831bedbe3fSmrgm4_defun([_LT_LINKER_SHLIBS],
56841bedbe3fSmrg[AC_REQUIRE([LT_PATH_LD])dnl
56851bedbe3fSmrgAC_REQUIRE([LT_PATH_NM])dnl
56861bedbe3fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
56871bedbe3fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
56881bedbe3fSmrgm4_require([_LT_DECL_EGREP])dnl
56891bedbe3fSmrgm4_require([_LT_DECL_SED])dnl
56901bedbe3fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
56911bedbe3fSmrgm4_require([_LT_TAG_COMPILER])dnl
56921bedbe3fSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
56931bedbe3fSmrgm4_if([$1], [CXX], [
56941bedbe3fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
56951bedbe3fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
56961bedbe3fSmrg  case $host_os in
56971bedbe3fSmrg  aix[[4-9]]*)
56981bedbe3fSmrg    # If we're using GNU nm, then we don't want the "-C" option.
56991bedbe3fSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
57001bedbe3fSmrg    # Also, AIX nm treats weak defined symbols like other global defined
57011bedbe3fSmrg    # symbols, whereas GNU nm marks them as "W".
57021bedbe3fSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
57031bedbe3fSmrg      _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'
57041bedbe3fSmrg    else
57051bedbe3fSmrg      _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'
57061bedbe3fSmrg    fi
57071bedbe3fSmrg    ;;
57081bedbe3fSmrg  pw32*)
57091bedbe3fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
57101bedbe3fSmrg    ;;
57111bedbe3fSmrg  cygwin* | mingw* | cegcc*)
57121bedbe3fSmrg    case $cc_basename in
57131bedbe3fSmrg    cl*)
57141bedbe3fSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
57151bedbe3fSmrg      ;;
57161bedbe3fSmrg    *)
57171bedbe3fSmrg      _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'
57181bedbe3fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
57191bedbe3fSmrg      ;;
57201bedbe3fSmrg    esac
57211bedbe3fSmrg    ;;
57221bedbe3fSmrg  *)
57231bedbe3fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
57241bedbe3fSmrg    ;;
57251bedbe3fSmrg  esac
57261bedbe3fSmrg], [
57271bedbe3fSmrg  runpath_var=
57281bedbe3fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
57291bedbe3fSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
57301bedbe3fSmrg  _LT_TAGVAR(archive_cmds, $1)=
57311bedbe3fSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
57321bedbe3fSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
57331bedbe3fSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
57341bedbe3fSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
57351bedbe3fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
57361bedbe3fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
57371bedbe3fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
57381bedbe3fSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
57391bedbe3fSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
57401bedbe3fSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
57411bedbe3fSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
57421bedbe3fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
57431bedbe3fSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
57441bedbe3fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
57451bedbe3fSmrg  _LT_TAGVAR(module_cmds, $1)=
57461bedbe3fSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
57471bedbe3fSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
57481bedbe3fSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
57491bedbe3fSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
57501bedbe3fSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
57511bedbe3fSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
57521bedbe3fSmrg  # included in the symbol list
57531bedbe3fSmrg  _LT_TAGVAR(include_expsyms, $1)=
57541bedbe3fSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
57551bedbe3fSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
57561bedbe3fSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
57571bedbe3fSmrg  # as well as any symbol that contains `d'.
57581bedbe3fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
57591bedbe3fSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
57601bedbe3fSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
57611bedbe3fSmrg  # the symbol is explicitly referenced.  Since portable code cannot
57621bedbe3fSmrg  # rely on this symbol name, it's probably fine to never include it in
57631bedbe3fSmrg  # preloaded symbol tables.
57641bedbe3fSmrg  # Exclude shared library initialization/finalization symbols.
57651bedbe3fSmrgdnl Note also adjust exclude_expsyms for C++ above.
57661bedbe3fSmrg  extract_expsyms_cmds=
57671bedbe3fSmrg
57681bedbe3fSmrg  case $host_os in
57691bedbe3fSmrg  cygwin* | mingw* | pw32* | cegcc*)
57701bedbe3fSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
57711bedbe3fSmrg    # When not using gcc, we currently assume that we are using
57721bedbe3fSmrg    # Microsoft Visual C++.
57731bedbe3fSmrg    if test "$GCC" != yes; then
57741bedbe3fSmrg      with_gnu_ld=no
57751bedbe3fSmrg    fi
57761bedbe3fSmrg    ;;
57771bedbe3fSmrg  interix*)
57781bedbe3fSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
57791bedbe3fSmrg    with_gnu_ld=yes
57801bedbe3fSmrg    ;;
57811bedbe3fSmrg  openbsd*)
57821bedbe3fSmrg    with_gnu_ld=no
57831bedbe3fSmrg    ;;
57841bedbe3fSmrg  esac
57851bedbe3fSmrg
57861bedbe3fSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
57871bedbe3fSmrg
57881bedbe3fSmrg  # On some targets, GNU ld is compatible enough with the native linker
57891bedbe3fSmrg  # that we're better off using the native interface for both.
57901bedbe3fSmrg  lt_use_gnu_ld_interface=no
57911bedbe3fSmrg  if test "$with_gnu_ld" = yes; then
57921bedbe3fSmrg    case $host_os in
57931bedbe3fSmrg      aix*)
57941bedbe3fSmrg	# The AIX port of GNU ld has always aspired to compatibility
57951bedbe3fSmrg	# with the native linker.  However, as the warning in the GNU ld
57961bedbe3fSmrg	# block says, versions before 2.19.5* couldn't really create working
57971bedbe3fSmrg	# shared libraries, regardless of the interface used.
57981bedbe3fSmrg	case `$LD -v 2>&1` in
57991bedbe3fSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
58001bedbe3fSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
58011bedbe3fSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
58021bedbe3fSmrg	  *)
58031bedbe3fSmrg	    lt_use_gnu_ld_interface=yes
58041bedbe3fSmrg	    ;;
58051bedbe3fSmrg	esac
58061bedbe3fSmrg	;;
58071bedbe3fSmrg      *)
58081bedbe3fSmrg	lt_use_gnu_ld_interface=yes
5809549e21daSmrg	;;
58101bedbe3fSmrg    esac
58111bedbe3fSmrg  fi
58121bedbe3fSmrg
58131bedbe3fSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
58141bedbe3fSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
58151bedbe3fSmrg    wlarc='${wl}'
58161bedbe3fSmrg
58171bedbe3fSmrg    # Set some defaults for GNU ld with shared library support. These
58181bedbe3fSmrg    # are reset later if shared libraries are not supported. Putting them
58191bedbe3fSmrg    # here allows them to be overridden if necessary.
58201bedbe3fSmrg    runpath_var=LD_RUN_PATH
58211bedbe3fSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
58221bedbe3fSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
58231bedbe3fSmrg    # ancient GNU ld didn't support --whole-archive et. al.
58241bedbe3fSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
58251bedbe3fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
58261bedbe3fSmrg    else
58271bedbe3fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
58281bedbe3fSmrg    fi
58291bedbe3fSmrg    supports_anon_versioning=no
58301bedbe3fSmrg    case `$LD -v 2>&1` in
58311bedbe3fSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
58321bedbe3fSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
58331bedbe3fSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
58341bedbe3fSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
58351bedbe3fSmrg      *\ 2.11.*) ;; # other 2.11 versions
58361bedbe3fSmrg      *) supports_anon_versioning=yes ;;
58371bedbe3fSmrg    esac
58381bedbe3fSmrg
58391bedbe3fSmrg    # See if GNU ld supports shared libraries.
58401bedbe3fSmrg    case $host_os in
58411bedbe3fSmrg    aix[[3-9]]*)
58421bedbe3fSmrg      # On AIX/PPC, the GNU linker is very broken
58431bedbe3fSmrg      if test "$host_cpu" != ia64; then
58441bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
58451bedbe3fSmrg	cat <<_LT_EOF 1>&2
58461bedbe3fSmrg
58471bedbe3fSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
58481bedbe3fSmrg*** to be unable to reliably create shared libraries on AIX.
58491bedbe3fSmrg*** Therefore, libtool is disabling shared libraries support.  If you
58501bedbe3fSmrg*** really care for shared libraries, you may want to install binutils
58511bedbe3fSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
58521bedbe3fSmrg*** You will then need to restart the configuration process.
58531bedbe3fSmrg
58541bedbe3fSmrg_LT_EOF
58551bedbe3fSmrg      fi
58561bedbe3fSmrg      ;;
58571bedbe3fSmrg
58581bedbe3fSmrg    amigaos*)
58591bedbe3fSmrg      case $host_cpu in
58601bedbe3fSmrg      powerpc)
58611bedbe3fSmrg            # see comment about AmigaOS4 .so support
58621bedbe3fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
58631bedbe3fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5864ba6a1819Smrg        ;;
58651bedbe3fSmrg      m68k)
58661bedbe3fSmrg            _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)'
58671bedbe3fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58681bedbe3fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
58691bedbe3fSmrg        ;;
58701bedbe3fSmrg      esac
58711bedbe3fSmrg      ;;
58721bedbe3fSmrg
58731bedbe3fSmrg    beos*)
58741bedbe3fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
58751bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
58761bedbe3fSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
58771bedbe3fSmrg	# support --undefined.  This deserves some investigation.  FIXME
58781bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
58791bedbe3fSmrg      else
58801bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
58811bedbe3fSmrg      fi
58821bedbe3fSmrg      ;;
58831bedbe3fSmrg
58841bedbe3fSmrg    cygwin* | mingw* | pw32* | cegcc*)
58851bedbe3fSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
58861bedbe3fSmrg      # as there is no search path for DLLs.
58871bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58881bedbe3fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
58891bedbe3fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
58901bedbe3fSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
58911bedbe3fSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
58921bedbe3fSmrg      _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'
58931bedbe3fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
58941bedbe3fSmrg
58951bedbe3fSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
58961bedbe3fSmrg        _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'
58971bedbe3fSmrg	# If the export-symbols file already is a .def file (1st line
58981bedbe3fSmrg	# is EXPORTS), use it as is; otherwise, prepend...
58991bedbe3fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
59001bedbe3fSmrg	  cp $export_symbols $output_objdir/$soname.def;
59011bedbe3fSmrg	else
59021bedbe3fSmrg	  echo EXPORTS > $output_objdir/$soname.def;
59031bedbe3fSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
59041bedbe3fSmrg	fi~
59051bedbe3fSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
59061bedbe3fSmrg      else
59071bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59081bedbe3fSmrg      fi
59091bedbe3fSmrg      ;;
59101bedbe3fSmrg
59111bedbe3fSmrg    haiku*)
59121bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59131bedbe3fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
59141bedbe3fSmrg      ;;
59151bedbe3fSmrg
59161bedbe3fSmrg    interix[[3-9]]*)
59171bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
59181bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59191bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
59201bedbe3fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
59211bedbe3fSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
59221bedbe3fSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
59231bedbe3fSmrg      # default) and relocated if they conflict, which is a slow very memory
59241bedbe3fSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
59251bedbe3fSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
59261bedbe3fSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
59271bedbe3fSmrg      _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'
59281bedbe3fSmrg      _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'
59291bedbe3fSmrg      ;;
59301bedbe3fSmrg
59311bedbe3fSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
59321bedbe3fSmrg      tmp_diet=no
59331bedbe3fSmrg      if test "$host_os" = linux-dietlibc; then
5934549e21daSmrg	case $cc_basename in
59351bedbe3fSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5936549e21daSmrg	esac
59371bedbe3fSmrg      fi
59381bedbe3fSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
59391bedbe3fSmrg	 && test "$tmp_diet" = no
59401bedbe3fSmrg      then
59411bedbe3fSmrg	tmp_addflag=' $pic_flag'
59421bedbe3fSmrg	tmp_sharedflag='-shared'
59431bedbe3fSmrg	case $cc_basename,$host_cpu in
59441bedbe3fSmrg        pgcc*)				# Portland Group C compiler
59451bedbe3fSmrg	  _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'
59461bedbe3fSmrg	  tmp_addflag=' $pic_flag'
59471bedbe3fSmrg	  ;;
59481bedbe3fSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
59491bedbe3fSmrg					# Portland Group f77 and f90 compilers
59501bedbe3fSmrg	  _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'
59511bedbe3fSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
59521bedbe3fSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
59531bedbe3fSmrg	  tmp_addflag=' -i_dynamic' ;;
59541bedbe3fSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
59551bedbe3fSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
59561bedbe3fSmrg	ifc* | ifort*)			# Intel Fortran compiler
59571bedbe3fSmrg	  tmp_addflag=' -nofor_main' ;;
59581bedbe3fSmrg	lf95*)				# Lahey Fortran 8.1
59591bedbe3fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
59601bedbe3fSmrg	  tmp_sharedflag='--shared' ;;
59611bedbe3fSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
59621bedbe3fSmrg	  tmp_sharedflag='-qmkshrobj'
59631bedbe3fSmrg	  tmp_addflag= ;;
59641bedbe3fSmrg	nvcc*)	# Cuda Compiler Driver 2.2
59651bedbe3fSmrg	  _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'
59661bedbe3fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
59671bedbe3fSmrg	  ;;
5968549e21daSmrg	esac
59691bedbe3fSmrg	case `$CC -V 2>&1 | sed 5q` in
59701bedbe3fSmrg	*Sun\ C*)			# Sun C 5.9
59711bedbe3fSmrg	  _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'
59721bedbe3fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
59731bedbe3fSmrg	  tmp_sharedflag='-G' ;;
59741bedbe3fSmrg	*Sun\ F*)			# Sun Fortran 8.3
59751bedbe3fSmrg	  tmp_sharedflag='-G' ;;
5976549e21daSmrg	esac
59771bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59781bedbe3fSmrg
59791bedbe3fSmrg        if test "x$supports_anon_versioning" = xyes; then
59801bedbe3fSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
59811bedbe3fSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
59821bedbe3fSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
59831bedbe3fSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
59841bedbe3fSmrg        fi
59851bedbe3fSmrg
5986549e21daSmrg	case $cc_basename in
59871bedbe3fSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
59881bedbe3fSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
59891bedbe3fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
59901bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59911bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
59921bedbe3fSmrg	  if test "x$supports_anon_versioning" = xyes; then
59931bedbe3fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
59941bedbe3fSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
59951bedbe3fSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
59961bedbe3fSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
59971bedbe3fSmrg	  fi
59981bedbe3fSmrg	  ;;
5999549e21daSmrg	esac
60001bedbe3fSmrg      else
60011bedbe3fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
60021bedbe3fSmrg      fi
60031bedbe3fSmrg      ;;
60041bedbe3fSmrg
60051bedbe3fSmrg    netbsd*)
60061bedbe3fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
60071bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
60081bedbe3fSmrg	wlarc=
60091bedbe3fSmrg      else
60101bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
60111bedbe3fSmrg	_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'
60121bedbe3fSmrg      fi
60131bedbe3fSmrg      ;;
60141bedbe3fSmrg
60151bedbe3fSmrg    solaris*)
60161bedbe3fSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
60171bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
60181bedbe3fSmrg	cat <<_LT_EOF 1>&2
60191bedbe3fSmrg
60201bedbe3fSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
60211bedbe3fSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
60221bedbe3fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
60231bedbe3fSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
60241bedbe3fSmrg*** your PATH or compiler configuration so that the native linker is
60251bedbe3fSmrg*** used, and then restart.
60261bedbe3fSmrg
60271bedbe3fSmrg_LT_EOF
60281bedbe3fSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
60291bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
60301bedbe3fSmrg	_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'
60311bedbe3fSmrg      else
60321bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
60331bedbe3fSmrg      fi
60341bedbe3fSmrg      ;;
60351bedbe3fSmrg
60361bedbe3fSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
60371bedbe3fSmrg      case `$LD -v 2>&1` in
60381bedbe3fSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
60391bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
60401bedbe3fSmrg	cat <<_LT_EOF 1>&2
60411bedbe3fSmrg
60421bedbe3fSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
60431bedbe3fSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
60441bedbe3fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
60451bedbe3fSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
60461bedbe3fSmrg*** your PATH or compiler configuration so that the native linker is
60471bedbe3fSmrg*** used, and then restart.
60481bedbe3fSmrg
60491bedbe3fSmrg_LT_EOF
6050ba6a1819Smrg	;;
60511bedbe3fSmrg	*)
60521bedbe3fSmrg	  # For security reasons, it is highly recommended that you always
60531bedbe3fSmrg	  # use absolute paths for naming shared libraries, and exclude the
60541bedbe3fSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
60551bedbe3fSmrg	  # requires that you compile everything twice, which is a pain.
60561bedbe3fSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
60571bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
60581bedbe3fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
60591bedbe3fSmrg	    _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'
60601bedbe3fSmrg	  else
60611bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
60621bedbe3fSmrg	  fi
6063ba6a1819Smrg	;;
60641bedbe3fSmrg      esac
60651bedbe3fSmrg      ;;
60661bedbe3fSmrg
60671bedbe3fSmrg    sunos4*)
60681bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
60691bedbe3fSmrg      wlarc=
60701bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
60711bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60721bedbe3fSmrg      ;;
60731bedbe3fSmrg
60741bedbe3fSmrg    *)
60751bedbe3fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
60761bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
60771bedbe3fSmrg	_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'
60781bedbe3fSmrg      else
60791bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
60801bedbe3fSmrg      fi
60811bedbe3fSmrg      ;;
6082ba6a1819Smrg    esac
6083549e21daSmrg
60841bedbe3fSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
60851bedbe3fSmrg      runpath_var=
60861bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
60871bedbe3fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
60881bedbe3fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
60891bedbe3fSmrg    fi
60901bedbe3fSmrg  else
60911bedbe3fSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
6092549e21daSmrg    case $host_os in
60931bedbe3fSmrg    aix3*)
60941bedbe3fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
60951bedbe3fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
60961bedbe3fSmrg      _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'
60971bedbe3fSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
60981bedbe3fSmrg      # are no directories specified by -L.
60991bedbe3fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
61001bedbe3fSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
61011bedbe3fSmrg	# Neither direct hardcoding nor static linking is supported with a
61021bedbe3fSmrg	# broken collect2.
61031bedbe3fSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
61041bedbe3fSmrg      fi
61051bedbe3fSmrg      ;;
61061bedbe3fSmrg
61071bedbe3fSmrg    aix[[4-9]]*)
6108549e21daSmrg      if test "$host_cpu" = ia64; then
61091bedbe3fSmrg	# On IA64, the linker does run time linking by default, so we don't
61101bedbe3fSmrg	# have to do anything special.
61111bedbe3fSmrg	aix_use_runtimelinking=no
61121bedbe3fSmrg	exp_sym_flag='-Bexport'
61131bedbe3fSmrg	no_entry_flag=""
61141bedbe3fSmrg      else
61151bedbe3fSmrg	# If we're using GNU nm, then we don't want the "-C" option.
61161bedbe3fSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
61171bedbe3fSmrg	# Also, AIX nm treats weak defined symbols like other global
61181bedbe3fSmrg	# defined symbols, whereas GNU nm marks them as "W".
61191bedbe3fSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
61201bedbe3fSmrg	  _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'
61211bedbe3fSmrg	else
61221bedbe3fSmrg	  _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'
61231bedbe3fSmrg	fi
61241bedbe3fSmrg	aix_use_runtimelinking=no
61251bedbe3fSmrg
61261bedbe3fSmrg	# Test if we are trying to use run time linking or normal
61271bedbe3fSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
61281bedbe3fSmrg	# need to do runtime linking.
61291bedbe3fSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
61301bedbe3fSmrg	  for ld_flag in $LDFLAGS; do
61311bedbe3fSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
61321bedbe3fSmrg	    aix_use_runtimelinking=yes
61331bedbe3fSmrg	    break
61341bedbe3fSmrg	  fi
61351bedbe3fSmrg	  done
61361bedbe3fSmrg	  ;;
61371bedbe3fSmrg	esac
61381bedbe3fSmrg
61391bedbe3fSmrg	exp_sym_flag='-bexport'
61401bedbe3fSmrg	no_entry_flag='-bnoentry'
61411bedbe3fSmrg      fi
61421bedbe3fSmrg
61431bedbe3fSmrg      # When large executables or shared objects are built, AIX ld can
61441bedbe3fSmrg      # have problems creating the table of contents.  If linking a library
61451bedbe3fSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
61461bedbe3fSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
61471bedbe3fSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
61481bedbe3fSmrg
61491bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)=''
61501bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
61511bedbe3fSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
61521bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
61531bedbe3fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
61541bedbe3fSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
61551bedbe3fSmrg
61561bedbe3fSmrg      if test "$GCC" = yes; then
61571bedbe3fSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
61581bedbe3fSmrg	# We only want to do this on AIX 4.2 and lower, the check
61591bedbe3fSmrg	# below for broken collect2 doesn't work under 4.3+
61601bedbe3fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
61611bedbe3fSmrg	  if test -f "$collect2name" &&
61621bedbe3fSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
61631bedbe3fSmrg	  then
61641bedbe3fSmrg	  # We have reworked collect2
61651bedbe3fSmrg	  :
61661bedbe3fSmrg	  else
61671bedbe3fSmrg	  # We have old collect2
61681bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
61691bedbe3fSmrg	  # It fails to find uninstalled libraries when the uninstalled
61701bedbe3fSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
61711bedbe3fSmrg	  # to unsupported forces relinking
61721bedbe3fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
61731bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61741bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
61751bedbe3fSmrg	  fi
61761bedbe3fSmrg	  ;;
61771bedbe3fSmrg	esac
61781bedbe3fSmrg	shared_flag='-shared'
61791bedbe3fSmrg	if test "$aix_use_runtimelinking" = yes; then
61801bedbe3fSmrg	  shared_flag="$shared_flag "'${wl}-G'
61811bedbe3fSmrg	fi
61821bedbe3fSmrg      else
61831bedbe3fSmrg	# not using gcc
61841bedbe3fSmrg	if test "$host_cpu" = ia64; then
61851bedbe3fSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
61861bedbe3fSmrg	# chokes on -Wl,-G. The following line is correct:
61871bedbe3fSmrg	  shared_flag='-G'
61881bedbe3fSmrg	else
61891bedbe3fSmrg	  if test "$aix_use_runtimelinking" = yes; then
61901bedbe3fSmrg	    shared_flag='${wl}-G'
61911bedbe3fSmrg	  else
61921bedbe3fSmrg	    shared_flag='${wl}-bM:SRE'
61931bedbe3fSmrg	  fi
61941bedbe3fSmrg	fi
61951bedbe3fSmrg      fi
61961bedbe3fSmrg
61971bedbe3fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
61981bedbe3fSmrg      # It seems that -bexpall does not export symbols beginning with
61991bedbe3fSmrg      # underscore (_), so it is better to generate a list of symbols to export.
62001bedbe3fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
62011bedbe3fSmrg      if test "$aix_use_runtimelinking" = yes; then
62021bedbe3fSmrg	# Warning - without using the other runtime loading flags (-brtl),
62031bedbe3fSmrg	# -berok will link without error, but may produce a broken library.
62041bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
62051bedbe3fSmrg        # Determine the default libpath from the value encoded in an
62061bedbe3fSmrg        # empty executable.
62071bedbe3fSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
62081bedbe3fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
62091bedbe3fSmrg        _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"
62101bedbe3fSmrg      else
62111bedbe3fSmrg	if test "$host_cpu" = ia64; then
62121bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
62131bedbe3fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
62141bedbe3fSmrg	  _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"
62151bedbe3fSmrg	else
62161bedbe3fSmrg	 # Determine the default libpath from the value encoded in an
62171bedbe3fSmrg	 # empty executable.
62181bedbe3fSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
62191bedbe3fSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
62201bedbe3fSmrg	  # Warning - without using the other run time loading flags,
62211bedbe3fSmrg	  # -berok will link without error, but may produce a broken library.
62221bedbe3fSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
62231bedbe3fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
62241bedbe3fSmrg	  if test "$with_gnu_ld" = yes; then
62251bedbe3fSmrg	    # We only use this code for GNU lds that support --whole-archive.
62261bedbe3fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
62271bedbe3fSmrg	  else
62281bedbe3fSmrg	    # Exported symbols can be pulled into shared objects from archives
62291bedbe3fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
62301bedbe3fSmrg	  fi
62311bedbe3fSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
62321bedbe3fSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
62331bedbe3fSmrg	  _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'
62341bedbe3fSmrg	fi
6235549e21daSmrg      fi
6236549e21daSmrg      ;;
6237ba6a1819Smrg
6238549e21daSmrg    amigaos*)
6239549e21daSmrg      case $host_cpu in
6240549e21daSmrg      powerpc)
6241549e21daSmrg            # see comment about AmigaOS4 .so support
62421bedbe3fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
62431bedbe3fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6244549e21daSmrg        ;;
6245549e21daSmrg      m68k)
62461bedbe3fSmrg            _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)'
62471bedbe3fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
62481bedbe3fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6249549e21daSmrg        ;;
6250549e21daSmrg      esac
6251549e21daSmrg      ;;
6252ba6a1819Smrg
62531bedbe3fSmrg    bsdi[[45]]*)
62541bedbe3fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6255549e21daSmrg      ;;
6256ba6a1819Smrg
62571bedbe3fSmrg    cygwin* | mingw* | pw32* | cegcc*)
62581bedbe3fSmrg      # When not using gcc, we currently assume that we are using
62591bedbe3fSmrg      # Microsoft Visual C++.
62601bedbe3fSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
62611bedbe3fSmrg      # no search path for DLLs.
62621bedbe3fSmrg      case $cc_basename in
62631bedbe3fSmrg      cl*)
62641bedbe3fSmrg	# Native MSVC
62651bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
62661bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
62671bedbe3fSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
62681bedbe3fSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
62691bedbe3fSmrg	# Tell ltmain to make .lib files, not .a files.
62701bedbe3fSmrg	libext=lib
62711bedbe3fSmrg	# Tell ltmain to make .dll files, not .so files.
62721bedbe3fSmrg	shrext_cmds=".dll"
62731bedbe3fSmrg	# FIXME: Setting linknames here is a bad hack.
62741bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
62751bedbe3fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
62761bedbe3fSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
62771bedbe3fSmrg	  else
62781bedbe3fSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
62791bedbe3fSmrg	  fi~
62801bedbe3fSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
62811bedbe3fSmrg	  linknames='
62821bedbe3fSmrg	# The linker will not automatically build a static lib if we build a DLL.
62831bedbe3fSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
62841bedbe3fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
62851bedbe3fSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
62861bedbe3fSmrg	_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'
62871bedbe3fSmrg	# Don't use ranlib
62881bedbe3fSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
62891bedbe3fSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
62901bedbe3fSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
62911bedbe3fSmrg	  case $lt_outputfile in
62921bedbe3fSmrg	    *.exe|*.EXE) ;;
62931bedbe3fSmrg	    *)
62941bedbe3fSmrg	      lt_outputfile="$lt_outputfile.exe"
62951bedbe3fSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
62961bedbe3fSmrg	      ;;
62971bedbe3fSmrg	  esac~
62981bedbe3fSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
62991bedbe3fSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
63001bedbe3fSmrg	    $RM "$lt_outputfile.manifest";
63011bedbe3fSmrg	  fi'
6302ba6a1819Smrg	;;
6303ba6a1819Smrg      *)
63041bedbe3fSmrg	# Assume MSVC wrapper
63051bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
63061bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
63071bedbe3fSmrg	# Tell ltmain to make .lib files, not .a files.
63081bedbe3fSmrg	libext=lib
63091bedbe3fSmrg	# Tell ltmain to make .dll files, not .so files.
63101bedbe3fSmrg	shrext_cmds=".dll"
63111bedbe3fSmrg	# FIXME: Setting linknames here is a bad hack.
63121bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
63131bedbe3fSmrg	# The linker will automatically build a .lib file if we build a DLL.
63141bedbe3fSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
63151bedbe3fSmrg	# FIXME: Should let the user specify the lib program.
63161bedbe3fSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
63171bedbe3fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6318ba6a1819Smrg	;;
6319549e21daSmrg      esac
6320549e21daSmrg      ;;
6321ba6a1819Smrg
63221bedbe3fSmrg    darwin* | rhapsody*)
63231bedbe3fSmrg      _LT_DARWIN_LINKER_FEATURES($1)
6324549e21daSmrg      ;;
6325ba6a1819Smrg
63261bedbe3fSmrg    dgux*)
63271bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
63281bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
63291bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6330549e21daSmrg      ;;
6331ba6a1819Smrg
63321bedbe3fSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
63331bedbe3fSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
63341bedbe3fSmrg    # does not break anything, and helps significantly (at the cost of a little
63351bedbe3fSmrg    # extra space).
63361bedbe3fSmrg    freebsd2.2*)
63371bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
63381bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
63391bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63401bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6341549e21daSmrg      ;;
6342ba6a1819Smrg
63431bedbe3fSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
63441bedbe3fSmrg    freebsd2.*)
63451bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
63461bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63471bedbe3fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
63481bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6349549e21daSmrg      ;;
6350ba6a1819Smrg
63511bedbe3fSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
63521bedbe3fSmrg    freebsd* | dragonfly*)
63531bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
63541bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
63551bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63561bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6357549e21daSmrg      ;;
6358ba6a1819Smrg
63591bedbe3fSmrg    hpux9*)
63601bedbe3fSmrg      if test "$GCC" = yes; then
63611bedbe3fSmrg	_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'
6362549e21daSmrg      else
63631bedbe3fSmrg	_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'
6364549e21daSmrg      fi
63651bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
63661bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63671bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6368ba6a1819Smrg
63691bedbe3fSmrg      # hardcode_minus_L: Not really in the search PATH,
63701bedbe3fSmrg      # but as the default location of the library.
63711bedbe3fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
63721bedbe3fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6373549e21daSmrg      ;;
6374549e21daSmrg
63751bedbe3fSmrg    hpux10*)
63761bedbe3fSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
63771bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
63781bedbe3fSmrg      else
63791bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
63801bedbe3fSmrg      fi
63811bedbe3fSmrg      if test "$with_gnu_ld" = no; then
63821bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
63831bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
63841bedbe3fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
63851bedbe3fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63861bedbe3fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63871bedbe3fSmrg	# hardcode_minus_L: Not really in the search PATH,
63881bedbe3fSmrg	# but as the default location of the library.
63891bedbe3fSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
63901bedbe3fSmrg      fi
6391549e21daSmrg      ;;
6392549e21daSmrg
63931bedbe3fSmrg    hpux11*)
63941bedbe3fSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
63951bedbe3fSmrg	case $host_cpu in
63961bedbe3fSmrg	hppa*64*)
63971bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
63981bedbe3fSmrg	  ;;
63991bedbe3fSmrg	ia64*)
64001bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
64011bedbe3fSmrg	  ;;
64021bedbe3fSmrg	*)
64031bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
64041bedbe3fSmrg	  ;;
64051bedbe3fSmrg	esac
64061bedbe3fSmrg      else
64071bedbe3fSmrg	case $host_cpu in
64081bedbe3fSmrg	hppa*64*)
64091bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
64101bedbe3fSmrg	  ;;
64111bedbe3fSmrg	ia64*)
64121bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
64131bedbe3fSmrg	  ;;
64141bedbe3fSmrg	*)
64151bedbe3fSmrg	m4_if($1, [], [
64161bedbe3fSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
64171bedbe3fSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
64181bedbe3fSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
64191bedbe3fSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
64201bedbe3fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
64211bedbe3fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
64221bedbe3fSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
64231bedbe3fSmrg	  ;;
64241bedbe3fSmrg	esac
64251bedbe3fSmrg      fi
64261bedbe3fSmrg      if test "$with_gnu_ld" = no; then
64271bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
64281bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6429549e21daSmrg
64301bedbe3fSmrg	case $host_cpu in
64311bedbe3fSmrg	hppa*64*|ia64*)
64321bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
64331bedbe3fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6434549e21daSmrg	  ;;
64351bedbe3fSmrg	*)
64361bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
64371bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
64381bedbe3fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
64391bedbe3fSmrg
64401bedbe3fSmrg	  # hardcode_minus_L: Not really in the search PATH,
64411bedbe3fSmrg	  # but as the default location of the library.
64421bedbe3fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6443549e21daSmrg	  ;;
6444549e21daSmrg	esac
64451bedbe3fSmrg      fi
64461bedbe3fSmrg      ;;
64471bedbe3fSmrg
64481bedbe3fSmrg    irix5* | irix6* | nonstopux*)
64491bedbe3fSmrg      if test "$GCC" = yes; then
64501bedbe3fSmrg	_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'
64511bedbe3fSmrg	# Try to use the -exported_symbol ld option, if it does not
64521bedbe3fSmrg	# work, assume that -exports_file does not work either and
64531bedbe3fSmrg	# implicitly export all symbols.
64541bedbe3fSmrg	# This should be the same for all languages, so no per-tag cache variable.
64551bedbe3fSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
64561bedbe3fSmrg	  [lt_cv_irix_exported_symbol],
64571bedbe3fSmrg	  [save_LDFLAGS="$LDFLAGS"
64581bedbe3fSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
64591bedbe3fSmrg	   AC_LINK_IFELSE(
64601bedbe3fSmrg	     [AC_LANG_SOURCE(
64611bedbe3fSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
64621bedbe3fSmrg			      [C++], [[int foo (void) { return 0; }]],
64631bedbe3fSmrg			      [Fortran 77], [[
64641bedbe3fSmrg      subroutine foo
64651bedbe3fSmrg      end]],
64661bedbe3fSmrg			      [Fortran], [[
64671bedbe3fSmrg      subroutine foo
64681bedbe3fSmrg      end]])])],
64691bedbe3fSmrg	      [lt_cv_irix_exported_symbol=yes],
64701bedbe3fSmrg	      [lt_cv_irix_exported_symbol=no])
64711bedbe3fSmrg           LDFLAGS="$save_LDFLAGS"])
64721bedbe3fSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
64731bedbe3fSmrg          _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'
64741bedbe3fSmrg	fi
64751bedbe3fSmrg      else
64761bedbe3fSmrg	_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'
64771bedbe3fSmrg	_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'
64781bedbe3fSmrg      fi
64791bedbe3fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
64801bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64811bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64821bedbe3fSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
64831bedbe3fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
64841bedbe3fSmrg      ;;
64851bedbe3fSmrg
64861bedbe3fSmrg    netbsd*)
64871bedbe3fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
64881bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
64891bedbe3fSmrg      else
64901bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
64911bedbe3fSmrg      fi
64921bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64931bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
64941bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6495549e21daSmrg      ;;
6496ba6a1819Smrg
6497549e21daSmrg    newsos6)
64981bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
64991bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
65001bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65011bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
65021bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6503549e21daSmrg      ;;
6504ba6a1819Smrg
6505549e21daSmrg    *nto* | *qnx*)
6506549e21daSmrg      ;;
6507ba6a1819Smrg
65081bedbe3fSmrg    openbsd*)
65091bedbe3fSmrg      if test -f /usr/libexec/ld.so; then
65101bedbe3fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
65111bedbe3fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65121bedbe3fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65131bedbe3fSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
65141bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
65151bedbe3fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
65161bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
65171bedbe3fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
65181bedbe3fSmrg	else
65191bedbe3fSmrg	  case $host_os in
65201bedbe3fSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
65211bedbe3fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
65221bedbe3fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65231bedbe3fSmrg	     ;;
65241bedbe3fSmrg	   *)
65251bedbe3fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
65261bedbe3fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
65271bedbe3fSmrg	     ;;
65281bedbe3fSmrg	  esac
65291bedbe3fSmrg	fi
65301bedbe3fSmrg      else
65311bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
65321bedbe3fSmrg      fi
6533549e21daSmrg      ;;
6534ba6a1819Smrg
65351bedbe3fSmrg    os2*)
65361bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65371bedbe3fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
65381bedbe3fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
65391bedbe3fSmrg      _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'
65401bedbe3fSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
65411bedbe3fSmrg      ;;
65421bedbe3fSmrg
65431bedbe3fSmrg    osf3*)
65441bedbe3fSmrg      if test "$GCC" = yes; then
65451bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
65461bedbe3fSmrg	_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'
65471bedbe3fSmrg      else
65481bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
65491bedbe3fSmrg	_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'
65501bedbe3fSmrg      fi
65511bedbe3fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
65521bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65531bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
65541bedbe3fSmrg      ;;
65551bedbe3fSmrg
65561bedbe3fSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
65571bedbe3fSmrg      if test "$GCC" = yes; then
65581bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
65591bedbe3fSmrg	_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'
65601bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65611bedbe3fSmrg      else
65621bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
65631bedbe3fSmrg	_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'
65641bedbe3fSmrg	_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~
65651bedbe3fSmrg	$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'
65661bedbe3fSmrg
65671bedbe3fSmrg	# Both c and cxx compiler support -rpath directly
65681bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
65691bedbe3fSmrg      fi
65701bedbe3fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
65711bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6572549e21daSmrg      ;;
6573ba6a1819Smrg
6574549e21daSmrg    solaris*)
65751bedbe3fSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
65761bedbe3fSmrg      if test "$GCC" = yes; then
65771bedbe3fSmrg	wlarc='${wl}'
65781bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
65791bedbe3fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
65801bedbe3fSmrg	  $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'
65811bedbe3fSmrg      else
65821bedbe3fSmrg	case `$CC -V 2>&1` in
65831bedbe3fSmrg	*"Compilers 5.0"*)
65841bedbe3fSmrg	  wlarc=''
65851bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
65861bedbe3fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
65871bedbe3fSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
65881bedbe3fSmrg	  ;;
65891bedbe3fSmrg	*)
65901bedbe3fSmrg	  wlarc='${wl}'
65911bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
65921bedbe3fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
65931bedbe3fSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
65941bedbe3fSmrg	  ;;
65951bedbe3fSmrg	esac
65961bedbe3fSmrg      fi
65971bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65981bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65991bedbe3fSmrg      case $host_os in
66001bedbe3fSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6601549e21daSmrg      *)
66021bedbe3fSmrg	# The compiler driver will combine and reorder linker options,
66031bedbe3fSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
66041bedbe3fSmrg	# but is careful enough not to reorder.
66051bedbe3fSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
66061bedbe3fSmrg	if test "$GCC" = yes; then
66071bedbe3fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
66081bedbe3fSmrg	else
66091bedbe3fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
66101bedbe3fSmrg	fi
66111bedbe3fSmrg	;;
6612549e21daSmrg      esac
66131bedbe3fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6614549e21daSmrg      ;;
6615ba6a1819Smrg
6616549e21daSmrg    sunos4*)
66171bedbe3fSmrg      if test "x$host_vendor" = xsequent; then
66181bedbe3fSmrg	# Use $CC to link under sequent, because it throws in some extra .o
66191bedbe3fSmrg	# files that make .init and .fini sections work.
66201bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
66211bedbe3fSmrg      else
66221bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
66231bedbe3fSmrg      fi
66241bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
66251bedbe3fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
66261bedbe3fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
66271bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6628549e21daSmrg      ;;
6629ba6a1819Smrg
66301bedbe3fSmrg    sysv4)
66311bedbe3fSmrg      case $host_vendor in
66321bedbe3fSmrg	sni)
66331bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66341bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
66351bedbe3fSmrg	;;
66361bedbe3fSmrg	siemens)
66371bedbe3fSmrg	  ## LD is ld it makes a PLAMLIB
66381bedbe3fSmrg	  ## CC just makes a GrossModule.
66391bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
66401bedbe3fSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
66411bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
66421bedbe3fSmrg        ;;
66431bedbe3fSmrg	motorola)
66441bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66451bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
66461bedbe3fSmrg	;;
66471bedbe3fSmrg      esac
66481bedbe3fSmrg      runpath_var='LD_RUN_PATH'
66491bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66501bedbe3fSmrg      ;;
66511bedbe3fSmrg
66521bedbe3fSmrg    sysv4.3*)
66531bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66541bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66551bedbe3fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6656549e21daSmrg      ;;
6657ba6a1819Smrg
6658549e21daSmrg    sysv4*MP*)
66591bedbe3fSmrg      if test -d /usr/nec; then
66601bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66611bedbe3fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66621bedbe3fSmrg	runpath_var=LD_RUN_PATH
66631bedbe3fSmrg	hardcode_runpath_var=yes
66641bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
6665549e21daSmrg      fi
6666549e21daSmrg      ;;
6667ba6a1819Smrg
66681bedbe3fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
66691bedbe3fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
66701bedbe3fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
66711bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66721bedbe3fSmrg      runpath_var='LD_RUN_PATH'
66731bedbe3fSmrg
66741bedbe3fSmrg      if test "$GCC" = yes; then
66751bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66761bedbe3fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66771bedbe3fSmrg      else
66781bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66791bedbe3fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
66801bedbe3fSmrg      fi
6681549e21daSmrg      ;;
6682ba6a1819Smrg
66831bedbe3fSmrg    sysv5* | sco3.2v5* | sco5v6*)
66841bedbe3fSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
66851bedbe3fSmrg      # link with -lc, and that would cause any symbols used from libc to
66861bedbe3fSmrg      # always be unresolved, which means just about no library would
66871bedbe3fSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
66881bedbe3fSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
66891bedbe3fSmrg      # as -z defs.
66901bedbe3fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
66911bedbe3fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
66921bedbe3fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
66931bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66941bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
66951bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
66961bedbe3fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
66971bedbe3fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
66981bedbe3fSmrg      runpath_var='LD_RUN_PATH'
66991bedbe3fSmrg
67001bedbe3fSmrg      if test "$GCC" = yes; then
67011bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
67021bedbe3fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
67031bedbe3fSmrg      else
67041bedbe3fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
67051bedbe3fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
67061bedbe3fSmrg      fi
6707549e21daSmrg      ;;
6708ba6a1819Smrg
6709549e21daSmrg    uts4*)
67101bedbe3fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
67111bedbe3fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
67121bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6713549e21daSmrg      ;;
6714ba6a1819Smrg
6715549e21daSmrg    *)
67161bedbe3fSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
6717549e21daSmrg      ;;
6718ba6a1819Smrg    esac
67191bedbe3fSmrg
67201bedbe3fSmrg    if test x$host_vendor = xsni; then
67211bedbe3fSmrg      case $host in
67221bedbe3fSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
67231bedbe3fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
67241bedbe3fSmrg	;;
67251bedbe3fSmrg      esac
67261bedbe3fSmrg    fi
6727549e21daSmrg  fi
6728549e21daSmrg])
67291bedbe3fSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
67301bedbe3fSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6731ba6a1819Smrg
67321bedbe3fSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
67331bedbe3fSmrg
67341bedbe3fSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
67351bedbe3fSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
67361bedbe3fSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
67371bedbe3fSmrg    [The commands to extract the exported symbol list from a shared archive])
6738ba6a1819Smrg
6739549e21daSmrg#
67401bedbe3fSmrg# Do we need to explicitly link libc?
6741549e21daSmrg#
67421bedbe3fSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
67431bedbe3fSmrgx|xyes)
67441bedbe3fSmrg  # Assume -lc should be added
67451bedbe3fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6746ba6a1819Smrg
67471bedbe3fSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
67481bedbe3fSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
67491bedbe3fSmrg    *'~'*)
67501bedbe3fSmrg      # FIXME: we may have to deal with multi-command sequences.
67511bedbe3fSmrg      ;;
67521bedbe3fSmrg    '$CC '*)
67531bedbe3fSmrg      # Test whether the compiler implicitly links with -lc since on some
67541bedbe3fSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
67551bedbe3fSmrg      # to ld, don't add -lc before -lgcc.
67561bedbe3fSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
67571bedbe3fSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
67581bedbe3fSmrg	[$RM conftest*
67591bedbe3fSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6760ba6a1819Smrg
67611bedbe3fSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
67621bedbe3fSmrg	  soname=conftest
67631bedbe3fSmrg	  lib=conftest
67641bedbe3fSmrg	  libobjs=conftest.$ac_objext
67651bedbe3fSmrg	  deplibs=
67661bedbe3fSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
67671bedbe3fSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
67681bedbe3fSmrg	  compiler_flags=-v
67691bedbe3fSmrg	  linker_flags=-v
67701bedbe3fSmrg	  verstring=
67711bedbe3fSmrg	  output_objdir=.
67721bedbe3fSmrg	  libname=conftest
67731bedbe3fSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
67741bedbe3fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
67751bedbe3fSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
67761bedbe3fSmrg	  then
67771bedbe3fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
67781bedbe3fSmrg	  else
67791bedbe3fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
67801bedbe3fSmrg	  fi
67811bedbe3fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
67821bedbe3fSmrg	else
67831bedbe3fSmrg	  cat conftest.err 1>&5
67841bedbe3fSmrg	fi
67851bedbe3fSmrg	$RM conftest*
67861bedbe3fSmrg	])
67871bedbe3fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
67881bedbe3fSmrg      ;;
67891bedbe3fSmrg    esac
67901bedbe3fSmrg  fi
6791549e21daSmrg  ;;
67921bedbe3fSmrgesac
67931bedbe3fSmrg
67941bedbe3fSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
67951bedbe3fSmrg    [Whether or not to add -lc for building shared libraries])
67961bedbe3fSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
67971bedbe3fSmrg    [enable_shared_with_static_runtimes], [0],
67981bedbe3fSmrg    [Whether or not to disallow shared libs when runtime libs are static])
67991bedbe3fSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
68001bedbe3fSmrg    [Compiler flag to allow reflexive dlopens])
68011bedbe3fSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
68021bedbe3fSmrg    [Compiler flag to generate shared objects directly from archives])
68031bedbe3fSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
68041bedbe3fSmrg    [Whether the compiler copes with passing no objects directly])
68051bedbe3fSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
68061bedbe3fSmrg    [Create an old-style archive from a shared archive])
68071bedbe3fSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
68081bedbe3fSmrg    [Create a temporary old-style archive to link instead of a shared archive])
68091bedbe3fSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
68101bedbe3fSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
68111bedbe3fSmrg_LT_TAGDECL([], [module_cmds], [2],
68121bedbe3fSmrg    [Commands used to build a loadable module if different from building
68131bedbe3fSmrg    a shared archive.])
68141bedbe3fSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
68151bedbe3fSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
68161bedbe3fSmrg    [Whether we are building with GNU ld or not])
68171bedbe3fSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
68181bedbe3fSmrg    [Flag that allows shared libraries with undefined symbols to be built])
68191bedbe3fSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
68201bedbe3fSmrg    [Flag that enforces no undefined symbols])
68211bedbe3fSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
68221bedbe3fSmrg    [Flag to hardcode $libdir into a binary during linking.
68231bedbe3fSmrg    This must work even if $libdir does not exist])
68241bedbe3fSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
68251bedbe3fSmrg    [Whether we need a single "-rpath" flag with a separated argument])
68261bedbe3fSmrg_LT_TAGDECL([], [hardcode_direct], [0],
68271bedbe3fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
68281bedbe3fSmrg    DIR into the resulting binary])
68291bedbe3fSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
68301bedbe3fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
68311bedbe3fSmrg    DIR into the resulting binary and the resulting library dependency is
68321bedbe3fSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
68331bedbe3fSmrg    library is relocated])
68341bedbe3fSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
68351bedbe3fSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
68361bedbe3fSmrg    into the resulting binary])
68371bedbe3fSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
68381bedbe3fSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
68391bedbe3fSmrg    into the resulting binary])
68401bedbe3fSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
68411bedbe3fSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
68421bedbe3fSmrg    into the library and all subsequent libraries and executables linked
68431bedbe3fSmrg    against it])
68441bedbe3fSmrg_LT_TAGDECL([], [inherit_rpath], [0],
68451bedbe3fSmrg    [Set to yes if linker adds runtime paths of dependent libraries
68461bedbe3fSmrg    to runtime path list])
68471bedbe3fSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
68481bedbe3fSmrg    [Whether libtool must link a program against all its dependency libraries])
68491bedbe3fSmrg_LT_TAGDECL([], [always_export_symbols], [0],
68501bedbe3fSmrg    [Set to "yes" if exported symbols are required])
68511bedbe3fSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
68521bedbe3fSmrg    [The commands to list exported symbols])
68531bedbe3fSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
68541bedbe3fSmrg    [Symbols that should not be listed in the preloaded symbols])
68551bedbe3fSmrg_LT_TAGDECL([], [include_expsyms], [1],
68561bedbe3fSmrg    [Symbols that must always be exported])
68571bedbe3fSmrg_LT_TAGDECL([], [prelink_cmds], [2],
68581bedbe3fSmrg    [Commands necessary for linking programs (against libraries) with templates])
68591bedbe3fSmrg_LT_TAGDECL([], [postlink_cmds], [2],
68601bedbe3fSmrg    [Commands necessary for finishing linking programs])
68611bedbe3fSmrg_LT_TAGDECL([], [file_list_spec], [1],
68621bedbe3fSmrg    [Specify filename containing input files])
68631bedbe3fSmrgdnl FIXME: Not yet implemented
68641bedbe3fSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
68651bedbe3fSmrgdnl    [Compiler flag to generate thread safe objects])
68661bedbe3fSmrg])# _LT_LINKER_SHLIBS
68671bedbe3fSmrg
68681bedbe3fSmrg
68691bedbe3fSmrg# _LT_LANG_C_CONFIG([TAG])
68701bedbe3fSmrg# ------------------------
68711bedbe3fSmrg# Ensure that the configuration variables for a C compiler are suitably
68721bedbe3fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
68731bedbe3fSmrg# the compiler configuration to `libtool'.
68741bedbe3fSmrgm4_defun([_LT_LANG_C_CONFIG],
68751bedbe3fSmrg[m4_require([_LT_DECL_EGREP])dnl
68761bedbe3fSmrglt_save_CC="$CC"
68771bedbe3fSmrgAC_LANG_PUSH(C)
68781bedbe3fSmrg
68791bedbe3fSmrg# Source file extension for C test sources.
68801bedbe3fSmrgac_ext=c
68811bedbe3fSmrg
68821bedbe3fSmrg# Object file extension for compiled C test sources.
68831bedbe3fSmrgobjext=o
68841bedbe3fSmrg_LT_TAGVAR(objext, $1)=$objext
68851bedbe3fSmrg
68861bedbe3fSmrg# Code to be used in simple compile tests
68871bedbe3fSmrglt_simple_compile_test_code="int some_variable = 0;"
68881bedbe3fSmrg
68891bedbe3fSmrg# Code to be used in simple link tests
68901bedbe3fSmrglt_simple_link_test_code='int main(){return(0);}'
68911bedbe3fSmrg
68921bedbe3fSmrg_LT_TAG_COMPILER
68931bedbe3fSmrg# Save the default compiler, since it gets overwritten when the other
68941bedbe3fSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
68951bedbe3fSmrgcompiler_DEFAULT=$CC
68961bedbe3fSmrg
68971bedbe3fSmrg# save warnings/boilerplate of simple test code
68981bedbe3fSmrg_LT_COMPILER_BOILERPLATE
68991bedbe3fSmrg_LT_LINKER_BOILERPLATE
69001bedbe3fSmrg
69011bedbe3fSmrgif test -n "$compiler"; then
69021bedbe3fSmrg  _LT_COMPILER_NO_RTTI($1)
69031bedbe3fSmrg  _LT_COMPILER_PIC($1)
69041bedbe3fSmrg  _LT_COMPILER_C_O($1)
69051bedbe3fSmrg  _LT_COMPILER_FILE_LOCKS($1)
69061bedbe3fSmrg  _LT_LINKER_SHLIBS($1)
69071bedbe3fSmrg  _LT_SYS_DYNAMIC_LINKER($1)
69081bedbe3fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
69091bedbe3fSmrg  LT_SYS_DLOPEN_SELF
69101bedbe3fSmrg  _LT_CMD_STRIPLIB
69111bedbe3fSmrg
69121bedbe3fSmrg  # Report which library types will actually be built
69131bedbe3fSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
69141bedbe3fSmrg  AC_MSG_RESULT([$can_build_shared])
69151bedbe3fSmrg
69161bedbe3fSmrg  AC_MSG_CHECKING([whether to build shared libraries])
69171bedbe3fSmrg  test "$can_build_shared" = "no" && enable_shared=no
6918ba6a1819Smrg
69191bedbe3fSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
69201bedbe3fSmrg  # are all built from PIC.
6921549e21daSmrg  case $host_os in
69221bedbe3fSmrg  aix3*)
69231bedbe3fSmrg    test "$enable_shared" = yes && enable_static=no
69241bedbe3fSmrg    if test -n "$RANLIB"; then
69251bedbe3fSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
69261bedbe3fSmrg      postinstall_cmds='$RANLIB $lib'
6927549e21daSmrg    fi
6928549e21daSmrg    ;;
69291bedbe3fSmrg
69301bedbe3fSmrg  aix[[4-9]]*)
69311bedbe3fSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
69321bedbe3fSmrg      test "$enable_shared" = yes && enable_static=no
69331bedbe3fSmrg    fi
6934549e21daSmrg    ;;
6935549e21daSmrg  esac
69361bedbe3fSmrg  AC_MSG_RESULT([$enable_shared])
6937ba6a1819Smrg
69381bedbe3fSmrg  AC_MSG_CHECKING([whether to build static libraries])
69391bedbe3fSmrg  # Make sure either enable_shared or enable_static is yes.
69401bedbe3fSmrg  test "$enable_shared" = yes || enable_static=yes
69411bedbe3fSmrg  AC_MSG_RESULT([$enable_static])
6942ba6a1819Smrg
69431bedbe3fSmrg  _LT_CONFIG($1)
69441bedbe3fSmrgfi
69451bedbe3fSmrgAC_LANG_POP
69461bedbe3fSmrgCC="$lt_save_CC"
69471bedbe3fSmrg])# _LT_LANG_C_CONFIG
6948ba6a1819Smrg
6949ba6a1819Smrg
69501bedbe3fSmrg# _LT_LANG_CXX_CONFIG([TAG])
69511bedbe3fSmrg# --------------------------
69521bedbe3fSmrg# Ensure that the configuration variables for a C++ compiler are suitably
69531bedbe3fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
69541bedbe3fSmrg# the compiler configuration to `libtool'.
69551bedbe3fSmrgm4_defun([_LT_LANG_CXX_CONFIG],
69561bedbe3fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
69571bedbe3fSmrgm4_require([_LT_DECL_EGREP])dnl
69581bedbe3fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
69591bedbe3fSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
69601bedbe3fSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
69611bedbe3fSmrg    (test "X$CXX" != "Xg++"))) ; then
69621bedbe3fSmrg  AC_PROG_CXXCPP
69631bedbe3fSmrgelse
69641bedbe3fSmrg  _lt_caught_CXX_error=yes
69651bedbe3fSmrgfi
69661bedbe3fSmrg
69671bedbe3fSmrgAC_LANG_PUSH(C++)
69681bedbe3fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
69691bedbe3fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
69701bedbe3fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
69711bedbe3fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
69721bedbe3fSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
69731bedbe3fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
69741bedbe3fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
69751bedbe3fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
69761bedbe3fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
69771bedbe3fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
69781bedbe3fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
69791bedbe3fSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
69801bedbe3fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
69811bedbe3fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
69821bedbe3fSmrg_LT_TAGVAR(module_cmds, $1)=
69831bedbe3fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
69841bedbe3fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
69851bedbe3fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
69861bedbe3fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
69871bedbe3fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
69881bedbe3fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
69891bedbe3fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
69901bedbe3fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
69911bedbe3fSmrg
69921bedbe3fSmrg# Source file extension for C++ test sources.
69931bedbe3fSmrgac_ext=cpp
69941bedbe3fSmrg
69951bedbe3fSmrg# Object file extension for compiled C++ test sources.
69961bedbe3fSmrgobjext=o
69971bedbe3fSmrg_LT_TAGVAR(objext, $1)=$objext
69981bedbe3fSmrg
69991bedbe3fSmrg# No sense in running all these tests if we already determined that
70001bedbe3fSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
70011bedbe3fSmrg# are currently assumed to apply to all compilers on this platform,
70021bedbe3fSmrg# and will be corrupted by setting them based on a non-working compiler.
70031bedbe3fSmrgif test "$_lt_caught_CXX_error" != yes; then
70041bedbe3fSmrg  # Code to be used in simple compile tests
70051bedbe3fSmrg  lt_simple_compile_test_code="int some_variable = 0;"
70061bedbe3fSmrg
70071bedbe3fSmrg  # Code to be used in simple link tests
70081bedbe3fSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
70091bedbe3fSmrg
70101bedbe3fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
70111bedbe3fSmrg  _LT_TAG_COMPILER
70121bedbe3fSmrg
70131bedbe3fSmrg  # save warnings/boilerplate of simple test code
70141bedbe3fSmrg  _LT_COMPILER_BOILERPLATE
70151bedbe3fSmrg  _LT_LINKER_BOILERPLATE
70161bedbe3fSmrg
70171bedbe3fSmrg  # Allow CC to be a program name with arguments.
70181bedbe3fSmrg  lt_save_CC=$CC
70191bedbe3fSmrg  lt_save_CFLAGS=$CFLAGS
70201bedbe3fSmrg  lt_save_LD=$LD
70211bedbe3fSmrg  lt_save_GCC=$GCC
70221bedbe3fSmrg  GCC=$GXX
70231bedbe3fSmrg  lt_save_with_gnu_ld=$with_gnu_ld
70241bedbe3fSmrg  lt_save_path_LD=$lt_cv_path_LD
70251bedbe3fSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
70261bedbe3fSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
70271bedbe3fSmrg  else
70281bedbe3fSmrg    $as_unset lt_cv_prog_gnu_ld
70291bedbe3fSmrg  fi
70301bedbe3fSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
70311bedbe3fSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
70321bedbe3fSmrg  else
70331bedbe3fSmrg    $as_unset lt_cv_path_LD
70341bedbe3fSmrg  fi
70351bedbe3fSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
70361bedbe3fSmrg  CC=${CXX-"c++"}
70371bedbe3fSmrg  CFLAGS=$CXXFLAGS
70381bedbe3fSmrg  compiler=$CC
70391bedbe3fSmrg  _LT_TAGVAR(compiler, $1)=$CC
70401bedbe3fSmrg  _LT_CC_BASENAME([$compiler])
70411bedbe3fSmrg
70421bedbe3fSmrg  if test -n "$compiler"; then
70431bedbe3fSmrg    # We don't want -fno-exception when compiling C++ code, so set the
70441bedbe3fSmrg    # no_builtin_flag separately
70451bedbe3fSmrg    if test "$GXX" = yes; then
70461bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7047549e21daSmrg    else
70481bedbe3fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7049549e21daSmrg    fi
7050ba6a1819Smrg
70511bedbe3fSmrg    if test "$GXX" = yes; then
70521bedbe3fSmrg      # Set up default GNU C++ configuration
7053ba6a1819Smrg
70541bedbe3fSmrg      LT_PATH_LD
70551bedbe3fSmrg
70561bedbe3fSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
70571bedbe3fSmrg      # archiving commands below assume that GNU ld is being used.
70581bedbe3fSmrg      if test "$with_gnu_ld" = yes; then
70591bedbe3fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
70601bedbe3fSmrg        _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'
70611bedbe3fSmrg
70621bedbe3fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
70631bedbe3fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
70641bedbe3fSmrg
70651bedbe3fSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
70661bedbe3fSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
70671bedbe3fSmrg        #     investigate it a little bit more. (MM)
70681bedbe3fSmrg        wlarc='${wl}'
70691bedbe3fSmrg
70701bedbe3fSmrg        # ancient GNU ld didn't support --whole-archive et. al.
70711bedbe3fSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
70721bedbe3fSmrg	  $GREP 'no-whole-archive' > /dev/null; then
70731bedbe3fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
70741bedbe3fSmrg        else
70751bedbe3fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
70761bedbe3fSmrg        fi
70771bedbe3fSmrg      else
70781bedbe3fSmrg        with_gnu_ld=no
70791bedbe3fSmrg        wlarc=
7080ba6a1819Smrg
70811bedbe3fSmrg        # A generic and very simple default shared library creation
70821bedbe3fSmrg        # command for GNU C++ for the case where it uses the native
70831bedbe3fSmrg        # linker, instead of GNU ld.  If possible, this setting should
70841bedbe3fSmrg        # overridden to take advantage of the native linker features on
70851bedbe3fSmrg        # the platform it is being used on.
70861bedbe3fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7087549e21daSmrg      fi
7088ba6a1819Smrg
70891bedbe3fSmrg      # Commands to make compiler produce verbose output that lists
70901bedbe3fSmrg      # what "hidden" libraries, object files and flags are used when
70911bedbe3fSmrg      # linking a shared library.
70921bedbe3fSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
70931bedbe3fSmrg
70941bedbe3fSmrg    else
70951bedbe3fSmrg      GXX=no
70961bedbe3fSmrg      with_gnu_ld=no
70971bedbe3fSmrg      wlarc=
70981bedbe3fSmrg    fi
70991bedbe3fSmrg
71001bedbe3fSmrg    # PORTME: fill in a description of your system's C++ link characteristics
71011bedbe3fSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
71021bedbe3fSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
71031bedbe3fSmrg    case $host_os in
71041bedbe3fSmrg      aix3*)
71051bedbe3fSmrg        # FIXME: insert proper C++ library support
71061bedbe3fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7107549e21daSmrg        ;;
71081bedbe3fSmrg      aix[[4-9]]*)
71091bedbe3fSmrg        if test "$host_cpu" = ia64; then
71101bedbe3fSmrg          # On IA64, the linker does run time linking by default, so we don't
71111bedbe3fSmrg          # have to do anything special.
71121bedbe3fSmrg          aix_use_runtimelinking=no
71131bedbe3fSmrg          exp_sym_flag='-Bexport'
71141bedbe3fSmrg          no_entry_flag=""
71151bedbe3fSmrg        else
71161bedbe3fSmrg          aix_use_runtimelinking=no
7117ba6a1819Smrg
71181bedbe3fSmrg          # Test if we are trying to use run time linking or normal
71191bedbe3fSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
71201bedbe3fSmrg          # need to do runtime linking.
71211bedbe3fSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
71221bedbe3fSmrg	    for ld_flag in $LDFLAGS; do
71231bedbe3fSmrg	      case $ld_flag in
71241bedbe3fSmrg	      *-brtl*)
71251bedbe3fSmrg	        aix_use_runtimelinking=yes
71261bedbe3fSmrg	        break
71271bedbe3fSmrg	        ;;
71281bedbe3fSmrg	      esac
71291bedbe3fSmrg	    done
71301bedbe3fSmrg	    ;;
71311bedbe3fSmrg          esac
7132ba6a1819Smrg
71331bedbe3fSmrg          exp_sym_flag='-bexport'
71341bedbe3fSmrg          no_entry_flag='-bnoentry'
71351bedbe3fSmrg        fi
7136549e21daSmrg
71371bedbe3fSmrg        # When large executables or shared objects are built, AIX ld can
71381bedbe3fSmrg        # have problems creating the table of contents.  If linking a library
71391bedbe3fSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
71401bedbe3fSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
71411bedbe3fSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7142ba6a1819Smrg
71431bedbe3fSmrg        _LT_TAGVAR(archive_cmds, $1)=''
71441bedbe3fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
71451bedbe3fSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
71461bedbe3fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
71471bedbe3fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
71481bedbe3fSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7149ba6a1819Smrg
71501bedbe3fSmrg        if test "$GXX" = yes; then
71511bedbe3fSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
71521bedbe3fSmrg          # We only want to do this on AIX 4.2 and lower, the check
71531bedbe3fSmrg          # below for broken collect2 doesn't work under 4.3+
71541bedbe3fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
71551bedbe3fSmrg	  if test -f "$collect2name" &&
71561bedbe3fSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
71571bedbe3fSmrg	  then
71581bedbe3fSmrg	    # We have reworked collect2
71591bedbe3fSmrg	    :
71601bedbe3fSmrg	  else
71611bedbe3fSmrg	    # We have old collect2
71621bedbe3fSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
71631bedbe3fSmrg	    # It fails to find uninstalled libraries when the uninstalled
71641bedbe3fSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
71651bedbe3fSmrg	    # to unsupported forces relinking
71661bedbe3fSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
71671bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
71681bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
71691bedbe3fSmrg	  fi
71701bedbe3fSmrg          esac
71711bedbe3fSmrg          shared_flag='-shared'
71721bedbe3fSmrg	  if test "$aix_use_runtimelinking" = yes; then
71731bedbe3fSmrg	    shared_flag="$shared_flag "'${wl}-G'
71741bedbe3fSmrg	  fi
71751bedbe3fSmrg        else
71761bedbe3fSmrg          # not using gcc
71771bedbe3fSmrg          if test "$host_cpu" = ia64; then
71781bedbe3fSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
71791bedbe3fSmrg	  # chokes on -Wl,-G. The following line is correct:
71801bedbe3fSmrg	  shared_flag='-G'
71811bedbe3fSmrg          else
71821bedbe3fSmrg	    if test "$aix_use_runtimelinking" = yes; then
71831bedbe3fSmrg	      shared_flag='${wl}-G'
71841bedbe3fSmrg	    else
71851bedbe3fSmrg	      shared_flag='${wl}-bM:SRE'
71861bedbe3fSmrg	    fi
71871bedbe3fSmrg          fi
71881bedbe3fSmrg        fi
7189ba6a1819Smrg
71901bedbe3fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
71911bedbe3fSmrg        # It seems that -bexpall does not export symbols beginning with
71921bedbe3fSmrg        # underscore (_), so it is better to generate a list of symbols to
71931bedbe3fSmrg	# export.
71941bedbe3fSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
71951bedbe3fSmrg        if test "$aix_use_runtimelinking" = yes; then
71961bedbe3fSmrg          # Warning - without using the other runtime loading flags (-brtl),
71971bedbe3fSmrg          # -berok will link without error, but may produce a broken library.
71981bedbe3fSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
71991bedbe3fSmrg          # Determine the default libpath from the value encoded in an empty
72001bedbe3fSmrg          # executable.
72011bedbe3fSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
72021bedbe3fSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7203ba6a1819Smrg
72041bedbe3fSmrg          _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"
72051bedbe3fSmrg        else
72061bedbe3fSmrg          if test "$host_cpu" = ia64; then
72071bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
72081bedbe3fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
72091bedbe3fSmrg	    _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"
72101bedbe3fSmrg          else
72111bedbe3fSmrg	    # Determine the default libpath from the value encoded in an
72121bedbe3fSmrg	    # empty executable.
72131bedbe3fSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
72141bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
72151bedbe3fSmrg	    # Warning - without using the other run time loading flags,
72161bedbe3fSmrg	    # -berok will link without error, but may produce a broken library.
72171bedbe3fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
72181bedbe3fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
72191bedbe3fSmrg	    if test "$with_gnu_ld" = yes; then
72201bedbe3fSmrg	      # We only use this code for GNU lds that support --whole-archive.
72211bedbe3fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
72221bedbe3fSmrg	    else
72231bedbe3fSmrg	      # Exported symbols can be pulled into shared objects from archives
72241bedbe3fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
72251bedbe3fSmrg	    fi
72261bedbe3fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
72271bedbe3fSmrg	    # This is similar to how AIX traditionally builds its shared
72281bedbe3fSmrg	    # libraries.
72291bedbe3fSmrg	    _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'
72301bedbe3fSmrg          fi
7231549e21daSmrg        fi
72321bedbe3fSmrg        ;;
7233ba6a1819Smrg
72341bedbe3fSmrg      beos*)
72351bedbe3fSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
72361bedbe3fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
72371bedbe3fSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
72381bedbe3fSmrg	  # support --undefined.  This deserves some investigation.  FIXME
72391bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
72401bedbe3fSmrg	else
72411bedbe3fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
72421bedbe3fSmrg	fi
72431bedbe3fSmrg	;;
72441bedbe3fSmrg
72451bedbe3fSmrg      chorus*)
72461bedbe3fSmrg        case $cc_basename in
72471bedbe3fSmrg          *)
72481bedbe3fSmrg	  # FIXME: insert proper C++ library support
72491bedbe3fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
72501bedbe3fSmrg	  ;;
72511bedbe3fSmrg        esac
72521bedbe3fSmrg        ;;
72531bedbe3fSmrg
72541bedbe3fSmrg      cygwin* | mingw* | pw32* | cegcc*)
72551bedbe3fSmrg	case $GXX,$cc_basename in
72561bedbe3fSmrg	,cl* | no,cl*)
72571bedbe3fSmrg	  # Native MSVC
72581bedbe3fSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
72591bedbe3fSmrg	  # no search path for DLLs.
72601bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
72611bedbe3fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
72621bedbe3fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
72631bedbe3fSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
72641bedbe3fSmrg	  # Tell ltmain to make .lib files, not .a files.
72651bedbe3fSmrg	  libext=lib
72661bedbe3fSmrg	  # Tell ltmain to make .dll files, not .so files.
72671bedbe3fSmrg	  shrext_cmds=".dll"
72681bedbe3fSmrg	  # FIXME: Setting linknames here is a bad hack.
72691bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
72701bedbe3fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
72711bedbe3fSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
72721bedbe3fSmrg	    else
72731bedbe3fSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
72741bedbe3fSmrg	    fi~
72751bedbe3fSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
72761bedbe3fSmrg	    linknames='
72771bedbe3fSmrg	  # The linker will not automatically build a static lib if we build a DLL.
72781bedbe3fSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
72791bedbe3fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
72801bedbe3fSmrg	  # Don't use ranlib
72811bedbe3fSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
72821bedbe3fSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
72831bedbe3fSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
72841bedbe3fSmrg	    case $lt_outputfile in
72851bedbe3fSmrg	      *.exe|*.EXE) ;;
72861bedbe3fSmrg	      *)
72871bedbe3fSmrg		lt_outputfile="$lt_outputfile.exe"
72881bedbe3fSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
72891bedbe3fSmrg		;;
72901bedbe3fSmrg	    esac~
72911bedbe3fSmrg	    func_to_tool_file "$lt_outputfile"~
72921bedbe3fSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
72931bedbe3fSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
72941bedbe3fSmrg	      $RM "$lt_outputfile.manifest";
72951bedbe3fSmrg	    fi'
72961bedbe3fSmrg	  ;;
72971bedbe3fSmrg	*)
72981bedbe3fSmrg	  # g++
72991bedbe3fSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
73001bedbe3fSmrg	  # as there is no search path for DLLs.
73011bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
73021bedbe3fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
73031bedbe3fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
73041bedbe3fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
73051bedbe3fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
73061bedbe3fSmrg
73071bedbe3fSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
73081bedbe3fSmrg	    _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'
73091bedbe3fSmrg	    # If the export-symbols file already is a .def file (1st line
73101bedbe3fSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
73111bedbe3fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
73121bedbe3fSmrg	      cp $export_symbols $output_objdir/$soname.def;
73131bedbe3fSmrg	    else
73141bedbe3fSmrg	      echo EXPORTS > $output_objdir/$soname.def;
73151bedbe3fSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
73161bedbe3fSmrg	    fi~
73171bedbe3fSmrg	    $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'
73181bedbe3fSmrg	  else
73191bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7320549e21daSmrg	  fi
7321549e21daSmrg	  ;;
7322549e21daSmrg	esac
73231bedbe3fSmrg	;;
73241bedbe3fSmrg      darwin* | rhapsody*)
73251bedbe3fSmrg        _LT_DARWIN_LINKER_FEATURES($1)
73261bedbe3fSmrg	;;
73271bedbe3fSmrg
73281bedbe3fSmrg      dgux*)
73291bedbe3fSmrg        case $cc_basename in
73301bedbe3fSmrg          ec++*)
73311bedbe3fSmrg	    # FIXME: insert proper C++ library support
73321bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73331bedbe3fSmrg	    ;;
73341bedbe3fSmrg          ghcx*)
73351bedbe3fSmrg	    # Green Hills C++ Compiler
73361bedbe3fSmrg	    # FIXME: insert proper C++ library support
73371bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73381bedbe3fSmrg	    ;;
73391bedbe3fSmrg          *)
73401bedbe3fSmrg	    # FIXME: insert proper C++ library support
73411bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73421bedbe3fSmrg	    ;;
73431bedbe3fSmrg        esac
73441bedbe3fSmrg        ;;
73451bedbe3fSmrg
73461bedbe3fSmrg      freebsd2.*)
73471bedbe3fSmrg        # C++ shared libraries reported to be fairly broken before
73481bedbe3fSmrg	# switch to ELF
7349549e21daSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
73501bedbe3fSmrg        ;;
7351ba6a1819Smrg
73521bedbe3fSmrg      freebsd-elf*)
73531bedbe3fSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
73541bedbe3fSmrg        ;;
7355ba6a1819Smrg
73561bedbe3fSmrg      freebsd* | dragonfly*)
73571bedbe3fSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
73581bedbe3fSmrg        # conventions
73591bedbe3fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
73601bedbe3fSmrg        ;;
7361ba6a1819Smrg
73621bedbe3fSmrg      gnu*)
73631bedbe3fSmrg        ;;
7364ba6a1819Smrg
73651bedbe3fSmrg      haiku*)
73661bedbe3fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
73671bedbe3fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
73681bedbe3fSmrg        ;;
7369ba6a1819Smrg
73701bedbe3fSmrg      hpux9*)
73711bedbe3fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
73721bedbe3fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
73731bedbe3fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73741bedbe3fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
73751bedbe3fSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
73761bedbe3fSmrg				             # but as the default
73771bedbe3fSmrg				             # location of the library.
7378ba6a1819Smrg
73791bedbe3fSmrg        case $cc_basename in
73801bedbe3fSmrg          CC*)
73811bedbe3fSmrg            # FIXME: insert proper C++ library support
73821bedbe3fSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
73831bedbe3fSmrg            ;;
73841bedbe3fSmrg          aCC*)
73851bedbe3fSmrg            _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'
73861bedbe3fSmrg            # Commands to make compiler produce verbose output that lists
73871bedbe3fSmrg            # what "hidden" libraries, object files and flags are used when
73881bedbe3fSmrg            # linking a shared library.
73891bedbe3fSmrg            #
73901bedbe3fSmrg            # There doesn't appear to be a way to prevent this compiler from
73911bedbe3fSmrg            # explicitly linking system object files so we need to strip them
73921bedbe3fSmrg            # from the output so that they don't get included in the library
73931bedbe3fSmrg            # dependencies.
73941bedbe3fSmrg            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"'
73951bedbe3fSmrg            ;;
73961bedbe3fSmrg          *)
73971bedbe3fSmrg            if test "$GXX" = yes; then
73981bedbe3fSmrg              _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'
73991bedbe3fSmrg            else
74001bedbe3fSmrg              # FIXME: insert proper C++ library support
74011bedbe3fSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
74021bedbe3fSmrg            fi
74031bedbe3fSmrg            ;;
74041bedbe3fSmrg        esac
74051bedbe3fSmrg        ;;
7406ba6a1819Smrg
74071bedbe3fSmrg      hpux10*|hpux11*)
74081bedbe3fSmrg        if test $with_gnu_ld = no; then
74091bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
74101bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
74111bedbe3fSmrg
74121bedbe3fSmrg          case $host_cpu in
74131bedbe3fSmrg            hppa*64*|ia64*)
74141bedbe3fSmrg              ;;
74151bedbe3fSmrg            *)
74161bedbe3fSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
74171bedbe3fSmrg              ;;
74181bedbe3fSmrg          esac
74191bedbe3fSmrg        fi
74201bedbe3fSmrg        case $host_cpu in
74211bedbe3fSmrg          hppa*64*|ia64*)
74221bedbe3fSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
74231bedbe3fSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
74241bedbe3fSmrg            ;;
74251bedbe3fSmrg          *)
74261bedbe3fSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
74271bedbe3fSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
74281bedbe3fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
74291bedbe3fSmrg					         # but as the default
74301bedbe3fSmrg					         # location of the library.
74311bedbe3fSmrg            ;;
74321bedbe3fSmrg        esac
74331bedbe3fSmrg
74341bedbe3fSmrg        case $cc_basename in
74351bedbe3fSmrg          CC*)
74361bedbe3fSmrg	    # FIXME: insert proper C++ library support
7437549e21daSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
74381bedbe3fSmrg	    ;;
74391bedbe3fSmrg          aCC*)
74401bedbe3fSmrg	    case $host_cpu in
74411bedbe3fSmrg	      hppa*64*)
74421bedbe3fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
74431bedbe3fSmrg	        ;;
74441bedbe3fSmrg	      ia64*)
74451bedbe3fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
74461bedbe3fSmrg	        ;;
74471bedbe3fSmrg	      *)
74481bedbe3fSmrg	        _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'
74491bedbe3fSmrg	        ;;
74501bedbe3fSmrg	    esac
74511bedbe3fSmrg	    # Commands to make compiler produce verbose output that lists
74521bedbe3fSmrg	    # what "hidden" libraries, object files and flags are used when
74531bedbe3fSmrg	    # linking a shared library.
74541bedbe3fSmrg	    #
74551bedbe3fSmrg	    # There doesn't appear to be a way to prevent this compiler from
74561bedbe3fSmrg	    # explicitly linking system object files so we need to strip them
74571bedbe3fSmrg	    # from the output so that they don't get included in the library
74581bedbe3fSmrg	    # dependencies.
74591bedbe3fSmrg	    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"'
74601bedbe3fSmrg	    ;;
74611bedbe3fSmrg          *)
74621bedbe3fSmrg	    if test "$GXX" = yes; then
74631bedbe3fSmrg	      if test $with_gnu_ld = no; then
74641bedbe3fSmrg	        case $host_cpu in
74651bedbe3fSmrg	          hppa*64*)
74661bedbe3fSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
74671bedbe3fSmrg	            ;;
74681bedbe3fSmrg	          ia64*)
74691bedbe3fSmrg	            _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'
74701bedbe3fSmrg	            ;;
74711bedbe3fSmrg	          *)
74721bedbe3fSmrg	            _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'
74731bedbe3fSmrg	            ;;
74741bedbe3fSmrg	        esac
74751bedbe3fSmrg	      fi
74761bedbe3fSmrg	    else
74771bedbe3fSmrg	      # FIXME: insert proper C++ library support
74781bedbe3fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
74791bedbe3fSmrg	    fi
74801bedbe3fSmrg	    ;;
74811bedbe3fSmrg        esac
74821bedbe3fSmrg        ;;
74831bedbe3fSmrg
74841bedbe3fSmrg      interix[[3-9]]*)
74851bedbe3fSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
74861bedbe3fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
74871bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
74881bedbe3fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
74891bedbe3fSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
74901bedbe3fSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
74911bedbe3fSmrg	# default) and relocated if they conflict, which is a slow very memory
74921bedbe3fSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
74931bedbe3fSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
74941bedbe3fSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
74951bedbe3fSmrg	_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'
74961bedbe3fSmrg	_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'
7497549e21daSmrg	;;
74981bedbe3fSmrg      irix5* | irix6*)
74991bedbe3fSmrg        case $cc_basename in
75001bedbe3fSmrg          CC*)
75011bedbe3fSmrg	    # SGI C++
75021bedbe3fSmrg	    _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'
7503ba6a1819Smrg
75041bedbe3fSmrg	    # Archives containing C++ object files must be created using
75051bedbe3fSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
75061bedbe3fSmrg	    # necessary to make sure instantiated templates are included
75071bedbe3fSmrg	    # in the archive.
75081bedbe3fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
75091bedbe3fSmrg	    ;;
75101bedbe3fSmrg          *)
75111bedbe3fSmrg	    if test "$GXX" = yes; then
75121bedbe3fSmrg	      if test "$with_gnu_ld" = no; then
75131bedbe3fSmrg	        _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'
75141bedbe3fSmrg	      else
75151bedbe3fSmrg	        _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'
75161bedbe3fSmrg	      fi
75171bedbe3fSmrg	    fi
75181bedbe3fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
75191bedbe3fSmrg	    ;;
75201bedbe3fSmrg        esac
75211bedbe3fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
75221bedbe3fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
75231bedbe3fSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
75241bedbe3fSmrg        ;;
7525ba6a1819Smrg
75261bedbe3fSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
75271bedbe3fSmrg        case $cc_basename in
75281bedbe3fSmrg          KCC*)
75291bedbe3fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7530ba6a1819Smrg
75311bedbe3fSmrg	    # KCC will only create a shared library if the output file
75321bedbe3fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
75331bedbe3fSmrg	    # to its proper name (with version) after linking.
75341bedbe3fSmrg	    _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'
75351bedbe3fSmrg	    _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'
75361bedbe3fSmrg	    # Commands to make compiler produce verbose output that lists
75371bedbe3fSmrg	    # what "hidden" libraries, object files and flags are used when
75381bedbe3fSmrg	    # linking a shared library.
75391bedbe3fSmrg	    #
75401bedbe3fSmrg	    # There doesn't appear to be a way to prevent this compiler from
75411bedbe3fSmrg	    # explicitly linking system object files so we need to strip them
75421bedbe3fSmrg	    # from the output so that they don't get included in the library
75431bedbe3fSmrg	    # dependencies.
75441bedbe3fSmrg	    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"'
7545ba6a1819Smrg
75461bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
75471bedbe3fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7548ba6a1819Smrg
75491bedbe3fSmrg	    # Archives containing C++ object files must be created using
75501bedbe3fSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
75511bedbe3fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
75521bedbe3fSmrg	    ;;
75531bedbe3fSmrg	  icpc* | ecpc* )
75541bedbe3fSmrg	    # Intel C++
75551bedbe3fSmrg	    with_gnu_ld=yes
75561bedbe3fSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
75571bedbe3fSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
75581bedbe3fSmrg	    # earlier do not add the objects themselves.
75591bedbe3fSmrg	    case `$CC -V 2>&1` in
75601bedbe3fSmrg	      *"Version 7."*)
75611bedbe3fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
75621bedbe3fSmrg		_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'
75631bedbe3fSmrg		;;
75641bedbe3fSmrg	      *)  # Version 8.0 or newer
75651bedbe3fSmrg	        tmp_idyn=
75661bedbe3fSmrg	        case $host_cpu in
75671bedbe3fSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
75681bedbe3fSmrg		esac
75691bedbe3fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
75701bedbe3fSmrg		_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'
75711bedbe3fSmrg		;;
75721bedbe3fSmrg	    esac
75731bedbe3fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
75741bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
75751bedbe3fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75761bedbe3fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
75771bedbe3fSmrg	    ;;
75781bedbe3fSmrg          pgCC* | pgcpp*)
75791bedbe3fSmrg            # Portland Group C++ compiler
75801bedbe3fSmrg	    case `$CC -V` in
75811bedbe3fSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
75821bedbe3fSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
75831bedbe3fSmrg		rm -rf $tpldir~
75841bedbe3fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
75851bedbe3fSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
75861bedbe3fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
75871bedbe3fSmrg		rm -rf $tpldir~
75881bedbe3fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
75891bedbe3fSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
75901bedbe3fSmrg		$RANLIB $oldlib'
75911bedbe3fSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
75921bedbe3fSmrg		rm -rf $tpldir~
75931bedbe3fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
75941bedbe3fSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
75951bedbe3fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
75961bedbe3fSmrg		rm -rf $tpldir~
75971bedbe3fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
75981bedbe3fSmrg		$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'
75991bedbe3fSmrg	      ;;
76001bedbe3fSmrg	    *) # Version 6 and above use weak symbols
76011bedbe3fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
76021bedbe3fSmrg	      _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'
76031bedbe3fSmrg	      ;;
76041bedbe3fSmrg	    esac
7605ba6a1819Smrg
76061bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
76071bedbe3fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
76081bedbe3fSmrg	    _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'
76091bedbe3fSmrg            ;;
76101bedbe3fSmrg	  cxx*)
76111bedbe3fSmrg	    # Compaq C++
76121bedbe3fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
76131bedbe3fSmrg	    _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'
7614ba6a1819Smrg
76151bedbe3fSmrg	    runpath_var=LD_RUN_PATH
76161bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
76171bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7618ba6a1819Smrg
76191bedbe3fSmrg	    # Commands to make compiler produce verbose output that lists
76201bedbe3fSmrg	    # what "hidden" libraries, object files and flags are used when
76211bedbe3fSmrg	    # linking a shared library.
76221bedbe3fSmrg	    #
76231bedbe3fSmrg	    # There doesn't appear to be a way to prevent this compiler from
76241bedbe3fSmrg	    # explicitly linking system object files so we need to strip them
76251bedbe3fSmrg	    # from the output so that they don't get included in the library
76261bedbe3fSmrg	    # dependencies.
76271bedbe3fSmrg	    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'
76281bedbe3fSmrg	    ;;
76291bedbe3fSmrg	  xl* | mpixl* | bgxl*)
76301bedbe3fSmrg	    # IBM XL 8.0 on PPC, with GNU ld
76311bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
76321bedbe3fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
76331bedbe3fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
76341bedbe3fSmrg	    if test "x$supports_anon_versioning" = xyes; then
76351bedbe3fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
76361bedbe3fSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
76371bedbe3fSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
76381bedbe3fSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
76391bedbe3fSmrg	    fi
76401bedbe3fSmrg	    ;;
76411bedbe3fSmrg	  *)
76421bedbe3fSmrg	    case `$CC -V 2>&1 | sed 5q` in
76431bedbe3fSmrg	    *Sun\ C*)
76441bedbe3fSmrg	      # Sun C++ 5.9
76451bedbe3fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
76461bedbe3fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
76471bedbe3fSmrg	      _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'
76481bedbe3fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
76491bedbe3fSmrg	      _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'
76501bedbe3fSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7651ba6a1819Smrg
76521bedbe3fSmrg	      # Not sure whether something based on
76531bedbe3fSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
76541bedbe3fSmrg	      # would be better.
76551bedbe3fSmrg	      output_verbose_link_cmd='func_echo_all'
76561bedbe3fSmrg
76571bedbe3fSmrg	      # Archives containing C++ object files must be created using
76581bedbe3fSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
76591bedbe3fSmrg	      # necessary to make sure instantiated templates are included
76601bedbe3fSmrg	      # in the archive.
76611bedbe3fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
76621bedbe3fSmrg	      ;;
76631bedbe3fSmrg	    esac
76641bedbe3fSmrg	    ;;
7665549e21daSmrg	esac
76661bedbe3fSmrg	;;
7667ba6a1819Smrg
76681bedbe3fSmrg      lynxos*)
76691bedbe3fSmrg        # FIXME: insert proper C++ library support
76701bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
76711bedbe3fSmrg	;;
7672ba6a1819Smrg
76731bedbe3fSmrg      m88k*)
76741bedbe3fSmrg        # FIXME: insert proper C++ library support
76751bedbe3fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
76761bedbe3fSmrg	;;
7677ba6a1819Smrg
76781bedbe3fSmrg      mvs*)
76791bedbe3fSmrg        case $cc_basename in
76801bedbe3fSmrg          cxx*)
76811bedbe3fSmrg	    # FIXME: insert proper C++ library support
76821bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
76831bedbe3fSmrg	    ;;
76841bedbe3fSmrg	  *)
76851bedbe3fSmrg	    # FIXME: insert proper C++ library support
76861bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
76871bedbe3fSmrg	    ;;
76881bedbe3fSmrg	esac
76891bedbe3fSmrg	;;
7690ba6a1819Smrg
76911bedbe3fSmrg      netbsd*)
76921bedbe3fSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
76931bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
76941bedbe3fSmrg	  wlarc=
76951bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
76961bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
76971bedbe3fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
76981bedbe3fSmrg	fi
76991bedbe3fSmrg	# Workaround some broken pre-1.5 toolchains
77001bedbe3fSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
77011bedbe3fSmrg	;;
7702ba6a1819Smrg
77031bedbe3fSmrg      *nto* | *qnx*)
77041bedbe3fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
77051bedbe3fSmrg	;;
7706ba6a1819Smrg
77071bedbe3fSmrg      openbsd2*)
77081bedbe3fSmrg        # C++ shared libraries are fairly broken
77091bedbe3fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
77101bedbe3fSmrg	;;
7711ba6a1819Smrg
77121bedbe3fSmrg      openbsd*)
77131bedbe3fSmrg	if test -f /usr/libexec/ld.so; then
77141bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
77151bedbe3fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
77161bedbe3fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
77171bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
77181bedbe3fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
77191bedbe3fSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
77201bedbe3fSmrg	    _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'
77211bedbe3fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
77221bedbe3fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
77231bedbe3fSmrg	  fi
77241bedbe3fSmrg	  output_verbose_link_cmd=func_echo_all
77251bedbe3fSmrg	else
77261bedbe3fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
77271bedbe3fSmrg	fi
77281bedbe3fSmrg	;;
7729ba6a1819Smrg
77301bedbe3fSmrg      osf3* | osf4* | osf5*)
77311bedbe3fSmrg        case $cc_basename in
77321bedbe3fSmrg          KCC*)
77331bedbe3fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7734ba6a1819Smrg
77351bedbe3fSmrg	    # KCC will only create a shared library if the output file
77361bedbe3fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
77371bedbe3fSmrg	    # to its proper name (with version) after linking.
77381bedbe3fSmrg	    _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'
7739ba6a1819Smrg
77401bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
77411bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7742ba6a1819Smrg
77431bedbe3fSmrg	    # Archives containing C++ object files must be created using
77441bedbe3fSmrg	    # the KAI C++ compiler.
77451bedbe3fSmrg	    case $host in
77461bedbe3fSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
77471bedbe3fSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
77481bedbe3fSmrg	    esac
77491bedbe3fSmrg	    ;;
77501bedbe3fSmrg          RCC*)
77511bedbe3fSmrg	    # Rational C++ 2.4.1
77521bedbe3fSmrg	    # FIXME: insert proper C++ library support
77531bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77541bedbe3fSmrg	    ;;
77551bedbe3fSmrg          cxx*)
77561bedbe3fSmrg	    case $host in
77571bedbe3fSmrg	      osf3*)
77581bedbe3fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
77591bedbe3fSmrg	        _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'
77601bedbe3fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
77611bedbe3fSmrg		;;
77621bedbe3fSmrg	      *)
77631bedbe3fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
77641bedbe3fSmrg	        _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'
77651bedbe3fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
77661bedbe3fSmrg	          echo "-hidden">> $lib.exp~
77671bedbe3fSmrg	          $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~
77681bedbe3fSmrg	          $RM $lib.exp'
77691bedbe3fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
77701bedbe3fSmrg		;;
77711bedbe3fSmrg	    esac
7772ba6a1819Smrg
77731bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7774ba6a1819Smrg
77751bedbe3fSmrg	    # Commands to make compiler produce verbose output that lists
77761bedbe3fSmrg	    # what "hidden" libraries, object files and flags are used when
77771bedbe3fSmrg	    # linking a shared library.
77781bedbe3fSmrg	    #
77791bedbe3fSmrg	    # There doesn't appear to be a way to prevent this compiler from
77801bedbe3fSmrg	    # explicitly linking system object files so we need to strip them
77811bedbe3fSmrg	    # from the output so that they don't get included in the library
77821bedbe3fSmrg	    # dependencies.
77831bedbe3fSmrg	    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"'
77841bedbe3fSmrg	    ;;
77851bedbe3fSmrg	  *)
77861bedbe3fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
77871bedbe3fSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
77881bedbe3fSmrg	      case $host in
77891bedbe3fSmrg	        osf3*)
77901bedbe3fSmrg	          _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'
77911bedbe3fSmrg		  ;;
77921bedbe3fSmrg	        *)
77931bedbe3fSmrg	          _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'
77941bedbe3fSmrg		  ;;
77951bedbe3fSmrg	      esac
7796ba6a1819Smrg
77971bedbe3fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
77981bedbe3fSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7799ba6a1819Smrg
78001bedbe3fSmrg	      # Commands to make compiler produce verbose output that lists
78011bedbe3fSmrg	      # what "hidden" libraries, object files and flags are used when
78021bedbe3fSmrg	      # linking a shared library.
78031bedbe3fSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7804ba6a1819Smrg
78051bedbe3fSmrg	    else
78061bedbe3fSmrg	      # FIXME: insert proper C++ library support
78071bedbe3fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
78081bedbe3fSmrg	    fi
78091bedbe3fSmrg	    ;;
78101bedbe3fSmrg        esac
78111bedbe3fSmrg        ;;
7812ba6a1819Smrg
78131bedbe3fSmrg      psos*)
78141bedbe3fSmrg        # FIXME: insert proper C++ library support
78151bedbe3fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
78161bedbe3fSmrg        ;;
7817ba6a1819Smrg
78181bedbe3fSmrg      sunos4*)
78191bedbe3fSmrg        case $cc_basename in
78201bedbe3fSmrg          CC*)
78211bedbe3fSmrg	    # Sun C++ 4.x
78221bedbe3fSmrg	    # FIXME: insert proper C++ library support
78231bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78241bedbe3fSmrg	    ;;
78251bedbe3fSmrg          lcc*)
78261bedbe3fSmrg	    # Lucid
78271bedbe3fSmrg	    # FIXME: insert proper C++ library support
78281bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78291bedbe3fSmrg	    ;;
78301bedbe3fSmrg          *)
78311bedbe3fSmrg	    # FIXME: insert proper C++ library support
78321bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78331bedbe3fSmrg	    ;;
78341bedbe3fSmrg        esac
78351bedbe3fSmrg        ;;
7836ba6a1819Smrg
78371bedbe3fSmrg      solaris*)
78381bedbe3fSmrg        case $cc_basename in
78391bedbe3fSmrg          CC* | sunCC*)
78401bedbe3fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
78411bedbe3fSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
78421bedbe3fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
78431bedbe3fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
78441bedbe3fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
78451bedbe3fSmrg	      $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'
7846ba6a1819Smrg
78471bedbe3fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
78481bedbe3fSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
78491bedbe3fSmrg	    case $host_os in
78501bedbe3fSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
78511bedbe3fSmrg	      *)
78521bedbe3fSmrg		# The compiler driver will combine and reorder linker options,
78531bedbe3fSmrg		# but understands `-z linker_flag'.
78541bedbe3fSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
78551bedbe3fSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
78561bedbe3fSmrg	        ;;
78571bedbe3fSmrg	    esac
78581bedbe3fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7859ba6a1819Smrg
78601bedbe3fSmrg	    output_verbose_link_cmd='func_echo_all'
7861ba6a1819Smrg
78621bedbe3fSmrg	    # Archives containing C++ object files must be created using
78631bedbe3fSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
78641bedbe3fSmrg	    # necessary to make sure instantiated templates are included
78651bedbe3fSmrg	    # in the archive.
78661bedbe3fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
78671bedbe3fSmrg	    ;;
78681bedbe3fSmrg          gcx*)
78691bedbe3fSmrg	    # Green Hills C++ Compiler
78701bedbe3fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7871ba6a1819Smrg
78721bedbe3fSmrg	    # The C++ compiler must be used to create the archive.
78731bedbe3fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
78741bedbe3fSmrg	    ;;
78751bedbe3fSmrg          *)
78761bedbe3fSmrg	    # GNU C++ compiler with Solaris linker
78771bedbe3fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
78781bedbe3fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
78791bedbe3fSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
78801bedbe3fSmrg	        _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'
78811bedbe3fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
78821bedbe3fSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7883ba6a1819Smrg
78841bedbe3fSmrg	        # Commands to make compiler produce verbose output that lists
78851bedbe3fSmrg	        # what "hidden" libraries, object files and flags are used when
78861bedbe3fSmrg	        # linking a shared library.
78871bedbe3fSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
78881bedbe3fSmrg	      else
78891bedbe3fSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
78901bedbe3fSmrg	        # platform.
78911bedbe3fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
78921bedbe3fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
78931bedbe3fSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7894ba6a1819Smrg
78951bedbe3fSmrg	        # Commands to make compiler produce verbose output that lists
78961bedbe3fSmrg	        # what "hidden" libraries, object files and flags are used when
78971bedbe3fSmrg	        # linking a shared library.
78981bedbe3fSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
78991bedbe3fSmrg	      fi
79001bedbe3fSmrg
79011bedbe3fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
79021bedbe3fSmrg	      case $host_os in
79031bedbe3fSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
79041bedbe3fSmrg		*)
79051bedbe3fSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
79061bedbe3fSmrg		  ;;
79071bedbe3fSmrg	      esac
79081bedbe3fSmrg	    fi
79091bedbe3fSmrg	    ;;
79101bedbe3fSmrg        esac
79111bedbe3fSmrg        ;;
79121bedbe3fSmrg
79131bedbe3fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
79141bedbe3fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
79151bedbe3fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
79161bedbe3fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
79171bedbe3fSmrg      runpath_var='LD_RUN_PATH'
7918ba6a1819Smrg
79191bedbe3fSmrg      case $cc_basename in
79201bedbe3fSmrg        CC*)
79211bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79221bedbe3fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7923549e21daSmrg	  ;;
7924549e21daSmrg	*)
79251bedbe3fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79261bedbe3fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7927549e21daSmrg	  ;;
7928549e21daSmrg      esac
7929549e21daSmrg      ;;
7930ba6a1819Smrg
79311bedbe3fSmrg      sysv5* | sco3.2v5* | sco5v6*)
79321bedbe3fSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
79331bedbe3fSmrg	# link with -lc, and that would cause any symbols used from libc to
79341bedbe3fSmrg	# always be unresolved, which means just about no library would
79351bedbe3fSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
79361bedbe3fSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
79371bedbe3fSmrg	# as -z defs.
79381bedbe3fSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
79391bedbe3fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
79401bedbe3fSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
79411bedbe3fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
79421bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
79431bedbe3fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
79441bedbe3fSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
79451bedbe3fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
79461bedbe3fSmrg	runpath_var='LD_RUN_PATH'
79471bedbe3fSmrg
79481bedbe3fSmrg	case $cc_basename in
79491bedbe3fSmrg          CC*)
79501bedbe3fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79511bedbe3fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79521bedbe3fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
79531bedbe3fSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
79541bedbe3fSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
79551bedbe3fSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
79561bedbe3fSmrg	    ;;
79571bedbe3fSmrg	  *)
79581bedbe3fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79591bedbe3fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
79601bedbe3fSmrg	    ;;
79611bedbe3fSmrg	esac
7962549e21daSmrg      ;;
7963ba6a1819Smrg
79641bedbe3fSmrg      tandem*)
79651bedbe3fSmrg        case $cc_basename in
79661bedbe3fSmrg          NCC*)
79671bedbe3fSmrg	    # NonStop-UX NCC 3.20
79681bedbe3fSmrg	    # FIXME: insert proper C++ library support
79691bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
79701bedbe3fSmrg	    ;;
79711bedbe3fSmrg          *)
79721bedbe3fSmrg	    # FIXME: insert proper C++ library support
79731bedbe3fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
79741bedbe3fSmrg	    ;;
79751bedbe3fSmrg        esac
7976549e21daSmrg        ;;
7977ba6a1819Smrg
79781bedbe3fSmrg      vxworks*)
79791bedbe3fSmrg        # FIXME: insert proper C++ library support
79801bedbe3fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
79811bedbe3fSmrg        ;;
7982ba6a1819Smrg
79831bedbe3fSmrg      *)
79841bedbe3fSmrg        # FIXME: insert proper C++ library support
79851bedbe3fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
79861bedbe3fSmrg        ;;
79871bedbe3fSmrg    esac
7988ba6a1819Smrg
79891bedbe3fSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
79901bedbe3fSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7991ba6a1819Smrg
79921bedbe3fSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
79931bedbe3fSmrg    _LT_TAGVAR(LD, $1)="$LD"
79941bedbe3fSmrg
79951bedbe3fSmrg    ## CAVEAT EMPTOR:
79961bedbe3fSmrg    ## There is no encapsulation within the following macros, do not change
79971bedbe3fSmrg    ## the running order or otherwise move them around unless you know exactly
79981bedbe3fSmrg    ## what you are doing...
79991bedbe3fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
80001bedbe3fSmrg    _LT_COMPILER_PIC($1)
80011bedbe3fSmrg    _LT_COMPILER_C_O($1)
80021bedbe3fSmrg    _LT_COMPILER_FILE_LOCKS($1)
80031bedbe3fSmrg    _LT_LINKER_SHLIBS($1)
80041bedbe3fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
80051bedbe3fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
80061bedbe3fSmrg
80071bedbe3fSmrg    _LT_CONFIG($1)
80081bedbe3fSmrg  fi # test -n "$compiler"
80091bedbe3fSmrg
80101bedbe3fSmrg  CC=$lt_save_CC
80111bedbe3fSmrg  CFLAGS=$lt_save_CFLAGS
80121bedbe3fSmrg  LDCXX=$LD
80131bedbe3fSmrg  LD=$lt_save_LD
80141bedbe3fSmrg  GCC=$lt_save_GCC
80151bedbe3fSmrg  with_gnu_ld=$lt_save_with_gnu_ld
80161bedbe3fSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
80171bedbe3fSmrg  lt_cv_path_LD=$lt_save_path_LD
80181bedbe3fSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
80191bedbe3fSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
80201bedbe3fSmrgfi # test "$_lt_caught_CXX_error" != yes
80211bedbe3fSmrg
80221bedbe3fSmrgAC_LANG_POP
80231bedbe3fSmrg])# _LT_LANG_CXX_CONFIG
80241bedbe3fSmrg
80251bedbe3fSmrg
80261bedbe3fSmrg# _LT_FUNC_STRIPNAME_CNF
80271bedbe3fSmrg# ----------------------
80281bedbe3fSmrg# func_stripname_cnf prefix suffix name
80291bedbe3fSmrg# strip PREFIX and SUFFIX off of NAME.
80301bedbe3fSmrg# PREFIX and SUFFIX must not contain globbing or regex special
80311bedbe3fSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
80321bedbe3fSmrg# dot (in which case that matches only a dot).
80331bedbe3fSmrg#
80341bedbe3fSmrg# This function is identical to the (non-XSI) version of func_stripname,
80351bedbe3fSmrg# except this one can be used by m4 code that may be executed by configure,
80361bedbe3fSmrg# rather than the libtool script.
80371bedbe3fSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
80381bedbe3fSmrgAC_REQUIRE([_LT_DECL_SED])
80391bedbe3fSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
80401bedbe3fSmrgfunc_stripname_cnf ()
80411bedbe3fSmrg{
80421bedbe3fSmrg  case ${2} in
80431bedbe3fSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
80441bedbe3fSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
80451bedbe3fSmrg  esac
80461bedbe3fSmrg} # func_stripname_cnf
80471bedbe3fSmrg])# _LT_FUNC_STRIPNAME_CNF
80481bedbe3fSmrg
80491bedbe3fSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
80501bedbe3fSmrg# ---------------------------------
80511bedbe3fSmrg# Figure out "hidden" library dependencies from verbose
80521bedbe3fSmrg# compiler output when linking a shared library.
80531bedbe3fSmrg# Parse the compiler output and extract the necessary
80541bedbe3fSmrg# objects, libraries and library flags.
80551bedbe3fSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
80561bedbe3fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
80571bedbe3fSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
80581bedbe3fSmrg# Dependencies to place before and after the object being linked:
80591bedbe3fSmrg_LT_TAGVAR(predep_objects, $1)=
80601bedbe3fSmrg_LT_TAGVAR(postdep_objects, $1)=
80611bedbe3fSmrg_LT_TAGVAR(predeps, $1)=
80621bedbe3fSmrg_LT_TAGVAR(postdeps, $1)=
80631bedbe3fSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
80641bedbe3fSmrg
80651bedbe3fSmrgdnl we can't use the lt_simple_compile_test_code here,
80661bedbe3fSmrgdnl because it contains code intended for an executable,
80671bedbe3fSmrgdnl not a library.  It's possible we should let each
80681bedbe3fSmrgdnl tag define a new lt_????_link_test_code variable,
80691bedbe3fSmrgdnl but it's only used here...
80701bedbe3fSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
80711bedbe3fSmrgint a;
80721bedbe3fSmrgvoid foo (void) { a = 0; }
80731bedbe3fSmrg_LT_EOF
80741bedbe3fSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
80751bedbe3fSmrgclass Foo
80761bedbe3fSmrg{
80771bedbe3fSmrgpublic:
80781bedbe3fSmrg  Foo (void) { a = 0; }
80791bedbe3fSmrgprivate:
80801bedbe3fSmrg  int a;
80811bedbe3fSmrg};
80821bedbe3fSmrg_LT_EOF
80831bedbe3fSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
80841bedbe3fSmrg      subroutine foo
80851bedbe3fSmrg      implicit none
80861bedbe3fSmrg      integer*4 a
80871bedbe3fSmrg      a=0
80881bedbe3fSmrg      return
80891bedbe3fSmrg      end
80901bedbe3fSmrg_LT_EOF
80911bedbe3fSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
80921bedbe3fSmrg      subroutine foo
80931bedbe3fSmrg      implicit none
80941bedbe3fSmrg      integer a
80951bedbe3fSmrg      a=0
80961bedbe3fSmrg      return
80971bedbe3fSmrg      end
80981bedbe3fSmrg_LT_EOF
80991bedbe3fSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
81001bedbe3fSmrgpublic class foo {
81011bedbe3fSmrg  private int a;
81021bedbe3fSmrg  public void bar (void) {
81031bedbe3fSmrg    a = 0;
81041bedbe3fSmrg  }
81051bedbe3fSmrg};
81061bedbe3fSmrg_LT_EOF
81071bedbe3fSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
81081bedbe3fSmrgpackage foo
81091bedbe3fSmrgfunc foo() {
81101bedbe3fSmrg}
81111bedbe3fSmrg_LT_EOF
81121bedbe3fSmrg])
8113ba6a1819Smrg
81141bedbe3fSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
81151bedbe3fSmrgcase "$CC $CFLAGS " in #(
81161bedbe3fSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
81171bedbe3fSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
81181bedbe3fSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
81191bedbe3fSmrgesac
8120ba6a1819Smrg
81211bedbe3fSmrgdnl Parse the compiler output and extract the necessary
81221bedbe3fSmrgdnl objects, libraries and library flags.
81231bedbe3fSmrgif AC_TRY_EVAL(ac_compile); then
81241bedbe3fSmrg  # Parse the compiler output and extract the necessary
81251bedbe3fSmrg  # objects, libraries and library flags.
8126ba6a1819Smrg
81271bedbe3fSmrg  # Sentinel used to keep track of whether or not we are before
81281bedbe3fSmrg  # the conftest object file.
81291bedbe3fSmrg  pre_test_object_deps_done=no
8130ba6a1819Smrg
81311bedbe3fSmrg  for p in `eval "$output_verbose_link_cmd"`; do
81321bedbe3fSmrg    case ${prev}${p} in
8133ba6a1819Smrg
81341bedbe3fSmrg    -L* | -R* | -l*)
81351bedbe3fSmrg       # Some compilers place space between "-{L,R}" and the path.
81361bedbe3fSmrg       # Remove the space.
81371bedbe3fSmrg       if test $p = "-L" ||
81381bedbe3fSmrg          test $p = "-R"; then
81391bedbe3fSmrg	 prev=$p
81401bedbe3fSmrg	 continue
81411bedbe3fSmrg       fi
8142ba6a1819Smrg
81431bedbe3fSmrg       # Expand the sysroot to ease extracting the directories later.
81441bedbe3fSmrg       if test -z "$prev"; then
81451bedbe3fSmrg         case $p in
81461bedbe3fSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
81471bedbe3fSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
81481bedbe3fSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
81491bedbe3fSmrg         esac
81501bedbe3fSmrg       fi
81511bedbe3fSmrg       case $p in
81521bedbe3fSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
81531bedbe3fSmrg       esac
81541bedbe3fSmrg       if test "$pre_test_object_deps_done" = no; then
81551bedbe3fSmrg	 case ${prev} in
81561bedbe3fSmrg	 -L | -R)
81571bedbe3fSmrg	   # Internal compiler library paths should come after those
81581bedbe3fSmrg	   # provided the user.  The postdeps already come after the
81591bedbe3fSmrg	   # user supplied libs so there is no need to process them.
81601bedbe3fSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
81611bedbe3fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
81621bedbe3fSmrg	   else
81631bedbe3fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
81641bedbe3fSmrg	   fi
81651bedbe3fSmrg	   ;;
81661bedbe3fSmrg	 # The "-l" case would never come before the object being
81671bedbe3fSmrg	 # linked, so don't bother handling this case.
81681bedbe3fSmrg	 esac
81691bedbe3fSmrg       else
81701bedbe3fSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
81711bedbe3fSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
81721bedbe3fSmrg	 else
81731bedbe3fSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
81741bedbe3fSmrg	 fi
81751bedbe3fSmrg       fi
81761bedbe3fSmrg       prev=
81771bedbe3fSmrg       ;;
8178ba6a1819Smrg
81791bedbe3fSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
81801bedbe3fSmrg    *.$objext)
81811bedbe3fSmrg       # This assumes that the test object file only shows up
81821bedbe3fSmrg       # once in the compiler output.
81831bedbe3fSmrg       if test "$p" = "conftest.$objext"; then
81841bedbe3fSmrg	 pre_test_object_deps_done=yes
81851bedbe3fSmrg	 continue
81861bedbe3fSmrg       fi
8187ba6a1819Smrg
81881bedbe3fSmrg       if test "$pre_test_object_deps_done" = no; then
81891bedbe3fSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
81901bedbe3fSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
81911bedbe3fSmrg	 else
81921bedbe3fSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
81931bedbe3fSmrg	 fi
81941bedbe3fSmrg       else
81951bedbe3fSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
81961bedbe3fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
81971bedbe3fSmrg	 else
81981bedbe3fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
81991bedbe3fSmrg	 fi
82001bedbe3fSmrg       fi
82011bedbe3fSmrg       ;;
8202ba6a1819Smrg
82031bedbe3fSmrg    *) ;; # Ignore the rest.
8204549e21daSmrg
8205549e21daSmrg    esac
82061bedbe3fSmrg  done
82071bedbe3fSmrg
82081bedbe3fSmrg  # Clean up.
82091bedbe3fSmrg  rm -f a.out a.exe
82101bedbe3fSmrgelse
82111bedbe3fSmrg  echo "libtool.m4: error: problem compiling $1 test program"
82121bedbe3fSmrgfi
82131bedbe3fSmrg
82141bedbe3fSmrg$RM -f confest.$objext
82151bedbe3fSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
82161bedbe3fSmrg
82171bedbe3fSmrg# PORTME: override above test on systems where it is broken
82181bedbe3fSmrgm4_if([$1], [CXX],
82191bedbe3fSmrg[case $host_os in
82201bedbe3fSmrginterix[[3-9]]*)
82211bedbe3fSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
82221bedbe3fSmrg  # hack all around it, let's just trust "g++" to DTRT.
82231bedbe3fSmrg  _LT_TAGVAR(predep_objects,$1)=
82241bedbe3fSmrg  _LT_TAGVAR(postdep_objects,$1)=
82251bedbe3fSmrg  _LT_TAGVAR(postdeps,$1)=
8226549e21daSmrg  ;;
8227ba6a1819Smrg
82281bedbe3fSmrglinux*)
82291bedbe3fSmrg  case `$CC -V 2>&1 | sed 5q` in
82301bedbe3fSmrg  *Sun\ C*)
82311bedbe3fSmrg    # Sun C++ 5.9
8232549e21daSmrg
82331bedbe3fSmrg    # The more standards-conforming stlport4 library is
82341bedbe3fSmrg    # incompatible with the Cstd library. Avoid specifying
82351bedbe3fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
82361bedbe3fSmrg    # -library=stlport4 depends on it.
82371bedbe3fSmrg    case " $CXX $CXXFLAGS " in
82381bedbe3fSmrg    *" -library=stlport4 "*)
82391bedbe3fSmrg      solaris_use_stlport4=yes
82401bedbe3fSmrg      ;;
82411bedbe3fSmrg    esac
8242549e21daSmrg
82431bedbe3fSmrg    if test "$solaris_use_stlport4" != yes; then
82441bedbe3fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
82451bedbe3fSmrg    fi
82461bedbe3fSmrg    ;;
82471bedbe3fSmrg  esac
82481bedbe3fSmrg  ;;
8249ba6a1819Smrg
82501bedbe3fSmrgsolaris*)
82511bedbe3fSmrg  case $cc_basename in
82521bedbe3fSmrg  CC* | sunCC*)
82531bedbe3fSmrg    # The more standards-conforming stlport4 library is
82541bedbe3fSmrg    # incompatible with the Cstd library. Avoid specifying
82551bedbe3fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
82561bedbe3fSmrg    # -library=stlport4 depends on it.
82571bedbe3fSmrg    case " $CXX $CXXFLAGS " in
82581bedbe3fSmrg    *" -library=stlport4 "*)
82591bedbe3fSmrg      solaris_use_stlport4=yes
82601bedbe3fSmrg      ;;
82611bedbe3fSmrg    esac
8262ba6a1819Smrg
82631bedbe3fSmrg    # Adding this requires a known-good setup of shared libraries for
82641bedbe3fSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
82651bedbe3fSmrg    # archive will be linked into the output, leading to subtle bugs.
82661bedbe3fSmrg    if test "$solaris_use_stlport4" != yes; then
82671bedbe3fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
82681bedbe3fSmrg    fi
82691bedbe3fSmrg    ;;
82701bedbe3fSmrg  esac
82711bedbe3fSmrg  ;;
82721bedbe3fSmrgesac
82731bedbe3fSmrg])
82741bedbe3fSmrg
82751bedbe3fSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
82761bedbe3fSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
82771bedbe3fSmrgesac
82781bedbe3fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
82791bedbe3fSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
82801bedbe3fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
82811bedbe3fSmrgfi
82821bedbe3fSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
82831bedbe3fSmrg    [The directories searched by this compiler when creating a shared library])
82841bedbe3fSmrg_LT_TAGDECL([], [predep_objects], [1],
82851bedbe3fSmrg    [Dependencies to place before and after the objects being linked to
82861bedbe3fSmrg    create a shared library])
82871bedbe3fSmrg_LT_TAGDECL([], [postdep_objects], [1])
82881bedbe3fSmrg_LT_TAGDECL([], [predeps], [1])
82891bedbe3fSmrg_LT_TAGDECL([], [postdeps], [1])
82901bedbe3fSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
82911bedbe3fSmrg    [The library search path used internally by the compiler when linking
82921bedbe3fSmrg    a shared library])
82931bedbe3fSmrg])# _LT_SYS_HIDDEN_LIBDEPS
82941bedbe3fSmrg
82951bedbe3fSmrg
82961bedbe3fSmrg# _LT_LANG_F77_CONFIG([TAG])
82971bedbe3fSmrg# --------------------------
82981bedbe3fSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
82991bedbe3fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
83001bedbe3fSmrg# to write the compiler configuration to `libtool'.
83011bedbe3fSmrgm4_defun([_LT_LANG_F77_CONFIG],
83021bedbe3fSmrg[AC_LANG_PUSH(Fortran 77)
83031bedbe3fSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
83041bedbe3fSmrg  _lt_disable_F77=yes
83051bedbe3fSmrgfi
83061bedbe3fSmrg
83071bedbe3fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
83081bedbe3fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
83091bedbe3fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
83101bedbe3fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
83111bedbe3fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
83121bedbe3fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
83131bedbe3fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
83141bedbe3fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
83151bedbe3fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
83161bedbe3fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
83171bedbe3fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
83181bedbe3fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
83191bedbe3fSmrg_LT_TAGVAR(module_cmds, $1)=
83201bedbe3fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
83211bedbe3fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
83221bedbe3fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
83231bedbe3fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
83241bedbe3fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
83251bedbe3fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
83261bedbe3fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
83271bedbe3fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
83281bedbe3fSmrg
83291bedbe3fSmrg# Source file extension for f77 test sources.
83301bedbe3fSmrgac_ext=f
83311bedbe3fSmrg
83321bedbe3fSmrg# Object file extension for compiled f77 test sources.
8333549e21daSmrgobjext=o
8334549e21daSmrg_LT_TAGVAR(objext, $1)=$objext
8335ba6a1819Smrg
83361bedbe3fSmrg# No sense in running all these tests if we already determined that
83371bedbe3fSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
83381bedbe3fSmrg# are currently assumed to apply to all compilers on this platform,
83391bedbe3fSmrg# and will be corrupted by setting them based on a non-working compiler.
83401bedbe3fSmrgif test "$_lt_disable_F77" != yes; then
83411bedbe3fSmrg  # Code to be used in simple compile tests
83421bedbe3fSmrg  lt_simple_compile_test_code="\
83431bedbe3fSmrg      subroutine t
83441bedbe3fSmrg      return
83451bedbe3fSmrg      end
83461bedbe3fSmrg"
8347ba6a1819Smrg
83481bedbe3fSmrg  # Code to be used in simple link tests
83491bedbe3fSmrg  lt_simple_link_test_code="\
83501bedbe3fSmrg      program t
83511bedbe3fSmrg      end
83521bedbe3fSmrg"
8353ba6a1819Smrg
83541bedbe3fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
83551bedbe3fSmrg  _LT_TAG_COMPILER
8356ba6a1819Smrg
83571bedbe3fSmrg  # save warnings/boilerplate of simple test code
83581bedbe3fSmrg  _LT_COMPILER_BOILERPLATE
83591bedbe3fSmrg  _LT_LINKER_BOILERPLATE
8360ba6a1819Smrg
83611bedbe3fSmrg  # Allow CC to be a program name with arguments.
83621bedbe3fSmrg  lt_save_CC="$CC"
83631bedbe3fSmrg  lt_save_GCC=$GCC
83641bedbe3fSmrg  lt_save_CFLAGS=$CFLAGS
83651bedbe3fSmrg  CC=${F77-"f77"}
83661bedbe3fSmrg  CFLAGS=$FFLAGS
83671bedbe3fSmrg  compiler=$CC
83681bedbe3fSmrg  _LT_TAGVAR(compiler, $1)=$CC
83691bedbe3fSmrg  _LT_CC_BASENAME([$compiler])
83701bedbe3fSmrg  GCC=$G77
83711bedbe3fSmrg  if test -n "$compiler"; then
83721bedbe3fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
83731bedbe3fSmrg    AC_MSG_RESULT([$can_build_shared])
8374549e21daSmrg
83751bedbe3fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
83761bedbe3fSmrg    test "$can_build_shared" = "no" && enable_shared=no
8377549e21daSmrg
83781bedbe3fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
83791bedbe3fSmrg    # are all built from PIC.
83801bedbe3fSmrg    case $host_os in
83811bedbe3fSmrg      aix3*)
83821bedbe3fSmrg        test "$enable_shared" = yes && enable_static=no
83831bedbe3fSmrg        if test -n "$RANLIB"; then
83841bedbe3fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
83851bedbe3fSmrg          postinstall_cmds='$RANLIB $lib'
83861bedbe3fSmrg        fi
83871bedbe3fSmrg        ;;
83881bedbe3fSmrg      aix[[4-9]]*)
83891bedbe3fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
83901bedbe3fSmrg	  test "$enable_shared" = yes && enable_static=no
83911bedbe3fSmrg	fi
83921bedbe3fSmrg        ;;
83931bedbe3fSmrg    esac
83941bedbe3fSmrg    AC_MSG_RESULT([$enable_shared])
8395549e21daSmrg
83961bedbe3fSmrg    AC_MSG_CHECKING([whether to build static libraries])
83971bedbe3fSmrg    # Make sure either enable_shared or enable_static is yes.
83981bedbe3fSmrg    test "$enable_shared" = yes || enable_static=yes
83991bedbe3fSmrg    AC_MSG_RESULT([$enable_static])
8400ba6a1819Smrg
84011bedbe3fSmrg    _LT_TAGVAR(GCC, $1)="$G77"
84021bedbe3fSmrg    _LT_TAGVAR(LD, $1)="$LD"
8403ba6a1819Smrg
84041bedbe3fSmrg    ## CAVEAT EMPTOR:
84051bedbe3fSmrg    ## There is no encapsulation within the following macros, do not change
84061bedbe3fSmrg    ## the running order or otherwise move them around unless you know exactly
84071bedbe3fSmrg    ## what you are doing...
84081bedbe3fSmrg    _LT_COMPILER_PIC($1)
84091bedbe3fSmrg    _LT_COMPILER_C_O($1)
84101bedbe3fSmrg    _LT_COMPILER_FILE_LOCKS($1)
84111bedbe3fSmrg    _LT_LINKER_SHLIBS($1)
84121bedbe3fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
84131bedbe3fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
84141bedbe3fSmrg
84151bedbe3fSmrg    _LT_CONFIG($1)
84161bedbe3fSmrg  fi # test -n "$compiler"
84171bedbe3fSmrg
84181bedbe3fSmrg  GCC=$lt_save_GCC
84191bedbe3fSmrg  CC="$lt_save_CC"
84201bedbe3fSmrg  CFLAGS="$lt_save_CFLAGS"
84211bedbe3fSmrgfi # test "$_lt_disable_F77" != yes
8422ba6a1819Smrg
8423549e21daSmrgAC_LANG_POP
84241bedbe3fSmrg])# _LT_LANG_F77_CONFIG
8425ba6a1819Smrg
8426ba6a1819Smrg
84271bedbe3fSmrg# _LT_LANG_FC_CONFIG([TAG])
84281bedbe3fSmrg# -------------------------
84291bedbe3fSmrg# Ensure that the configuration variables for a Fortran compiler are
84301bedbe3fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
84311bedbe3fSmrg# to write the compiler configuration to `libtool'.
84321bedbe3fSmrgm4_defun([_LT_LANG_FC_CONFIG],
84331bedbe3fSmrg[AC_LANG_PUSH(Fortran)
84341bedbe3fSmrg
84351bedbe3fSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
84361bedbe3fSmrg  _lt_disable_FC=yes
8437549e21daSmrgfi
8438ba6a1819Smrg
8439549e21daSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8440549e21daSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
8441549e21daSmrg_LT_TAGVAR(always_export_symbols, $1)=no
8442549e21daSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8443549e21daSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8444549e21daSmrg_LT_TAGVAR(hardcode_direct, $1)=no
8445549e21daSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8446549e21daSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8447549e21daSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8448549e21daSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8449549e21daSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
8450549e21daSmrg_LT_TAGVAR(inherit_rpath, $1)=no
8451549e21daSmrg_LT_TAGVAR(module_cmds, $1)=
8452549e21daSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
8453549e21daSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8454549e21daSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8455549e21daSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8456549e21daSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8457549e21daSmrg_LT_TAGVAR(no_undefined_flag, $1)=
8458549e21daSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8459549e21daSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8460ba6a1819Smrg
84611bedbe3fSmrg# Source file extension for fc test sources.
84621bedbe3fSmrgac_ext=${ac_fc_srcext-f}
8463ba6a1819Smrg
84641bedbe3fSmrg# Object file extension for compiled fc test sources.
8465549e21daSmrgobjext=o
8466549e21daSmrg_LT_TAGVAR(objext, $1)=$objext
8467549e21daSmrg
8468549e21daSmrg# No sense in running all these tests if we already determined that
84691bedbe3fSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
8470549e21daSmrg# are currently assumed to apply to all compilers on this platform,
8471549e21daSmrg# and will be corrupted by setting them based on a non-working compiler.
84721bedbe3fSmrgif test "$_lt_disable_FC" != yes; then
8473549e21daSmrg  # Code to be used in simple compile tests
84741bedbe3fSmrg  lt_simple_compile_test_code="\
84751bedbe3fSmrg      subroutine t
84761bedbe3fSmrg      return
84771bedbe3fSmrg      end
84781bedbe3fSmrg"
8479549e21daSmrg
8480549e21daSmrg  # Code to be used in simple link tests
84811bedbe3fSmrg  lt_simple_link_test_code="\
84821bedbe3fSmrg      program t
84831bedbe3fSmrg      end
84841bedbe3fSmrg"
8485549e21daSmrg
8486549e21daSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8487549e21daSmrg  _LT_TAG_COMPILER
8488549e21daSmrg
8489549e21daSmrg  # save warnings/boilerplate of simple test code
8490549e21daSmrg  _LT_COMPILER_BOILERPLATE
8491549e21daSmrg  _LT_LINKER_BOILERPLATE
8492549e21daSmrg
8493549e21daSmrg  # Allow CC to be a program name with arguments.
84941bedbe3fSmrg  lt_save_CC="$CC"
8495549e21daSmrg  lt_save_GCC=$GCC
84961bedbe3fSmrg  lt_save_CFLAGS=$CFLAGS
84971bedbe3fSmrg  CC=${FC-"f95"}
84981bedbe3fSmrg  CFLAGS=$FCFLAGS
8499549e21daSmrg  compiler=$CC
85001bedbe3fSmrg  GCC=$ac_cv_fc_compiler_gnu
85011bedbe3fSmrg
8502549e21daSmrg  _LT_TAGVAR(compiler, $1)=$CC
8503549e21daSmrg  _LT_CC_BASENAME([$compiler])
8504ba6a1819Smrg
8505549e21daSmrg  if test -n "$compiler"; then
85061bedbe3fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
85071bedbe3fSmrg    AC_MSG_RESULT([$can_build_shared])
8508ba6a1819Smrg
85091bedbe3fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
85101bedbe3fSmrg    test "$can_build_shared" = "no" && enable_shared=no
8511ba6a1819Smrg
85121bedbe3fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
85131bedbe3fSmrg    # are all built from PIC.
85141bedbe3fSmrg    case $host_os in
85151bedbe3fSmrg      aix3*)
85161bedbe3fSmrg        test "$enable_shared" = yes && enable_static=no
85171bedbe3fSmrg        if test -n "$RANLIB"; then
85181bedbe3fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
85191bedbe3fSmrg          postinstall_cmds='$RANLIB $lib'
85201bedbe3fSmrg        fi
85211bedbe3fSmrg        ;;
85221bedbe3fSmrg      aix[[4-9]]*)
85231bedbe3fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
85241bedbe3fSmrg	  test "$enable_shared" = yes && enable_static=no
85251bedbe3fSmrg	fi
85261bedbe3fSmrg        ;;
85271bedbe3fSmrg    esac
85281bedbe3fSmrg    AC_MSG_RESULT([$enable_shared])
8529ba6a1819Smrg
85301bedbe3fSmrg    AC_MSG_CHECKING([whether to build static libraries])
85311bedbe3fSmrg    # Make sure either enable_shared or enable_static is yes.
85321bedbe3fSmrg    test "$enable_shared" = yes || enable_static=yes
85331bedbe3fSmrg    AC_MSG_RESULT([$enable_static])
8534ba6a1819Smrg
85351bedbe3fSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
85361bedbe3fSmrg    _LT_TAGVAR(LD, $1)="$LD"
8537ba6a1819Smrg
85381bedbe3fSmrg    ## CAVEAT EMPTOR:
85391bedbe3fSmrg    ## There is no encapsulation within the following macros, do not change
85401bedbe3fSmrg    ## the running order or otherwise move them around unless you know exactly
85411bedbe3fSmrg    ## what you are doing...
85421bedbe3fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
85431bedbe3fSmrg    _LT_COMPILER_PIC($1)
85441bedbe3fSmrg    _LT_COMPILER_C_O($1)
85451bedbe3fSmrg    _LT_COMPILER_FILE_LOCKS($1)
85461bedbe3fSmrg    _LT_LINKER_SHLIBS($1)
85471bedbe3fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
85481bedbe3fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8549549e21daSmrg
85501bedbe3fSmrg    _LT_CONFIG($1)
85511bedbe3fSmrg  fi # test -n "$compiler"
8552ba6a1819Smrg
85531bedbe3fSmrg  GCC=$lt_save_GCC
85541bedbe3fSmrg  CC=$lt_save_CC
85551bedbe3fSmrg  CFLAGS=$lt_save_CFLAGS
85561bedbe3fSmrgfi # test "$_lt_disable_FC" != yes
8557ba6a1819Smrg
85581bedbe3fSmrgAC_LANG_POP
85591bedbe3fSmrg])# _LT_LANG_FC_CONFIG
8560ba6a1819Smrg
8561549e21daSmrg
85621bedbe3fSmrg# _LT_LANG_GCJ_CONFIG([TAG])
85631bedbe3fSmrg# --------------------------
85641bedbe3fSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
85651bedbe3fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
85661bedbe3fSmrg# to write the compiler configuration to `libtool'.
85671bedbe3fSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
85681bedbe3fSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
85691bedbe3fSmrgAC_LANG_SAVE
8570ba6a1819Smrg
85711bedbe3fSmrg# Source file extension for Java test sources.
85721bedbe3fSmrgac_ext=java
8573ba6a1819Smrg
85741bedbe3fSmrg# Object file extension for compiled Java test sources.
85751bedbe3fSmrgobjext=o
85761bedbe3fSmrg_LT_TAGVAR(objext, $1)=$objext
8577549e21daSmrg
85781bedbe3fSmrg# Code to be used in simple compile tests
85791bedbe3fSmrglt_simple_compile_test_code="class foo {}"
8580549e21daSmrg
85811bedbe3fSmrg# Code to be used in simple link tests
85821bedbe3fSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8583ba6a1819Smrg
85841bedbe3fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
85851bedbe3fSmrg_LT_TAG_COMPILER
8586549e21daSmrg
85871bedbe3fSmrg# save warnings/boilerplate of simple test code
85881bedbe3fSmrg_LT_COMPILER_BOILERPLATE
85891bedbe3fSmrg_LT_LINKER_BOILERPLATE
8590ba6a1819Smrg
85911bedbe3fSmrg# Allow CC to be a program name with arguments.
85921bedbe3fSmrglt_save_CC=$CC
85931bedbe3fSmrglt_save_CFLAGS=$CFLAGS
85941bedbe3fSmrglt_save_GCC=$GCC
85951bedbe3fSmrgGCC=yes
85961bedbe3fSmrgCC=${GCJ-"gcj"}
85971bedbe3fSmrgCFLAGS=$GCJFLAGS
85981bedbe3fSmrgcompiler=$CC
85991bedbe3fSmrg_LT_TAGVAR(compiler, $1)=$CC
86001bedbe3fSmrg_LT_TAGVAR(LD, $1)="$LD"
86011bedbe3fSmrg_LT_CC_BASENAME([$compiler])
8602ba6a1819Smrg
86031bedbe3fSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
86041bedbe3fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8605ba6a1819Smrg
86061bedbe3fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
86071bedbe3fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
86081bedbe3fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8609ba6a1819Smrg
86101bedbe3fSmrgif test -n "$compiler"; then
86111bedbe3fSmrg  _LT_COMPILER_NO_RTTI($1)
86121bedbe3fSmrg  _LT_COMPILER_PIC($1)
86131bedbe3fSmrg  _LT_COMPILER_C_O($1)
86141bedbe3fSmrg  _LT_COMPILER_FILE_LOCKS($1)
86151bedbe3fSmrg  _LT_LINKER_SHLIBS($1)
86161bedbe3fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8617ba6a1819Smrg
86181bedbe3fSmrg  _LT_CONFIG($1)
86191bedbe3fSmrgfi
8620ba6a1819Smrg
86211bedbe3fSmrgAC_LANG_RESTORE
8622ba6a1819Smrg
86231bedbe3fSmrgGCC=$lt_save_GCC
86241bedbe3fSmrgCC=$lt_save_CC
86251bedbe3fSmrgCFLAGS=$lt_save_CFLAGS
86261bedbe3fSmrg])# _LT_LANG_GCJ_CONFIG
8627ba6a1819Smrg
8628ba6a1819Smrg
86291bedbe3fSmrg# _LT_LANG_GO_CONFIG([TAG])
86301bedbe3fSmrg# --------------------------
86311bedbe3fSmrg# Ensure that the configuration variables for the GNU Go compiler
86321bedbe3fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
86331bedbe3fSmrg# to write the compiler configuration to `libtool'.
86341bedbe3fSmrgm4_defun([_LT_LANG_GO_CONFIG],
86351bedbe3fSmrg[AC_REQUIRE([LT_PROG_GO])dnl
86361bedbe3fSmrgAC_LANG_SAVE
8637ba6a1819Smrg
86381bedbe3fSmrg# Source file extension for Go test sources.
86391bedbe3fSmrgac_ext=go
8640549e21daSmrg
86411bedbe3fSmrg# Object file extension for compiled Go test sources.
86421bedbe3fSmrgobjext=o
86431bedbe3fSmrg_LT_TAGVAR(objext, $1)=$objext
8644ba6a1819Smrg
86451bedbe3fSmrg# Code to be used in simple compile tests
86461bedbe3fSmrglt_simple_compile_test_code="package main; func main() { }"
8647549e21daSmrg
86481bedbe3fSmrg# Code to be used in simple link tests
86491bedbe3fSmrglt_simple_link_test_code='package main; func main() { }'
8650ba6a1819Smrg
86511bedbe3fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
86521bedbe3fSmrg_LT_TAG_COMPILER
8653ba6a1819Smrg
86541bedbe3fSmrg# save warnings/boilerplate of simple test code
86551bedbe3fSmrg_LT_COMPILER_BOILERPLATE
86561bedbe3fSmrg_LT_LINKER_BOILERPLATE
8657549e21daSmrg
86581bedbe3fSmrg# Allow CC to be a program name with arguments.
86591bedbe3fSmrglt_save_CC=$CC
86601bedbe3fSmrglt_save_CFLAGS=$CFLAGS
86611bedbe3fSmrglt_save_GCC=$GCC
86621bedbe3fSmrgGCC=yes
86631bedbe3fSmrgCC=${GOC-"gccgo"}
86641bedbe3fSmrgCFLAGS=$GOFLAGS
86651bedbe3fSmrgcompiler=$CC
86661bedbe3fSmrg_LT_TAGVAR(compiler, $1)=$CC
86671bedbe3fSmrg_LT_TAGVAR(LD, $1)="$LD"
86681bedbe3fSmrg_LT_CC_BASENAME([$compiler])
8669ba6a1819Smrg
86701bedbe3fSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
86711bedbe3fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8672ba6a1819Smrg
86731bedbe3fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
86741bedbe3fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
86751bedbe3fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8676549e21daSmrg
86771bedbe3fSmrgif test -n "$compiler"; then
86781bedbe3fSmrg  _LT_COMPILER_NO_RTTI($1)
86791bedbe3fSmrg  _LT_COMPILER_PIC($1)
86801bedbe3fSmrg  _LT_COMPILER_C_O($1)
86811bedbe3fSmrg  _LT_COMPILER_FILE_LOCKS($1)
86821bedbe3fSmrg  _LT_LINKER_SHLIBS($1)
86831bedbe3fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8684549e21daSmrg
86851bedbe3fSmrg  _LT_CONFIG($1)
86861bedbe3fSmrgfi
8687ba6a1819Smrg
86881bedbe3fSmrgAC_LANG_RESTORE
8689ba6a1819Smrg
86901bedbe3fSmrgGCC=$lt_save_GCC
86911bedbe3fSmrgCC=$lt_save_CC
86921bedbe3fSmrgCFLAGS=$lt_save_CFLAGS
86931bedbe3fSmrg])# _LT_LANG_GO_CONFIG
8694ba6a1819Smrg
8695549e21daSmrg
86961bedbe3fSmrg# _LT_LANG_RC_CONFIG([TAG])
86971bedbe3fSmrg# -------------------------
86981bedbe3fSmrg# Ensure that the configuration variables for the Windows resource compiler
86991bedbe3fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
87001bedbe3fSmrg# to write the compiler configuration to `libtool'.
87011bedbe3fSmrgm4_defun([_LT_LANG_RC_CONFIG],
87021bedbe3fSmrg[AC_REQUIRE([LT_PROG_RC])dnl
87031bedbe3fSmrgAC_LANG_SAVE
8704549e21daSmrg
87051bedbe3fSmrg# Source file extension for RC test sources.
87061bedbe3fSmrgac_ext=rc
8707ba6a1819Smrg
87081bedbe3fSmrg# Object file extension for compiled RC test sources.
87091bedbe3fSmrgobjext=o
87101bedbe3fSmrg_LT_TAGVAR(objext, $1)=$objext
8711ba6a1819Smrg
87121bedbe3fSmrg# Code to be used in simple compile tests
87131bedbe3fSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8714ba6a1819Smrg
87151bedbe3fSmrg# Code to be used in simple link tests
87161bedbe3fSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
8717ba6a1819Smrg
87181bedbe3fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
87191bedbe3fSmrg_LT_TAG_COMPILER
8720ba6a1819Smrg
87211bedbe3fSmrg# save warnings/boilerplate of simple test code
87221bedbe3fSmrg_LT_COMPILER_BOILERPLATE
87231bedbe3fSmrg_LT_LINKER_BOILERPLATE
8724ba6a1819Smrg
87251bedbe3fSmrg# Allow CC to be a program name with arguments.
87261bedbe3fSmrglt_save_CC="$CC"
87271bedbe3fSmrglt_save_CFLAGS=$CFLAGS
87281bedbe3fSmrglt_save_GCC=$GCC
87291bedbe3fSmrgGCC=
87301bedbe3fSmrgCC=${RC-"windres"}
87311bedbe3fSmrgCFLAGS=
87321bedbe3fSmrgcompiler=$CC
87331bedbe3fSmrg_LT_TAGVAR(compiler, $1)=$CC
87341bedbe3fSmrg_LT_CC_BASENAME([$compiler])
87351bedbe3fSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
87361bedbe3fSmrg
87371bedbe3fSmrgif test -n "$compiler"; then
87381bedbe3fSmrg  :
87391bedbe3fSmrg  _LT_CONFIG($1)
87401bedbe3fSmrgfi
87411bedbe3fSmrg
87421bedbe3fSmrgGCC=$lt_save_GCC
87431bedbe3fSmrgAC_LANG_RESTORE
87441bedbe3fSmrgCC=$lt_save_CC
87451bedbe3fSmrgCFLAGS=$lt_save_CFLAGS
87461bedbe3fSmrg])# _LT_LANG_RC_CONFIG
87471bedbe3fSmrg
87481bedbe3fSmrg
87491bedbe3fSmrg# LT_PROG_GCJ
87501bedbe3fSmrg# -----------
87511bedbe3fSmrgAC_DEFUN([LT_PROG_GCJ],
87521bedbe3fSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
87531bedbe3fSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
87541bedbe3fSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
87551bedbe3fSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
87561bedbe3fSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
87571bedbe3fSmrg])
8758ba6a1819Smrg
87591bedbe3fSmrg# Old name:
87601bedbe3fSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
87611bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
87621bedbe3fSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8763ba6a1819Smrg
8764549e21daSmrg
87651bedbe3fSmrg# LT_PROG_GO
87661bedbe3fSmrg# ----------
87671bedbe3fSmrgAC_DEFUN([LT_PROG_GO],
87681bedbe3fSmrg[AC_CHECK_TOOL(GOC, gccgo,)
87691bedbe3fSmrg])
8770549e21daSmrg
8771549e21daSmrg
87721bedbe3fSmrg# LT_PROG_RC
87731bedbe3fSmrg# ----------
87741bedbe3fSmrgAC_DEFUN([LT_PROG_RC],
87751bedbe3fSmrg[AC_CHECK_TOOL(RC, windres,)
87761bedbe3fSmrg])
8777ba6a1819Smrg
87781bedbe3fSmrg# Old name:
87791bedbe3fSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
87801bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
87811bedbe3fSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8782ba6a1819Smrg
8783549e21daSmrg
87841bedbe3fSmrg# _LT_DECL_EGREP
87851bedbe3fSmrg# --------------
87861bedbe3fSmrg# If we don't have a new enough Autoconf to choose the best grep
87871bedbe3fSmrg# available, choose the one first in the user's PATH.
87881bedbe3fSmrgm4_defun([_LT_DECL_EGREP],
87891bedbe3fSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
87901bedbe3fSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
87911bedbe3fSmrgtest -z "$GREP" && GREP=grep
87921bedbe3fSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
87931bedbe3fSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
87941bedbe3fSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
87951bedbe3fSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
87961bedbe3fSmrgAC_SUBST([GREP])
87971bedbe3fSmrg])
8798549e21daSmrg
8799549e21daSmrg
88001bedbe3fSmrg# _LT_DECL_OBJDUMP
88011bedbe3fSmrg# --------------
88021bedbe3fSmrg# If we don't have a new enough Autoconf to choose the best objdump
88031bedbe3fSmrg# available, choose the one first in the user's PATH.
88041bedbe3fSmrgm4_defun([_LT_DECL_OBJDUMP],
88051bedbe3fSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
88061bedbe3fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
88071bedbe3fSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
88081bedbe3fSmrgAC_SUBST([OBJDUMP])
88091bedbe3fSmrg])
8810ba6a1819Smrg
88111bedbe3fSmrg# _LT_DECL_DLLTOOL
88121bedbe3fSmrg# ----------------
88131bedbe3fSmrg# Ensure DLLTOOL variable is set.
88141bedbe3fSmrgm4_defun([_LT_DECL_DLLTOOL],
88151bedbe3fSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
88161bedbe3fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
88171bedbe3fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
88181bedbe3fSmrgAC_SUBST([DLLTOOL])
88191bedbe3fSmrg])
8820ba6a1819Smrg
88211bedbe3fSmrg# _LT_DECL_SED
88221bedbe3fSmrg# ------------
88231bedbe3fSmrg# Check for a fully-functional sed program, that truncates
88241bedbe3fSmrg# as few characters as possible.  Prefer GNU sed if found.
88251bedbe3fSmrgm4_defun([_LT_DECL_SED],
88261bedbe3fSmrg[AC_PROG_SED
88271bedbe3fSmrgtest -z "$SED" && SED=sed
88281bedbe3fSmrgXsed="$SED -e 1s/^X//"
88291bedbe3fSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
88301bedbe3fSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
88311bedbe3fSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
88321bedbe3fSmrg])# _LT_DECL_SED
8833ba6a1819Smrg
88341bedbe3fSmrgm4_ifndef([AC_PROG_SED], [
88351bedbe3fSmrg# NOTE: This macro has been submitted for inclusion into   #
88361bedbe3fSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
88371bedbe3fSmrg#  a released version of Autoconf we should remove this    #
88381bedbe3fSmrg#  macro and use it instead.                               #
8839549e21daSmrg
88401bedbe3fSmrgm4_defun([AC_PROG_SED],
88411bedbe3fSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
88421bedbe3fSmrgAC_CACHE_VAL(lt_cv_path_SED,
88431bedbe3fSmrg[# Loop through the user's path and test for sed and gsed.
88441bedbe3fSmrg# Then use that list of sed's as ones to test for truncation.
88451bedbe3fSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
88461bedbe3fSmrgfor as_dir in $PATH
88471bedbe3fSmrgdo
88481bedbe3fSmrg  IFS=$as_save_IFS
88491bedbe3fSmrg  test -z "$as_dir" && as_dir=.
88501bedbe3fSmrg  for lt_ac_prog in sed gsed; do
88511bedbe3fSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
88521bedbe3fSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
88531bedbe3fSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
88541bedbe3fSmrg      fi
88551bedbe3fSmrg    done
88561bedbe3fSmrg  done
88571bedbe3fSmrgdone
88581bedbe3fSmrgIFS=$as_save_IFS
88591bedbe3fSmrglt_ac_max=0
88601bedbe3fSmrglt_ac_count=0
88611bedbe3fSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
88621bedbe3fSmrg# along with /bin/sed that truncates output.
88631bedbe3fSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
88641bedbe3fSmrg  test ! -f $lt_ac_sed && continue
88651bedbe3fSmrg  cat /dev/null > conftest.in
88661bedbe3fSmrg  lt_ac_count=0
88671bedbe3fSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
88681bedbe3fSmrg  # Check for GNU sed and select it if it is found.
88691bedbe3fSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
88701bedbe3fSmrg    lt_cv_path_SED=$lt_ac_sed
88711bedbe3fSmrg    break
88721bedbe3fSmrg  fi
88731bedbe3fSmrg  while true; do
88741bedbe3fSmrg    cat conftest.in conftest.in >conftest.tmp
88751bedbe3fSmrg    mv conftest.tmp conftest.in
88761bedbe3fSmrg    cp conftest.in conftest.nl
88771bedbe3fSmrg    echo >>conftest.nl
88781bedbe3fSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
88791bedbe3fSmrg    cmp -s conftest.out conftest.nl || break
88801bedbe3fSmrg    # 10000 chars as input seems more than enough
88811bedbe3fSmrg    test $lt_ac_count -gt 10 && break
88821bedbe3fSmrg    lt_ac_count=`expr $lt_ac_count + 1`
88831bedbe3fSmrg    if test $lt_ac_count -gt $lt_ac_max; then
88841bedbe3fSmrg      lt_ac_max=$lt_ac_count
88851bedbe3fSmrg      lt_cv_path_SED=$lt_ac_sed
88861bedbe3fSmrg    fi
88871bedbe3fSmrg  done
88881bedbe3fSmrgdone
88891bedbe3fSmrg])
88901bedbe3fSmrgSED=$lt_cv_path_SED
88911bedbe3fSmrgAC_SUBST([SED])
88921bedbe3fSmrgAC_MSG_RESULT([$SED])
88931bedbe3fSmrg])#AC_PROG_SED
88941bedbe3fSmrg])#m4_ifndef
8895ba6a1819Smrg
88961bedbe3fSmrg# Old name:
88971bedbe3fSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
88981bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
88991bedbe3fSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8900ba6a1819Smrg
8901ba6a1819Smrg
89021bedbe3fSmrg# _LT_CHECK_SHELL_FEATURES
89031bedbe3fSmrg# ------------------------
89041bedbe3fSmrg# Find out whether the shell is Bourne or XSI compatible,
89051bedbe3fSmrg# or has some other useful features.
89061bedbe3fSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
89071bedbe3fSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
89081bedbe3fSmrg# Try some XSI features
89091bedbe3fSmrgxsi_shell=no
89101bedbe3fSmrg( _lt_dummy="a/b/c"
89111bedbe3fSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
89121bedbe3fSmrg      = c,a/b,b/c, \
89131bedbe3fSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
89141bedbe3fSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
89151bedbe3fSmrg  && xsi_shell=yes
89161bedbe3fSmrgAC_MSG_RESULT([$xsi_shell])
89171bedbe3fSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8918549e21daSmrg
89191bedbe3fSmrgAC_MSG_CHECKING([whether the shell understands "+="])
89201bedbe3fSmrglt_shell_append=no
89211bedbe3fSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
89221bedbe3fSmrg    >/dev/null 2>&1 \
89231bedbe3fSmrg  && lt_shell_append=yes
89241bedbe3fSmrgAC_MSG_RESULT([$lt_shell_append])
89251bedbe3fSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8926549e21daSmrg
89271bedbe3fSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
89281bedbe3fSmrg  lt_unset=unset
89291bedbe3fSmrgelse
89301bedbe3fSmrg  lt_unset=false
89311bedbe3fSmrgfi
89321bedbe3fSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8933549e21daSmrg
89341bedbe3fSmrg# test EBCDIC or ASCII
89351bedbe3fSmrgcase `echo X|tr X '\101'` in
89361bedbe3fSmrg A) # ASCII based system
89371bedbe3fSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
89381bedbe3fSmrg  lt_SP2NL='tr \040 \012'
89391bedbe3fSmrg  lt_NL2SP='tr \015\012 \040\040'
89401bedbe3fSmrg  ;;
89411bedbe3fSmrg *) # EBCDIC based system
89421bedbe3fSmrg  lt_SP2NL='tr \100 \n'
89431bedbe3fSmrg  lt_NL2SP='tr \r\n \100\100'
89441bedbe3fSmrg  ;;
89451bedbe3fSmrgesac
89461bedbe3fSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
89471bedbe3fSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
89481bedbe3fSmrg])# _LT_CHECK_SHELL_FEATURES
8949ba6a1819Smrg
8950ba6a1819Smrg
89511bedbe3fSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
89521bedbe3fSmrg# ------------------------------------------------------
89531bedbe3fSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
89541bedbe3fSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
89551bedbe3fSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
89561bedbe3fSmrg[dnl {
89571bedbe3fSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
89581bedbe3fSmrg$1 ()\
89591bedbe3fSmrg{\
89601bedbe3fSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
89611bedbe3fSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
89621bedbe3fSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
89631bedbe3fSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
89641bedbe3fSmrgtest 0 -eq $? || _lt_function_replace_fail=:
89651bedbe3fSmrg])
8966ba6a1819Smrg
8967ba6a1819Smrg
89681bedbe3fSmrg# _LT_PROG_REPLACE_SHELLFNS
89691bedbe3fSmrg# -------------------------
89701bedbe3fSmrg# Replace existing portable implementations of several shell functions with
89711bedbe3fSmrg# equivalent extended shell implementations where those features are available..
89721bedbe3fSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
89731bedbe3fSmrg[if test x"$xsi_shell" = xyes; then
89741bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
89751bedbe3fSmrg    case ${1} in
89761bedbe3fSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
89771bedbe3fSmrg      *  ) func_dirname_result="${3}" ;;
89781bedbe3fSmrg    esac])
89791bedbe3fSmrg
89801bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
89811bedbe3fSmrg    func_basename_result="${1##*/}"])
89821bedbe3fSmrg
89831bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
89841bedbe3fSmrg    case ${1} in
89851bedbe3fSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
89861bedbe3fSmrg      *  ) func_dirname_result="${3}" ;;
89871bedbe3fSmrg    esac
89881bedbe3fSmrg    func_basename_result="${1##*/}"])
8989ba6a1819Smrg
89901bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
89911bedbe3fSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
89921bedbe3fSmrg    # positional parameters, so assign one to ordinary parameter first.
89931bedbe3fSmrg    func_stripname_result=${3}
89941bedbe3fSmrg    func_stripname_result=${func_stripname_result#"${1}"}
89951bedbe3fSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
8996ba6a1819Smrg
89971bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
89981bedbe3fSmrg    func_split_long_opt_name=${1%%=*}
89991bedbe3fSmrg    func_split_long_opt_arg=${1#*=}])
9000ba6a1819Smrg
90011bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
90021bedbe3fSmrg    func_split_short_opt_arg=${1#??}
90031bedbe3fSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
9004ba6a1819Smrg
90051bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
90061bedbe3fSmrg    case ${1} in
90071bedbe3fSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
90081bedbe3fSmrg      *)    func_lo2o_result=${1} ;;
90091bedbe3fSmrg    esac])
9010549e21daSmrg
90111bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
9012549e21daSmrg
90131bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
9014549e21daSmrg
90151bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
90161bedbe3fSmrgfi
9017549e21daSmrg
90181bedbe3fSmrgif test x"$lt_shell_append" = xyes; then
90191bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
9020ba6a1819Smrg
90211bedbe3fSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
90221bedbe3fSmrg    func_quote_for_eval "${2}"
90231bedbe3fSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
90241bedbe3fSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
9025ba6a1819Smrg
90261bedbe3fSmrg  # Save a `func_append' function call where possible by direct use of '+='
90271bedbe3fSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
90281bedbe3fSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
90291bedbe3fSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
90301bedbe3fSmrg  test 0 -eq $? || _lt_function_replace_fail=:
90311bedbe3fSmrgelse
90321bedbe3fSmrg  # Save a `func_append' function call even when '+=' is not available
90331bedbe3fSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
90341bedbe3fSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
90351bedbe3fSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
90361bedbe3fSmrg  test 0 -eq $? || _lt_function_replace_fail=:
90371bedbe3fSmrgfi
9038ba6a1819Smrg
90391bedbe3fSmrgif test x"$_lt_function_replace_fail" = x":"; then
90401bedbe3fSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
90411bedbe3fSmrgfi
90421bedbe3fSmrg])
9043ba6a1819Smrg
90441bedbe3fSmrg# _LT_PATH_CONVERSION_FUNCTIONS
90451bedbe3fSmrg# -----------------------------
90461bedbe3fSmrg# Determine which file name conversion functions should be used by
90471bedbe3fSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
90481bedbe3fSmrg# for certain cross-compile configurations and native mingw.
90491bedbe3fSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
90501bedbe3fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
90511bedbe3fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
90521bedbe3fSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
90531bedbe3fSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
90541bedbe3fSmrg[case $host in
90551bedbe3fSmrg  *-*-mingw* )
90561bedbe3fSmrg    case $build in
90571bedbe3fSmrg      *-*-mingw* ) # actually msys
90581bedbe3fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
90591bedbe3fSmrg        ;;
90601bedbe3fSmrg      *-*-cygwin* )
90611bedbe3fSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
90621bedbe3fSmrg        ;;
90631bedbe3fSmrg      * ) # otherwise, assume *nix
90641bedbe3fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
90651bedbe3fSmrg        ;;
90661bedbe3fSmrg    esac
90671bedbe3fSmrg    ;;
90681bedbe3fSmrg  *-*-cygwin* )
90691bedbe3fSmrg    case $build in
90701bedbe3fSmrg      *-*-mingw* ) # actually msys
90711bedbe3fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
90721bedbe3fSmrg        ;;
90731bedbe3fSmrg      *-*-cygwin* )
90741bedbe3fSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
90751bedbe3fSmrg        ;;
90761bedbe3fSmrg      * ) # otherwise, assume *nix
90771bedbe3fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
90781bedbe3fSmrg        ;;
90791bedbe3fSmrg    esac
90801bedbe3fSmrg    ;;
90811bedbe3fSmrg  * ) # unhandled hosts (and "normal" native builds)
90821bedbe3fSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
90831bedbe3fSmrg    ;;
90841bedbe3fSmrgesac
9085549e21daSmrg])
90861bedbe3fSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
90871bedbe3fSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
90881bedbe3fSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
90891bedbe3fSmrg         [0], [convert $build file names to $host format])dnl
90901bedbe3fSmrg
90911bedbe3fSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
90921bedbe3fSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
90931bedbe3fSmrg[#assume ordinary cross tools, or native build.
90941bedbe3fSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
90951bedbe3fSmrgcase $host in
90961bedbe3fSmrg  *-*-mingw* )
90971bedbe3fSmrg    case $build in
90981bedbe3fSmrg      *-*-mingw* ) # actually msys
90991bedbe3fSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
91001bedbe3fSmrg        ;;
91011bedbe3fSmrg    esac
91021bedbe3fSmrg    ;;
91031bedbe3fSmrgesac
91041bedbe3fSmrg])
91051bedbe3fSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
91061bedbe3fSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
91071bedbe3fSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
91081bedbe3fSmrg         [0], [convert $build files to toolchain format])dnl
91091bedbe3fSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
9110ba6a1819Smrg
91111bedbe3fSmrg# Helper functions for option handling.                    -*- Autoconf -*-
91121bedbe3fSmrg#
91131bedbe3fSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
91141bedbe3fSmrg#   Inc.
91151bedbe3fSmrg#   Written by Gary V. Vaughan, 2004
91161bedbe3fSmrg#
91171bedbe3fSmrg# This file is free software; the Free Software Foundation gives
91181bedbe3fSmrg# unlimited permission to copy and/or distribute it, with or without
91191bedbe3fSmrg# modifications, as long as this notice is preserved.
9120ba6a1819Smrg
91211bedbe3fSmrg# serial 7 ltoptions.m4
9122ba6a1819Smrg
91231bedbe3fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
91241bedbe3fSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9125ba6a1819Smrg
9126ba6a1819Smrg
91271bedbe3fSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
91281bedbe3fSmrg# ------------------------------------------
91291bedbe3fSmrgm4_define([_LT_MANGLE_OPTION],
91301bedbe3fSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9131ba6a1819Smrg
9132ba6a1819Smrg
91331bedbe3fSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
91341bedbe3fSmrg# ---------------------------------------
91351bedbe3fSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
91361bedbe3fSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
91371bedbe3fSmrg# saved as a flag.
91381bedbe3fSmrgm4_define([_LT_SET_OPTION],
91391bedbe3fSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
91401bedbe3fSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
91411bedbe3fSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
91421bedbe3fSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
91431bedbe3fSmrg])
9144ba6a1819Smrg
9145ba6a1819Smrg
91461bedbe3fSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
91471bedbe3fSmrg# ------------------------------------------------------------
91481bedbe3fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
91491bedbe3fSmrgm4_define([_LT_IF_OPTION],
91501bedbe3fSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9151ba6a1819Smrg
9152ba6a1819Smrg
91531bedbe3fSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
91541bedbe3fSmrg# -------------------------------------------------------
91551bedbe3fSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
91561bedbe3fSmrg# are set.
91571bedbe3fSmrgm4_define([_LT_UNLESS_OPTIONS],
91581bedbe3fSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
91591bedbe3fSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
91601bedbe3fSmrg		      [m4_define([$0_found])])])[]dnl
91611bedbe3fSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
91621bedbe3fSmrg])[]dnl
91631bedbe3fSmrg])
9164549e21daSmrg
9165549e21daSmrg
91661bedbe3fSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
91671bedbe3fSmrg# ----------------------------------------
91681bedbe3fSmrg# OPTION-LIST is a space-separated list of Libtool options associated
91691bedbe3fSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
91701bedbe3fSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
91711bedbe3fSmrg# the unknown option and exit.
91721bedbe3fSmrgm4_defun([_LT_SET_OPTIONS],
91731bedbe3fSmrg[# Set options
91741bedbe3fSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
91751bedbe3fSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
9176549e21daSmrg
91771bedbe3fSmrgm4_if([$1],[LT_INIT],[
91781bedbe3fSmrg  dnl
91791bedbe3fSmrg  dnl Simply set some default values (i.e off) if boolean options were not
91801bedbe3fSmrg  dnl specified:
91811bedbe3fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
91821bedbe3fSmrg  ])
91831bedbe3fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
91841bedbe3fSmrg  ])
91851bedbe3fSmrg  dnl
91861bedbe3fSmrg  dnl If no reference was made to various pairs of opposing options, then
91871bedbe3fSmrg  dnl we run the default mode handler for the pair.  For example, if neither
91881bedbe3fSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
91891bedbe3fSmrg  dnl archives by default:
91901bedbe3fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
91911bedbe3fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
91921bedbe3fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
91931bedbe3fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
91941bedbe3fSmrg  		   [_LT_ENABLE_FAST_INSTALL])
91951bedbe3fSmrg  ])
91961bedbe3fSmrg])# _LT_SET_OPTIONS
9197ba6a1819Smrg
9198549e21daSmrg
91991bedbe3fSmrg
92001bedbe3fSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
92011bedbe3fSmrg# -----------------------------------------
92021bedbe3fSmrgm4_define([_LT_MANGLE_DEFUN],
92031bedbe3fSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
92041bedbe3fSmrg
92051bedbe3fSmrg
92061bedbe3fSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
92071bedbe3fSmrg# -----------------------------------------------
92081bedbe3fSmrgm4_define([LT_OPTION_DEFINE],
92091bedbe3fSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
92101bedbe3fSmrg])# LT_OPTION_DEFINE
92111bedbe3fSmrg
92121bedbe3fSmrg
92131bedbe3fSmrg# dlopen
92141bedbe3fSmrg# ------
92151bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9216ba6a1819Smrg])
9217549e21daSmrg
92181bedbe3fSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
92191bedbe3fSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
92201bedbe3fSmrgAC_DIAGNOSE([obsolete],
92211bedbe3fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
92221bedbe3fSmrgput the `dlopen' option into LT_INIT's first parameter.])
92231bedbe3fSmrg])
92241bedbe3fSmrg
92251bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
92261bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
92271bedbe3fSmrg
92281bedbe3fSmrg
92291bedbe3fSmrg# win32-dll
92301bedbe3fSmrg# ---------
92311bedbe3fSmrg# Declare package support for building win32 dll's.
92321bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
92331bedbe3fSmrg[enable_win32_dll=yes
9234549e21daSmrg
92351bedbe3fSmrgcase $host in
92361bedbe3fSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
92371bedbe3fSmrg  AC_CHECK_TOOL(AS, as, false)
92381bedbe3fSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
92391bedbe3fSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
92401bedbe3fSmrg  ;;
92411bedbe3fSmrgesac
9242549e21daSmrg
92431bedbe3fSmrgtest -z "$AS" && AS=as
92441bedbe3fSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
9245ba6a1819Smrg
92461bedbe3fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
92471bedbe3fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9248ba6a1819Smrg
92491bedbe3fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
92501bedbe3fSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
92511bedbe3fSmrg])# win32-dll
9252ba6a1819Smrg
92531bedbe3fSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
92541bedbe3fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
92551bedbe3fSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
92561bedbe3fSmrgAC_DIAGNOSE([obsolete],
92571bedbe3fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
92581bedbe3fSmrgput the `win32-dll' option into LT_INIT's first parameter.])
92591bedbe3fSmrg])
9260549e21daSmrg
92611bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
92621bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9263549e21daSmrg
9264549e21daSmrg
92651bedbe3fSmrg# _LT_ENABLE_SHARED([DEFAULT])
92661bedbe3fSmrg# ----------------------------
92671bedbe3fSmrg# implement the --enable-shared flag, and supports the `shared' and
92681bedbe3fSmrg# `disable-shared' LT_INIT options.
92691bedbe3fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
92701bedbe3fSmrgm4_define([_LT_ENABLE_SHARED],
92711bedbe3fSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
92721bedbe3fSmrgAC_ARG_ENABLE([shared],
92731bedbe3fSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
92741bedbe3fSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
92751bedbe3fSmrg    [p=${PACKAGE-default}
92761bedbe3fSmrg    case $enableval in
92771bedbe3fSmrg    yes) enable_shared=yes ;;
92781bedbe3fSmrg    no) enable_shared=no ;;
92791bedbe3fSmrg    *)
92801bedbe3fSmrg      enable_shared=no
92811bedbe3fSmrg      # Look at the argument we got.  We use all the common list separators.
92821bedbe3fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
92831bedbe3fSmrg      for pkg in $enableval; do
92841bedbe3fSmrg	IFS="$lt_save_ifs"
92851bedbe3fSmrg	if test "X$pkg" = "X$p"; then
92861bedbe3fSmrg	  enable_shared=yes
92871bedbe3fSmrg	fi
92881bedbe3fSmrg      done
92891bedbe3fSmrg      IFS="$lt_save_ifs"
92901bedbe3fSmrg      ;;
92911bedbe3fSmrg    esac],
92921bedbe3fSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9293549e21daSmrg
92941bedbe3fSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
92951bedbe3fSmrg	[Whether or not to build shared libraries])
92961bedbe3fSmrg])# _LT_ENABLE_SHARED
9297549e21daSmrg
92981bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
92991bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9300ba6a1819Smrg
93011bedbe3fSmrg# Old names:
93021bedbe3fSmrgAC_DEFUN([AC_ENABLE_SHARED],
93031bedbe3fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
93041bedbe3fSmrg])
9305549e21daSmrg
93061bedbe3fSmrgAC_DEFUN([AC_DISABLE_SHARED],
93071bedbe3fSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
93081bedbe3fSmrg])
9309549e21daSmrg
93101bedbe3fSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
93111bedbe3fSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9312549e21daSmrg
93131bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
93141bedbe3fSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
93151bedbe3fSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
9316549e21daSmrg
9317549e21daSmrg
9318549e21daSmrg
93191bedbe3fSmrg# _LT_ENABLE_STATIC([DEFAULT])
93201bedbe3fSmrg# ----------------------------
93211bedbe3fSmrg# implement the --enable-static flag, and support the `static' and
93221bedbe3fSmrg# `disable-static' LT_INIT options.
93231bedbe3fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
93241bedbe3fSmrgm4_define([_LT_ENABLE_STATIC],
93251bedbe3fSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
93261bedbe3fSmrgAC_ARG_ENABLE([static],
93271bedbe3fSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
93281bedbe3fSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
93291bedbe3fSmrg    [p=${PACKAGE-default}
93301bedbe3fSmrg    case $enableval in
93311bedbe3fSmrg    yes) enable_static=yes ;;
93321bedbe3fSmrg    no) enable_static=no ;;
93331bedbe3fSmrg    *)
93341bedbe3fSmrg     enable_static=no
93351bedbe3fSmrg      # Look at the argument we got.  We use all the common list separators.
93361bedbe3fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
93371bedbe3fSmrg      for pkg in $enableval; do
93381bedbe3fSmrg	IFS="$lt_save_ifs"
93391bedbe3fSmrg	if test "X$pkg" = "X$p"; then
93401bedbe3fSmrg	  enable_static=yes
93411bedbe3fSmrg	fi
93421bedbe3fSmrg      done
93431bedbe3fSmrg      IFS="$lt_save_ifs"
93441bedbe3fSmrg      ;;
93451bedbe3fSmrg    esac],
93461bedbe3fSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9347549e21daSmrg
93481bedbe3fSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
93491bedbe3fSmrg	[Whether or not to build static libraries])
93501bedbe3fSmrg])# _LT_ENABLE_STATIC
9351549e21daSmrg
93521bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
93531bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9354549e21daSmrg
93551bedbe3fSmrg# Old names:
93561bedbe3fSmrgAC_DEFUN([AC_ENABLE_STATIC],
93571bedbe3fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
93581bedbe3fSmrg])
9359549e21daSmrg
93601bedbe3fSmrgAC_DEFUN([AC_DISABLE_STATIC],
93611bedbe3fSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
93621bedbe3fSmrg])
9363549e21daSmrg
93641bedbe3fSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
93651bedbe3fSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9366549e21daSmrg
93671bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
93681bedbe3fSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
93691bedbe3fSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
9370549e21daSmrg
9371549e21daSmrg
9372549e21daSmrg
93731bedbe3fSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
93741bedbe3fSmrg# ----------------------------------
93751bedbe3fSmrg# implement the --enable-fast-install flag, and support the `fast-install'
93761bedbe3fSmrg# and `disable-fast-install' LT_INIT options.
93771bedbe3fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
93781bedbe3fSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
93791bedbe3fSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
93801bedbe3fSmrgAC_ARG_ENABLE([fast-install],
93811bedbe3fSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
93821bedbe3fSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
93831bedbe3fSmrg    [p=${PACKAGE-default}
93841bedbe3fSmrg    case $enableval in
93851bedbe3fSmrg    yes) enable_fast_install=yes ;;
93861bedbe3fSmrg    no) enable_fast_install=no ;;
93871bedbe3fSmrg    *)
93881bedbe3fSmrg      enable_fast_install=no
93891bedbe3fSmrg      # Look at the argument we got.  We use all the common list separators.
93901bedbe3fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
93911bedbe3fSmrg      for pkg in $enableval; do
93921bedbe3fSmrg	IFS="$lt_save_ifs"
93931bedbe3fSmrg	if test "X$pkg" = "X$p"; then
93941bedbe3fSmrg	  enable_fast_install=yes
93951bedbe3fSmrg	fi
93961bedbe3fSmrg      done
93971bedbe3fSmrg      IFS="$lt_save_ifs"
93981bedbe3fSmrg      ;;
93991bedbe3fSmrg    esac],
94001bedbe3fSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9401549e21daSmrg
94021bedbe3fSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
94031bedbe3fSmrg	 [Whether or not to optimize for fast installation])dnl
94041bedbe3fSmrg])# _LT_ENABLE_FAST_INSTALL
9405549e21daSmrg
94061bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
94071bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9408549e21daSmrg
94091bedbe3fSmrg# Old names:
94101bedbe3fSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
94111bedbe3fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
94121bedbe3fSmrgAC_DIAGNOSE([obsolete],
94131bedbe3fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
94141bedbe3fSmrgthe `fast-install' option into LT_INIT's first parameter.])
94151bedbe3fSmrg])
9416549e21daSmrg
94171bedbe3fSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
94181bedbe3fSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
94191bedbe3fSmrgAC_DIAGNOSE([obsolete],
94201bedbe3fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
94211bedbe3fSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
94221bedbe3fSmrg])
9423549e21daSmrg
94241bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
94251bedbe3fSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
94261bedbe3fSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9427549e21daSmrg
9428549e21daSmrg
94291bedbe3fSmrg# _LT_WITH_PIC([MODE])
94301bedbe3fSmrg# --------------------
94311bedbe3fSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
94321bedbe3fSmrg# LT_INIT options.
94331bedbe3fSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
94341bedbe3fSmrgm4_define([_LT_WITH_PIC],
94351bedbe3fSmrg[AC_ARG_WITH([pic],
94361bedbe3fSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
94371bedbe3fSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
94381bedbe3fSmrg    [lt_p=${PACKAGE-default}
94391bedbe3fSmrg    case $withval in
94401bedbe3fSmrg    yes|no) pic_mode=$withval ;;
94411bedbe3fSmrg    *)
94421bedbe3fSmrg      pic_mode=default
94431bedbe3fSmrg      # Look at the argument we got.  We use all the common list separators.
94441bedbe3fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
94451bedbe3fSmrg      for lt_pkg in $withval; do
94461bedbe3fSmrg	IFS="$lt_save_ifs"
94471bedbe3fSmrg	if test "X$lt_pkg" = "X$lt_p"; then
94481bedbe3fSmrg	  pic_mode=yes
9449ba6a1819Smrg	fi
94501bedbe3fSmrg      done
94511bedbe3fSmrg      IFS="$lt_save_ifs"
94521bedbe3fSmrg      ;;
94531bedbe3fSmrg    esac],
94541bedbe3fSmrg    [pic_mode=default])
9455549e21daSmrg
94561bedbe3fSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9457549e21daSmrg
94581bedbe3fSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
94591bedbe3fSmrg])# _LT_WITH_PIC
9460549e21daSmrg
94611bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
94621bedbe3fSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9463549e21daSmrg
94641bedbe3fSmrg# Old name:
94651bedbe3fSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
94661bedbe3fSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
94671bedbe3fSmrgAC_DIAGNOSE([obsolete],
94681bedbe3fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
94691bedbe3fSmrgput the `pic-only' option into LT_INIT's first parameter.])
94701bedbe3fSmrg])
9471549e21daSmrg
94721bedbe3fSmrgdnl aclocal-1.4 backwards compatibility:
94731bedbe3fSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9474ba6a1819Smrg
9475ba6a1819Smrg
94761bedbe3fSmrgm4_define([_LTDL_MODE], [])
94771bedbe3fSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
94781bedbe3fSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
94791bedbe3fSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
94801bedbe3fSmrg		 [m4_define([_LTDL_MODE], [recursive])])
94811bedbe3fSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
94821bedbe3fSmrg		 [m4_define([_LTDL_MODE], [subproject])])
9483ba6a1819Smrg
94841bedbe3fSmrgm4_define([_LTDL_TYPE], [])
94851bedbe3fSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
94861bedbe3fSmrg		 [m4_define([_LTDL_TYPE], [installable])])
94871bedbe3fSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
94881bedbe3fSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
9489ba6a1819Smrg
94901bedbe3fSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
94911bedbe3fSmrg#
94921bedbe3fSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
94931bedbe3fSmrg# Written by Gary V. Vaughan, 2004
94941bedbe3fSmrg#
94951bedbe3fSmrg# This file is free software; the Free Software Foundation gives
94961bedbe3fSmrg# unlimited permission to copy and/or distribute it, with or without
94971bedbe3fSmrg# modifications, as long as this notice is preserved.
9498ba6a1819Smrg
94991bedbe3fSmrg# serial 6 ltsugar.m4
9500ba6a1819Smrg
95011bedbe3fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
95021bedbe3fSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9503ba6a1819Smrg
9504ba6a1819Smrg
95051bedbe3fSmrg# lt_join(SEP, ARG1, [ARG2...])
95061bedbe3fSmrg# -----------------------------
95071bedbe3fSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
95081bedbe3fSmrg# associated separator.
95091bedbe3fSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
95101bedbe3fSmrg# versions in m4sugar had bugs.
95111bedbe3fSmrgm4_define([lt_join],
95121bedbe3fSmrg[m4_if([$#], [1], [],
95131bedbe3fSmrg       [$#], [2], [[$2]],
95141bedbe3fSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
95151bedbe3fSmrgm4_define([_lt_join],
95161bedbe3fSmrg[m4_if([$#$2], [2], [],
95171bedbe3fSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9518ba6a1819Smrg
9519ba6a1819Smrg
95201bedbe3fSmrg# lt_car(LIST)
95211bedbe3fSmrg# lt_cdr(LIST)
95221bedbe3fSmrg# ------------
95231bedbe3fSmrg# Manipulate m4 lists.
95241bedbe3fSmrg# These macros are necessary as long as will still need to support
95251bedbe3fSmrg# Autoconf-2.59 which quotes differently.
95261bedbe3fSmrgm4_define([lt_car], [[$1]])
95271bedbe3fSmrgm4_define([lt_cdr],
95281bedbe3fSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
95291bedbe3fSmrg       [$#], 1, [],
95301bedbe3fSmrg       [m4_dquote(m4_shift($@))])])
95311bedbe3fSmrgm4_define([lt_unquote], $1)
95321bedbe3fSmrg
95331bedbe3fSmrg
95341bedbe3fSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
95351bedbe3fSmrg# ------------------------------------------
95361bedbe3fSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
95371bedbe3fSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
95381bedbe3fSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
95391bedbe3fSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
95401bedbe3fSmrg# than defined and empty).
95411bedbe3fSmrg#
95421bedbe3fSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
95431bedbe3fSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
95441bedbe3fSmrgm4_define([lt_append],
95451bedbe3fSmrg[m4_define([$1],
95461bedbe3fSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9547ba6a1819Smrg
9548ba6a1819Smrg
9549ba6a1819Smrg
95501bedbe3fSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
95511bedbe3fSmrg# ----------------------------------------------------------
95521bedbe3fSmrg# Produce a SEP delimited list of all paired combinations of elements of
95531bedbe3fSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
95541bedbe3fSmrg# has the form PREFIXmINFIXSUFFIXn.
95551bedbe3fSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
95561bedbe3fSmrgm4_define([lt_combine],
95571bedbe3fSmrg[m4_if(m4_eval([$# > 3]), [1],
95581bedbe3fSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
95591bedbe3fSmrg[[m4_foreach([_Lt_prefix], [$2],
95601bedbe3fSmrg	     [m4_foreach([_Lt_suffix],
95611bedbe3fSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
95621bedbe3fSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9563ba6a1819Smrg
9564ba6a1819Smrg
95651bedbe3fSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
95661bedbe3fSmrg# -----------------------------------------------------------------------
95671bedbe3fSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
95681bedbe3fSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
95691bedbe3fSmrgm4_define([lt_if_append_uniq],
95701bedbe3fSmrg[m4_ifdef([$1],
95711bedbe3fSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
95721bedbe3fSmrg		 [lt_append([$1], [$2], [$3])$4],
95731bedbe3fSmrg		 [$5])],
95741bedbe3fSmrg	  [lt_append([$1], [$2], [$3])$4])])
9575ba6a1819Smrg
9576ba6a1819Smrg
95771bedbe3fSmrg# lt_dict_add(DICT, KEY, VALUE)
95781bedbe3fSmrg# -----------------------------
95791bedbe3fSmrgm4_define([lt_dict_add],
95801bedbe3fSmrg[m4_define([$1($2)], [$3])])
9581ba6a1819Smrg
9582ba6a1819Smrg
95831bedbe3fSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
95841bedbe3fSmrg# --------------------------------------------
95851bedbe3fSmrgm4_define([lt_dict_add_subkey],
95861bedbe3fSmrg[m4_define([$1($2:$3)], [$4])])
9587ba6a1819Smrg
9588ba6a1819Smrg
95891bedbe3fSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
95901bedbe3fSmrg# ----------------------------------
95911bedbe3fSmrgm4_define([lt_dict_fetch],
95921bedbe3fSmrg[m4_ifval([$3],
95931bedbe3fSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
95941bedbe3fSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9595ba6a1819Smrg
9596ba6a1819Smrg
95971bedbe3fSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
95981bedbe3fSmrg# -----------------------------------------------------------------
95991bedbe3fSmrgm4_define([lt_if_dict_fetch],
96001bedbe3fSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
96011bedbe3fSmrg	[$5],
96021bedbe3fSmrg    [$6])])
9603ba6a1819Smrg
9604ba6a1819Smrg
96051bedbe3fSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
96061bedbe3fSmrg# --------------------------------------------------------------
96071bedbe3fSmrgm4_define([lt_dict_filter],
96081bedbe3fSmrg[m4_if([$5], [], [],
96091bedbe3fSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
96101bedbe3fSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
96111bedbe3fSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
96121bedbe3fSmrg])
9613549e21daSmrg
96141bedbe3fSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
96151bedbe3fSmrg#
96161bedbe3fSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
96171bedbe3fSmrg#   Written by Scott James Remnant, 2004
96181bedbe3fSmrg#
96191bedbe3fSmrg# This file is free software; the Free Software Foundation gives
96201bedbe3fSmrg# unlimited permission to copy and/or distribute it, with or without
96211bedbe3fSmrg# modifications, as long as this notice is preserved.
9622ba6a1819Smrg
96231bedbe3fSmrg# @configure_input@
9624549e21daSmrg
96251bedbe3fSmrg# serial 3337 ltversion.m4
96261bedbe3fSmrg# This file is part of GNU Libtool
9627549e21daSmrg
96281bedbe3fSmrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
96291bedbe3fSmrgm4_define([LT_PACKAGE_REVISION], [1.3337])
96301bedbe3fSmrg
96311bedbe3fSmrgAC_DEFUN([LTVERSION_VERSION],
96321bedbe3fSmrg[macro_version='2.4.2'
96331bedbe3fSmrgmacro_revision='1.3337'
96341bedbe3fSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
96351bedbe3fSmrg_LT_DECL(, macro_revision, 0)
9636549e21daSmrg])
9637549e21daSmrg
96381bedbe3fSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
96391bedbe3fSmrg#
96401bedbe3fSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
96411bedbe3fSmrg#   Written by Scott James Remnant, 2004.
96421bedbe3fSmrg#
96431bedbe3fSmrg# This file is free software; the Free Software Foundation gives
96441bedbe3fSmrg# unlimited permission to copy and/or distribute it, with or without
96451bedbe3fSmrg# modifications, as long as this notice is preserved.
9646549e21daSmrg
96471bedbe3fSmrg# serial 5 lt~obsolete.m4
9648549e21daSmrg
96491bedbe3fSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
96501bedbe3fSmrg#
96511bedbe3fSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
96521bedbe3fSmrg# which have later been changed to m4_define as they aren't part of the
96531bedbe3fSmrg# exported API, or moved to Autoconf or Automake where they belong.
96541bedbe3fSmrg#
96551bedbe3fSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
96561bedbe3fSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
96571bedbe3fSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
96581bedbe3fSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
96591bedbe3fSmrg# and doesn't know about Autoconf macros at all.)
96601bedbe3fSmrg#
96611bedbe3fSmrg# So we provide this file, which has a silly filename so it's always
96621bedbe3fSmrg# included after everything else.  This provides aclocal with the
96631bedbe3fSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
96641bedbe3fSmrg# because those macros already exist, or will be overwritten later.
96651bedbe3fSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
96661bedbe3fSmrg#
96671bedbe3fSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
96681bedbe3fSmrg# Yes, that means every name once taken will need to remain here until
96691bedbe3fSmrg# we give up compatibility with versions before 1.7, at which point
96701bedbe3fSmrg# we need to keep only those names which we still refer to.
9671549e21daSmrg
96721bedbe3fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
96731bedbe3fSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
96741bedbe3fSmrg
96751bedbe3fSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
96761bedbe3fSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
96771bedbe3fSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
96781bedbe3fSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
96791bedbe3fSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
96801bedbe3fSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
96811bedbe3fSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
96821bedbe3fSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
96831bedbe3fSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
96841bedbe3fSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
96851bedbe3fSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
96861bedbe3fSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
96871bedbe3fSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
96881bedbe3fSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
96891bedbe3fSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
96901bedbe3fSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
96911bedbe3fSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
96921bedbe3fSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
96931bedbe3fSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
96941bedbe3fSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
96951bedbe3fSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
96961bedbe3fSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
96971bedbe3fSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
96981bedbe3fSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
96991bedbe3fSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
97001bedbe3fSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
97011bedbe3fSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
97021bedbe3fSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
97031bedbe3fSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
97041bedbe3fSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
97051bedbe3fSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
97061bedbe3fSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
97071bedbe3fSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
97081bedbe3fSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
97091bedbe3fSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
97101bedbe3fSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
97111bedbe3fSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
97121bedbe3fSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
97131bedbe3fSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
97141bedbe3fSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
97151bedbe3fSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
97161bedbe3fSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
97171bedbe3fSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
97181bedbe3fSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
97191bedbe3fSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
97201bedbe3fSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
97211bedbe3fSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
97221bedbe3fSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
97231bedbe3fSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
97241bedbe3fSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
97251bedbe3fSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
97261bedbe3fSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
97271bedbe3fSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
97281bedbe3fSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
97291bedbe3fSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
97301bedbe3fSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
97311bedbe3fSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
97321bedbe3fSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
97331bedbe3fSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
97341bedbe3fSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
97351bedbe3fSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
97361bedbe3fSmrg
97371bedbe3fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
97381bedbe3fSmrg# 
97391bedbe3fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
97401bedbe3fSmrg#
97411bedbe3fSmrg# This program is free software; you can redistribute it and/or modify
97421bedbe3fSmrg# it under the terms of the GNU General Public License as published by
97431bedbe3fSmrg# the Free Software Foundation; either version 2 of the License, or
97441bedbe3fSmrg# (at your option) any later version.
97451bedbe3fSmrg#
97461bedbe3fSmrg# This program is distributed in the hope that it will be useful, but
97471bedbe3fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
97481bedbe3fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
97491bedbe3fSmrg# General Public License for more details.
97501bedbe3fSmrg#
97511bedbe3fSmrg# You should have received a copy of the GNU General Public License
97521bedbe3fSmrg# along with this program; if not, write to the Free Software
97531bedbe3fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
97541bedbe3fSmrg#
97551bedbe3fSmrg# As a special exception to the GNU General Public License, if you
97561bedbe3fSmrg# distribute this file as part of a program that contains a
97571bedbe3fSmrg# configuration script generated by Autoconf, you may include it under
97581bedbe3fSmrg# the same distribution terms that you use for the rest of that program.
9759549e21daSmrg
97601bedbe3fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
97611bedbe3fSmrg# ----------------------------------
97621bedbe3fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
97631bedbe3fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
97641bedbe3fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
97651bedbe3fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
97661bedbe3fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
97671bedbe3fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
97681bedbe3fSmrgfi
97691bedbe3fSmrgif test -n "$PKG_CONFIG"; then
97701bedbe3fSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
97711bedbe3fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
97721bedbe3fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
97731bedbe3fSmrg		AC_MSG_RESULT([yes])
97741bedbe3fSmrg	else
97751bedbe3fSmrg		AC_MSG_RESULT([no])
97761bedbe3fSmrg		PKG_CONFIG=""
97771bedbe3fSmrg	fi
97781bedbe3fSmrg		
97791bedbe3fSmrgfi[]dnl
97801bedbe3fSmrg])# PKG_PROG_PKG_CONFIG
9781549e21daSmrg
97821bedbe3fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
97831bedbe3fSmrg#
97841bedbe3fSmrg# Check to see whether a particular set of modules exists.  Similar
97851bedbe3fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
97861bedbe3fSmrg#
97871bedbe3fSmrg#
97881bedbe3fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
97891bedbe3fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
97901bedbe3fSmrg# PKG_CHECK_EXISTS manually
97911bedbe3fSmrg# --------------------------------------------------------------
97921bedbe3fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
97931bedbe3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
97941bedbe3fSmrgif test -n "$PKG_CONFIG" && \
97951bedbe3fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
97961bedbe3fSmrg  m4_ifval([$2], [$2], [:])
97971bedbe3fSmrgm4_ifvaln([$3], [else
97981bedbe3fSmrg  $3])dnl
97991bedbe3fSmrgfi])
9800549e21daSmrg
9801549e21daSmrg
98021bedbe3fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
98031bedbe3fSmrg# ---------------------------------------------
98041bedbe3fSmrgm4_define([_PKG_CONFIG],
98051bedbe3fSmrg[if test -n "$$1"; then
98061bedbe3fSmrg    pkg_cv_[]$1="$$1"
98071bedbe3fSmrg elif test -n "$PKG_CONFIG"; then
98081bedbe3fSmrg    PKG_CHECK_EXISTS([$3],
98091bedbe3fSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
98101bedbe3fSmrg		     [pkg_failed=yes])
98111bedbe3fSmrg else
98121bedbe3fSmrg    pkg_failed=untried
98131bedbe3fSmrgfi[]dnl
98141bedbe3fSmrg])# _PKG_CONFIG
9815549e21daSmrg
98161bedbe3fSmrg# _PKG_SHORT_ERRORS_SUPPORTED
98171bedbe3fSmrg# -----------------------------
98181bedbe3fSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
98191bedbe3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
98201bedbe3fSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
98211bedbe3fSmrg        _pkg_short_errors_supported=yes
98221bedbe3fSmrgelse
98231bedbe3fSmrg        _pkg_short_errors_supported=no
98241bedbe3fSmrgfi[]dnl
98251bedbe3fSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
9826549e21daSmrg
9827549e21daSmrg
98281bedbe3fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
98291bedbe3fSmrg# [ACTION-IF-NOT-FOUND])
98301bedbe3fSmrg#
98311bedbe3fSmrg#
98321bedbe3fSmrg# Note that if there is a possibility the first call to
98331bedbe3fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
98341bedbe3fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
98351bedbe3fSmrg#
98361bedbe3fSmrg#
98371bedbe3fSmrg# --------------------------------------------------------------
98381bedbe3fSmrgAC_DEFUN([PKG_CHECK_MODULES],
98391bedbe3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
98401bedbe3fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
98411bedbe3fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9842549e21daSmrg
98431bedbe3fSmrgpkg_failed=no
98441bedbe3fSmrgAC_MSG_CHECKING([for $1])
9845ba6a1819Smrg
98461bedbe3fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
98471bedbe3fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9848ba6a1819Smrg
98491bedbe3fSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
98501bedbe3fSmrgand $1[]_LIBS to avoid the need to call pkg-config.
98511bedbe3fSmrgSee the pkg-config man page for more details.])
9852549e21daSmrg
98531bedbe3fSmrgif test $pkg_failed = yes; then
98541bedbe3fSmrg        _PKG_SHORT_ERRORS_SUPPORTED
98551bedbe3fSmrg        if test $_pkg_short_errors_supported = yes; then
98561bedbe3fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
98571bedbe3fSmrg        else 
98581bedbe3fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
98591bedbe3fSmrg        fi
98601bedbe3fSmrg	# Put the nasty error message in config.log where it belongs
98611bedbe3fSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9862549e21daSmrg
98631bedbe3fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
98641bedbe3fSmrg[Package requirements ($2) were not met:
9865549e21daSmrg
98661bedbe3fSmrg$$1_PKG_ERRORS
9867549e21daSmrg
98681bedbe3fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
98691bedbe3fSmrginstalled software in a non-standard prefix.
9870549e21daSmrg
98711bedbe3fSmrg_PKG_TEXT
98721bedbe3fSmrg])],
98731bedbe3fSmrg		[AC_MSG_RESULT([no])
98741bedbe3fSmrg                $4])
98751bedbe3fSmrgelif test $pkg_failed = untried; then
98761bedbe3fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
98771bedbe3fSmrg[The pkg-config script could not be found or is too old.  Make sure it
98781bedbe3fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
98791bedbe3fSmrgpath to pkg-config.
9880549e21daSmrg
98811bedbe3fSmrg_PKG_TEXT
9882549e21daSmrg
98831bedbe3fSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
98841bedbe3fSmrg		[$4])
98851bedbe3fSmrgelse
98861bedbe3fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
98871bedbe3fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
98881bedbe3fSmrg        AC_MSG_RESULT([yes])
98891bedbe3fSmrg	ifelse([$3], , :, [$3])
98901bedbe3fSmrgfi[]dnl
98911bedbe3fSmrg])# PKG_CHECK_MODULES
9892549e21daSmrg
98931bedbe3fSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
98941bedbe3fSmrgdnl
98951bedbe3fSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
98966af7124fSmrgdnl
98971bedbe3fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
98981bedbe3fSmrgdnl copy of this software and associated documentation files (the "Software"),
98991bedbe3fSmrgdnl to deal in the Software without restriction, including without limitation
99001bedbe3fSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
99011bedbe3fSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
99021bedbe3fSmrgdnl Software is furnished to do so, subject to the following conditions:
99031bedbe3fSmrgdnl
99041bedbe3fSmrgdnl The above copyright notice and this permission notice (including the next
99051bedbe3fSmrgdnl paragraph) shall be included in all copies or substantial portions of the
99061bedbe3fSmrgdnl Software.
99071bedbe3fSmrgdnl
99081bedbe3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
99091bedbe3fSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
99101bedbe3fSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
99111bedbe3fSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
99121bedbe3fSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
99131bedbe3fSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
99141bedbe3fSmrgdnl DEALINGS IN THE SOFTWARE.
9915ba6a1819Smrg
99161bedbe3fSmrg# XORG_MACROS_VERSION(required-version)
99171bedbe3fSmrg# -------------------------------------
99181bedbe3fSmrg# Minimum version: 1.1.0
99191bedbe3fSmrg#
99201bedbe3fSmrg# If you're using a macro added in Version 1.1 or newer, include this in
99211bedbe3fSmrg# your configure.ac with the minimum required version, such as:
99221bedbe3fSmrg# XORG_MACROS_VERSION(1.1)
99231bedbe3fSmrg#
99241bedbe3fSmrg# To ensure that this macro is defined, also add:
99251bedbe3fSmrg# m4_ifndef([XORG_MACROS_VERSION],
99261bedbe3fSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
99271bedbe3fSmrg#
99281bedbe3fSmrg#
99296af7124fSmrg# See the "minimum version" comment for each macro you use to see what
99301bedbe3fSmrg# version you require.
99311bedbe3fSmrgm4_defun([XORG_MACROS_VERSION],[
99326af7124fSmrgm4_define([vers_have], [1.18.0])
99331bedbe3fSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
99341bedbe3fSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
99351bedbe3fSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
99361bedbe3fSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
99371bedbe3fSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
99381bedbe3fSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
99391bedbe3fSmrgm4_undefine([vers_have])
99401bedbe3fSmrgm4_undefine([maj_have])
99411bedbe3fSmrgm4_undefine([maj_needed])
99421bedbe3fSmrg]) # XORG_MACROS_VERSION
9943ba6a1819Smrg
99441bedbe3fSmrg# XORG_PROG_RAWCPP()
99451bedbe3fSmrg# ------------------
99461bedbe3fSmrg# Minimum version: 1.0.0
99471bedbe3fSmrg#
99481bedbe3fSmrg# Find cpp program and necessary flags for use in pre-processing text files
99491bedbe3fSmrg# such as man pages and config files
99501bedbe3fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
99511bedbe3fSmrgAC_REQUIRE([AC_PROG_CPP])
99526af7124fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
99531bedbe3fSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9954ba6a1819Smrg
99551bedbe3fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
99561bedbe3fSmrg# which is not the best choice for supporting other OS'es, but covers most
99571bedbe3fSmrg# of the ones we need for now.
99581bedbe3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
99591bedbe3fSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
99601bedbe3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99611bedbe3fSmrg	AC_MSG_RESULT([no])
99621bedbe3fSmrgelse
99631bedbe3fSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99641bedbe3fSmrg		RAWCPPFLAGS=-undef
99651bedbe3fSmrg		AC_MSG_RESULT([yes])
99661bedbe3fSmrg	# under Cygwin unix is still defined even with -undef
99671bedbe3fSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99681bedbe3fSmrg		RAWCPPFLAGS="-undef -ansi"
99691bedbe3fSmrg		AC_MSG_RESULT([yes, with -ansi])
99701bedbe3fSmrg	else
99711bedbe3fSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
99721bedbe3fSmrg	fi
99731bedbe3fSmrgfi
99741bedbe3fSmrgrm -f conftest.$ac_ext
9975ba6a1819Smrg
99761bedbe3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
99771bedbe3fSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
99781bedbe3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
99791bedbe3fSmrg	AC_MSG_RESULT([no])
99801bedbe3fSmrgelse
99811bedbe3fSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
99821bedbe3fSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
99831bedbe3fSmrg		AC_MSG_RESULT([yes])
99841bedbe3fSmrg	else
99851bedbe3fSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
99861bedbe3fSmrg	fi
99871bedbe3fSmrgfi
99881bedbe3fSmrgrm -f conftest.$ac_ext
99891bedbe3fSmrgAC_SUBST(RAWCPPFLAGS)
99901bedbe3fSmrg]) # XORG_PROG_RAWCPP
9991ba6a1819Smrg
99921bedbe3fSmrg# XORG_MANPAGE_SECTIONS()
99931bedbe3fSmrg# -----------------------
99941bedbe3fSmrg# Minimum version: 1.0.0
99951bedbe3fSmrg#
99961bedbe3fSmrg# Determine which sections man pages go in for the different man page types
99971bedbe3fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
99981bedbe3fSmrg# Not sure if there's any better way than just hardcoding by OS name.
99991bedbe3fSmrg# Override default settings by setting environment variables
100001bedbe3fSmrg# Added MAN_SUBSTS in version 1.8
100011bedbe3fSmrg# Added AC_PROG_SED in version 1.8
10002ba6a1819Smrg
100031bedbe3fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
100041bedbe3fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
100051bedbe3fSmrgAC_REQUIRE([AC_PROG_SED])
10006ba6a1819Smrg
100071bedbe3fSmrgif test x$APP_MAN_SUFFIX = x    ; then
100081bedbe3fSmrg    APP_MAN_SUFFIX=1
100091bedbe3fSmrgfi
100101bedbe3fSmrgif test x$APP_MAN_DIR = x    ; then
100111bedbe3fSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
100121bedbe3fSmrgfi
10013ba6a1819Smrg
100141bedbe3fSmrgif test x$LIB_MAN_SUFFIX = x    ; then
100151bedbe3fSmrg    LIB_MAN_SUFFIX=3
100161bedbe3fSmrgfi
100171bedbe3fSmrgif test x$LIB_MAN_DIR = x    ; then
100181bedbe3fSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
100191bedbe3fSmrgfi
10020ba6a1819Smrg
100211bedbe3fSmrgif test x$FILE_MAN_SUFFIX = x    ; then
100221bedbe3fSmrg    case $host_os in
100231bedbe3fSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
100241bedbe3fSmrg	*)		FILE_MAN_SUFFIX=5  ;;
100251bedbe3fSmrg    esac
100261bedbe3fSmrgfi
100271bedbe3fSmrgif test x$FILE_MAN_DIR = x    ; then
100281bedbe3fSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
100291bedbe3fSmrgfi
10030ba6a1819Smrg
100311bedbe3fSmrgif test x$MISC_MAN_SUFFIX = x    ; then
100321bedbe3fSmrg    case $host_os in
100331bedbe3fSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
100341bedbe3fSmrg	*)		MISC_MAN_SUFFIX=7  ;;
100351bedbe3fSmrg    esac
100361bedbe3fSmrgfi
100371bedbe3fSmrgif test x$MISC_MAN_DIR = x    ; then
100381bedbe3fSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
100391bedbe3fSmrgfi
10040549e21daSmrg
100411bedbe3fSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
100421bedbe3fSmrg    case $host_os in
100431bedbe3fSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
100441bedbe3fSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
100451bedbe3fSmrg    esac
100461bedbe3fSmrgfi
100471bedbe3fSmrgif test x$DRIVER_MAN_DIR = x    ; then
100481bedbe3fSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
100491bedbe3fSmrgfi
10050ba6a1819Smrg
100511bedbe3fSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
100521bedbe3fSmrg    case $host_os in
100531bedbe3fSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
100541bedbe3fSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
100551bedbe3fSmrg    esac
100561bedbe3fSmrgfi
100571bedbe3fSmrgif test x$ADMIN_MAN_DIR = x    ; then
100581bedbe3fSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
100591bedbe3fSmrgfi
10060ba6a1819Smrg
10061ba6a1819Smrg
100621bedbe3fSmrgAC_SUBST([APP_MAN_SUFFIX])
100631bedbe3fSmrgAC_SUBST([LIB_MAN_SUFFIX])
100641bedbe3fSmrgAC_SUBST([FILE_MAN_SUFFIX])
100651bedbe3fSmrgAC_SUBST([MISC_MAN_SUFFIX])
100661bedbe3fSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
100671bedbe3fSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
100681bedbe3fSmrgAC_SUBST([APP_MAN_DIR])
100691bedbe3fSmrgAC_SUBST([LIB_MAN_DIR])
100701bedbe3fSmrgAC_SUBST([FILE_MAN_DIR])
100711bedbe3fSmrgAC_SUBST([MISC_MAN_DIR])
100721bedbe3fSmrgAC_SUBST([DRIVER_MAN_DIR])
100731bedbe3fSmrgAC_SUBST([ADMIN_MAN_DIR])
10074ba6a1819Smrg
100751bedbe3fSmrgXORG_MAN_PAGE="X Version 11"
100761bedbe3fSmrgAC_SUBST([XORG_MAN_PAGE])
100771bedbe3fSmrgMAN_SUBSTS="\
100781bedbe3fSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
100791bedbe3fSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
100801bedbe3fSmrg	-e 's|__xservername__|Xorg|g' \
100811bedbe3fSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
100821bedbe3fSmrg	-e 's|__projectroot__|\$(prefix)|g' \
100831bedbe3fSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
100841bedbe3fSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
100851bedbe3fSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
100861bedbe3fSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
100871bedbe3fSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
100881bedbe3fSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
100891bedbe3fSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
100901bedbe3fSmrgAC_SUBST([MAN_SUBSTS])
10091ba6a1819Smrg
100921bedbe3fSmrg]) # XORG_MANPAGE_SECTIONS
10093ba6a1819Smrg
100941bedbe3fSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
100951bedbe3fSmrg# ------------------------
100961bedbe3fSmrg# Minimum version: 1.7.0
100971bedbe3fSmrg#
100981bedbe3fSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
100991bedbe3fSmrg# provided by xorg-sgml-doctools, if installed.
101001bedbe3fSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
101011bedbe3fSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
101021bedbe3fSmrgXORG_SGML_PATH=
101031bedbe3fSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
101041bedbe3fSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
101051bedbe3fSmrg    [m4_ifval([$1],[:],
101061bedbe3fSmrg        [if test x"$cross_compiling" != x"yes" ; then
101071bedbe3fSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
101081bedbe3fSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
101091bedbe3fSmrg         fi])
101101bedbe3fSmrg    ])
10111ba6a1819Smrg
101121bedbe3fSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
101131bedbe3fSmrg# the path and the name of the doc stylesheet
101141bedbe3fSmrgif test "x$XORG_SGML_PATH" != "x" ; then
101151bedbe3fSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
101161bedbe3fSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
101171bedbe3fSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
101181bedbe3fSmrgelse
101191bedbe3fSmrg   AC_MSG_RESULT([no])
101201bedbe3fSmrgfi
10121549e21daSmrg
101221bedbe3fSmrgAC_SUBST(XORG_SGML_PATH)
101231bedbe3fSmrgAC_SUBST(STYLESHEET_SRCDIR)
101241bedbe3fSmrgAC_SUBST(XSL_STYLESHEET)
101251bedbe3fSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
101261bedbe3fSmrg]) # XORG_CHECK_SGML_DOCTOOLS
10127ba6a1819Smrg
101281bedbe3fSmrg# XORG_CHECK_LINUXDOC
101291bedbe3fSmrg# -------------------
101301bedbe3fSmrg# Minimum version: 1.0.0
101311bedbe3fSmrg#
101321bedbe3fSmrg# Defines the variable MAKE_TEXT if the necessary tools and
101331bedbe3fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
101341bedbe3fSmrg# Whether or not the necessary tools and files are found can be checked
101351bedbe3fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
101361bedbe3fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
101371bedbe3fSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
101381bedbe3fSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
10139ba6a1819Smrg
101401bedbe3fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
10141ba6a1819Smrg
101421bedbe3fSmrgAC_MSG_CHECKING([whether to build documentation])
10143ba6a1819Smrg
101441bedbe3fSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
101451bedbe3fSmrg   BUILDDOC=yes
101461bedbe3fSmrgelse
101471bedbe3fSmrg   BUILDDOC=no
101481bedbe3fSmrgfi
10149ba6a1819Smrg
101501bedbe3fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10151ba6a1819Smrg
101521bedbe3fSmrgAC_MSG_RESULT([$BUILDDOC])
10153ba6a1819Smrg
101541bedbe3fSmrgAC_MSG_CHECKING([whether to build pdf documentation])
10155ba6a1819Smrg
101561bedbe3fSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
101571bedbe3fSmrg   BUILDPDFDOC=yes
101581bedbe3fSmrgelse
101591bedbe3fSmrg   BUILDPDFDOC=no
101601bedbe3fSmrgfi
10161549e21daSmrg
101621bedbe3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10163ba6a1819Smrg
101641bedbe3fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10165ba6a1819Smrg
101661bedbe3fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
101671bedbe3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
101681bedbe3fSmrgMAKE_PDF="$PS2PDF"
101691bedbe3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10170ba6a1819Smrg
101711bedbe3fSmrgAC_SUBST(MAKE_TEXT)
101721bedbe3fSmrgAC_SUBST(MAKE_PS)
101731bedbe3fSmrgAC_SUBST(MAKE_PDF)
101741bedbe3fSmrgAC_SUBST(MAKE_HTML)
101751bedbe3fSmrg]) # XORG_CHECK_LINUXDOC
10176549e21daSmrg
101771bedbe3fSmrg# XORG_CHECK_DOCBOOK
101781bedbe3fSmrg# -------------------
101791bedbe3fSmrg# Minimum version: 1.0.0
101801bedbe3fSmrg#
101811bedbe3fSmrg# Checks for the ability to build output formats from SGML DocBook source.
101821bedbe3fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
101831bedbe3fSmrg# indicates whether the necessary tools and files are found and, if set,
101841bedbe3fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
101851bedbe3fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
101861bedbe3fSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10187549e21daSmrg
101881bedbe3fSmrgBUILDTXTDOC=no
101891bedbe3fSmrgBUILDPDFDOC=no
101901bedbe3fSmrgBUILDPSDOC=no
101911bedbe3fSmrgBUILDHTMLDOC=no
10192ba6a1819Smrg
101931bedbe3fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
101941bedbe3fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
101951bedbe3fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
101961bedbe3fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10197ba6a1819Smrg
101981bedbe3fSmrgAC_MSG_CHECKING([whether to build text documentation])
101991bedbe3fSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
102001bedbe3fSmrg   test x$BUILD_TXTDOC != xno; then
102011bedbe3fSmrg	BUILDTXTDOC=yes
102021bedbe3fSmrgfi
102031bedbe3fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
102041bedbe3fSmrgAC_MSG_RESULT([$BUILDTXTDOC])
10205549e21daSmrg
102061bedbe3fSmrgAC_MSG_CHECKING([whether to build PDF documentation])
102071bedbe3fSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
102081bedbe3fSmrg   test x$BUILD_PDFDOC != xno; then
102091bedbe3fSmrg	BUILDPDFDOC=yes
102101bedbe3fSmrgfi
102111bedbe3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
102121bedbe3fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10213ba6a1819Smrg
102141bedbe3fSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
102151bedbe3fSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
102161bedbe3fSmrg   test x$BUILD_PSDOC != xno; then
102171bedbe3fSmrg	BUILDPSDOC=yes
102181bedbe3fSmrgfi
102191bedbe3fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
102201bedbe3fSmrgAC_MSG_RESULT([$BUILDPSDOC])
10221ba6a1819Smrg
102221bedbe3fSmrgAC_MSG_CHECKING([whether to build HTML documentation])
102231bedbe3fSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
102241bedbe3fSmrg   test x$BUILD_HTMLDOC != xno; then
102251bedbe3fSmrg	BUILDHTMLDOC=yes
102261bedbe3fSmrgfi
102271bedbe3fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
102281bedbe3fSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10229ba6a1819Smrg
102301bedbe3fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
102311bedbe3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
102321bedbe3fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
102331bedbe3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10234ba6a1819Smrg
102351bedbe3fSmrgAC_SUBST(MAKE_TEXT)
102361bedbe3fSmrgAC_SUBST(MAKE_PS)
102371bedbe3fSmrgAC_SUBST(MAKE_PDF)
102381bedbe3fSmrgAC_SUBST(MAKE_HTML)
102391bedbe3fSmrg]) # XORG_CHECK_DOCBOOK
10240ba6a1819Smrg
102411bedbe3fSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
102421bedbe3fSmrg# ----------------
102431bedbe3fSmrg# Minimum version: 1.5.0
102441bedbe3fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
102451bedbe3fSmrg#
102461bedbe3fSmrg# Documentation tools are not always available on all platforms and sometimes
102471bedbe3fSmrg# not at the appropriate level. This macro enables a module to test for the
102481bedbe3fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
102491bedbe3fSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
102501bedbe3fSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
102511bedbe3fSmrg# --with-xmlto assumes 'auto'.
102521bedbe3fSmrg#
102531bedbe3fSmrg# Interface to module:
102541bedbe3fSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
102551bedbe3fSmrg# XMLTO:	returns the path of the xmlto program found
102561bedbe3fSmrg#		returns the path set by the user in the environment
102571bedbe3fSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
102581bedbe3fSmrg#		'no' user instructs the module not to use xmlto
102591bedbe3fSmrg#
102601bedbe3fSmrg# Added in version 1.10.0
102611bedbe3fSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
102621bedbe3fSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
102631bedbe3fSmrg#
102641bedbe3fSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
102651bedbe3fSmrg#
102661bedbe3fSmrgAC_DEFUN([XORG_WITH_XMLTO],[
102671bedbe3fSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
102681bedbe3fSmrgm4_define([_defopt], m4_default([$2], [auto]))
102691bedbe3fSmrgAC_ARG_WITH(xmlto,
102701bedbe3fSmrg	AS_HELP_STRING([--with-xmlto],
102711bedbe3fSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
102721bedbe3fSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
102731bedbe3fSmrgm4_undefine([_defopt])
10274ba6a1819Smrg
102751bedbe3fSmrgif test "x$use_xmlto" = x"auto"; then
102761bedbe3fSmrg   AC_PATH_PROG([XMLTO], [xmlto])
102771bedbe3fSmrg   if test "x$XMLTO" = "x"; then
102781bedbe3fSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
102791bedbe3fSmrg	have_xmlto=no
102801bedbe3fSmrg   else
102811bedbe3fSmrg        have_xmlto=yes
102821bedbe3fSmrg   fi
102831bedbe3fSmrgelif test "x$use_xmlto" = x"yes" ; then
102841bedbe3fSmrg   AC_PATH_PROG([XMLTO], [xmlto])
102851bedbe3fSmrg   if test "x$XMLTO" = "x"; then
102861bedbe3fSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
102871bedbe3fSmrg   fi
102881bedbe3fSmrg   have_xmlto=yes
102891bedbe3fSmrgelif test "x$use_xmlto" = x"no" ; then
102901bedbe3fSmrg   if test "x$XMLTO" != "x"; then
102911bedbe3fSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
102921bedbe3fSmrg   fi
102931bedbe3fSmrg   have_xmlto=no
102941bedbe3fSmrgelse
102951bedbe3fSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
102961bedbe3fSmrgfi
10297ba6a1819Smrg
102981bedbe3fSmrg# Test for a minimum version of xmlto, if provided.
102991bedbe3fSmrgm4_ifval([$1],
103001bedbe3fSmrg[if test "$have_xmlto" = yes; then
103011bedbe3fSmrg    # scrape the xmlto version
103021bedbe3fSmrg    AC_MSG_CHECKING([the xmlto version])
103031bedbe3fSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
103041bedbe3fSmrg    AC_MSG_RESULT([$xmlto_version])
103051bedbe3fSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
103061bedbe3fSmrg        [if test "x$use_xmlto" = xauto; then
103071bedbe3fSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
103081bedbe3fSmrg            have_xmlto=no
103091bedbe3fSmrg        else
103101bedbe3fSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
103111bedbe3fSmrg        fi])
103121bedbe3fSmrgfi])
10313ba6a1819Smrg
103141bedbe3fSmrg# Test for the ability of xmlto to generate a text target
103151bedbe3fSmrghave_xmlto_text=no
103161bedbe3fSmrgcat > conftest.xml << "EOF"
103171bedbe3fSmrgEOF
103181bedbe3fSmrgAS_IF([test "$have_xmlto" = yes],
103191bedbe3fSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
103201bedbe3fSmrg             [have_xmlto_text=yes],
103211bedbe3fSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
103221bedbe3fSmrgrm -f conftest.xml
103231bedbe3fSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
103241bedbe3fSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
103251bedbe3fSmrg]) # XORG_WITH_XMLTO
10326ba6a1819Smrg
103271bedbe3fSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
103281bedbe3fSmrg# --------------------------------------------
103291bedbe3fSmrg# Minimum version: 1.12.0
103301bedbe3fSmrg# Minimum version for optional DEFAULT argument: 1.12.0
103311bedbe3fSmrg#
103321bedbe3fSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
103331bedbe3fSmrg# XML-based language used for the transformation of XML documents.
103341bedbe3fSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
103351bedbe3fSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
103361bedbe3fSmrg# The XSLT processor is often used as a standalone tool for transformations.
103371bedbe3fSmrg# It should not be assumed that this tool is used only to work with documnetation.
103381bedbe3fSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
103391bedbe3fSmrg#
103401bedbe3fSmrg# Interface to module:
103411bedbe3fSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
103421bedbe3fSmrg# XSLTPROC:	 returns the path of the xsltproc program found
103431bedbe3fSmrg#		 returns the path set by the user in the environment
103441bedbe3fSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
103451bedbe3fSmrg#		  'no' user instructs the module not to use xsltproc
103461bedbe3fSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
103471bedbe3fSmrg#
103481bedbe3fSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
103491bedbe3fSmrg#
103501bedbe3fSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
103511bedbe3fSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
103521bedbe3fSmrg# Preserves the interface, should it be implemented later
103531bedbe3fSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
103541bedbe3fSmrgm4_define([_defopt], m4_default([$2], [auto]))
103551bedbe3fSmrgAC_ARG_WITH(xsltproc,
103561bedbe3fSmrg	AS_HELP_STRING([--with-xsltproc],
103571bedbe3fSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
103581bedbe3fSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
103591bedbe3fSmrgm4_undefine([_defopt])
103601bedbe3fSmrg
103611bedbe3fSmrgif test "x$use_xsltproc" = x"auto"; then
103621bedbe3fSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
103631bedbe3fSmrg   if test "x$XSLTPROC" = "x"; then
103641bedbe3fSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
103651bedbe3fSmrg	have_xsltproc=no
103661bedbe3fSmrg   else
103671bedbe3fSmrg        have_xsltproc=yes
103681bedbe3fSmrg   fi
103691bedbe3fSmrgelif test "x$use_xsltproc" = x"yes" ; then
103701bedbe3fSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
103711bedbe3fSmrg   if test "x$XSLTPROC" = "x"; then
103721bedbe3fSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
103731bedbe3fSmrg   fi
103741bedbe3fSmrg   have_xsltproc=yes
103751bedbe3fSmrgelif test "x$use_xsltproc" = x"no" ; then
103761bedbe3fSmrg   if test "x$XSLTPROC" != "x"; then
103771bedbe3fSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
103781bedbe3fSmrg   fi
103791bedbe3fSmrg   have_xsltproc=no
103801bedbe3fSmrgelse
103811bedbe3fSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
103821bedbe3fSmrgfi
10383ba6a1819Smrg
103841bedbe3fSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
103851bedbe3fSmrg]) # XORG_WITH_XSLTPROC
10386ba6a1819Smrg
103871bedbe3fSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
103881bedbe3fSmrg# ----------------------------------------
103891bedbe3fSmrg# Minimum version: 1.15.0
103901bedbe3fSmrg#
103911bedbe3fSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
103921bedbe3fSmrg# scanning arbitrary text files, extracting information from those text files,
103931bedbe3fSmrg# and printing reports based on that information.
103941bedbe3fSmrg#
103951bedbe3fSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
103961bedbe3fSmrg#
103971bedbe3fSmrg# Interface to module:
103981bedbe3fSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
103991bedbe3fSmrg# PERL:	     returns the path of the perl program found
104001bedbe3fSmrg#	     returns the path set by the user in the environment
104011bedbe3fSmrg# --with-perl: 'yes' user instructs the module to use perl
104021bedbe3fSmrg#	       'no' user instructs the module not to use perl
104031bedbe3fSmrg# have_perl: returns yes if perl found in PATH or no
104041bedbe3fSmrg#
104051bedbe3fSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
104061bedbe3fSmrg#
104071bedbe3fSmrgAC_DEFUN([XORG_WITH_PERL],[
104081bedbe3fSmrgAC_ARG_VAR([PERL], [Path to perl command])
104091bedbe3fSmrg# Preserves the interface, should it be implemented later
104101bedbe3fSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
104111bedbe3fSmrgm4_define([_defopt], m4_default([$2], [auto]))
104121bedbe3fSmrgAC_ARG_WITH(perl,
104131bedbe3fSmrg	AS_HELP_STRING([--with-perl],
104141bedbe3fSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
104151bedbe3fSmrg	   [use_perl=$withval], [use_perl=]_defopt)
104161bedbe3fSmrgm4_undefine([_defopt])
104171bedbe3fSmrg
104181bedbe3fSmrgif test "x$use_perl" = x"auto"; then
104191bedbe3fSmrg   AC_PATH_PROG([PERL], [perl])
104201bedbe3fSmrg   if test "x$PERL" = "x"; then
104211bedbe3fSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
104221bedbe3fSmrg	have_perl=no
104231bedbe3fSmrg   else
104241bedbe3fSmrg        have_perl=yes
104251bedbe3fSmrg   fi
104261bedbe3fSmrgelif test "x$use_perl" = x"yes" ; then
104271bedbe3fSmrg   AC_PATH_PROG([PERL], [perl])
104281bedbe3fSmrg   if test "x$PERL" = "x"; then
104291bedbe3fSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
104301bedbe3fSmrg   fi
104311bedbe3fSmrg   have_perl=yes
104321bedbe3fSmrgelif test "x$use_perl" = x"no" ; then
104331bedbe3fSmrg   if test "x$PERL" != "x"; then
104341bedbe3fSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
104351bedbe3fSmrg   fi
104361bedbe3fSmrg   have_perl=no
104371bedbe3fSmrgelse
104381bedbe3fSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
104391bedbe3fSmrgfi
10440ba6a1819Smrg
104411bedbe3fSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
104421bedbe3fSmrg]) # XORG_WITH_PERL
10443ba6a1819Smrg
104441bedbe3fSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
104451bedbe3fSmrg# ----------------
104461bedbe3fSmrg# Minimum version: 1.5.0
104471bedbe3fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
104481bedbe3fSmrg#
104491bedbe3fSmrg# Documentation tools are not always available on all platforms and sometimes
104501bedbe3fSmrg# not at the appropriate level. This macro enables a module to test for the
104511bedbe3fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
104521bedbe3fSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
104531bedbe3fSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
104541bedbe3fSmrg# --with-asciidoc assumes 'auto'.
104551bedbe3fSmrg#
104561bedbe3fSmrg# Interface to module:
104571bedbe3fSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
104581bedbe3fSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
104591bedbe3fSmrg#		 returns the path set by the user in the environment
104601bedbe3fSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
104611bedbe3fSmrg#		  'no' user instructs the module not to use asciidoc
104621bedbe3fSmrg#
104631bedbe3fSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
104641bedbe3fSmrg#
104651bedbe3fSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
104661bedbe3fSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
104671bedbe3fSmrgm4_define([_defopt], m4_default([$2], [auto]))
104681bedbe3fSmrgAC_ARG_WITH(asciidoc,
104691bedbe3fSmrg	AS_HELP_STRING([--with-asciidoc],
104701bedbe3fSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
104711bedbe3fSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
104721bedbe3fSmrgm4_undefine([_defopt])
10473ba6a1819Smrg
104741bedbe3fSmrgif test "x$use_asciidoc" = x"auto"; then
104751bedbe3fSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
104761bedbe3fSmrg   if test "x$ASCIIDOC" = "x"; then
104771bedbe3fSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
104781bedbe3fSmrg	have_asciidoc=no
104791bedbe3fSmrg   else
104801bedbe3fSmrg        have_asciidoc=yes
104811bedbe3fSmrg   fi
104821bedbe3fSmrgelif test "x$use_asciidoc" = x"yes" ; then
104831bedbe3fSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
104841bedbe3fSmrg   if test "x$ASCIIDOC" = "x"; then
104851bedbe3fSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
104861bedbe3fSmrg   fi
104871bedbe3fSmrg   have_asciidoc=yes
104881bedbe3fSmrgelif test "x$use_asciidoc" = x"no" ; then
104891bedbe3fSmrg   if test "x$ASCIIDOC" != "x"; then
104901bedbe3fSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
104911bedbe3fSmrg   fi
104921bedbe3fSmrg   have_asciidoc=no
104931bedbe3fSmrgelse
104941bedbe3fSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
104951bedbe3fSmrgfi
104961bedbe3fSmrgm4_ifval([$1],
104971bedbe3fSmrg[if test "$have_asciidoc" = yes; then
104981bedbe3fSmrg    # scrape the asciidoc version
104991bedbe3fSmrg    AC_MSG_CHECKING([the asciidoc version])
105001bedbe3fSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
105011bedbe3fSmrg    AC_MSG_RESULT([$asciidoc_version])
105021bedbe3fSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
105031bedbe3fSmrg        [if test "x$use_asciidoc" = xauto; then
105041bedbe3fSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
105051bedbe3fSmrg            have_asciidoc=no
105061bedbe3fSmrg        else
105071bedbe3fSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
105081bedbe3fSmrg        fi])
105091bedbe3fSmrgfi])
105101bedbe3fSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
105111bedbe3fSmrg]) # XORG_WITH_ASCIIDOC
10512ba6a1819Smrg
105131bedbe3fSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
105146af7124fSmrg# -------------------------------------------
105151bedbe3fSmrg# Minimum version: 1.5.0
105161bedbe3fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
105176af7124fSmrg# Minimum version for optional DOT checking: 1.18.0
105181bedbe3fSmrg#
105191bedbe3fSmrg# Documentation tools are not always available on all platforms and sometimes
105201bedbe3fSmrg# not at the appropriate level. This macro enables a module to test for the
105211bedbe3fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
105221bedbe3fSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
105231bedbe3fSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
105241bedbe3fSmrg# --with-doxygen assumes 'auto'.
105251bedbe3fSmrg#
105261bedbe3fSmrg# Interface to module:
105271bedbe3fSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
105281bedbe3fSmrg# DOXYGEN:	 returns the path of the doxygen program found
105291bedbe3fSmrg#		 returns the path set by the user in the environment
105301bedbe3fSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
105311bedbe3fSmrg#		  'no' user instructs the module not to use doxygen
105321bedbe3fSmrg#
105331bedbe3fSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
105341bedbe3fSmrg#
105351bedbe3fSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
105361bedbe3fSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
105376af7124fSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
105381bedbe3fSmrgm4_define([_defopt], m4_default([$2], [auto]))
105391bedbe3fSmrgAC_ARG_WITH(doxygen,
105401bedbe3fSmrg	AS_HELP_STRING([--with-doxygen],
105411bedbe3fSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
105421bedbe3fSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
105431bedbe3fSmrgm4_undefine([_defopt])
10544ba6a1819Smrg
105451bedbe3fSmrgif test "x$use_doxygen" = x"auto"; then
105461bedbe3fSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
105471bedbe3fSmrg   if test "x$DOXYGEN" = "x"; then
105481bedbe3fSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
105491bedbe3fSmrg	have_doxygen=no
105501bedbe3fSmrg   else
105511bedbe3fSmrg        have_doxygen=yes
105521bedbe3fSmrg   fi
105531bedbe3fSmrgelif test "x$use_doxygen" = x"yes" ; then
105541bedbe3fSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
105551bedbe3fSmrg   if test "x$DOXYGEN" = "x"; then
105561bedbe3fSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
105571bedbe3fSmrg   fi
105581bedbe3fSmrg   have_doxygen=yes
105591bedbe3fSmrgelif test "x$use_doxygen" = x"no" ; then
105601bedbe3fSmrg   if test "x$DOXYGEN" != "x"; then
105611bedbe3fSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
105621bedbe3fSmrg   fi
105631bedbe3fSmrg   have_doxygen=no
105641bedbe3fSmrgelse
105651bedbe3fSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
105661bedbe3fSmrgfi
105671bedbe3fSmrgm4_ifval([$1],
105681bedbe3fSmrg[if test "$have_doxygen" = yes; then
105691bedbe3fSmrg    # scrape the doxygen version
105701bedbe3fSmrg    AC_MSG_CHECKING([the doxygen version])
105711bedbe3fSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
105721bedbe3fSmrg    AC_MSG_RESULT([$doxygen_version])
105731bedbe3fSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
105741bedbe3fSmrg        [if test "x$use_doxygen" = xauto; then
105751bedbe3fSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
105761bedbe3fSmrg            have_doxygen=no
105771bedbe3fSmrg        else
105781bedbe3fSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
105791bedbe3fSmrg        fi])
105801bedbe3fSmrgfi])
105816af7124fSmrg
105826af7124fSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
105836af7124fSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
105846af7124fSmrgdnl 	HAVE_DOT = @HAVE_DOT@
105856af7124fSmrgHAVE_DOT=no
105866af7124fSmrgif test "x$have_doxygen" = "xyes"; then
105876af7124fSmrg  AC_PATH_PROG([DOT], [dot])
105886af7124fSmrg    if test "x$DOT" != "x"; then
105896af7124fSmrg      HAVE_DOT=yes
105906af7124fSmrg    fi
105916af7124fSmrgfi
105926af7124fSmrg
105936af7124fSmrgAC_SUBST([HAVE_DOT])
105946af7124fSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
105951bedbe3fSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
105961bedbe3fSmrg]) # XORG_WITH_DOXYGEN
10597ba6a1819Smrg
105981bedbe3fSmrg# XORG_WITH_GROFF([DEFAULT])
105991bedbe3fSmrg# ----------------
106001bedbe3fSmrg# Minimum version: 1.6.0
106011bedbe3fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
106021bedbe3fSmrg#
106031bedbe3fSmrg# Documentation tools are not always available on all platforms and sometimes
106041bedbe3fSmrg# not at the appropriate level. This macro enables a module to test for the
106051bedbe3fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
106061bedbe3fSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
106071bedbe3fSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
106081bedbe3fSmrg# --with-groff assumes 'auto'.
106091bedbe3fSmrg#
106101bedbe3fSmrg# Interface to module:
106111bedbe3fSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
106121bedbe3fSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
106131bedbe3fSmrg# HAVE_GROFF_MS: the -ms macros package
106141bedbe3fSmrg# GROFF:	 returns the path of the groff program found
106151bedbe3fSmrg#		 returns the path set by the user in the environment
106161bedbe3fSmrg# --with-groff:	 'yes' user instructs the module to use groff
106171bedbe3fSmrg#		 'no' user instructs the module not to use groff
106181bedbe3fSmrg#
106191bedbe3fSmrg# Added in version 1.9.0:
106201bedbe3fSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
106211bedbe3fSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
106221bedbe3fSmrg#		   psselect from the psutils package.
106231bedbe3fSmrg#		   the ghostcript package. Refer to the grohtml man pages
106241bedbe3fSmrg#
106251bedbe3fSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
106261bedbe3fSmrg#
106271bedbe3fSmrg# OS and distros often splits groff in a basic and full package, the former
106281bedbe3fSmrg# having the groff program and the later having devices, fonts and macros
106291bedbe3fSmrg# Checking for the groff executable is not enough.
106301bedbe3fSmrg#
106311bedbe3fSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
106321bedbe3fSmrg# unset HAVE_GROFF or GROFF env variables.
106331bedbe3fSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
106341bedbe3fSmrg#
106351bedbe3fSmrgAC_DEFUN([XORG_WITH_GROFF],[
106361bedbe3fSmrgAC_ARG_VAR([GROFF], [Path to groff command])
106371bedbe3fSmrgm4_define([_defopt], m4_default([$1], [auto]))
106381bedbe3fSmrgAC_ARG_WITH(groff,
106391bedbe3fSmrg	AS_HELP_STRING([--with-groff],
106401bedbe3fSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
106411bedbe3fSmrg	   [use_groff=$withval], [use_groff=]_defopt)
106421bedbe3fSmrgm4_undefine([_defopt])
10643ba6a1819Smrg
106441bedbe3fSmrgif test "x$use_groff" = x"auto"; then
106451bedbe3fSmrg   AC_PATH_PROG([GROFF], [groff])
106461bedbe3fSmrg   if test "x$GROFF" = "x"; then
106471bedbe3fSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
106481bedbe3fSmrg	have_groff=no
106491bedbe3fSmrg   else
106501bedbe3fSmrg        have_groff=yes
106511bedbe3fSmrg   fi
106521bedbe3fSmrgelif test "x$use_groff" = x"yes" ; then
106531bedbe3fSmrg   AC_PATH_PROG([GROFF], [groff])
106541bedbe3fSmrg   if test "x$GROFF" = "x"; then
106551bedbe3fSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
106561bedbe3fSmrg   fi
106571bedbe3fSmrg   have_groff=yes
106581bedbe3fSmrgelif test "x$use_groff" = x"no" ; then
106591bedbe3fSmrg   if test "x$GROFF" != "x"; then
106601bedbe3fSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
106611bedbe3fSmrg   fi
106621bedbe3fSmrg   have_groff=no
106631bedbe3fSmrgelse
106641bedbe3fSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
106651bedbe3fSmrgfi
10666ba6a1819Smrg
106671bedbe3fSmrg# We have groff, test for the presence of the macro packages
106681bedbe3fSmrgif test "x$have_groff" = x"yes"; then
106691bedbe3fSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
106701bedbe3fSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
106711bedbe3fSmrg        groff_ms_works=yes
106721bedbe3fSmrg    else
106731bedbe3fSmrg        groff_ms_works=no
106741bedbe3fSmrg    fi
106751bedbe3fSmrg    AC_MSG_RESULT([$groff_ms_works])
106761bedbe3fSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
106771bedbe3fSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
106781bedbe3fSmrg        groff_mm_works=yes
106791bedbe3fSmrg    else
106801bedbe3fSmrg        groff_mm_works=no
106811bedbe3fSmrg    fi
106821bedbe3fSmrg    AC_MSG_RESULT([$groff_mm_works])
106831bedbe3fSmrgfi
10684ba6a1819Smrg
106851bedbe3fSmrg# We have groff, test for HTML dependencies, one command per package
106861bedbe3fSmrgif test "x$have_groff" = x"yes"; then
106871bedbe3fSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
106881bedbe3fSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
106891bedbe3fSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
106901bedbe3fSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
106911bedbe3fSmrg      have_groff_html=yes
106921bedbe3fSmrg   else
106931bedbe3fSmrg      have_groff_html=no
106941bedbe3fSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
106951bedbe3fSmrg   fi
106961bedbe3fSmrgfi
10697ba6a1819Smrg
106981bedbe3fSmrg# Set Automake conditionals for Makefiles
106991bedbe3fSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
107001bedbe3fSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
107011bedbe3fSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
107021bedbe3fSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
107031bedbe3fSmrg]) # XORG_WITH_GROFF
10704ba6a1819Smrg
107051bedbe3fSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
107061bedbe3fSmrg# ---------------------------------------
107071bedbe3fSmrg# Minimum version: 1.6.0
107081bedbe3fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
107091bedbe3fSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
107101bedbe3fSmrg#
107111bedbe3fSmrg# Documentation tools are not always available on all platforms and sometimes
107121bedbe3fSmrg# not at the appropriate level. This macro enables a module to test for the
107131bedbe3fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
107141bedbe3fSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
107151bedbe3fSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
107161bedbe3fSmrg# --with-fop assumes 'auto'.
107171bedbe3fSmrg#
107181bedbe3fSmrg# Interface to module:
107191bedbe3fSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
107201bedbe3fSmrg# FOP:	 	returns the path of the fop program found
107211bedbe3fSmrg#		returns the path set by the user in the environment
107221bedbe3fSmrg# --with-fop: 	'yes' user instructs the module to use fop
107231bedbe3fSmrg#		'no' user instructs the module not to use fop
107241bedbe3fSmrg#
107251bedbe3fSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
107261bedbe3fSmrg#
107271bedbe3fSmrgAC_DEFUN([XORG_WITH_FOP],[
107281bedbe3fSmrgAC_ARG_VAR([FOP], [Path to fop command])
107291bedbe3fSmrgm4_define([_defopt], m4_default([$2], [auto]))
107301bedbe3fSmrgAC_ARG_WITH(fop,
107311bedbe3fSmrg	AS_HELP_STRING([--with-fop],
107321bedbe3fSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
107331bedbe3fSmrg	   [use_fop=$withval], [use_fop=]_defopt)
107341bedbe3fSmrgm4_undefine([_defopt])
10735ba6a1819Smrg
107361bedbe3fSmrgif test "x$use_fop" = x"auto"; then
107371bedbe3fSmrg   AC_PATH_PROG([FOP], [fop])
107381bedbe3fSmrg   if test "x$FOP" = "x"; then
107391bedbe3fSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
107401bedbe3fSmrg	have_fop=no
107411bedbe3fSmrg   else
107421bedbe3fSmrg        have_fop=yes
107431bedbe3fSmrg   fi
107441bedbe3fSmrgelif test "x$use_fop" = x"yes" ; then
107451bedbe3fSmrg   AC_PATH_PROG([FOP], [fop])
107461bedbe3fSmrg   if test "x$FOP" = "x"; then
107471bedbe3fSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
107481bedbe3fSmrg   fi
107491bedbe3fSmrg   have_fop=yes
107501bedbe3fSmrgelif test "x$use_fop" = x"no" ; then
107511bedbe3fSmrg   if test "x$FOP" != "x"; then
107521bedbe3fSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
107531bedbe3fSmrg   fi
107541bedbe3fSmrg   have_fop=no
107551bedbe3fSmrgelse
107561bedbe3fSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
107571bedbe3fSmrgfi
10758ba6a1819Smrg
107591bedbe3fSmrg# Test for a minimum version of fop, if provided.
107601bedbe3fSmrgm4_ifval([$1],
107611bedbe3fSmrg[if test "$have_fop" = yes; then
107621bedbe3fSmrg    # scrape the fop version
107631bedbe3fSmrg    AC_MSG_CHECKING([for fop minimum version])
107641bedbe3fSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
107651bedbe3fSmrg    AC_MSG_RESULT([$fop_version])
107661bedbe3fSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
107671bedbe3fSmrg        [if test "x$use_fop" = xauto; then
107681bedbe3fSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
107691bedbe3fSmrg            have_fop=no
107701bedbe3fSmrg        else
107711bedbe3fSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
107721bedbe3fSmrg        fi])
107731bedbe3fSmrgfi])
107741bedbe3fSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
107751bedbe3fSmrg]) # XORG_WITH_FOP
10776ba6a1819Smrg
107776af7124fSmrg# XORG_WITH_M4([MIN-VERSION])
107786af7124fSmrg# ---------------------------
107796af7124fSmrg# Minimum version: 1.19.0
107806af7124fSmrg#
107816af7124fSmrg# This macro attempts to locate an m4 macro processor which supports
107826af7124fSmrg# -I option and is only useful for modules relying on M4 in order to
107836af7124fSmrg# expand macros in source code files.
107846af7124fSmrg#
107856af7124fSmrg# Interface to module:
107866af7124fSmrg# M4:	 	returns the path of the m4 program found
107876af7124fSmrg#		returns the path set by the user in the environment
107886af7124fSmrg#
107896af7124fSmrgAC_DEFUN([XORG_WITH_M4], [
107906af7124fSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
107916af7124fSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
107926af7124fSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
107936af7124fSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
107946af7124fSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
107956af7124fSmrg   [$PATH:/usr/gnu/bin])])
107966af7124fSmrg
107976af7124fSmrgAC_SUBST([M4], [$ac_cv_path_M4])
107986af7124fSmrg]) # XORG_WITH_M4
107996af7124fSmrg
108001bedbe3fSmrg# XORG_WITH_PS2PDF([DEFAULT])
108011bedbe3fSmrg# ----------------
108021bedbe3fSmrg# Minimum version: 1.6.0
108031bedbe3fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
108041bedbe3fSmrg#
108051bedbe3fSmrg# Documentation tools are not always available on all platforms and sometimes
108061bedbe3fSmrg# not at the appropriate level. This macro enables a module to test for the
108071bedbe3fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
108081bedbe3fSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
108091bedbe3fSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
108101bedbe3fSmrg# --with-ps2pdf assumes 'auto'.
108111bedbe3fSmrg#
108121bedbe3fSmrg# Interface to module:
108131bedbe3fSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
108141bedbe3fSmrg# PS2PDF:	returns the path of the ps2pdf program found
108151bedbe3fSmrg#		returns the path set by the user in the environment
108161bedbe3fSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
108171bedbe3fSmrg#		 'no' user instructs the module not to use ps2pdf
108181bedbe3fSmrg#
108191bedbe3fSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
108201bedbe3fSmrg#
108211bedbe3fSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
108221bedbe3fSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
108231bedbe3fSmrgm4_define([_defopt], m4_default([$1], [auto]))
108241bedbe3fSmrgAC_ARG_WITH(ps2pdf,
108251bedbe3fSmrg	AS_HELP_STRING([--with-ps2pdf],
108261bedbe3fSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
108271bedbe3fSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
108281bedbe3fSmrgm4_undefine([_defopt])
10829ba6a1819Smrg
108301bedbe3fSmrgif test "x$use_ps2pdf" = x"auto"; then
108311bedbe3fSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
108321bedbe3fSmrg   if test "x$PS2PDF" = "x"; then
108331bedbe3fSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
108341bedbe3fSmrg	have_ps2pdf=no
108351bedbe3fSmrg   else
108361bedbe3fSmrg        have_ps2pdf=yes
108371bedbe3fSmrg   fi
108381bedbe3fSmrgelif test "x$use_ps2pdf" = x"yes" ; then
108391bedbe3fSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
108401bedbe3fSmrg   if test "x$PS2PDF" = "x"; then
108411bedbe3fSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
108421bedbe3fSmrg   fi
108431bedbe3fSmrg   have_ps2pdf=yes
108441bedbe3fSmrgelif test "x$use_ps2pdf" = x"no" ; then
108451bedbe3fSmrg   if test "x$PS2PDF" != "x"; then
108461bedbe3fSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
108471bedbe3fSmrg   fi
108481bedbe3fSmrg   have_ps2pdf=no
108491bedbe3fSmrgelse
108501bedbe3fSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
108511bedbe3fSmrgfi
108521bedbe3fSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
108531bedbe3fSmrg]) # XORG_WITH_PS2PDF
10854ba6a1819Smrg
108551bedbe3fSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
108561bedbe3fSmrg# ----------------
108571bedbe3fSmrg# Minimum version: 1.6.0
108581bedbe3fSmrg#
108591bedbe3fSmrg# Documentation tools are not always available on all platforms and sometimes
108601bedbe3fSmrg# not at the appropriate level. This macro enables a builder to skip all
108611bedbe3fSmrg# documentation targets except traditional man pages.
108621bedbe3fSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
108631bedbe3fSmrg# maximum flexibilty in controlling documentation building.
108641bedbe3fSmrg# Refer to:
108651bedbe3fSmrg# XORG_WITH_XMLTO         --with-xmlto
108661bedbe3fSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
108671bedbe3fSmrg# XORG_WITH_DOXYGEN       --with-doxygen
108681bedbe3fSmrg# XORG_WITH_FOP           --with-fop
108691bedbe3fSmrg# XORG_WITH_GROFF         --with-groff
108701bedbe3fSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
108711bedbe3fSmrg#
108721bedbe3fSmrg# Interface to module:
108731bedbe3fSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
108741bedbe3fSmrg# --enable-docs: 'yes' user instructs the module to generate docs
108751bedbe3fSmrg#		 'no' user instructs the module not to generate docs
108761bedbe3fSmrg# parm1:	specify the default value, yes or no.
108771bedbe3fSmrg#
108781bedbe3fSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
108791bedbe3fSmrgm4_define([docs_default], m4_default([$1], [yes]))
108801bedbe3fSmrgAC_ARG_ENABLE(docs,
108811bedbe3fSmrg	AS_HELP_STRING([--enable-docs],
108821bedbe3fSmrg	   [Enable building the documentation (default: ]docs_default[)]),
108831bedbe3fSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
108841bedbe3fSmrgm4_undefine([docs_default])
108851bedbe3fSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
108861bedbe3fSmrgAC_MSG_CHECKING([whether to build documentation])
108871bedbe3fSmrgAC_MSG_RESULT([$build_docs])
108881bedbe3fSmrg]) # XORG_ENABLE_DOCS
10889ba6a1819Smrg
108901bedbe3fSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
108911bedbe3fSmrg# ----------------
108921bedbe3fSmrg# Minimum version: 1.6.0
108931bedbe3fSmrg#
108941bedbe3fSmrg# This macro enables a builder to skip all developer documentation.
108951bedbe3fSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
108961bedbe3fSmrg# maximum flexibilty in controlling documentation building.
108971bedbe3fSmrg# Refer to:
108981bedbe3fSmrg# XORG_WITH_XMLTO         --with-xmlto
108991bedbe3fSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
109001bedbe3fSmrg# XORG_WITH_DOXYGEN       --with-doxygen
109011bedbe3fSmrg# XORG_WITH_FOP           --with-fop
109021bedbe3fSmrg# XORG_WITH_GROFF         --with-groff
109031bedbe3fSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
109041bedbe3fSmrg#
109051bedbe3fSmrg# Interface to module:
109061bedbe3fSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
109071bedbe3fSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
109081bedbe3fSmrg#			'no' user instructs the module not to generate developer docs
109091bedbe3fSmrg# parm1:		specify the default value, yes or no.
109101bedbe3fSmrg#
109111bedbe3fSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
109121bedbe3fSmrgm4_define([devel_default], m4_default([$1], [yes]))
109131bedbe3fSmrgAC_ARG_ENABLE(devel-docs,
109141bedbe3fSmrg	AS_HELP_STRING([--enable-devel-docs],
109151bedbe3fSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
109161bedbe3fSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
109171bedbe3fSmrgm4_undefine([devel_default])
109181bedbe3fSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
109191bedbe3fSmrgAC_MSG_CHECKING([whether to build developer documentation])
109201bedbe3fSmrgAC_MSG_RESULT([$build_devel_docs])
109211bedbe3fSmrg]) # XORG_ENABLE_DEVEL_DOCS
10922549e21daSmrg
109231bedbe3fSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
109241bedbe3fSmrg# ----------------
109251bedbe3fSmrg# Minimum version: 1.6.0
109261bedbe3fSmrg#
109271bedbe3fSmrg# This macro enables a builder to skip all functional specification targets.
109281bedbe3fSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
109291bedbe3fSmrg# maximum flexibilty in controlling documentation building.
109301bedbe3fSmrg# Refer to:
109311bedbe3fSmrg# XORG_WITH_XMLTO         --with-xmlto
109321bedbe3fSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
109331bedbe3fSmrg# XORG_WITH_DOXYGEN       --with-doxygen
109341bedbe3fSmrg# XORG_WITH_FOP           --with-fop
109351bedbe3fSmrg# XORG_WITH_GROFF         --with-groff
109361bedbe3fSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
109371bedbe3fSmrg#
109381bedbe3fSmrg# Interface to module:
109391bedbe3fSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
109401bedbe3fSmrg# --enable-specs:	'yes' user instructs the module to generate specs
109411bedbe3fSmrg#			'no' user instructs the module not to generate specs
109421bedbe3fSmrg# parm1:		specify the default value, yes or no.
109431bedbe3fSmrg#
109441bedbe3fSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
109451bedbe3fSmrgm4_define([spec_default], m4_default([$1], [yes]))
109461bedbe3fSmrgAC_ARG_ENABLE(specs,
109471bedbe3fSmrg	AS_HELP_STRING([--enable-specs],
109481bedbe3fSmrg	   [Enable building the specs (default: ]spec_default[)]),
109491bedbe3fSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
109501bedbe3fSmrgm4_undefine([spec_default])
109511bedbe3fSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
109521bedbe3fSmrgAC_MSG_CHECKING([whether to build functional specifications])
109531bedbe3fSmrgAC_MSG_RESULT([$build_specs])
109541bedbe3fSmrg]) # XORG_ENABLE_SPECS
10955ba6a1819Smrg
109561bedbe3fSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
109571bedbe3fSmrg# ----------------------------------------------
109581bedbe3fSmrg# Minimum version: 1.13.0
109591bedbe3fSmrg#
109601bedbe3fSmrg# This macro enables a builder to enable/disable unit testing
109611bedbe3fSmrg# It makes no assumption about the test cases implementation
109621bedbe3fSmrg# Test cases may or may not use Automake "Support for test suites"
109631bedbe3fSmrg# They may or may not use the software utility library GLib
109641bedbe3fSmrg#
109651bedbe3fSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
109661bedbe3fSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
109671bedbe3fSmrg# The variable enable_unit_tests is used by other macros in this file.
109681bedbe3fSmrg#
109691bedbe3fSmrg# Interface to module:
109701bedbe3fSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
109711bedbe3fSmrg# enable_unit_tests:    used in configure.ac for additional configuration
109721bedbe3fSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
109731bedbe3fSmrg#			'no' user instructs the module not to build tests
109741bedbe3fSmrg# parm1:		specify the default value, yes or no.
109751bedbe3fSmrg#
109761bedbe3fSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
109771bedbe3fSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
109781bedbe3fSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
109791bedbe3fSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
109801bedbe3fSmrgm4_define([_defopt], m4_default([$1], [auto]))
109811bedbe3fSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
109821bedbe3fSmrg	[Enable building unit test cases (default: ]_defopt[)]),
109831bedbe3fSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
109841bedbe3fSmrgm4_undefine([_defopt])
109851bedbe3fSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
109861bedbe3fSmrgAC_MSG_CHECKING([whether to build unit test cases])
109871bedbe3fSmrgAC_MSG_RESULT([$enable_unit_tests])
109881bedbe3fSmrg]) # XORG_ENABLE_UNIT_TESTS
109891bedbe3fSmrg
109901bedbe3fSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
109911bedbe3fSmrg# ------------------------------------------------------
109921bedbe3fSmrg# Minimum version: 1.17.0
109931bedbe3fSmrg#
109941bedbe3fSmrg# This macro enables a builder to enable/disable integration testing
109951bedbe3fSmrg# It makes no assumption about the test cases' implementation
109961bedbe3fSmrg# Test cases may or may not use Automake "Support for test suites"
109971bedbe3fSmrg#
109981bedbe3fSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
109991bedbe3fSmrg# usually requires less dependencies and may be built and run under less
110001bedbe3fSmrg# stringent environments than integration tests.
110011bedbe3fSmrg#
110021bedbe3fSmrg# Interface to module:
110031bedbe3fSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
110041bedbe3fSmrg# enable_integration_tests:   used in configure.ac for additional configuration
110051bedbe3fSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
110061bedbe3fSmrg#                             'no' user instructs the module not to build tests
110071bedbe3fSmrg# parm1:                      specify the default value, yes or no.
110081bedbe3fSmrg#
110091bedbe3fSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
110101bedbe3fSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
110111bedbe3fSmrgm4_define([_defopt], m4_default([$1], [auto]))
110121bedbe3fSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
110131bedbe3fSmrg	[Enable building integration test cases (default: ]_defopt[)]),
110141bedbe3fSmrg	[enable_integration_tests=$enableval],
110151bedbe3fSmrg	[enable_integration_tests=]_defopt)
110161bedbe3fSmrgm4_undefine([_defopt])
110171bedbe3fSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
110181bedbe3fSmrg	[test "x$enable_integration_tests" != xno])
110191bedbe3fSmrgAC_MSG_CHECKING([whether to build unit test cases])
110201bedbe3fSmrgAC_MSG_RESULT([$enable_integration_tests])
110211bedbe3fSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
110221bedbe3fSmrg
110231bedbe3fSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
110241bedbe3fSmrg# ----------------------------------------
110251bedbe3fSmrg# Minimum version: 1.13.0
110261bedbe3fSmrg#
110271bedbe3fSmrg# GLib is a library which provides advanced data structures and functions.
110281bedbe3fSmrg# This macro enables a module to test for the presence of Glib.
110291bedbe3fSmrg#
110301bedbe3fSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
110311bedbe3fSmrg# Otherwise the value of $enable_unit_tests is blank.
110321bedbe3fSmrg#
110331bedbe3fSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
110341bedbe3fSmrg# test support usually requires less dependencies and may be built and run under
110351bedbe3fSmrg# less stringent environments than integration tests.
110361bedbe3fSmrg#
110371bedbe3fSmrg# Interface to module:
110381bedbe3fSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
110391bedbe3fSmrg# with_glib: used in configure.ac to know if GLib has been found
110401bedbe3fSmrg# --with-glib:	'yes' user instructs the module to use glib
110411bedbe3fSmrg#		'no' user instructs the module not to use glib
110421bedbe3fSmrg#
110431bedbe3fSmrgAC_DEFUN([XORG_WITH_GLIB],[
110441bedbe3fSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
110451bedbe3fSmrgm4_define([_defopt], m4_default([$2], [auto]))
110461bedbe3fSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
110471bedbe3fSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
110481bedbe3fSmrg	[with_glib=$withval], [with_glib=]_defopt)
110491bedbe3fSmrgm4_undefine([_defopt])
110501bedbe3fSmrg
110511bedbe3fSmrghave_glib=no
110521bedbe3fSmrg# Do not probe GLib if user explicitly disabled unit testing
110531bedbe3fSmrgif test "x$enable_unit_tests" != x"no"; then
110541bedbe3fSmrg  # Do not probe GLib if user explicitly disabled it
110551bedbe3fSmrg  if test "x$with_glib" != x"no"; then
110561bedbe3fSmrg    m4_ifval(
110571bedbe3fSmrg      [$1],
110581bedbe3fSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
110591bedbe3fSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
110601bedbe3fSmrg    )
110611bedbe3fSmrg  fi
110621bedbe3fSmrgfi
11063ba6a1819Smrg
110641bedbe3fSmrg# Not having GLib when unit testing has been explicitly requested is an error
110651bedbe3fSmrgif test "x$enable_unit_tests" = x"yes"; then
110661bedbe3fSmrg  if test "x$have_glib" = x"no"; then
110671bedbe3fSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
110681bedbe3fSmrg  fi
110691bedbe3fSmrgfi
11070ba6a1819Smrg
110711bedbe3fSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
110721bedbe3fSmrgif test "x$enable_unit_tests" = x"no"; then
110731bedbe3fSmrg  if test "x$with_glib" = x"yes"; then
110741bedbe3fSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
110751bedbe3fSmrg  fi
110761bedbe3fSmrgfi
11077ba6a1819Smrg
110781bedbe3fSmrg# Not having GLib when it has been explicitly requested is an error
110791bedbe3fSmrgif test "x$with_glib" = x"yes"; then
110801bedbe3fSmrg  if test "x$have_glib" = x"no"; then
110811bedbe3fSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
110821bedbe3fSmrg  fi
110831bedbe3fSmrgfi
11084549e21daSmrg
110851bedbe3fSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
110861bedbe3fSmrg]) # XORG_WITH_GLIB
11087ba6a1819Smrg
110881bedbe3fSmrg# XORG_LD_WRAP([required|optional])
110891bedbe3fSmrg# ---------------------------------
110901bedbe3fSmrg# Minimum version: 1.13.0
110911bedbe3fSmrg#
110921bedbe3fSmrg# Check if linker supports -wrap, passed via compiler flags
110931bedbe3fSmrg#
110941bedbe3fSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
110951bedbe3fSmrg# Otherwise the value of $enable_unit_tests is blank.
110961bedbe3fSmrg#
110971bedbe3fSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
110981bedbe3fSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
110991bedbe3fSmrg# available, an argument of "optional" allows use when some unit tests require
111001bedbe3fSmrg# ld -wrap and others do not.
111011bedbe3fSmrg#
111021bedbe3fSmrgAC_DEFUN([XORG_LD_WRAP],[
111031bedbe3fSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
111041bedbe3fSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
111051bedbe3fSmrg                      void __wrap_exit(int status) { return; }],
111061bedbe3fSmrg                     [exit(0);])])
111071bedbe3fSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
111081bedbe3fSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
111091bedbe3fSmrg  if test "x$have_ld_wrap" = x"no"; then
111101bedbe3fSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
111111bedbe3fSmrg  fi
111121bedbe3fSmrgfi
111131bedbe3fSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
111141bedbe3fSmrg#
111151bedbe3fSmrg]) # XORG_LD_WRAP
11116ba6a1819Smrg
111171bedbe3fSmrg# XORG_CHECK_LINKER_FLAGS
111181bedbe3fSmrg# -----------------------
111191bedbe3fSmrg# SYNOPSIS
111201bedbe3fSmrg#
111211bedbe3fSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
111221bedbe3fSmrg#
111231bedbe3fSmrg# DESCRIPTION
111241bedbe3fSmrg#
111251bedbe3fSmrg#   Check whether the given linker FLAGS work with the current language's
111261bedbe3fSmrg#   linker, or whether they give an error.
111271bedbe3fSmrg#
111281bedbe3fSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
111291bedbe3fSmrg#   success/failure.
111301bedbe3fSmrg#
111311bedbe3fSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
111321bedbe3fSmrg#
111331bedbe3fSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
111341bedbe3fSmrg#
111351bedbe3fSmrg# LICENSE
111361bedbe3fSmrg#
111371bedbe3fSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
111381bedbe3fSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
111391bedbe3fSmrg#   Copyright (c) 2009 Matteo Frigo
111401bedbe3fSmrg#
111411bedbe3fSmrg#   This program is free software: you can redistribute it and/or modify it
111421bedbe3fSmrg#   under the terms of the GNU General Public License as published by the
111431bedbe3fSmrg#   Free Software Foundation, either version 3 of the License, or (at your
111441bedbe3fSmrg#   option) any later version.
111451bedbe3fSmrg#
111461bedbe3fSmrg#   This program is distributed in the hope that it will be useful, but
111471bedbe3fSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
111481bedbe3fSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
111491bedbe3fSmrg#   Public License for more details.
111501bedbe3fSmrg#
111511bedbe3fSmrg#   You should have received a copy of the GNU General Public License along
111521bedbe3fSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
111531bedbe3fSmrg#
111541bedbe3fSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
111551bedbe3fSmrg#   gives unlimited permission to copy, distribute and modify the configure
111561bedbe3fSmrg#   scripts that are the output of Autoconf when processing the Macro. You
111571bedbe3fSmrg#   need not follow the terms of the GNU General Public License when using
111581bedbe3fSmrg#   or distributing such scripts, even though portions of the text of the
111591bedbe3fSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
111601bedbe3fSmrg#   all other use of the material that constitutes the Autoconf Macro.
111611bedbe3fSmrg#
111621bedbe3fSmrg#   This special exception to the GPL applies to versions of the Autoconf
111631bedbe3fSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
111641bedbe3fSmrg#   modified version of the Autoconf Macro, you may extend this special
111651bedbe3fSmrg#   exception to the GPL to apply to your modified version as well.#
111661bedbe3fSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
111671bedbe3fSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
111681bedbe3fSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
111691bedbe3fSmrgAS_LITERAL_IF([$1],
111701bedbe3fSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
111711bedbe3fSmrg      ax_save_FLAGS=$LDFLAGS
111721bedbe3fSmrg      LDFLAGS="$1"
111731bedbe3fSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
111741bedbe3fSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
111751bedbe3fSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
111761bedbe3fSmrg      LDFLAGS=$ax_save_FLAGS])],
111771bedbe3fSmrg  [ax_save_FLAGS=$LDFLAGS
111781bedbe3fSmrg   LDFLAGS="$1"
111791bedbe3fSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
111801bedbe3fSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
111811bedbe3fSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
111821bedbe3fSmrg   LDFLAGS=$ax_save_FLAGS])
111831bedbe3fSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
111841bedbe3fSmrgAC_MSG_RESULT($xorg_check_linker_flags)
111851bedbe3fSmrgif test "x$xorg_check_linker_flags" = xyes; then
111861bedbe3fSmrg	m4_default([$2], :)
111871bedbe3fSmrgelse
111881bedbe3fSmrg	m4_default([$3], :)
111891bedbe3fSmrgfi
111901bedbe3fSmrg]) # XORG_CHECK_LINKER_FLAGS
11191549e21daSmrg
111921bedbe3fSmrg# XORG_MEMORY_CHECK_FLAGS
111931bedbe3fSmrg# -----------------------
111941bedbe3fSmrg# Minimum version: 1.16.0
111951bedbe3fSmrg#
111961bedbe3fSmrg# This macro attempts to find appropriate memory checking functionality
111971bedbe3fSmrg# for various platforms which unit testing code may use to catch various
111981bedbe3fSmrg# forms of memory allocation and access errors in testing.
111991bedbe3fSmrg#
112001bedbe3fSmrg# Interface to module:
112011bedbe3fSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
112021bedbe3fSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
112031bedbe3fSmrg#
112041bedbe3fSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
112051bedbe3fSmrg#
112061bedbe3fSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11207549e21daSmrg
112081bedbe3fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
112091bedbe3fSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
112101bedbe3fSmrg           [Environment variables to enable memory checking in tests])
11211549e21daSmrg
112121bedbe3fSmrg# Check for different types of support on different platforms
112131bedbe3fSmrgcase $host_os in
112141bedbe3fSmrg    solaris*)
112151bedbe3fSmrg        AC_CHECK_LIB([umem], [umem_alloc],
112161bedbe3fSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
112171bedbe3fSmrg        ;;
112181bedbe3fSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
112191bedbe3fSmrg        # both directly and inverted, so should not be 0 or 255.
112201bedbe3fSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
112211bedbe3fSmrg        ;;
112221bedbe3fSmrg    darwin*)
112231bedbe3fSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
112241bedbe3fSmrg        ;;
112251bedbe3fSmrg    *bsd*)
112261bedbe3fSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
112271bedbe3fSmrg        ;;
112281bedbe3fSmrgesac
11229549e21daSmrg
112301bedbe3fSmrg# User supplied flags override default flags
112311bedbe3fSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
112321bedbe3fSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
112331bedbe3fSmrgfi
11234ba6a1819Smrg
112351bedbe3fSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
112361bedbe3fSmrg]) # XORG_WITH_LINT
11237ba6a1819Smrg
112381bedbe3fSmrg# XORG_CHECK_MALLOC_ZERO
112391bedbe3fSmrg# ----------------------
112401bedbe3fSmrg# Minimum version: 1.0.0
112411bedbe3fSmrg#
112421bedbe3fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
112431bedbe3fSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
112441bedbe3fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
112451bedbe3fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
112461bedbe3fSmrgAC_ARG_ENABLE(malloc0returnsnull,
112471bedbe3fSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
112481bedbe3fSmrg		       [malloc(0) returns NULL (default: auto)]),
112491bedbe3fSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
112501bedbe3fSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11251ba6a1819Smrg
112521bedbe3fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
112531bedbe3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
112546af7124fSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
112556af7124fSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
112561bedbe3fSmrg#include <stdlib.h>
112571bedbe3fSmrg],[
112581bedbe3fSmrg    char *m0, *r0, *c0, *p;
112591bedbe3fSmrg    m0 = malloc(0);
112601bedbe3fSmrg    p = malloc(10);
112611bedbe3fSmrg    r0 = realloc(p,0);
112621bedbe3fSmrg    c0 = calloc(0,10);
112631bedbe3fSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
112641bedbe3fSmrg])],
112656af7124fSmrg		[xorg_cv_malloc0_returns_null=yes],
112666af7124fSmrg		[xorg_cv_malloc0_returns_null=no])])
112676af7124fSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
112681bedbe3fSmrgfi
112691bedbe3fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11270ba6a1819Smrg
112711bedbe3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
112721bedbe3fSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
112731bedbe3fSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
112741bedbe3fSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
112751bedbe3fSmrgelse
112761bedbe3fSmrg	MALLOC_ZERO_CFLAGS=""
112771bedbe3fSmrg	XMALLOC_ZERO_CFLAGS=""
112781bedbe3fSmrg	XTMALLOC_ZERO_CFLAGS=""
112791bedbe3fSmrgfi
11280ba6a1819Smrg
112811bedbe3fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
112821bedbe3fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
112831bedbe3fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
112841bedbe3fSmrg]) # XORG_CHECK_MALLOC_ZERO
11285ba6a1819Smrg
112861bedbe3fSmrg# XORG_WITH_LINT()
112871bedbe3fSmrg# ----------------
112881bedbe3fSmrg# Minimum version: 1.1.0
112891bedbe3fSmrg#
112901bedbe3fSmrg# This macro enables the use of a tool that flags some suspicious and
112911bedbe3fSmrg# non-portable constructs (likely to be bugs) in C language source code.
112921bedbe3fSmrg# It will attempt to locate the tool and use appropriate options.
112931bedbe3fSmrg# There are various lint type tools on different platforms.
112941bedbe3fSmrg#
112951bedbe3fSmrg# Interface to module:
112961bedbe3fSmrg# LINT:		returns the path to the tool found on the platform
112971bedbe3fSmrg#		or the value set to LINT on the configure cmd line
112981bedbe3fSmrg#		also an Automake conditional
112991bedbe3fSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
113001bedbe3fSmrg#
113011bedbe3fSmrg# --with-lint:	'yes' user instructs the module to use lint
113021bedbe3fSmrg#		'no' user instructs the module not to use lint (default)
113031bedbe3fSmrg#
113041bedbe3fSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
113051bedbe3fSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
113061bedbe3fSmrg#
113071bedbe3fSmrgAC_DEFUN([XORG_WITH_LINT],[
11308ba6a1819Smrg
113091bedbe3fSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
113101bedbe3fSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
113111bedbe3fSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
113121bedbe3fSmrg		[Use a lint-style source code checker (default: disabled)])],
113131bedbe3fSmrg		[use_lint=$withval], [use_lint=no])
11314ba6a1819Smrg
113151bedbe3fSmrg# Obtain platform specific info like program name and options
113161bedbe3fSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
113171bedbe3fSmrgcase $host_os in
113181bedbe3fSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
113191bedbe3fSmrg	lint_name=splint
113201bedbe3fSmrg	lint_options="-badflag"
113211bedbe3fSmrg	;;
113221bedbe3fSmrg  *freebsd* | *netbsd*)
113231bedbe3fSmrg	lint_name=lint
113241bedbe3fSmrg	lint_options="-u -b"
113251bedbe3fSmrg	;;
113261bedbe3fSmrg  *solaris*)
113271bedbe3fSmrg	lint_name=lint
113281bedbe3fSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
113291bedbe3fSmrg	;;
113301bedbe3fSmrgesac
11331ba6a1819Smrg
113321bedbe3fSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
113331bedbe3fSmrgif test "x$use_lint" = x"yes" ; then
113341bedbe3fSmrg   AC_PATH_PROG([LINT], [$lint_name])
113351bedbe3fSmrg   if test "x$LINT" = "x"; then
113361bedbe3fSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
113371bedbe3fSmrg   fi
113381bedbe3fSmrgelif test "x$use_lint" = x"no" ; then
113391bedbe3fSmrg   if test "x$LINT" != "x"; then
113401bedbe3fSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
113411bedbe3fSmrg   fi
113421bedbe3fSmrgelse
113431bedbe3fSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
113441bedbe3fSmrgfi
11345ba6a1819Smrg
113461bedbe3fSmrg# User supplied flags override default flags
113471bedbe3fSmrgif test "x$LINT_FLAGS" != "x"; then
113481bedbe3fSmrg   lint_options=$LINT_FLAGS
113491bedbe3fSmrgfi
11350ba6a1819Smrg
113511bedbe3fSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
113521bedbe3fSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
11353549e21daSmrg
113541bedbe3fSmrg]) # XORG_WITH_LINT
11355549e21daSmrg
113561bedbe3fSmrg# XORG_LINT_LIBRARY(LIBNAME)
113571bedbe3fSmrg# --------------------------
113581bedbe3fSmrg# Minimum version: 1.1.0
11359ba6a1819Smrg#
113601bedbe3fSmrg# Sets up flags for building lint libraries for checking programs that call
113611bedbe3fSmrg# functions in the library.
11362ba6a1819Smrg#
113631bedbe3fSmrg# Interface to module:
113641bedbe3fSmrg# LINTLIB		- Automake variable with the name of lint library file to make
113651bedbe3fSmrg# MAKE_LINT_LIB		- Automake conditional
113661bedbe3fSmrg#
113671bedbe3fSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
113681bedbe3fSmrg#			  - 'no' user instructs the module not to create a lint library (default)
11369549e21daSmrg
113701bedbe3fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
113711bedbe3fSmrgAC_REQUIRE([XORG_WITH_LINT])
113721bedbe3fSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
113731bedbe3fSmrg	[Create lint library (default: disabled)])],
113741bedbe3fSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11375549e21daSmrg
113761bedbe3fSmrgif test "x$make_lint_lib" = x"yes" ; then
113771bedbe3fSmrg   LINTLIB=llib-l$1.ln
113781bedbe3fSmrg   if test "x$LINT" = "x"; then
113791bedbe3fSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
113801bedbe3fSmrg   fi
113811bedbe3fSmrgelif test "x$make_lint_lib" != x"no" ; then
113821bedbe3fSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
113831bedbe3fSmrgfi
11384549e21daSmrg
113851bedbe3fSmrgAC_SUBST(LINTLIB)
113861bedbe3fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11387549e21daSmrg
113881bedbe3fSmrg]) # XORG_LINT_LIBRARY
11389549e21daSmrg
113901bedbe3fSmrg# XORG_COMPILER_BRAND
113911bedbe3fSmrg# -------------------
113921bedbe3fSmrg# Minimum version: 1.14.0
113931bedbe3fSmrg#
113941bedbe3fSmrg# Checks for various brands of compilers and sets flags as appropriate:
113951bedbe3fSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
113961bedbe3fSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
113971bedbe3fSmrg#   clang compiler - sets CLANGCC to "yes"
113981bedbe3fSmrg#   Intel compiler - sets INTELCC to "yes"
113991bedbe3fSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
114001bedbe3fSmrg#
114011bedbe3fSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
114021bedbe3fSmrgAC_LANG_CASE(
114031bedbe3fSmrg	[C], [
114041bedbe3fSmrg		AC_REQUIRE([AC_PROG_CC_C99])
114051bedbe3fSmrg	],
114061bedbe3fSmrg	[C++], [
114071bedbe3fSmrg		AC_REQUIRE([AC_PROG_CXX])
114081bedbe3fSmrg	]
114091bedbe3fSmrg)
114101bedbe3fSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
114111bedbe3fSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
114121bedbe3fSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
114131bedbe3fSmrg]) # XORG_COMPILER_BRAND
11414549e21daSmrg
114151bedbe3fSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
114161bedbe3fSmrg# ---------------
114171bedbe3fSmrg# Minimum version: 1.16.0
114181bedbe3fSmrg#
114191bedbe3fSmrg# Test if the compiler works when passed the given flag as a command line argument.
114201bedbe3fSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
114211bedbe3fSmrg# next flag in the list until there are no more options.
114221bedbe3fSmrg#
114231bedbe3fSmrg# Note that this does not guarantee that the compiler supports the flag as some
114241bedbe3fSmrg# compilers will simply ignore arguments that they do not understand, but we do
114251bedbe3fSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
114261bedbe3fSmrg# -Werror=unused-command-line-argument
114271bedbe3fSmrg#
114281bedbe3fSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
114291bedbe3fSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
114301bedbe3fSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
114311bedbe3fSmrg
114321bedbe3fSmrgAC_LANG_COMPILER_REQUIRE
114331bedbe3fSmrg
114341bedbe3fSmrgAC_LANG_CASE(
114351bedbe3fSmrg	[C], [
114361bedbe3fSmrg		AC_REQUIRE([AC_PROG_CC_C99])
114371bedbe3fSmrg		define([PREFIX], [C])
114381bedbe3fSmrg		define([CACHE_PREFIX], [cc])
114391bedbe3fSmrg		define([COMPILER], [$CC])
114401bedbe3fSmrg	],
114411bedbe3fSmrg	[C++], [
114421bedbe3fSmrg		define([PREFIX], [CXX])
114431bedbe3fSmrg		define([CACHE_PREFIX], [cxx])
114441bedbe3fSmrg		define([COMPILER], [$CXX])
114451bedbe3fSmrg	]
114461bedbe3fSmrg)
11447549e21daSmrg
114481bedbe3fSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
114491bedbe3fSmrg
114501bedbe3fSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
114511bedbe3fSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
114521bedbe3fSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
114531bedbe3fSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
114541bedbe3fSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
114551bedbe3fSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
114561bedbe3fSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
114571bedbe3fSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
114581bedbe3fSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
114591bedbe3fSmrgfi
11460549e21daSmrg
114611bedbe3fSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
114621bedbe3fSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
114631bedbe3fSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
114641bedbe3fSmrg	fi
114651bedbe3fSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
114661bedbe3fSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
114671bedbe3fSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
114681bedbe3fSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
114691bedbe3fSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
114701bedbe3fSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
114711bedbe3fSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
114721bedbe3fSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
114731bedbe3fSmrgfi
11474549e21daSmrg
114751bedbe3fSmrgfound="no"
114761bedbe3fSmrgm4_foreach([flag], m4_cdr($@), [
114771bedbe3fSmrg	if test $found = "no" ; then
114786af7124fSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
114791bedbe3fSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
114801bedbe3fSmrg		fi
114811bedbe3fSmrg
114826af7124fSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
114831bedbe3fSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
114841bedbe3fSmrg		fi
114851bedbe3fSmrg
114861bedbe3fSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
114871bedbe3fSmrg
114881bedbe3fSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
114891bedbe3fSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
114901bedbe3fSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
114911bedbe3fSmrg		AC_CACHE_VAL($cacheid,
114921bedbe3fSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
114931bedbe3fSmrg					     [eval $cacheid=yes],
114941bedbe3fSmrg					     [eval $cacheid=no])])
114951bedbe3fSmrg
114961bedbe3fSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
114971bedbe3fSmrg
114981bedbe3fSmrg		eval supported=\$$cacheid
114991bedbe3fSmrg		AC_MSG_RESULT([$supported])
115001bedbe3fSmrg		if test "$supported" = "yes" ; then
115011bedbe3fSmrg			$1="$$1 ]flag["
115021bedbe3fSmrg			found="yes"
115031bedbe3fSmrg		fi
115041bedbe3fSmrg	fi
115051bedbe3fSmrg])
115061bedbe3fSmrg]) # XORG_TESTSET_CFLAG
11507549e21daSmrg
115081bedbe3fSmrg# XORG_COMPILER_FLAGS
115091bedbe3fSmrg# ---------------
115101bedbe3fSmrg# Minimum version: 1.16.0
115111bedbe3fSmrg#
115121bedbe3fSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
115131bedbe3fSmrg# arguments supported by the selected compiler which do NOT alter the generated
115141bedbe3fSmrg# code.  These arguments will cause the compiler to print various warnings
115151bedbe3fSmrg# during compilation AND turn a conservative set of warnings into errors.
115161bedbe3fSmrg#
115171bedbe3fSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
115181bedbe3fSmrg# future versions of util-macros as options are added to new compilers.
115191bedbe3fSmrg#
115201bedbe3fSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
115211bedbe3fSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
115221bedbe3fSmrg
115231bedbe3fSmrgAC_ARG_ENABLE(selective-werror,
115241bedbe3fSmrg              AS_HELP_STRING([--disable-selective-werror],
115251bedbe3fSmrg                             [Turn off selective compiler errors. (default: enabled)]),
115261bedbe3fSmrg              [SELECTIVE_WERROR=$enableval],
115271bedbe3fSmrg              [SELECTIVE_WERROR=yes])
115281bedbe3fSmrg
115291bedbe3fSmrgAC_LANG_CASE(
115301bedbe3fSmrg        [C], [
115311bedbe3fSmrg                define([PREFIX], [C])
115321bedbe3fSmrg        ],
115331bedbe3fSmrg        [C++], [
115341bedbe3fSmrg                define([PREFIX], [CXX])
115351bedbe3fSmrg        ]
115361bedbe3fSmrg)
115371bedbe3fSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
115381bedbe3fSmrgif test "x$SUNCC" = "xyes"; then
115391bedbe3fSmrg    [BASE_]PREFIX[FLAGS]="-v"
115401bedbe3fSmrgelse
115411bedbe3fSmrg    [BASE_]PREFIX[FLAGS]=""
115421bedbe3fSmrgfi
11543549e21daSmrg
115441bedbe3fSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
115451bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
115461bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
115471bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
115481bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
115491bedbe3fSmrg
115501bedbe3fSmrgAC_LANG_CASE(
115511bedbe3fSmrg	[C], [
115521bedbe3fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
115531bedbe3fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
115541bedbe3fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
115551bedbe3fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
115566af7124fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
115571bedbe3fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
115581bedbe3fSmrg	]
115591bedbe3fSmrg)
11560549e21daSmrg
115611bedbe3fSmrg# This chunk adds additional warnings that could catch undesired effects.
115621bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
115631bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
115641bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
115651bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
115661bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
115671bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
115686af7124fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
115691bedbe3fSmrg
115701bedbe3fSmrg# These are currently disabled because they are noisy.  They will be enabled
115711bedbe3fSmrg# in the future once the codebase is sufficiently modernized to silence
115721bedbe3fSmrg# them.  For now, I don't want them to drown out the other warnings.
115731bedbe3fSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
115741bedbe3fSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
115756af7124fSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
115761bedbe3fSmrg
115771bedbe3fSmrg# Turn some warnings into errors, so we don't accidently get successful builds
115781bedbe3fSmrg# when there are problems that should be fixed.
115791bedbe3fSmrg
115801bedbe3fSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
115811bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
115821bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
115831bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
115841bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
115851bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
115861bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
115871bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
115881bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
115891bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
115901bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
115911bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
115921bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
115931bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
115941bedbe3fSmrgelse
115951bedbe3fSmrgAC_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])
115961bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
115971bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
115981bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
115991bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
116001bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
116011bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
116021bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
116031bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
116041bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
116051bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
116061bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
116071bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
116081bedbe3fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
116091bedbe3fSmrgfi
11610549e21daSmrg
116111bedbe3fSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
116121bedbe3fSmrg]) # XORG_COMPILER_FLAGS
11613549e21daSmrg
116141bedbe3fSmrg# XORG_CWARNFLAGS
116151bedbe3fSmrg# ---------------
116161bedbe3fSmrg# Minimum version: 1.2.0
116171bedbe3fSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
116181bedbe3fSmrg#
116191bedbe3fSmrg# Defines CWARNFLAGS to enable C compiler warnings.
116201bedbe3fSmrg#
116211bedbe3fSmrg# This function is deprecated because it defines -fno-strict-aliasing
116221bedbe3fSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
116231bedbe3fSmrg# is needed, then it should be added explicitly in the module when
116241bedbe3fSmrg# it is updated to use BASE_CFLAGS.
116251bedbe3fSmrg#
116261bedbe3fSmrgAC_DEFUN([XORG_CWARNFLAGS], [
116271bedbe3fSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
116281bedbe3fSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
116291bedbe3fSmrgAC_LANG_CASE(
116301bedbe3fSmrg	[C], [
116311bedbe3fSmrg		CWARNFLAGS="$BASE_CFLAGS"
116321bedbe3fSmrg		if  test "x$GCC" = xyes ; then
116331bedbe3fSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
116341bedbe3fSmrg		fi
116351bedbe3fSmrg		AC_SUBST(CWARNFLAGS)
116361bedbe3fSmrg	]
116371bedbe3fSmrg)
116381bedbe3fSmrg]) # XORG_CWARNFLAGS
11639549e21daSmrg
116401bedbe3fSmrg# XORG_STRICT_OPTION
116411bedbe3fSmrg# -----------------------
116421bedbe3fSmrg# Minimum version: 1.3.0
116431bedbe3fSmrg#
116441bedbe3fSmrg# Add configure option to enable strict compilation flags, such as treating
116451bedbe3fSmrg# warnings as fatal errors.
116461bedbe3fSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
116471bedbe3fSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
116481bedbe3fSmrg#
116491bedbe3fSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
116501bedbe3fSmrg# when strict compilation is unconditionally desired.
116511bedbe3fSmrgAC_DEFUN([XORG_STRICT_OPTION], [
116521bedbe3fSmrgAC_REQUIRE([XORG_CWARNFLAGS])
116531bedbe3fSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11654ba6a1819Smrg
116551bedbe3fSmrgAC_ARG_ENABLE(strict-compilation,
116561bedbe3fSmrg			  AS_HELP_STRING([--enable-strict-compilation],
116571bedbe3fSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
116581bedbe3fSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11659549e21daSmrg
116601bedbe3fSmrgAC_LANG_CASE(
116611bedbe3fSmrg        [C], [
116621bedbe3fSmrg                define([PREFIX], [C])
116631bedbe3fSmrg        ],
116641bedbe3fSmrg        [C++], [
116651bedbe3fSmrg                define([PREFIX], [CXX])
116661bedbe3fSmrg        ]
116671bedbe3fSmrg)
11668549e21daSmrg
116691bedbe3fSmrg[STRICT_]PREFIX[FLAGS]=""
116701bedbe3fSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
116711bedbe3fSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11672549e21daSmrg
116731bedbe3fSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
116741bedbe3fSmrg# activate it with -Werror, so we add it here explicitly.
116751bedbe3fSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11676ba6a1819Smrg
116771bedbe3fSmrgif test "x$STRICT_COMPILE" = "xyes"; then
116781bedbe3fSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
116791bedbe3fSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
116801bedbe3fSmrgfi
116811bedbe3fSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
116821bedbe3fSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
116831bedbe3fSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
116841bedbe3fSmrg]) # XORG_STRICT_OPTION
11685ba6a1819Smrg
116861bedbe3fSmrg# XORG_DEFAULT_OPTIONS
116871bedbe3fSmrg# --------------------
116881bedbe3fSmrg# Minimum version: 1.3.0
116891bedbe3fSmrg#
116901bedbe3fSmrg# Defines default options for X.Org modules.
116911bedbe3fSmrg#
116921bedbe3fSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
116931bedbe3fSmrgAC_REQUIRE([AC_PROG_INSTALL])
116941bedbe3fSmrgXORG_COMPILER_FLAGS
116951bedbe3fSmrgXORG_CWARNFLAGS
116961bedbe3fSmrgXORG_STRICT_OPTION
116971bedbe3fSmrgXORG_RELEASE_VERSION
116981bedbe3fSmrgXORG_CHANGELOG
116991bedbe3fSmrgXORG_INSTALL
117001bedbe3fSmrgXORG_MANPAGE_SECTIONS
117011bedbe3fSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
117021bedbe3fSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
117031bedbe3fSmrg]) # XORG_DEFAULT_OPTIONS
11704ba6a1819Smrg
117051bedbe3fSmrg# XORG_INSTALL()
117061bedbe3fSmrg# ----------------
117071bedbe3fSmrg# Minimum version: 1.4.0
117081bedbe3fSmrg#
117091bedbe3fSmrg# Defines the variable INSTALL_CMD as the command to copy
117101bedbe3fSmrg# INSTALL from $prefix/share/util-macros.
117111bedbe3fSmrg#
117121bedbe3fSmrgAC_DEFUN([XORG_INSTALL], [
117131bedbe3fSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
117141bedbe3fSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
117151bedbe3fSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
117161bedbe3fSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
117171bedbe3fSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
117181bedbe3fSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
117191bedbe3fSmrgAC_SUBST([INSTALL_CMD])
117201bedbe3fSmrg]) # XORG_INSTALL
117211bedbe3fSmrgdnl Copyright 2005 Red Hat, Inc
117221bedbe3fSmrgdnl
117231bedbe3fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
117241bedbe3fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
117251bedbe3fSmrgdnl the above copyright notice appear in all copies and that both that
117261bedbe3fSmrgdnl copyright notice and this permission notice appear in supporting
117271bedbe3fSmrgdnl documentation.
117281bedbe3fSmrgdnl
117291bedbe3fSmrgdnl The above copyright notice and this permission notice shall be included
117301bedbe3fSmrgdnl in all copies or substantial portions of the Software.
117311bedbe3fSmrgdnl
117321bedbe3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
117331bedbe3fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
117341bedbe3fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
117351bedbe3fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
117361bedbe3fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
117371bedbe3fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
117381bedbe3fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
117391bedbe3fSmrgdnl
117401bedbe3fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
117411bedbe3fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
117421bedbe3fSmrgdnl other dealings in this Software without prior written authorization
117431bedbe3fSmrgdnl from the copyright holders.
117441bedbe3fSmrgdnl
11745ba6a1819Smrg
117461bedbe3fSmrg# XORG_RELEASE_VERSION
117471bedbe3fSmrg# --------------------
117481bedbe3fSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
117496af7124fSmrg
117501bedbe3fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
117511bedbe3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
117521bedbe3fSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
117531bedbe3fSmrg		[Major version of this package])
117541bedbe3fSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
117551bedbe3fSmrg	if test "x$PVM" = "x"; then
117561bedbe3fSmrg		PVM="0"
117571bedbe3fSmrg	fi
117581bedbe3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
117591bedbe3fSmrg		[$PVM],
117601bedbe3fSmrg		[Minor version of this package])
117611bedbe3fSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
117621bedbe3fSmrg	if test "x$PVP" = "x"; then
117631bedbe3fSmrg		PVP="0"
117641bedbe3fSmrg	fi
117651bedbe3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
117661bedbe3fSmrg		[$PVP],
117671bedbe3fSmrg		[Patch version of this package])
11768549e21daSmrg])
11769549e21daSmrg
117701bedbe3fSmrg# XORG_CHANGELOG()
117711bedbe3fSmrg# ----------------
117721bedbe3fSmrg# Minimum version: 1.2.0
11773ba6a1819Smrg#
117741bedbe3fSmrg# Defines the variable CHANGELOG_CMD as the command to generate
117751bedbe3fSmrg# ChangeLog from git.
11776ba6a1819Smrg#
117771bedbe3fSmrg#
117781bedbe3fSmrgAC_DEFUN([XORG_CHANGELOG], [
117791bedbe3fSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
117801bedbe3fSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
117811bedbe3fSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
117821bedbe3fSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
117831bedbe3fSmrgAC_SUBST([CHANGELOG_CMD])
117841bedbe3fSmrg]) # XORG_CHANGELOG
11785ba6a1819Smrg
117861bedbe3fSmrgdnl
117871bedbe3fSmrgdnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
117881bedbe3fSmrgdnl
117891bedbe3fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
117901bedbe3fSmrgdnl copy of this software and associated documentation files (the "Software"),
117911bedbe3fSmrgdnl to deal in the Software without restriction, including without limitation
117921bedbe3fSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
117931bedbe3fSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
117941bedbe3fSmrgdnl Software is furnished to do so, subject to the following conditions:
117951bedbe3fSmrgdnl
117961bedbe3fSmrgdnl The above copyright notice and this permission notice (including the next
117971bedbe3fSmrgdnl paragraph) shall be included in all copies or substantial portions of the
117981bedbe3fSmrgdnl Software.
117991bedbe3fSmrgdnl
118001bedbe3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
118011bedbe3fSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
118021bedbe3fSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
118031bedbe3fSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
118041bedbe3fSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
118051bedbe3fSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
118061bedbe3fSmrgdnl DEALINGS IN THE SOFTWARE.
118071bedbe3fSmrgdnl
11808ba6a1819Smrg
118091bedbe3fSmrg# XTRANS_TCP_FLAGS()
118101bedbe3fSmrg# ------------------
118111bedbe3fSmrg# Find needed libraries for TCP sockets, and check for IPv6 support
118121bedbe3fSmrgAC_DEFUN([XTRANS_TCP_FLAGS],[
118131bedbe3fSmrg # SVR4 hides these in libraries other than libc
118141bedbe3fSmrg AC_SEARCH_LIBS(socket, [socket])
118151bedbe3fSmrg AC_SEARCH_LIBS(gethostbyname, [nsl])
118161bedbe3fSmrg if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
118176af7124fSmrg   AC_CHECK_LIB([ws2_32],[main])
118181bedbe3fSmrg fi
11819ba6a1819Smrg
118201bedbe3fSmrg # Needs to come after above checks for libsocket & libnsl for SVR4 systems
118211bedbe3fSmrg AC_ARG_ENABLE(ipv6,
118226af7124fSmrg	AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
118231bedbe3fSmrg	[IPV6CONN=$enableval],
118241bedbe3fSmrg	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
118251bedbe3fSmrg AC_MSG_CHECKING([if IPv6 support should be built])
118261bedbe3fSmrg if test "$IPV6CONN" = "yes"; then
118271bedbe3fSmrg	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
118281bedbe3fSmrg fi
118291bedbe3fSmrg AC_MSG_RESULT($IPV6CONN)
11830ba6a1819Smrg
118311bedbe3fSmrg # 4.3BSD-Reno added a new member to struct sockaddr_in
118321bedbe3fSmrg AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
118331bedbe3fSmrg	AC_DEFINE([BSD44SOCKETS],1,
118341bedbe3fSmrg 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
118351bedbe3fSmrg#include <sys/types.h>
118361bedbe3fSmrg#include <sys/socket.h>
118371bedbe3fSmrg#include <netinet/in.h>
118381bedbe3fSmrg ])
11839ba6a1819Smrg
118401bedbe3fSmrg # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
118411bedbe3fSmrg AC_CHECK_TYPES([socklen_t], [], [], [
118421bedbe3fSmrgAC_INCLUDES_DEFAULT
118431bedbe3fSmrg#include <sys/socket.h>])
11844ba6a1819Smrg
118456af7124fSmrg # XPG4v2/UNIX95 added msg_control - check to see if we need to define
118466af7124fSmrg # _XOPEN_SOURCE to get it (such as on Solaris)
118476af7124fSmrg AC_CHECK_MEMBER([struct msghdr.msg_control], [], [],
118486af7124fSmrg                 [
118496af7124fSmrgAC_INCLUDES_DEFAULT
118506af7124fSmrg#include <sys/socket.h>
118516af7124fSmrg                 ])
118526af7124fSmrg # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03
118536af7124fSmrg if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
118546af7124fSmrg     unset ac_cv_member_struct_msghdr_msg_control
118556af7124fSmrg     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600])
118566af7124fSmrg     AC_CHECK_MEMBER([struct msghdr.msg_control],
118576af7124fSmrg                     [AC_DEFINE([_XOPEN_SOURCE], [600],
118586af7124fSmrg                       [Defined if needed to expose struct msghdr.msg_control])
118596af7124fSmrg                     ], [], [
118606af7124fSmrg#define _XOPEN_SOURCE 600
118616af7124fSmrgAC_INCLUDES_DEFAULT
118626af7124fSmrg#include <sys/socket.h>
118636af7124fSmrg                     ])
118646af7124fSmrg fi
118656af7124fSmrg # If that didn't work, fall back to XPG5/UNIX98 with C89
118666af7124fSmrg if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
118676af7124fSmrg     unset ac_cv_member_struct_msghdr_msg_control
118686af7124fSmrg     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500])
118696af7124fSmrg     AC_CHECK_MEMBER([struct msghdr.msg_control],
118706af7124fSmrg                     [AC_DEFINE([_XOPEN_SOURCE], [500],
118716af7124fSmrg                       [Defined if needed to expose struct msghdr.msg_control])
118726af7124fSmrg                     ], [], [
118736af7124fSmrg#define _XOPEN_SOURCE 500
118746af7124fSmrgAC_INCLUDES_DEFAULT
118756af7124fSmrg#include <sys/socket.h>
118766af7124fSmrg                     ])
118776af7124fSmrg fi
118786af7124fSmrg
118796af7124fSmrg
118801bedbe3fSmrg]) # XTRANS_TCP_FLAGS
11881ba6a1819Smrg
118821bedbe3fSmrg# XTRANS_CONNECTION_FLAGS()
118831bedbe3fSmrg# -------------------------
118841bedbe3fSmrg# Standard checks for which Xtrans transports to use by the Xorg packages
118851bedbe3fSmrg# that use Xtrans functions
118861bedbe3fSmrgAC_DEFUN([XTRANS_CONNECTION_FLAGS],[
118871bedbe3fSmrg AC_REQUIRE([AC_CANONICAL_HOST])
118881bedbe3fSmrg [case $host_os in
118891bedbe3fSmrg	mingw*)	unixdef="no"   ;;
118901bedbe3fSmrg	*)	unixdef="yes"  ;;
118911bedbe3fSmrg esac]
118921bedbe3fSmrg AC_ARG_ENABLE(unix-transport,
118936af7124fSmrg	AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
118941bedbe3fSmrg	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
118951bedbe3fSmrg AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
118961bedbe3fSmrg if test "$UNIXCONN" = "yes"; then
118971bedbe3fSmrg	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
118981bedbe3fSmrg fi
118991bedbe3fSmrg AC_MSG_RESULT($UNIXCONN)
119001bedbe3fSmrg AC_ARG_ENABLE(tcp-transport,
119016af7124fSmrg	AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
119021bedbe3fSmrg	[TCPCONN=$enableval], [TCPCONN=yes])
119031bedbe3fSmrg AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
119041bedbe3fSmrg AC_MSG_RESULT($TCPCONN)
119051bedbe3fSmrg if test "$TCPCONN" = "yes"; then
119061bedbe3fSmrg	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
119071bedbe3fSmrg	XTRANS_TCP_FLAGS
119081bedbe3fSmrg fi
119091bedbe3fSmrg [case $host_os in
119101bedbe3fSmrg	solaris*|sco*|sysv4*)	localdef="yes" ;;
119111bedbe3fSmrg	*)			localdef="no"  ;;
119121bedbe3fSmrg esac]
119131bedbe3fSmrg AC_ARG_ENABLE(local-transport,
119146af7124fSmrg	AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
119151bedbe3fSmrg	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
119161bedbe3fSmrg AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
119171bedbe3fSmrg AC_MSG_RESULT($LOCALCONN)
119181bedbe3fSmrg if test "$LOCALCONN" = "yes"; then
119191bedbe3fSmrg	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
119201bedbe3fSmrg fi
11921549e21daSmrg
119221bedbe3fSmrg]) # XTRANS_CONNECTION_FLAGS
119231bedbe3fSmrg
119241bedbe3fSmrg
119251bedbe3fSmrg# XTRANS_SECURE_RPC_FLAGS()
119261bedbe3fSmrg# -------------------------
119271bedbe3fSmrg# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
119281bedbe3fSmrg# so that any necessary networking libraries are already found
119291bedbe3fSmrgAC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
119301bedbe3fSmrg[AC_REQUIRE([XTRANS_TCP_FLAGS])
119311bedbe3fSmrg AC_ARG_ENABLE(secure-rpc,
119326af7124fSmrg	AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
119331bedbe3fSmrg        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
119341bedbe3fSmrg
119351bedbe3fSmrg if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
119361bedbe3fSmrg	FOUND_SECURE_RPC="no"
119371bedbe3fSmrg	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
119381bedbe3fSmrg			[FOUND_SECURE_RPC="yes"])
119391bedbe3fSmrg	if test "x$FOUND_SECURE_RPC" = "xno" ; then
119401bedbe3fSmrg		if test "x$SECURE_RPC" = "xyes" ; then
119411bedbe3fSmrg	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
119421bedbe3fSmrg		fi
119431bedbe3fSmrg		SECURE_RPC="no"
119441bedbe3fSmrg	else
119451bedbe3fSmrg		dnl FreeBSD keeps getsecretkey in librpcsvc
119461bedbe3fSmrg		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
119471bedbe3fSmrg		SECURE_RPC="yes"
119481bedbe3fSmrg	fi
119491bedbe3fSmrg fi
119501bedbe3fSmrg AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
119511bedbe3fSmrg if test "x$SECURE_RPC" = "xyes" ; then
119521bedbe3fSmrg	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
119531bedbe3fSmrg fi
119541bedbe3fSmrg AC_MSG_RESULT($SECURE_RPC)
119551bedbe3fSmrg]) # XTRANS_SECURE_RPC_FLAGS
11956549e21daSmrg
11957ba6a1819Smrg
11958