packaging: version up to 2.3.2
[platform/upstream/libXft.git] / aclocal.m4
1 # generated automatically by aclocal 1.14 -*- Autoconf -*-
2
3 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
4
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 m4_ifndef([AC_AUTOCONF_VERSION],
16   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18 [m4_warning([this file was generated for autoconf 2.68.
19 You have another version of autoconf.  It may work, but is not guaranteed to.
20 If you have problems, you may need to regenerate the build system entirely.
21 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22
23 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
24 #
25 # This file is free software; the Free Software Foundation
26 # gives unlimited permission to copy and/or distribute it,
27 # with or without modifications, as long as this notice is preserved.
28
29 # AM_AUTOMAKE_VERSION(VERSION)
30 # ----------------------------
31 # Automake X.Y traces this macro to ensure aclocal.m4 has been
32 # generated from the m4 files accompanying Automake X.Y.
33 # (This private macro should not be called outside this file.)
34 AC_DEFUN([AM_AUTOMAKE_VERSION],
35 [am__api_version='1.14'
36 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37 dnl require some minimum version.  Point them to the right macro.
38 m4_if([$1], [1.14], [],
39       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40 ])
41
42 # _AM_AUTOCONF_VERSION(VERSION)
43 # -----------------------------
44 # aclocal traces this macro to find the Autoconf version.
45 # This is a private macro too.  Using m4_define simplifies
46 # the logic in aclocal, which can simply ignore this definition.
47 m4_define([_AM_AUTOCONF_VERSION], [])
48
49 # AM_SET_CURRENT_AUTOMAKE_VERSION
50 # -------------------------------
51 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54 [AM_AUTOMAKE_VERSION([1.14])dnl
55 m4_ifndef([AC_AUTOCONF_VERSION],
56   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58
59 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60
61 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
62 #
63 # This file is free software; the Free Software Foundation
64 # gives unlimited permission to copy and/or distribute it,
65 # with or without modifications, as long as this notice is preserved.
66
67 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68 # $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70 #
71 # Of course, Automake must honor this variable whenever it calls a
72 # tool from the auxiliary directory.  The problem is that $srcdir (and
73 # therefore $ac_aux_dir as well) can be either absolute or relative,
74 # depending on how configure is run.  This is pretty annoying, since
75 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
76 # source directory, any form will work fine, but in subdirectories a
77 # relative path needs to be adjusted first.
78 #
79 # $ac_aux_dir/missing
80 #    fails when called from a subdirectory if $ac_aux_dir is relative
81 # $top_srcdir/$ac_aux_dir/missing
82 #    fails if $ac_aux_dir is absolute,
83 #    fails when called from a subdirectory in a VPATH build with
84 #          a relative $ac_aux_dir
85 #
86 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87 # are both prefixed by $srcdir.  In an in-source build this is usually
88 # harmless because $srcdir is '.', but things will broke when you
89 # start a VPATH build or use an absolute $srcdir.
90 #
91 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94 # and then we would define $MISSING as
95 #   MISSING="\${SHELL} $am_aux_dir/missing"
96 # This will work as long as MISSING is not called from configure, because
97 # unfortunately $(top_srcdir) has no meaning in configure.
98 # However there are other variables, like CC, which are often used in
99 # configure, and could therefore not use this "fixed" $ac_aux_dir.
100 #
101 # Another solution, used here, is to always expand $ac_aux_dir to an
102 # absolute PATH.  The drawback is that using absolute paths prevent a
103 # configured tree to be moved without reconfiguration.
104
105 AC_DEFUN([AM_AUX_DIR_EXPAND],
106 [dnl Rely on autoconf to set up CDPATH properly.
107 AC_PREREQ([2.50])dnl
108 # expand $ac_aux_dir to an absolute path
109 am_aux_dir=`cd $ac_aux_dir && pwd`
110 ])
111
112 # AM_CONDITIONAL                                            -*- Autoconf -*-
113
114 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
115 #
116 # This file is free software; the Free Software Foundation
117 # gives unlimited permission to copy and/or distribute it,
118 # with or without modifications, as long as this notice is preserved.
119
120 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
121 # -------------------------------------
122 # Define a conditional.
123 AC_DEFUN([AM_CONDITIONAL],
124 [AC_PREREQ([2.52])dnl
125  m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
126        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
127 AC_SUBST([$1_TRUE])dnl
128 AC_SUBST([$1_FALSE])dnl
129 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
130 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
131 m4_define([_AM_COND_VALUE_$1], [$2])dnl
132 if $2; then
133   $1_TRUE=
134   $1_FALSE='#'
135 else
136   $1_TRUE='#'
137   $1_FALSE=
138 fi
139 AC_CONFIG_COMMANDS_PRE(
140 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
141   AC_MSG_ERROR([[conditional "$1" was never defined.
142 Usually this means the macro was only invoked conditionally.]])
143 fi])])
144
145 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
146 #
147 # This file is free software; the Free Software Foundation
148 # gives unlimited permission to copy and/or distribute it,
149 # with or without modifications, as long as this notice is preserved.
150
151
152 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
153 # written in clear, in which case automake, when reading aclocal.m4,
154 # will think it sees a *use*, and therefore will trigger all it's
155 # C support machinery.  Also note that it means that autoscan, seeing
156 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
157
158
159 # _AM_DEPENDENCIES(NAME)
160 # ----------------------
161 # See how the compiler implements dependency checking.
162 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
163 # We try a few techniques and use that to set a single cache variable.
164 #
165 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
166 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
167 # dependency, and given that the user is not expected to run this macro,
168 # just rely on AC_PROG_CC.
169 AC_DEFUN([_AM_DEPENDENCIES],
170 [AC_REQUIRE([AM_SET_DEPDIR])dnl
171 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
172 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
173 AC_REQUIRE([AM_DEP_TRACK])dnl
174
175 m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
176       [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
177       [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
178       [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
179       [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
180       [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
181                     [depcc="$$1"   am_compiler_list=])
182
183 AC_CACHE_CHECK([dependency style of $depcc],
184                [am_cv_$1_dependencies_compiler_type],
185 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
186   # We make a subdir and do the tests there.  Otherwise we can end up
187   # making bogus files that we don't know about and never remove.  For
188   # instance it was reported that on HP-UX the gcc test will end up
189   # making a dummy file named 'D' -- because '-MD' means "put the output
190   # in D".
191   rm -rf conftest.dir
192   mkdir conftest.dir
193   # Copy depcomp to subdir because otherwise we won't find it if we're
194   # using a relative directory.
195   cp "$am_depcomp" conftest.dir
196   cd conftest.dir
197   # We will build objects and dependencies in a subdirectory because
198   # it helps to detect inapplicable dependency modes.  For instance
199   # both Tru64's cc and ICC support -MD to output dependencies as a
200   # side effect of compilation, but ICC will put the dependencies in
201   # the current directory while Tru64 will put them in the object
202   # directory.
203   mkdir sub
204
205   am_cv_$1_dependencies_compiler_type=none
206   if test "$am_compiler_list" = ""; then
207      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
208   fi
209   am__universal=false
210   m4_case([$1], [CC],
211     [case " $depcc " in #(
212      *\ -arch\ *\ -arch\ *) am__universal=true ;;
213      esac],
214     [CXX],
215     [case " $depcc " in #(
216      *\ -arch\ *\ -arch\ *) am__universal=true ;;
217      esac])
218
219   for depmode in $am_compiler_list; do
220     # Setup a source with many dependencies, because some compilers
221     # like to wrap large dependency lists on column 80 (with \), and
222     # we should not choose a depcomp mode which is confused by this.
223     #
224     # We need to recreate these files for each test, as the compiler may
225     # overwrite some of them when testing with obscure command lines.
226     # This happens at least with the AIX C compiler.
227     : > sub/conftest.c
228     for i in 1 2 3 4 5 6; do
229       echo '#include "conftst'$i'.h"' >> sub/conftest.c
230       # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
231       # Solaris 10 /bin/sh.
232       echo '/* dummy */' > sub/conftst$i.h
233     done
234     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
235
236     # We check with '-c' and '-o' for the sake of the "dashmstdout"
237     # mode.  It turns out that the SunPro C++ compiler does not properly
238     # handle '-M -o', and we need to detect this.  Also, some Intel
239     # versions had trouble with output in subdirs.
240     am__obj=sub/conftest.${OBJEXT-o}
241     am__minus_obj="-o $am__obj"
242     case $depmode in
243     gcc)
244       # This depmode causes a compiler race in universal mode.
245       test "$am__universal" = false || continue
246       ;;
247     nosideeffect)
248       # After this tag, mechanisms are not by side-effect, so they'll
249       # only be used when explicitly requested.
250       if test "x$enable_dependency_tracking" = xyes; then
251         continue
252       else
253         break
254       fi
255       ;;
256     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
257       # This compiler won't grok '-c -o', but also, the minuso test has
258       # not run yet.  These depmodes are late enough in the game, and
259       # so weak that their functioning should not be impacted.
260       am__obj=conftest.${OBJEXT-o}
261       am__minus_obj=
262       ;;
263     none) break ;;
264     esac
265     if depmode=$depmode \
266        source=sub/conftest.c object=$am__obj \
267        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
268        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
269          >/dev/null 2>conftest.err &&
270        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
271        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
272        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
273        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
274       # icc doesn't choke on unknown options, it will just issue warnings
275       # or remarks (even with -Werror).  So we grep stderr for any message
276       # that says an option was ignored or not supported.
277       # When given -MP, icc 7.0 and 7.1 complain thusly:
278       #   icc: Command line warning: ignoring option '-M'; no argument required
279       # The diagnosis changed in icc 8.0:
280       #   icc: Command line remark: option '-MP' not supported
281       if (grep 'ignoring option' conftest.err ||
282           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
283         am_cv_$1_dependencies_compiler_type=$depmode
284         break
285       fi
286     fi
287   done
288
289   cd ..
290   rm -rf conftest.dir
291 else
292   am_cv_$1_dependencies_compiler_type=none
293 fi
294 ])
295 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
296 AM_CONDITIONAL([am__fastdep$1], [
297   test "x$enable_dependency_tracking" != xno \
298   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
299 ])
300
301
302 # AM_SET_DEPDIR
303 # -------------
304 # Choose a directory name for dependency files.
305 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
306 AC_DEFUN([AM_SET_DEPDIR],
307 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
308 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
309 ])
310
311
312 # AM_DEP_TRACK
313 # ------------
314 AC_DEFUN([AM_DEP_TRACK],
315 [AC_ARG_ENABLE([dependency-tracking], [dnl
316 AS_HELP_STRING(
317   [--enable-dependency-tracking],
318   [do not reject slow dependency extractors])
319 AS_HELP_STRING(
320   [--disable-dependency-tracking],
321   [speeds up one-time build])])
322 if test "x$enable_dependency_tracking" != xno; then
323   am_depcomp="$ac_aux_dir/depcomp"
324   AMDEPBACKSLASH='\'
325   am__nodep='_no'
326 fi
327 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
328 AC_SUBST([AMDEPBACKSLASH])dnl
329 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
330 AC_SUBST([am__nodep])dnl
331 _AM_SUBST_NOTMAKE([am__nodep])dnl
332 ])
333
334 # Generate code to set up dependency tracking.              -*- Autoconf -*-
335
336 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
337 #
338 # This file is free software; the Free Software Foundation
339 # gives unlimited permission to copy and/or distribute it,
340 # with or without modifications, as long as this notice is preserved.
341
342
343 # _AM_OUTPUT_DEPENDENCY_COMMANDS
344 # ------------------------------
345 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
346 [{
347   # Older Autoconf quotes --file arguments for eval, but not when files
348   # are listed without --file.  Let's play safe and only enable the eval
349   # if we detect the quoting.
350   case $CONFIG_FILES in
351   *\'*) eval set x "$CONFIG_FILES" ;;
352   *)   set x $CONFIG_FILES ;;
353   esac
354   shift
355   for mf
356   do
357     # Strip MF so we end up with the name of the file.
358     mf=`echo "$mf" | sed -e 's/:.*$//'`
359     # Check whether this is an Automake generated Makefile or not.
360     # We used to match only the files named 'Makefile.in', but
361     # some people rename them; so instead we look at the file content.
362     # Grep'ing the first line is not enough: some people post-process
363     # each Makefile.in and add a new line on top of each file to say so.
364     # Grep'ing the whole file is not good either: AIX grep has a line
365     # limit of 2048, but all sed's we know have understand at least 4000.
366     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
367       dirpart=`AS_DIRNAME("$mf")`
368     else
369       continue
370     fi
371     # Extract the definition of DEPDIR, am__include, and am__quote
372     # from the Makefile without running 'make'.
373     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
374     test -z "$DEPDIR" && continue
375     am__include=`sed -n 's/^am__include = //p' < "$mf"`
376     test -z "$am__include" && continue
377     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
378     # Find all dependency output files, they are included files with
379     # $(DEPDIR) in their names.  We invoke sed twice because it is the
380     # simplest approach to changing $(DEPDIR) to its actual value in the
381     # expansion.
382     for file in `sed -n "
383       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
384          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
385       # Make sure the directory exists.
386       test -f "$dirpart/$file" && continue
387       fdir=`AS_DIRNAME(["$file"])`
388       AS_MKDIR_P([$dirpart/$fdir])
389       # echo "creating $dirpart/$file"
390       echo '# dummy' > "$dirpart/$file"
391     done
392   done
393 }
394 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
395
396
397 # AM_OUTPUT_DEPENDENCY_COMMANDS
398 # -----------------------------
399 # This macro should only be invoked once -- use via AC_REQUIRE.
400 #
401 # This code is only required when automatic dependency tracking
402 # is enabled.  FIXME.  This creates each '.P' file that we will
403 # need in order to bootstrap the dependency handling code.
404 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
405 [AC_CONFIG_COMMANDS([depfiles],
406      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
407      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
408 ])
409
410 # Do all the work for Automake.                             -*- Autoconf -*-
411
412 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
413 #
414 # This file is free software; the Free Software Foundation
415 # gives unlimited permission to copy and/or distribute it,
416 # with or without modifications, as long as this notice is preserved.
417
418 # This macro actually does too much.  Some checks are only needed if
419 # your package does certain things.  But this isn't really a big deal.
420
421 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
422 m4_define([AC_PROG_CC],
423 m4_defn([AC_PROG_CC])
424 [_AM_PROG_CC_C_O
425 ])
426
427 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
428 # AM_INIT_AUTOMAKE([OPTIONS])
429 # -----------------------------------------------
430 # The call with PACKAGE and VERSION arguments is the old style
431 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
432 # and VERSION should now be passed to AC_INIT and removed from
433 # the call to AM_INIT_AUTOMAKE.
434 # We support both call styles for the transition.  After
435 # the next Automake release, Autoconf can make the AC_INIT
436 # arguments mandatory, and then we can depend on a new Autoconf
437 # release and drop the old call support.
438 AC_DEFUN([AM_INIT_AUTOMAKE],
439 [AC_PREREQ([2.65])dnl
440 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
441 dnl the ones we care about.
442 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
443 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
444 AC_REQUIRE([AC_PROG_INSTALL])dnl
445 if test "`cd $srcdir && pwd`" != "`pwd`"; then
446   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
447   # is not polluted with repeated "-I."
448   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
449   # test to see if srcdir already configured
450   if test -f $srcdir/config.status; then
451     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
452   fi
453 fi
454
455 # test whether we have cygpath
456 if test -z "$CYGPATH_W"; then
457   if (cygpath --version) >/dev/null 2>/dev/null; then
458     CYGPATH_W='cygpath -w'
459   else
460     CYGPATH_W=echo
461   fi
462 fi
463 AC_SUBST([CYGPATH_W])
464
465 # Define the identity of the package.
466 dnl Distinguish between old-style and new-style calls.
467 m4_ifval([$2],
468 [AC_DIAGNOSE([obsolete],
469              [$0: two- and three-arguments forms are deprecated.])
470 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
471  AC_SUBST([PACKAGE], [$1])dnl
472  AC_SUBST([VERSION], [$2])],
473 [_AM_SET_OPTIONS([$1])dnl
474 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
475 m4_if(
476   m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
477   [ok:ok],,
478   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
479  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
480  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
481
482 _AM_IF_OPTION([no-define],,
483 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
484  AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
485
486 # Some tools Automake needs.
487 AC_REQUIRE([AM_SANITY_CHECK])dnl
488 AC_REQUIRE([AC_ARG_PROGRAM])dnl
489 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
490 AM_MISSING_PROG([AUTOCONF], [autoconf])
491 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
492 AM_MISSING_PROG([AUTOHEADER], [autoheader])
493 AM_MISSING_PROG([MAKEINFO], [makeinfo])
494 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
495 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
496 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
497 # For better backward compatibility.  To be removed once Automake 1.9.x
498 # dies out for good.  For more background, see:
499 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
500 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
501 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
502 # We need awk for the "check" target.  The system "awk" is bad on
503 # some platforms.
504 AC_REQUIRE([AC_PROG_AWK])dnl
505 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
506 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
507 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
508               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
509                              [_AM_PROG_TAR([v7])])])
510 _AM_IF_OPTION([no-dependencies],,
511 [AC_PROVIDE_IFELSE([AC_PROG_CC],
512                   [_AM_DEPENDENCIES([CC])],
513                   [m4_define([AC_PROG_CC],
514                              m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
515 AC_PROVIDE_IFELSE([AC_PROG_CXX],
516                   [_AM_DEPENDENCIES([CXX])],
517                   [m4_define([AC_PROG_CXX],
518                              m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
519 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
520                   [_AM_DEPENDENCIES([OBJC])],
521                   [m4_define([AC_PROG_OBJC],
522                              m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
523 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
524                   [_AM_DEPENDENCIES([OBJCXX])],
525                   [m4_define([AC_PROG_OBJCXX],
526                              m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
527 ])
528 AC_REQUIRE([AM_SILENT_RULES])dnl
529 dnl The testsuite driver may need to know about EXEEXT, so add the
530 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
531 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
532 AC_CONFIG_COMMANDS_PRE(dnl
533 [m4_provide_if([_AM_COMPILER_EXEEXT],
534   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
535
536 # POSIX will say in a future version that running "rm -f" with no argument
537 # is OK; and we want to be able to make that assumption in our Makefile
538 # recipes.  So use an aggressive probe to check that the usage we want is
539 # actually supported "in the wild" to an acceptable degree.
540 # See automake bug#10828.
541 # To make any issue more visible, cause the running configure to be aborted
542 # by default if the 'rm' program in use doesn't match our expectations; the
543 # user can still override this though.
544 if rm -f && rm -fr && rm -rf; then : OK; else
545   cat >&2 <<'END'
546 Oops!
547
548 Your 'rm' program seems unable to run without file operands specified
549 on the command line, even when the '-f' option is present.  This is contrary
550 to the behaviour of most rm programs out there, and not conforming with
551 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
552
553 Please tell bug-automake@gnu.org about your system, including the value
554 of your $PATH and any error possibly output before this message.  This
555 can help us improve future automake versions.
556
557 END
558   if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
559     echo 'Configuration will proceed anyway, since you have set the' >&2
560     echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
561     echo >&2
562   else
563     cat >&2 <<'END'
564 Aborting the configuration process, to ensure you take notice of the issue.
565
566 You can download and install GNU coreutils to get an 'rm' implementation
567 that behaves properly: <http://www.gnu.org/software/coreutils/>.
568
569 If you want to complete the configuration process using your problematic
570 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
571 to "yes", and re-run configure.
572
573 END
574     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
575   fi
576 fi])
577
578 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
579 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
580 dnl mangled by Autoconf and run in a shell conditional statement.
581 m4_define([_AC_COMPILER_EXEEXT],
582 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
583
584 # When config.status generates a header, we must update the stamp-h file.
585 # This file resides in the same directory as the config header
586 # that is generated.  The stamp files are numbered to have different names.
587
588 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
589 # loop where config.status creates the headers, so we can generate
590 # our stamp files there.
591 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
592 [# Compute $1's index in $config_headers.
593 _am_arg=$1
594 _am_stamp_count=1
595 for _am_header in $config_headers :; do
596   case $_am_header in
597     $_am_arg | $_am_arg:* )
598       break ;;
599     * )
600       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
601   esac
602 done
603 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
604
605 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
606 #
607 # This file is free software; the Free Software Foundation
608 # gives unlimited permission to copy and/or distribute it,
609 # with or without modifications, as long as this notice is preserved.
610
611 # AM_PROG_INSTALL_SH
612 # ------------------
613 # Define $install_sh.
614 AC_DEFUN([AM_PROG_INSTALL_SH],
615 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
616 if test x"${install_sh}" != xset; then
617   case $am_aux_dir in
618   *\ * | *\     *)
619     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
620   *)
621     install_sh="\${SHELL} $am_aux_dir/install-sh"
622   esac
623 fi
624 AC_SUBST([install_sh])])
625
626 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
627 #
628 # This file is free software; the Free Software Foundation
629 # gives unlimited permission to copy and/or distribute it,
630 # with or without modifications, as long as this notice is preserved.
631
632 # Check whether the underlying file-system supports filenames
633 # with a leading dot.  For instance MS-DOS doesn't.
634 AC_DEFUN([AM_SET_LEADING_DOT],
635 [rm -rf .tst 2>/dev/null
636 mkdir .tst 2>/dev/null
637 if test -d .tst; then
638   am__leading_dot=.
639 else
640   am__leading_dot=_
641 fi
642 rmdir .tst 2>/dev/null
643 AC_SUBST([am__leading_dot])])
644
645 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
646
647 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
648 #
649 # This file is free software; the Free Software Foundation
650 # gives unlimited permission to copy and/or distribute it,
651 # with or without modifications, as long as this notice is preserved.
652
653 # AM_MAKE_INCLUDE()
654 # -----------------
655 # Check to see how make treats includes.
656 AC_DEFUN([AM_MAKE_INCLUDE],
657 [am_make=${MAKE-make}
658 cat > confinc << 'END'
659 am__doit:
660         @echo this is the am__doit target
661 .PHONY: am__doit
662 END
663 # If we don't find an include directive, just comment out the code.
664 AC_MSG_CHECKING([for style of include used by $am_make])
665 am__include="#"
666 am__quote=
667 _am_result=none
668 # First try GNU make style include.
669 echo "include confinc" > confmf
670 # Ignore all kinds of additional output from 'make'.
671 case `$am_make -s -f confmf 2> /dev/null` in #(
672 *the\ am__doit\ target*)
673   am__include=include
674   am__quote=
675   _am_result=GNU
676   ;;
677 esac
678 # Now try BSD make style include.
679 if test "$am__include" = "#"; then
680    echo '.include "confinc"' > confmf
681    case `$am_make -s -f confmf 2> /dev/null` in #(
682    *the\ am__doit\ target*)
683      am__include=.include
684      am__quote="\""
685      _am_result=BSD
686      ;;
687    esac
688 fi
689 AC_SUBST([am__include])
690 AC_SUBST([am__quote])
691 AC_MSG_RESULT([$_am_result])
692 rm -f confinc confmf
693 ])
694
695 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
696
697 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
698 #
699 # This file is free software; the Free Software Foundation
700 # gives unlimited permission to copy and/or distribute it,
701 # with or without modifications, as long as this notice is preserved.
702
703 # AM_MISSING_PROG(NAME, PROGRAM)
704 # ------------------------------
705 AC_DEFUN([AM_MISSING_PROG],
706 [AC_REQUIRE([AM_MISSING_HAS_RUN])
707 $1=${$1-"${am_missing_run}$2"}
708 AC_SUBST($1)])
709
710 # AM_MISSING_HAS_RUN
711 # ------------------
712 # Define MISSING if not defined so far and test if it is modern enough.
713 # If it is, set am_missing_run to use it, otherwise, to nothing.
714 AC_DEFUN([AM_MISSING_HAS_RUN],
715 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
716 AC_REQUIRE_AUX_FILE([missing])dnl
717 if test x"${MISSING+set}" != xset; then
718   case $am_aux_dir in
719   *\ * | *\     *)
720     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
721   *)
722     MISSING="\${SHELL} $am_aux_dir/missing" ;;
723   esac
724 fi
725 # Use eval to expand $SHELL
726 if eval "$MISSING --is-lightweight"; then
727   am_missing_run="$MISSING "
728 else
729   am_missing_run=
730   AC_MSG_WARN(['missing' script is too old or missing])
731 fi
732 ])
733
734 # Helper functions for option handling.                     -*- Autoconf -*-
735
736 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
737 #
738 # This file is free software; the Free Software Foundation
739 # gives unlimited permission to copy and/or distribute it,
740 # with or without modifications, as long as this notice is preserved.
741
742 # _AM_MANGLE_OPTION(NAME)
743 # -----------------------
744 AC_DEFUN([_AM_MANGLE_OPTION],
745 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
746
747 # _AM_SET_OPTION(NAME)
748 # --------------------
749 # Set option NAME.  Presently that only means defining a flag for this option.
750 AC_DEFUN([_AM_SET_OPTION],
751 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
752
753 # _AM_SET_OPTIONS(OPTIONS)
754 # ------------------------
755 # OPTIONS is a space-separated list of Automake options.
756 AC_DEFUN([_AM_SET_OPTIONS],
757 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
758
759 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
760 # -------------------------------------------
761 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
762 AC_DEFUN([_AM_IF_OPTION],
763 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
764
765 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
766 #
767 # This file is free software; the Free Software Foundation
768 # gives unlimited permission to copy and/or distribute it,
769 # with or without modifications, as long as this notice is preserved.
770
771 # _AM_PROG_CC_C_O
772 # ---------------
773 # Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
774 # to automatically call this.
775 AC_DEFUN([_AM_PROG_CC_C_O],
776 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
777 AC_REQUIRE_AUX_FILE([compile])dnl
778 AC_LANG_PUSH([C])dnl
779 AC_CACHE_CHECK(
780   [whether $CC understands -c and -o together],
781   [am_cv_prog_cc_c_o],
782   [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
783   # Make sure it works both with $CC and with simple cc.
784   # Following AC_PROG_CC_C_O, we do the test twice because some
785   # compilers refuse to overwrite an existing .o file with -o,
786   # though they will create one.
787   am_cv_prog_cc_c_o=yes
788   for am_i in 1 2; do
789     if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
790          && test -f conftest2.$ac_objext; then
791       : OK
792     else
793       am_cv_prog_cc_c_o=no
794       break
795     fi
796   done
797   rm -f core conftest*
798   unset am_i])
799 if test "$am_cv_prog_cc_c_o" != yes; then
800    # Losing compiler, so override with the script.
801    # FIXME: It is wrong to rewrite CC.
802    # But if we don't then we get into trouble of one sort or another.
803    # A longer-term fix would be to have automake use am__CC in this case,
804    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
805    CC="$am_aux_dir/compile $CC"
806 fi
807 AC_LANG_POP([C])])
808
809 # For backward compatibility.
810 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
811
812 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
813 #
814 # This file is free software; the Free Software Foundation
815 # gives unlimited permission to copy and/or distribute it,
816 # with or without modifications, as long as this notice is preserved.
817
818 # AM_RUN_LOG(COMMAND)
819 # -------------------
820 # Run COMMAND, save the exit status in ac_status, and log it.
821 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
822 AC_DEFUN([AM_RUN_LOG],
823 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
824    ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
825    ac_status=$?
826    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
827    (exit $ac_status); }])
828
829 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
830
831 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
832 #
833 # This file is free software; the Free Software Foundation
834 # gives unlimited permission to copy and/or distribute it,
835 # with or without modifications, as long as this notice is preserved.
836
837 # AM_SANITY_CHECK
838 # ---------------
839 AC_DEFUN([AM_SANITY_CHECK],
840 [AC_MSG_CHECKING([whether build environment is sane])
841 # Reject unsafe characters in $srcdir or the absolute working directory
842 # name.  Accept space and tab only in the latter.
843 am_lf='
844 '
845 case `pwd` in
846   *[[\\\"\#\$\&\'\`$am_lf]]*)
847     AC_MSG_ERROR([unsafe absolute working directory name]);;
848 esac
849 case $srcdir in
850   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
851     AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
852 esac
853
854 # Do 'set' in a subshell so we don't clobber the current shell's
855 # arguments.  Must try -L first in case configure is actually a
856 # symlink; some systems play weird games with the mod time of symlinks
857 # (eg FreeBSD returns the mod time of the symlink's containing
858 # directory).
859 if (
860    am_has_slept=no
861    for am_try in 1 2; do
862      echo "timestamp, slept: $am_has_slept" > conftest.file
863      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
864      if test "$[*]" = "X"; then
865         # -L didn't work.
866         set X `ls -t "$srcdir/configure" conftest.file`
867      fi
868      if test "$[*]" != "X $srcdir/configure conftest.file" \
869         && test "$[*]" != "X conftest.file $srcdir/configure"; then
870
871         # If neither matched, then we have a broken ls.  This can happen
872         # if, for instance, CONFIG_SHELL is bash and it inherits a
873         # broken ls alias from the environment.  This has actually
874         # happened.  Such a system could not be considered "sane".
875         AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
876   alias in your environment])
877      fi
878      if test "$[2]" = conftest.file || test $am_try -eq 2; then
879        break
880      fi
881      # Just in case.
882      sleep 1
883      am_has_slept=yes
884    done
885    test "$[2]" = conftest.file
886    )
887 then
888    # Ok.
889    :
890 else
891    AC_MSG_ERROR([newly created file is older than distributed files!
892 Check your system clock])
893 fi
894 AC_MSG_RESULT([yes])
895 # If we didn't sleep, we still need to ensure time stamps of config.status and
896 # generated files are strictly newer.
897 am_sleep_pid=
898 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
899   ( sleep 1 ) &
900   am_sleep_pid=$!
901 fi
902 AC_CONFIG_COMMANDS_PRE(
903   [AC_MSG_CHECKING([that generated files are newer than configure])
904    if test -n "$am_sleep_pid"; then
905      # Hide warnings about reused PIDs.
906      wait $am_sleep_pid 2>/dev/null
907    fi
908    AC_MSG_RESULT([done])])
909 rm -f conftest.file
910 ])
911
912 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
913 #
914 # This file is free software; the Free Software Foundation
915 # gives unlimited permission to copy and/or distribute it,
916 # with or without modifications, as long as this notice is preserved.
917
918 # AM_SILENT_RULES([DEFAULT])
919 # --------------------------
920 # Enable less verbose build rules; with the default set to DEFAULT
921 # ("yes" being less verbose, "no" or empty being verbose).
922 AC_DEFUN([AM_SILENT_RULES],
923 [AC_ARG_ENABLE([silent-rules], [dnl
924 AS_HELP_STRING(
925   [--enable-silent-rules],
926   [less verbose build output (undo: "make V=1")])
927 AS_HELP_STRING(
928   [--disable-silent-rules],
929   [verbose build output (undo: "make V=0")])dnl
930 ])
931 case $enable_silent_rules in @%:@ (((
932   yes) AM_DEFAULT_VERBOSITY=0;;
933    no) AM_DEFAULT_VERBOSITY=1;;
934     *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
935 esac
936 dnl
937 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
938 dnl do not support nested variable expansions.
939 dnl See automake bug#9928 and bug#10237.
940 am_make=${MAKE-make}
941 AC_CACHE_CHECK([whether $am_make supports nested variables],
942    [am_cv_make_support_nested_variables],
943    [if AS_ECHO([['TRUE=$(BAR$(V))
944 BAR0=false
945 BAR1=true
946 V=1
947 am__doit:
948         @$(TRUE)
949 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
950   am_cv_make_support_nested_variables=yes
951 else
952   am_cv_make_support_nested_variables=no
953 fi])
954 if test $am_cv_make_support_nested_variables = yes; then
955   dnl Using '$V' instead of '$(V)' breaks IRIX make.
956   AM_V='$(V)'
957   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
958 else
959   AM_V=$AM_DEFAULT_VERBOSITY
960   AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
961 fi
962 AC_SUBST([AM_V])dnl
963 AM_SUBST_NOTMAKE([AM_V])dnl
964 AC_SUBST([AM_DEFAULT_V])dnl
965 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
966 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
967 AM_BACKSLASH='\'
968 AC_SUBST([AM_BACKSLASH])dnl
969 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
970 ])
971
972 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
973 #
974 # This file is free software; the Free Software Foundation
975 # gives unlimited permission to copy and/or distribute it,
976 # with or without modifications, as long as this notice is preserved.
977
978 # AM_PROG_INSTALL_STRIP
979 # ---------------------
980 # One issue with vendor 'install' (even GNU) is that you can't
981 # specify the program used to strip binaries.  This is especially
982 # annoying in cross-compiling environments, where the build's strip
983 # is unlikely to handle the host's binaries.
984 # Fortunately install-sh will honor a STRIPPROG variable, so we
985 # always use install-sh in "make install-strip", and initialize
986 # STRIPPROG with the value of the STRIP variable (set by the user).
987 AC_DEFUN([AM_PROG_INSTALL_STRIP],
988 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
989 # Installed binaries are usually stripped using 'strip' when the user
990 # run "make install-strip".  However 'strip' might not be the right
991 # tool to use in cross-compilation environments, therefore Automake
992 # will honor the 'STRIP' environment variable to overrule this program.
993 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
994 if test "$cross_compiling" != no; then
995   AC_CHECK_TOOL([STRIP], [strip], :)
996 fi
997 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
998 AC_SUBST([INSTALL_STRIP_PROGRAM])])
999
1000 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
1001 #
1002 # This file is free software; the Free Software Foundation
1003 # gives unlimited permission to copy and/or distribute it,
1004 # with or without modifications, as long as this notice is preserved.
1005
1006 # _AM_SUBST_NOTMAKE(VARIABLE)
1007 # ---------------------------
1008 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1009 # This macro is traced by Automake.
1010 AC_DEFUN([_AM_SUBST_NOTMAKE])
1011
1012 # AM_SUBST_NOTMAKE(VARIABLE)
1013 # --------------------------
1014 # Public sister of _AM_SUBST_NOTMAKE.
1015 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1016
1017 # Check how to create a tarball.                            -*- Autoconf -*-
1018
1019 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
1020 #
1021 # This file is free software; the Free Software Foundation
1022 # gives unlimited permission to copy and/or distribute it,
1023 # with or without modifications, as long as this notice is preserved.
1024
1025 # _AM_PROG_TAR(FORMAT)
1026 # --------------------
1027 # Check how to create a tarball in format FORMAT.
1028 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
1029 #
1030 # Substitute a variable $(am__tar) that is a command
1031 # writing to stdout a FORMAT-tarball containing the directory
1032 # $tardir.
1033 #     tardir=directory && $(am__tar) > result.tar
1034 #
1035 # Substitute a variable $(am__untar) that extract such
1036 # a tarball read from stdin.
1037 #     $(am__untar) < result.tar
1038 #
1039 AC_DEFUN([_AM_PROG_TAR],
1040 [# Always define AMTAR for backward compatibility.  Yes, it's still used
1041 # in the wild :-(  We should find a proper way to deprecate it ...
1042 AC_SUBST([AMTAR], ['$${TAR-tar}'])
1043
1044 # We'll loop over all known methods to create a tar archive until one works.
1045 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1046
1047 m4_if([$1], [v7],
1048   [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1049
1050   [m4_case([$1],
1051     [ustar],
1052      [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1053       # There is notably a 21 bits limit for the UID and the GID.  In fact,
1054       # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1055       # and bug#13588).
1056       am_max_uid=2097151 # 2^21 - 1
1057       am_max_gid=$am_max_uid
1058       # The $UID and $GID variables are not portable, so we need to resort
1059       # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1060       # below are definitely unexpected, so allow the users to see them
1061       # (that is, avoid stderr redirection).
1062       am_uid=`id -u || echo unknown`
1063       am_gid=`id -g || echo unknown`
1064       AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1065       if test $am_uid -le $am_max_uid; then
1066          AC_MSG_RESULT([yes])
1067       else
1068          AC_MSG_RESULT([no])
1069          _am_tools=none
1070       fi
1071       AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1072       if test $am_gid -le $am_max_gid; then
1073          AC_MSG_RESULT([yes])
1074       else
1075         AC_MSG_RESULT([no])
1076         _am_tools=none
1077       fi],
1078
1079   [pax],
1080     [],
1081
1082   [m4_fatal([Unknown tar format])])
1083
1084   AC_MSG_CHECKING([how to create a $1 tar archive])
1085
1086   # Go ahead even if we have the value already cached.  We do so because we
1087   # need to set the values for the 'am__tar' and 'am__untar' variables.
1088   _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1089
1090   for _am_tool in $_am_tools; do
1091     case $_am_tool in
1092     gnutar)
1093       for _am_tar in tar gnutar gtar; do
1094         AM_RUN_LOG([$_am_tar --version]) && break
1095       done
1096       am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1097       am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1098       am__untar="$_am_tar -xf -"
1099       ;;
1100     plaintar)
1101       # Must skip GNU tar: if it does not support --format= it doesn't create
1102       # ustar tarball either.
1103       (tar --version) >/dev/null 2>&1 && continue
1104       am__tar='tar chf - "$$tardir"'
1105       am__tar_='tar chf - "$tardir"'
1106       am__untar='tar xf -'
1107       ;;
1108     pax)
1109       am__tar='pax -L -x $1 -w "$$tardir"'
1110       am__tar_='pax -L -x $1 -w "$tardir"'
1111       am__untar='pax -r'
1112       ;;
1113     cpio)
1114       am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1115       am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1116       am__untar='cpio -i -H $1 -d'
1117       ;;
1118     none)
1119       am__tar=false
1120       am__tar_=false
1121       am__untar=false
1122       ;;
1123     esac
1124
1125     # If the value was cached, stop now.  We just wanted to have am__tar
1126     # and am__untar set.
1127     test -n "${am_cv_prog_tar_$1}" && break
1128
1129     # tar/untar a dummy directory, and stop if the command works.
1130     rm -rf conftest.dir
1131     mkdir conftest.dir
1132     echo GrepMe > conftest.dir/file
1133     AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1134     rm -rf conftest.dir
1135     if test -s conftest.tar; then
1136       AM_RUN_LOG([$am__untar <conftest.tar])
1137       AM_RUN_LOG([cat conftest.dir/file])
1138       grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1139     fi
1140   done
1141   rm -rf conftest.dir
1142
1143   AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1144   AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1145
1146 AC_SUBST([am__tar])
1147 AC_SUBST([am__untar])
1148 ]) # _AM_PROG_TAR
1149
1150 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1151 #
1152 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1153 #                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1154 #                 Foundation, Inc.
1155 #   Written by Gordon Matzigkeit, 1996
1156 #
1157 # This file is free software; the Free Software Foundation gives
1158 # unlimited permission to copy and/or distribute it, with or without
1159 # modifications, as long as this notice is preserved.
1160
1161 m4_define([_LT_COPYING], [dnl
1162 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1163 #                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1164 #                 Foundation, Inc.
1165 #   Written by Gordon Matzigkeit, 1996
1166 #
1167 #   This file is part of GNU Libtool.
1168 #
1169 # GNU Libtool is free software; you can redistribute it and/or
1170 # modify it under the terms of the GNU General Public License as
1171 # published by the Free Software Foundation; either version 2 of
1172 # the License, or (at your option) any later version.
1173 #
1174 # As a special exception to the GNU General Public License,
1175 # if you distribute this file as part of a program or library that
1176 # is built using GNU Libtool, you may include this file under the
1177 # same distribution terms that you use for the rest of that program.
1178 #
1179 # GNU Libtool is distributed in the hope that it will be useful,
1180 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1181 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1182 # GNU General Public License for more details.
1183 #
1184 # You should have received a copy of the GNU General Public License
1185 # along with GNU Libtool; see the file COPYING.  If not, a copy
1186 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1187 # obtained by writing to the Free Software Foundation, Inc.,
1188 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1189 ])
1190
1191 # serial 57 LT_INIT
1192
1193
1194 # LT_PREREQ(VERSION)
1195 # ------------------
1196 # Complain and exit if this libtool version is less that VERSION.
1197 m4_defun([LT_PREREQ],
1198 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1199        [m4_default([$3],
1200                    [m4_fatal([Libtool version $1 or higher is required],
1201                              63)])],
1202        [$2])])
1203
1204
1205 # _LT_CHECK_BUILDDIR
1206 # ------------------
1207 # Complain if the absolute build directory name contains unusual characters
1208 m4_defun([_LT_CHECK_BUILDDIR],
1209 [case `pwd` in
1210   *\ * | *\     *)
1211     AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1212 esac
1213 ])
1214
1215
1216 # LT_INIT([OPTIONS])
1217 # ------------------
1218 AC_DEFUN([LT_INIT],
1219 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1220 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1221 AC_BEFORE([$0], [LT_LANG])dnl
1222 AC_BEFORE([$0], [LT_OUTPUT])dnl
1223 AC_BEFORE([$0], [LTDL_INIT])dnl
1224 m4_require([_LT_CHECK_BUILDDIR])dnl
1225
1226 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1227 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1228 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1229 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1230 dnl unless we require an AC_DEFUNed macro:
1231 AC_REQUIRE([LTOPTIONS_VERSION])dnl
1232 AC_REQUIRE([LTSUGAR_VERSION])dnl
1233 AC_REQUIRE([LTVERSION_VERSION])dnl
1234 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1235 m4_require([_LT_PROG_LTMAIN])dnl
1236
1237 _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1238
1239 dnl Parse OPTIONS
1240 _LT_SET_OPTIONS([$0], [$1])
1241
1242 # This can be used to rebuild libtool when needed
1243 LIBTOOL_DEPS="$ltmain"
1244
1245 # Always use our own libtool.
1246 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1247 AC_SUBST(LIBTOOL)dnl
1248
1249 _LT_SETUP
1250
1251 # Only expand once:
1252 m4_define([LT_INIT])
1253 ])# LT_INIT
1254
1255 # Old names:
1256 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1257 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1258 dnl aclocal-1.4 backwards compatibility:
1259 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1260 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1261
1262
1263 # _LT_CC_BASENAME(CC)
1264 # -------------------
1265 # Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1266 m4_defun([_LT_CC_BASENAME],
1267 [for cc_temp in $1""; do
1268   case $cc_temp in
1269     compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1270     distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1271     \-*) ;;
1272     *) break;;
1273   esac
1274 done
1275 cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1276 ])
1277
1278
1279 # _LT_FILEUTILS_DEFAULTS
1280 # ----------------------
1281 # It is okay to use these file commands and assume they have been set
1282 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1283 m4_defun([_LT_FILEUTILS_DEFAULTS],
1284 [: ${CP="cp -f"}
1285 : ${MV="mv -f"}
1286 : ${RM="rm -f"}
1287 ])# _LT_FILEUTILS_DEFAULTS
1288
1289
1290 # _LT_SETUP
1291 # ---------
1292 m4_defun([_LT_SETUP],
1293 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1294 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1295 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1296 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1297
1298 _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1299 dnl
1300 _LT_DECL([], [host_alias], [0], [The host system])dnl
1301 _LT_DECL([], [host], [0])dnl
1302 _LT_DECL([], [host_os], [0])dnl
1303 dnl
1304 _LT_DECL([], [build_alias], [0], [The build system])dnl
1305 _LT_DECL([], [build], [0])dnl
1306 _LT_DECL([], [build_os], [0])dnl
1307 dnl
1308 AC_REQUIRE([AC_PROG_CC])dnl
1309 AC_REQUIRE([LT_PATH_LD])dnl
1310 AC_REQUIRE([LT_PATH_NM])dnl
1311 dnl
1312 AC_REQUIRE([AC_PROG_LN_S])dnl
1313 test -z "$LN_S" && LN_S="ln -s"
1314 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1315 dnl
1316 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1317 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1318 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1319 dnl
1320 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1321 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1322 m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1323 m4_require([_LT_CMD_RELOAD])dnl
1324 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1325 m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1326 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1327 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1328 m4_require([_LT_WITH_SYSROOT])dnl
1329
1330 _LT_CONFIG_LIBTOOL_INIT([
1331 # See if we are running on zsh, and set the options which allow our
1332 # commands through without removal of \ escapes INIT.
1333 if test -n "\${ZSH_VERSION+set}" ; then
1334    setopt NO_GLOB_SUBST
1335 fi
1336 ])
1337 if test -n "${ZSH_VERSION+set}" ; then
1338    setopt NO_GLOB_SUBST
1339 fi
1340
1341 _LT_CHECK_OBJDIR
1342
1343 m4_require([_LT_TAG_COMPILER])dnl
1344
1345 case $host_os in
1346 aix3*)
1347   # AIX sometimes has problems with the GCC collect2 program.  For some
1348   # reason, if we set the COLLECT_NAMES environment variable, the problems
1349   # vanish in a puff of smoke.
1350   if test "X${COLLECT_NAMES+set}" != Xset; then
1351     COLLECT_NAMES=
1352     export COLLECT_NAMES
1353   fi
1354   ;;
1355 esac
1356
1357 # Global variables:
1358 ofile=libtool
1359 can_build_shared=yes
1360
1361 # All known linkers require a `.a' archive for static linking (except MSVC,
1362 # which needs '.lib').
1363 libext=a
1364
1365 with_gnu_ld="$lt_cv_prog_gnu_ld"
1366
1367 old_CC="$CC"
1368 old_CFLAGS="$CFLAGS"
1369
1370 # Set sane defaults for various variables
1371 test -z "$CC" && CC=cc
1372 test -z "$LTCC" && LTCC=$CC
1373 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1374 test -z "$LD" && LD=ld
1375 test -z "$ac_objext" && ac_objext=o
1376
1377 _LT_CC_BASENAME([$compiler])
1378
1379 # Only perform the check for file, if the check method requires it
1380 test -z "$MAGIC_CMD" && MAGIC_CMD=file
1381 case $deplibs_check_method in
1382 file_magic*)
1383   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1384     _LT_PATH_MAGIC
1385   fi
1386   ;;
1387 esac
1388
1389 # Use C for the default configuration in the libtool script
1390 LT_SUPPORTED_TAG([CC])
1391 _LT_LANG_C_CONFIG
1392 _LT_LANG_DEFAULT_CONFIG
1393 _LT_CONFIG_COMMANDS
1394 ])# _LT_SETUP
1395
1396
1397 # _LT_PREPARE_SED_QUOTE_VARS
1398 # --------------------------
1399 # Define a few sed substitution that help us do robust quoting.
1400 m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1401 [# Backslashify metacharacters that are still active within
1402 # double-quoted strings.
1403 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1404
1405 # Same as above, but do not quote variable references.
1406 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1407
1408 # Sed substitution to delay expansion of an escaped shell variable in a
1409 # double_quote_subst'ed string.
1410 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1411
1412 # Sed substitution to delay expansion of an escaped single quote.
1413 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1414
1415 # Sed substitution to avoid accidental globbing in evaled expressions
1416 no_glob_subst='s/\*/\\\*/g'
1417 ])
1418
1419 # _LT_PROG_LTMAIN
1420 # ---------------
1421 # Note that this code is called both from `configure', and `config.status'
1422 # now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1423 # `config.status' has no value for ac_aux_dir unless we are using Automake,
1424 # so we pass a copy along to make sure it has a sensible value anyway.
1425 m4_defun([_LT_PROG_LTMAIN],
1426 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1427 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1428 ltmain="$ac_aux_dir/ltmain.sh"
1429 ])# _LT_PROG_LTMAIN
1430
1431
1432
1433 # So that we can recreate a full libtool script including additional
1434 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1435 # in macros and then make a single call at the end using the `libtool'
1436 # label.
1437
1438
1439 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1440 # ----------------------------------------
1441 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1442 m4_define([_LT_CONFIG_LIBTOOL_INIT],
1443 [m4_ifval([$1],
1444           [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1445                      [$1
1446 ])])])
1447
1448 # Initialize.
1449 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1450
1451
1452 # _LT_CONFIG_LIBTOOL([COMMANDS])
1453 # ------------------------------
1454 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1455 m4_define([_LT_CONFIG_LIBTOOL],
1456 [m4_ifval([$1],
1457           [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1458                      [$1
1459 ])])])
1460
1461 # Initialize.
1462 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1463
1464
1465 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1466 # -----------------------------------------------------
1467 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1468 [_LT_CONFIG_LIBTOOL([$1])
1469 _LT_CONFIG_LIBTOOL_INIT([$2])
1470 ])
1471
1472
1473 # _LT_FORMAT_COMMENT([COMMENT])
1474 # -----------------------------
1475 # Add leading comment marks to the start of each line, and a trailing
1476 # full-stop to the whole comment if one is not present already.
1477 m4_define([_LT_FORMAT_COMMENT],
1478 [m4_ifval([$1], [
1479 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1480               [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1481 )])
1482
1483
1484
1485
1486
1487 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1488 # -------------------------------------------------------------------
1489 # CONFIGNAME is the name given to the value in the libtool script.
1490 # VARNAME is the (base) name used in the configure script.
1491 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1492 # VARNAME.  Any other value will be used directly.
1493 m4_define([_LT_DECL],
1494 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1495     [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1496         [m4_ifval([$1], [$1], [$2])])
1497     lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1498     m4_ifval([$4],
1499         [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1500     lt_dict_add_subkey([lt_decl_dict], [$2],
1501         [tagged?], [m4_ifval([$5], [yes], [no])])])
1502 ])
1503
1504
1505 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1506 # --------------------------------------------------------
1507 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1508
1509
1510 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1511 # ------------------------------------------------
1512 m4_define([lt_decl_tag_varnames],
1513 [_lt_decl_filter([tagged?], [yes], $@)])
1514
1515
1516 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1517 # ---------------------------------------------------------
1518 m4_define([_lt_decl_filter],
1519 [m4_case([$#],
1520   [0], [m4_fatal([$0: too few arguments: $#])],
1521   [1], [m4_fatal([$0: too few arguments: $#: $1])],
1522   [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1523   [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1524   [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1525 ])
1526
1527
1528 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1529 # --------------------------------------------------
1530 m4_define([lt_decl_quote_varnames],
1531 [_lt_decl_filter([value], [1], $@)])
1532
1533
1534 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1535 # ---------------------------------------------------
1536 m4_define([lt_decl_dquote_varnames],
1537 [_lt_decl_filter([value], [2], $@)])
1538
1539
1540 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1541 # ---------------------------------------------------
1542 m4_define([lt_decl_varnames_tagged],
1543 [m4_assert([$# <= 2])dnl
1544 _$0(m4_quote(m4_default([$1], [[, ]])),
1545     m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1546     m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1547 m4_define([_lt_decl_varnames_tagged],
1548 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1549
1550
1551 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1552 # ------------------------------------------------
1553 m4_define([lt_decl_all_varnames],
1554 [_$0(m4_quote(m4_default([$1], [[, ]])),
1555      m4_if([$2], [],
1556            m4_quote(lt_decl_varnames),
1557         m4_quote(m4_shift($@))))[]dnl
1558 ])
1559 m4_define([_lt_decl_all_varnames],
1560 [lt_join($@, lt_decl_varnames_tagged([$1],
1561                         lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1562 ])
1563
1564
1565 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
1566 # ------------------------------------
1567 # Quote a variable value, and forward it to `config.status' so that its
1568 # declaration there will have the same value as in `configure'.  VARNAME
1569 # must have a single quote delimited value for this to work.
1570 m4_define([_LT_CONFIG_STATUS_DECLARE],
1571 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1572
1573
1574 # _LT_CONFIG_STATUS_DECLARATIONS
1575 # ------------------------------
1576 # We delimit libtool config variables with single quotes, so when
1577 # we write them to config.status, we have to be sure to quote all
1578 # embedded single quotes properly.  In configure, this macro expands
1579 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1580 #
1581 #    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1582 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1583 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1584     [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1585
1586
1587 # _LT_LIBTOOL_TAGS
1588 # ----------------
1589 # Output comment and list of tags supported by the script
1590 m4_defun([_LT_LIBTOOL_TAGS],
1591 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1592 available_tags="_LT_TAGS"dnl
1593 ])
1594
1595
1596 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1597 # -----------------------------------
1598 # Extract the dictionary values for VARNAME (optionally with TAG) and
1599 # expand to a commented shell variable setting:
1600 #
1601 #    # Some comment about what VAR is for.
1602 #    visible_name=$lt_internal_name
1603 m4_define([_LT_LIBTOOL_DECLARE],
1604 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1605                                            [description])))[]dnl
1606 m4_pushdef([_libtool_name],
1607     m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1608 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1609     [0], [_libtool_name=[$]$1],
1610     [1], [_libtool_name=$lt_[]$1],
1611     [2], [_libtool_name=$lt_[]$1],
1612     [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1613 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1614 ])
1615
1616
1617 # _LT_LIBTOOL_CONFIG_VARS
1618 # -----------------------
1619 # Produce commented declarations of non-tagged libtool config variables
1620 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1621 # script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1622 # section) are produced by _LT_LIBTOOL_TAG_VARS.
1623 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1624 [m4_foreach([_lt_var],
1625     m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1626     [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1627
1628
1629 # _LT_LIBTOOL_TAG_VARS(TAG)
1630 # -------------------------
1631 m4_define([_LT_LIBTOOL_TAG_VARS],
1632 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1633     [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1634
1635
1636 # _LT_TAGVAR(VARNAME, [TAGNAME])
1637 # ------------------------------
1638 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1639
1640
1641 # _LT_CONFIG_COMMANDS
1642 # -------------------
1643 # Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1644 # variables for single and double quote escaping we saved from calls
1645 # to _LT_DECL, we can put quote escaped variables declarations
1646 # into `config.status', and then the shell code to quote escape them in
1647 # for loops in `config.status'.  Finally, any additional code accumulated
1648 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1649 m4_defun([_LT_CONFIG_COMMANDS],
1650 [AC_PROVIDE_IFELSE([LT_OUTPUT],
1651         dnl If the libtool generation code has been placed in $CONFIG_LT,
1652         dnl instead of duplicating it all over again into config.status,
1653         dnl then we will have config.status run $CONFIG_LT later, so it
1654         dnl needs to know what name is stored there:
1655         [AC_CONFIG_COMMANDS([libtool],
1656             [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1657     dnl If the libtool generation code is destined for config.status,
1658     dnl expand the accumulated commands and init code now:
1659     [AC_CONFIG_COMMANDS([libtool],
1660         [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1661 ])#_LT_CONFIG_COMMANDS
1662
1663
1664 # Initialize.
1665 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1666 [
1667
1668 # The HP-UX ksh and POSIX shell print the target directory to stdout
1669 # if CDPATH is set.
1670 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1671
1672 sed_quote_subst='$sed_quote_subst'
1673 double_quote_subst='$double_quote_subst'
1674 delay_variable_subst='$delay_variable_subst'
1675 _LT_CONFIG_STATUS_DECLARATIONS
1676 LTCC='$LTCC'
1677 LTCFLAGS='$LTCFLAGS'
1678 compiler='$compiler_DEFAULT'
1679
1680 # A function that is used when there is no print builtin or printf.
1681 func_fallback_echo ()
1682 {
1683   eval 'cat <<_LTECHO_EOF
1684 \$[]1
1685 _LTECHO_EOF'
1686 }
1687
1688 # Quote evaled strings.
1689 for var in lt_decl_all_varnames([[ \
1690 ]], lt_decl_quote_varnames); do
1691     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1692     *[[\\\\\\\`\\"\\\$]]*)
1693       eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1694       ;;
1695     *)
1696       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1697       ;;
1698     esac
1699 done
1700
1701 # Double-quote double-evaled strings.
1702 for var in lt_decl_all_varnames([[ \
1703 ]], lt_decl_dquote_varnames); do
1704     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1705     *[[\\\\\\\`\\"\\\$]]*)
1706       eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1707       ;;
1708     *)
1709       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1710       ;;
1711     esac
1712 done
1713
1714 _LT_OUTPUT_LIBTOOL_INIT
1715 ])
1716
1717 # _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1718 # ------------------------------------
1719 # Generate a child script FILE with all initialization necessary to
1720 # reuse the environment learned by the parent script, and make the
1721 # file executable.  If COMMENT is supplied, it is inserted after the
1722 # `#!' sequence but before initialization text begins.  After this
1723 # macro, additional text can be appended to FILE to form the body of
1724 # the child script.  The macro ends with non-zero status if the
1725 # file could not be fully written (such as if the disk is full).
1726 m4_ifdef([AS_INIT_GENERATED],
1727 [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1728 [m4_defun([_LT_GENERATED_FILE_INIT],
1729 [m4_require([AS_PREPARE])]dnl
1730 [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1731 [lt_write_fail=0
1732 cat >$1 <<_ASEOF || lt_write_fail=1
1733 #! $SHELL
1734 # Generated by $as_me.
1735 $2
1736 SHELL=\${CONFIG_SHELL-$SHELL}
1737 export SHELL
1738 _ASEOF
1739 cat >>$1 <<\_ASEOF || lt_write_fail=1
1740 AS_SHELL_SANITIZE
1741 _AS_PREPARE
1742 exec AS_MESSAGE_FD>&1
1743 _ASEOF
1744 test $lt_write_fail = 0 && chmod +x $1[]dnl
1745 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1746
1747 # LT_OUTPUT
1748 # ---------
1749 # This macro allows early generation of the libtool script (before
1750 # AC_OUTPUT is called), incase it is used in configure for compilation
1751 # tests.
1752 AC_DEFUN([LT_OUTPUT],
1753 [: ${CONFIG_LT=./config.lt}
1754 AC_MSG_NOTICE([creating $CONFIG_LT])
1755 _LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1756 [# Run this file to recreate a libtool stub with the current configuration.])
1757
1758 cat >>"$CONFIG_LT" <<\_LTEOF
1759 lt_cl_silent=false
1760 exec AS_MESSAGE_LOG_FD>>config.log
1761 {
1762   echo
1763   AS_BOX([Running $as_me.])
1764 } >&AS_MESSAGE_LOG_FD
1765
1766 lt_cl_help="\
1767 \`$as_me' creates a local libtool stub from the current configuration,
1768 for use in further configure time tests before the real libtool is
1769 generated.
1770
1771 Usage: $[0] [[OPTIONS]]
1772
1773   -h, --help      print this help, then exit
1774   -V, --version   print version number, then exit
1775   -q, --quiet     do not print progress messages
1776   -d, --debug     don't remove temporary files
1777
1778 Report bugs to <bug-libtool@gnu.org>."
1779
1780 lt_cl_version="\
1781 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1782 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1783 configured by $[0], generated by m4_PACKAGE_STRING.
1784
1785 Copyright (C) 2011 Free Software Foundation, Inc.
1786 This config.lt script is free software; the Free Software Foundation
1787 gives unlimited permision to copy, distribute and modify it."
1788
1789 while test $[#] != 0
1790 do
1791   case $[1] in
1792     --version | --v* | -V )
1793       echo "$lt_cl_version"; exit 0 ;;
1794     --help | --h* | -h )
1795       echo "$lt_cl_help"; exit 0 ;;
1796     --debug | --d* | -d )
1797       debug=: ;;
1798     --quiet | --q* | --silent | --s* | -q )
1799       lt_cl_silent=: ;;
1800
1801     -*) AC_MSG_ERROR([unrecognized option: $[1]
1802 Try \`$[0] --help' for more information.]) ;;
1803
1804     *) AC_MSG_ERROR([unrecognized argument: $[1]
1805 Try \`$[0] --help' for more information.]) ;;
1806   esac
1807   shift
1808 done
1809
1810 if $lt_cl_silent; then
1811   exec AS_MESSAGE_FD>/dev/null
1812 fi
1813 _LTEOF
1814
1815 cat >>"$CONFIG_LT" <<_LTEOF
1816 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1817 _LTEOF
1818
1819 cat >>"$CONFIG_LT" <<\_LTEOF
1820 AC_MSG_NOTICE([creating $ofile])
1821 _LT_OUTPUT_LIBTOOL_COMMANDS
1822 AS_EXIT(0)
1823 _LTEOF
1824 chmod +x "$CONFIG_LT"
1825
1826 # configure is writing to config.log, but config.lt does its own redirection,
1827 # appending to config.log, which fails on DOS, as config.log is still kept
1828 # open by configure.  Here we exec the FD to /dev/null, effectively closing
1829 # config.log, so it can be properly (re)opened and appended to by config.lt.
1830 lt_cl_success=:
1831 test "$silent" = yes &&
1832   lt_config_lt_args="$lt_config_lt_args --quiet"
1833 exec AS_MESSAGE_LOG_FD>/dev/null
1834 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1835 exec AS_MESSAGE_LOG_FD>>config.log
1836 $lt_cl_success || AS_EXIT(1)
1837 ])# LT_OUTPUT
1838
1839
1840 # _LT_CONFIG(TAG)
1841 # ---------------
1842 # If TAG is the built-in tag, create an initial libtool script with a
1843 # default configuration from the untagged config vars.  Otherwise add code
1844 # to config.status for appending the configuration named by TAG from the
1845 # matching tagged config vars.
1846 m4_defun([_LT_CONFIG],
1847 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1848 _LT_CONFIG_SAVE_COMMANDS([
1849   m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1850   m4_if(_LT_TAG, [C], [
1851     # See if we are running on zsh, and set the options which allow our
1852     # commands through without removal of \ escapes.
1853     if test -n "${ZSH_VERSION+set}" ; then
1854       setopt NO_GLOB_SUBST
1855     fi
1856
1857     cfgfile="${ofile}T"
1858     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1859     $RM "$cfgfile"
1860
1861     cat <<_LT_EOF >> "$cfgfile"
1862 #! $SHELL
1863
1864 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1865 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1866 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1867 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
1868 #
1869 _LT_COPYING
1870 _LT_LIBTOOL_TAGS
1871
1872 # ### BEGIN LIBTOOL CONFIG
1873 _LT_LIBTOOL_CONFIG_VARS
1874 _LT_LIBTOOL_TAG_VARS
1875 # ### END LIBTOOL CONFIG
1876
1877 _LT_EOF
1878
1879   case $host_os in
1880   aix3*)
1881     cat <<\_LT_EOF >> "$cfgfile"
1882 # AIX sometimes has problems with the GCC collect2 program.  For some
1883 # reason, if we set the COLLECT_NAMES environment variable, the problems
1884 # vanish in a puff of smoke.
1885 if test "X${COLLECT_NAMES+set}" != Xset; then
1886   COLLECT_NAMES=
1887   export COLLECT_NAMES
1888 fi
1889 _LT_EOF
1890     ;;
1891   esac
1892
1893   _LT_PROG_LTMAIN
1894
1895   # We use sed instead of cat because bash on DJGPP gets confused if
1896   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1897   # text mode, it properly converts lines to CR/LF.  This bash problem
1898   # is reportedly fixed, but why not run on old versions too?
1899   sed '$q' "$ltmain" >> "$cfgfile" \
1900      || (rm -f "$cfgfile"; exit 1)
1901
1902   _LT_PROG_REPLACE_SHELLFNS
1903
1904    mv -f "$cfgfile" "$ofile" ||
1905     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1906   chmod +x "$ofile"
1907 ],
1908 [cat <<_LT_EOF >> "$ofile"
1909
1910 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1911 dnl in a comment (ie after a #).
1912 # ### BEGIN LIBTOOL TAG CONFIG: $1
1913 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
1914 # ### END LIBTOOL TAG CONFIG: $1
1915 _LT_EOF
1916 ])dnl /m4_if
1917 ],
1918 [m4_if([$1], [], [
1919     PACKAGE='$PACKAGE'
1920     VERSION='$VERSION'
1921     TIMESTAMP='$TIMESTAMP'
1922     RM='$RM'
1923     ofile='$ofile'], [])
1924 ])dnl /_LT_CONFIG_SAVE_COMMANDS
1925 ])# _LT_CONFIG
1926
1927
1928 # LT_SUPPORTED_TAG(TAG)
1929 # ---------------------
1930 # Trace this macro to discover what tags are supported by the libtool
1931 # --tag option, using:
1932 #    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1933 AC_DEFUN([LT_SUPPORTED_TAG], [])
1934
1935
1936 # C support is built-in for now
1937 m4_define([_LT_LANG_C_enabled], [])
1938 m4_define([_LT_TAGS], [])
1939
1940
1941 # LT_LANG(LANG)
1942 # -------------
1943 # Enable libtool support for the given language if not already enabled.
1944 AC_DEFUN([LT_LANG],
1945 [AC_BEFORE([$0], [LT_OUTPUT])dnl
1946 m4_case([$1],
1947   [C],                  [_LT_LANG(C)],
1948   [C++],                [_LT_LANG(CXX)],
1949   [Go],                 [_LT_LANG(GO)],
1950   [Java],               [_LT_LANG(GCJ)],
1951   [Fortran 77],         [_LT_LANG(F77)],
1952   [Fortran],            [_LT_LANG(FC)],
1953   [Windows Resource],   [_LT_LANG(RC)],
1954   [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1955     [_LT_LANG($1)],
1956     [m4_fatal([$0: unsupported language: "$1"])])])dnl
1957 ])# LT_LANG
1958
1959
1960 # _LT_LANG(LANGNAME)
1961 # ------------------
1962 m4_defun([_LT_LANG],
1963 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
1964   [LT_SUPPORTED_TAG([$1])dnl
1965   m4_append([_LT_TAGS], [$1 ])dnl
1966   m4_define([_LT_LANG_]$1[_enabled], [])dnl
1967   _LT_LANG_$1_CONFIG($1)])dnl
1968 ])# _LT_LANG
1969
1970
1971 m4_ifndef([AC_PROG_GO], [
1972 # NOTE: This macro has been submitted for inclusion into   #
1973 #  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1974 #  a released version of Autoconf we should remove this    #
1975 #  macro and use it instead.                               #
1976 m4_defun([AC_PROG_GO],
1977 [AC_LANG_PUSH(Go)dnl
1978 AC_ARG_VAR([GOC],     [Go compiler command])dnl
1979 AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1980 _AC_ARG_VAR_LDFLAGS()dnl
1981 AC_CHECK_TOOL(GOC, gccgo)
1982 if test -z "$GOC"; then
1983   if test -n "$ac_tool_prefix"; then
1984     AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1985   fi
1986 fi
1987 if test -z "$GOC"; then
1988   AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1989 fi
1990 ])#m4_defun
1991 ])#m4_ifndef
1992
1993
1994 # _LT_LANG_DEFAULT_CONFIG
1995 # -----------------------
1996 m4_defun([_LT_LANG_DEFAULT_CONFIG],
1997 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
1998   [LT_LANG(CXX)],
1999   [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
2000
2001 AC_PROVIDE_IFELSE([AC_PROG_F77],
2002   [LT_LANG(F77)],
2003   [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
2004
2005 AC_PROVIDE_IFELSE([AC_PROG_FC],
2006   [LT_LANG(FC)],
2007   [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
2008
2009 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
2010 dnl pulling things in needlessly.
2011 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
2012   [LT_LANG(GCJ)],
2013   [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
2014     [LT_LANG(GCJ)],
2015     [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
2016       [LT_LANG(GCJ)],
2017       [m4_ifdef([AC_PROG_GCJ],
2018         [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
2019        m4_ifdef([A][M_PROG_GCJ],
2020         [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
2021        m4_ifdef([LT_PROG_GCJ],
2022         [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
2023
2024 AC_PROVIDE_IFELSE([AC_PROG_GO],
2025   [LT_LANG(GO)],
2026   [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
2027
2028 AC_PROVIDE_IFELSE([LT_PROG_RC],
2029   [LT_LANG(RC)],
2030   [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
2031 ])# _LT_LANG_DEFAULT_CONFIG
2032
2033 # Obsolete macros:
2034 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
2035 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
2036 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
2037 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
2038 AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
2039 dnl aclocal-1.4 backwards compatibility:
2040 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
2041 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
2042 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
2043 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
2044 dnl AC_DEFUN([AC_LIBTOOL_RC], [])
2045
2046
2047 # _LT_TAG_COMPILER
2048 # ----------------
2049 m4_defun([_LT_TAG_COMPILER],
2050 [AC_REQUIRE([AC_PROG_CC])dnl
2051
2052 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
2053 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
2054 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
2055 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
2056
2057 # If no C compiler was specified, use CC.
2058 LTCC=${LTCC-"$CC"}
2059
2060 # If no C compiler flags were specified, use CFLAGS.
2061 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2062
2063 # Allow CC to be a program name with arguments.
2064 compiler=$CC
2065 ])# _LT_TAG_COMPILER
2066
2067
2068 # _LT_COMPILER_BOILERPLATE
2069 # ------------------------
2070 # Check for compiler boilerplate output or warnings with
2071 # the simple compiler test code.
2072 m4_defun([_LT_COMPILER_BOILERPLATE],
2073 [m4_require([_LT_DECL_SED])dnl
2074 ac_outfile=conftest.$ac_objext
2075 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
2076 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2077 _lt_compiler_boilerplate=`cat conftest.err`
2078 $RM conftest*
2079 ])# _LT_COMPILER_BOILERPLATE
2080
2081
2082 # _LT_LINKER_BOILERPLATE
2083 # ----------------------
2084 # Check for linker boilerplate output or warnings with
2085 # the simple link test code.
2086 m4_defun([_LT_LINKER_BOILERPLATE],
2087 [m4_require([_LT_DECL_SED])dnl
2088 ac_outfile=conftest.$ac_objext
2089 echo "$lt_simple_link_test_code" >conftest.$ac_ext
2090 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2091 _lt_linker_boilerplate=`cat conftest.err`
2092 $RM -r conftest*
2093 ])# _LT_LINKER_BOILERPLATE
2094
2095 # _LT_REQUIRED_DARWIN_CHECKS
2096 # -------------------------
2097 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
2098   case $host_os in
2099     rhapsody* | darwin*)
2100     AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
2101     AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
2102     AC_CHECK_TOOL([LIPO], [lipo], [:])
2103     AC_CHECK_TOOL([OTOOL], [otool], [:])
2104     AC_CHECK_TOOL([OTOOL64], [otool64], [:])
2105     _LT_DECL([], [DSYMUTIL], [1],
2106       [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
2107     _LT_DECL([], [NMEDIT], [1],
2108       [Tool to change global to local symbols on Mac OS X])
2109     _LT_DECL([], [LIPO], [1],
2110       [Tool to manipulate fat objects and archives on Mac OS X])
2111     _LT_DECL([], [OTOOL], [1],
2112       [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2113     _LT_DECL([], [OTOOL64], [1],
2114       [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2115
2116     AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2117       [lt_cv_apple_cc_single_mod=no
2118       if test -z "${LT_MULTI_MODULE}"; then
2119         # By default we will add the -single_module flag. You can override
2120         # by either setting the environment variable LT_MULTI_MODULE
2121         # non-empty at configure time, or by adding -multi_module to the
2122         # link flags.
2123         rm -rf libconftest.dylib*
2124         echo "int foo(void){return 1;}" > conftest.c
2125         echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2126 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2127         $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2128           -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2129         _lt_result=$?
2130         # If there is a non-empty error log, and "single_module"
2131         # appears in it, assume the flag caused a linker warning
2132         if test -s conftest.err && $GREP single_module conftest.err; then
2133           cat conftest.err >&AS_MESSAGE_LOG_FD
2134         # Otherwise, if the output was created with a 0 exit code from
2135         # the compiler, it worked.
2136         elif test -f libconftest.dylib && test $_lt_result -eq 0; then
2137           lt_cv_apple_cc_single_mod=yes
2138         else
2139           cat conftest.err >&AS_MESSAGE_LOG_FD
2140         fi
2141         rm -rf libconftest.dylib*
2142         rm -f conftest.*
2143       fi])
2144
2145     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2146       [lt_cv_ld_exported_symbols_list],
2147       [lt_cv_ld_exported_symbols_list=no
2148       save_LDFLAGS=$LDFLAGS
2149       echo "_main" > conftest.sym
2150       LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2151       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2152         [lt_cv_ld_exported_symbols_list=yes],
2153         [lt_cv_ld_exported_symbols_list=no])
2154         LDFLAGS="$save_LDFLAGS"
2155     ])
2156
2157     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2158       [lt_cv_ld_force_load=no
2159       cat > conftest.c << _LT_EOF
2160 int forced_loaded() { return 2;}
2161 _LT_EOF
2162       echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2163       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2164       echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2165       $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2166       echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2167       $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2168       cat > conftest.c << _LT_EOF
2169 int main() { return 0;}
2170 _LT_EOF
2171       echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2172       $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2173       _lt_result=$?
2174       if test -s conftest.err && $GREP force_load conftest.err; then
2175         cat conftest.err >&AS_MESSAGE_LOG_FD
2176       elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2177         lt_cv_ld_force_load=yes
2178       else
2179         cat conftest.err >&AS_MESSAGE_LOG_FD
2180       fi
2181         rm -f conftest.err libconftest.a conftest conftest.c
2182         rm -rf conftest.dSYM
2183     ])
2184     case $host_os in
2185     rhapsody* | darwin1.[[012]])
2186       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2187     darwin1.*)
2188       _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2189     darwin*) # darwin 5.x on
2190       # if running on 10.5 or later, the deployment target defaults
2191       # to the OS version, if on x86, and 10.4, the deployment
2192       # target defaults to 10.4. Don't you love it?
2193       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2194         10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2195           _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2196         10.[[012]]*)
2197           _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2198         10.*)
2199           _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2200       esac
2201     ;;
2202   esac
2203     if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2204       _lt_dar_single_mod='$single_module'
2205     fi
2206     if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2207       _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2208     else
2209       _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2210     fi
2211     if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2212       _lt_dsymutil='~$DSYMUTIL $lib || :'
2213     else
2214       _lt_dsymutil=
2215     fi
2216     ;;
2217   esac
2218 ])
2219
2220
2221 # _LT_DARWIN_LINKER_FEATURES([TAG])
2222 # ---------------------------------
2223 # Checks for linker and compiler features on darwin
2224 m4_defun([_LT_DARWIN_LINKER_FEATURES],
2225 [
2226   m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2227   _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2228   _LT_TAGVAR(hardcode_direct, $1)=no
2229   _LT_TAGVAR(hardcode_automatic, $1)=yes
2230   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2231   if test "$lt_cv_ld_force_load" = "yes"; then
2232     _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\"`'
2233     m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2234                   [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2235   else
2236     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2237   fi
2238   _LT_TAGVAR(link_all_deplibs, $1)=yes
2239   _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2240   case $cc_basename in
2241      ifort*) _lt_dar_can_shared=yes ;;
2242      *) _lt_dar_can_shared=$GCC ;;
2243   esac
2244   if test "$_lt_dar_can_shared" = "yes"; then
2245     output_verbose_link_cmd=func_echo_all
2246     _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}"
2247     _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2248     _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}"
2249     _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}"
2250     m4_if([$1], [CXX],
2251 [   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2252       _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}"
2253       _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}"
2254     fi
2255 ],[])
2256   else
2257   _LT_TAGVAR(ld_shlibs, $1)=no
2258   fi
2259 ])
2260
2261 # _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2262 # ----------------------------------
2263 # Links a minimal program and checks the executable
2264 # for the system default hardcoded library path. In most cases,
2265 # this is /usr/lib:/lib, but when the MPI compilers are used
2266 # the location of the communication and MPI libs are included too.
2267 # If we don't find anything, use the default library path according
2268 # to the aix ld manual.
2269 # Store the results from the different compilers for each TAGNAME.
2270 # Allow to override them for all tags through lt_cv_aix_libpath.
2271 m4_defun([_LT_SYS_MODULE_PATH_AIX],
2272 [m4_require([_LT_DECL_SED])dnl
2273 if test "${lt_cv_aix_libpath+set}" = set; then
2274   aix_libpath=$lt_cv_aix_libpath
2275 else
2276   AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2277   [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2278   lt_aix_libpath_sed='[
2279       /Import File Strings/,/^$/ {
2280           /^0/ {
2281               s/^0  *\([^ ]*\) *$/\1/
2282               p
2283           }
2284       }]'
2285   _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2286   # Check for a 64-bit object if we didn't find anything.
2287   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2288     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2289   fi],[])
2290   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2291     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2292   fi
2293   ])
2294   aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2295 fi
2296 ])# _LT_SYS_MODULE_PATH_AIX
2297
2298
2299 # _LT_SHELL_INIT(ARG)
2300 # -------------------
2301 m4_define([_LT_SHELL_INIT],
2302 [m4_divert_text([M4SH-INIT], [$1
2303 ])])# _LT_SHELL_INIT
2304
2305
2306
2307 # _LT_PROG_ECHO_BACKSLASH
2308 # -----------------------
2309 # Find how we can fake an echo command that does not interpret backslash.
2310 # In particular, with Autoconf 2.60 or later we add some code to the start
2311 # of the generated configure script which will find a shell with a builtin
2312 # printf (which we can use as an echo command).
2313 m4_defun([_LT_PROG_ECHO_BACKSLASH],
2314 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2315 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2316 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2317
2318 AC_MSG_CHECKING([how to print strings])
2319 # Test print first, because it will be a builtin if present.
2320 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2321    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2322   ECHO='print -r --'
2323 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2324   ECHO='printf %s\n'
2325 else
2326   # Use this function as a fallback that always works.
2327   func_fallback_echo ()
2328   {
2329     eval 'cat <<_LTECHO_EOF
2330 $[]1
2331 _LTECHO_EOF'
2332   }
2333   ECHO='func_fallback_echo'
2334 fi
2335
2336 # func_echo_all arg...
2337 # Invoke $ECHO with all args, space-separated.
2338 func_echo_all ()
2339 {
2340     $ECHO "$*" 
2341 }
2342
2343 case "$ECHO" in
2344   printf*) AC_MSG_RESULT([printf]) ;;
2345   print*) AC_MSG_RESULT([print -r]) ;;
2346   *) AC_MSG_RESULT([cat]) ;;
2347 esac
2348
2349 m4_ifdef([_AS_DETECT_SUGGESTED],
2350 [_AS_DETECT_SUGGESTED([
2351   test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2352     ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2353     ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2354     ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2355     PATH=/empty FPATH=/empty; export PATH FPATH
2356     test "X`printf %s $ECHO`" = "X$ECHO" \
2357       || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2358
2359 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2360 _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2361 ])# _LT_PROG_ECHO_BACKSLASH
2362
2363
2364 # _LT_WITH_SYSROOT
2365 # ----------------
2366 AC_DEFUN([_LT_WITH_SYSROOT],
2367 [AC_MSG_CHECKING([for sysroot])
2368 AC_ARG_WITH([sysroot],
2369 [  --with-sysroot[=DIR] Search for dependent libraries within DIR
2370                         (or the compiler's sysroot if not specified).],
2371 [], [with_sysroot=no])
2372
2373 dnl lt_sysroot will always be passed unquoted.  We quote it here
2374 dnl in case the user passed a directory name.
2375 lt_sysroot=
2376 case ${with_sysroot} in #(
2377  yes)
2378    if test "$GCC" = yes; then
2379      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2380    fi
2381    ;; #(
2382  /*)
2383    lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2384    ;; #(
2385  no|'')
2386    ;; #(
2387  *)
2388    AC_MSG_RESULT([${with_sysroot}])
2389    AC_MSG_ERROR([The sysroot must be an absolute path.])
2390    ;;
2391 esac
2392
2393  AC_MSG_RESULT([${lt_sysroot:-no}])
2394 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2395 [dependent libraries, and in which our libraries should be installed.])])
2396
2397 # _LT_ENABLE_LOCK
2398 # ---------------
2399 m4_defun([_LT_ENABLE_LOCK],
2400 [AC_ARG_ENABLE([libtool-lock],
2401   [AS_HELP_STRING([--disable-libtool-lock],
2402     [avoid locking (might break parallel builds)])])
2403 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2404
2405 # Some flags need to be propagated to the compiler or linker for good
2406 # libtool support.
2407 case $host in
2408 ia64-*-hpux*)
2409   # Find out which ABI we are using.
2410   echo 'int i;' > conftest.$ac_ext
2411   if AC_TRY_EVAL(ac_compile); then
2412     case `/usr/bin/file conftest.$ac_objext` in
2413       *ELF-32*)
2414         HPUX_IA64_MODE="32"
2415         ;;
2416       *ELF-64*)
2417         HPUX_IA64_MODE="64"
2418         ;;
2419     esac
2420   fi
2421   rm -rf conftest*
2422   ;;
2423 *-*-irix6*)
2424   # Find out which ABI we are using.
2425   echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2426   if AC_TRY_EVAL(ac_compile); then
2427     if test "$lt_cv_prog_gnu_ld" = yes; then
2428       case `/usr/bin/file conftest.$ac_objext` in
2429         *32-bit*)
2430           LD="${LD-ld} -melf32bsmip"
2431           ;;
2432         *N32*)
2433           LD="${LD-ld} -melf32bmipn32"
2434           ;;
2435         *64-bit*)
2436           LD="${LD-ld} -melf64bmip"
2437         ;;
2438       esac
2439     else
2440       case `/usr/bin/file conftest.$ac_objext` in
2441         *32-bit*)
2442           LD="${LD-ld} -32"
2443           ;;
2444         *N32*)
2445           LD="${LD-ld} -n32"
2446           ;;
2447         *64-bit*)
2448           LD="${LD-ld} -64"
2449           ;;
2450       esac
2451     fi
2452   fi
2453   rm -rf conftest*
2454   ;;
2455
2456 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2457 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2458   # Find out which ABI we are using.
2459   echo 'int i;' > conftest.$ac_ext
2460   if AC_TRY_EVAL(ac_compile); then
2461     case `/usr/bin/file conftest.o` in
2462       *32-bit*)
2463         case $host in
2464           x86_64-*kfreebsd*-gnu)
2465             LD="${LD-ld} -m elf_i386_fbsd"
2466             ;;
2467           x86_64-*linux*)
2468             LD="${LD-ld} -m elf_i386"
2469             ;;
2470           ppc64-*linux*|powerpc64-*linux*)
2471             LD="${LD-ld} -m elf32ppclinux"
2472             ;;
2473           s390x-*linux*)
2474             LD="${LD-ld} -m elf_s390"
2475             ;;
2476           sparc64-*linux*)
2477             LD="${LD-ld} -m elf32_sparc"
2478             ;;
2479         esac
2480         ;;
2481       *64-bit*)
2482         case $host in
2483           x86_64-*kfreebsd*-gnu)
2484             LD="${LD-ld} -m elf_x86_64_fbsd"
2485             ;;
2486           x86_64-*linux*)
2487             LD="${LD-ld} -m elf_x86_64"
2488             ;;
2489           ppc*-*linux*|powerpc*-*linux*)
2490             LD="${LD-ld} -m elf64ppc"
2491             ;;
2492           s390*-*linux*|s390*-*tpf*)
2493             LD="${LD-ld} -m elf64_s390"
2494             ;;
2495           sparc*-*linux*)
2496             LD="${LD-ld} -m elf64_sparc"
2497             ;;
2498         esac
2499         ;;
2500     esac
2501   fi
2502   rm -rf conftest*
2503   ;;
2504
2505 *-*-sco3.2v5*)
2506   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2507   SAVE_CFLAGS="$CFLAGS"
2508   CFLAGS="$CFLAGS -belf"
2509   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2510     [AC_LANG_PUSH(C)
2511      AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2512      AC_LANG_POP])
2513   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2514     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2515     CFLAGS="$SAVE_CFLAGS"
2516   fi
2517   ;;
2518 *-*solaris*)
2519   # Find out which ABI we are using.
2520   echo 'int i;' > conftest.$ac_ext
2521   if AC_TRY_EVAL(ac_compile); then
2522     case `/usr/bin/file conftest.o` in
2523     *64-bit*)
2524       case $lt_cv_prog_gnu_ld in
2525       yes*)
2526         case $host in
2527         i?86-*-solaris*)
2528           LD="${LD-ld} -m elf_x86_64"
2529           ;;
2530         sparc*-*-solaris*)
2531           LD="${LD-ld} -m elf64_sparc"
2532           ;;
2533         esac
2534         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2535         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2536           LD="${LD-ld}_sol2"
2537         fi
2538         ;;
2539       *)
2540         if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2541           LD="${LD-ld} -64"
2542         fi
2543         ;;
2544       esac
2545       ;;
2546     esac
2547   fi
2548   rm -rf conftest*
2549   ;;
2550 esac
2551
2552 need_locks="$enable_libtool_lock"
2553 ])# _LT_ENABLE_LOCK
2554
2555
2556 # _LT_PROG_AR
2557 # -----------
2558 m4_defun([_LT_PROG_AR],
2559 [AC_CHECK_TOOLS(AR, [ar], false)
2560 : ${AR=ar}
2561 : ${AR_FLAGS=cru}
2562 _LT_DECL([], [AR], [1], [The archiver])
2563 _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2564
2565 AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2566   [lt_cv_ar_at_file=no
2567    AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2568      [echo conftest.$ac_objext > conftest.lst
2569       lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2570       AC_TRY_EVAL([lt_ar_try])
2571       if test "$ac_status" -eq 0; then
2572         # Ensure the archiver fails upon bogus file names.
2573         rm -f conftest.$ac_objext libconftest.a
2574         AC_TRY_EVAL([lt_ar_try])
2575         if test "$ac_status" -ne 0; then
2576           lt_cv_ar_at_file=@
2577         fi
2578       fi
2579       rm -f conftest.* libconftest.a
2580      ])
2581   ])
2582
2583 if test "x$lt_cv_ar_at_file" = xno; then
2584   archiver_list_spec=
2585 else
2586   archiver_list_spec=$lt_cv_ar_at_file
2587 fi
2588 _LT_DECL([], [archiver_list_spec], [1],
2589   [How to feed a file listing to the archiver])
2590 ])# _LT_PROG_AR
2591
2592
2593 # _LT_CMD_OLD_ARCHIVE
2594 # -------------------
2595 m4_defun([_LT_CMD_OLD_ARCHIVE],
2596 [_LT_PROG_AR
2597
2598 AC_CHECK_TOOL(STRIP, strip, :)
2599 test -z "$STRIP" && STRIP=:
2600 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
2601
2602 AC_CHECK_TOOL(RANLIB, ranlib, :)
2603 test -z "$RANLIB" && RANLIB=:
2604 _LT_DECL([], [RANLIB], [1],
2605     [Commands used to install an old-style archive])
2606
2607 # Determine commands to create old-style static archives.
2608 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2609 old_postinstall_cmds='chmod 644 $oldlib'
2610 old_postuninstall_cmds=
2611
2612 if test -n "$RANLIB"; then
2613   case $host_os in
2614   openbsd*)
2615     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2616     ;;
2617   *)
2618     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2619     ;;
2620   esac
2621   old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2622 fi
2623
2624 case $host_os in
2625   darwin*)
2626     lock_old_archive_extraction=yes ;;
2627   *)
2628     lock_old_archive_extraction=no ;;
2629 esac
2630 _LT_DECL([], [old_postinstall_cmds], [2])
2631 _LT_DECL([], [old_postuninstall_cmds], [2])
2632 _LT_TAGDECL([], [old_archive_cmds], [2],
2633     [Commands used to build an old-style archive])
2634 _LT_DECL([], [lock_old_archive_extraction], [0],
2635     [Whether to use a lock for old archive extraction])
2636 ])# _LT_CMD_OLD_ARCHIVE
2637
2638
2639 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2640 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2641 # ----------------------------------------------------------------
2642 # Check whether the given compiler option works
2643 AC_DEFUN([_LT_COMPILER_OPTION],
2644 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2645 m4_require([_LT_DECL_SED])dnl
2646 AC_CACHE_CHECK([$1], [$2],
2647   [$2=no
2648    m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2649    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2650    lt_compiler_flag="$3"
2651    # Insert the option either (1) after the last *FLAGS variable, or
2652    # (2) before a word containing "conftest.", or (3) at the end.
2653    # Note that $ac_compile itself does not contain backslashes and begins
2654    # with a dollar sign (not a hyphen), so the echo should work correctly.
2655    # The option is referenced via a variable to avoid confusing sed.
2656    lt_compile=`echo "$ac_compile" | $SED \
2657    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2658    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2659    -e 's:$: $lt_compiler_flag:'`
2660    (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2661    (eval "$lt_compile" 2>conftest.err)
2662    ac_status=$?
2663    cat conftest.err >&AS_MESSAGE_LOG_FD
2664    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2665    if (exit $ac_status) && test -s "$ac_outfile"; then
2666      # The compiler can only warn and ignore the option if not recognized
2667      # So say no if there are warnings other than the usual output.
2668      $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2669      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2670      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2671        $2=yes
2672      fi
2673    fi
2674    $RM conftest*
2675 ])
2676
2677 if test x"[$]$2" = xyes; then
2678     m4_if([$5], , :, [$5])
2679 else
2680     m4_if([$6], , :, [$6])
2681 fi
2682 ])# _LT_COMPILER_OPTION
2683
2684 # Old name:
2685 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2686 dnl aclocal-1.4 backwards compatibility:
2687 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2688
2689
2690 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2691 #                  [ACTION-SUCCESS], [ACTION-FAILURE])
2692 # ----------------------------------------------------
2693 # Check whether the given linker option works
2694 AC_DEFUN([_LT_LINKER_OPTION],
2695 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2696 m4_require([_LT_DECL_SED])dnl
2697 AC_CACHE_CHECK([$1], [$2],
2698   [$2=no
2699    save_LDFLAGS="$LDFLAGS"
2700    LDFLAGS="$LDFLAGS $3"
2701    echo "$lt_simple_link_test_code" > conftest.$ac_ext
2702    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2703      # The linker can only warn and ignore the option if not recognized
2704      # So say no if there are warnings
2705      if test -s conftest.err; then
2706        # Append any errors to the config.log.
2707        cat conftest.err 1>&AS_MESSAGE_LOG_FD
2708        $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2709        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2710        if diff conftest.exp conftest.er2 >/dev/null; then
2711          $2=yes
2712        fi
2713      else
2714        $2=yes
2715      fi
2716    fi
2717    $RM -r conftest*
2718    LDFLAGS="$save_LDFLAGS"
2719 ])
2720
2721 if test x"[$]$2" = xyes; then
2722     m4_if([$4], , :, [$4])
2723 else
2724     m4_if([$5], , :, [$5])
2725 fi
2726 ])# _LT_LINKER_OPTION
2727
2728 # Old name:
2729 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2730 dnl aclocal-1.4 backwards compatibility:
2731 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2732
2733
2734 # LT_CMD_MAX_LEN
2735 #---------------
2736 AC_DEFUN([LT_CMD_MAX_LEN],
2737 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2738 # find the maximum length of command line arguments
2739 AC_MSG_CHECKING([the maximum length of command line arguments])
2740 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2741   i=0
2742   teststring="ABCD"
2743
2744   case $build_os in
2745   msdosdjgpp*)
2746     # On DJGPP, this test can blow up pretty badly due to problems in libc
2747     # (any single argument exceeding 2000 bytes causes a buffer overrun
2748     # during glob expansion).  Even if it were fixed, the result of this
2749     # check would be larger than it should be.
2750     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2751     ;;
2752
2753   gnu*)
2754     # Under GNU Hurd, this test is not required because there is
2755     # no limit to the length of command line arguments.
2756     # Libtool will interpret -1 as no limit whatsoever
2757     lt_cv_sys_max_cmd_len=-1;
2758     ;;
2759
2760   cygwin* | mingw* | cegcc*)
2761     # On Win9x/ME, this test blows up -- it succeeds, but takes
2762     # about 5 minutes as the teststring grows exponentially.
2763     # Worse, since 9x/ME are not pre-emptively multitasking,
2764     # you end up with a "frozen" computer, even though with patience
2765     # the test eventually succeeds (with a max line length of 256k).
2766     # Instead, let's just punt: use the minimum linelength reported by
2767     # all of the supported platforms: 8192 (on NT/2K/XP).
2768     lt_cv_sys_max_cmd_len=8192;
2769     ;;
2770
2771   mint*)
2772     # On MiNT this can take a long time and run out of memory.
2773     lt_cv_sys_max_cmd_len=8192;
2774     ;;
2775
2776   amigaos*)
2777     # On AmigaOS with pdksh, this test takes hours, literally.
2778     # So we just punt and use a minimum line length of 8192.
2779     lt_cv_sys_max_cmd_len=8192;
2780     ;;
2781
2782   netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2783     # This has been around since 386BSD, at least.  Likely further.
2784     if test -x /sbin/sysctl; then
2785       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2786     elif test -x /usr/sbin/sysctl; then
2787       lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2788     else
2789       lt_cv_sys_max_cmd_len=65536       # usable default for all BSDs
2790     fi
2791     # And add a safety zone
2792     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2793     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2794     ;;
2795
2796   interix*)
2797     # We know the value 262144 and hardcode it with a safety zone (like BSD)
2798     lt_cv_sys_max_cmd_len=196608
2799     ;;
2800
2801   os2*)
2802     # The test takes a long time on OS/2.
2803     lt_cv_sys_max_cmd_len=8192
2804     ;;
2805
2806   osf*)
2807     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2808     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2809     # nice to cause kernel panics so lets avoid the loop below.
2810     # First set a reasonable default.
2811     lt_cv_sys_max_cmd_len=16384
2812     #
2813     if test -x /sbin/sysconfig; then
2814       case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2815         *1*) lt_cv_sys_max_cmd_len=-1 ;;
2816       esac
2817     fi
2818     ;;
2819   sco3.2v5*)
2820     lt_cv_sys_max_cmd_len=102400
2821     ;;
2822   sysv5* | sco5v6* | sysv4.2uw2*)
2823     kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2824     if test -n "$kargmax"; then
2825       lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[         ]]//'`
2826     else
2827       lt_cv_sys_max_cmd_len=32768
2828     fi
2829     ;;
2830   *)
2831     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2832     if test -n "$lt_cv_sys_max_cmd_len"; then
2833       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2834       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2835     else
2836       # Make teststring a little bigger before we do anything with it.
2837       # a 1K string should be a reasonable start.
2838       for i in 1 2 3 4 5 6 7 8 ; do
2839         teststring=$teststring$teststring
2840       done
2841       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2842       # If test is not a shell built-in, we'll probably end up computing a
2843       # maximum length that is only half of the actual maximum length, but
2844       # we can't tell.
2845       while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2846                  = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2847               test $i != 17 # 1/2 MB should be enough
2848       do
2849         i=`expr $i + 1`
2850         teststring=$teststring$teststring
2851       done
2852       # Only check the string length outside the loop.
2853       lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2854       teststring=
2855       # Add a significant safety factor because C++ compilers can tack on
2856       # massive amounts of additional arguments before passing them to the
2857       # linker.  It appears as though 1/2 is a usable value.
2858       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2859     fi
2860     ;;
2861   esac
2862 ])
2863 if test -n $lt_cv_sys_max_cmd_len ; then
2864   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2865 else
2866   AC_MSG_RESULT(none)
2867 fi
2868 max_cmd_len=$lt_cv_sys_max_cmd_len
2869 _LT_DECL([], [max_cmd_len], [0],
2870     [What is the maximum length of a command?])
2871 ])# LT_CMD_MAX_LEN
2872
2873 # Old name:
2874 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2875 dnl aclocal-1.4 backwards compatibility:
2876 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2877
2878
2879 # _LT_HEADER_DLFCN
2880 # ----------------
2881 m4_defun([_LT_HEADER_DLFCN],
2882 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2883 ])# _LT_HEADER_DLFCN
2884
2885
2886 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2887 #                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2888 # ----------------------------------------------------------------
2889 m4_defun([_LT_TRY_DLOPEN_SELF],
2890 [m4_require([_LT_HEADER_DLFCN])dnl
2891 if test "$cross_compiling" = yes; then :
2892   [$4]
2893 else
2894   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2895   lt_status=$lt_dlunknown
2896   cat > conftest.$ac_ext <<_LT_EOF
2897 [#line $LINENO "configure"
2898 #include "confdefs.h"
2899
2900 #if HAVE_DLFCN_H
2901 #include <dlfcn.h>
2902 #endif
2903
2904 #include <stdio.h>
2905
2906 #ifdef RTLD_GLOBAL
2907 #  define LT_DLGLOBAL           RTLD_GLOBAL
2908 #else
2909 #  ifdef DL_GLOBAL
2910 #    define LT_DLGLOBAL         DL_GLOBAL
2911 #  else
2912 #    define LT_DLGLOBAL         0
2913 #  endif
2914 #endif
2915
2916 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2917    find out it does not work in some platform. */
2918 #ifndef LT_DLLAZY_OR_NOW
2919 #  ifdef RTLD_LAZY
2920 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
2921 #  else
2922 #    ifdef DL_LAZY
2923 #      define LT_DLLAZY_OR_NOW          DL_LAZY
2924 #    else
2925 #      ifdef RTLD_NOW
2926 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
2927 #      else
2928 #        ifdef DL_NOW
2929 #          define LT_DLLAZY_OR_NOW      DL_NOW
2930 #        else
2931 #          define LT_DLLAZY_OR_NOW      0
2932 #        endif
2933 #      endif
2934 #    endif
2935 #  endif
2936 #endif
2937
2938 /* When -fvisbility=hidden is used, assume the code has been annotated
2939    correspondingly for the symbols needed.  */
2940 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2941 int fnord () __attribute__((visibility("default")));
2942 #endif
2943
2944 int fnord () { return 42; }
2945 int main ()
2946 {
2947   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2948   int status = $lt_dlunknown;
2949
2950   if (self)
2951     {
2952       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2953       else
2954         {
2955           if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2956           else puts (dlerror ());
2957         }
2958       /* dlclose (self); */
2959     }
2960   else
2961     puts (dlerror ());
2962
2963   return status;
2964 }]
2965 _LT_EOF
2966   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2967     (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2968     lt_status=$?
2969     case x$lt_status in
2970       x$lt_dlno_uscore) $1 ;;
2971       x$lt_dlneed_uscore) $2 ;;
2972       x$lt_dlunknown|x*) $3 ;;
2973     esac
2974   else :
2975     # compilation failed
2976     $3
2977   fi
2978 fi
2979 rm -fr conftest*
2980 ])# _LT_TRY_DLOPEN_SELF
2981
2982
2983 # LT_SYS_DLOPEN_SELF
2984 # ------------------
2985 AC_DEFUN([LT_SYS_DLOPEN_SELF],
2986 [m4_require([_LT_HEADER_DLFCN])dnl
2987 if test "x$enable_dlopen" != xyes; then
2988   enable_dlopen=unknown
2989   enable_dlopen_self=unknown
2990   enable_dlopen_self_static=unknown
2991 else
2992   lt_cv_dlopen=no
2993   lt_cv_dlopen_libs=
2994
2995   case $host_os in
2996   beos*)
2997     lt_cv_dlopen="load_add_on"
2998     lt_cv_dlopen_libs=
2999     lt_cv_dlopen_self=yes
3000     ;;
3001
3002   mingw* | pw32* | cegcc*)
3003     lt_cv_dlopen="LoadLibrary"
3004     lt_cv_dlopen_libs=
3005     ;;
3006
3007   cygwin*)
3008     lt_cv_dlopen="dlopen"
3009     lt_cv_dlopen_libs=
3010     ;;
3011
3012   darwin*)
3013   # if libdl is installed we need to link against it
3014     AC_CHECK_LIB([dl], [dlopen],
3015                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
3016     lt_cv_dlopen="dyld"
3017     lt_cv_dlopen_libs=
3018     lt_cv_dlopen_self=yes
3019     ])
3020     ;;
3021
3022   *)
3023     AC_CHECK_FUNC([shl_load],
3024           [lt_cv_dlopen="shl_load"],
3025       [AC_CHECK_LIB([dld], [shl_load],
3026             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
3027         [AC_CHECK_FUNC([dlopen],
3028               [lt_cv_dlopen="dlopen"],
3029           [AC_CHECK_LIB([dl], [dlopen],
3030                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
3031             [AC_CHECK_LIB([svld], [dlopen],
3032                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
3033               [AC_CHECK_LIB([dld], [dld_link],
3034                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
3035               ])
3036             ])
3037           ])
3038         ])
3039       ])
3040     ;;
3041   esac
3042
3043   if test "x$lt_cv_dlopen" != xno; then
3044     enable_dlopen=yes
3045   else
3046     enable_dlopen=no
3047   fi
3048
3049   case $lt_cv_dlopen in
3050   dlopen)
3051     save_CPPFLAGS="$CPPFLAGS"
3052     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
3053
3054     save_LDFLAGS="$LDFLAGS"
3055     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
3056
3057     save_LIBS="$LIBS"
3058     LIBS="$lt_cv_dlopen_libs $LIBS"
3059
3060     AC_CACHE_CHECK([whether a program can dlopen itself],
3061           lt_cv_dlopen_self, [dnl
3062           _LT_TRY_DLOPEN_SELF(
3063             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
3064             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
3065     ])
3066
3067     if test "x$lt_cv_dlopen_self" = xyes; then
3068       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
3069       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
3070           lt_cv_dlopen_self_static, [dnl
3071           _LT_TRY_DLOPEN_SELF(
3072             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
3073             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
3074       ])
3075     fi
3076
3077     CPPFLAGS="$save_CPPFLAGS"
3078     LDFLAGS="$save_LDFLAGS"
3079     LIBS="$save_LIBS"
3080     ;;
3081   esac
3082
3083   case $lt_cv_dlopen_self in
3084   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
3085   *) enable_dlopen_self=unknown ;;
3086   esac
3087
3088   case $lt_cv_dlopen_self_static in
3089   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
3090   *) enable_dlopen_self_static=unknown ;;
3091   esac
3092 fi
3093 _LT_DECL([dlopen_support], [enable_dlopen], [0],
3094          [Whether dlopen is supported])
3095 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
3096          [Whether dlopen of programs is supported])
3097 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
3098          [Whether dlopen of statically linked programs is supported])
3099 ])# LT_SYS_DLOPEN_SELF
3100
3101 # Old name:
3102 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
3103 dnl aclocal-1.4 backwards compatibility:
3104 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
3105
3106
3107 # _LT_COMPILER_C_O([TAGNAME])
3108 # ---------------------------
3109 # Check to see if options -c and -o are simultaneously supported by compiler.
3110 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
3111 m4_defun([_LT_COMPILER_C_O],
3112 [m4_require([_LT_DECL_SED])dnl
3113 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3114 m4_require([_LT_TAG_COMPILER])dnl
3115 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3116   [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3117   [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3118    $RM -r conftest 2>/dev/null
3119    mkdir conftest
3120    cd conftest
3121    mkdir out
3122    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3123
3124    lt_compiler_flag="-o out/conftest2.$ac_objext"
3125    # Insert the option either (1) after the last *FLAGS variable, or
3126    # (2) before a word containing "conftest.", or (3) at the end.
3127    # Note that $ac_compile itself does not contain backslashes and begins
3128    # with a dollar sign (not a hyphen), so the echo should work correctly.
3129    lt_compile=`echo "$ac_compile" | $SED \
3130    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3131    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3132    -e 's:$: $lt_compiler_flag:'`
3133    (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3134    (eval "$lt_compile" 2>out/conftest.err)
3135    ac_status=$?
3136    cat out/conftest.err >&AS_MESSAGE_LOG_FD
3137    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3138    if (exit $ac_status) && test -s out/conftest2.$ac_objext
3139    then
3140      # The compiler can only warn and ignore the option if not recognized
3141      # So say no if there are warnings
3142      $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3143      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3144      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3145        _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3146      fi
3147    fi
3148    chmod u+w . 2>&AS_MESSAGE_LOG_FD
3149    $RM conftest*
3150    # SGI C++ compiler will create directory out/ii_files/ for
3151    # template instantiation
3152    test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3153    $RM out/* && rmdir out
3154    cd ..
3155    $RM -r conftest
3156    $RM conftest*
3157 ])
3158 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3159         [Does compiler simultaneously support -c and -o options?])
3160 ])# _LT_COMPILER_C_O
3161
3162
3163 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
3164 # ----------------------------------
3165 # Check to see if we can do hard links to lock some files if needed
3166 m4_defun([_LT_COMPILER_FILE_LOCKS],
3167 [m4_require([_LT_ENABLE_LOCK])dnl
3168 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3169 _LT_COMPILER_C_O([$1])
3170
3171 hard_links="nottested"
3172 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3173   # do not overwrite the value of need_locks provided by the user
3174   AC_MSG_CHECKING([if we can lock with hard links])
3175   hard_links=yes
3176   $RM conftest*
3177   ln conftest.a conftest.b 2>/dev/null && hard_links=no
3178   touch conftest.a
3179   ln conftest.a conftest.b 2>&5 || hard_links=no
3180   ln conftest.a conftest.b 2>/dev/null && hard_links=no
3181   AC_MSG_RESULT([$hard_links])
3182   if test "$hard_links" = no; then
3183     AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3184     need_locks=warn
3185   fi
3186 else
3187   need_locks=no
3188 fi
3189 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3190 ])# _LT_COMPILER_FILE_LOCKS
3191
3192
3193 # _LT_CHECK_OBJDIR
3194 # ----------------
3195 m4_defun([_LT_CHECK_OBJDIR],
3196 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3197 [rm -f .libs 2>/dev/null
3198 mkdir .libs 2>/dev/null
3199 if test -d .libs; then
3200   lt_cv_objdir=.libs
3201 else
3202   # MS-DOS does not allow filenames that begin with a dot.
3203   lt_cv_objdir=_libs
3204 fi
3205 rmdir .libs 2>/dev/null])
3206 objdir=$lt_cv_objdir
3207 _LT_DECL([], [objdir], [0],
3208          [The name of the directory that contains temporary libtool files])dnl
3209 m4_pattern_allow([LT_OBJDIR])dnl
3210 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3211   [Define to the sub-directory in which libtool stores uninstalled libraries.])
3212 ])# _LT_CHECK_OBJDIR
3213
3214
3215 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3216 # --------------------------------------
3217 # Check hardcoding attributes.
3218 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3219 [AC_MSG_CHECKING([how to hardcode library paths into programs])
3220 _LT_TAGVAR(hardcode_action, $1)=
3221 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3222    test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3223    test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3224
3225   # We can hardcode non-existent directories.
3226   if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3227      # If the only mechanism to avoid hardcoding is shlibpath_var, we
3228      # have to relink, otherwise we might link with an installed library
3229      # when we should be linking with a yet-to-be-installed one
3230      ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3231      test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3232     # Linking always hardcodes the temporary library directory.
3233     _LT_TAGVAR(hardcode_action, $1)=relink
3234   else
3235     # We can link without hardcoding, and we can hardcode nonexisting dirs.
3236     _LT_TAGVAR(hardcode_action, $1)=immediate
3237   fi
3238 else
3239   # We cannot hardcode anything, or else we can only hardcode existing
3240   # directories.
3241   _LT_TAGVAR(hardcode_action, $1)=unsupported
3242 fi
3243 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3244
3245 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3246    test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3247   # Fast installation is not supported
3248   enable_fast_install=no
3249 elif test "$shlibpath_overrides_runpath" = yes ||
3250      test "$enable_shared" = no; then
3251   # Fast installation is not necessary
3252   enable_fast_install=needless
3253 fi
3254 _LT_TAGDECL([], [hardcode_action], [0],
3255     [How to hardcode a shared library path into an executable])
3256 ])# _LT_LINKER_HARDCODE_LIBPATH
3257
3258
3259 # _LT_CMD_STRIPLIB
3260 # ----------------
3261 m4_defun([_LT_CMD_STRIPLIB],
3262 [m4_require([_LT_DECL_EGREP])
3263 striplib=
3264 old_striplib=
3265 AC_MSG_CHECKING([whether stripping libraries is possible])
3266 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3267   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3268   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3269   AC_MSG_RESULT([yes])
3270 else
3271 # FIXME - insert some real tests, host_os isn't really good enough
3272   case $host_os in
3273   darwin*)
3274     if test -n "$STRIP" ; then
3275       striplib="$STRIP -x"
3276       old_striplib="$STRIP -S"
3277       AC_MSG_RESULT([yes])
3278     else
3279       AC_MSG_RESULT([no])
3280     fi
3281     ;;
3282   *)
3283     AC_MSG_RESULT([no])
3284     ;;
3285   esac
3286 fi
3287 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3288 _LT_DECL([], [striplib], [1])
3289 ])# _LT_CMD_STRIPLIB
3290
3291
3292 # _LT_SYS_DYNAMIC_LINKER([TAG])
3293 # -----------------------------
3294 # PORTME Fill in your ld.so characteristics
3295 m4_defun([_LT_SYS_DYNAMIC_LINKER],
3296 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3297 m4_require([_LT_DECL_EGREP])dnl
3298 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3299 m4_require([_LT_DECL_OBJDUMP])dnl
3300 m4_require([_LT_DECL_SED])dnl
3301 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3302 AC_MSG_CHECKING([dynamic linker characteristics])
3303 m4_if([$1],
3304         [], [
3305 if test "$GCC" = yes; then
3306   case $host_os in
3307     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3308     *) lt_awk_arg="/^libraries:/" ;;
3309   esac
3310   case $host_os in
3311     mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3312     *) lt_sed_strip_eq="s,=/,/,g" ;;
3313   esac
3314   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3315   case $lt_search_path_spec in
3316   *\;*)
3317     # if the path contains ";" then we assume it to be the separator
3318     # otherwise default to the standard path separator (i.e. ":") - it is
3319     # assumed that no part of a normal pathname contains ";" but that should
3320     # okay in the real world where ";" in dirpaths is itself problematic.
3321     lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3322     ;;
3323   *)
3324     lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3325     ;;
3326   esac
3327   # Ok, now we have the path, separated by spaces, we can step through it
3328   # and add multilib dir if necessary.
3329   lt_tmp_lt_search_path_spec=
3330   lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3331   for lt_sys_path in $lt_search_path_spec; do
3332     if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3333       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3334     else
3335       test -d "$lt_sys_path" && \
3336         lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3337     fi
3338   done
3339   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3340 BEGIN {RS=" "; FS="/|\n";} {
3341   lt_foo="";
3342   lt_count=0;
3343   for (lt_i = NF; lt_i > 0; lt_i--) {
3344     if ($lt_i != "" && $lt_i != ".") {
3345       if ($lt_i == "..") {
3346         lt_count++;
3347       } else {
3348         if (lt_count == 0) {
3349           lt_foo="/" $lt_i lt_foo;
3350         } else {
3351           lt_count--;
3352         }
3353       }
3354     }
3355   }
3356   if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3357   if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3358 }'`
3359   # AWK program above erroneously prepends '/' to C:/dos/paths
3360   # for these hosts.
3361   case $host_os in
3362     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3363       $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3364   esac
3365   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3366 else
3367   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3368 fi])
3369 library_names_spec=
3370 libname_spec='lib$name'
3371 soname_spec=
3372 shrext_cmds=".so"
3373 postinstall_cmds=
3374 postuninstall_cmds=
3375 finish_cmds=
3376 finish_eval=
3377 shlibpath_var=
3378 shlibpath_overrides_runpath=unknown
3379 version_type=none
3380 dynamic_linker="$host_os ld.so"
3381 sys_lib_dlsearch_path_spec="/lib /usr/lib"
3382 need_lib_prefix=unknown
3383 hardcode_into_libs=no
3384
3385 # when you set need_version to no, make sure it does not cause -set_version
3386 # flags to be left without arguments
3387 need_version=unknown
3388
3389 case $host_os in
3390 aix3*)
3391   version_type=linux # correct to gnu/linux during the next big refactor
3392   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3393   shlibpath_var=LIBPATH
3394
3395   # AIX 3 has no versioning support, so we append a major version to the name.
3396   soname_spec='${libname}${release}${shared_ext}$major'
3397   ;;
3398
3399 aix[[4-9]]*)
3400   version_type=linux # correct to gnu/linux during the next big refactor
3401   need_lib_prefix=no
3402   need_version=no
3403   hardcode_into_libs=yes
3404   if test "$host_cpu" = ia64; then
3405     # AIX 5 supports IA64
3406     library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3407     shlibpath_var=LD_LIBRARY_PATH
3408   else
3409     # With GCC up to 2.95.x, collect2 would create an import file
3410     # for dependence libraries.  The import file would start with
3411     # the line `#! .'.  This would cause the generated library to
3412     # depend on `.', always an invalid library.  This was fixed in
3413     # development snapshots of GCC prior to 3.0.
3414     case $host_os in
3415       aix4 | aix4.[[01]] | aix4.[[01]].*)
3416       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3417            echo ' yes '
3418            echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3419         :
3420       else
3421         can_build_shared=no
3422       fi
3423       ;;
3424     esac
3425     # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3426     # soname into executable. Probably we can add versioning support to
3427     # collect2, so additional links can be useful in future.
3428     if test "$aix_use_runtimelinking" = yes; then
3429       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3430       # instead of lib<name>.a to let people know that these are not
3431       # typical AIX shared libraries.
3432       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3433     else
3434       # We preserve .a as extension for shared libraries through AIX4.2
3435       # and later when we are not doing run time linking.
3436       library_names_spec='${libname}${release}.a $libname.a'
3437       soname_spec='${libname}${release}${shared_ext}$major'
3438     fi
3439     shlibpath_var=LIBPATH
3440   fi
3441   ;;
3442
3443 amigaos*)
3444   case $host_cpu in
3445   powerpc)
3446     # Since July 2007 AmigaOS4 officially supports .so libraries.
3447     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3448     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3449     ;;
3450   m68k)
3451     library_names_spec='$libname.ixlibrary $libname.a'
3452     # Create ${libname}_ixlibrary.a entries in /sys/libs.
3453     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'
3454     ;;
3455   esac
3456   ;;
3457
3458 beos*)
3459   library_names_spec='${libname}${shared_ext}'
3460   dynamic_linker="$host_os ld.so"
3461   shlibpath_var=LIBRARY_PATH
3462   ;;
3463
3464 bsdi[[45]]*)
3465   version_type=linux # correct to gnu/linux during the next big refactor
3466   need_version=no
3467   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3468   soname_spec='${libname}${release}${shared_ext}$major'
3469   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3470   shlibpath_var=LD_LIBRARY_PATH
3471   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3472   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3473   # the default ld.so.conf also contains /usr/contrib/lib and
3474   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3475   # libtool to hard-code these into programs
3476   ;;
3477
3478 cygwin* | mingw* | pw32* | cegcc*)
3479   version_type=windows
3480   shrext_cmds=".dll"
3481   need_version=no
3482   need_lib_prefix=no
3483
3484   case $GCC,$cc_basename in
3485   yes,*)
3486     # gcc
3487     library_names_spec='$libname.dll.a'
3488     # DLL is installed to $(libdir)/../bin by postinstall_cmds
3489     postinstall_cmds='base_file=`basename \${file}`~
3490       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3491       dldir=$destdir/`dirname \$dlpath`~
3492       test -d \$dldir || mkdir -p \$dldir~
3493       $install_prog $dir/$dlname \$dldir/$dlname~
3494       chmod a+x \$dldir/$dlname~
3495       if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3496         eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3497       fi'
3498     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3499       dlpath=$dir/\$dldll~
3500        $RM \$dlpath'
3501     shlibpath_overrides_runpath=yes
3502
3503     case $host_os in
3504     cygwin*)
3505       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3506       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3507 m4_if([$1], [],[
3508       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3509       ;;
3510     mingw* | cegcc*)
3511       # MinGW DLLs use traditional 'lib' prefix
3512       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3513       ;;
3514     pw32*)
3515       # pw32 DLLs use 'pw' prefix rather than 'lib'
3516       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3517       ;;
3518     esac
3519     dynamic_linker='Win32 ld.exe'
3520     ;;
3521
3522   *,cl*)
3523     # Native MSVC
3524     libname_spec='$name'
3525     soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3526     library_names_spec='${libname}.dll.lib'
3527
3528     case $build_os in
3529     mingw*)
3530       sys_lib_search_path_spec=
3531       lt_save_ifs=$IFS
3532       IFS=';'
3533       for lt_path in $LIB
3534       do
3535         IFS=$lt_save_ifs
3536         # Let DOS variable expansion print the short 8.3 style file name.
3537         lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3538         sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3539       done
3540       IFS=$lt_save_ifs
3541       # Convert to MSYS style.
3542       sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3543       ;;
3544     cygwin*)
3545       # Convert to unix form, then to dos form, then back to unix form
3546       # but this time dos style (no spaces!) so that the unix form looks
3547       # like /cygdrive/c/PROGRA~1:/cygdr...
3548       sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3549       sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3550       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3551       ;;
3552     *)
3553       sys_lib_search_path_spec="$LIB"
3554       if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3555         # It is most probably a Windows format PATH.
3556         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3557       else
3558         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3559       fi
3560       # FIXME: find the short name or the path components, as spaces are
3561       # common. (e.g. "Program Files" -> "PROGRA~1")
3562       ;;
3563     esac
3564
3565     # DLL is installed to $(libdir)/../bin by postinstall_cmds
3566     postinstall_cmds='base_file=`basename \${file}`~
3567       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3568       dldir=$destdir/`dirname \$dlpath`~
3569       test -d \$dldir || mkdir -p \$dldir~
3570       $install_prog $dir/$dlname \$dldir/$dlname'
3571     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3572       dlpath=$dir/\$dldll~
3573        $RM \$dlpath'
3574     shlibpath_overrides_runpath=yes
3575     dynamic_linker='Win32 link.exe'
3576     ;;
3577
3578   *)
3579     # Assume MSVC wrapper
3580     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3581     dynamic_linker='Win32 ld.exe'
3582     ;;
3583   esac
3584   # FIXME: first we should search . and the directory the executable is in
3585   shlibpath_var=PATH
3586   ;;
3587
3588 darwin* | rhapsody*)
3589   dynamic_linker="$host_os dyld"
3590   version_type=darwin
3591   need_lib_prefix=no
3592   need_version=no
3593   library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3594   soname_spec='${libname}${release}${major}$shared_ext'
3595   shlibpath_overrides_runpath=yes
3596   shlibpath_var=DYLD_LIBRARY_PATH
3597   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3598 m4_if([$1], [],[
3599   sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3600   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3601   ;;
3602
3603 dgux*)
3604   version_type=linux # correct to gnu/linux during the next big refactor
3605   need_lib_prefix=no
3606   need_version=no
3607   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3608   soname_spec='${libname}${release}${shared_ext}$major'
3609   shlibpath_var=LD_LIBRARY_PATH
3610   ;;
3611
3612 freebsd* | dragonfly*)
3613   # DragonFly does not have aout.  When/if they implement a new
3614   # versioning mechanism, adjust this.
3615   if test -x /usr/bin/objformat; then
3616     objformat=`/usr/bin/objformat`
3617   else
3618     case $host_os in
3619     freebsd[[23]].*) objformat=aout ;;
3620     *) objformat=elf ;;
3621     esac
3622   fi
3623   version_type=freebsd-$objformat
3624   case $version_type in
3625     freebsd-elf*)
3626       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3627       need_version=no
3628       need_lib_prefix=no
3629       ;;
3630     freebsd-*)
3631       library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3632       need_version=yes
3633       ;;
3634   esac
3635   shlibpath_var=LD_LIBRARY_PATH
3636   case $host_os in
3637   freebsd2.*)
3638     shlibpath_overrides_runpath=yes
3639     ;;
3640   freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3641     shlibpath_overrides_runpath=yes
3642     hardcode_into_libs=yes
3643     ;;
3644   freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3645   freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3646     shlibpath_overrides_runpath=no
3647     hardcode_into_libs=yes
3648     ;;
3649   *) # from 4.6 on, and DragonFly
3650     shlibpath_overrides_runpath=yes
3651     hardcode_into_libs=yes
3652     ;;
3653   esac
3654   ;;
3655
3656 gnu*)
3657   version_type=linux # correct to gnu/linux during the next big refactor
3658   need_lib_prefix=no
3659   need_version=no
3660   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3661   soname_spec='${libname}${release}${shared_ext}$major'
3662   shlibpath_var=LD_LIBRARY_PATH
3663   shlibpath_overrides_runpath=no
3664   hardcode_into_libs=yes
3665   ;;
3666
3667 haiku*)
3668   version_type=linux # correct to gnu/linux during the next big refactor
3669   need_lib_prefix=no
3670   need_version=no
3671   dynamic_linker="$host_os runtime_loader"
3672   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3673   soname_spec='${libname}${release}${shared_ext}$major'
3674   shlibpath_var=LIBRARY_PATH
3675   shlibpath_overrides_runpath=yes
3676   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3677   hardcode_into_libs=yes
3678   ;;
3679
3680 hpux9* | hpux10* | hpux11*)
3681   # Give a soname corresponding to the major version so that dld.sl refuses to
3682   # link against other versions.
3683   version_type=sunos
3684   need_lib_prefix=no
3685   need_version=no
3686   case $host_cpu in
3687   ia64*)
3688     shrext_cmds='.so'
3689     hardcode_into_libs=yes
3690     dynamic_linker="$host_os dld.so"
3691     shlibpath_var=LD_LIBRARY_PATH
3692     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3693     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3694     soname_spec='${libname}${release}${shared_ext}$major'
3695     if test "X$HPUX_IA64_MODE" = X32; then
3696       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3697     else
3698       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3699     fi
3700     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3701     ;;
3702   hppa*64*)
3703     shrext_cmds='.sl'
3704     hardcode_into_libs=yes
3705     dynamic_linker="$host_os dld.sl"
3706     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3707     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3708     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3709     soname_spec='${libname}${release}${shared_ext}$major'
3710     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3711     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3712     ;;
3713   *)
3714     shrext_cmds='.sl'
3715     dynamic_linker="$host_os dld.sl"
3716     shlibpath_var=SHLIB_PATH
3717     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3718     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3719     soname_spec='${libname}${release}${shared_ext}$major'
3720     ;;
3721   esac
3722   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3723   postinstall_cmds='chmod 555 $lib'
3724   # or fails outright, so override atomically:
3725   install_override_mode=555
3726   ;;
3727
3728 interix[[3-9]]*)
3729   version_type=linux # correct to gnu/linux during the next big refactor
3730   need_lib_prefix=no
3731   need_version=no
3732   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3733   soname_spec='${libname}${release}${shared_ext}$major'
3734   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3735   shlibpath_var=LD_LIBRARY_PATH
3736   shlibpath_overrides_runpath=no
3737   hardcode_into_libs=yes
3738   ;;
3739
3740 irix5* | irix6* | nonstopux*)
3741   case $host_os in
3742     nonstopux*) version_type=nonstopux ;;
3743     *)
3744         if test "$lt_cv_prog_gnu_ld" = yes; then
3745                 version_type=linux # correct to gnu/linux during the next big refactor
3746         else
3747                 version_type=irix
3748         fi ;;
3749   esac
3750   need_lib_prefix=no
3751   need_version=no
3752   soname_spec='${libname}${release}${shared_ext}$major'
3753   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3754   case $host_os in
3755   irix5* | nonstopux*)
3756     libsuff= shlibsuff=
3757     ;;
3758   *)
3759     case $LD in # libtool.m4 will add one of these switches to LD
3760     *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3761       libsuff= shlibsuff= libmagic=32-bit;;
3762     *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3763       libsuff=32 shlibsuff=N32 libmagic=N32;;
3764     *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3765       libsuff=64 shlibsuff=64 libmagic=64-bit;;
3766     *) libsuff= shlibsuff= libmagic=never-match;;
3767     esac
3768     ;;
3769   esac
3770   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3771   shlibpath_overrides_runpath=no
3772   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3773   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3774   hardcode_into_libs=yes
3775   ;;
3776
3777 # No shared lib support for Linux oldld, aout, or coff.
3778 linux*oldld* | linux*aout* | linux*coff*)
3779   dynamic_linker=no
3780   ;;
3781
3782 # This must be glibc/ELF.
3783 linux* | k*bsd*-gnu | kopensolaris*-gnu)
3784   version_type=linux # correct to gnu/linux during the next big refactor
3785   need_lib_prefix=no
3786   need_version=no
3787   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3788   soname_spec='${libname}${release}${shared_ext}$major'
3789   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3790   shlibpath_var=LD_LIBRARY_PATH
3791   shlibpath_overrides_runpath=no
3792
3793   # Some binutils ld are patched to set DT_RUNPATH
3794   AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3795     [lt_cv_shlibpath_overrides_runpath=no
3796     save_LDFLAGS=$LDFLAGS
3797     save_libdir=$libdir
3798     eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3799          LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3800     AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3801       [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3802          [lt_cv_shlibpath_overrides_runpath=yes])])
3803     LDFLAGS=$save_LDFLAGS
3804     libdir=$save_libdir
3805     ])
3806   shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3807
3808   # This implies no fast_install, which is unacceptable.
3809   # Some rework will be needed to allow for fast_install
3810   # before this can be enabled.
3811   hardcode_into_libs=yes
3812
3813   # Append ld.so.conf contents to the search path
3814   if test -f /etc/ld.so.conf; then
3815     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' ' '`
3816     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3817   fi
3818
3819   # We used to test for /lib/ld.so.1 and disable shared libraries on
3820   # powerpc, because MkLinux only supported shared libraries with the
3821   # GNU dynamic linker.  Since this was broken with cross compilers,
3822   # most powerpc-linux boxes support dynamic linking these days and
3823   # people can always --disable-shared, the test was removed, and we
3824   # assume the GNU/Linux dynamic linker is in use.
3825   dynamic_linker='GNU/Linux ld.so'
3826   ;;
3827
3828 netbsd*)
3829   version_type=sunos
3830   need_lib_prefix=no
3831   need_version=no
3832   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3833     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3834     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3835     dynamic_linker='NetBSD (a.out) ld.so'
3836   else
3837     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3838     soname_spec='${libname}${release}${shared_ext}$major'
3839     dynamic_linker='NetBSD ld.elf_so'
3840   fi
3841   shlibpath_var=LD_LIBRARY_PATH
3842   shlibpath_overrides_runpath=yes
3843   hardcode_into_libs=yes
3844   ;;
3845
3846 newsos6)
3847   version_type=linux # correct to gnu/linux during the next big refactor
3848   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3849   shlibpath_var=LD_LIBRARY_PATH
3850   shlibpath_overrides_runpath=yes
3851   ;;
3852
3853 *nto* | *qnx*)
3854   version_type=qnx
3855   need_lib_prefix=no
3856   need_version=no
3857   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3858   soname_spec='${libname}${release}${shared_ext}$major'
3859   shlibpath_var=LD_LIBRARY_PATH
3860   shlibpath_overrides_runpath=no
3861   hardcode_into_libs=yes
3862   dynamic_linker='ldqnx.so'
3863   ;;
3864
3865 openbsd*)
3866   version_type=sunos
3867   sys_lib_dlsearch_path_spec="/usr/lib"
3868   need_lib_prefix=no
3869   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3870   case $host_os in
3871     openbsd3.3 | openbsd3.3.*)  need_version=yes ;;
3872     *)                          need_version=no  ;;
3873   esac
3874   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3875   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3876   shlibpath_var=LD_LIBRARY_PATH
3877   if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3878     case $host_os in
3879       openbsd2.[[89]] | openbsd2.[[89]].*)
3880         shlibpath_overrides_runpath=no
3881         ;;
3882       *)
3883         shlibpath_overrides_runpath=yes
3884         ;;
3885       esac
3886   else
3887     shlibpath_overrides_runpath=yes
3888   fi
3889   ;;
3890
3891 os2*)
3892   libname_spec='$name'
3893   shrext_cmds=".dll"
3894   need_lib_prefix=no
3895   library_names_spec='$libname${shared_ext} $libname.a'
3896   dynamic_linker='OS/2 ld.exe'
3897   shlibpath_var=LIBPATH
3898   ;;
3899
3900 osf3* | osf4* | osf5*)
3901   version_type=osf
3902   need_lib_prefix=no
3903   need_version=no
3904   soname_spec='${libname}${release}${shared_ext}$major'
3905   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3906   shlibpath_var=LD_LIBRARY_PATH
3907   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3908   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3909   ;;
3910
3911 rdos*)
3912   dynamic_linker=no
3913   ;;
3914
3915 solaris*)
3916   version_type=linux # correct to gnu/linux during the next big refactor
3917   need_lib_prefix=no
3918   need_version=no
3919   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3920   soname_spec='${libname}${release}${shared_ext}$major'
3921   shlibpath_var=LD_LIBRARY_PATH
3922   shlibpath_overrides_runpath=yes
3923   hardcode_into_libs=yes
3924   # ldd complains unless libraries are executable
3925   postinstall_cmds='chmod +x $lib'
3926   ;;
3927
3928 sunos4*)
3929   version_type=sunos
3930   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3931   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3932   shlibpath_var=LD_LIBRARY_PATH
3933   shlibpath_overrides_runpath=yes
3934   if test "$with_gnu_ld" = yes; then
3935     need_lib_prefix=no
3936   fi
3937   need_version=yes
3938   ;;
3939
3940 sysv4 | sysv4.3*)
3941   version_type=linux # correct to gnu/linux during the next big refactor
3942   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3943   soname_spec='${libname}${release}${shared_ext}$major'
3944   shlibpath_var=LD_LIBRARY_PATH
3945   case $host_vendor in
3946     sni)
3947       shlibpath_overrides_runpath=no
3948       need_lib_prefix=no
3949       runpath_var=LD_RUN_PATH
3950       ;;
3951     siemens)
3952       need_lib_prefix=no
3953       ;;
3954     motorola)
3955       need_lib_prefix=no
3956       need_version=no
3957       shlibpath_overrides_runpath=no
3958       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3959       ;;
3960   esac
3961   ;;
3962
3963 sysv4*MP*)
3964   if test -d /usr/nec ;then
3965     version_type=linux # correct to gnu/linux during the next big refactor
3966     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3967     soname_spec='$libname${shared_ext}.$major'
3968     shlibpath_var=LD_LIBRARY_PATH
3969   fi
3970   ;;
3971
3972 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3973   version_type=freebsd-elf
3974   need_lib_prefix=no
3975   need_version=no
3976   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3977   soname_spec='${libname}${release}${shared_ext}$major'
3978   shlibpath_var=LD_LIBRARY_PATH
3979   shlibpath_overrides_runpath=yes
3980   hardcode_into_libs=yes
3981   if test "$with_gnu_ld" = yes; then
3982     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3983   else
3984     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3985     case $host_os in
3986       sco3.2v5*)
3987         sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3988         ;;
3989     esac
3990   fi
3991   sys_lib_dlsearch_path_spec='/usr/lib'
3992   ;;
3993
3994 tpf*)
3995   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3996   version_type=linux # correct to gnu/linux during the next big refactor
3997   need_lib_prefix=no
3998   need_version=no
3999   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4000   shlibpath_var=LD_LIBRARY_PATH
4001   shlibpath_overrides_runpath=no
4002   hardcode_into_libs=yes
4003   ;;
4004
4005 uts4*)
4006   version_type=linux # correct to gnu/linux during the next big refactor
4007   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
4008   soname_spec='${libname}${release}${shared_ext}$major'
4009   shlibpath_var=LD_LIBRARY_PATH
4010   ;;
4011
4012 *)
4013   dynamic_linker=no
4014   ;;
4015 esac
4016 AC_MSG_RESULT([$dynamic_linker])
4017 test "$dynamic_linker" = no && can_build_shared=no
4018
4019 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
4020 if test "$GCC" = yes; then
4021   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
4022 fi
4023
4024 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
4025   sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
4026 fi
4027 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
4028   sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
4029 fi
4030
4031 _LT_DECL([], [variables_saved_for_relink], [1],
4032     [Variables whose values should be saved in libtool wrapper scripts and
4033     restored at link time])
4034 _LT_DECL([], [need_lib_prefix], [0],
4035     [Do we need the "lib" prefix for modules?])
4036 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
4037 _LT_DECL([], [version_type], [0], [Library versioning type])
4038 _LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
4039 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
4040 _LT_DECL([], [shlibpath_overrides_runpath], [0],
4041     [Is shlibpath searched before the hard-coded library search path?])
4042 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
4043 _LT_DECL([], [library_names_spec], [1],
4044     [[List of archive names.  First name is the real one, the rest are links.
4045     The last name is the one that the linker finds with -lNAME]])
4046 _LT_DECL([], [soname_spec], [1],
4047     [[The coded name of the library, if different from the real name]])
4048 _LT_DECL([], [install_override_mode], [1],
4049     [Permission mode override for installation of shared libraries])
4050 _LT_DECL([], [postinstall_cmds], [2],
4051     [Command to use after installation of a shared archive])
4052 _LT_DECL([], [postuninstall_cmds], [2],
4053     [Command to use after uninstallation of a shared archive])
4054 _LT_DECL([], [finish_cmds], [2],
4055     [Commands used to finish a libtool library installation in a directory])
4056 _LT_DECL([], [finish_eval], [1],
4057     [[As "finish_cmds", except a single script fragment to be evaled but
4058     not shown]])
4059 _LT_DECL([], [hardcode_into_libs], [0],
4060     [Whether we should hardcode library paths into libraries])
4061 _LT_DECL([], [sys_lib_search_path_spec], [2],
4062     [Compile-time system search path for libraries])
4063 _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
4064     [Run-time system search path for libraries])
4065 ])# _LT_SYS_DYNAMIC_LINKER
4066
4067
4068 # _LT_PATH_TOOL_PREFIX(TOOL)
4069 # --------------------------
4070 # find a file program which can recognize shared library
4071 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
4072 [m4_require([_LT_DECL_EGREP])dnl
4073 AC_MSG_CHECKING([for $1])
4074 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4075 [case $MAGIC_CMD in
4076 [[\\/*] |  ?:[\\/]*])
4077   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4078   ;;
4079 *)
4080   lt_save_MAGIC_CMD="$MAGIC_CMD"
4081   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4082 dnl $ac_dummy forces splitting on constant user-supplied paths.
4083 dnl POSIX.2 word splitting is done only on the output of word expansions,
4084 dnl not every word.  This closes a longstanding sh security hole.
4085   ac_dummy="m4_if([$2], , $PATH, [$2])"
4086   for ac_dir in $ac_dummy; do
4087     IFS="$lt_save_ifs"
4088     test -z "$ac_dir" && ac_dir=.
4089     if test -f $ac_dir/$1; then
4090       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4091       if test -n "$file_magic_test_file"; then
4092         case $deplibs_check_method in
4093         "file_magic "*)
4094           file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
4095           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4096           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4097             $EGREP "$file_magic_regex" > /dev/null; then
4098             :
4099           else
4100             cat <<_LT_EOF 1>&2
4101
4102 *** Warning: the command libtool uses to detect shared libraries,
4103 *** $file_magic_cmd, produces output that libtool cannot recognize.
4104 *** The result is that libtool may fail to recognize shared libraries
4105 *** as such.  This will affect the creation of libtool libraries that
4106 *** depend on shared libraries, but programs linked with such libtool
4107 *** libraries will work regardless of this problem.  Nevertheless, you
4108 *** may want to report the problem to your system manager and/or to
4109 *** bug-libtool@gnu.org
4110
4111 _LT_EOF
4112           fi ;;
4113         esac
4114       fi
4115       break
4116     fi
4117   done
4118   IFS="$lt_save_ifs"
4119   MAGIC_CMD="$lt_save_MAGIC_CMD"
4120   ;;
4121 esac])
4122 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4123 if test -n "$MAGIC_CMD"; then
4124   AC_MSG_RESULT($MAGIC_CMD)
4125 else
4126   AC_MSG_RESULT(no)
4127 fi
4128 _LT_DECL([], [MAGIC_CMD], [0],
4129          [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4130 ])# _LT_PATH_TOOL_PREFIX
4131
4132 # Old name:
4133 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4134 dnl aclocal-1.4 backwards compatibility:
4135 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4136
4137
4138 # _LT_PATH_MAGIC
4139 # --------------
4140 # find a file program which can recognize a shared library
4141 m4_defun([_LT_PATH_MAGIC],
4142 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4143 if test -z "$lt_cv_path_MAGIC_CMD"; then
4144   if test -n "$ac_tool_prefix"; then
4145     _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4146   else
4147     MAGIC_CMD=:
4148   fi
4149 fi
4150 ])# _LT_PATH_MAGIC
4151
4152
4153 # LT_PATH_LD
4154 # ----------
4155 # find the pathname to the GNU or non-GNU linker
4156 AC_DEFUN([LT_PATH_LD],
4157 [AC_REQUIRE([AC_PROG_CC])dnl
4158 AC_REQUIRE([AC_CANONICAL_HOST])dnl
4159 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4160 m4_require([_LT_DECL_SED])dnl
4161 m4_require([_LT_DECL_EGREP])dnl
4162 m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4163
4164 AC_ARG_WITH([gnu-ld],
4165     [AS_HELP_STRING([--with-gnu-ld],
4166         [assume the C compiler uses GNU ld @<:@default=no@:>@])],
4167     [test "$withval" = no || with_gnu_ld=yes],
4168     [with_gnu_ld=no])dnl
4169
4170 ac_prog=ld
4171 if test "$GCC" = yes; then
4172   # Check if gcc -print-prog-name=ld gives a path.
4173   AC_MSG_CHECKING([for ld used by $CC])
4174   case $host in
4175   *-*-mingw*)
4176     # gcc leaves a trailing carriage return which upsets mingw
4177     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4178   *)
4179     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4180   esac
4181   case $ac_prog in
4182     # Accept absolute paths.
4183     [[\\/]]* | ?:[[\\/]]*)
4184       re_direlt='/[[^/]][[^/]]*/\.\./'
4185       # Canonicalize the pathname of ld
4186       ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4187       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4188         ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4189       done
4190       test -z "$LD" && LD="$ac_prog"
4191       ;;
4192   "")
4193     # If it fails, then pretend we aren't using GCC.
4194     ac_prog=ld
4195     ;;
4196   *)
4197     # If it is relative, then search for the first ld in PATH.
4198     with_gnu_ld=unknown
4199     ;;
4200   esac
4201 elif test "$with_gnu_ld" = yes; then
4202   AC_MSG_CHECKING([for GNU ld])
4203 else
4204   AC_MSG_CHECKING([for non-GNU ld])
4205 fi
4206 AC_CACHE_VAL(lt_cv_path_LD,
4207 [if test -z "$LD"; then
4208   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4209   for ac_dir in $PATH; do
4210     IFS="$lt_save_ifs"
4211     test -z "$ac_dir" && ac_dir=.
4212     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4213       lt_cv_path_LD="$ac_dir/$ac_prog"
4214       # Check to see if the program is GNU ld.  I'd rather use --version,
4215       # but apparently some variants of GNU ld only accept -v.
4216       # Break only if it was the GNU/non-GNU ld that we prefer.
4217       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4218       *GNU* | *'with BFD'*)
4219         test "$with_gnu_ld" != no && break
4220         ;;
4221       *)
4222         test "$with_gnu_ld" != yes && break
4223         ;;
4224       esac
4225     fi
4226   done
4227   IFS="$lt_save_ifs"
4228 else
4229   lt_cv_path_LD="$LD" # Let the user override the test with a path.
4230 fi])
4231 LD="$lt_cv_path_LD"
4232 if test -n "$LD"; then
4233   AC_MSG_RESULT($LD)
4234 else
4235   AC_MSG_RESULT(no)
4236 fi
4237 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4238 _LT_PATH_LD_GNU
4239 AC_SUBST([LD])
4240
4241 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4242 ])# LT_PATH_LD
4243
4244 # Old names:
4245 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4246 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4247 dnl aclocal-1.4 backwards compatibility:
4248 dnl AC_DEFUN([AM_PROG_LD], [])
4249 dnl AC_DEFUN([AC_PROG_LD], [])
4250
4251
4252 # _LT_PATH_LD_GNU
4253 #- --------------
4254 m4_defun([_LT_PATH_LD_GNU],
4255 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4256 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
4257 case `$LD -v 2>&1 </dev/null` in
4258 *GNU* | *'with BFD'*)
4259   lt_cv_prog_gnu_ld=yes
4260   ;;
4261 *)
4262   lt_cv_prog_gnu_ld=no
4263   ;;
4264 esac])
4265 with_gnu_ld=$lt_cv_prog_gnu_ld
4266 ])# _LT_PATH_LD_GNU
4267
4268
4269 # _LT_CMD_RELOAD
4270 # --------------
4271 # find reload flag for linker
4272 #   -- PORTME Some linkers may need a different reload flag.
4273 m4_defun([_LT_CMD_RELOAD],
4274 [AC_CACHE_CHECK([for $LD option to reload object files],
4275   lt_cv_ld_reload_flag,
4276   [lt_cv_ld_reload_flag='-r'])
4277 reload_flag=$lt_cv_ld_reload_flag
4278 case $reload_flag in
4279 "" | " "*) ;;
4280 *) reload_flag=" $reload_flag" ;;
4281 esac
4282 reload_cmds='$LD$reload_flag -o $output$reload_objs'
4283 case $host_os in
4284   cygwin* | mingw* | pw32* | cegcc*)
4285     if test "$GCC" != yes; then
4286       reload_cmds=false
4287     fi
4288     ;;
4289   darwin*)
4290     if test "$GCC" = yes; then
4291       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4292     else
4293       reload_cmds='$LD$reload_flag -o $output$reload_objs'
4294     fi
4295     ;;
4296 esac
4297 _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4298 _LT_TAGDECL([], [reload_cmds], [2])dnl
4299 ])# _LT_CMD_RELOAD
4300
4301
4302 # _LT_CHECK_MAGIC_METHOD
4303 # ----------------------
4304 # how to check for library dependencies
4305 #  -- PORTME fill in with the dynamic library characteristics
4306 m4_defun([_LT_CHECK_MAGIC_METHOD],
4307 [m4_require([_LT_DECL_EGREP])
4308 m4_require([_LT_DECL_OBJDUMP])
4309 AC_CACHE_CHECK([how to recognize dependent libraries],
4310 lt_cv_deplibs_check_method,
4311 [lt_cv_file_magic_cmd='$MAGIC_CMD'
4312 lt_cv_file_magic_test_file=
4313 lt_cv_deplibs_check_method='unknown'
4314 # Need to set the preceding variable on all platforms that support
4315 # interlibrary dependencies.
4316 # 'none' -- dependencies not supported.
4317 # `unknown' -- same as none, but documents that we really don't know.
4318 # 'pass_all' -- all dependencies passed with no checks.
4319 # 'test_compile' -- check by making test program.
4320 # 'file_magic [[regex]]' -- check by looking for files in library path
4321 # which responds to the $file_magic_cmd with a given extended regex.
4322 # If you have `file' or equivalent on your system and you're not sure
4323 # whether `pass_all' will *always* work, you probably want this one.
4324
4325 case $host_os in
4326 aix[[4-9]]*)
4327   lt_cv_deplibs_check_method=pass_all
4328   ;;
4329
4330 beos*)
4331   lt_cv_deplibs_check_method=pass_all
4332   ;;
4333
4334 bsdi[[45]]*)
4335   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4336   lt_cv_file_magic_cmd='/usr/bin/file -L'
4337   lt_cv_file_magic_test_file=/shlib/libc.so
4338   ;;
4339
4340 cygwin*)
4341   # func_win32_libid is a shell function defined in ltmain.sh
4342   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4343   lt_cv_file_magic_cmd='func_win32_libid'
4344   ;;
4345
4346 mingw* | pw32*)
4347   # Base MSYS/MinGW do not provide the 'file' command needed by
4348   # func_win32_libid shell function, so use a weaker test based on 'objdump',
4349   # unless we find 'file', for example because we are cross-compiling.
4350   # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4351   if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4352     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4353     lt_cv_file_magic_cmd='func_win32_libid'
4354   else
4355     # Keep this pattern in sync with the one in func_win32_libid.
4356     lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4357     lt_cv_file_magic_cmd='$OBJDUMP -f'
4358   fi
4359   ;;
4360
4361 cegcc*)
4362   # use the weaker test based on 'objdump'. See mingw*.
4363   lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4364   lt_cv_file_magic_cmd='$OBJDUMP -f'
4365   ;;
4366
4367 darwin* | rhapsody*)
4368   lt_cv_deplibs_check_method=pass_all
4369   ;;
4370
4371 freebsd* | dragonfly*)
4372   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4373     case $host_cpu in
4374     i*86 )
4375       # Not sure whether the presence of OpenBSD here was a mistake.
4376       # Let's accept both of them until this is cleared up.
4377       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4378       lt_cv_file_magic_cmd=/usr/bin/file
4379       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4380       ;;
4381     esac
4382   else
4383     lt_cv_deplibs_check_method=pass_all
4384   fi
4385   ;;
4386
4387 gnu*)
4388   lt_cv_deplibs_check_method=pass_all
4389   ;;
4390
4391 haiku*)
4392   lt_cv_deplibs_check_method=pass_all
4393   ;;
4394
4395 hpux10.20* | hpux11*)
4396   lt_cv_file_magic_cmd=/usr/bin/file
4397   case $host_cpu in
4398   ia64*)
4399     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4400     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4401     ;;
4402   hppa*64*)
4403     [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]']
4404     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4405     ;;
4406   *)
4407     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4408     lt_cv_file_magic_test_file=/usr/lib/libc.sl
4409     ;;
4410   esac
4411   ;;
4412
4413 interix[[3-9]]*)
4414   # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4415   lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4416   ;;
4417
4418 irix5* | irix6* | nonstopux*)
4419   case $LD in
4420   *-32|*"-32 ") libmagic=32-bit;;
4421   *-n32|*"-n32 ") libmagic=N32;;
4422   *-64|*"-64 ") libmagic=64-bit;;
4423   *) libmagic=never-match;;
4424   esac
4425   lt_cv_deplibs_check_method=pass_all
4426   ;;
4427
4428 # This must be glibc/ELF.
4429 linux* | k*bsd*-gnu | kopensolaris*-gnu)
4430   lt_cv_deplibs_check_method=pass_all
4431   ;;
4432
4433 netbsd*)
4434   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4435     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4436   else
4437     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4438   fi
4439   ;;
4440
4441 newos6*)
4442   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4443   lt_cv_file_magic_cmd=/usr/bin/file
4444   lt_cv_file_magic_test_file=/usr/lib/libnls.so
4445   ;;
4446
4447 *nto* | *qnx*)
4448   lt_cv_deplibs_check_method=pass_all
4449   ;;
4450
4451 openbsd*)
4452   if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4453     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4454   else
4455     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4456   fi
4457   ;;
4458
4459 osf3* | osf4* | osf5*)
4460   lt_cv_deplibs_check_method=pass_all
4461   ;;
4462
4463 rdos*)
4464   lt_cv_deplibs_check_method=pass_all
4465   ;;
4466
4467 solaris*)
4468   lt_cv_deplibs_check_method=pass_all
4469   ;;
4470
4471 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4472   lt_cv_deplibs_check_method=pass_all
4473   ;;
4474
4475 sysv4 | sysv4.3*)
4476   case $host_vendor in
4477   motorola)
4478     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]]'
4479     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4480     ;;
4481   ncr)
4482     lt_cv_deplibs_check_method=pass_all
4483     ;;
4484   sequent)
4485     lt_cv_file_magic_cmd='/bin/file'
4486     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4487     ;;
4488   sni)
4489     lt_cv_file_magic_cmd='/bin/file'
4490     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4491     lt_cv_file_magic_test_file=/lib/libc.so
4492     ;;
4493   siemens)
4494     lt_cv_deplibs_check_method=pass_all
4495     ;;
4496   pc)
4497     lt_cv_deplibs_check_method=pass_all
4498     ;;
4499   esac
4500   ;;
4501
4502 tpf*)
4503   lt_cv_deplibs_check_method=pass_all
4504   ;;
4505 esac
4506 ])
4507
4508 file_magic_glob=
4509 want_nocaseglob=no
4510 if test "$build" = "$host"; then
4511   case $host_os in
4512   mingw* | pw32*)
4513     if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4514       want_nocaseglob=yes
4515     else
4516       file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4517     fi
4518     ;;
4519   esac
4520 fi
4521
4522 file_magic_cmd=$lt_cv_file_magic_cmd
4523 deplibs_check_method=$lt_cv_deplibs_check_method
4524 test -z "$deplibs_check_method" && deplibs_check_method=unknown
4525
4526 _LT_DECL([], [deplibs_check_method], [1],
4527     [Method to check whether dependent libraries are shared objects])
4528 _LT_DECL([], [file_magic_cmd], [1],
4529     [Command to use when deplibs_check_method = "file_magic"])
4530 _LT_DECL([], [file_magic_glob], [1],
4531     [How to find potential files when deplibs_check_method = "file_magic"])
4532 _LT_DECL([], [want_nocaseglob], [1],
4533     [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4534 ])# _LT_CHECK_MAGIC_METHOD
4535
4536
4537 # LT_PATH_NM
4538 # ----------
4539 # find the pathname to a BSD- or MS-compatible name lister
4540 AC_DEFUN([LT_PATH_NM],
4541 [AC_REQUIRE([AC_PROG_CC])dnl
4542 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4543 [if test -n "$NM"; then
4544   # Let the user override the test.
4545   lt_cv_path_NM="$NM"
4546 else
4547   lt_nm_to_check="${ac_tool_prefix}nm"
4548   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4549     lt_nm_to_check="$lt_nm_to_check nm"
4550   fi
4551   for lt_tmp_nm in $lt_nm_to_check; do
4552     lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4553     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4554       IFS="$lt_save_ifs"
4555       test -z "$ac_dir" && ac_dir=.
4556       tmp_nm="$ac_dir/$lt_tmp_nm"
4557       if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4558         # Check to see if the nm accepts a BSD-compat flag.
4559         # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4560         #   nm: unknown option "B" ignored
4561         # Tru64's nm complains that /dev/null is an invalid object file
4562         case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4563         */dev/null* | *'Invalid file or object type'*)
4564           lt_cv_path_NM="$tmp_nm -B"
4565           break
4566           ;;
4567         *)
4568           case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4569           */dev/null*)
4570             lt_cv_path_NM="$tmp_nm -p"
4571             break
4572             ;;
4573           *)
4574             lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4575             continue # so that we can try to find one that supports BSD flags
4576             ;;
4577           esac
4578           ;;
4579         esac
4580       fi
4581     done
4582     IFS="$lt_save_ifs"
4583   done
4584   : ${lt_cv_path_NM=no}
4585 fi])
4586 if test "$lt_cv_path_NM" != "no"; then
4587   NM="$lt_cv_path_NM"
4588 else
4589   # Didn't find any BSD compatible name lister, look for dumpbin.
4590   if test -n "$DUMPBIN"; then :
4591     # Let the user override the test.
4592   else
4593     AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4594     case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4595     *COFF*)
4596       DUMPBIN="$DUMPBIN -symbols"
4597       ;;
4598     *)
4599       DUMPBIN=:
4600       ;;
4601     esac
4602   fi
4603   AC_SUBST([DUMPBIN])
4604   if test "$DUMPBIN" != ":"; then
4605     NM="$DUMPBIN"
4606   fi
4607 fi
4608 test -z "$NM" && NM=nm
4609 AC_SUBST([NM])
4610 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4611
4612 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4613   [lt_cv_nm_interface="BSD nm"
4614   echo "int some_variable = 0;" > conftest.$ac_ext
4615   (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4616   (eval "$ac_compile" 2>conftest.err)
4617   cat conftest.err >&AS_MESSAGE_LOG_FD
4618   (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4619   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4620   cat conftest.err >&AS_MESSAGE_LOG_FD
4621   (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4622   cat conftest.out >&AS_MESSAGE_LOG_FD
4623   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4624     lt_cv_nm_interface="MS dumpbin"
4625   fi
4626   rm -f conftest*])
4627 ])# LT_PATH_NM
4628
4629 # Old names:
4630 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4631 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4632 dnl aclocal-1.4 backwards compatibility:
4633 dnl AC_DEFUN([AM_PROG_NM], [])
4634 dnl AC_DEFUN([AC_PROG_NM], [])
4635
4636 # _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4637 # --------------------------------
4638 # how to determine the name of the shared library
4639 # associated with a specific link library.
4640 #  -- PORTME fill in with the dynamic library characteristics
4641 m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4642 [m4_require([_LT_DECL_EGREP])
4643 m4_require([_LT_DECL_OBJDUMP])
4644 m4_require([_LT_DECL_DLLTOOL])
4645 AC_CACHE_CHECK([how to associate runtime and link libraries],
4646 lt_cv_sharedlib_from_linklib_cmd,
4647 [lt_cv_sharedlib_from_linklib_cmd='unknown'
4648
4649 case $host_os in
4650 cygwin* | mingw* | pw32* | cegcc*)
4651   # two different shell functions defined in ltmain.sh
4652   # decide which to use based on capabilities of $DLLTOOL
4653   case `$DLLTOOL --help 2>&1` in
4654   *--identify-strict*)
4655     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4656     ;;
4657   *)
4658     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4659     ;;
4660   esac
4661   ;;
4662 *)
4663   # fallback: assume linklib IS sharedlib
4664   lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4665   ;;
4666 esac
4667 ])
4668 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4669 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4670
4671 _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4672     [Command to associate shared and link libraries])
4673 ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4674
4675
4676 # _LT_PATH_MANIFEST_TOOL
4677 # ----------------------
4678 # locate the manifest tool
4679 m4_defun([_LT_PATH_MANIFEST_TOOL],
4680 [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4681 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4682 AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4683   [lt_cv_path_mainfest_tool=no
4684   echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4685   $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4686   cat conftest.err >&AS_MESSAGE_LOG_FD
4687   if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4688     lt_cv_path_mainfest_tool=yes
4689   fi
4690   rm -f conftest*])
4691 if test "x$lt_cv_path_mainfest_tool" != xyes; then
4692   MANIFEST_TOOL=:
4693 fi
4694 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4695 ])# _LT_PATH_MANIFEST_TOOL
4696
4697
4698 # LT_LIB_M
4699 # --------
4700 # check for math library
4701 AC_DEFUN([LT_LIB_M],
4702 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
4703 LIBM=
4704 case $host in
4705 *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4706   # These system don't have libm, or don't need it
4707   ;;
4708 *-ncr-sysv4.3*)
4709   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4710   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4711   ;;
4712 *)
4713   AC_CHECK_LIB(m, cos, LIBM="-lm")
4714   ;;
4715 esac
4716 AC_SUBST([LIBM])
4717 ])# LT_LIB_M
4718
4719 # Old name:
4720 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4721 dnl aclocal-1.4 backwards compatibility:
4722 dnl AC_DEFUN([AC_CHECK_LIBM], [])
4723
4724
4725 # _LT_COMPILER_NO_RTTI([TAGNAME])
4726 # -------------------------------
4727 m4_defun([_LT_COMPILER_NO_RTTI],
4728 [m4_require([_LT_TAG_COMPILER])dnl
4729
4730 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4731
4732 if test "$GCC" = yes; then
4733   case $cc_basename in
4734   nvcc*)
4735     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4736   *)
4737     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4738   esac
4739
4740   _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4741     lt_cv_prog_compiler_rtti_exceptions,
4742     [-fno-rtti -fno-exceptions], [],
4743     [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4744 fi
4745 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4746         [Compiler flag to turn off builtin functions])
4747 ])# _LT_COMPILER_NO_RTTI
4748
4749
4750 # _LT_CMD_GLOBAL_SYMBOLS
4751 # ----------------------
4752 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4753 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
4754 AC_REQUIRE([AC_PROG_CC])dnl
4755 AC_REQUIRE([AC_PROG_AWK])dnl
4756 AC_REQUIRE([LT_PATH_NM])dnl
4757 AC_REQUIRE([LT_PATH_LD])dnl
4758 m4_require([_LT_DECL_SED])dnl
4759 m4_require([_LT_DECL_EGREP])dnl
4760 m4_require([_LT_TAG_COMPILER])dnl
4761
4762 # Check for command to grab the raw symbol name followed by C symbol from nm.
4763 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4764 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4765 [
4766 # These are sane defaults that work on at least a few old systems.
4767 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4768
4769 # Character class describing NM global symbol codes.
4770 symcode='[[BCDEGRST]]'
4771
4772 # Regexp to match symbols that can be accessed directly from C.
4773 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4774
4775 # Define system-specific variables.
4776 case $host_os in
4777 aix*)
4778   symcode='[[BCDT]]'
4779   ;;
4780 cygwin* | mingw* | pw32* | cegcc*)
4781   symcode='[[ABCDGISTW]]'
4782   ;;
4783 hpux*)
4784   if test "$host_cpu" = ia64; then
4785     symcode='[[ABCDEGRST]]'
4786   fi
4787   ;;
4788 irix* | nonstopux*)
4789   symcode='[[BCDEGRST]]'
4790   ;;
4791 osf*)
4792   symcode='[[BCDEGQRST]]'
4793   ;;
4794 solaris*)
4795   symcode='[[BDRT]]'
4796   ;;
4797 sco3.2v5*)
4798   symcode='[[DT]]'
4799   ;;
4800 sysv4.2uw2*)
4801   symcode='[[DT]]'
4802   ;;
4803 sysv5* | sco5v6* | unixware* | OpenUNIX*)
4804   symcode='[[ABDT]]'
4805   ;;
4806 sysv4)
4807   symcode='[[DFNSTU]]'
4808   ;;
4809 esac
4810
4811 # If we're using GNU nm, then use its standard symbol codes.
4812 case `$NM -V 2>&1` in
4813 *GNU* | *'with BFD'*)
4814   symcode='[[ABCDGIRSTW]]' ;;
4815 esac
4816
4817 # Transform an extracted symbol line into a proper C declaration.
4818 # Some systems (esp. on ia64) link data and code symbols differently,
4819 # so use this general approach.
4820 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4821
4822 # Transform an extracted symbol line into symbol name and symbol address
4823 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4824 lt_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'"
4825
4826 # Handle CRLF in mingw tool chain
4827 opt_cr=
4828 case $build_os in
4829 mingw*)
4830   opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4831   ;;
4832 esac
4833
4834 # Try without a prefix underscore, then with it.
4835 for ac_symprfx in "" "_"; do
4836
4837   # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4838   symxfrm="\\1 $ac_symprfx\\2 \\2"
4839
4840   # Write the raw and C identifiers.
4841   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4842     # Fake it for dumpbin and say T for any non-static function
4843     # and D for any global variable.
4844     # Also find C++ and __fastcall symbols from MSVC++,
4845     # which start with @ or ?.
4846     lt_cv_sys_global_symbol_pipe="$AWK ['"\
4847 "     {last_section=section; section=\$ 3};"\
4848 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4849 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4850 "     \$ 0!~/External *\|/{next};"\
4851 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4852 "     {if(hide[section]) next};"\
4853 "     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4854 "     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4855 "     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4856 "     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4857 "     ' prfx=^$ac_symprfx]"
4858   else
4859     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4860   fi
4861   lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4862
4863   # Check to see that the pipe works correctly.
4864   pipe_works=no
4865
4866   rm -f conftest*
4867   cat > conftest.$ac_ext <<_LT_EOF
4868 #ifdef __cplusplus
4869 extern "C" {
4870 #endif
4871 char nm_test_var;
4872 void nm_test_func(void);
4873 void nm_test_func(void){}
4874 #ifdef __cplusplus
4875 }
4876 #endif
4877 int main(){nm_test_var='a';nm_test_func();return(0);}
4878 _LT_EOF
4879
4880   if AC_TRY_EVAL(ac_compile); then
4881     # Now try to grab the symbols.
4882     nlist=conftest.nm
4883     if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4884       # Try sorting and uniquifying the output.
4885       if sort "$nlist" | uniq > "$nlist"T; then
4886         mv -f "$nlist"T "$nlist"
4887       else
4888         rm -f "$nlist"T
4889       fi
4890
4891       # Make sure that we snagged all the symbols we need.
4892       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4893         if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4894           cat <<_LT_EOF > conftest.$ac_ext
4895 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4896 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4897 /* DATA imports from DLLs on WIN32 con't be const, because runtime
4898    relocations are performed -- see ld's documentation on pseudo-relocs.  */
4899 # define LT@&t@_DLSYM_CONST
4900 #elif defined(__osf__)
4901 /* This system does not cope well with relocations in const data.  */
4902 # define LT@&t@_DLSYM_CONST
4903 #else
4904 # define LT@&t@_DLSYM_CONST const
4905 #endif
4906
4907 #ifdef __cplusplus
4908 extern "C" {
4909 #endif
4910
4911 _LT_EOF
4912           # Now generate the symbol file.
4913           eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4914
4915           cat <<_LT_EOF >> conftest.$ac_ext
4916
4917 /* The mapping between symbol names and symbols.  */
4918 LT@&t@_DLSYM_CONST struct {
4919   const char *name;
4920   void       *address;
4921 }
4922 lt__PROGRAM__LTX_preloaded_symbols[[]] =
4923 {
4924   { "@PROGRAM@", (void *) 0 },
4925 _LT_EOF
4926           $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4927           cat <<\_LT_EOF >> conftest.$ac_ext
4928   {0, (void *) 0}
4929 };
4930
4931 /* This works around a problem in FreeBSD linker */
4932 #ifdef FREEBSD_WORKAROUND
4933 static const void *lt_preloaded_setup() {
4934   return lt__PROGRAM__LTX_preloaded_symbols;
4935 }
4936 #endif
4937
4938 #ifdef __cplusplus
4939 }
4940 #endif
4941 _LT_EOF
4942           # Now try linking the two files.
4943           mv conftest.$ac_objext conftstm.$ac_objext
4944           lt_globsym_save_LIBS=$LIBS
4945           lt_globsym_save_CFLAGS=$CFLAGS
4946           LIBS="conftstm.$ac_objext"
4947           CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4948           if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4949             pipe_works=yes
4950           fi
4951           LIBS=$lt_globsym_save_LIBS
4952           CFLAGS=$lt_globsym_save_CFLAGS
4953         else
4954           echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4955         fi
4956       else
4957         echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4958       fi
4959     else
4960       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4961     fi
4962   else
4963     echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4964     cat conftest.$ac_ext >&5
4965   fi
4966   rm -rf conftest* conftst*
4967
4968   # Do not use the global_symbol_pipe unless it works.
4969   if test "$pipe_works" = yes; then
4970     break
4971   else
4972     lt_cv_sys_global_symbol_pipe=
4973   fi
4974 done
4975 ])
4976 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4977   lt_cv_sys_global_symbol_to_cdecl=
4978 fi
4979 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4980   AC_MSG_RESULT(failed)
4981 else
4982   AC_MSG_RESULT(ok)
4983 fi
4984
4985 # Response file support.
4986 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4987   nm_file_list_spec='@'
4988 elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4989   nm_file_list_spec='@'
4990 fi
4991
4992 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4993     [Take the output of nm and produce a listing of raw symbols and C names])
4994 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4995     [Transform the output of nm in a proper C declaration])
4996 _LT_DECL([global_symbol_to_c_name_address],
4997     [lt_cv_sys_global_symbol_to_c_name_address], [1],
4998     [Transform the output of nm in a C name address pair])
4999 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
5000     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
5001     [Transform the output of nm in a C name address pair when lib prefix is needed])
5002 _LT_DECL([], [nm_file_list_spec], [1],
5003     [Specify filename containing input files for $NM])
5004 ]) # _LT_CMD_GLOBAL_SYMBOLS
5005
5006
5007 # _LT_COMPILER_PIC([TAGNAME])
5008 # ---------------------------
5009 m4_defun([_LT_COMPILER_PIC],
5010 [m4_require([_LT_TAG_COMPILER])dnl
5011 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
5012 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5013 _LT_TAGVAR(lt_prog_compiler_static, $1)=
5014
5015 m4_if([$1], [CXX], [
5016   # C++ specific cases for pic, static, wl, etc.
5017   if test "$GXX" = yes; then
5018     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5019     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5020
5021     case $host_os in
5022     aix*)
5023       # All AIX code is PIC.
5024       if test "$host_cpu" = ia64; then
5025         # AIX 5 now supports IA64 processor
5026         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5027       fi
5028       ;;
5029
5030     amigaos*)
5031       case $host_cpu in
5032       powerpc)
5033             # see comment about AmigaOS4 .so support
5034             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5035         ;;
5036       m68k)
5037             # FIXME: we need at least 68020 code to build shared libraries, but
5038             # adding the `-m68020' flag to GCC prevents building anything better,
5039             # like `-m68040'.
5040             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5041         ;;
5042       esac
5043       ;;
5044
5045     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5046       # PIC is the default for these OSes.
5047       ;;
5048     mingw* | cygwin* | os2* | pw32* | cegcc*)
5049       # This hack is so that the source file can tell whether it is being
5050       # built for inclusion in a dll (and should export symbols for example).
5051       # Although the cygwin gcc ignores -fPIC, still need this for old-style
5052       # (--disable-auto-import) libraries
5053       m4_if([$1], [GCJ], [],
5054         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5055       ;;
5056     darwin* | rhapsody*)
5057       # PIC is the default on this platform
5058       # Common symbols not allowed in MH_DYLIB files
5059       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5060       ;;
5061     *djgpp*)
5062       # DJGPP does not support shared libraries at all
5063       _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5064       ;;
5065     haiku*)
5066       # PIC is the default for Haiku.
5067       # The "-static" flag exists, but is broken.
5068       _LT_TAGVAR(lt_prog_compiler_static, $1)=
5069       ;;
5070     interix[[3-9]]*)
5071       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5072       # Instead, we relocate shared libraries at runtime.
5073       ;;
5074     sysv4*MP*)
5075       if test -d /usr/nec; then
5076         _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5077       fi
5078       ;;
5079     hpux*)
5080       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5081       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5082       # sets the default TLS model and affects inlining.
5083       case $host_cpu in
5084       hppa*64*)
5085         ;;
5086       *)
5087         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5088         ;;
5089       esac
5090       ;;
5091     *qnx* | *nto*)
5092       # QNX uses GNU C++, but need to define -shared option too, otherwise
5093       # it will coredump.
5094       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5095       ;;
5096     *)
5097       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5098       ;;
5099     esac
5100   else
5101     case $host_os in
5102       aix[[4-9]]*)
5103         # All AIX code is PIC.
5104         if test "$host_cpu" = ia64; then
5105           # AIX 5 now supports IA64 processor
5106           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5107         else
5108           _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5109         fi
5110         ;;
5111       chorus*)
5112         case $cc_basename in
5113         cxch68*)
5114           # Green Hills C++ Compiler
5115           # _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"
5116           ;;
5117         esac
5118         ;;
5119       mingw* | cygwin* | os2* | pw32* | cegcc*)
5120         # This hack is so that the source file can tell whether it is being
5121         # built for inclusion in a dll (and should export symbols for example).
5122         m4_if([$1], [GCJ], [],
5123           [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5124         ;;
5125       dgux*)
5126         case $cc_basename in
5127           ec++*)
5128             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5129             ;;
5130           ghcx*)
5131             # Green Hills C++ Compiler
5132             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5133             ;;
5134           *)
5135             ;;
5136         esac
5137         ;;
5138       freebsd* | dragonfly*)
5139         # FreeBSD uses GNU C++
5140         ;;
5141       hpux9* | hpux10* | hpux11*)
5142         case $cc_basename in
5143           CC*)
5144             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5145             _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5146             if test "$host_cpu" != ia64; then
5147               _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5148             fi
5149             ;;
5150           aCC*)
5151             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5152             _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5153             case $host_cpu in
5154             hppa*64*|ia64*)
5155               # +Z the default
5156               ;;
5157             *)
5158               _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5159               ;;
5160             esac
5161             ;;
5162           *)
5163             ;;
5164         esac
5165         ;;
5166       interix*)
5167         # This is c89, which is MS Visual C++ (no shared libs)
5168         # Anyone wants to do a port?
5169         ;;
5170       irix5* | irix6* | nonstopux*)
5171         case $cc_basename in
5172           CC*)
5173             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5174             _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5175             # CC pic flag -KPIC is the default.
5176             ;;
5177           *)
5178             ;;
5179         esac
5180         ;;
5181       linux* | k*bsd*-gnu | kopensolaris*-gnu)
5182         case $cc_basename in
5183           KCC*)
5184             # KAI C++ Compiler
5185             _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5186             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5187             ;;
5188           ecpc* )
5189             # old Intel C++ for x86_64 which still supported -KPIC.
5190             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5191             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5192             _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5193             ;;
5194           icpc* )
5195             # Intel C++, used to be incompatible with GCC.
5196             # ICC 10 doesn't accept -KPIC any more.
5197             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5198             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5199             _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5200             ;;
5201           pgCC* | pgcpp*)
5202             # Portland Group C++ compiler
5203             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5204             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5205             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5206             ;;
5207           cxx*)
5208             # Compaq C++
5209             # Make sure the PIC flag is empty.  It appears that all Alpha
5210             # Linux and Compaq Tru64 Unix objects are PIC.
5211             _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5212             _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5213             ;;
5214           xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5215             # IBM XL 8.0, 9.0 on PPC and BlueGene
5216             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5217             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5218             _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5219             ;;
5220           *)
5221             case `$CC -V 2>&1 | sed 5q` in
5222             *Sun\ C*)
5223               # Sun C++ 5.9
5224               _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5225               _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5226               _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5227               ;;
5228             esac
5229             ;;
5230         esac
5231         ;;
5232       lynxos*)
5233         ;;
5234       m88k*)
5235         ;;
5236       mvs*)
5237         case $cc_basename in
5238           cxx*)
5239             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5240             ;;
5241           *)
5242             ;;
5243         esac
5244         ;;
5245       netbsd*)
5246         ;;
5247       *qnx* | *nto*)
5248         # QNX uses GNU C++, but need to define -shared option too, otherwise
5249         # it will coredump.
5250         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5251         ;;
5252       osf3* | osf4* | osf5*)
5253         case $cc_basename in
5254           KCC*)
5255             _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5256             ;;
5257           RCC*)
5258             # Rational C++ 2.4.1
5259             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5260             ;;
5261           cxx*)
5262             # Digital/Compaq C++
5263             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5264             # Make sure the PIC flag is empty.  It appears that all Alpha
5265             # Linux and Compaq Tru64 Unix objects are PIC.
5266             _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5267             _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5268             ;;
5269           *)
5270             ;;
5271         esac
5272         ;;
5273       psos*)
5274         ;;
5275       solaris*)
5276         case $cc_basename in
5277           CC* | sunCC*)
5278             # Sun C++ 4.2, 5.x and Centerline C++
5279             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5280             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5281             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5282             ;;
5283           gcx*)
5284             # Green Hills C++ Compiler
5285             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5286             ;;
5287           *)
5288             ;;
5289         esac
5290         ;;
5291       sunos4*)
5292         case $cc_basename in
5293           CC*)
5294             # Sun C++ 4.x
5295             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5296             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5297             ;;
5298           lcc*)
5299             # Lucid
5300             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5301             ;;
5302           *)
5303             ;;
5304         esac
5305         ;;
5306       sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5307         case $cc_basename in
5308           CC*)
5309             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5310             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5311             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5312             ;;
5313         esac
5314         ;;
5315       tandem*)
5316         case $cc_basename in
5317           NCC*)
5318             # NonStop-UX NCC 3.20
5319             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5320             ;;
5321           *)
5322             ;;
5323         esac
5324         ;;
5325       vxworks*)
5326         ;;
5327       *)
5328         _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5329         ;;
5330     esac
5331   fi
5332 ],
5333 [
5334   if test "$GCC" = yes; then
5335     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5336     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5337
5338     case $host_os in
5339       aix*)
5340       # All AIX code is PIC.
5341       if test "$host_cpu" = ia64; then
5342         # AIX 5 now supports IA64 processor
5343         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5344       fi
5345       ;;
5346
5347     amigaos*)
5348       case $host_cpu in
5349       powerpc)
5350             # see comment about AmigaOS4 .so support
5351             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5352         ;;
5353       m68k)
5354             # FIXME: we need at least 68020 code to build shared libraries, but
5355             # adding the `-m68020' flag to GCC prevents building anything better,
5356             # like `-m68040'.
5357             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5358         ;;
5359       esac
5360       ;;
5361
5362     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5363       # PIC is the default for these OSes.
5364       ;;
5365
5366     mingw* | cygwin* | pw32* | os2* | cegcc*)
5367       # This hack is so that the source file can tell whether it is being
5368       # built for inclusion in a dll (and should export symbols for example).
5369       # Although the cygwin gcc ignores -fPIC, still need this for old-style
5370       # (--disable-auto-import) libraries
5371       m4_if([$1], [GCJ], [],
5372         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5373       ;;
5374
5375     darwin* | rhapsody*)
5376       # PIC is the default on this platform
5377       # Common symbols not allowed in MH_DYLIB files
5378       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5379       ;;
5380
5381     haiku*)
5382       # PIC is the default for Haiku.
5383       # The "-static" flag exists, but is broken.
5384       _LT_TAGVAR(lt_prog_compiler_static, $1)=
5385       ;;
5386
5387     hpux*)
5388       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5389       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5390       # sets the default TLS model and affects inlining.
5391       case $host_cpu in
5392       hppa*64*)
5393         # +Z the default
5394         ;;
5395       *)
5396         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5397         ;;
5398       esac
5399       ;;
5400
5401     interix[[3-9]]*)
5402       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5403       # Instead, we relocate shared libraries at runtime.
5404       ;;
5405
5406     msdosdjgpp*)
5407       # Just because we use GCC doesn't mean we suddenly get shared libraries
5408       # on systems that don't support them.
5409       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5410       enable_shared=no
5411       ;;
5412
5413     *nto* | *qnx*)
5414       # QNX uses GNU C++, but need to define -shared option too, otherwise
5415       # it will coredump.
5416       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5417       ;;
5418
5419     sysv4*MP*)
5420       if test -d /usr/nec; then
5421         _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5422       fi
5423       ;;
5424
5425     *)
5426       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5427       ;;
5428     esac
5429
5430     case $cc_basename in
5431     nvcc*) # Cuda Compiler Driver 2.2
5432       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5433       if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5434         _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5435       fi
5436       ;;
5437     esac
5438   else
5439     # PORTME Check for flag to pass linker flags through the system compiler.
5440     case $host_os in
5441     aix*)
5442       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5443       if test "$host_cpu" = ia64; then
5444         # AIX 5 now supports IA64 processor
5445         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5446       else
5447         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5448       fi
5449       ;;
5450
5451     mingw* | cygwin* | pw32* | os2* | cegcc*)
5452       # This hack is so that the source file can tell whether it is being
5453       # built for inclusion in a dll (and should export symbols for example).
5454       m4_if([$1], [GCJ], [],
5455         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5456       ;;
5457
5458     hpux9* | hpux10* | hpux11*)
5459       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5460       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5461       # not for PA HP-UX.
5462       case $host_cpu in
5463       hppa*64*|ia64*)
5464         # +Z the default
5465         ;;
5466       *)
5467         _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5468         ;;
5469       esac
5470       # Is there a better lt_prog_compiler_static that works with the bundled CC?
5471       _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5472       ;;
5473
5474     irix5* | irix6* | nonstopux*)
5475       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5476       # PIC (with -KPIC) is the default.
5477       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5478       ;;
5479
5480     linux* | k*bsd*-gnu | kopensolaris*-gnu)
5481       case $cc_basename in
5482       # old Intel for x86_64 which still supported -KPIC.
5483       ecc*)
5484         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5485         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5486         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5487         ;;
5488       # icc used to be incompatible with GCC.
5489       # ICC 10 doesn't accept -KPIC any more.
5490       icc* | ifort*)
5491         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5492         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5493         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5494         ;;
5495       # Lahey Fortran 8.1.
5496       lf95*)
5497         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5498         _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5499         _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5500         ;;
5501       nagfor*)
5502         # NAG Fortran compiler
5503         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5504         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5505         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5506         ;;
5507       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5508         # Portland Group compilers (*not* the Pentium gcc compiler,
5509         # which looks to be a dead project)
5510         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5511         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5512         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5513         ;;
5514       ccc*)
5515         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5516         # All Alpha code is PIC.
5517         _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5518         ;;
5519       xl* | bgxl* | bgf* | mpixl*)
5520         # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5521         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5522         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5523         _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5524         ;;
5525       *)
5526         case `$CC -V 2>&1 | sed 5q` in
5527         *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5528           # Sun Fortran 8.3 passes all unrecognized flags to the linker
5529           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5530           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5531           _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5532           ;;
5533         *Sun\ F* | *Sun*Fortran*)
5534           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5535           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5536           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5537           ;;
5538         *Sun\ C*)
5539           # Sun C 5.9
5540           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5541           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5542           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5543           ;;
5544         *Intel*\ [[CF]]*Compiler*)
5545           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5546           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5547           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5548           ;;
5549         *Portland\ Group*)
5550           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5551           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5552           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5553           ;;
5554         esac
5555         ;;
5556       esac
5557       ;;
5558
5559     newsos6)
5560       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5561       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5562       ;;
5563
5564     *nto* | *qnx*)
5565       # QNX uses GNU C++, but need to define -shared option too, otherwise
5566       # it will coredump.
5567       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5568       ;;
5569
5570     osf3* | osf4* | osf5*)
5571       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5572       # All OSF/1 code is PIC.
5573       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5574       ;;
5575
5576     rdos*)
5577       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5578       ;;
5579
5580     solaris*)
5581       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5582       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5583       case $cc_basename in
5584       f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5585         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5586       *)
5587         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5588       esac
5589       ;;
5590
5591     sunos4*)
5592       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5593       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5594       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5595       ;;
5596
5597     sysv4 | sysv4.2uw2* | sysv4.3*)
5598       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5599       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5600       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5601       ;;
5602
5603     sysv4*MP*)
5604       if test -d /usr/nec ;then
5605         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5606         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5607       fi
5608       ;;
5609
5610     sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5611       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5612       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5613       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5614       ;;
5615
5616     unicos*)
5617       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5618       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5619       ;;
5620
5621     uts4*)
5622       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5623       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5624       ;;
5625
5626     *)
5627       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5628       ;;
5629     esac
5630   fi
5631 ])
5632 case $host_os in
5633   # For platforms which do not support PIC, -DPIC is meaningless:
5634   *djgpp*)
5635     _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5636     ;;
5637   *)
5638     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5639     ;;
5640 esac
5641
5642 AC_CACHE_CHECK([for $compiler option to produce PIC],
5643   [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5644   [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5645 _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5646
5647 #
5648 # Check to make sure the PIC flag actually works.
5649 #
5650 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5651   _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5652     [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5653     [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5654     [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5655      "" | " "*) ;;
5656      *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5657      esac],
5658     [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5659      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5660 fi
5661 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5662         [Additional compiler flags for building library objects])
5663
5664 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5665         [How to pass a linker flag through the compiler])
5666 #
5667 # Check to make sure the static flag actually works.
5668 #
5669 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5670 _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5671   _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5672   $lt_tmp_static_flag,
5673   [],
5674   [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5675 _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5676         [Compiler flag to prevent dynamic linking])
5677 ])# _LT_COMPILER_PIC
5678
5679
5680 # _LT_LINKER_SHLIBS([TAGNAME])
5681 # ----------------------------
5682 # See if the linker supports building shared libraries.
5683 m4_defun([_LT_LINKER_SHLIBS],
5684 [AC_REQUIRE([LT_PATH_LD])dnl
5685 AC_REQUIRE([LT_PATH_NM])dnl
5686 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5687 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5688 m4_require([_LT_DECL_EGREP])dnl
5689 m4_require([_LT_DECL_SED])dnl
5690 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5691 m4_require([_LT_TAG_COMPILER])dnl
5692 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5693 m4_if([$1], [CXX], [
5694   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5695   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5696   case $host_os in
5697   aix[[4-9]]*)
5698     # If we're using GNU nm, then we don't want the "-C" option.
5699     # -C means demangle to AIX nm, but means don't demangle with GNU nm
5700     # Also, AIX nm treats weak defined symbols like other global defined
5701     # symbols, whereas GNU nm marks them as "W".
5702     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5703       _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'
5704     else
5705       _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'
5706     fi
5707     ;;
5708   pw32*)
5709     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5710     ;;
5711   cygwin* | mingw* | cegcc*)
5712     case $cc_basename in
5713     cl*)
5714       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5715       ;;
5716     *)
5717       _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'
5718       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5719       ;;
5720     esac
5721     ;;
5722   *)
5723     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5724     ;;
5725   esac
5726 ], [
5727   runpath_var=
5728   _LT_TAGVAR(allow_undefined_flag, $1)=
5729   _LT_TAGVAR(always_export_symbols, $1)=no
5730   _LT_TAGVAR(archive_cmds, $1)=
5731   _LT_TAGVAR(archive_expsym_cmds, $1)=
5732   _LT_TAGVAR(compiler_needs_object, $1)=no
5733   _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5734   _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5735   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5736   _LT_TAGVAR(hardcode_automatic, $1)=no
5737   _LT_TAGVAR(hardcode_direct, $1)=no
5738   _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5739   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5740   _LT_TAGVAR(hardcode_libdir_separator, $1)=
5741   _LT_TAGVAR(hardcode_minus_L, $1)=no
5742   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5743   _LT_TAGVAR(inherit_rpath, $1)=no
5744   _LT_TAGVAR(link_all_deplibs, $1)=unknown
5745   _LT_TAGVAR(module_cmds, $1)=
5746   _LT_TAGVAR(module_expsym_cmds, $1)=
5747   _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5748   _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5749   _LT_TAGVAR(thread_safe_flag_spec, $1)=
5750   _LT_TAGVAR(whole_archive_flag_spec, $1)=
5751   # include_expsyms should be a list of space-separated symbols to be *always*
5752   # included in the symbol list
5753   _LT_TAGVAR(include_expsyms, $1)=
5754   # exclude_expsyms can be an extended regexp of symbols to exclude
5755   # it will be wrapped by ` (' and `)$', so one must not match beginning or
5756   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5757   # as well as any symbol that contains `d'.
5758   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5759   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5760   # platforms (ab)use it in PIC code, but their linkers get confused if
5761   # the symbol is explicitly referenced.  Since portable code cannot
5762   # rely on this symbol name, it's probably fine to never include it in
5763   # preloaded symbol tables.
5764   # Exclude shared library initialization/finalization symbols.
5765 dnl Note also adjust exclude_expsyms for C++ above.
5766   extract_expsyms_cmds=
5767
5768   case $host_os in
5769   cygwin* | mingw* | pw32* | cegcc*)
5770     # FIXME: the MSVC++ port hasn't been tested in a loooong time
5771     # When not using gcc, we currently assume that we are using
5772     # Microsoft Visual C++.
5773     if test "$GCC" != yes; then
5774       with_gnu_ld=no
5775     fi
5776     ;;
5777   interix*)
5778     # we just hope/assume this is gcc and not c89 (= MSVC++)
5779     with_gnu_ld=yes
5780     ;;
5781   openbsd*)
5782     with_gnu_ld=no
5783     ;;
5784   esac
5785
5786   _LT_TAGVAR(ld_shlibs, $1)=yes
5787
5788   # On some targets, GNU ld is compatible enough with the native linker
5789   # that we're better off using the native interface for both.
5790   lt_use_gnu_ld_interface=no
5791   if test "$with_gnu_ld" = yes; then
5792     case $host_os in
5793       aix*)
5794         # The AIX port of GNU ld has always aspired to compatibility
5795         # with the native linker.  However, as the warning in the GNU ld
5796         # block says, versions before 2.19.5* couldn't really create working
5797         # shared libraries, regardless of the interface used.
5798         case `$LD -v 2>&1` in
5799           *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5800           *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5801           *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5802           *)
5803             lt_use_gnu_ld_interface=yes
5804             ;;
5805         esac
5806         ;;
5807       *)
5808         lt_use_gnu_ld_interface=yes
5809         ;;
5810     esac
5811   fi
5812
5813   if test "$lt_use_gnu_ld_interface" = yes; then
5814     # If archive_cmds runs LD, not CC, wlarc should be empty
5815     wlarc='${wl}'
5816
5817     # Set some defaults for GNU ld with shared library support. These
5818     # are reset later if shared libraries are not supported. Putting them
5819     # here allows them to be overridden if necessary.
5820     runpath_var=LD_RUN_PATH
5821     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5822     _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5823     # ancient GNU ld didn't support --whole-archive et. al.
5824     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5825       _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5826     else
5827       _LT_TAGVAR(whole_archive_flag_spec, $1)=
5828     fi
5829     supports_anon_versioning=no
5830     case `$LD -v 2>&1` in
5831       *GNU\ gold*) supports_anon_versioning=yes ;;
5832       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5833       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5834       *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5835       *\ 2.11.*) ;; # other 2.11 versions
5836       *) supports_anon_versioning=yes ;;
5837     esac
5838
5839     # See if GNU ld supports shared libraries.
5840     case $host_os in
5841     aix[[3-9]]*)
5842       # On AIX/PPC, the GNU linker is very broken
5843       if test "$host_cpu" != ia64; then
5844         _LT_TAGVAR(ld_shlibs, $1)=no
5845         cat <<_LT_EOF 1>&2
5846
5847 *** Warning: the GNU linker, at least up to release 2.19, is reported
5848 *** to be unable to reliably create shared libraries on AIX.
5849 *** Therefore, libtool is disabling shared libraries support.  If you
5850 *** really care for shared libraries, you may want to install binutils
5851 *** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5852 *** You will then need to restart the configuration process.
5853
5854 _LT_EOF
5855       fi
5856       ;;
5857
5858     amigaos*)
5859       case $host_cpu in
5860       powerpc)
5861             # see comment about AmigaOS4 .so support
5862             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5863             _LT_TAGVAR(archive_expsym_cmds, $1)=''
5864         ;;
5865       m68k)
5866             _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)'
5867             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5868             _LT_TAGVAR(hardcode_minus_L, $1)=yes
5869         ;;
5870       esac
5871       ;;
5872
5873     beos*)
5874       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5875         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5876         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5877         # support --undefined.  This deserves some investigation.  FIXME
5878         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5879       else
5880         _LT_TAGVAR(ld_shlibs, $1)=no
5881       fi
5882       ;;
5883
5884     cygwin* | mingw* | pw32* | cegcc*)
5885       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5886       # as there is no search path for DLLs.
5887       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5888       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5889       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5890       _LT_TAGVAR(always_export_symbols, $1)=no
5891       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5892       _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'
5893       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5894
5895       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5896         _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'
5897         # If the export-symbols file already is a .def file (1st line
5898         # is EXPORTS), use it as is; otherwise, prepend...
5899         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5900           cp $export_symbols $output_objdir/$soname.def;
5901         else
5902           echo EXPORTS > $output_objdir/$soname.def;
5903           cat $export_symbols >> $output_objdir/$soname.def;
5904         fi~
5905         $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5906       else
5907         _LT_TAGVAR(ld_shlibs, $1)=no
5908       fi
5909       ;;
5910
5911     haiku*)
5912       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5913       _LT_TAGVAR(link_all_deplibs, $1)=yes
5914       ;;
5915
5916     interix[[3-9]]*)
5917       _LT_TAGVAR(hardcode_direct, $1)=no
5918       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5919       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5920       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5921       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5922       # Instead, shared libraries are loaded at an image base (0x10000000 by
5923       # default) and relocated if they conflict, which is a slow very memory
5924       # consuming and fragmenting process.  To avoid this, we pick a random,
5925       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5926       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5927       _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'
5928       _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'
5929       ;;
5930
5931     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5932       tmp_diet=no
5933       if test "$host_os" = linux-dietlibc; then
5934         case $cc_basename in
5935           diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
5936         esac
5937       fi
5938       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5939          && test "$tmp_diet" = no
5940       then
5941         tmp_addflag=' $pic_flag'
5942         tmp_sharedflag='-shared'
5943         case $cc_basename,$host_cpu in
5944         pgcc*)                          # Portland Group C compiler
5945           _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'
5946           tmp_addflag=' $pic_flag'
5947           ;;
5948         pgf77* | pgf90* | pgf95* | pgfortran*)
5949                                         # Portland Group f77 and f90 compilers
5950           _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'
5951           tmp_addflag=' $pic_flag -Mnomain' ;;
5952         ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
5953           tmp_addflag=' -i_dynamic' ;;
5954         efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
5955           tmp_addflag=' -i_dynamic -nofor_main' ;;
5956         ifc* | ifort*)                  # Intel Fortran compiler
5957           tmp_addflag=' -nofor_main' ;;
5958         lf95*)                          # Lahey Fortran 8.1
5959           _LT_TAGVAR(whole_archive_flag_spec, $1)=
5960           tmp_sharedflag='--shared' ;;
5961         xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5962           tmp_sharedflag='-qmkshrobj'
5963           tmp_addflag= ;;
5964         nvcc*)  # Cuda Compiler Driver 2.2
5965           _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'
5966           _LT_TAGVAR(compiler_needs_object, $1)=yes
5967           ;;
5968         esac
5969         case `$CC -V 2>&1 | sed 5q` in
5970         *Sun\ C*)                       # Sun C 5.9
5971           _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'
5972           _LT_TAGVAR(compiler_needs_object, $1)=yes
5973           tmp_sharedflag='-G' ;;
5974         *Sun\ F*)                       # Sun Fortran 8.3
5975           tmp_sharedflag='-G' ;;
5976         esac
5977         _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5978
5979         if test "x$supports_anon_versioning" = xyes; then
5980           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5981             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5982             echo "local: *; };" >> $output_objdir/$libname.ver~
5983             $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5984         fi
5985
5986         case $cc_basename in
5987         xlf* | bgf* | bgxlf* | mpixlf*)
5988           # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5989           _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5990           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5991           _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5992           if test "x$supports_anon_versioning" = xyes; then
5993             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5994               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5995               echo "local: *; };" >> $output_objdir/$libname.ver~
5996               $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5997           fi
5998           ;;
5999         esac
6000       else
6001         _LT_TAGVAR(ld_shlibs, $1)=no
6002       fi
6003       ;;
6004
6005     netbsd*)
6006       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6007         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6008         wlarc=
6009       else
6010         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6011         _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'
6012       fi
6013       ;;
6014
6015     solaris*)
6016       if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
6017         _LT_TAGVAR(ld_shlibs, $1)=no
6018         cat <<_LT_EOF 1>&2
6019
6020 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
6021 *** create shared libraries on Solaris systems.  Therefore, libtool
6022 *** is disabling shared libraries support.  We urge you to upgrade GNU
6023 *** binutils to release 2.9.1 or newer.  Another option is to modify
6024 *** your PATH or compiler configuration so that the native linker is
6025 *** used, and then restart.
6026
6027 _LT_EOF
6028       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6029         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6030         _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'
6031       else
6032         _LT_TAGVAR(ld_shlibs, $1)=no
6033       fi
6034       ;;
6035
6036     sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
6037       case `$LD -v 2>&1` in
6038         *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
6039         _LT_TAGVAR(ld_shlibs, $1)=no
6040         cat <<_LT_EOF 1>&2
6041
6042 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
6043 *** reliably create shared libraries on SCO systems.  Therefore, libtool
6044 *** is disabling shared libraries support.  We urge you to upgrade GNU
6045 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
6046 *** your PATH or compiler configuration so that the native linker is
6047 *** used, and then restart.
6048
6049 _LT_EOF
6050         ;;
6051         *)
6052           # For security reasons, it is highly recommended that you always
6053           # use absolute paths for naming shared libraries, and exclude the
6054           # DT_RUNPATH tag from executables and libraries.  But doing so
6055           # requires that you compile everything twice, which is a pain.
6056           if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6057             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6058             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6059             _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'
6060           else
6061             _LT_TAGVAR(ld_shlibs, $1)=no
6062           fi
6063         ;;
6064       esac
6065       ;;
6066
6067     sunos4*)
6068       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6069       wlarc=
6070       _LT_TAGVAR(hardcode_direct, $1)=yes
6071       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6072       ;;
6073
6074     *)
6075       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6076         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6077         _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'
6078       else
6079         _LT_TAGVAR(ld_shlibs, $1)=no
6080       fi
6081       ;;
6082     esac
6083
6084     if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
6085       runpath_var=
6086       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6087       _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6088       _LT_TAGVAR(whole_archive_flag_spec, $1)=
6089     fi
6090   else
6091     # PORTME fill in a description of your system's linker (not GNU ld)
6092     case $host_os in
6093     aix3*)
6094       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6095       _LT_TAGVAR(always_export_symbols, $1)=yes
6096       _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'
6097       # Note: this linker hardcodes the directories in LIBPATH if there
6098       # are no directories specified by -L.
6099       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6100       if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6101         # Neither direct hardcoding nor static linking is supported with a
6102         # broken collect2.
6103         _LT_TAGVAR(hardcode_direct, $1)=unsupported
6104       fi
6105       ;;
6106
6107     aix[[4-9]]*)
6108       if test "$host_cpu" = ia64; then
6109         # On IA64, the linker does run time linking by default, so we don't
6110         # have to do anything special.
6111         aix_use_runtimelinking=no
6112         exp_sym_flag='-Bexport'
6113         no_entry_flag=""
6114       else
6115         # If we're using GNU nm, then we don't want the "-C" option.
6116         # -C means demangle to AIX nm, but means don't demangle with GNU nm
6117         # Also, AIX nm treats weak defined symbols like other global
6118         # defined symbols, whereas GNU nm marks them as "W".
6119         if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6120           _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'
6121         else
6122           _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'
6123         fi
6124         aix_use_runtimelinking=no
6125
6126         # Test if we are trying to use run time linking or normal
6127         # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6128         # need to do runtime linking.
6129         case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6130           for ld_flag in $LDFLAGS; do
6131           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6132             aix_use_runtimelinking=yes
6133             break
6134           fi
6135           done
6136           ;;
6137         esac
6138
6139         exp_sym_flag='-bexport'
6140         no_entry_flag='-bnoentry'
6141       fi
6142
6143       # When large executables or shared objects are built, AIX ld can
6144       # have problems creating the table of contents.  If linking a library
6145       # or program results in "error TOC overflow" add -mminimal-toc to
6146       # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6147       # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6148
6149       _LT_TAGVAR(archive_cmds, $1)=''
6150       _LT_TAGVAR(hardcode_direct, $1)=yes
6151       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6152       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6153       _LT_TAGVAR(link_all_deplibs, $1)=yes
6154       _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6155
6156       if test "$GCC" = yes; then
6157         case $host_os in aix4.[[012]]|aix4.[[012]].*)
6158         # We only want to do this on AIX 4.2 and lower, the check
6159         # below for broken collect2 doesn't work under 4.3+
6160           collect2name=`${CC} -print-prog-name=collect2`
6161           if test -f "$collect2name" &&
6162            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6163           then
6164           # We have reworked collect2
6165           :
6166           else
6167           # We have old collect2
6168           _LT_TAGVAR(hardcode_direct, $1)=unsupported
6169           # It fails to find uninstalled libraries when the uninstalled
6170           # path is not listed in the libpath.  Setting hardcode_minus_L
6171           # to unsupported forces relinking
6172           _LT_TAGVAR(hardcode_minus_L, $1)=yes
6173           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6174           _LT_TAGVAR(hardcode_libdir_separator, $1)=
6175           fi
6176           ;;
6177         esac
6178         shared_flag='-shared'
6179         if test "$aix_use_runtimelinking" = yes; then
6180           shared_flag="$shared_flag "'${wl}-G'
6181         fi
6182       else
6183         # not using gcc
6184         if test "$host_cpu" = ia64; then
6185         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6186         # chokes on -Wl,-G. The following line is correct:
6187           shared_flag='-G'
6188         else
6189           if test "$aix_use_runtimelinking" = yes; then
6190             shared_flag='${wl}-G'
6191           else
6192             shared_flag='${wl}-bM:SRE'
6193           fi
6194         fi
6195       fi
6196
6197       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6198       # It seems that -bexpall does not export symbols beginning with
6199       # underscore (_), so it is better to generate a list of symbols to export.
6200       _LT_TAGVAR(always_export_symbols, $1)=yes
6201       if test "$aix_use_runtimelinking" = yes; then
6202         # Warning - without using the other runtime loading flags (-brtl),
6203         # -berok will link without error, but may produce a broken library.
6204         _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6205         # Determine the default libpath from the value encoded in an
6206         # empty executable.
6207         _LT_SYS_MODULE_PATH_AIX([$1])
6208         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6209         _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"
6210       else
6211         if test "$host_cpu" = ia64; then
6212           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6213           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6214           _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"
6215         else
6216          # Determine the default libpath from the value encoded in an
6217          # empty executable.
6218          _LT_SYS_MODULE_PATH_AIX([$1])
6219          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6220           # Warning - without using the other run time loading flags,
6221           # -berok will link without error, but may produce a broken library.
6222           _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6223           _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6224           if test "$with_gnu_ld" = yes; then
6225             # We only use this code for GNU lds that support --whole-archive.
6226             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6227           else
6228             # Exported symbols can be pulled into shared objects from archives
6229             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6230           fi
6231           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6232           # This is similar to how AIX traditionally builds its shared libraries.
6233           _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'
6234         fi
6235       fi
6236       ;;
6237
6238     amigaos*)
6239       case $host_cpu in
6240       powerpc)
6241             # see comment about AmigaOS4 .so support
6242             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6243             _LT_TAGVAR(archive_expsym_cmds, $1)=''
6244         ;;
6245       m68k)
6246             _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)'
6247             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6248             _LT_TAGVAR(hardcode_minus_L, $1)=yes
6249         ;;
6250       esac
6251       ;;
6252
6253     bsdi[[45]]*)
6254       _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6255       ;;
6256
6257     cygwin* | mingw* | pw32* | cegcc*)
6258       # When not using gcc, we currently assume that we are using
6259       # Microsoft Visual C++.
6260       # hardcode_libdir_flag_spec is actually meaningless, as there is
6261       # no search path for DLLs.
6262       case $cc_basename in
6263       cl*)
6264         # Native MSVC
6265         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6266         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6267         _LT_TAGVAR(always_export_symbols, $1)=yes
6268         _LT_TAGVAR(file_list_spec, $1)='@'
6269         # Tell ltmain to make .lib files, not .a files.
6270         libext=lib
6271         # Tell ltmain to make .dll files, not .so files.
6272         shrext_cmds=".dll"
6273         # FIXME: Setting linknames here is a bad hack.
6274         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6275         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6276             sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6277           else
6278             sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6279           fi~
6280           $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6281           linknames='
6282         # The linker will not automatically build a static lib if we build a DLL.
6283         # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6284         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6285         _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6286         _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'
6287         # Don't use ranlib
6288         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6289         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6290           lt_tool_outputfile="@TOOL_OUTPUT@"~
6291           case $lt_outputfile in
6292             *.exe|*.EXE) ;;
6293             *)
6294               lt_outputfile="$lt_outputfile.exe"
6295               lt_tool_outputfile="$lt_tool_outputfile.exe"
6296               ;;
6297           esac~
6298           if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6299             $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6300             $RM "$lt_outputfile.manifest";
6301           fi'
6302         ;;
6303       *)
6304         # Assume MSVC wrapper
6305         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6306         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6307         # Tell ltmain to make .lib files, not .a files.
6308         libext=lib
6309         # Tell ltmain to make .dll files, not .so files.
6310         shrext_cmds=".dll"
6311         # FIXME: Setting linknames here is a bad hack.
6312         _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6313         # The linker will automatically build a .lib file if we build a DLL.
6314         _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6315         # FIXME: Should let the user specify the lib program.
6316         _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6317         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6318         ;;
6319       esac
6320       ;;
6321
6322     darwin* | rhapsody*)
6323       _LT_DARWIN_LINKER_FEATURES($1)
6324       ;;
6325
6326     dgux*)
6327       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6328       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6329       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6330       ;;
6331
6332     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6333     # support.  Future versions do this automatically, but an explicit c++rt0.o
6334     # does not break anything, and helps significantly (at the cost of a little
6335     # extra space).
6336     freebsd2.2*)
6337       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6338       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6339       _LT_TAGVAR(hardcode_direct, $1)=yes
6340       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6341       ;;
6342
6343     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6344     freebsd2.*)
6345       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6346       _LT_TAGVAR(hardcode_direct, $1)=yes
6347       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6348       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6349       ;;
6350
6351     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6352     freebsd* | dragonfly*)
6353       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6354       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6355       _LT_TAGVAR(hardcode_direct, $1)=yes
6356       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6357       ;;
6358
6359     hpux9*)
6360       if test "$GCC" = yes; then
6361         _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'
6362       else
6363         _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'
6364       fi
6365       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6366       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6367       _LT_TAGVAR(hardcode_direct, $1)=yes
6368
6369       # hardcode_minus_L: Not really in the search PATH,
6370       # but as the default location of the library.
6371       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6372       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6373       ;;
6374
6375     hpux10*)
6376       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6377         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6378       else
6379         _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6380       fi
6381       if test "$with_gnu_ld" = no; then
6382         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6383         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6384         _LT_TAGVAR(hardcode_direct, $1)=yes
6385         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6386         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6387         # hardcode_minus_L: Not really in the search PATH,
6388         # but as the default location of the library.
6389         _LT_TAGVAR(hardcode_minus_L, $1)=yes
6390       fi
6391       ;;
6392
6393     hpux11*)
6394       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6395         case $host_cpu in
6396         hppa*64*)
6397           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6398           ;;
6399         ia64*)
6400           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6401           ;;
6402         *)
6403           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6404           ;;
6405         esac
6406       else
6407         case $host_cpu in
6408         hppa*64*)
6409           _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6410           ;;
6411         ia64*)
6412           _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6413           ;;
6414         *)
6415         m4_if($1, [], [
6416           # Older versions of the 11.00 compiler do not understand -b yet
6417           # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6418           _LT_LINKER_OPTION([if $CC understands -b],
6419             _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6420             [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6421             [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6422           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6423           ;;
6424         esac
6425       fi
6426       if test "$with_gnu_ld" = no; then
6427         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6428         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6429
6430         case $host_cpu in
6431         hppa*64*|ia64*)
6432           _LT_TAGVAR(hardcode_direct, $1)=no
6433           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6434           ;;
6435         *)
6436           _LT_TAGVAR(hardcode_direct, $1)=yes
6437           _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6438           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6439
6440           # hardcode_minus_L: Not really in the search PATH,
6441           # but as the default location of the library.
6442           _LT_TAGVAR(hardcode_minus_L, $1)=yes
6443           ;;
6444         esac
6445       fi
6446       ;;
6447
6448     irix5* | irix6* | nonstopux*)
6449       if test "$GCC" = yes; then
6450         _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'
6451         # Try to use the -exported_symbol ld option, if it does not
6452         # work, assume that -exports_file does not work either and
6453         # implicitly export all symbols.
6454         # This should be the same for all languages, so no per-tag cache variable.
6455         AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6456           [lt_cv_irix_exported_symbol],
6457           [save_LDFLAGS="$LDFLAGS"
6458            LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6459            AC_LINK_IFELSE(
6460              [AC_LANG_SOURCE(
6461                 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6462                               [C++], [[int foo (void) { return 0; }]],
6463                               [Fortran 77], [[
6464       subroutine foo
6465       end]],
6466                               [Fortran], [[
6467       subroutine foo
6468       end]])])],
6469               [lt_cv_irix_exported_symbol=yes],
6470               [lt_cv_irix_exported_symbol=no])
6471            LDFLAGS="$save_LDFLAGS"])
6472         if test "$lt_cv_irix_exported_symbol" = yes; then
6473           _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'
6474         fi
6475       else
6476         _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'
6477         _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'
6478       fi
6479       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6480       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6481       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6482       _LT_TAGVAR(inherit_rpath, $1)=yes
6483       _LT_TAGVAR(link_all_deplibs, $1)=yes
6484       ;;
6485
6486     netbsd*)
6487       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6488         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6489       else
6490         _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6491       fi
6492       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6493       _LT_TAGVAR(hardcode_direct, $1)=yes
6494       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6495       ;;
6496
6497     newsos6)
6498       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6499       _LT_TAGVAR(hardcode_direct, $1)=yes
6500       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6501       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6502       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6503       ;;
6504
6505     *nto* | *qnx*)
6506       ;;
6507
6508     openbsd*)
6509       if test -f /usr/libexec/ld.so; then
6510         _LT_TAGVAR(hardcode_direct, $1)=yes
6511         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6512         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6513         if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6514           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6515           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6516           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6517           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6518         else
6519           case $host_os in
6520            openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6521              _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6522              _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6523              ;;
6524            *)
6525              _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6526              _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6527              ;;
6528           esac
6529         fi
6530       else
6531         _LT_TAGVAR(ld_shlibs, $1)=no
6532       fi
6533       ;;
6534
6535     os2*)
6536       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6537       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6538       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6539       _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'
6540       _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6541       ;;
6542
6543     osf3*)
6544       if test "$GCC" = yes; then
6545         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6546         _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'
6547       else
6548         _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6549         _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'
6550       fi
6551       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6552       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6553       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6554       ;;
6555
6556     osf4* | osf5*)      # as osf3* with the addition of -msym flag
6557       if test "$GCC" = yes; then
6558         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6559         _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'
6560         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6561       else
6562         _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6563         _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'
6564         _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~
6565         $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'
6566
6567         # Both c and cxx compiler support -rpath directly
6568         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6569       fi
6570       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6571       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6572       ;;
6573
6574     solaris*)
6575       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6576       if test "$GCC" = yes; then
6577         wlarc='${wl}'
6578         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6579         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6580           $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'
6581       else
6582         case `$CC -V 2>&1` in
6583         *"Compilers 5.0"*)
6584           wlarc=''
6585           _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6586           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6587           $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6588           ;;
6589         *)
6590           wlarc='${wl}'
6591           _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6592           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6593           $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6594           ;;
6595         esac
6596       fi
6597       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6598       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6599       case $host_os in
6600       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6601       *)
6602         # The compiler driver will combine and reorder linker options,
6603         # but understands `-z linker_flag'.  GCC discards it without `$wl',
6604         # but is careful enough not to reorder.
6605         # Supported since Solaris 2.6 (maybe 2.5.1?)
6606         if test "$GCC" = yes; then
6607           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6608         else
6609           _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6610         fi
6611         ;;
6612       esac
6613       _LT_TAGVAR(link_all_deplibs, $1)=yes
6614       ;;
6615
6616     sunos4*)
6617       if test "x$host_vendor" = xsequent; then
6618         # Use $CC to link under sequent, because it throws in some extra .o
6619         # files that make .init and .fini sections work.
6620         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6621       else
6622         _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6623       fi
6624       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6625       _LT_TAGVAR(hardcode_direct, $1)=yes
6626       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6627       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6628       ;;
6629
6630     sysv4)
6631       case $host_vendor in
6632         sni)
6633           _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6634           _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6635         ;;
6636         siemens)
6637           ## LD is ld it makes a PLAMLIB
6638           ## CC just makes a GrossModule.
6639           _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6640           _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6641           _LT_TAGVAR(hardcode_direct, $1)=no
6642         ;;
6643         motorola)
6644           _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6645           _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6646         ;;
6647       esac
6648       runpath_var='LD_RUN_PATH'
6649       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6650       ;;
6651
6652     sysv4.3*)
6653       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6654       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6655       _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6656       ;;
6657
6658     sysv4*MP*)
6659       if test -d /usr/nec; then
6660         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6661         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6662         runpath_var=LD_RUN_PATH
6663         hardcode_runpath_var=yes
6664         _LT_TAGVAR(ld_shlibs, $1)=yes
6665       fi
6666       ;;
6667
6668     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6669       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6670       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6671       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6672       runpath_var='LD_RUN_PATH'
6673
6674       if test "$GCC" = yes; then
6675         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6676         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6677       else
6678         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6679         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6680       fi
6681       ;;
6682
6683     sysv5* | sco3.2v5* | sco5v6*)
6684       # Note: We can NOT use -z defs as we might desire, because we do not
6685       # link with -lc, and that would cause any symbols used from libc to
6686       # always be unresolved, which means just about no library would
6687       # ever link correctly.  If we're not using GNU ld we use -z text
6688       # though, which does catch some bad symbols but isn't as heavy-handed
6689       # as -z defs.
6690       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6691       _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6692       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6693       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6694       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6695       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6696       _LT_TAGVAR(link_all_deplibs, $1)=yes
6697       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6698       runpath_var='LD_RUN_PATH'
6699
6700       if test "$GCC" = yes; then
6701         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6702         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6703       else
6704         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6705         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6706       fi
6707       ;;
6708
6709     uts4*)
6710       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6711       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6712       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6713       ;;
6714
6715     *)
6716       _LT_TAGVAR(ld_shlibs, $1)=no
6717       ;;
6718     esac
6719
6720     if test x$host_vendor = xsni; then
6721       case $host in
6722       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6723         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6724         ;;
6725       esac
6726     fi
6727   fi
6728 ])
6729 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6730 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6731
6732 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6733
6734 _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6735 _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6736 _LT_DECL([], [extract_expsyms_cmds], [2],
6737     [The commands to extract the exported symbol list from a shared archive])
6738
6739 #
6740 # Do we need to explicitly link libc?
6741 #
6742 case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6743 x|xyes)
6744   # Assume -lc should be added
6745   _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6746
6747   if test "$enable_shared" = yes && test "$GCC" = yes; then
6748     case $_LT_TAGVAR(archive_cmds, $1) in
6749     *'~'*)
6750       # FIXME: we may have to deal with multi-command sequences.
6751       ;;
6752     '$CC '*)
6753       # Test whether the compiler implicitly links with -lc since on some
6754       # systems, -lgcc has to come before -lc. If gcc already passes -lc
6755       # to ld, don't add -lc before -lgcc.
6756       AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6757         [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6758         [$RM conftest*
6759         echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6760
6761         if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6762           soname=conftest
6763           lib=conftest
6764           libobjs=conftest.$ac_objext
6765           deplibs=
6766           wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6767           pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6768           compiler_flags=-v
6769           linker_flags=-v
6770           verstring=
6771           output_objdir=.
6772           libname=conftest
6773           lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6774           _LT_TAGVAR(allow_undefined_flag, $1)=
6775           if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6776           then
6777             lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6778           else
6779             lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6780           fi
6781           _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6782         else
6783           cat conftest.err 1>&5
6784         fi
6785         $RM conftest*
6786         ])
6787       _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6788       ;;
6789     esac
6790   fi
6791   ;;
6792 esac
6793
6794 _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6795     [Whether or not to add -lc for building shared libraries])
6796 _LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6797     [enable_shared_with_static_runtimes], [0],
6798     [Whether or not to disallow shared libs when runtime libs are static])
6799 _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6800     [Compiler flag to allow reflexive dlopens])
6801 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
6802     [Compiler flag to generate shared objects directly from archives])
6803 _LT_TAGDECL([], [compiler_needs_object], [1],
6804     [Whether the compiler copes with passing no objects directly])
6805 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6806     [Create an old-style archive from a shared archive])
6807 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6808     [Create a temporary old-style archive to link instead of a shared archive])
6809 _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6810 _LT_TAGDECL([], [archive_expsym_cmds], [2])
6811 _LT_TAGDECL([], [module_cmds], [2],
6812     [Commands used to build a loadable module if different from building
6813     a shared archive.])
6814 _LT_TAGDECL([], [module_expsym_cmds], [2])
6815 _LT_TAGDECL([], [with_gnu_ld], [1],
6816     [Whether we are building with GNU ld or not])
6817 _LT_TAGDECL([], [allow_undefined_flag], [1],
6818     [Flag that allows shared libraries with undefined symbols to be built])
6819 _LT_TAGDECL([], [no_undefined_flag], [1],
6820     [Flag that enforces no undefined symbols])
6821 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6822     [Flag to hardcode $libdir into a binary during linking.
6823     This must work even if $libdir does not exist])
6824 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
6825     [Whether we need a single "-rpath" flag with a separated argument])
6826 _LT_TAGDECL([], [hardcode_direct], [0],
6827     [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6828     DIR into the resulting binary])
6829 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
6830     [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6831     DIR into the resulting binary and the resulting library dependency is
6832     "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6833     library is relocated])
6834 _LT_TAGDECL([], [hardcode_minus_L], [0],
6835     [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6836     into the resulting binary])
6837 _LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6838     [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6839     into the resulting binary])
6840 _LT_TAGDECL([], [hardcode_automatic], [0],
6841     [Set to "yes" if building a shared library automatically hardcodes DIR
6842     into the library and all subsequent libraries and executables linked
6843     against it])
6844 _LT_TAGDECL([], [inherit_rpath], [0],
6845     [Set to yes if linker adds runtime paths of dependent libraries
6846     to runtime path list])
6847 _LT_TAGDECL([], [link_all_deplibs], [0],
6848     [Whether libtool must link a program against all its dependency libraries])
6849 _LT_TAGDECL([], [always_export_symbols], [0],
6850     [Set to "yes" if exported symbols are required])
6851 _LT_TAGDECL([], [export_symbols_cmds], [2],
6852     [The commands to list exported symbols])
6853 _LT_TAGDECL([], [exclude_expsyms], [1],
6854     [Symbols that should not be listed in the preloaded symbols])
6855 _LT_TAGDECL([], [include_expsyms], [1],
6856     [Symbols that must always be exported])
6857 _LT_TAGDECL([], [prelink_cmds], [2],
6858     [Commands necessary for linking programs (against libraries) with templates])
6859 _LT_TAGDECL([], [postlink_cmds], [2],
6860     [Commands necessary for finishing linking programs])
6861 _LT_TAGDECL([], [file_list_spec], [1],
6862     [Specify filename containing input files])
6863 dnl FIXME: Not yet implemented
6864 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6865 dnl    [Compiler flag to generate thread safe objects])
6866 ])# _LT_LINKER_SHLIBS
6867
6868
6869 # _LT_LANG_C_CONFIG([TAG])
6870 # ------------------------
6871 # Ensure that the configuration variables for a C compiler are suitably
6872 # defined.  These variables are subsequently used by _LT_CONFIG to write
6873 # the compiler configuration to `libtool'.
6874 m4_defun([_LT_LANG_C_CONFIG],
6875 [m4_require([_LT_DECL_EGREP])dnl
6876 lt_save_CC="$CC"
6877 AC_LANG_PUSH(C)
6878
6879 # Source file extension for C test sources.
6880 ac_ext=c
6881
6882 # Object file extension for compiled C test sources.
6883 objext=o
6884 _LT_TAGVAR(objext, $1)=$objext
6885
6886 # Code to be used in simple compile tests
6887 lt_simple_compile_test_code="int some_variable = 0;"
6888
6889 # Code to be used in simple link tests
6890 lt_simple_link_test_code='int main(){return(0);}'
6891
6892 _LT_TAG_COMPILER
6893 # Save the default compiler, since it gets overwritten when the other
6894 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6895 compiler_DEFAULT=$CC
6896
6897 # save warnings/boilerplate of simple test code
6898 _LT_COMPILER_BOILERPLATE
6899 _LT_LINKER_BOILERPLATE
6900
6901 if test -n "$compiler"; then
6902   _LT_COMPILER_NO_RTTI($1)
6903   _LT_COMPILER_PIC($1)
6904   _LT_COMPILER_C_O($1)
6905   _LT_COMPILER_FILE_LOCKS($1)
6906   _LT_LINKER_SHLIBS($1)
6907   _LT_SYS_DYNAMIC_LINKER($1)
6908   _LT_LINKER_HARDCODE_LIBPATH($1)
6909   LT_SYS_DLOPEN_SELF
6910   _LT_CMD_STRIPLIB
6911
6912   # Report which library types will actually be built
6913   AC_MSG_CHECKING([if libtool supports shared libraries])
6914   AC_MSG_RESULT([$can_build_shared])
6915
6916   AC_MSG_CHECKING([whether to build shared libraries])
6917   test "$can_build_shared" = "no" && enable_shared=no
6918
6919   # On AIX, shared libraries and static libraries use the same namespace, and
6920   # are all built from PIC.
6921   case $host_os in
6922   aix3*)
6923     test "$enable_shared" = yes && enable_static=no
6924     if test -n "$RANLIB"; then
6925       archive_cmds="$archive_cmds~\$RANLIB \$lib"
6926       postinstall_cmds='$RANLIB $lib'
6927     fi
6928     ;;
6929
6930   aix[[4-9]]*)
6931     if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6932       test "$enable_shared" = yes && enable_static=no
6933     fi
6934     ;;
6935   esac
6936   AC_MSG_RESULT([$enable_shared])
6937
6938   AC_MSG_CHECKING([whether to build static libraries])
6939   # Make sure either enable_shared or enable_static is yes.
6940   test "$enable_shared" = yes || enable_static=yes
6941   AC_MSG_RESULT([$enable_static])
6942
6943   _LT_CONFIG($1)
6944 fi
6945 AC_LANG_POP
6946 CC="$lt_save_CC"
6947 ])# _LT_LANG_C_CONFIG
6948
6949
6950 # _LT_LANG_CXX_CONFIG([TAG])
6951 # --------------------------
6952 # Ensure that the configuration variables for a C++ compiler are suitably
6953 # defined.  These variables are subsequently used by _LT_CONFIG to write
6954 # the compiler configuration to `libtool'.
6955 m4_defun([_LT_LANG_CXX_CONFIG],
6956 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6957 m4_require([_LT_DECL_EGREP])dnl
6958 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6959 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6960     ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6961     (test "X$CXX" != "Xg++"))) ; then
6962   AC_PROG_CXXCPP
6963 else
6964   _lt_caught_CXX_error=yes
6965 fi
6966
6967 AC_LANG_PUSH(C++)
6968 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6969 _LT_TAGVAR(allow_undefined_flag, $1)=
6970 _LT_TAGVAR(always_export_symbols, $1)=no
6971 _LT_TAGVAR(archive_expsym_cmds, $1)=
6972 _LT_TAGVAR(compiler_needs_object, $1)=no
6973 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6974 _LT_TAGVAR(hardcode_direct, $1)=no
6975 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6976 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6977 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6978 _LT_TAGVAR(hardcode_minus_L, $1)=no
6979 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6980 _LT_TAGVAR(hardcode_automatic, $1)=no
6981 _LT_TAGVAR(inherit_rpath, $1)=no
6982 _LT_TAGVAR(module_cmds, $1)=
6983 _LT_TAGVAR(module_expsym_cmds, $1)=
6984 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6985 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6986 _LT_TAGVAR(reload_flag, $1)=$reload_flag
6987 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6988 _LT_TAGVAR(no_undefined_flag, $1)=
6989 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6990 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6991
6992 # Source file extension for C++ test sources.
6993 ac_ext=cpp
6994
6995 # Object file extension for compiled C++ test sources.
6996 objext=o
6997 _LT_TAGVAR(objext, $1)=$objext
6998
6999 # No sense in running all these tests if we already determined that
7000 # the CXX compiler isn't working.  Some variables (like enable_shared)
7001 # are currently assumed to apply to all compilers on this platform,
7002 # and will be corrupted by setting them based on a non-working compiler.
7003 if test "$_lt_caught_CXX_error" != yes; then
7004   # Code to be used in simple compile tests
7005   lt_simple_compile_test_code="int some_variable = 0;"
7006
7007   # Code to be used in simple link tests
7008   lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
7009
7010   # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7011   _LT_TAG_COMPILER
7012
7013   # save warnings/boilerplate of simple test code
7014   _LT_COMPILER_BOILERPLATE
7015   _LT_LINKER_BOILERPLATE
7016
7017   # Allow CC to be a program name with arguments.
7018   lt_save_CC=$CC
7019   lt_save_CFLAGS=$CFLAGS
7020   lt_save_LD=$LD
7021   lt_save_GCC=$GCC
7022   GCC=$GXX
7023   lt_save_with_gnu_ld=$with_gnu_ld
7024   lt_save_path_LD=$lt_cv_path_LD
7025   if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
7026     lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
7027   else
7028     $as_unset lt_cv_prog_gnu_ld
7029   fi
7030   if test -n "${lt_cv_path_LDCXX+set}"; then
7031     lt_cv_path_LD=$lt_cv_path_LDCXX
7032   else
7033     $as_unset lt_cv_path_LD
7034   fi
7035   test -z "${LDCXX+set}" || LD=$LDCXX
7036   CC=${CXX-"c++"}
7037   CFLAGS=$CXXFLAGS
7038   compiler=$CC
7039   _LT_TAGVAR(compiler, $1)=$CC
7040   _LT_CC_BASENAME([$compiler])
7041
7042   if test -n "$compiler"; then
7043     # We don't want -fno-exception when compiling C++ code, so set the
7044     # no_builtin_flag separately
7045     if test "$GXX" = yes; then
7046       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7047     else
7048       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7049     fi
7050
7051     if test "$GXX" = yes; then
7052       # Set up default GNU C++ configuration
7053
7054       LT_PATH_LD
7055
7056       # Check if GNU C++ uses GNU ld as the underlying linker, since the
7057       # archiving commands below assume that GNU ld is being used.
7058       if test "$with_gnu_ld" = yes; then
7059         _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7060         _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'
7061
7062         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7063         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7064
7065         # If archive_cmds runs LD, not CC, wlarc should be empty
7066         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
7067         #     investigate it a little bit more. (MM)
7068         wlarc='${wl}'
7069
7070         # ancient GNU ld didn't support --whole-archive et. al.
7071         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
7072           $GREP 'no-whole-archive' > /dev/null; then
7073           _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7074         else
7075           _LT_TAGVAR(whole_archive_flag_spec, $1)=
7076         fi
7077       else
7078         with_gnu_ld=no
7079         wlarc=
7080
7081         # A generic and very simple default shared library creation
7082         # command for GNU C++ for the case where it uses the native
7083         # linker, instead of GNU ld.  If possible, this setting should
7084         # overridden to take advantage of the native linker features on
7085         # the platform it is being used on.
7086         _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7087       fi
7088
7089       # Commands to make compiler produce verbose output that lists
7090       # what "hidden" libraries, object files and flags are used when
7091       # linking a shared library.
7092       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7093
7094     else
7095       GXX=no
7096       with_gnu_ld=no
7097       wlarc=
7098     fi
7099
7100     # PORTME: fill in a description of your system's C++ link characteristics
7101     AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7102     _LT_TAGVAR(ld_shlibs, $1)=yes
7103     case $host_os in
7104       aix3*)
7105         # FIXME: insert proper C++ library support
7106         _LT_TAGVAR(ld_shlibs, $1)=no
7107         ;;
7108       aix[[4-9]]*)
7109         if test "$host_cpu" = ia64; then
7110           # On IA64, the linker does run time linking by default, so we don't
7111           # have to do anything special.
7112           aix_use_runtimelinking=no
7113           exp_sym_flag='-Bexport'
7114           no_entry_flag=""
7115         else
7116           aix_use_runtimelinking=no
7117
7118           # Test if we are trying to use run time linking or normal
7119           # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7120           # need to do runtime linking.
7121           case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7122             for ld_flag in $LDFLAGS; do
7123               case $ld_flag in
7124               *-brtl*)
7125                 aix_use_runtimelinking=yes
7126                 break
7127                 ;;
7128               esac
7129             done
7130             ;;
7131           esac
7132
7133           exp_sym_flag='-bexport'
7134           no_entry_flag='-bnoentry'
7135         fi
7136
7137         # When large executables or shared objects are built, AIX ld can
7138         # have problems creating the table of contents.  If linking a library
7139         # or program results in "error TOC overflow" add -mminimal-toc to
7140         # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7141         # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7142
7143         _LT_TAGVAR(archive_cmds, $1)=''
7144         _LT_TAGVAR(hardcode_direct, $1)=yes
7145         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7146         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7147         _LT_TAGVAR(link_all_deplibs, $1)=yes
7148         _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7149
7150         if test "$GXX" = yes; then
7151           case $host_os in aix4.[[012]]|aix4.[[012]].*)
7152           # We only want to do this on AIX 4.2 and lower, the check
7153           # below for broken collect2 doesn't work under 4.3+
7154           collect2name=`${CC} -print-prog-name=collect2`
7155           if test -f "$collect2name" &&
7156              strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7157           then
7158             # We have reworked collect2
7159             :
7160           else
7161             # We have old collect2
7162             _LT_TAGVAR(hardcode_direct, $1)=unsupported
7163             # It fails to find uninstalled libraries when the uninstalled
7164             # path is not listed in the libpath.  Setting hardcode_minus_L
7165             # to unsupported forces relinking
7166             _LT_TAGVAR(hardcode_minus_L, $1)=yes
7167             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7168             _LT_TAGVAR(hardcode_libdir_separator, $1)=
7169           fi
7170           esac
7171           shared_flag='-shared'
7172           if test "$aix_use_runtimelinking" = yes; then
7173             shared_flag="$shared_flag "'${wl}-G'
7174           fi
7175         else
7176           # not using gcc
7177           if test "$host_cpu" = ia64; then
7178           # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7179           # chokes on -Wl,-G. The following line is correct:
7180           shared_flag='-G'
7181           else
7182             if test "$aix_use_runtimelinking" = yes; then
7183               shared_flag='${wl}-G'
7184             else
7185               shared_flag='${wl}-bM:SRE'
7186             fi
7187           fi
7188         fi
7189
7190         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7191         # It seems that -bexpall does not export symbols beginning with
7192         # underscore (_), so it is better to generate a list of symbols to
7193         # export.
7194         _LT_TAGVAR(always_export_symbols, $1)=yes
7195         if test "$aix_use_runtimelinking" = yes; then
7196           # Warning - without using the other runtime loading flags (-brtl),
7197           # -berok will link without error, but may produce a broken library.
7198           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7199           # Determine the default libpath from the value encoded in an empty
7200           # executable.
7201           _LT_SYS_MODULE_PATH_AIX([$1])
7202           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7203
7204           _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"
7205         else
7206           if test "$host_cpu" = ia64; then
7207             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7208             _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7209             _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"
7210           else
7211             # Determine the default libpath from the value encoded in an
7212             # empty executable.
7213             _LT_SYS_MODULE_PATH_AIX([$1])
7214             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7215             # Warning - without using the other run time loading flags,
7216             # -berok will link without error, but may produce a broken library.
7217             _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7218             _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7219             if test "$with_gnu_ld" = yes; then
7220               # We only use this code for GNU lds that support --whole-archive.
7221               _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7222             else
7223               # Exported symbols can be pulled into shared objects from archives
7224               _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7225             fi
7226             _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7227             # This is similar to how AIX traditionally builds its shared
7228             # libraries.
7229             _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'
7230           fi
7231         fi
7232         ;;
7233
7234       beos*)
7235         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7236           _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7237           # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7238           # support --undefined.  This deserves some investigation.  FIXME
7239           _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7240         else
7241           _LT_TAGVAR(ld_shlibs, $1)=no
7242         fi
7243         ;;
7244
7245       chorus*)
7246         case $cc_basename in
7247           *)
7248           # FIXME: insert proper C++ library support
7249           _LT_TAGVAR(ld_shlibs, $1)=no
7250           ;;
7251         esac
7252         ;;
7253
7254       cygwin* | mingw* | pw32* | cegcc*)
7255         case $GXX,$cc_basename in
7256         ,cl* | no,cl*)
7257           # Native MSVC
7258           # hardcode_libdir_flag_spec is actually meaningless, as there is
7259           # no search path for DLLs.
7260           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7261           _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7262           _LT_TAGVAR(always_export_symbols, $1)=yes
7263           _LT_TAGVAR(file_list_spec, $1)='@'
7264           # Tell ltmain to make .lib files, not .a files.
7265           libext=lib
7266           # Tell ltmain to make .dll files, not .so files.
7267           shrext_cmds=".dll"
7268           # FIXME: Setting linknames here is a bad hack.
7269           _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7270           _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7271               $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7272             else
7273               $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7274             fi~
7275             $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7276             linknames='
7277           # The linker will not automatically build a static lib if we build a DLL.
7278           # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7279           _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7280           # Don't use ranlib
7281           _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7282           _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7283             lt_tool_outputfile="@TOOL_OUTPUT@"~
7284             case $lt_outputfile in
7285               *.exe|*.EXE) ;;
7286               *)
7287                 lt_outputfile="$lt_outputfile.exe"
7288                 lt_tool_outputfile="$lt_tool_outputfile.exe"
7289                 ;;
7290             esac~
7291             func_to_tool_file "$lt_outputfile"~
7292             if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7293               $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7294               $RM "$lt_outputfile.manifest";
7295             fi'
7296           ;;
7297         *)
7298           # g++
7299           # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7300           # as there is no search path for DLLs.
7301           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7302           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7303           _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7304           _LT_TAGVAR(always_export_symbols, $1)=no
7305           _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7306
7307           if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7308             _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'
7309             # If the export-symbols file already is a .def file (1st line
7310             # is EXPORTS), use it as is; otherwise, prepend...
7311             _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7312               cp $export_symbols $output_objdir/$soname.def;
7313             else
7314               echo EXPORTS > $output_objdir/$soname.def;
7315               cat $export_symbols >> $output_objdir/$soname.def;
7316             fi~
7317             $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'
7318           else
7319             _LT_TAGVAR(ld_shlibs, $1)=no
7320           fi
7321           ;;
7322         esac
7323         ;;
7324       darwin* | rhapsody*)
7325         _LT_DARWIN_LINKER_FEATURES($1)
7326         ;;
7327
7328       dgux*)
7329         case $cc_basename in
7330           ec++*)
7331             # FIXME: insert proper C++ library support
7332             _LT_TAGVAR(ld_shlibs, $1)=no
7333             ;;
7334           ghcx*)
7335             # Green Hills C++ Compiler
7336             # FIXME: insert proper C++ library support
7337             _LT_TAGVAR(ld_shlibs, $1)=no
7338             ;;
7339           *)
7340             # FIXME: insert proper C++ library support
7341             _LT_TAGVAR(ld_shlibs, $1)=no
7342             ;;
7343         esac
7344         ;;
7345
7346       freebsd2.*)
7347         # C++ shared libraries reported to be fairly broken before
7348         # switch to ELF
7349         _LT_TAGVAR(ld_shlibs, $1)=no
7350         ;;
7351
7352       freebsd-elf*)
7353         _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7354         ;;
7355
7356       freebsd* | dragonfly*)
7357         # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7358         # conventions
7359         _LT_TAGVAR(ld_shlibs, $1)=yes
7360         ;;
7361
7362       gnu*)
7363         ;;
7364
7365       haiku*)
7366         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7367         _LT_TAGVAR(link_all_deplibs, $1)=yes
7368         ;;
7369
7370       hpux9*)
7371         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7372         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7373         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7374         _LT_TAGVAR(hardcode_direct, $1)=yes
7375         _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7376                                              # but as the default
7377                                              # location of the library.
7378
7379         case $cc_basename in
7380           CC*)
7381             # FIXME: insert proper C++ library support
7382             _LT_TAGVAR(ld_shlibs, $1)=no
7383             ;;
7384           aCC*)
7385             _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'
7386             # Commands to make compiler produce verbose output that lists
7387             # what "hidden" libraries, object files and flags are used when
7388             # linking a shared library.
7389             #
7390             # There doesn't appear to be a way to prevent this compiler from
7391             # explicitly linking system object files so we need to strip them
7392             # from the output so that they don't get included in the library
7393             # dependencies.
7394             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"'
7395             ;;
7396           *)
7397             if test "$GXX" = yes; then
7398               _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'
7399             else
7400               # FIXME: insert proper C++ library support
7401               _LT_TAGVAR(ld_shlibs, $1)=no
7402             fi
7403             ;;
7404         esac
7405         ;;
7406
7407       hpux10*|hpux11*)
7408         if test $with_gnu_ld = no; then
7409           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7410           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7411
7412           case $host_cpu in
7413             hppa*64*|ia64*)
7414               ;;
7415             *)
7416               _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7417               ;;
7418           esac
7419         fi
7420         case $host_cpu in
7421           hppa*64*|ia64*)
7422             _LT_TAGVAR(hardcode_direct, $1)=no
7423             _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7424             ;;
7425           *)
7426             _LT_TAGVAR(hardcode_direct, $1)=yes
7427             _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7428             _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7429                                                  # but as the default
7430                                                  # location of the library.
7431             ;;
7432         esac
7433
7434         case $cc_basename in
7435           CC*)
7436             # FIXME: insert proper C++ library support
7437             _LT_TAGVAR(ld_shlibs, $1)=no
7438             ;;
7439           aCC*)
7440             case $host_cpu in
7441               hppa*64*)
7442                 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7443                 ;;
7444               ia64*)
7445                 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7446                 ;;
7447               *)
7448                 _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'
7449                 ;;
7450             esac
7451             # Commands to make compiler produce verbose output that lists
7452             # what "hidden" libraries, object files and flags are used when
7453             # linking a shared library.
7454             #
7455             # There doesn't appear to be a way to prevent this compiler from
7456             # explicitly linking system object files so we need to strip them
7457             # from the output so that they don't get included in the library
7458             # dependencies.
7459             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"'
7460             ;;
7461           *)
7462             if test "$GXX" = yes; then
7463               if test $with_gnu_ld = no; then
7464                 case $host_cpu in
7465                   hppa*64*)
7466                     _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7467                     ;;
7468                   ia64*)
7469                     _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'
7470                     ;;
7471                   *)
7472                     _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'
7473                     ;;
7474                 esac
7475               fi
7476             else
7477               # FIXME: insert proper C++ library support
7478               _LT_TAGVAR(ld_shlibs, $1)=no
7479             fi
7480             ;;
7481         esac
7482         ;;
7483
7484       interix[[3-9]]*)
7485         _LT_TAGVAR(hardcode_direct, $1)=no
7486         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7487         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7488         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7489         # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7490         # Instead, shared libraries are loaded at an image base (0x10000000 by
7491         # default) and relocated if they conflict, which is a slow very memory
7492         # consuming and fragmenting process.  To avoid this, we pick a random,
7493         # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7494         # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7495         _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'
7496         _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'
7497         ;;
7498       irix5* | irix6*)
7499         case $cc_basename in
7500           CC*)
7501             # SGI C++
7502             _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'
7503
7504             # Archives containing C++ object files must be created using
7505             # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7506             # necessary to make sure instantiated templates are included
7507             # in the archive.
7508             _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7509             ;;
7510           *)
7511             if test "$GXX" = yes; then
7512               if test "$with_gnu_ld" = no; then
7513                 _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'
7514               else
7515                 _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'
7516               fi
7517             fi
7518             _LT_TAGVAR(link_all_deplibs, $1)=yes
7519             ;;
7520         esac
7521         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7522         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7523         _LT_TAGVAR(inherit_rpath, $1)=yes
7524         ;;
7525
7526       linux* | k*bsd*-gnu | kopensolaris*-gnu)
7527         case $cc_basename in
7528           KCC*)
7529             # Kuck and Associates, Inc. (KAI) C++ Compiler
7530
7531             # KCC will only create a shared library if the output file
7532             # ends with ".so" (or ".sl" for HP-UX), so rename the library
7533             # to its proper name (with version) after linking.
7534             _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'
7535             _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'
7536             # Commands to make compiler produce verbose output that lists
7537             # what "hidden" libraries, object files and flags are used when
7538             # linking a shared library.
7539             #
7540             # There doesn't appear to be a way to prevent this compiler from
7541             # explicitly linking system object files so we need to strip them
7542             # from the output so that they don't get included in the library
7543             # dependencies.
7544             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"'
7545
7546             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7547             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7548
7549             # Archives containing C++ object files must be created using
7550             # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7551             _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7552             ;;
7553           icpc* | ecpc* )
7554             # Intel C++
7555             with_gnu_ld=yes
7556             # version 8.0 and above of icpc choke on multiply defined symbols
7557             # if we add $predep_objects and $postdep_objects, however 7.1 and
7558             # earlier do not add the objects themselves.
7559             case `$CC -V 2>&1` in
7560               *"Version 7."*)
7561                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7562                 _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'
7563                 ;;
7564               *)  # Version 8.0 or newer
7565                 tmp_idyn=
7566                 case $host_cpu in
7567                   ia64*) tmp_idyn=' -i_dynamic';;
7568                 esac
7569                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7570                 _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'
7571                 ;;
7572             esac
7573             _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7574             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7575             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7576             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7577             ;;
7578           pgCC* | pgcpp*)
7579             # Portland Group C++ compiler
7580             case `$CC -V` in
7581             *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7582               _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7583                 rm -rf $tpldir~
7584                 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7585                 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7586               _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7587                 rm -rf $tpldir~
7588                 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7589                 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7590                 $RANLIB $oldlib'
7591               _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7592                 rm -rf $tpldir~
7593                 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7594                 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7595               _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7596                 rm -rf $tpldir~
7597                 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7598                 $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'
7599               ;;
7600             *) # Version 6 and above use weak symbols
7601               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7602               _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'
7603               ;;
7604             esac
7605
7606             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7607             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7608             _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'
7609             ;;
7610           cxx*)
7611             # Compaq C++
7612             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7613             _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'
7614
7615             runpath_var=LD_RUN_PATH
7616             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7617             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7618
7619             # Commands to make compiler produce verbose output that lists
7620             # what "hidden" libraries, object files and flags are used when
7621             # linking a shared library.
7622             #
7623             # There doesn't appear to be a way to prevent this compiler from
7624             # explicitly linking system object files so we need to strip them
7625             # from the output so that they don't get included in the library
7626             # dependencies.
7627             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'
7628             ;;
7629           xl* | mpixl* | bgxl*)
7630             # IBM XL 8.0 on PPC, with GNU ld
7631             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7632             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7633             _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7634             if test "x$supports_anon_versioning" = xyes; then
7635               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7636                 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7637                 echo "local: *; };" >> $output_objdir/$libname.ver~
7638                 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7639             fi
7640             ;;
7641           *)
7642             case `$CC -V 2>&1 | sed 5q` in
7643             *Sun\ C*)
7644               # Sun C++ 5.9
7645               _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7646               _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7647               _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'
7648               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7649               _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'
7650               _LT_TAGVAR(compiler_needs_object, $1)=yes
7651
7652               # Not sure whether something based on
7653               # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7654               # would be better.
7655               output_verbose_link_cmd='func_echo_all'
7656
7657               # Archives containing C++ object files must be created using
7658               # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7659               # necessary to make sure instantiated templates are included
7660               # in the archive.
7661               _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7662               ;;
7663             esac
7664             ;;
7665         esac
7666         ;;
7667
7668       lynxos*)
7669         # FIXME: insert proper C++ library support
7670         _LT_TAGVAR(ld_shlibs, $1)=no
7671         ;;
7672
7673       m88k*)
7674         # FIXME: insert proper C++ library support
7675         _LT_TAGVAR(ld_shlibs, $1)=no
7676         ;;
7677
7678       mvs*)
7679         case $cc_basename in
7680           cxx*)
7681             # FIXME: insert proper C++ library support
7682             _LT_TAGVAR(ld_shlibs, $1)=no
7683             ;;
7684           *)
7685             # FIXME: insert proper C++ library support
7686             _LT_TAGVAR(ld_shlibs, $1)=no
7687             ;;
7688         esac
7689         ;;
7690
7691       netbsd*)
7692         if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7693           _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7694           wlarc=
7695           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7696           _LT_TAGVAR(hardcode_direct, $1)=yes
7697           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7698         fi
7699         # Workaround some broken pre-1.5 toolchains
7700         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7701         ;;
7702
7703       *nto* | *qnx*)
7704         _LT_TAGVAR(ld_shlibs, $1)=yes
7705         ;;
7706
7707       openbsd2*)
7708         # C++ shared libraries are fairly broken
7709         _LT_TAGVAR(ld_shlibs, $1)=no
7710         ;;
7711
7712       openbsd*)
7713         if test -f /usr/libexec/ld.so; then
7714           _LT_TAGVAR(hardcode_direct, $1)=yes
7715           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7716           _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7717           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7718           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7719           if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7720             _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'
7721             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7722             _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7723           fi
7724           output_verbose_link_cmd=func_echo_all
7725         else
7726           _LT_TAGVAR(ld_shlibs, $1)=no
7727         fi
7728         ;;
7729
7730       osf3* | osf4* | osf5*)
7731         case $cc_basename in
7732           KCC*)
7733             # Kuck and Associates, Inc. (KAI) C++ Compiler
7734
7735             # KCC will only create a shared library if the output file
7736             # ends with ".so" (or ".sl" for HP-UX), so rename the library
7737             # to its proper name (with version) after linking.
7738             _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'
7739
7740             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7741             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7742
7743             # Archives containing C++ object files must be created using
7744             # the KAI C++ compiler.
7745             case $host in
7746               osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7747               *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7748             esac
7749             ;;
7750           RCC*)
7751             # Rational C++ 2.4.1
7752             # FIXME: insert proper C++ library support
7753             _LT_TAGVAR(ld_shlibs, $1)=no
7754             ;;
7755           cxx*)
7756             case $host in
7757               osf3*)
7758                 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7759                 _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'
7760                 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7761                 ;;
7762               *)
7763                 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7764                 _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'
7765                 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7766                   echo "-hidden">> $lib.exp~
7767                   $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~
7768                   $RM $lib.exp'
7769                 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7770                 ;;
7771             esac
7772
7773             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7774
7775             # Commands to make compiler produce verbose output that lists
7776             # what "hidden" libraries, object files and flags are used when
7777             # linking a shared library.
7778             #
7779             # There doesn't appear to be a way to prevent this compiler from
7780             # explicitly linking system object files so we need to strip them
7781             # from the output so that they don't get included in the library
7782             # dependencies.
7783             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"'
7784             ;;
7785           *)
7786             if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7787               _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7788               case $host in
7789                 osf3*)
7790                   _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'
7791                   ;;
7792                 *)
7793                   _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'
7794                   ;;
7795               esac
7796
7797               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7798               _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7799
7800               # Commands to make compiler produce verbose output that lists
7801               # what "hidden" libraries, object files and flags are used when
7802               # linking a shared library.
7803               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7804
7805             else
7806               # FIXME: insert proper C++ library support
7807               _LT_TAGVAR(ld_shlibs, $1)=no
7808             fi
7809             ;;
7810         esac
7811         ;;
7812
7813       psos*)
7814         # FIXME: insert proper C++ library support
7815         _LT_TAGVAR(ld_shlibs, $1)=no
7816         ;;
7817
7818       sunos4*)
7819         case $cc_basename in
7820           CC*)
7821             # Sun C++ 4.x
7822             # FIXME: insert proper C++ library support
7823             _LT_TAGVAR(ld_shlibs, $1)=no
7824             ;;
7825           lcc*)
7826             # Lucid
7827             # FIXME: insert proper C++ library support
7828             _LT_TAGVAR(ld_shlibs, $1)=no
7829             ;;
7830           *)
7831             # FIXME: insert proper C++ library support
7832             _LT_TAGVAR(ld_shlibs, $1)=no
7833             ;;
7834         esac
7835         ;;
7836
7837       solaris*)
7838         case $cc_basename in
7839           CC* | sunCC*)
7840             # Sun C++ 4.2, 5.x and Centerline C++
7841             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7842             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7843             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7844             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7845               $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'
7846
7847             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7848             _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7849             case $host_os in
7850               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7851               *)
7852                 # The compiler driver will combine and reorder linker options,
7853                 # but understands `-z linker_flag'.
7854                 # Supported since Solaris 2.6 (maybe 2.5.1?)
7855                 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7856                 ;;
7857             esac
7858             _LT_TAGVAR(link_all_deplibs, $1)=yes
7859
7860             output_verbose_link_cmd='func_echo_all'
7861
7862             # Archives containing C++ object files must be created using
7863             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7864             # necessary to make sure instantiated templates are included
7865             # in the archive.
7866             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7867             ;;
7868           gcx*)
7869             # Green Hills C++ Compiler
7870             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7871
7872             # The C++ compiler must be used to create the archive.
7873             _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7874             ;;
7875           *)
7876             # GNU C++ compiler with Solaris linker
7877             if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7878               _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7879               if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7880                 _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'
7881                 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7882                   $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7883
7884                 # Commands to make compiler produce verbose output that lists
7885                 # what "hidden" libraries, object files and flags are used when
7886                 # linking a shared library.
7887                 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7888               else
7889                 # g++ 2.7 appears to require `-G' NOT `-shared' on this
7890                 # platform.
7891                 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7892                 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7893                   $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7894
7895                 # Commands to make compiler produce verbose output that lists
7896                 # what "hidden" libraries, object files and flags are used when
7897                 # linking a shared library.
7898                 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7899               fi
7900
7901               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7902               case $host_os in
7903                 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7904                 *)
7905                   _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7906                   ;;
7907               esac
7908             fi
7909             ;;
7910         esac
7911         ;;
7912
7913     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7914       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7915       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7916       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7917       runpath_var='LD_RUN_PATH'
7918
7919       case $cc_basename in
7920         CC*)
7921           _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7922           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7923           ;;
7924         *)
7925           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7926           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7927           ;;
7928       esac
7929       ;;
7930
7931       sysv5* | sco3.2v5* | sco5v6*)
7932         # Note: We can NOT use -z defs as we might desire, because we do not
7933         # link with -lc, and that would cause any symbols used from libc to
7934         # always be unresolved, which means just about no library would
7935         # ever link correctly.  If we're not using GNU ld we use -z text
7936         # though, which does catch some bad symbols but isn't as heavy-handed
7937         # as -z defs.
7938         _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7939         _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7940         _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7941         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7942         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7943         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7944         _LT_TAGVAR(link_all_deplibs, $1)=yes
7945         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7946         runpath_var='LD_RUN_PATH'
7947
7948         case $cc_basename in
7949           CC*)
7950             _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7951             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7952             _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7953               '"$_LT_TAGVAR(old_archive_cmds, $1)"
7954             _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7955               '"$_LT_TAGVAR(reload_cmds, $1)"
7956             ;;
7957           *)
7958             _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7959             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7960             ;;
7961         esac
7962       ;;
7963
7964       tandem*)
7965         case $cc_basename in
7966           NCC*)
7967             # NonStop-UX NCC 3.20
7968             # FIXME: insert proper C++ library support
7969             _LT_TAGVAR(ld_shlibs, $1)=no
7970             ;;
7971           *)
7972             # FIXME: insert proper C++ library support
7973             _LT_TAGVAR(ld_shlibs, $1)=no
7974             ;;
7975         esac
7976         ;;
7977
7978       vxworks*)
7979         # FIXME: insert proper C++ library support
7980         _LT_TAGVAR(ld_shlibs, $1)=no
7981         ;;
7982
7983       *)
7984         # FIXME: insert proper C++ library support
7985         _LT_TAGVAR(ld_shlibs, $1)=no
7986         ;;
7987     esac
7988
7989     AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7990     test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7991
7992     _LT_TAGVAR(GCC, $1)="$GXX"
7993     _LT_TAGVAR(LD, $1)="$LD"
7994
7995     ## CAVEAT EMPTOR:
7996     ## There is no encapsulation within the following macros, do not change
7997     ## the running order or otherwise move them around unless you know exactly
7998     ## what you are doing...
7999     _LT_SYS_HIDDEN_LIBDEPS($1)
8000     _LT_COMPILER_PIC($1)
8001     _LT_COMPILER_C_O($1)
8002     _LT_COMPILER_FILE_LOCKS($1)
8003     _LT_LINKER_SHLIBS($1)
8004     _LT_SYS_DYNAMIC_LINKER($1)
8005     _LT_LINKER_HARDCODE_LIBPATH($1)
8006
8007     _LT_CONFIG($1)
8008   fi # test -n "$compiler"
8009
8010   CC=$lt_save_CC
8011   CFLAGS=$lt_save_CFLAGS
8012   LDCXX=$LD
8013   LD=$lt_save_LD
8014   GCC=$lt_save_GCC
8015   with_gnu_ld=$lt_save_with_gnu_ld
8016   lt_cv_path_LDCXX=$lt_cv_path_LD
8017   lt_cv_path_LD=$lt_save_path_LD
8018   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
8019   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
8020 fi # test "$_lt_caught_CXX_error" != yes
8021
8022 AC_LANG_POP
8023 ])# _LT_LANG_CXX_CONFIG
8024
8025
8026 # _LT_FUNC_STRIPNAME_CNF
8027 # ----------------------
8028 # func_stripname_cnf prefix suffix name
8029 # strip PREFIX and SUFFIX off of NAME.
8030 # PREFIX and SUFFIX must not contain globbing or regex special
8031 # characters, hashes, percent signs, but SUFFIX may contain a leading
8032 # dot (in which case that matches only a dot).
8033 #
8034 # This function is identical to the (non-XSI) version of func_stripname,
8035 # except this one can be used by m4 code that may be executed by configure,
8036 # rather than the libtool script.
8037 m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
8038 AC_REQUIRE([_LT_DECL_SED])
8039 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
8040 func_stripname_cnf ()
8041 {
8042   case ${2} in
8043   .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
8044   *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
8045   esac
8046 } # func_stripname_cnf
8047 ])# _LT_FUNC_STRIPNAME_CNF
8048
8049 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
8050 # ---------------------------------
8051 # Figure out "hidden" library dependencies from verbose
8052 # compiler output when linking a shared library.
8053 # Parse the compiler output and extract the necessary
8054 # objects, libraries and library flags.
8055 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
8056 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
8057 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
8058 # Dependencies to place before and after the object being linked:
8059 _LT_TAGVAR(predep_objects, $1)=
8060 _LT_TAGVAR(postdep_objects, $1)=
8061 _LT_TAGVAR(predeps, $1)=
8062 _LT_TAGVAR(postdeps, $1)=
8063 _LT_TAGVAR(compiler_lib_search_path, $1)=
8064
8065 dnl we can't use the lt_simple_compile_test_code here,
8066 dnl because it contains code intended for an executable,
8067 dnl not a library.  It's possible we should let each
8068 dnl tag define a new lt_????_link_test_code variable,
8069 dnl but it's only used here...
8070 m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
8071 int a;
8072 void foo (void) { a = 0; }
8073 _LT_EOF
8074 ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
8075 class Foo
8076 {
8077 public:
8078   Foo (void) { a = 0; }
8079 private:
8080   int a;
8081 };
8082 _LT_EOF
8083 ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
8084       subroutine foo
8085       implicit none
8086       integer*4 a
8087       a=0
8088       return
8089       end
8090 _LT_EOF
8091 ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
8092       subroutine foo
8093       implicit none
8094       integer a
8095       a=0
8096       return
8097       end
8098 _LT_EOF
8099 ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
8100 public class foo {
8101   private int a;
8102   public void bar (void) {
8103     a = 0;
8104   }
8105 };
8106 _LT_EOF
8107 ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
8108 package foo
8109 func foo() {
8110 }
8111 _LT_EOF
8112 ])
8113
8114 _lt_libdeps_save_CFLAGS=$CFLAGS
8115 case "$CC $CFLAGS " in #(
8116 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8117 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8118 *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
8119 esac
8120
8121 dnl Parse the compiler output and extract the necessary
8122 dnl objects, libraries and library flags.
8123 if AC_TRY_EVAL(ac_compile); then
8124   # Parse the compiler output and extract the necessary
8125   # objects, libraries and library flags.
8126
8127   # Sentinel used to keep track of whether or not we are before
8128   # the conftest object file.
8129   pre_test_object_deps_done=no
8130
8131   for p in `eval "$output_verbose_link_cmd"`; do
8132     case ${prev}${p} in
8133
8134     -L* | -R* | -l*)
8135        # Some compilers place space between "-{L,R}" and the path.
8136        # Remove the space.
8137        if test $p = "-L" ||
8138           test $p = "-R"; then
8139          prev=$p
8140          continue
8141        fi
8142
8143        # Expand the sysroot to ease extracting the directories later.
8144        if test -z "$prev"; then
8145          case $p in
8146          -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8147          -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8148          -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8149          esac
8150        fi
8151        case $p in
8152        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8153        esac
8154        if test "$pre_test_object_deps_done" = no; then
8155          case ${prev} in
8156          -L | -R)
8157            # Internal compiler library paths should come after those
8158            # provided the user.  The postdeps already come after the
8159            # user supplied libs so there is no need to process them.
8160            if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8161              _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8162            else
8163              _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8164            fi
8165            ;;
8166          # The "-l" case would never come before the object being
8167          # linked, so don't bother handling this case.
8168          esac
8169        else
8170          if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8171            _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8172          else
8173            _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8174          fi
8175        fi
8176        prev=
8177        ;;
8178
8179     *.lto.$objext) ;; # Ignore GCC LTO objects
8180     *.$objext)
8181        # This assumes that the test object file only shows up
8182        # once in the compiler output.
8183        if test "$p" = "conftest.$objext"; then
8184          pre_test_object_deps_done=yes
8185          continue
8186        fi
8187
8188        if test "$pre_test_object_deps_done" = no; then
8189          if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8190            _LT_TAGVAR(predep_objects, $1)="$p"
8191          else
8192            _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8193          fi
8194        else
8195          if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8196            _LT_TAGVAR(postdep_objects, $1)="$p"
8197          else
8198            _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8199          fi
8200        fi
8201        ;;
8202
8203     *) ;; # Ignore the rest.
8204
8205     esac
8206   done
8207
8208   # Clean up.
8209   rm -f a.out a.exe
8210 else
8211   echo "libtool.m4: error: problem compiling $1 test program"
8212 fi
8213
8214 $RM -f confest.$objext
8215 CFLAGS=$_lt_libdeps_save_CFLAGS
8216
8217 # PORTME: override above test on systems where it is broken
8218 m4_if([$1], [CXX],
8219 [case $host_os in
8220 interix[[3-9]]*)
8221   # Interix 3.5 installs completely hosed .la files for C++, so rather than
8222   # hack all around it, let's just trust "g++" to DTRT.
8223   _LT_TAGVAR(predep_objects,$1)=
8224   _LT_TAGVAR(postdep_objects,$1)=
8225   _LT_TAGVAR(postdeps,$1)=
8226   ;;
8227
8228 linux*)
8229   case `$CC -V 2>&1 | sed 5q` in
8230   *Sun\ C*)
8231     # Sun C++ 5.9
8232
8233     # The more standards-conforming stlport4 library is
8234     # incompatible with the Cstd library. Avoid specifying
8235     # it if it's in CXXFLAGS. Ignore libCrun as
8236     # -library=stlport4 depends on it.
8237     case " $CXX $CXXFLAGS " in
8238     *" -library=stlport4 "*)
8239       solaris_use_stlport4=yes
8240       ;;
8241     esac
8242
8243     if test "$solaris_use_stlport4" != yes; then
8244       _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8245     fi
8246     ;;
8247   esac
8248   ;;
8249
8250 solaris*)
8251   case $cc_basename in
8252   CC* | sunCC*)
8253     # The more standards-conforming stlport4 library is
8254     # incompatible with the Cstd library. Avoid specifying
8255     # it if it's in CXXFLAGS. Ignore libCrun as
8256     # -library=stlport4 depends on it.
8257     case " $CXX $CXXFLAGS " in
8258     *" -library=stlport4 "*)
8259       solaris_use_stlport4=yes
8260       ;;
8261     esac
8262
8263     # Adding this requires a known-good setup of shared libraries for
8264     # Sun compiler versions before 5.6, else PIC objects from an old
8265     # archive will be linked into the output, leading to subtle bugs.
8266     if test "$solaris_use_stlport4" != yes; then
8267       _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8268     fi
8269     ;;
8270   esac
8271   ;;
8272 esac
8273 ])
8274
8275 case " $_LT_TAGVAR(postdeps, $1) " in
8276 *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8277 esac
8278  _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8279 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8280  _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8281 fi
8282 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8283     [The directories searched by this compiler when creating a shared library])
8284 _LT_TAGDECL([], [predep_objects], [1],
8285     [Dependencies to place before and after the objects being linked to
8286     create a shared library])
8287 _LT_TAGDECL([], [postdep_objects], [1])
8288 _LT_TAGDECL([], [predeps], [1])
8289 _LT_TAGDECL([], [postdeps], [1])
8290 _LT_TAGDECL([], [compiler_lib_search_path], [1],
8291     [The library search path used internally by the compiler when linking
8292     a shared library])
8293 ])# _LT_SYS_HIDDEN_LIBDEPS
8294
8295
8296 # _LT_LANG_F77_CONFIG([TAG])
8297 # --------------------------
8298 # Ensure that the configuration variables for a Fortran 77 compiler are
8299 # suitably defined.  These variables are subsequently used by _LT_CONFIG
8300 # to write the compiler configuration to `libtool'.
8301 m4_defun([_LT_LANG_F77_CONFIG],
8302 [AC_LANG_PUSH(Fortran 77)
8303 if test -z "$F77" || test "X$F77" = "Xno"; then
8304   _lt_disable_F77=yes
8305 fi
8306
8307 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8308 _LT_TAGVAR(allow_undefined_flag, $1)=
8309 _LT_TAGVAR(always_export_symbols, $1)=no
8310 _LT_TAGVAR(archive_expsym_cmds, $1)=
8311 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8312 _LT_TAGVAR(hardcode_direct, $1)=no
8313 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8314 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8315 _LT_TAGVAR(hardcode_libdir_separator, $1)=
8316 _LT_TAGVAR(hardcode_minus_L, $1)=no
8317 _LT_TAGVAR(hardcode_automatic, $1)=no
8318 _LT_TAGVAR(inherit_rpath, $1)=no
8319 _LT_TAGVAR(module_cmds, $1)=
8320 _LT_TAGVAR(module_expsym_cmds, $1)=
8321 _LT_TAGVAR(link_all_deplibs, $1)=unknown
8322 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8323 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8324 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8325 _LT_TAGVAR(no_undefined_flag, $1)=
8326 _LT_TAGVAR(whole_archive_flag_spec, $1)=
8327 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8328
8329 # Source file extension for f77 test sources.
8330 ac_ext=f
8331
8332 # Object file extension for compiled f77 test sources.
8333 objext=o
8334 _LT_TAGVAR(objext, $1)=$objext
8335
8336 # No sense in running all these tests if we already determined that
8337 # the F77 compiler isn't working.  Some variables (like enable_shared)
8338 # are currently assumed to apply to all compilers on this platform,
8339 # and will be corrupted by setting them based on a non-working compiler.
8340 if test "$_lt_disable_F77" != yes; then
8341   # Code to be used in simple compile tests
8342   lt_simple_compile_test_code="\
8343       subroutine t
8344       return
8345       end
8346 "
8347
8348   # Code to be used in simple link tests
8349   lt_simple_link_test_code="\
8350       program t
8351       end
8352 "
8353
8354   # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8355   _LT_TAG_COMPILER
8356
8357   # save warnings/boilerplate of simple test code
8358   _LT_COMPILER_BOILERPLATE
8359   _LT_LINKER_BOILERPLATE
8360
8361   # Allow CC to be a program name with arguments.
8362   lt_save_CC="$CC"
8363   lt_save_GCC=$GCC
8364   lt_save_CFLAGS=$CFLAGS
8365   CC=${F77-"f77"}
8366   CFLAGS=$FFLAGS
8367   compiler=$CC
8368   _LT_TAGVAR(compiler, $1)=$CC
8369   _LT_CC_BASENAME([$compiler])
8370   GCC=$G77
8371   if test -n "$compiler"; then
8372     AC_MSG_CHECKING([if libtool supports shared libraries])
8373     AC_MSG_RESULT([$can_build_shared])
8374
8375     AC_MSG_CHECKING([whether to build shared libraries])
8376     test "$can_build_shared" = "no" && enable_shared=no
8377
8378     # On AIX, shared libraries and static libraries use the same namespace, and
8379     # are all built from PIC.
8380     case $host_os in
8381       aix3*)
8382         test "$enable_shared" = yes && enable_static=no
8383         if test -n "$RANLIB"; then
8384           archive_cmds="$archive_cmds~\$RANLIB \$lib"
8385           postinstall_cmds='$RANLIB $lib'
8386         fi
8387         ;;
8388       aix[[4-9]]*)
8389         if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8390           test "$enable_shared" = yes && enable_static=no
8391         fi
8392         ;;
8393     esac
8394     AC_MSG_RESULT([$enable_shared])
8395
8396     AC_MSG_CHECKING([whether to build static libraries])
8397     # Make sure either enable_shared or enable_static is yes.
8398     test "$enable_shared" = yes || enable_static=yes
8399     AC_MSG_RESULT([$enable_static])
8400
8401     _LT_TAGVAR(GCC, $1)="$G77"
8402     _LT_TAGVAR(LD, $1)="$LD"
8403
8404     ## CAVEAT EMPTOR:
8405     ## There is no encapsulation within the following macros, do not change
8406     ## the running order or otherwise move them around unless you know exactly
8407     ## what you are doing...
8408     _LT_COMPILER_PIC($1)
8409     _LT_COMPILER_C_O($1)
8410     _LT_COMPILER_FILE_LOCKS($1)
8411     _LT_LINKER_SHLIBS($1)
8412     _LT_SYS_DYNAMIC_LINKER($1)
8413     _LT_LINKER_HARDCODE_LIBPATH($1)
8414
8415     _LT_CONFIG($1)
8416   fi # test -n "$compiler"
8417
8418   GCC=$lt_save_GCC
8419   CC="$lt_save_CC"
8420   CFLAGS="$lt_save_CFLAGS"
8421 fi # test "$_lt_disable_F77" != yes
8422
8423 AC_LANG_POP
8424 ])# _LT_LANG_F77_CONFIG
8425
8426
8427 # _LT_LANG_FC_CONFIG([TAG])
8428 # -------------------------
8429 # Ensure that the configuration variables for a Fortran compiler are
8430 # suitably defined.  These variables are subsequently used by _LT_CONFIG
8431 # to write the compiler configuration to `libtool'.
8432 m4_defun([_LT_LANG_FC_CONFIG],
8433 [AC_LANG_PUSH(Fortran)
8434
8435 if test -z "$FC" || test "X$FC" = "Xno"; then
8436   _lt_disable_FC=yes
8437 fi
8438
8439 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8440 _LT_TAGVAR(allow_undefined_flag, $1)=
8441 _LT_TAGVAR(always_export_symbols, $1)=no
8442 _LT_TAGVAR(archive_expsym_cmds, $1)=
8443 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8444 _LT_TAGVAR(hardcode_direct, $1)=no
8445 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8446 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8447 _LT_TAGVAR(hardcode_libdir_separator, $1)=
8448 _LT_TAGVAR(hardcode_minus_L, $1)=no
8449 _LT_TAGVAR(hardcode_automatic, $1)=no
8450 _LT_TAGVAR(inherit_rpath, $1)=no
8451 _LT_TAGVAR(module_cmds, $1)=
8452 _LT_TAGVAR(module_expsym_cmds, $1)=
8453 _LT_TAGVAR(link_all_deplibs, $1)=unknown
8454 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8455 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8456 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8457 _LT_TAGVAR(no_undefined_flag, $1)=
8458 _LT_TAGVAR(whole_archive_flag_spec, $1)=
8459 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8460
8461 # Source file extension for fc test sources.
8462 ac_ext=${ac_fc_srcext-f}
8463
8464 # Object file extension for compiled fc test sources.
8465 objext=o
8466 _LT_TAGVAR(objext, $1)=$objext
8467
8468 # No sense in running all these tests if we already determined that
8469 # the FC compiler isn't working.  Some variables (like enable_shared)
8470 # are currently assumed to apply to all compilers on this platform,
8471 # and will be corrupted by setting them based on a non-working compiler.
8472 if test "$_lt_disable_FC" != yes; then
8473   # Code to be used in simple compile tests
8474   lt_simple_compile_test_code="\
8475       subroutine t
8476       return
8477       end
8478 "
8479
8480   # Code to be used in simple link tests
8481   lt_simple_link_test_code="\
8482       program t
8483       end
8484 "
8485
8486   # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8487   _LT_TAG_COMPILER
8488
8489   # save warnings/boilerplate of simple test code
8490   _LT_COMPILER_BOILERPLATE
8491   _LT_LINKER_BOILERPLATE
8492
8493   # Allow CC to be a program name with arguments.
8494   lt_save_CC="$CC"
8495   lt_save_GCC=$GCC
8496   lt_save_CFLAGS=$CFLAGS
8497   CC=${FC-"f95"}
8498   CFLAGS=$FCFLAGS
8499   compiler=$CC
8500   GCC=$ac_cv_fc_compiler_gnu
8501
8502   _LT_TAGVAR(compiler, $1)=$CC
8503   _LT_CC_BASENAME([$compiler])
8504
8505   if test -n "$compiler"; then
8506     AC_MSG_CHECKING([if libtool supports shared libraries])
8507     AC_MSG_RESULT([$can_build_shared])
8508
8509     AC_MSG_CHECKING([whether to build shared libraries])
8510     test "$can_build_shared" = "no" && enable_shared=no
8511
8512     # On AIX, shared libraries and static libraries use the same namespace, and
8513     # are all built from PIC.
8514     case $host_os in
8515       aix3*)
8516         test "$enable_shared" = yes && enable_static=no
8517         if test -n "$RANLIB"; then
8518           archive_cmds="$archive_cmds~\$RANLIB \$lib"
8519           postinstall_cmds='$RANLIB $lib'
8520         fi
8521         ;;
8522       aix[[4-9]]*)
8523         if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8524           test "$enable_shared" = yes && enable_static=no
8525         fi
8526         ;;
8527     esac
8528     AC_MSG_RESULT([$enable_shared])
8529
8530     AC_MSG_CHECKING([whether to build static libraries])
8531     # Make sure either enable_shared or enable_static is yes.
8532     test "$enable_shared" = yes || enable_static=yes
8533     AC_MSG_RESULT([$enable_static])
8534
8535     _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8536     _LT_TAGVAR(LD, $1)="$LD"
8537
8538     ## CAVEAT EMPTOR:
8539     ## There is no encapsulation within the following macros, do not change
8540     ## the running order or otherwise move them around unless you know exactly
8541     ## what you are doing...
8542     _LT_SYS_HIDDEN_LIBDEPS($1)
8543     _LT_COMPILER_PIC($1)
8544     _LT_COMPILER_C_O($1)
8545     _LT_COMPILER_FILE_LOCKS($1)
8546     _LT_LINKER_SHLIBS($1)
8547     _LT_SYS_DYNAMIC_LINKER($1)
8548     _LT_LINKER_HARDCODE_LIBPATH($1)
8549
8550     _LT_CONFIG($1)
8551   fi # test -n "$compiler"
8552
8553   GCC=$lt_save_GCC
8554   CC=$lt_save_CC
8555   CFLAGS=$lt_save_CFLAGS
8556 fi # test "$_lt_disable_FC" != yes
8557
8558 AC_LANG_POP
8559 ])# _LT_LANG_FC_CONFIG
8560
8561
8562 # _LT_LANG_GCJ_CONFIG([TAG])
8563 # --------------------------
8564 # Ensure that the configuration variables for the GNU Java Compiler compiler
8565 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
8566 # to write the compiler configuration to `libtool'.
8567 m4_defun([_LT_LANG_GCJ_CONFIG],
8568 [AC_REQUIRE([LT_PROG_GCJ])dnl
8569 AC_LANG_SAVE
8570
8571 # Source file extension for Java test sources.
8572 ac_ext=java
8573
8574 # Object file extension for compiled Java test sources.
8575 objext=o
8576 _LT_TAGVAR(objext, $1)=$objext
8577
8578 # Code to be used in simple compile tests
8579 lt_simple_compile_test_code="class foo {}"
8580
8581 # Code to be used in simple link tests
8582 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8583
8584 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8585 _LT_TAG_COMPILER
8586
8587 # save warnings/boilerplate of simple test code
8588 _LT_COMPILER_BOILERPLATE
8589 _LT_LINKER_BOILERPLATE
8590
8591 # Allow CC to be a program name with arguments.
8592 lt_save_CC=$CC
8593 lt_save_CFLAGS=$CFLAGS
8594 lt_save_GCC=$GCC
8595 GCC=yes
8596 CC=${GCJ-"gcj"}
8597 CFLAGS=$GCJFLAGS
8598 compiler=$CC
8599 _LT_TAGVAR(compiler, $1)=$CC
8600 _LT_TAGVAR(LD, $1)="$LD"
8601 _LT_CC_BASENAME([$compiler])
8602
8603 # GCJ did not exist at the time GCC didn't implicitly link libc in.
8604 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8605
8606 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8607 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8608 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8609
8610 if test -n "$compiler"; then
8611   _LT_COMPILER_NO_RTTI($1)
8612   _LT_COMPILER_PIC($1)
8613   _LT_COMPILER_C_O($1)
8614   _LT_COMPILER_FILE_LOCKS($1)
8615   _LT_LINKER_SHLIBS($1)
8616   _LT_LINKER_HARDCODE_LIBPATH($1)
8617
8618   _LT_CONFIG($1)
8619 fi
8620
8621 AC_LANG_RESTORE
8622
8623 GCC=$lt_save_GCC
8624 CC=$lt_save_CC
8625 CFLAGS=$lt_save_CFLAGS
8626 ])# _LT_LANG_GCJ_CONFIG
8627
8628
8629 # _LT_LANG_GO_CONFIG([TAG])
8630 # --------------------------
8631 # Ensure that the configuration variables for the GNU Go compiler
8632 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
8633 # to write the compiler configuration to `libtool'.
8634 m4_defun([_LT_LANG_GO_CONFIG],
8635 [AC_REQUIRE([LT_PROG_GO])dnl
8636 AC_LANG_SAVE
8637
8638 # Source file extension for Go test sources.
8639 ac_ext=go
8640
8641 # Object file extension for compiled Go test sources.
8642 objext=o
8643 _LT_TAGVAR(objext, $1)=$objext
8644
8645 # Code to be used in simple compile tests
8646 lt_simple_compile_test_code="package main; func main() { }"
8647
8648 # Code to be used in simple link tests
8649 lt_simple_link_test_code='package main; func main() { }'
8650
8651 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8652 _LT_TAG_COMPILER
8653
8654 # save warnings/boilerplate of simple test code
8655 _LT_COMPILER_BOILERPLATE
8656 _LT_LINKER_BOILERPLATE
8657
8658 # Allow CC to be a program name with arguments.
8659 lt_save_CC=$CC
8660 lt_save_CFLAGS=$CFLAGS
8661 lt_save_GCC=$GCC
8662 GCC=yes
8663 CC=${GOC-"gccgo"}
8664 CFLAGS=$GOFLAGS
8665 compiler=$CC
8666 _LT_TAGVAR(compiler, $1)=$CC
8667 _LT_TAGVAR(LD, $1)="$LD"
8668 _LT_CC_BASENAME([$compiler])
8669
8670 # Go did not exist at the time GCC didn't implicitly link libc in.
8671 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8672
8673 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8674 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8675 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8676
8677 if test -n "$compiler"; then
8678   _LT_COMPILER_NO_RTTI($1)
8679   _LT_COMPILER_PIC($1)
8680   _LT_COMPILER_C_O($1)
8681   _LT_COMPILER_FILE_LOCKS($1)
8682   _LT_LINKER_SHLIBS($1)
8683   _LT_LINKER_HARDCODE_LIBPATH($1)
8684
8685   _LT_CONFIG($1)
8686 fi
8687
8688 AC_LANG_RESTORE
8689
8690 GCC=$lt_save_GCC
8691 CC=$lt_save_CC
8692 CFLAGS=$lt_save_CFLAGS
8693 ])# _LT_LANG_GO_CONFIG
8694
8695
8696 # _LT_LANG_RC_CONFIG([TAG])
8697 # -------------------------
8698 # Ensure that the configuration variables for the Windows resource compiler
8699 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
8700 # to write the compiler configuration to `libtool'.
8701 m4_defun([_LT_LANG_RC_CONFIG],
8702 [AC_REQUIRE([LT_PROG_RC])dnl
8703 AC_LANG_SAVE
8704
8705 # Source file extension for RC test sources.
8706 ac_ext=rc
8707
8708 # Object file extension for compiled RC test sources.
8709 objext=o
8710 _LT_TAGVAR(objext, $1)=$objext
8711
8712 # Code to be used in simple compile tests
8713 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8714
8715 # Code to be used in simple link tests
8716 lt_simple_link_test_code="$lt_simple_compile_test_code"
8717
8718 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8719 _LT_TAG_COMPILER
8720
8721 # save warnings/boilerplate of simple test code
8722 _LT_COMPILER_BOILERPLATE
8723 _LT_LINKER_BOILERPLATE
8724
8725 # Allow CC to be a program name with arguments.
8726 lt_save_CC="$CC"
8727 lt_save_CFLAGS=$CFLAGS
8728 lt_save_GCC=$GCC
8729 GCC=
8730 CC=${RC-"windres"}
8731 CFLAGS=
8732 compiler=$CC
8733 _LT_TAGVAR(compiler, $1)=$CC
8734 _LT_CC_BASENAME([$compiler])
8735 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8736
8737 if test -n "$compiler"; then
8738   :
8739   _LT_CONFIG($1)
8740 fi
8741
8742 GCC=$lt_save_GCC
8743 AC_LANG_RESTORE
8744 CC=$lt_save_CC
8745 CFLAGS=$lt_save_CFLAGS
8746 ])# _LT_LANG_RC_CONFIG
8747
8748
8749 # LT_PROG_GCJ
8750 # -----------
8751 AC_DEFUN([LT_PROG_GCJ],
8752 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8753   [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8754     [AC_CHECK_TOOL(GCJ, gcj,)
8755       test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8756       AC_SUBST(GCJFLAGS)])])[]dnl
8757 ])
8758
8759 # Old name:
8760 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8761 dnl aclocal-1.4 backwards compatibility:
8762 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8763
8764
8765 # LT_PROG_GO
8766 # ----------
8767 AC_DEFUN([LT_PROG_GO],
8768 [AC_CHECK_TOOL(GOC, gccgo,)
8769 ])
8770
8771
8772 # LT_PROG_RC
8773 # ----------
8774 AC_DEFUN([LT_PROG_RC],
8775 [AC_CHECK_TOOL(RC, windres,)
8776 ])
8777
8778 # Old name:
8779 AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8780 dnl aclocal-1.4 backwards compatibility:
8781 dnl AC_DEFUN([LT_AC_PROG_RC], [])
8782
8783
8784 # _LT_DECL_EGREP
8785 # --------------
8786 # If we don't have a new enough Autoconf to choose the best grep
8787 # available, choose the one first in the user's PATH.
8788 m4_defun([_LT_DECL_EGREP],
8789 [AC_REQUIRE([AC_PROG_EGREP])dnl
8790 AC_REQUIRE([AC_PROG_FGREP])dnl
8791 test -z "$GREP" && GREP=grep
8792 _LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8793 _LT_DECL([], [EGREP], [1], [An ERE matcher])
8794 _LT_DECL([], [FGREP], [1], [A literal string matcher])
8795 dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8796 AC_SUBST([GREP])
8797 ])
8798
8799
8800 # _LT_DECL_OBJDUMP
8801 # --------------
8802 # If we don't have a new enough Autoconf to choose the best objdump
8803 # available, choose the one first in the user's PATH.
8804 m4_defun([_LT_DECL_OBJDUMP],
8805 [AC_CHECK_TOOL(OBJDUMP, objdump, false)
8806 test -z "$OBJDUMP" && OBJDUMP=objdump
8807 _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8808 AC_SUBST([OBJDUMP])
8809 ])
8810
8811 # _LT_DECL_DLLTOOL
8812 # ----------------
8813 # Ensure DLLTOOL variable is set.
8814 m4_defun([_LT_DECL_DLLTOOL],
8815 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8816 test -z "$DLLTOOL" && DLLTOOL=dlltool
8817 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8818 AC_SUBST([DLLTOOL])
8819 ])
8820
8821 # _LT_DECL_SED
8822 # ------------
8823 # Check for a fully-functional sed program, that truncates
8824 # as few characters as possible.  Prefer GNU sed if found.
8825 m4_defun([_LT_DECL_SED],
8826 [AC_PROG_SED
8827 test -z "$SED" && SED=sed
8828 Xsed="$SED -e 1s/^X//"
8829 _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8830 _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8831     [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8832 ])# _LT_DECL_SED
8833
8834 m4_ifndef([AC_PROG_SED], [
8835 # NOTE: This macro has been submitted for inclusion into   #
8836 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8837 #  a released version of Autoconf we should remove this    #
8838 #  macro and use it instead.                               #
8839
8840 m4_defun([AC_PROG_SED],
8841 [AC_MSG_CHECKING([for a sed that does not truncate output])
8842 AC_CACHE_VAL(lt_cv_path_SED,
8843 [# Loop through the user's path and test for sed and gsed.
8844 # Then use that list of sed's as ones to test for truncation.
8845 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8846 for as_dir in $PATH
8847 do
8848   IFS=$as_save_IFS
8849   test -z "$as_dir" && as_dir=.
8850   for lt_ac_prog in sed gsed; do
8851     for ac_exec_ext in '' $ac_executable_extensions; do
8852       if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8853         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8854       fi
8855     done
8856   done
8857 done
8858 IFS=$as_save_IFS
8859 lt_ac_max=0
8860 lt_ac_count=0
8861 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
8862 # along with /bin/sed that truncates output.
8863 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8864   test ! -f $lt_ac_sed && continue
8865   cat /dev/null > conftest.in
8866   lt_ac_count=0
8867   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8868   # Check for GNU sed and select it if it is found.
8869   if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8870     lt_cv_path_SED=$lt_ac_sed
8871     break
8872   fi
8873   while true; do
8874     cat conftest.in conftest.in >conftest.tmp
8875     mv conftest.tmp conftest.in
8876     cp conftest.in conftest.nl
8877     echo >>conftest.nl
8878     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8879     cmp -s conftest.out conftest.nl || break
8880     # 10000 chars as input seems more than enough
8881     test $lt_ac_count -gt 10 && break
8882     lt_ac_count=`expr $lt_ac_count + 1`
8883     if test $lt_ac_count -gt $lt_ac_max; then
8884       lt_ac_max=$lt_ac_count
8885       lt_cv_path_SED=$lt_ac_sed
8886     fi
8887   done
8888 done
8889 ])
8890 SED=$lt_cv_path_SED
8891 AC_SUBST([SED])
8892 AC_MSG_RESULT([$SED])
8893 ])#AC_PROG_SED
8894 ])#m4_ifndef
8895
8896 # Old name:
8897 AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8898 dnl aclocal-1.4 backwards compatibility:
8899 dnl AC_DEFUN([LT_AC_PROG_SED], [])
8900
8901
8902 # _LT_CHECK_SHELL_FEATURES
8903 # ------------------------
8904 # Find out whether the shell is Bourne or XSI compatible,
8905 # or has some other useful features.
8906 m4_defun([_LT_CHECK_SHELL_FEATURES],
8907 [AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8908 # Try some XSI features
8909 xsi_shell=no
8910 ( _lt_dummy="a/b/c"
8911   test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8912       = c,a/b,b/c, \
8913     && eval 'test $(( 1 + 1 )) -eq 2 \
8914     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8915   && xsi_shell=yes
8916 AC_MSG_RESULT([$xsi_shell])
8917 _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8918
8919 AC_MSG_CHECKING([whether the shell understands "+="])
8920 lt_shell_append=no
8921 ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8922     >/dev/null 2>&1 \
8923   && lt_shell_append=yes
8924 AC_MSG_RESULT([$lt_shell_append])
8925 _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8926
8927 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8928   lt_unset=unset
8929 else
8930   lt_unset=false
8931 fi
8932 _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8933
8934 # test EBCDIC or ASCII
8935 case `echo X|tr X '\101'` in
8936  A) # ASCII based system
8937     # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8938   lt_SP2NL='tr \040 \012'
8939   lt_NL2SP='tr \015\012 \040\040'
8940   ;;
8941  *) # EBCDIC based system
8942   lt_SP2NL='tr \100 \n'
8943   lt_NL2SP='tr \r\n \100\100'
8944   ;;
8945 esac
8946 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8947 _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8948 ])# _LT_CHECK_SHELL_FEATURES
8949
8950
8951 # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8952 # ------------------------------------------------------
8953 # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8954 # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8955 m4_defun([_LT_PROG_FUNCTION_REPLACE],
8956 [dnl {
8957 sed -e '/^$1 ()$/,/^} # $1 /c\
8958 $1 ()\
8959 {\
8960 m4_bpatsubsts([$2], [$], [\\], [^\([     ]\)], [\\\1])
8961 } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8962   && mv -f "$cfgfile.tmp" "$cfgfile" \
8963     || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8964 test 0 -eq $? || _lt_function_replace_fail=:
8965 ])
8966
8967
8968 # _LT_PROG_REPLACE_SHELLFNS
8969 # -------------------------
8970 # Replace existing portable implementations of several shell functions with
8971 # equivalent extended shell implementations where those features are available..
8972 m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8973 [if test x"$xsi_shell" = xyes; then
8974   _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8975     case ${1} in
8976       */*) func_dirname_result="${1%/*}${2}" ;;
8977       *  ) func_dirname_result="${3}" ;;
8978     esac])
8979
8980   _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8981     func_basename_result="${1##*/}"])
8982
8983   _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8984     case ${1} in
8985       */*) func_dirname_result="${1%/*}${2}" ;;
8986       *  ) func_dirname_result="${3}" ;;
8987     esac
8988     func_basename_result="${1##*/}"])
8989
8990   _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8991     # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8992     # positional parameters, so assign one to ordinary parameter first.
8993     func_stripname_result=${3}
8994     func_stripname_result=${func_stripname_result#"${1}"}
8995     func_stripname_result=${func_stripname_result%"${2}"}])
8996
8997   _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8998     func_split_long_opt_name=${1%%=*}
8999     func_split_long_opt_arg=${1#*=}])
9000
9001   _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
9002     func_split_short_opt_arg=${1#??}
9003     func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
9004
9005   _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
9006     case ${1} in
9007       *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
9008       *)    func_lo2o_result=${1} ;;
9009     esac])
9010
9011   _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
9012
9013   _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
9014
9015   _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
9016 fi
9017
9018 if test x"$lt_shell_append" = xyes; then
9019   _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
9020
9021   _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
9022     func_quote_for_eval "${2}"
9023 dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
9024     eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
9025
9026   # Save a `func_append' function call where possible by direct use of '+='
9027   sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
9028     && mv -f "$cfgfile.tmp" "$cfgfile" \
9029       || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
9030   test 0 -eq $? || _lt_function_replace_fail=:
9031 else
9032   # Save a `func_append' function call even when '+=' is not available
9033   sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
9034     && mv -f "$cfgfile.tmp" "$cfgfile" \
9035       || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
9036   test 0 -eq $? || _lt_function_replace_fail=:
9037 fi
9038
9039 if test x"$_lt_function_replace_fail" = x":"; then
9040   AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
9041 fi
9042 ])
9043
9044 # _LT_PATH_CONVERSION_FUNCTIONS
9045 # -----------------------------
9046 # Determine which file name conversion functions should be used by
9047 # func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
9048 # for certain cross-compile configurations and native mingw.
9049 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
9050 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
9051 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
9052 AC_MSG_CHECKING([how to convert $build file names to $host format])
9053 AC_CACHE_VAL(lt_cv_to_host_file_cmd,
9054 [case $host in
9055   *-*-mingw* )
9056     case $build in
9057       *-*-mingw* ) # actually msys
9058         lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
9059         ;;
9060       *-*-cygwin* )
9061         lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
9062         ;;
9063       * ) # otherwise, assume *nix
9064         lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
9065         ;;
9066     esac
9067     ;;
9068   *-*-cygwin* )
9069     case $build in
9070       *-*-mingw* ) # actually msys
9071         lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
9072         ;;
9073       *-*-cygwin* )
9074         lt_cv_to_host_file_cmd=func_convert_file_noop
9075         ;;
9076       * ) # otherwise, assume *nix
9077         lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
9078         ;;
9079     esac
9080     ;;
9081   * ) # unhandled hosts (and "normal" native builds)
9082     lt_cv_to_host_file_cmd=func_convert_file_noop
9083     ;;
9084 esac
9085 ])
9086 to_host_file_cmd=$lt_cv_to_host_file_cmd
9087 AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
9088 _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
9089          [0], [convert $build file names to $host format])dnl
9090
9091 AC_MSG_CHECKING([how to convert $build file names to toolchain format])
9092 AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
9093 [#assume ordinary cross tools, or native build.
9094 lt_cv_to_tool_file_cmd=func_convert_file_noop
9095 case $host in
9096   *-*-mingw* )
9097     case $build in
9098       *-*-mingw* ) # actually msys
9099         lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
9100         ;;
9101     esac
9102     ;;
9103 esac
9104 ])
9105 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
9106 AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
9107 _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
9108          [0], [convert $build files to toolchain format])dnl
9109 ])# _LT_PATH_CONVERSION_FUNCTIONS
9110
9111 # Helper functions for option handling.                    -*- Autoconf -*-
9112 #
9113 #   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
9114 #   Inc.
9115 #   Written by Gary V. Vaughan, 2004
9116 #
9117 # This file is free software; the Free Software Foundation gives
9118 # unlimited permission to copy and/or distribute it, with or without
9119 # modifications, as long as this notice is preserved.
9120
9121 # serial 7 ltoptions.m4
9122
9123 # This is to help aclocal find these macros, as it can't see m4_define.
9124 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9125
9126
9127 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9128 # ------------------------------------------
9129 m4_define([_LT_MANGLE_OPTION],
9130 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9131
9132
9133 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9134 # ---------------------------------------
9135 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9136 # matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9137 # saved as a flag.
9138 m4_define([_LT_SET_OPTION],
9139 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9140 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9141         _LT_MANGLE_DEFUN([$1], [$2]),
9142     [m4_warning([Unknown $1 option `$2'])])[]dnl
9143 ])
9144
9145
9146 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9147 # ------------------------------------------------------------
9148 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9149 m4_define([_LT_IF_OPTION],
9150 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9151
9152
9153 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9154 # -------------------------------------------------------
9155 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9156 # are set.
9157 m4_define([_LT_UNLESS_OPTIONS],
9158 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9159             [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9160                       [m4_define([$0_found])])])[]dnl
9161 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9162 ])[]dnl
9163 ])
9164
9165
9166 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9167 # ----------------------------------------
9168 # OPTION-LIST is a space-separated list of Libtool options associated
9169 # with MACRO-NAME.  If any OPTION has a matching handler declared with
9170 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9171 # the unknown option and exit.
9172 m4_defun([_LT_SET_OPTIONS],
9173 [# Set options
9174 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9175     [_LT_SET_OPTION([$1], _LT_Option)])
9176
9177 m4_if([$1],[LT_INIT],[
9178   dnl
9179   dnl Simply set some default values (i.e off) if boolean options were not
9180   dnl specified:
9181   _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9182   ])
9183   _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9184   ])
9185   dnl
9186   dnl If no reference was made to various pairs of opposing options, then
9187   dnl we run the default mode handler for the pair.  For example, if neither
9188   dnl `shared' nor `disable-shared' was passed, we enable building of shared
9189   dnl archives by default:
9190   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9191   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9192   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9193   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9194                    [_LT_ENABLE_FAST_INSTALL])
9195   ])
9196 ])# _LT_SET_OPTIONS
9197
9198
9199
9200 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9201 # -----------------------------------------
9202 m4_define([_LT_MANGLE_DEFUN],
9203 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9204
9205
9206 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9207 # -----------------------------------------------
9208 m4_define([LT_OPTION_DEFINE],
9209 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9210 ])# LT_OPTION_DEFINE
9211
9212
9213 # dlopen
9214 # ------
9215 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9216 ])
9217
9218 AU_DEFUN([AC_LIBTOOL_DLOPEN],
9219 [_LT_SET_OPTION([LT_INIT], [dlopen])
9220 AC_DIAGNOSE([obsolete],
9221 [$0: Remove this warning and the call to _LT_SET_OPTION when you
9222 put the `dlopen' option into LT_INIT's first parameter.])
9223 ])
9224
9225 dnl aclocal-1.4 backwards compatibility:
9226 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9227
9228
9229 # win32-dll
9230 # ---------
9231 # Declare package support for building win32 dll's.
9232 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9233 [enable_win32_dll=yes
9234
9235 case $host in
9236 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9237   AC_CHECK_TOOL(AS, as, false)
9238   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9239   AC_CHECK_TOOL(OBJDUMP, objdump, false)
9240   ;;
9241 esac
9242
9243 test -z "$AS" && AS=as
9244 _LT_DECL([], [AS],      [1], [Assembler program])dnl
9245
9246 test -z "$DLLTOOL" && DLLTOOL=dlltool
9247 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9248
9249 test -z "$OBJDUMP" && OBJDUMP=objdump
9250 _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9251 ])# win32-dll
9252
9253 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9254 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
9255 _LT_SET_OPTION([LT_INIT], [win32-dll])
9256 AC_DIAGNOSE([obsolete],
9257 [$0: Remove this warning and the call to _LT_SET_OPTION when you
9258 put the `win32-dll' option into LT_INIT's first parameter.])
9259 ])
9260
9261 dnl aclocal-1.4 backwards compatibility:
9262 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9263
9264
9265 # _LT_ENABLE_SHARED([DEFAULT])
9266 # ----------------------------
9267 # implement the --enable-shared flag, and supports the `shared' and
9268 # `disable-shared' LT_INIT options.
9269 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9270 m4_define([_LT_ENABLE_SHARED],
9271 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9272 AC_ARG_ENABLE([shared],
9273     [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9274         [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9275     [p=${PACKAGE-default}
9276     case $enableval in
9277     yes) enable_shared=yes ;;
9278     no) enable_shared=no ;;
9279     *)
9280       enable_shared=no
9281       # Look at the argument we got.  We use all the common list separators.
9282       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9283       for pkg in $enableval; do
9284         IFS="$lt_save_ifs"
9285         if test "X$pkg" = "X$p"; then
9286           enable_shared=yes
9287         fi
9288       done
9289       IFS="$lt_save_ifs"
9290       ;;
9291     esac],
9292     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9293
9294     _LT_DECL([build_libtool_libs], [enable_shared], [0],
9295         [Whether or not to build shared libraries])
9296 ])# _LT_ENABLE_SHARED
9297
9298 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9299 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9300
9301 # Old names:
9302 AC_DEFUN([AC_ENABLE_SHARED],
9303 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9304 ])
9305
9306 AC_DEFUN([AC_DISABLE_SHARED],
9307 [_LT_SET_OPTION([LT_INIT], [disable-shared])
9308 ])
9309
9310 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9311 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9312
9313 dnl aclocal-1.4 backwards compatibility:
9314 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9315 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9316
9317
9318
9319 # _LT_ENABLE_STATIC([DEFAULT])
9320 # ----------------------------
9321 # implement the --enable-static flag, and support the `static' and
9322 # `disable-static' LT_INIT options.
9323 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9324 m4_define([_LT_ENABLE_STATIC],
9325 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9326 AC_ARG_ENABLE([static],
9327     [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9328         [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9329     [p=${PACKAGE-default}
9330     case $enableval in
9331     yes) enable_static=yes ;;
9332     no) enable_static=no ;;
9333     *)
9334      enable_static=no
9335       # Look at the argument we got.  We use all the common list separators.
9336       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9337       for pkg in $enableval; do
9338         IFS="$lt_save_ifs"
9339         if test "X$pkg" = "X$p"; then
9340           enable_static=yes
9341         fi
9342       done
9343       IFS="$lt_save_ifs"
9344       ;;
9345     esac],
9346     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9347
9348     _LT_DECL([build_old_libs], [enable_static], [0],
9349         [Whether or not to build static libraries])
9350 ])# _LT_ENABLE_STATIC
9351
9352 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9353 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9354
9355 # Old names:
9356 AC_DEFUN([AC_ENABLE_STATIC],
9357 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9358 ])
9359
9360 AC_DEFUN([AC_DISABLE_STATIC],
9361 [_LT_SET_OPTION([LT_INIT], [disable-static])
9362 ])
9363
9364 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9365 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9366
9367 dnl aclocal-1.4 backwards compatibility:
9368 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9369 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9370
9371
9372
9373 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
9374 # ----------------------------------
9375 # implement the --enable-fast-install flag, and support the `fast-install'
9376 # and `disable-fast-install' LT_INIT options.
9377 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9378 m4_define([_LT_ENABLE_FAST_INSTALL],
9379 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9380 AC_ARG_ENABLE([fast-install],
9381     [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9382     [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9383     [p=${PACKAGE-default}
9384     case $enableval in
9385     yes) enable_fast_install=yes ;;
9386     no) enable_fast_install=no ;;
9387     *)
9388       enable_fast_install=no
9389       # Look at the argument we got.  We use all the common list separators.
9390       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9391       for pkg in $enableval; do
9392         IFS="$lt_save_ifs"
9393         if test "X$pkg" = "X$p"; then
9394           enable_fast_install=yes
9395         fi
9396       done
9397       IFS="$lt_save_ifs"
9398       ;;
9399     esac],
9400     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9401
9402 _LT_DECL([fast_install], [enable_fast_install], [0],
9403          [Whether or not to optimize for fast installation])dnl
9404 ])# _LT_ENABLE_FAST_INSTALL
9405
9406 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9407 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9408
9409 # Old names:
9410 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9411 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9412 AC_DIAGNOSE([obsolete],
9413 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
9414 the `fast-install' option into LT_INIT's first parameter.])
9415 ])
9416
9417 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9418 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9419 AC_DIAGNOSE([obsolete],
9420 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
9421 the `disable-fast-install' option into LT_INIT's first parameter.])
9422 ])
9423
9424 dnl aclocal-1.4 backwards compatibility:
9425 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9426 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9427
9428
9429 # _LT_WITH_PIC([MODE])
9430 # --------------------
9431 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
9432 # LT_INIT options.
9433 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9434 m4_define([_LT_WITH_PIC],
9435 [AC_ARG_WITH([pic],
9436     [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9437         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9438     [lt_p=${PACKAGE-default}
9439     case $withval in
9440     yes|no) pic_mode=$withval ;;
9441     *)
9442       pic_mode=default
9443       # Look at the argument we got.  We use all the common list separators.
9444       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9445       for lt_pkg in $withval; do
9446         IFS="$lt_save_ifs"
9447         if test "X$lt_pkg" = "X$lt_p"; then
9448           pic_mode=yes
9449         fi
9450       done
9451       IFS="$lt_save_ifs"
9452       ;;
9453     esac],
9454     [pic_mode=default])
9455
9456 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9457
9458 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9459 ])# _LT_WITH_PIC
9460
9461 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9462 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9463
9464 # Old name:
9465 AU_DEFUN([AC_LIBTOOL_PICMODE],
9466 [_LT_SET_OPTION([LT_INIT], [pic-only])
9467 AC_DIAGNOSE([obsolete],
9468 [$0: Remove this warning and the call to _LT_SET_OPTION when you
9469 put the `pic-only' option into LT_INIT's first parameter.])
9470 ])
9471
9472 dnl aclocal-1.4 backwards compatibility:
9473 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9474
9475
9476 m4_define([_LTDL_MODE], [])
9477 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9478                  [m4_define([_LTDL_MODE], [nonrecursive])])
9479 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9480                  [m4_define([_LTDL_MODE], [recursive])])
9481 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9482                  [m4_define([_LTDL_MODE], [subproject])])
9483
9484 m4_define([_LTDL_TYPE], [])
9485 LT_OPTION_DEFINE([LTDL_INIT], [installable],
9486                  [m4_define([_LTDL_TYPE], [installable])])
9487 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9488                  [m4_define([_LTDL_TYPE], [convenience])])
9489
9490 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9491 #
9492 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9493 # Written by Gary V. Vaughan, 2004
9494 #
9495 # This file is free software; the Free Software Foundation gives
9496 # unlimited permission to copy and/or distribute it, with or without
9497 # modifications, as long as this notice is preserved.
9498
9499 # serial 6 ltsugar.m4
9500
9501 # This is to help aclocal find these macros, as it can't see m4_define.
9502 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9503
9504
9505 # lt_join(SEP, ARG1, [ARG2...])
9506 # -----------------------------
9507 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9508 # associated separator.
9509 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9510 # versions in m4sugar had bugs.
9511 m4_define([lt_join],
9512 [m4_if([$#], [1], [],
9513        [$#], [2], [[$2]],
9514        [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9515 m4_define([_lt_join],
9516 [m4_if([$#$2], [2], [],
9517        [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9518
9519
9520 # lt_car(LIST)
9521 # lt_cdr(LIST)
9522 # ------------
9523 # Manipulate m4 lists.
9524 # These macros are necessary as long as will still need to support
9525 # Autoconf-2.59 which quotes differently.
9526 m4_define([lt_car], [[$1]])
9527 m4_define([lt_cdr],
9528 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9529        [$#], 1, [],
9530        [m4_dquote(m4_shift($@))])])
9531 m4_define([lt_unquote], $1)
9532
9533
9534 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
9535 # ------------------------------------------
9536 # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9537 # Note that neither SEPARATOR nor STRING are expanded; they are appended
9538 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9539 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
9540 # than defined and empty).
9541 #
9542 # This macro is needed until we can rely on Autoconf 2.62, since earlier
9543 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9544 m4_define([lt_append],
9545 [m4_define([$1],
9546            m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9547
9548
9549
9550 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9551 # ----------------------------------------------------------
9552 # Produce a SEP delimited list of all paired combinations of elements of
9553 # PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9554 # has the form PREFIXmINFIXSUFFIXn.
9555 # Needed until we can rely on m4_combine added in Autoconf 2.62.
9556 m4_define([lt_combine],
9557 [m4_if(m4_eval([$# > 3]), [1],
9558        [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9559 [[m4_foreach([_Lt_prefix], [$2],
9560              [m4_foreach([_Lt_suffix],
9561                 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9562         [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9563
9564
9565 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9566 # -----------------------------------------------------------------------
9567 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9568 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9569 m4_define([lt_if_append_uniq],
9570 [m4_ifdef([$1],
9571           [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9572                  [lt_append([$1], [$2], [$3])$4],
9573                  [$5])],
9574           [lt_append([$1], [$2], [$3])$4])])
9575
9576
9577 # lt_dict_add(DICT, KEY, VALUE)
9578 # -----------------------------
9579 m4_define([lt_dict_add],
9580 [m4_define([$1($2)], [$3])])
9581
9582
9583 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9584 # --------------------------------------------
9585 m4_define([lt_dict_add_subkey],
9586 [m4_define([$1($2:$3)], [$4])])
9587
9588
9589 # lt_dict_fetch(DICT, KEY, [SUBKEY])
9590 # ----------------------------------
9591 m4_define([lt_dict_fetch],
9592 [m4_ifval([$3],
9593         m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9594     m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9595
9596
9597 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9598 # -----------------------------------------------------------------
9599 m4_define([lt_if_dict_fetch],
9600 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9601         [$5],
9602     [$6])])
9603
9604
9605 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9606 # --------------------------------------------------------------
9607 m4_define([lt_dict_filter],
9608 [m4_if([$5], [], [],
9609   [lt_join(m4_quote(m4_default([$4], [[, ]])),
9610            lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9611                       [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9612 ])
9613
9614 # ltversion.m4 -- version numbers                       -*- Autoconf -*-
9615 #
9616 #   Copyright (C) 2004 Free Software Foundation, Inc.
9617 #   Written by Scott James Remnant, 2004
9618 #
9619 # This file is free software; the Free Software Foundation gives
9620 # unlimited permission to copy and/or distribute it, with or without
9621 # modifications, as long as this notice is preserved.
9622
9623 # @configure_input@
9624
9625 # serial 3337 ltversion.m4
9626 # This file is part of GNU Libtool
9627
9628 m4_define([LT_PACKAGE_VERSION], [2.4.2])
9629 m4_define([LT_PACKAGE_REVISION], [1.3337])
9630
9631 AC_DEFUN([LTVERSION_VERSION],
9632 [macro_version='2.4.2'
9633 macro_revision='1.3337'
9634 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9635 _LT_DECL(, macro_revision, 0)
9636 ])
9637
9638 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9639 #
9640 #   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9641 #   Written by Scott James Remnant, 2004.
9642 #
9643 # This file is free software; the Free Software Foundation gives
9644 # unlimited permission to copy and/or distribute it, with or without
9645 # modifications, as long as this notice is preserved.
9646
9647 # serial 5 lt~obsolete.m4
9648
9649 # These exist entirely to fool aclocal when bootstrapping libtool.
9650 #
9651 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9652 # which have later been changed to m4_define as they aren't part of the
9653 # exported API, or moved to Autoconf or Automake where they belong.
9654 #
9655 # The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9656 # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9657 # using a macro with the same name in our local m4/libtool.m4 it'll
9658 # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9659 # and doesn't know about Autoconf macros at all.)
9660 #
9661 # So we provide this file, which has a silly filename so it's always
9662 # included after everything else.  This provides aclocal with the
9663 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9664 # because those macros already exist, or will be overwritten later.
9665 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9666 #
9667 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9668 # Yes, that means every name once taken will need to remain here until
9669 # we give up compatibility with versions before 1.7, at which point
9670 # we need to keep only those names which we still refer to.
9671
9672 # This is to help aclocal find these macros, as it can't see m4_define.
9673 AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9674
9675 m4_ifndef([AC_LIBTOOL_LINKER_OPTION],   [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9676 m4_ifndef([AC_PROG_EGREP],              [AC_DEFUN([AC_PROG_EGREP])])
9677 m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9678 m4_ifndef([_LT_AC_SHELL_INIT],          [AC_DEFUN([_LT_AC_SHELL_INIT])])
9679 m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],     [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9680 m4_ifndef([_LT_PROG_LTMAIN],            [AC_DEFUN([_LT_PROG_LTMAIN])])
9681 m4_ifndef([_LT_AC_TAGVAR],              [AC_DEFUN([_LT_AC_TAGVAR])])
9682 m4_ifndef([AC_LTDL_ENABLE_INSTALL],     [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9683 m4_ifndef([AC_LTDL_PREOPEN],            [AC_DEFUN([AC_LTDL_PREOPEN])])
9684 m4_ifndef([_LT_AC_SYS_COMPILER],        [AC_DEFUN([_LT_AC_SYS_COMPILER])])
9685 m4_ifndef([_LT_AC_LOCK],                [AC_DEFUN([_LT_AC_LOCK])])
9686 m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9687 m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],     [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9688 m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],     [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9689 m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9690 m4_ifndef([AC_LIBTOOL_OBJDIR],          [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9691 m4_ifndef([AC_LTDL_OBJDIR],             [AC_DEFUN([AC_LTDL_OBJDIR])])
9692 m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9693 m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],   [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9694 m4_ifndef([AC_PATH_MAGIC],              [AC_DEFUN([AC_PATH_MAGIC])])
9695 m4_ifndef([AC_PROG_LD_GNU],             [AC_DEFUN([AC_PROG_LD_GNU])])
9696 m4_ifndef([AC_PROG_LD_RELOAD_FLAG],     [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9697 m4_ifndef([AC_DEPLIBS_CHECK_METHOD],    [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9698 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9699 m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9700 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9701 m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],  [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9702 m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],  [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9703 m4_ifndef([LT_AC_PROG_EGREP],           [AC_DEFUN([LT_AC_PROG_EGREP])])
9704 m4_ifndef([LT_AC_PROG_SED],             [AC_DEFUN([LT_AC_PROG_SED])])
9705 m4_ifndef([_LT_CC_BASENAME],            [AC_DEFUN([_LT_CC_BASENAME])])
9706 m4_ifndef([_LT_COMPILER_BOILERPLATE],   [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9707 m4_ifndef([_LT_LINKER_BOILERPLATE],     [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9708 m4_ifndef([_AC_PROG_LIBTOOL],           [AC_DEFUN([_AC_PROG_LIBTOOL])])
9709 m4_ifndef([AC_LIBTOOL_SETUP],           [AC_DEFUN([AC_LIBTOOL_SETUP])])
9710 m4_ifndef([_LT_AC_CHECK_DLFCN],         [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9711 m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],      [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9712 m4_ifndef([_LT_AC_TAGCONFIG],           [AC_DEFUN([_LT_AC_TAGCONFIG])])
9713 m4_ifndef([AC_DISABLE_FAST_INSTALL],    [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9714 m4_ifndef([_LT_AC_LANG_CXX],            [AC_DEFUN([_LT_AC_LANG_CXX])])
9715 m4_ifndef([_LT_AC_LANG_F77],            [AC_DEFUN([_LT_AC_LANG_F77])])
9716 m4_ifndef([_LT_AC_LANG_GCJ],            [AC_DEFUN([_LT_AC_LANG_GCJ])])
9717 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],   [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9718 m4_ifndef([_LT_AC_LANG_C_CONFIG],       [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9719 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9720 m4_ifndef([_LT_AC_LANG_CXX_CONFIG],     [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9721 m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9722 m4_ifndef([_LT_AC_LANG_F77_CONFIG],     [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9723 m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9724 m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],     [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9725 m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9726 m4_ifndef([_LT_AC_LANG_RC_CONFIG],      [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9727 m4_ifndef([AC_LIBTOOL_CONFIG],          [AC_DEFUN([AC_LIBTOOL_CONFIG])])
9728 m4_ifndef([_LT_AC_FILE_LTDLL_C],        [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9729 m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9730 m4_ifndef([_LT_AC_PROG_CXXCPP],         [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9731 m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9732 m4_ifndef([_LT_PROG_ECHO_BACKSLASH],    [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9733 m4_ifndef([_LT_PROG_F77],               [AC_DEFUN([_LT_PROG_F77])])
9734 m4_ifndef([_LT_PROG_FC],                [AC_DEFUN([_LT_PROG_FC])])
9735 m4_ifndef([_LT_PROG_CXX],               [AC_DEFUN([_LT_PROG_CXX])])
9736
9737 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9738
9739 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
9740 #
9741 # This program is free software; you can redistribute it and/or modify
9742 # it under the terms of the GNU General Public License as published by
9743 # the Free Software Foundation; either version 2 of the License, or
9744 # (at your option) any later version.
9745 #
9746 # This program is distributed in the hope that it will be useful, but
9747 # WITHOUT ANY WARRANTY; without even the implied warranty of
9748 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9749 # General Public License for more details.
9750 #
9751 # You should have received a copy of the GNU General Public License
9752 # along with this program; if not, write to the Free Software
9753 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9754 #
9755 # As a special exception to the GNU General Public License, if you
9756 # distribute this file as part of a program that contains a
9757 # configuration script generated by Autoconf, you may include it under
9758 # the same distribution terms that you use for the rest of that program.
9759
9760 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
9761 # ----------------------------------
9762 AC_DEFUN([PKG_PROG_PKG_CONFIG],
9763 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9764 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9765 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9766 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9767         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9768 fi
9769 if test -n "$PKG_CONFIG"; then
9770         _pkg_min_version=m4_default([$1], [0.9.0])
9771         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9772         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9773                 AC_MSG_RESULT([yes])
9774         else
9775                 AC_MSG_RESULT([no])
9776                 PKG_CONFIG=""
9777         fi
9778                 
9779 fi[]dnl
9780 ])# PKG_PROG_PKG_CONFIG
9781
9782 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9783 #
9784 # Check to see whether a particular set of modules exists.  Similar
9785 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
9786 #
9787 #
9788 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
9789 # this or PKG_CHECK_MODULES is called, or make sure to call
9790 # PKG_CHECK_EXISTS manually
9791 # --------------------------------------------------------------
9792 AC_DEFUN([PKG_CHECK_EXISTS],
9793 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9794 if test -n "$PKG_CONFIG" && \
9795     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9796   m4_ifval([$2], [$2], [:])
9797 m4_ifvaln([$3], [else
9798   $3])dnl
9799 fi])
9800
9801
9802 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9803 # ---------------------------------------------
9804 m4_define([_PKG_CONFIG],
9805 [if test -n "$$1"; then
9806     pkg_cv_[]$1="$$1"
9807  elif test -n "$PKG_CONFIG"; then
9808     PKG_CHECK_EXISTS([$3],
9809                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9810                      [pkg_failed=yes])
9811  else
9812     pkg_failed=untried
9813 fi[]dnl
9814 ])# _PKG_CONFIG
9815
9816 # _PKG_SHORT_ERRORS_SUPPORTED
9817 # -----------------------------
9818 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9819 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9820 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9821         _pkg_short_errors_supported=yes
9822 else
9823         _pkg_short_errors_supported=no
9824 fi[]dnl
9825 ])# _PKG_SHORT_ERRORS_SUPPORTED
9826
9827
9828 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9829 # [ACTION-IF-NOT-FOUND])
9830 #
9831 #
9832 # Note that if there is a possibility the first call to
9833 # PKG_CHECK_MODULES might not happen, you should be sure to include an
9834 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9835 #
9836 #
9837 # --------------------------------------------------------------
9838 AC_DEFUN([PKG_CHECK_MODULES],
9839 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9840 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9841 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9842
9843 pkg_failed=no
9844 AC_MSG_CHECKING([for $1])
9845
9846 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9847 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
9848
9849 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9850 and $1[]_LIBS to avoid the need to call pkg-config.
9851 See the pkg-config man page for more details.])
9852
9853 if test $pkg_failed = yes; then
9854         _PKG_SHORT_ERRORS_SUPPORTED
9855         if test $_pkg_short_errors_supported = yes; then
9856                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9857         else 
9858                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9859         fi
9860         # Put the nasty error message in config.log where it belongs
9861         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9862
9863         ifelse([$4], , [AC_MSG_ERROR(dnl
9864 [Package requirements ($2) were not met:
9865
9866 $$1_PKG_ERRORS
9867
9868 Consider adjusting the PKG_CONFIG_PATH environment variable if you
9869 installed software in a non-standard prefix.
9870
9871 _PKG_TEXT
9872 ])],
9873                 [AC_MSG_RESULT([no])
9874                 $4])
9875 elif test $pkg_failed = untried; then
9876         ifelse([$4], , [AC_MSG_FAILURE(dnl
9877 [The pkg-config script could not be found or is too old.  Make sure it
9878 is in your PATH or set the PKG_CONFIG environment variable to the full
9879 path to pkg-config.
9880
9881 _PKG_TEXT
9882
9883 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9884                 [$4])
9885 else
9886         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9887         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9888         AC_MSG_RESULT([yes])
9889         ifelse([$3], , :, [$3])
9890 fi[]dnl
9891 ])# PKG_CHECK_MODULES
9892
9893 dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9894 dnl
9895 dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9896 dnl
9897 dnl Permission is hereby granted, free of charge, to any person obtaining a
9898 dnl copy of this software and associated documentation files (the "Software"),
9899 dnl to deal in the Software without restriction, including without limitation
9900 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9901 dnl and/or sell copies of the Software, and to permit persons to whom the
9902 dnl Software is furnished to do so, subject to the following conditions:
9903 dnl
9904 dnl The above copyright notice and this permission notice (including the next
9905 dnl paragraph) shall be included in all copies or substantial portions of the
9906 dnl Software.
9907 dnl
9908 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9909 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9910 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9911 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9912 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9913 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9914 dnl DEALINGS IN THE SOFTWARE.
9915
9916 # XORG_MACROS_VERSION(required-version)
9917 # -------------------------------------
9918 # Minimum version: 1.1.0
9919 #
9920 # If you're using a macro added in Version 1.1 or newer, include this in
9921 # your configure.ac with the minimum required version, such as:
9922 # XORG_MACROS_VERSION(1.1)
9923 #
9924 # To ensure that this macro is defined, also add:
9925 # m4_ifndef([XORG_MACROS_VERSION],
9926 #     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9927 #
9928 #
9929 # See the "minimum version" comment for each macro you use to see what
9930 # version you require.
9931 m4_defun([XORG_MACROS_VERSION],[
9932 m4_define([vers_have], [1.19.0])
9933 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9934 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9935 m4_if(m4_cmp(maj_have, maj_needed), 0,,
9936     [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9937 m4_if(m4_version_compare(vers_have, [$1]), -1,
9938     [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9939 m4_undefine([vers_have])
9940 m4_undefine([maj_have])
9941 m4_undefine([maj_needed])
9942 ]) # XORG_MACROS_VERSION
9943
9944 # XORG_PROG_RAWCPP()
9945 # ------------------
9946 # Minimum version: 1.0.0
9947 #
9948 # Find cpp program and necessary flags for use in pre-processing text files
9949 # such as man pages and config files
9950 AC_DEFUN([XORG_PROG_RAWCPP],[
9951 AC_REQUIRE([AC_PROG_CPP])
9952 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9953    [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9954
9955 # Check for flag to avoid builtin definitions - assumes unix is predefined,
9956 # which is not the best choice for supporting other OS'es, but covers most
9957 # of the ones we need for now.
9958 AC_MSG_CHECKING([if $RAWCPP requires -undef])
9959 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9960 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9961         AC_MSG_RESULT([no])
9962 else
9963         if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9964                 RAWCPPFLAGS=-undef
9965                 AC_MSG_RESULT([yes])
9966         # under Cygwin unix is still defined even with -undef
9967         elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9968                 RAWCPPFLAGS="-undef -ansi"
9969                 AC_MSG_RESULT([yes, with -ansi])
9970         else
9971                 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9972         fi
9973 fi
9974 rm -f conftest.$ac_ext
9975
9976 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9977 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9978 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9979         AC_MSG_RESULT([no])
9980 else
9981         if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9982                 TRADITIONALCPPFLAGS="-traditional"
9983                 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9984                 AC_MSG_RESULT([yes])
9985         else
9986                 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9987         fi
9988 fi
9989 rm -f conftest.$ac_ext
9990 AC_SUBST(RAWCPPFLAGS)
9991 AC_SUBST(TRADITIONALCPPFLAGS)
9992 ]) # XORG_PROG_RAWCPP
9993
9994 # XORG_MANPAGE_SECTIONS()
9995 # -----------------------
9996 # Minimum version: 1.0.0
9997 #
9998 # Determine which sections man pages go in for the different man page types
9999 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
10000 # Not sure if there's any better way than just hardcoding by OS name.
10001 # Override default settings by setting environment variables
10002 # Added MAN_SUBSTS in version 1.8
10003 # Added AC_PROG_SED in version 1.8
10004
10005 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
10006 AC_REQUIRE([AC_CANONICAL_HOST])
10007 AC_REQUIRE([AC_PROG_SED])
10008
10009 if test x$APP_MAN_SUFFIX = x    ; then
10010     APP_MAN_SUFFIX=1
10011 fi
10012 if test x$APP_MAN_DIR = x    ; then
10013     APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10014 fi
10015
10016 if test x$LIB_MAN_SUFFIX = x    ; then
10017     LIB_MAN_SUFFIX=3
10018 fi
10019 if test x$LIB_MAN_DIR = x    ; then
10020     LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10021 fi
10022
10023 if test x$FILE_MAN_SUFFIX = x    ; then
10024     case $host_os in
10025         solaris*)       FILE_MAN_SUFFIX=4  ;;
10026         *)              FILE_MAN_SUFFIX=5  ;;
10027     esac
10028 fi
10029 if test x$FILE_MAN_DIR = x    ; then
10030     FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10031 fi
10032
10033 if test x$MISC_MAN_SUFFIX = x    ; then
10034     case $host_os in
10035         solaris*)       MISC_MAN_SUFFIX=5  ;;
10036         *)              MISC_MAN_SUFFIX=7  ;;
10037     esac
10038 fi
10039 if test x$MISC_MAN_DIR = x    ; then
10040     MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10041 fi
10042
10043 if test x$DRIVER_MAN_SUFFIX = x    ; then
10044     case $host_os in
10045         solaris*)       DRIVER_MAN_SUFFIX=7  ;;
10046         *)              DRIVER_MAN_SUFFIX=4  ;;
10047     esac
10048 fi
10049 if test x$DRIVER_MAN_DIR = x    ; then
10050     DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10051 fi
10052
10053 if test x$ADMIN_MAN_SUFFIX = x    ; then
10054     case $host_os in
10055         solaris*)       ADMIN_MAN_SUFFIX=1m ;;
10056         *)              ADMIN_MAN_SUFFIX=8  ;;
10057     esac
10058 fi
10059 if test x$ADMIN_MAN_DIR = x    ; then
10060     ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10061 fi
10062
10063
10064 AC_SUBST([APP_MAN_SUFFIX])
10065 AC_SUBST([LIB_MAN_SUFFIX])
10066 AC_SUBST([FILE_MAN_SUFFIX])
10067 AC_SUBST([MISC_MAN_SUFFIX])
10068 AC_SUBST([DRIVER_MAN_SUFFIX])
10069 AC_SUBST([ADMIN_MAN_SUFFIX])
10070 AC_SUBST([APP_MAN_DIR])
10071 AC_SUBST([LIB_MAN_DIR])
10072 AC_SUBST([FILE_MAN_DIR])
10073 AC_SUBST([MISC_MAN_DIR])
10074 AC_SUBST([DRIVER_MAN_DIR])
10075 AC_SUBST([ADMIN_MAN_DIR])
10076
10077 XORG_MAN_PAGE="X Version 11"
10078 AC_SUBST([XORG_MAN_PAGE])
10079 MAN_SUBSTS="\
10080         -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10081         -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10082         -e 's|__xservername__|Xorg|g' \
10083         -e 's|__xconfigfile__|xorg.conf|g' \
10084         -e 's|__projectroot__|\$(prefix)|g' \
10085         -e 's|__apploaddir__|\$(appdefaultdir)|g' \
10086         -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
10087         -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
10088         -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
10089         -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
10090         -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
10091         -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
10092 AC_SUBST([MAN_SUBSTS])
10093
10094 ]) # XORG_MANPAGE_SECTIONS
10095
10096 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
10097 # ------------------------
10098 # Minimum version: 1.7.0
10099 #
10100 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
10101 # provided by xorg-sgml-doctools, if installed.
10102 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
10103 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
10104 XORG_SGML_PATH=
10105 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
10106     [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
10107     [m4_ifval([$1],[:],
10108         [if test x"$cross_compiling" != x"yes" ; then
10109             AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
10110                           [XORG_SGML_PATH=$prefix/share/sgml])
10111          fi])
10112     ])
10113
10114 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10115 # the path and the name of the doc stylesheet
10116 if test "x$XORG_SGML_PATH" != "x" ; then
10117    AC_MSG_RESULT([$XORG_SGML_PATH])
10118    STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10119    XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10120 else
10121    AC_MSG_RESULT([no])
10122 fi
10123
10124 AC_SUBST(XORG_SGML_PATH)
10125 AC_SUBST(STYLESHEET_SRCDIR)
10126 AC_SUBST(XSL_STYLESHEET)
10127 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10128 ]) # XORG_CHECK_SGML_DOCTOOLS
10129
10130 # XORG_CHECK_LINUXDOC
10131 # -------------------
10132 # Minimum version: 1.0.0
10133 #
10134 # Defines the variable MAKE_TEXT if the necessary tools and
10135 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10136 # Whether or not the necessary tools and files are found can be checked
10137 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
10138 AC_DEFUN([XORG_CHECK_LINUXDOC],[
10139 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10140 AC_REQUIRE([XORG_WITH_PS2PDF])
10141
10142 AC_PATH_PROG(LINUXDOC, linuxdoc)
10143
10144 AC_MSG_CHECKING([whether to build documentation])
10145
10146 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10147    BUILDDOC=yes
10148 else
10149    BUILDDOC=no
10150 fi
10151
10152 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10153
10154 AC_MSG_RESULT([$BUILDDOC])
10155
10156 AC_MSG_CHECKING([whether to build pdf documentation])
10157
10158 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10159    BUILDPDFDOC=yes
10160 else
10161    BUILDPDFDOC=no
10162 fi
10163
10164 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10165
10166 AC_MSG_RESULT([$BUILDPDFDOC])
10167
10168 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10169 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10170 MAKE_PDF="$PS2PDF"
10171 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10172
10173 AC_SUBST(MAKE_TEXT)
10174 AC_SUBST(MAKE_PS)
10175 AC_SUBST(MAKE_PDF)
10176 AC_SUBST(MAKE_HTML)
10177 ]) # XORG_CHECK_LINUXDOC
10178
10179 # XORG_CHECK_DOCBOOK
10180 # -------------------
10181 # Minimum version: 1.0.0
10182 #
10183 # Checks for the ability to build output formats from SGML DocBook source.
10184 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10185 # indicates whether the necessary tools and files are found and, if set,
10186 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
10187 AC_DEFUN([XORG_CHECK_DOCBOOK],[
10188 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10189
10190 BUILDTXTDOC=no
10191 BUILDPDFDOC=no
10192 BUILDPSDOC=no
10193 BUILDHTMLDOC=no
10194
10195 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
10196 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10197 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
10198 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10199
10200 AC_MSG_CHECKING([whether to build text documentation])
10201 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10202    test x$BUILD_TXTDOC != xno; then
10203         BUILDTXTDOC=yes
10204 fi
10205 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10206 AC_MSG_RESULT([$BUILDTXTDOC])
10207
10208 AC_MSG_CHECKING([whether to build PDF documentation])
10209 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10210    test x$BUILD_PDFDOC != xno; then
10211         BUILDPDFDOC=yes
10212 fi
10213 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10214 AC_MSG_RESULT([$BUILDPDFDOC])
10215
10216 AC_MSG_CHECKING([whether to build PostScript documentation])
10217 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10218    test x$BUILD_PSDOC != xno; then
10219         BUILDPSDOC=yes
10220 fi
10221 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10222 AC_MSG_RESULT([$BUILDPSDOC])
10223
10224 AC_MSG_CHECKING([whether to build HTML documentation])
10225 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10226    test x$BUILD_HTMLDOC != xno; then
10227         BUILDHTMLDOC=yes
10228 fi
10229 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10230 AC_MSG_RESULT([$BUILDHTMLDOC])
10231
10232 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10233 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10234 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10235 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10236
10237 AC_SUBST(MAKE_TEXT)
10238 AC_SUBST(MAKE_PS)
10239 AC_SUBST(MAKE_PDF)
10240 AC_SUBST(MAKE_HTML)
10241 ]) # XORG_CHECK_DOCBOOK
10242
10243 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10244 # ----------------
10245 # Minimum version: 1.5.0
10246 # Minimum version for optional DEFAULT argument: 1.11.0
10247 #
10248 # Documentation tools are not always available on all platforms and sometimes
10249 # not at the appropriate level. This macro enables a module to test for the
10250 # presence of the tool and obtain it's path in separate variables. Coupled with
10251 # the --with-xmlto option, it allows maximum flexibilty in making decisions
10252 # as whether or not to use the xmlto package. When DEFAULT is not specified,
10253 # --with-xmlto assumes 'auto'.
10254 #
10255 # Interface to module:
10256 # HAVE_XMLTO:   used in makefiles to conditionally generate documentation
10257 # XMLTO:        returns the path of the xmlto program found
10258 #               returns the path set by the user in the environment
10259 # --with-xmlto: 'yes' user instructs the module to use xmlto
10260 #               'no' user instructs the module not to use xmlto
10261 #
10262 # Added in version 1.10.0
10263 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10264 #                  xmlto for text output requires either lynx, links, or w3m browsers
10265 #
10266 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10267 #
10268 AC_DEFUN([XORG_WITH_XMLTO],[
10269 AC_ARG_VAR([XMLTO], [Path to xmlto command])
10270 m4_define([_defopt], m4_default([$2], [auto]))
10271 AC_ARG_WITH(xmlto,
10272         AS_HELP_STRING([--with-xmlto],
10273            [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10274            [use_xmlto=$withval], [use_xmlto=]_defopt)
10275 m4_undefine([_defopt])
10276
10277 if test "x$use_xmlto" = x"auto"; then
10278    AC_PATH_PROG([XMLTO], [xmlto])
10279    if test "x$XMLTO" = "x"; then
10280         AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10281         have_xmlto=no
10282    else
10283         have_xmlto=yes
10284    fi
10285 elif test "x$use_xmlto" = x"yes" ; then
10286    AC_PATH_PROG([XMLTO], [xmlto])
10287    if test "x$XMLTO" = "x"; then
10288         AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10289    fi
10290    have_xmlto=yes
10291 elif test "x$use_xmlto" = x"no" ; then
10292    if test "x$XMLTO" != "x"; then
10293       AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10294    fi
10295    have_xmlto=no
10296 else
10297    AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10298 fi
10299
10300 # Test for a minimum version of xmlto, if provided.
10301 m4_ifval([$1],
10302 [if test "$have_xmlto" = yes; then
10303     # scrape the xmlto version
10304     AC_MSG_CHECKING([the xmlto version])
10305     xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10306     AC_MSG_RESULT([$xmlto_version])
10307     AS_VERSION_COMPARE([$xmlto_version], [$1],
10308         [if test "x$use_xmlto" = xauto; then
10309             AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10310             have_xmlto=no
10311         else
10312             AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10313         fi])
10314 fi])
10315
10316 # Test for the ability of xmlto to generate a text target
10317 have_xmlto_text=no
10318 cat > conftest.xml << "EOF"
10319 EOF
10320 AS_IF([test "$have_xmlto" = yes],
10321       [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10322              [have_xmlto_text=yes],
10323              [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10324 rm -f conftest.xml
10325 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10326 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10327 ]) # XORG_WITH_XMLTO
10328
10329 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10330 # --------------------------------------------
10331 # Minimum version: 1.12.0
10332 # Minimum version for optional DEFAULT argument: 1.12.0
10333 #
10334 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10335 # XML-based language used for the transformation of XML documents.
10336 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10337 # It is used under the cover by xmlto to generate html files from DocBook/XML.
10338 # The XSLT processor is often used as a standalone tool for transformations.
10339 # It should not be assumed that this tool is used only to work with documnetation.
10340 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10341 #
10342 # Interface to module:
10343 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10344 # XSLTPROC:      returns the path of the xsltproc program found
10345 #                returns the path set by the user in the environment
10346 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
10347 #                 'no' user instructs the module not to use xsltproc
10348 # have_xsltproc: returns yes if xsltproc found in PATH or no
10349 #
10350 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10351 #
10352 AC_DEFUN([XORG_WITH_XSLTPROC],[
10353 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10354 # Preserves the interface, should it be implemented later
10355 m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10356 m4_define([_defopt], m4_default([$2], [auto]))
10357 AC_ARG_WITH(xsltproc,
10358         AS_HELP_STRING([--with-xsltproc],
10359            [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10360            [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10361 m4_undefine([_defopt])
10362
10363 if test "x$use_xsltproc" = x"auto"; then
10364    AC_PATH_PROG([XSLTPROC], [xsltproc])
10365    if test "x$XSLTPROC" = "x"; then
10366         AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10367         have_xsltproc=no
10368    else
10369         have_xsltproc=yes
10370    fi
10371 elif test "x$use_xsltproc" = x"yes" ; then
10372    AC_PATH_PROG([XSLTPROC], [xsltproc])
10373    if test "x$XSLTPROC" = "x"; then
10374         AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10375    fi
10376    have_xsltproc=yes
10377 elif test "x$use_xsltproc" = x"no" ; then
10378    if test "x$XSLTPROC" != "x"; then
10379       AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10380    fi
10381    have_xsltproc=no
10382 else
10383    AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10384 fi
10385
10386 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10387 ]) # XORG_WITH_XSLTPROC
10388
10389 # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10390 # ----------------------------------------
10391 # Minimum version: 1.15.0
10392 #
10393 # PERL (Practical Extraction and Report Language) is a language optimized for
10394 # scanning arbitrary text files, extracting information from those text files,
10395 # and printing reports based on that information.
10396 #
10397 # When DEFAULT is not specified, --with-perl assumes 'auto'.
10398 #
10399 # Interface to module:
10400 # HAVE_PERL: used in makefiles to conditionally scan text files
10401 # PERL:      returns the path of the perl program found
10402 #            returns the path set by the user in the environment
10403 # --with-perl: 'yes' user instructs the module to use perl
10404 #              'no' user instructs the module not to use perl
10405 # have_perl: returns yes if perl found in PATH or no
10406 #
10407 # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10408 #
10409 AC_DEFUN([XORG_WITH_PERL],[
10410 AC_ARG_VAR([PERL], [Path to perl command])
10411 # Preserves the interface, should it be implemented later
10412 m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10413 m4_define([_defopt], m4_default([$2], [auto]))
10414 AC_ARG_WITH(perl,
10415         AS_HELP_STRING([--with-perl],
10416            [Use perl for extracting information from files (default: ]_defopt[)]),
10417            [use_perl=$withval], [use_perl=]_defopt)
10418 m4_undefine([_defopt])
10419
10420 if test "x$use_perl" = x"auto"; then
10421    AC_PATH_PROG([PERL], [perl])
10422    if test "x$PERL" = "x"; then
10423         AC_MSG_WARN([perl not found - cannot extract information and report])
10424         have_perl=no
10425    else
10426         have_perl=yes
10427    fi
10428 elif test "x$use_perl" = x"yes" ; then
10429    AC_PATH_PROG([PERL], [perl])
10430    if test "x$PERL" = "x"; then
10431         AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10432    fi
10433    have_perl=yes
10434 elif test "x$use_perl" = x"no" ; then
10435    if test "x$PERL" != "x"; then
10436       AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10437    fi
10438    have_perl=no
10439 else
10440    AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10441 fi
10442
10443 AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10444 ]) # XORG_WITH_PERL
10445
10446 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10447 # ----------------
10448 # Minimum version: 1.5.0
10449 # Minimum version for optional DEFAULT argument: 1.11.0
10450 #
10451 # Documentation tools are not always available on all platforms and sometimes
10452 # not at the appropriate level. This macro enables a module to test for the
10453 # presence of the tool and obtain it's path in separate variables. Coupled with
10454 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
10455 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
10456 # --with-asciidoc assumes 'auto'.
10457 #
10458 # Interface to module:
10459 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10460 # ASCIIDOC:      returns the path of the asciidoc program found
10461 #                returns the path set by the user in the environment
10462 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
10463 #                 'no' user instructs the module not to use asciidoc
10464 #
10465 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10466 #
10467 AC_DEFUN([XORG_WITH_ASCIIDOC],[
10468 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10469 m4_define([_defopt], m4_default([$2], [auto]))
10470 AC_ARG_WITH(asciidoc,
10471         AS_HELP_STRING([--with-asciidoc],
10472            [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10473            [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10474 m4_undefine([_defopt])
10475
10476 if test "x$use_asciidoc" = x"auto"; then
10477    AC_PATH_PROG([ASCIIDOC], [asciidoc])
10478    if test "x$ASCIIDOC" = "x"; then
10479         AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10480         have_asciidoc=no
10481    else
10482         have_asciidoc=yes
10483    fi
10484 elif test "x$use_asciidoc" = x"yes" ; then
10485    AC_PATH_PROG([ASCIIDOC], [asciidoc])
10486    if test "x$ASCIIDOC" = "x"; then
10487         AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10488    fi
10489    have_asciidoc=yes
10490 elif test "x$use_asciidoc" = x"no" ; then
10491    if test "x$ASCIIDOC" != "x"; then
10492       AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10493    fi
10494    have_asciidoc=no
10495 else
10496    AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10497 fi
10498 m4_ifval([$1],
10499 [if test "$have_asciidoc" = yes; then
10500     # scrape the asciidoc version
10501     AC_MSG_CHECKING([the asciidoc version])
10502     asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10503     AC_MSG_RESULT([$asciidoc_version])
10504     AS_VERSION_COMPARE([$asciidoc_version], [$1],
10505         [if test "x$use_asciidoc" = xauto; then
10506             AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10507             have_asciidoc=no
10508         else
10509             AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10510         fi])
10511 fi])
10512 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10513 ]) # XORG_WITH_ASCIIDOC
10514
10515 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10516 # -------------------------------------------
10517 # Minimum version: 1.5.0
10518 # Minimum version for optional DEFAULT argument: 1.11.0
10519 # Minimum version for optional DOT checking: 1.18.0
10520 #
10521 # Documentation tools are not always available on all platforms and sometimes
10522 # not at the appropriate level. This macro enables a module to test for the
10523 # presence of the tool and obtain it's path in separate variables. Coupled with
10524 # the --with-doxygen option, it allows maximum flexibilty in making decisions
10525 # as whether or not to use the doxygen package. When DEFAULT is not specified,
10526 # --with-doxygen assumes 'auto'.
10527 #
10528 # Interface to module:
10529 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10530 # DOXYGEN:       returns the path of the doxygen program found
10531 #                returns the path set by the user in the environment
10532 # --with-doxygen: 'yes' user instructs the module to use doxygen
10533 #                 'no' user instructs the module not to use doxygen
10534 #
10535 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10536 #
10537 AC_DEFUN([XORG_WITH_DOXYGEN],[
10538 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10539 AC_ARG_VAR([DOT], [Path to the dot graphics utility])
10540 m4_define([_defopt], m4_default([$2], [auto]))
10541 AC_ARG_WITH(doxygen,
10542         AS_HELP_STRING([--with-doxygen],
10543            [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10544            [use_doxygen=$withval], [use_doxygen=]_defopt)
10545 m4_undefine([_defopt])
10546
10547 if test "x$use_doxygen" = x"auto"; then
10548    AC_PATH_PROG([DOXYGEN], [doxygen])
10549    if test "x$DOXYGEN" = "x"; then
10550         AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10551         have_doxygen=no
10552    else
10553         have_doxygen=yes
10554    fi
10555 elif test "x$use_doxygen" = x"yes" ; then
10556    AC_PATH_PROG([DOXYGEN], [doxygen])
10557    if test "x$DOXYGEN" = "x"; then
10558         AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10559    fi
10560    have_doxygen=yes
10561 elif test "x$use_doxygen" = x"no" ; then
10562    if test "x$DOXYGEN" != "x"; then
10563       AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10564    fi
10565    have_doxygen=no
10566 else
10567    AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10568 fi
10569 m4_ifval([$1],
10570 [if test "$have_doxygen" = yes; then
10571     # scrape the doxygen version
10572     AC_MSG_CHECKING([the doxygen version])
10573     doxygen_version=`$DOXYGEN --version 2>/dev/null`
10574     AC_MSG_RESULT([$doxygen_version])
10575     AS_VERSION_COMPARE([$doxygen_version], [$1],
10576         [if test "x$use_doxygen" = xauto; then
10577             AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10578             have_doxygen=no
10579         else
10580             AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10581         fi])
10582 fi])
10583
10584 dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10585 dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10586 dnl     HAVE_DOT = @HAVE_DOT@
10587 HAVE_DOT=no
10588 if test "x$have_doxygen" = "xyes"; then
10589   AC_PATH_PROG([DOT], [dot])
10590     if test "x$DOT" != "x"; then
10591       HAVE_DOT=yes
10592     fi
10593 fi
10594
10595 AC_SUBST([HAVE_DOT])
10596 AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
10597 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10598 ]) # XORG_WITH_DOXYGEN
10599
10600 # XORG_WITH_GROFF([DEFAULT])
10601 # ----------------
10602 # Minimum version: 1.6.0
10603 # Minimum version for optional DEFAULT argument: 1.11.0
10604 #
10605 # Documentation tools are not always available on all platforms and sometimes
10606 # not at the appropriate level. This macro enables a module to test for the
10607 # presence of the tool and obtain it's path in separate variables. Coupled with
10608 # the --with-groff option, it allows maximum flexibilty in making decisions
10609 # as whether or not to use the groff package. When DEFAULT is not specified,
10610 # --with-groff assumes 'auto'.
10611 #
10612 # Interface to module:
10613 # HAVE_GROFF:    used in makefiles to conditionally generate documentation
10614 # HAVE_GROFF_MM: the memorandum macros (-mm) package
10615 # HAVE_GROFF_MS: the -ms macros package
10616 # GROFF:         returns the path of the groff program found
10617 #                returns the path set by the user in the environment
10618 # --with-groff:  'yes' user instructs the module to use groff
10619 #                'no' user instructs the module not to use groff
10620 #
10621 # Added in version 1.9.0:
10622 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10623 #                  pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10624 #                  psselect from the psutils package.
10625 #                  the ghostcript package. Refer to the grohtml man pages
10626 #
10627 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10628 #
10629 # OS and distros often splits groff in a basic and full package, the former
10630 # having the groff program and the later having devices, fonts and macros
10631 # Checking for the groff executable is not enough.
10632 #
10633 # If macros are missing, we cannot assume that groff is useless, so we don't
10634 # unset HAVE_GROFF or GROFF env variables.
10635 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10636 #
10637 AC_DEFUN([XORG_WITH_GROFF],[
10638 AC_ARG_VAR([GROFF], [Path to groff command])
10639 m4_define([_defopt], m4_default([$1], [auto]))
10640 AC_ARG_WITH(groff,
10641         AS_HELP_STRING([--with-groff],
10642            [Use groff to regenerate documentation (default: ]_defopt[)]),
10643            [use_groff=$withval], [use_groff=]_defopt)
10644 m4_undefine([_defopt])
10645
10646 if test "x$use_groff" = x"auto"; then
10647    AC_PATH_PROG([GROFF], [groff])
10648    if test "x$GROFF" = "x"; then
10649         AC_MSG_WARN([groff not found - documentation targets will be skipped])
10650         have_groff=no
10651    else
10652         have_groff=yes
10653    fi
10654 elif test "x$use_groff" = x"yes" ; then
10655    AC_PATH_PROG([GROFF], [groff])
10656    if test "x$GROFF" = "x"; then
10657         AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10658    fi
10659    have_groff=yes
10660 elif test "x$use_groff" = x"no" ; then
10661    if test "x$GROFF" != "x"; then
10662       AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10663    fi
10664    have_groff=no
10665 else
10666    AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10667 fi
10668
10669 # We have groff, test for the presence of the macro packages
10670 if test "x$have_groff" = x"yes"; then
10671     AC_MSG_CHECKING([for ${GROFF} -ms macros])
10672     if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10673         groff_ms_works=yes
10674     else
10675         groff_ms_works=no
10676     fi
10677     AC_MSG_RESULT([$groff_ms_works])
10678     AC_MSG_CHECKING([for ${GROFF} -mm macros])
10679     if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10680         groff_mm_works=yes
10681     else
10682         groff_mm_works=no
10683     fi
10684     AC_MSG_RESULT([$groff_mm_works])
10685 fi
10686
10687 # We have groff, test for HTML dependencies, one command per package
10688 if test "x$have_groff" = x"yes"; then
10689    AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10690    AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10691    AC_PATH_PROG(PSSELECT_PATH, [psselect])
10692    if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10693       have_groff_html=yes
10694    else
10695       have_groff_html=no
10696       AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10697    fi
10698 fi
10699
10700 # Set Automake conditionals for Makefiles
10701 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10702 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10703 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10704 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10705 ]) # XORG_WITH_GROFF
10706
10707 # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10708 # ---------------------------------------
10709 # Minimum version: 1.6.0
10710 # Minimum version for optional DEFAULT argument: 1.11.0
10711 # Minimum version for optional MIN-VERSION argument: 1.15.0
10712 #
10713 # Documentation tools are not always available on all platforms and sometimes
10714 # not at the appropriate level. This macro enables a module to test for the
10715 # presence of the tool and obtain it's path in separate variables. Coupled with
10716 # the --with-fop option, it allows maximum flexibilty in making decisions
10717 # as whether or not to use the fop package. When DEFAULT is not specified,
10718 # --with-fop assumes 'auto'.
10719 #
10720 # Interface to module:
10721 # HAVE_FOP:     used in makefiles to conditionally generate documentation
10722 # FOP:          returns the path of the fop program found
10723 #               returns the path set by the user in the environment
10724 # --with-fop:   'yes' user instructs the module to use fop
10725 #               'no' user instructs the module not to use fop
10726 #
10727 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10728 #
10729 AC_DEFUN([XORG_WITH_FOP],[
10730 AC_ARG_VAR([FOP], [Path to fop command])
10731 m4_define([_defopt], m4_default([$2], [auto]))
10732 AC_ARG_WITH(fop,
10733         AS_HELP_STRING([--with-fop],
10734            [Use fop to regenerate documentation (default: ]_defopt[)]),
10735            [use_fop=$withval], [use_fop=]_defopt)
10736 m4_undefine([_defopt])
10737
10738 if test "x$use_fop" = x"auto"; then
10739    AC_PATH_PROG([FOP], [fop])
10740    if test "x$FOP" = "x"; then
10741         AC_MSG_WARN([fop not found - documentation targets will be skipped])
10742         have_fop=no
10743    else
10744         have_fop=yes
10745    fi
10746 elif test "x$use_fop" = x"yes" ; then
10747    AC_PATH_PROG([FOP], [fop])
10748    if test "x$FOP" = "x"; then
10749         AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10750    fi
10751    have_fop=yes
10752 elif test "x$use_fop" = x"no" ; then
10753    if test "x$FOP" != "x"; then
10754       AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10755    fi
10756    have_fop=no
10757 else
10758    AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10759 fi
10760
10761 # Test for a minimum version of fop, if provided.
10762 m4_ifval([$1],
10763 [if test "$have_fop" = yes; then
10764     # scrape the fop version
10765     AC_MSG_CHECKING([for fop minimum version])
10766     fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10767     AC_MSG_RESULT([$fop_version])
10768     AS_VERSION_COMPARE([$fop_version], [$1],
10769         [if test "x$use_fop" = xauto; then
10770             AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10771             have_fop=no
10772         else
10773             AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10774         fi])
10775 fi])
10776 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10777 ]) # XORG_WITH_FOP
10778
10779 # XORG_WITH_M4([MIN-VERSION])
10780 # ---------------------------
10781 # Minimum version: 1.19.0
10782 #
10783 # This macro attempts to locate an m4 macro processor which supports
10784 # -I option and is only useful for modules relying on M4 in order to
10785 # expand macros in source code files.
10786 #
10787 # Interface to module:
10788 # M4:           returns the path of the m4 program found
10789 #               returns the path set by the user in the environment
10790 #
10791 AC_DEFUN([XORG_WITH_M4], [
10792 AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10793    [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10794        [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10795          ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10796    [AC_MSG_ERROR([could not find m4 that supports -I option])],
10797    [$PATH:/usr/gnu/bin])])
10798
10799 AC_SUBST([M4], [$ac_cv_path_M4])
10800 ]) # XORG_WITH_M4
10801
10802 # XORG_WITH_PS2PDF([DEFAULT])
10803 # ----------------
10804 # Minimum version: 1.6.0
10805 # Minimum version for optional DEFAULT argument: 1.11.0
10806 #
10807 # Documentation tools are not always available on all platforms and sometimes
10808 # not at the appropriate level. This macro enables a module to test for the
10809 # presence of the tool and obtain it's path in separate variables. Coupled with
10810 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10811 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10812 # --with-ps2pdf assumes 'auto'.
10813 #
10814 # Interface to module:
10815 # HAVE_PS2PDF:  used in makefiles to conditionally generate documentation
10816 # PS2PDF:       returns the path of the ps2pdf program found
10817 #               returns the path set by the user in the environment
10818 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10819 #                'no' user instructs the module not to use ps2pdf
10820 #
10821 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10822 #
10823 AC_DEFUN([XORG_WITH_PS2PDF],[
10824 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10825 m4_define([_defopt], m4_default([$1], [auto]))
10826 AC_ARG_WITH(ps2pdf,
10827         AS_HELP_STRING([--with-ps2pdf],
10828            [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10829            [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10830 m4_undefine([_defopt])
10831
10832 if test "x$use_ps2pdf" = x"auto"; then
10833    AC_PATH_PROG([PS2PDF], [ps2pdf])
10834    if test "x$PS2PDF" = "x"; then
10835         AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10836         have_ps2pdf=no
10837    else
10838         have_ps2pdf=yes
10839    fi
10840 elif test "x$use_ps2pdf" = x"yes" ; then
10841    AC_PATH_PROG([PS2PDF], [ps2pdf])
10842    if test "x$PS2PDF" = "x"; then
10843         AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10844    fi
10845    have_ps2pdf=yes
10846 elif test "x$use_ps2pdf" = x"no" ; then
10847    if test "x$PS2PDF" != "x"; then
10848       AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10849    fi
10850    have_ps2pdf=no
10851 else
10852    AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10853 fi
10854 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10855 ]) # XORG_WITH_PS2PDF
10856
10857 # XORG_ENABLE_DOCS (enable_docs=yes)
10858 # ----------------
10859 # Minimum version: 1.6.0
10860 #
10861 # Documentation tools are not always available on all platforms and sometimes
10862 # not at the appropriate level. This macro enables a builder to skip all
10863 # documentation targets except traditional man pages.
10864 # Combined with the specific tool checking macros XORG_WITH_*, it provides
10865 # maximum flexibilty in controlling documentation building.
10866 # Refer to:
10867 # XORG_WITH_XMLTO         --with-xmlto
10868 # XORG_WITH_ASCIIDOC      --with-asciidoc
10869 # XORG_WITH_DOXYGEN       --with-doxygen
10870 # XORG_WITH_FOP           --with-fop
10871 # XORG_WITH_GROFF         --with-groff
10872 # XORG_WITH_PS2PDF        --with-ps2pdf
10873 #
10874 # Interface to module:
10875 # ENABLE_DOCS:    used in makefiles to conditionally generate documentation
10876 # --enable-docs: 'yes' user instructs the module to generate docs
10877 #                'no' user instructs the module not to generate docs
10878 # parm1:        specify the default value, yes or no.
10879 #
10880 AC_DEFUN([XORG_ENABLE_DOCS],[
10881 m4_define([docs_default], m4_default([$1], [yes]))
10882 AC_ARG_ENABLE(docs,
10883         AS_HELP_STRING([--enable-docs],
10884            [Enable building the documentation (default: ]docs_default[)]),
10885            [build_docs=$enableval], [build_docs=]docs_default)
10886 m4_undefine([docs_default])
10887 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10888 AC_MSG_CHECKING([whether to build documentation])
10889 AC_MSG_RESULT([$build_docs])
10890 ]) # XORG_ENABLE_DOCS
10891
10892 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10893 # ----------------
10894 # Minimum version: 1.6.0
10895 #
10896 # This macro enables a builder to skip all developer documentation.
10897 # Combined with the specific tool checking macros XORG_WITH_*, it provides
10898 # maximum flexibilty in controlling documentation building.
10899 # Refer to:
10900 # XORG_WITH_XMLTO         --with-xmlto
10901 # XORG_WITH_ASCIIDOC      --with-asciidoc
10902 # XORG_WITH_DOXYGEN       --with-doxygen
10903 # XORG_WITH_FOP           --with-fop
10904 # XORG_WITH_GROFF         --with-groff
10905 # XORG_WITH_PS2PDF        --with-ps2pdf
10906 #
10907 # Interface to module:
10908 # ENABLE_DEVEL_DOCS:    used in makefiles to conditionally generate developer docs
10909 # --enable-devel-docs:  'yes' user instructs the module to generate developer docs
10910 #                       'no' user instructs the module not to generate developer docs
10911 # parm1:                specify the default value, yes or no.
10912 #
10913 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10914 m4_define([devel_default], m4_default([$1], [yes]))
10915 AC_ARG_ENABLE(devel-docs,
10916         AS_HELP_STRING([--enable-devel-docs],
10917            [Enable building the developer documentation (default: ]devel_default[)]),
10918            [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10919 m4_undefine([devel_default])
10920 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10921 AC_MSG_CHECKING([whether to build developer documentation])
10922 AC_MSG_RESULT([$build_devel_docs])
10923 ]) # XORG_ENABLE_DEVEL_DOCS
10924
10925 # XORG_ENABLE_SPECS (enable_specs=yes)
10926 # ----------------
10927 # Minimum version: 1.6.0
10928 #
10929 # This macro enables a builder to skip all functional specification targets.
10930 # Combined with the specific tool checking macros XORG_WITH_*, it provides
10931 # maximum flexibilty in controlling documentation building.
10932 # Refer to:
10933 # XORG_WITH_XMLTO         --with-xmlto
10934 # XORG_WITH_ASCIIDOC      --with-asciidoc
10935 # XORG_WITH_DOXYGEN       --with-doxygen
10936 # XORG_WITH_FOP           --with-fop
10937 # XORG_WITH_GROFF         --with-groff
10938 # XORG_WITH_PS2PDF        --with-ps2pdf
10939 #
10940 # Interface to module:
10941 # ENABLE_SPECS:         used in makefiles to conditionally generate specs
10942 # --enable-specs:       'yes' user instructs the module to generate specs
10943 #                       'no' user instructs the module not to generate specs
10944 # parm1:                specify the default value, yes or no.
10945 #
10946 AC_DEFUN([XORG_ENABLE_SPECS],[
10947 m4_define([spec_default], m4_default([$1], [yes]))
10948 AC_ARG_ENABLE(specs,
10949         AS_HELP_STRING([--enable-specs],
10950            [Enable building the specs (default: ]spec_default[)]),
10951            [build_specs=$enableval], [build_specs=]spec_default)
10952 m4_undefine([spec_default])
10953 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10954 AC_MSG_CHECKING([whether to build functional specifications])
10955 AC_MSG_RESULT([$build_specs])
10956 ]) # XORG_ENABLE_SPECS
10957
10958 # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10959 # ----------------------------------------------
10960 # Minimum version: 1.13.0
10961 #
10962 # This macro enables a builder to enable/disable unit testing
10963 # It makes no assumption about the test cases implementation
10964 # Test cases may or may not use Automake "Support for test suites"
10965 # They may or may not use the software utility library GLib
10966 #
10967 # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10968 # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10969 # The variable enable_unit_tests is used by other macros in this file.
10970 #
10971 # Interface to module:
10972 # ENABLE_UNIT_TESTS:    used in makefiles to conditionally build tests
10973 # enable_unit_tests:    used in configure.ac for additional configuration
10974 # --enable-unit-tests:  'yes' user instructs the module to build tests
10975 #                       'no' user instructs the module not to build tests
10976 # parm1:                specify the default value, yes or no.
10977 #
10978 AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10979 AC_BEFORE([$0], [XORG_WITH_GLIB])
10980 AC_BEFORE([$0], [XORG_LD_WRAP])
10981 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10982 m4_define([_defopt], m4_default([$1], [auto]))
10983 AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10984         [Enable building unit test cases (default: ]_defopt[)]),
10985         [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10986 m4_undefine([_defopt])
10987 AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10988 AC_MSG_CHECKING([whether to build unit test cases])
10989 AC_MSG_RESULT([$enable_unit_tests])
10990 ]) # XORG_ENABLE_UNIT_TESTS
10991
10992 # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10993 # ------------------------------------------------------
10994 # Minimum version: 1.17.0
10995 #
10996 # This macro enables a builder to enable/disable integration testing
10997 # It makes no assumption about the test cases' implementation
10998 # Test cases may or may not use Automake "Support for test suites"
10999 #
11000 # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
11001 # usually requires less dependencies and may be built and run under less
11002 # stringent environments than integration tests.
11003 #
11004 # Interface to module:
11005 # ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
11006 # enable_integration_tests:   used in configure.ac for additional configuration
11007 # --enable-integration-tests: 'yes' user instructs the module to build tests
11008 #                             'no' user instructs the module not to build tests
11009 # parm1:                      specify the default value, yes or no.
11010 #
11011 AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
11012 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
11013 m4_define([_defopt], m4_default([$1], [auto]))
11014 AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
11015         [Enable building integration test cases (default: ]_defopt[)]),
11016         [enable_integration_tests=$enableval],
11017         [enable_integration_tests=]_defopt)
11018 m4_undefine([_defopt])
11019 AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
11020         [test "x$enable_integration_tests" != xno])
11021 AC_MSG_CHECKING([whether to build unit test cases])
11022 AC_MSG_RESULT([$enable_integration_tests])
11023 ]) # XORG_ENABLE_INTEGRATION_TESTS
11024
11025 # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
11026 # ----------------------------------------
11027 # Minimum version: 1.13.0
11028 #
11029 # GLib is a library which provides advanced data structures and functions.
11030 # This macro enables a module to test for the presence of Glib.
11031 #
11032 # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
11033 # Otherwise the value of $enable_unit_tests is blank.
11034 #
11035 # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
11036 # test support usually requires less dependencies and may be built and run under
11037 # less stringent environments than integration tests.
11038 #
11039 # Interface to module:
11040 # HAVE_GLIB: used in makefiles to conditionally build targets
11041 # with_glib: used in configure.ac to know if GLib has been found
11042 # --with-glib:  'yes' user instructs the module to use glib
11043 #               'no' user instructs the module not to use glib
11044 #
11045 AC_DEFUN([XORG_WITH_GLIB],[
11046 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11047 m4_define([_defopt], m4_default([$2], [auto]))
11048 AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
11049         [Use GLib library for unit testing (default: ]_defopt[)]),
11050         [with_glib=$withval], [with_glib=]_defopt)
11051 m4_undefine([_defopt])
11052
11053 have_glib=no
11054 # Do not probe GLib if user explicitly disabled unit testing
11055 if test "x$enable_unit_tests" != x"no"; then
11056   # Do not probe GLib if user explicitly disabled it
11057   if test "x$with_glib" != x"no"; then
11058     m4_ifval(
11059       [$1],
11060       [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
11061       [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
11062     )
11063   fi
11064 fi
11065
11066 # Not having GLib when unit testing has been explicitly requested is an error
11067 if test "x$enable_unit_tests" = x"yes"; then
11068   if test "x$have_glib" = x"no"; then
11069     AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11070   fi
11071 fi
11072
11073 # Having unit testing disabled when GLib has been explicitly requested is an error
11074 if test "x$enable_unit_tests" = x"no"; then
11075   if test "x$with_glib" = x"yes"; then
11076     AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11077   fi
11078 fi
11079
11080 # Not having GLib when it has been explicitly requested is an error
11081 if test "x$with_glib" = x"yes"; then
11082   if test "x$have_glib" = x"no"; then
11083     AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
11084   fi
11085 fi
11086
11087 AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
11088 ]) # XORG_WITH_GLIB
11089
11090 # XORG_LD_WRAP([required|optional])
11091 # ---------------------------------
11092 # Minimum version: 1.13.0
11093 #
11094 # Check if linker supports -wrap, passed via compiler flags
11095 #
11096 # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
11097 # Otherwise the value of $enable_unit_tests is blank.
11098 #
11099 # Argument added in 1.16.0 - default is "required", to match existing behavior
11100 # of returning an error if enable_unit_tests is yes, and ld -wrap is not
11101 # available, an argument of "optional" allows use when some unit tests require
11102 # ld -wrap and others do not.
11103 #
11104 AC_DEFUN([XORG_LD_WRAP],[
11105 XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
11106     [AC_LANG_PROGRAM([#include <stdlib.h>
11107                       void __wrap_exit(int status) { return; }],
11108                      [exit(0);])])
11109 # Not having ld wrap when unit testing has been explicitly requested is an error
11110 if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
11111   if test "x$have_ld_wrap" = x"no"; then
11112     AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
11113   fi
11114 fi
11115 AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
11116 #
11117 ]) # XORG_LD_WRAP
11118
11119 # XORG_CHECK_LINKER_FLAGS
11120 # -----------------------
11121 # SYNOPSIS
11122 #
11123 #   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
11124 #
11125 # DESCRIPTION
11126 #
11127 #   Check whether the given linker FLAGS work with the current language's
11128 #   linker, or whether they give an error.
11129 #
11130 #   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
11131 #   success/failure.
11132 #
11133 #   PROGRAM-SOURCE is the program source to link with, if needed
11134 #
11135 #   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
11136 #
11137 # LICENSE
11138 #
11139 #   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
11140 #   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
11141 #   Copyright (c) 2009 Matteo Frigo
11142 #
11143 #   This program is free software: you can redistribute it and/or modify it
11144 #   under the terms of the GNU General Public License as published by the
11145 #   Free Software Foundation, either version 3 of the License, or (at your
11146 #   option) any later version.
11147 #
11148 #   This program is distributed in the hope that it will be useful, but
11149 #   WITHOUT ANY WARRANTY; without even the implied warranty of
11150 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11151 #   Public License for more details.
11152 #
11153 #   You should have received a copy of the GNU General Public License along
11154 #   with this program. If not, see <http://www.gnu.org/licenses/>.
11155 #
11156 #   As a special exception, the respective Autoconf Macro's copyright owner
11157 #   gives unlimited permission to copy, distribute and modify the configure
11158 #   scripts that are the output of Autoconf when processing the Macro. You
11159 #   need not follow the terms of the GNU General Public License when using
11160 #   or distributing such scripts, even though portions of the text of the
11161 #   Macro appear in them. The GNU General Public License (GPL) does govern
11162 #   all other use of the material that constitutes the Autoconf Macro.
11163 #
11164 #   This special exception to the GPL applies to versions of the Autoconf
11165 #   Macro released by the Autoconf Archive. When you make and distribute a
11166 #   modified version of the Autoconf Macro, you may extend this special
11167 #   exception to the GPL to apply to your modified version as well.#
11168 AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11169 [AC_MSG_CHECKING([whether the linker accepts $1])
11170 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11171 AS_LITERAL_IF([$1],
11172   [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11173       ax_save_FLAGS=$LDFLAGS
11174       LDFLAGS="$1"
11175       AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11176         AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11177         AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11178       LDFLAGS=$ax_save_FLAGS])],
11179   [ax_save_FLAGS=$LDFLAGS
11180    LDFLAGS="$1"
11181    AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11182      eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11183      eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11184    LDFLAGS=$ax_save_FLAGS])
11185 eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11186 AC_MSG_RESULT($xorg_check_linker_flags)
11187 if test "x$xorg_check_linker_flags" = xyes; then
11188         m4_default([$2], :)
11189 else
11190         m4_default([$3], :)
11191 fi
11192 ]) # XORG_CHECK_LINKER_FLAGS
11193
11194 # XORG_MEMORY_CHECK_FLAGS
11195 # -----------------------
11196 # Minimum version: 1.16.0
11197 #
11198 # This macro attempts to find appropriate memory checking functionality
11199 # for various platforms which unit testing code may use to catch various
11200 # forms of memory allocation and access errors in testing.
11201 #
11202 # Interface to module:
11203 # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11204 #                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11205 #
11206 # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11207 #
11208 AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11209
11210 AC_REQUIRE([AC_CANONICAL_HOST])
11211 AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11212            [Environment variables to enable memory checking in tests])
11213
11214 # Check for different types of support on different platforms
11215 case $host_os in
11216     solaris*)
11217         AC_CHECK_LIB([umem], [umem_alloc],
11218             [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11219         ;;
11220     *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11221         # both directly and inverted, so should not be 0 or 255.
11222         malloc_debug_env='MALLOC_PERTURB_=15'
11223         ;;
11224     darwin*)
11225         malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11226         ;;
11227     *bsd*)
11228         malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11229         ;;
11230 esac
11231
11232 # User supplied flags override default flags
11233 if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11234     malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11235 fi
11236
11237 AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11238 ]) # XORG_WITH_LINT
11239
11240 # XORG_CHECK_MALLOC_ZERO
11241 # ----------------------
11242 # Minimum version: 1.0.0
11243 #
11244 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11245 # malloc(0) returns NULL.  Packages should add one of these cflags to
11246 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11247 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11248 AC_ARG_ENABLE(malloc0returnsnull,
11249         AS_HELP_STRING([--enable-malloc0returnsnull],
11250                        [malloc(0) returns NULL (default: auto)]),
11251         [MALLOC_ZERO_RETURNS_NULL=$enableval],
11252         [MALLOC_ZERO_RETURNS_NULL=auto])
11253
11254 AC_MSG_CHECKING([whether malloc(0) returns NULL])
11255 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11256 AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
11257         [AC_RUN_IFELSE([AC_LANG_PROGRAM([
11258 #include <stdlib.h>
11259 ],[
11260     char *m0, *r0, *c0, *p;
11261     m0 = malloc(0);
11262     p = malloc(10);
11263     r0 = realloc(p,0);
11264     c0 = calloc(0,10);
11265     exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11266 ])],
11267                 [xorg_cv_malloc0_returns_null=yes],
11268                 [xorg_cv_malloc0_returns_null=no])])
11269 MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
11270 fi
11271 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11272
11273 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11274         MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11275         XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11276         XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11277 else
11278         MALLOC_ZERO_CFLAGS=""
11279         XMALLOC_ZERO_CFLAGS=""
11280         XTMALLOC_ZERO_CFLAGS=""
11281 fi
11282
11283 AC_SUBST([MALLOC_ZERO_CFLAGS])
11284 AC_SUBST([XMALLOC_ZERO_CFLAGS])
11285 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
11286 ]) # XORG_CHECK_MALLOC_ZERO
11287
11288 # XORG_WITH_LINT()
11289 # ----------------
11290 # Minimum version: 1.1.0
11291 #
11292 # This macro enables the use of a tool that flags some suspicious and
11293 # non-portable constructs (likely to be bugs) in C language source code.
11294 # It will attempt to locate the tool and use appropriate options.
11295 # There are various lint type tools on different platforms.
11296 #
11297 # Interface to module:
11298 # LINT:         returns the path to the tool found on the platform
11299 #               or the value set to LINT on the configure cmd line
11300 #               also an Automake conditional
11301 # LINT_FLAGS:   an Automake variable with appropriate flags
11302 #
11303 # --with-lint:  'yes' user instructs the module to use lint
11304 #               'no' user instructs the module not to use lint (default)
11305 #
11306 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11307 # If the user sets the value of LINT_FLAGS, they are used verbatim.
11308 #
11309 AC_DEFUN([XORG_WITH_LINT],[
11310
11311 AC_ARG_VAR([LINT], [Path to a lint-style command])
11312 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11313 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11314                 [Use a lint-style source code checker (default: disabled)])],
11315                 [use_lint=$withval], [use_lint=no])
11316
11317 # Obtain platform specific info like program name and options
11318 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
11319 case $host_os in
11320   *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11321         lint_name=splint
11322         lint_options="-badflag"
11323         ;;
11324   *freebsd* | *netbsd*)
11325         lint_name=lint
11326         lint_options="-u -b"
11327         ;;
11328   *solaris*)
11329         lint_name=lint
11330         lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11331         ;;
11332 esac
11333
11334 # Test for the presence of the program (either guessed by the code or spelled out by the user)
11335 if test "x$use_lint" = x"yes" ; then
11336    AC_PATH_PROG([LINT], [$lint_name])
11337    if test "x$LINT" = "x"; then
11338         AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11339    fi
11340 elif test "x$use_lint" = x"no" ; then
11341    if test "x$LINT" != "x"; then
11342       AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11343    fi
11344 else
11345    AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11346 fi
11347
11348 # User supplied flags override default flags
11349 if test "x$LINT_FLAGS" != "x"; then
11350    lint_options=$LINT_FLAGS
11351 fi
11352
11353 AC_SUBST([LINT_FLAGS],[$lint_options])
11354 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
11355
11356 ]) # XORG_WITH_LINT
11357
11358 # XORG_LINT_LIBRARY(LIBNAME)
11359 # --------------------------
11360 # Minimum version: 1.1.0
11361 #
11362 # Sets up flags for building lint libraries for checking programs that call
11363 # functions in the library.
11364 #
11365 # Interface to module:
11366 # LINTLIB               - Automake variable with the name of lint library file to make
11367 # MAKE_LINT_LIB         - Automake conditional
11368 #
11369 # --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11370 #                         - 'no' user instructs the module not to create a lint library (default)
11371
11372 AC_DEFUN([XORG_LINT_LIBRARY],[
11373 AC_REQUIRE([XORG_WITH_LINT])
11374 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11375         [Create lint library (default: disabled)])],
11376         [make_lint_lib=$enableval], [make_lint_lib=no])
11377
11378 if test "x$make_lint_lib" = x"yes" ; then
11379    LINTLIB=llib-l$1.ln
11380    if test "x$LINT" = "x"; then
11381         AC_MSG_ERROR([Cannot make lint library without --with-lint])
11382    fi
11383 elif test "x$make_lint_lib" != x"no" ; then
11384    AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11385 fi
11386
11387 AC_SUBST(LINTLIB)
11388 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11389
11390 ]) # XORG_LINT_LIBRARY
11391
11392 # XORG_COMPILER_BRAND
11393 # -------------------
11394 # Minimum version: 1.14.0
11395 #
11396 # Checks for various brands of compilers and sets flags as appropriate:
11397 #   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11398 #   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11399 #   clang compiler - sets CLANGCC to "yes"
11400 #   Intel compiler - sets INTELCC to "yes"
11401 #   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11402 #
11403 AC_DEFUN([XORG_COMPILER_BRAND], [
11404 AC_LANG_CASE(
11405         [C], [
11406                 AC_REQUIRE([AC_PROG_CC_C99])
11407         ],
11408         [C++], [
11409                 AC_REQUIRE([AC_PROG_CXX])
11410         ]
11411 )
11412 AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11413 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11414 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11415 ]) # XORG_COMPILER_BRAND
11416
11417 # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11418 # ---------------
11419 # Minimum version: 1.16.0
11420 #
11421 # Test if the compiler works when passed the given flag as a command line argument.
11422 # If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11423 # next flag in the list until there are no more options.
11424 #
11425 # Note that this does not guarantee that the compiler supports the flag as some
11426 # compilers will simply ignore arguments that they do not understand, but we do
11427 # attempt to weed out false positives by using -Werror=unknown-warning-option and
11428 # -Werror=unused-command-line-argument
11429 #
11430 AC_DEFUN([XORG_TESTSET_CFLAG], [
11431 m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11432 m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11433
11434 AC_LANG_COMPILER_REQUIRE
11435
11436 AC_LANG_CASE(
11437         [C], [
11438                 AC_REQUIRE([AC_PROG_CC_C99])
11439                 define([PREFIX], [C])
11440                 define([CACHE_PREFIX], [cc])
11441                 define([COMPILER], [$CC])
11442         ],
11443         [C++], [
11444                 define([PREFIX], [CXX])
11445                 define([CACHE_PREFIX], [cxx])
11446                 define([COMPILER], [$CXX])
11447         ]
11448 )
11449
11450 [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11451
11452 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11453         PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11454         AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11455                         [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11456                         AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11457                                           [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11458                                           [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11459         [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11460         PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11461 fi
11462
11463 if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11464         if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11465                 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11466         fi
11467         PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11468         AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11469                         [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11470                         AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11471                                           [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11472                                           [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11473         [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11474         PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11475 fi
11476
11477 found="no"
11478 m4_foreach([flag], m4_cdr($@), [
11479         if test $found = "no" ; then
11480                 if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
11481                         PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11482                 fi
11483
11484                 if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
11485                         PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11486                 fi
11487
11488                 PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11489
11490 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11491                 AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11492                 cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11493                 AC_CACHE_VAL($cacheid,
11494                              [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11495                                              [eval $cacheid=yes],
11496                                              [eval $cacheid=no])])
11497
11498                 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11499
11500                 eval supported=\$$cacheid
11501                 AC_MSG_RESULT([$supported])
11502                 if test "$supported" = "yes" ; then
11503                         $1="$$1 ]flag["
11504                         found="yes"
11505                 fi
11506         fi
11507 ])
11508 ]) # XORG_TESTSET_CFLAG
11509
11510 # XORG_COMPILER_FLAGS
11511 # ---------------
11512 # Minimum version: 1.16.0
11513 #
11514 # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11515 # arguments supported by the selected compiler which do NOT alter the generated
11516 # code.  These arguments will cause the compiler to print various warnings
11517 # during compilation AND turn a conservative set of warnings into errors.
11518 #
11519 # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11520 # future versions of util-macros as options are added to new compilers.
11521 #
11522 AC_DEFUN([XORG_COMPILER_FLAGS], [
11523 AC_REQUIRE([XORG_COMPILER_BRAND])
11524
11525 AC_ARG_ENABLE(selective-werror,
11526               AS_HELP_STRING([--disable-selective-werror],
11527                              [Turn off selective compiler errors. (default: enabled)]),
11528               [SELECTIVE_WERROR=$enableval],
11529               [SELECTIVE_WERROR=yes])
11530
11531 AC_LANG_CASE(
11532         [C], [
11533                 define([PREFIX], [C])
11534         ],
11535         [C++], [
11536                 define([PREFIX], [CXX])
11537         ]
11538 )
11539 # -v is too short to test reliably with XORG_TESTSET_CFLAG
11540 if test "x$SUNCC" = "xyes"; then
11541     [BASE_]PREFIX[FLAGS]="-v"
11542 else
11543     [BASE_]PREFIX[FLAGS]=""
11544 fi
11545
11546 # This chunk of warnings were those that existed in the legacy CWARNFLAGS
11547 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11548 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11549 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11550 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11551
11552 AC_LANG_CASE(
11553         [C], [
11554                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11555                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11556                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11557                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11558                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
11559                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11560         ]
11561 )
11562
11563 # This chunk adds additional warnings that could catch undesired effects.
11564 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11565 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11566 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11567 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11568 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11569 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11570 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11571
11572 # These are currently disabled because they are noisy.  They will be enabled
11573 # in the future once the codebase is sufficiently modernized to silence
11574 # them.  For now, I don't want them to drown out the other warnings.
11575 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11576 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11577 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11578
11579 # Turn some warnings into errors, so we don't accidently get successful builds
11580 # when there are problems that should be fixed.
11581
11582 if test "x$SELECTIVE_WERROR" = "xyes" ; then
11583 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11584 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11585 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11586 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11587 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11588 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11589 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11590 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11591 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11592 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11593 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11594 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11595 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11596 else
11597 AC_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])
11598 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11599 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11600 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11601 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11602 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11603 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11604 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11605 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11606 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11607 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11608 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11609 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11610 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11611 fi
11612
11613 AC_SUBST([BASE_]PREFIX[FLAGS])
11614 ]) # XORG_COMPILER_FLAGS
11615
11616 # XORG_CWARNFLAGS
11617 # ---------------
11618 # Minimum version: 1.2.0
11619 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11620 #
11621 # Defines CWARNFLAGS to enable C compiler warnings.
11622 #
11623 # This function is deprecated because it defines -fno-strict-aliasing
11624 # which alters the code generated by the compiler.  If -fno-strict-aliasing
11625 # is needed, then it should be added explicitly in the module when
11626 # it is updated to use BASE_CFLAGS.
11627 #
11628 AC_DEFUN([XORG_CWARNFLAGS], [
11629 AC_REQUIRE([XORG_COMPILER_FLAGS])
11630 AC_REQUIRE([XORG_COMPILER_BRAND])
11631 AC_LANG_CASE(
11632         [C], [
11633                 CWARNFLAGS="$BASE_CFLAGS"
11634                 if  test "x$GCC" = xyes ; then
11635                     CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11636                 fi
11637                 AC_SUBST(CWARNFLAGS)
11638         ]
11639 )
11640 ]) # XORG_CWARNFLAGS
11641
11642 # XORG_STRICT_OPTION
11643 # -----------------------
11644 # Minimum version: 1.3.0
11645 #
11646 # Add configure option to enable strict compilation flags, such as treating
11647 # warnings as fatal errors.
11648 # If --enable-strict-compilation is passed to configure, adds strict flags to
11649 # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11650 #
11651 # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11652 # when strict compilation is unconditionally desired.
11653 AC_DEFUN([XORG_STRICT_OPTION], [
11654 AC_REQUIRE([XORG_CWARNFLAGS])
11655 AC_REQUIRE([XORG_COMPILER_FLAGS])
11656
11657 AC_ARG_ENABLE(strict-compilation,
11658                           AS_HELP_STRING([--enable-strict-compilation],
11659                           [Enable all warnings from compiler and make them errors (default: disabled)]),
11660                           [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11661
11662 AC_LANG_CASE(
11663         [C], [
11664                 define([PREFIX], [C])
11665         ],
11666         [C++], [
11667                 define([PREFIX], [CXX])
11668         ]
11669 )
11670
11671 [STRICT_]PREFIX[FLAGS]=""
11672 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11673 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11674
11675 # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11676 # activate it with -Werror, so we add it here explicitly.
11677 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11678
11679 if test "x$STRICT_COMPILE" = "xyes"; then
11680     [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11681     AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11682 fi
11683 AC_SUBST([STRICT_]PREFIX[FLAGS])
11684 AC_SUBST([BASE_]PREFIX[FLAGS])
11685 AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11686 ]) # XORG_STRICT_OPTION
11687
11688 # XORG_DEFAULT_OPTIONS
11689 # --------------------
11690 # Minimum version: 1.3.0
11691 #
11692 # Defines default options for X.Org modules.
11693 #
11694 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11695 AC_REQUIRE([AC_PROG_INSTALL])
11696 XORG_COMPILER_FLAGS
11697 XORG_CWARNFLAGS
11698 XORG_STRICT_OPTION
11699 XORG_RELEASE_VERSION
11700 XORG_CHANGELOG
11701 XORG_INSTALL
11702 XORG_MANPAGE_SECTIONS
11703 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11704     [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11705 ]) # XORG_DEFAULT_OPTIONS
11706
11707 # XORG_INSTALL()
11708 # ----------------
11709 # Minimum version: 1.4.0
11710 #
11711 # Defines the variable INSTALL_CMD as the command to copy
11712 # INSTALL from $prefix/share/util-macros.
11713 #
11714 AC_DEFUN([XORG_INSTALL], [
11715 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11716 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11717 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11718 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11719 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11720 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11721 AC_SUBST([INSTALL_CMD])
11722 ]) # XORG_INSTALL
11723 dnl Copyright 2005 Red Hat, Inc
11724 dnl
11725 dnl Permission to use, copy, modify, distribute, and sell this software and its
11726 dnl documentation for any purpose is hereby granted without fee, provided that
11727 dnl the above copyright notice appear in all copies and that both that
11728 dnl copyright notice and this permission notice appear in supporting
11729 dnl documentation.
11730 dnl
11731 dnl The above copyright notice and this permission notice shall be included
11732 dnl in all copies or substantial portions of the Software.
11733 dnl
11734 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11735 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11736 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11737 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11738 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11739 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11740 dnl OTHER DEALINGS IN THE SOFTWARE.
11741 dnl
11742 dnl Except as contained in this notice, the name of the copyright holders shall
11743 dnl not be used in advertising or otherwise to promote the sale, use or
11744 dnl other dealings in this Software without prior written authorization
11745 dnl from the copyright holders.
11746 dnl
11747
11748 # XORG_RELEASE_VERSION
11749 # --------------------
11750 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11751
11752 AC_DEFUN([XORG_RELEASE_VERSION],[
11753         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11754                 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
11755                 [Major version of this package])
11756         PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11757         if test "x$PVM" = "x"; then
11758                 PVM="0"
11759         fi
11760         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11761                 [$PVM],
11762                 [Minor version of this package])
11763         PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11764         if test "x$PVP" = "x"; then
11765                 PVP="0"
11766         fi
11767         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11768                 [$PVP],
11769                 [Patch version of this package])
11770 ])
11771
11772 # XORG_CHANGELOG()
11773 # ----------------
11774 # Minimum version: 1.2.0
11775 #
11776 # Defines the variable CHANGELOG_CMD as the command to generate
11777 # ChangeLog from git.
11778 #
11779 #
11780 AC_DEFUN([XORG_CHANGELOG], [
11781 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11782 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11783 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11784 echo 'git directory not found: installing possibly empty changelog.' >&2)"
11785 AC_SUBST([CHANGELOG_CMD])
11786 ]) # XORG_CHANGELOG
11787