Add multi-lib support
[platform/upstream/libXinerama.git] / aclocal.m4
1 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
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_AUTOCONF_VERSION],
15   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17 [m4_warning([this file was generated for autoconf 2.68.
18 You have another version of autoconf.  It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23 #
24 # This file is free software; the Free Software Foundation
25 # gives unlimited permission to copy and/or distribute it,
26 # with or without modifications, as long as this notice is preserved.
27
28 # AM_AUTOMAKE_VERSION(VERSION)
29 # ----------------------------
30 # Automake X.Y traces this macro to ensure aclocal.m4 has been
31 # generated from the m4 files accompanying Automake X.Y.
32 # (This private macro should not be called outside this file.)
33 AC_DEFUN([AM_AUTOMAKE_VERSION],
34 [am__api_version='1.11'
35 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36 dnl require some minimum version.  Point them to the right macro.
37 m4_if([$1], [1.11.1], [],
38       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39 ])
40
41 # _AM_AUTOCONF_VERSION(VERSION)
42 # -----------------------------
43 # aclocal traces this macro to find the Autoconf version.
44 # This is a private macro too.  Using m4_define simplifies
45 # the logic in aclocal, which can simply ignore this definition.
46 m4_define([_AM_AUTOCONF_VERSION], [])
47
48 # AM_SET_CURRENT_AUTOMAKE_VERSION
49 # -------------------------------
50 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53 [AM_AUTOMAKE_VERSION([1.11.1])dnl
54 m4_ifndef([AC_AUTOCONF_VERSION],
55   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57
58 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59
60 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61 #
62 # This file is free software; the Free Software Foundation
63 # gives unlimited permission to copy and/or distribute it,
64 # with or without modifications, as long as this notice is preserved.
65
66 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69 #
70 # Of course, Automake must honor this variable whenever it calls a
71 # tool from the auxiliary directory.  The problem is that $srcdir (and
72 # therefore $ac_aux_dir as well) can be either absolute or relative,
73 # depending on how configure is run.  This is pretty annoying, since
74 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
75 # source directory, any form will work fine, but in subdirectories a
76 # relative path needs to be adjusted first.
77 #
78 # $ac_aux_dir/missing
79 #    fails when called from a subdirectory if $ac_aux_dir is relative
80 # $top_srcdir/$ac_aux_dir/missing
81 #    fails if $ac_aux_dir is absolute,
82 #    fails when called from a subdirectory in a VPATH build with
83 #          a relative $ac_aux_dir
84 #
85 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86 # are both prefixed by $srcdir.  In an in-source build this is usually
87 # harmless because $srcdir is `.', but things will broke when you
88 # start a VPATH build or use an absolute $srcdir.
89 #
90 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93 # and then we would define $MISSING as
94 #   MISSING="\${SHELL} $am_aux_dir/missing"
95 # This will work as long as MISSING is not called from configure, because
96 # unfortunately $(top_srcdir) has no meaning in configure.
97 # However there are other variables, like CC, which are often used in
98 # configure, and could therefore not use this "fixed" $ac_aux_dir.
99 #
100 # Another solution, used here, is to always expand $ac_aux_dir to an
101 # absolute PATH.  The drawback is that using absolute paths prevent a
102 # configured tree to be moved without reconfiguration.
103
104 AC_DEFUN([AM_AUX_DIR_EXPAND],
105 [dnl Rely on autoconf to set up CDPATH properly.
106 AC_PREREQ([2.50])dnl
107 # expand $ac_aux_dir to an absolute path
108 am_aux_dir=`cd $ac_aux_dir && pwd`
109 ])
110
111 # AM_CONDITIONAL                                            -*- Autoconf -*-
112
113 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114 # 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 # serial 9
121
122 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
123 # -------------------------------------
124 # Define a conditional.
125 AC_DEFUN([AM_CONDITIONAL],
126 [AC_PREREQ(2.52)dnl
127  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129 AC_SUBST([$1_TRUE])dnl
130 AC_SUBST([$1_FALSE])dnl
131 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
132 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
133 m4_define([_AM_COND_VALUE_$1], [$2])dnl
134 if $2; then
135   $1_TRUE=
136   $1_FALSE='#'
137 else
138   $1_TRUE='#'
139   $1_FALSE=
140 fi
141 AC_CONFIG_COMMANDS_PRE(
142 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143   AC_MSG_ERROR([[conditional "$1" was never defined.
144 Usually this means the macro was only invoked conditionally.]])
145 fi])])
146
147 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148 # Free Software Foundation, Inc.
149 #
150 # This file is free software; the Free Software Foundation
151 # gives unlimited permission to copy and/or distribute it,
152 # with or without modifications, as long as this notice is preserved.
153
154 # serial 10
155
156 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157 # written in clear, in which case automake, when reading aclocal.m4,
158 # will think it sees a *use*, and therefore will trigger all it's
159 # C support machinery.  Also note that it means that autoscan, seeing
160 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161
162
163 # _AM_DEPENDENCIES(NAME)
164 # ----------------------
165 # See how the compiler implements dependency checking.
166 # NAME is "CC", "CXX", "GCJ", or "OBJC".
167 # We try a few techniques and use that to set a single cache variable.
168 #
169 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171 # dependency, and given that the user is not expected to run this macro,
172 # just rely on AC_PROG_CC.
173 AC_DEFUN([_AM_DEPENDENCIES],
174 [AC_REQUIRE([AM_SET_DEPDIR])dnl
175 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
177 AC_REQUIRE([AM_DEP_TRACK])dnl
178
179 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184                    [depcc="$$1"   am_compiler_list=])
185
186 AC_CACHE_CHECK([dependency style of $depcc],
187                [am_cv_$1_dependencies_compiler_type],
188 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189   # We make a subdir and do the tests there.  Otherwise we can end up
190   # making bogus files that we don't know about and never remove.  For
191   # instance it was reported that on HP-UX the gcc test will end up
192   # making a dummy file named `D' -- because `-MD' means `put the output
193   # in D'.
194   mkdir conftest.dir
195   # Copy depcomp to subdir because otherwise we won't find it if we're
196   # using a relative directory.
197   cp "$am_depcomp" conftest.dir
198   cd conftest.dir
199   # We will build objects and dependencies in a subdirectory because
200   # it helps to detect inapplicable dependency modes.  For instance
201   # both Tru64's cc and ICC support -MD to output dependencies as a
202   # side effect of compilation, but ICC will put the dependencies in
203   # the current directory while Tru64 will put them in the object
204   # directory.
205   mkdir sub
206
207   am_cv_$1_dependencies_compiler_type=none
208   if test "$am_compiler_list" = ""; then
209      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210   fi
211   am__universal=false
212   m4_case([$1], [CC],
213     [case " $depcc " in #(
214      *\ -arch\ *\ -arch\ *) am__universal=true ;;
215      esac],
216     [CXX],
217     [case " $depcc " in #(
218      *\ -arch\ *\ -arch\ *) am__universal=true ;;
219      esac])
220
221   for depmode in $am_compiler_list; do
222     # Setup a source with many dependencies, because some compilers
223     # like to wrap large dependency lists on column 80 (with \), and
224     # we should not choose a depcomp mode which is confused by this.
225     #
226     # We need to recreate these files for each test, as the compiler may
227     # overwrite some of them when testing with obscure command lines.
228     # This happens at least with the AIX C compiler.
229     : > sub/conftest.c
230     for i in 1 2 3 4 5 6; do
231       echo '#include "conftst'$i'.h"' >> sub/conftest.c
232       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233       # Solaris 8's {/usr,}/bin/sh.
234       touch sub/conftst$i.h
235     done
236     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237
238     # We check with `-c' and `-o' for the sake of the "dashmstdout"
239     # mode.  It turns out that the SunPro C++ compiler does not properly
240     # handle `-M -o', and we need to detect this.  Also, some Intel
241     # versions had trouble with output in subdirs
242     am__obj=sub/conftest.${OBJEXT-o}
243     am__minus_obj="-o $am__obj"
244     case $depmode in
245     gcc)
246       # This depmode causes a compiler race in universal mode.
247       test "$am__universal" = false || continue
248       ;;
249     nosideeffect)
250       # after this tag, mechanisms are not by side-effect, so they'll
251       # only be used when explicitly requested
252       if test "x$enable_dependency_tracking" = xyes; then
253         continue
254       else
255         break
256       fi
257       ;;
258     msvisualcpp | msvcmsys)
259       # This compiler won't grok `-c -o', but also, the minuso test has
260       # not run yet.  These depmodes are late enough in the game, and
261       # so weak that their functioning should not be impacted.
262       am__obj=conftest.${OBJEXT-o}
263       am__minus_obj=
264       ;;
265     none) break ;;
266     esac
267     if depmode=$depmode \
268        source=sub/conftest.c object=$am__obj \
269        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271          >/dev/null 2>conftest.err &&
272        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276       # icc doesn't choke on unknown options, it will just issue warnings
277       # or remarks (even with -Werror).  So we grep stderr for any message
278       # that says an option was ignored or not supported.
279       # When given -MP, icc 7.0 and 7.1 complain thusly:
280       #   icc: Command line warning: ignoring option '-M'; no argument required
281       # The diagnosis changed in icc 8.0:
282       #   icc: Command line remark: option '-MP' not supported
283       if (grep 'ignoring option' conftest.err ||
284           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285         am_cv_$1_dependencies_compiler_type=$depmode
286         break
287       fi
288     fi
289   done
290
291   cd ..
292   rm -rf conftest.dir
293 else
294   am_cv_$1_dependencies_compiler_type=none
295 fi
296 ])
297 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298 AM_CONDITIONAL([am__fastdep$1], [
299   test "x$enable_dependency_tracking" != xno \
300   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301 ])
302
303
304 # AM_SET_DEPDIR
305 # -------------
306 # Choose a directory name for dependency files.
307 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
308 AC_DEFUN([AM_SET_DEPDIR],
309 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311 ])
312
313
314 # AM_DEP_TRACK
315 # ------------
316 AC_DEFUN([AM_DEP_TRACK],
317 [AC_ARG_ENABLE(dependency-tracking,
318 [  --disable-dependency-tracking  speeds up one-time build
319   --enable-dependency-tracking   do not reject slow dependency extractors])
320 if test "x$enable_dependency_tracking" != xno; then
321   am_depcomp="$ac_aux_dir/depcomp"
322   AMDEPBACKSLASH='\'
323 fi
324 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325 AC_SUBST([AMDEPBACKSLASH])dnl
326 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327 ])
328
329 # Generate code to set up dependency tracking.              -*- Autoconf -*-
330
331 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332 # Free Software Foundation, Inc.
333 #
334 # This file is free software; the Free Software Foundation
335 # gives unlimited permission to copy and/or distribute it,
336 # with or without modifications, as long as this notice is preserved.
337
338 #serial 5
339
340 # _AM_OUTPUT_DEPENDENCY_COMMANDS
341 # ------------------------------
342 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343 [{
344   # Autoconf 2.62 quotes --file arguments for eval, but not when files
345   # are listed without --file.  Let's play safe and only enable the eval
346   # if we detect the quoting.
347   case $CONFIG_FILES in
348   *\'*) eval set x "$CONFIG_FILES" ;;
349   *)   set x $CONFIG_FILES ;;
350   esac
351   shift
352   for mf
353   do
354     # Strip MF so we end up with the name of the file.
355     mf=`echo "$mf" | sed -e 's/:.*$//'`
356     # Check whether this is an Automake generated Makefile or not.
357     # We used to match only the files named `Makefile.in', but
358     # some people rename them; so instead we look at the file content.
359     # Grep'ing the first line is not enough: some people post-process
360     # each Makefile.in and add a new line on top of each file to say so.
361     # Grep'ing the whole file is not good either: AIX grep has a line
362     # limit of 2048, but all sed's we know have understand at least 4000.
363     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364       dirpart=`AS_DIRNAME("$mf")`
365     else
366       continue
367     fi
368     # Extract the definition of DEPDIR, am__include, and am__quote
369     # from the Makefile without running `make'.
370     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371     test -z "$DEPDIR" && continue
372     am__include=`sed -n 's/^am__include = //p' < "$mf"`
373     test -z "am__include" && continue
374     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375     # When using ansi2knr, U may be empty or an underscore; expand it
376     U=`sed -n 's/^U = //p' < "$mf"`
377     # Find all dependency output files, they are included files with
378     # $(DEPDIR) in their names.  We invoke sed twice because it is the
379     # simplest approach to changing $(DEPDIR) to its actual value in the
380     # expansion.
381     for file in `sed -n "
382       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384       # Make sure the directory exists.
385       test -f "$dirpart/$file" && continue
386       fdir=`AS_DIRNAME(["$file"])`
387       AS_MKDIR_P([$dirpart/$fdir])
388       # echo "creating $dirpart/$file"
389       echo '# dummy' > "$dirpart/$file"
390     done
391   done
392 }
393 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394
395
396 # AM_OUTPUT_DEPENDENCY_COMMANDS
397 # -----------------------------
398 # This macro should only be invoked once -- use via AC_REQUIRE.
399 #
400 # This code is only required when automatic dependency tracking
401 # is enabled.  FIXME.  This creates each `.P' file that we will
402 # need in order to bootstrap the dependency handling code.
403 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404 [AC_CONFIG_COMMANDS([depfiles],
405      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407 ])
408
409 # Do all the work for Automake.                             -*- Autoconf -*-
410
411 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412 # 2005, 2006, 2008, 2009 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 # serial 16
419
420 # This macro actually does too much.  Some checks are only needed if
421 # your package does certain things.  But this isn't really a big deal.
422
423 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424 # AM_INIT_AUTOMAKE([OPTIONS])
425 # -----------------------------------------------
426 # The call with PACKAGE and VERSION arguments is the old style
427 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
428 # and VERSION should now be passed to AC_INIT and removed from
429 # the call to AM_INIT_AUTOMAKE.
430 # We support both call styles for the transition.  After
431 # the next Automake release, Autoconf can make the AC_INIT
432 # arguments mandatory, and then we can depend on a new Autoconf
433 # release and drop the old call support.
434 AC_DEFUN([AM_INIT_AUTOMAKE],
435 [AC_PREREQ([2.62])dnl
436 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
437 dnl the ones we care about.
438 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440 AC_REQUIRE([AC_PROG_INSTALL])dnl
441 if test "`cd $srcdir && pwd`" != "`pwd`"; then
442   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443   # is not polluted with repeated "-I."
444   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445   # test to see if srcdir already configured
446   if test -f $srcdir/config.status; then
447     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448   fi
449 fi
450
451 # test whether we have cygpath
452 if test -z "$CYGPATH_W"; then
453   if (cygpath --version) >/dev/null 2>/dev/null; then
454     CYGPATH_W='cygpath -w'
455   else
456     CYGPATH_W=echo
457   fi
458 fi
459 AC_SUBST([CYGPATH_W])
460
461 # Define the identity of the package.
462 dnl Distinguish between old-style and new-style calls.
463 m4_ifval([$2],
464 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465  AC_SUBST([PACKAGE], [$1])dnl
466  AC_SUBST([VERSION], [$2])],
467 [_AM_SET_OPTIONS([$1])dnl
468 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473
474 _AM_IF_OPTION([no-define],,
475 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477
478 # Some tools Automake needs.
479 AC_REQUIRE([AM_SANITY_CHECK])dnl
480 AC_REQUIRE([AC_ARG_PROGRAM])dnl
481 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482 AM_MISSING_PROG(AUTOCONF, autoconf)
483 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484 AM_MISSING_PROG(AUTOHEADER, autoheader)
485 AM_MISSING_PROG(MAKEINFO, makeinfo)
486 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
489 # We need awk for the "check" target.  The system "awk" is bad on
490 # some platforms.
491 AC_REQUIRE([AC_PROG_AWK])dnl
492 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
493 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
494 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496                              [_AM_PROG_TAR([v7])])])
497 _AM_IF_OPTION([no-dependencies],,
498 [AC_PROVIDE_IFELSE([AC_PROG_CC],
499                   [_AM_DEPENDENCIES(CC)],
500                   [define([AC_PROG_CC],
501                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502 AC_PROVIDE_IFELSE([AC_PROG_CXX],
503                   [_AM_DEPENDENCIES(CXX)],
504                   [define([AC_PROG_CXX],
505                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
507                   [_AM_DEPENDENCIES(OBJC)],
508                   [define([AC_PROG_OBJC],
509                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510 ])
511 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515 AC_CONFIG_COMMANDS_PRE(dnl
516 [m4_provide_if([_AM_COMPILER_EXEEXT],
517   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518 ])
519
520 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522 dnl mangled by Autoconf and run in a shell conditional statement.
523 m4_define([_AC_COMPILER_EXEEXT],
524 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525
526
527 # When config.status generates a header, we must update the stamp-h file.
528 # This file resides in the same directory as the config header
529 # that is generated.  The stamp files are numbered to have different names.
530
531 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532 # loop where config.status creates the headers, so we can generate
533 # our stamp files there.
534 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535 [# Compute $1's index in $config_headers.
536 _am_arg=$1
537 _am_stamp_count=1
538 for _am_header in $config_headers :; do
539   case $_am_header in
540     $_am_arg | $_am_arg:* )
541       break ;;
542     * )
543       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544   esac
545 done
546 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547
548 # Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549 #
550 # This file is free software; the Free Software Foundation
551 # gives unlimited permission to copy and/or distribute it,
552 # with or without modifications, as long as this notice is preserved.
553
554 # AM_PROG_INSTALL_SH
555 # ------------------
556 # Define $install_sh.
557 AC_DEFUN([AM_PROG_INSTALL_SH],
558 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559 if test x"${install_sh}" != xset; then
560   case $am_aux_dir in
561   *\ * | *\     *)
562     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563   *)
564     install_sh="\${SHELL} $am_aux_dir/install-sh"
565   esac
566 fi
567 AC_SUBST(install_sh)])
568
569 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570 #
571 # This file is free software; the Free Software Foundation
572 # gives unlimited permission to copy and/or distribute it,
573 # with or without modifications, as long as this notice is preserved.
574
575 # serial 2
576
577 # Check whether the underlying file-system supports filenames
578 # with a leading dot.  For instance MS-DOS doesn't.
579 AC_DEFUN([AM_SET_LEADING_DOT],
580 [rm -rf .tst 2>/dev/null
581 mkdir .tst 2>/dev/null
582 if test -d .tst; then
583   am__leading_dot=.
584 else
585   am__leading_dot=_
586 fi
587 rmdir .tst 2>/dev/null
588 AC_SUBST([am__leading_dot])])
589
590 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591 # From Jim Meyering
592
593 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594 # Free Software Foundation, Inc.
595 #
596 # This file is free software; the Free Software Foundation
597 # gives unlimited permission to copy and/or distribute it,
598 # with or without modifications, as long as this notice is preserved.
599
600 # serial 5
601
602 # AM_MAINTAINER_MODE([DEFAULT-MODE])
603 # ----------------------------------
604 # Control maintainer-specific portions of Makefiles.
605 # Default is to disable them, unless `enable' is passed literally.
606 # For symmetry, `disable' may be passed as well.  Anyway, the user
607 # can override the default with the --enable/--disable switch.
608 AC_DEFUN([AM_MAINTAINER_MODE],
609 [m4_case(m4_default([$1], [disable]),
610        [enable], [m4_define([am_maintainer_other], [disable])],
611        [disable], [m4_define([am_maintainer_other], [enable])],
612        [m4_define([am_maintainer_other], [enable])
613         m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615   dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616   AC_ARG_ENABLE([maintainer-mode],
617 [  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618                           (and sometimes confusing) to the casual installer],
619       [USE_MAINTAINER_MODE=$enableval],
620       [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622   AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623   MAINT=$MAINTAINER_MODE_TRUE
624   AC_SUBST([MAINT])dnl
625 ]
626 )
627
628 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629
630 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
631
632 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633 #
634 # This file is free software; the Free Software Foundation
635 # gives unlimited permission to copy and/or distribute it,
636 # with or without modifications, as long as this notice is preserved.
637
638 # serial 4
639
640 # AM_MAKE_INCLUDE()
641 # -----------------
642 # Check to see how make treats includes.
643 AC_DEFUN([AM_MAKE_INCLUDE],
644 [am_make=${MAKE-make}
645 cat > confinc << 'END'
646 am__doit:
647         @echo this is the am__doit target
648 .PHONY: am__doit
649 END
650 # If we don't find an include directive, just comment out the code.
651 AC_MSG_CHECKING([for style of include used by $am_make])
652 am__include="#"
653 am__quote=
654 _am_result=none
655 # First try GNU make style include.
656 echo "include confinc" > confmf
657 # Ignore all kinds of additional output from `make'.
658 case `$am_make -s -f confmf 2> /dev/null` in #(
659 *the\ am__doit\ target*)
660   am__include=include
661   am__quote=
662   _am_result=GNU
663   ;;
664 esac
665 # Now try BSD make style include.
666 if test "$am__include" = "#"; then
667    echo '.include "confinc"' > confmf
668    case `$am_make -s -f confmf 2> /dev/null` in #(
669    *the\ am__doit\ target*)
670      am__include=.include
671      am__quote="\""
672      _am_result=BSD
673      ;;
674    esac
675 fi
676 AC_SUBST([am__include])
677 AC_SUBST([am__quote])
678 AC_MSG_RESULT([$_am_result])
679 rm -f confinc confmf
680 ])
681
682 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683
684 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685 # Free Software Foundation, Inc.
686 #
687 # This file is free software; the Free Software Foundation
688 # gives unlimited permission to copy and/or distribute it,
689 # with or without modifications, as long as this notice is preserved.
690
691 # serial 6
692
693 # AM_MISSING_PROG(NAME, PROGRAM)
694 # ------------------------------
695 AC_DEFUN([AM_MISSING_PROG],
696 [AC_REQUIRE([AM_MISSING_HAS_RUN])
697 $1=${$1-"${am_missing_run}$2"}
698 AC_SUBST($1)])
699
700
701 # AM_MISSING_HAS_RUN
702 # ------------------
703 # Define MISSING if not defined so far and test if it supports --run.
704 # If it does, set am_missing_run to use it, otherwise, to nothing.
705 AC_DEFUN([AM_MISSING_HAS_RUN],
706 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707 AC_REQUIRE_AUX_FILE([missing])dnl
708 if test x"${MISSING+set}" != xset; then
709   case $am_aux_dir in
710   *\ * | *\     *)
711     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712   *)
713     MISSING="\${SHELL} $am_aux_dir/missing" ;;
714   esac
715 fi
716 # Use eval to expand $SHELL
717 if eval "$MISSING --run true"; then
718   am_missing_run="$MISSING --run "
719 else
720   am_missing_run=
721   AC_MSG_WARN([`missing' script is too old or missing])
722 fi
723 ])
724
725 # Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726 #
727 # This file is free software; the Free Software Foundation
728 # gives unlimited permission to copy and/or distribute it,
729 # with or without modifications, as long as this notice is preserved.
730
731 # AM_PROG_MKDIR_P
732 # ---------------
733 # Check for `mkdir -p'.
734 AC_DEFUN([AM_PROG_MKDIR_P],
735 [AC_PREREQ([2.60])dnl
736 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
737 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738 dnl while keeping a definition of mkdir_p for backward compatibility.
739 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741 dnl Makefile.ins that do not define MKDIR_P, so we do our own
742 dnl adjustment using top_builddir (which is defined more often than
743 dnl MKDIR_P).
744 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745 case $mkdir_p in
746   [[\\/$]]* | ?:[[\\/]]*) ;;
747   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748 esac
749 ])
750
751 # Helper functions for option handling.                     -*- Autoconf -*-
752
753 # Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754 #
755 # This file is free software; the Free Software Foundation
756 # gives unlimited permission to copy and/or distribute it,
757 # with or without modifications, as long as this notice is preserved.
758
759 # serial 4
760
761 # _AM_MANGLE_OPTION(NAME)
762 # -----------------------
763 AC_DEFUN([_AM_MANGLE_OPTION],
764 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765
766 # _AM_SET_OPTION(NAME)
767 # ------------------------------
768 # Set option NAME.  Presently that only means defining a flag for this option.
769 AC_DEFUN([_AM_SET_OPTION],
770 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771
772 # _AM_SET_OPTIONS(OPTIONS)
773 # ----------------------------------
774 # OPTIONS is a space-separated list of Automake options.
775 AC_DEFUN([_AM_SET_OPTIONS],
776 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777
778 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779 # -------------------------------------------
780 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781 AC_DEFUN([_AM_IF_OPTION],
782 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783
784 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
785
786 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787 # Free Software Foundation, Inc.
788 #
789 # This file is free software; the Free Software Foundation
790 # gives unlimited permission to copy and/or distribute it,
791 # with or without modifications, as long as this notice is preserved.
792
793 # serial 5
794
795 # AM_SANITY_CHECK
796 # ---------------
797 AC_DEFUN([AM_SANITY_CHECK],
798 [AC_MSG_CHECKING([whether build environment is sane])
799 # Just in case
800 sleep 1
801 echo timestamp > conftest.file
802 # Reject unsafe characters in $srcdir or the absolute working directory
803 # name.  Accept space and tab only in the latter.
804 am_lf='
805 '
806 case `pwd` in
807   *[[\\\"\#\$\&\'\`$am_lf]]*)
808     AC_MSG_ERROR([unsafe absolute working directory name]);;
809 esac
810 case $srcdir in
811   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
812     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813 esac
814
815 # Do `set' in a subshell so we don't clobber the current shell's
816 # arguments.  Must try -L first in case configure is actually a
817 # symlink; some systems play weird games with the mod time of symlinks
818 # (eg FreeBSD returns the mod time of the symlink's containing
819 # directory).
820 if (
821    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822    if test "$[*]" = "X"; then
823       # -L didn't work.
824       set X `ls -t "$srcdir/configure" conftest.file`
825    fi
826    rm -f conftest.file
827    if test "$[*]" != "X $srcdir/configure conftest.file" \
828       && test "$[*]" != "X conftest.file $srcdir/configure"; then
829
830       # If neither matched, then we have a broken ls.  This can happen
831       # if, for instance, CONFIG_SHELL is bash and it inherits a
832       # broken ls alias from the environment.  This has actually
833       # happened.  Such a system could not be considered "sane".
834       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835 alias in your environment])
836    fi
837
838    test "$[2]" = conftest.file
839    )
840 then
841    # Ok.
842    :
843 else
844    AC_MSG_ERROR([newly created file is older than distributed files!
845 Check your system clock])
846 fi
847 AC_MSG_RESULT(yes)])
848
849 # Copyright (C) 2009  Free Software Foundation, Inc.
850 #
851 # This file is free software; the Free Software Foundation
852 # gives unlimited permission to copy and/or distribute it,
853 # with or without modifications, as long as this notice is preserved.
854
855 # serial 1
856
857 # AM_SILENT_RULES([DEFAULT])
858 # --------------------------
859 # Enable less verbose build rules; with the default set to DEFAULT
860 # (`yes' being less verbose, `no' or empty being verbose).
861 AC_DEFUN([AM_SILENT_RULES],
862 [AC_ARG_ENABLE([silent-rules],
863 [  --enable-silent-rules          less verbose build output (undo: `make V=1')
864   --disable-silent-rules         verbose build output (undo: `make V=0')])
865 case $enable_silent_rules in
866 yes) AM_DEFAULT_VERBOSITY=0;;
867 no)  AM_DEFAULT_VERBOSITY=1;;
868 *)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869 esac
870 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871 AM_BACKSLASH='\'
872 AC_SUBST([AM_BACKSLASH])dnl
873 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874 ])
875
876 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877 #
878 # This file is free software; the Free Software Foundation
879 # gives unlimited permission to copy and/or distribute it,
880 # with or without modifications, as long as this notice is preserved.
881
882 # AM_PROG_INSTALL_STRIP
883 # ---------------------
884 # One issue with vendor `install' (even GNU) is that you can't
885 # specify the program used to strip binaries.  This is especially
886 # annoying in cross-compiling environments, where the build's strip
887 # is unlikely to handle the host's binaries.
888 # Fortunately install-sh will honor a STRIPPROG variable, so we
889 # always use install-sh in `make install-strip', and initialize
890 # STRIPPROG with the value of the STRIP variable (set by the user).
891 AC_DEFUN([AM_PROG_INSTALL_STRIP],
892 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893 # Installed binaries are usually stripped using `strip' when the user
894 # run `make install-strip'.  However `strip' might not be the right
895 # tool to use in cross-compilation environments, therefore Automake
896 # will honor the `STRIP' environment variable to overrule this program.
897 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898 if test "$cross_compiling" != no; then
899   AC_CHECK_TOOL([STRIP], [strip], :)
900 fi
901 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902 AC_SUBST([INSTALL_STRIP_PROGRAM])])
903
904 # Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905 #
906 # This file is free software; the Free Software Foundation
907 # gives unlimited permission to copy and/or distribute it,
908 # with or without modifications, as long as this notice is preserved.
909
910 # serial 2
911
912 # _AM_SUBST_NOTMAKE(VARIABLE)
913 # ---------------------------
914 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915 # This macro is traced by Automake.
916 AC_DEFUN([_AM_SUBST_NOTMAKE])
917
918 # AM_SUBST_NOTMAKE(VARIABLE)
919 # ---------------------------
920 # Public sister of _AM_SUBST_NOTMAKE.
921 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922
923 # Check how to create a tarball.                            -*- Autoconf -*-
924
925 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926 #
927 # This file is free software; the Free Software Foundation
928 # gives unlimited permission to copy and/or distribute it,
929 # with or without modifications, as long as this notice is preserved.
930
931 # serial 2
932
933 # _AM_PROG_TAR(FORMAT)
934 # --------------------
935 # Check how to create a tarball in format FORMAT.
936 # FORMAT should be one of `v7', `ustar', or `pax'.
937 #
938 # Substitute a variable $(am__tar) that is a command
939 # writing to stdout a FORMAT-tarball containing the directory
940 # $tardir.
941 #     tardir=directory && $(am__tar) > result.tar
942 #
943 # Substitute a variable $(am__untar) that extract such
944 # a tarball read from stdin.
945 #     $(am__untar) < result.tar
946 AC_DEFUN([_AM_PROG_TAR],
947 [# Always define AMTAR for backward compatibility.
948 AM_MISSING_PROG([AMTAR], [tar])
949 m4_if([$1], [v7],
950      [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951      [m4_case([$1], [ustar],, [pax],,
952               [m4_fatal([Unknown tar format])])
953 AC_MSG_CHECKING([how to create a $1 tar archive])
954 # Loop over all known methods to create a tar archive until one works.
955 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
957 # Do not fold the above two line into one, because Tru64 sh and
958 # Solaris sh will not grok spaces in the rhs of `-'.
959 for _am_tool in $_am_tools
960 do
961   case $_am_tool in
962   gnutar)
963     for _am_tar in tar gnutar gtar;
964     do
965       AM_RUN_LOG([$_am_tar --version]) && break
966     done
967     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969     am__untar="$_am_tar -xf -"
970     ;;
971   plaintar)
972     # Must skip GNU tar: if it does not support --format= it doesn't create
973     # ustar tarball either.
974     (tar --version) >/dev/null 2>&1 && continue
975     am__tar='tar chf - "$$tardir"'
976     am__tar_='tar chf - "$tardir"'
977     am__untar='tar xf -'
978     ;;
979   pax)
980     am__tar='pax -L -x $1 -w "$$tardir"'
981     am__tar_='pax -L -x $1 -w "$tardir"'
982     am__untar='pax -r'
983     ;;
984   cpio)
985     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987     am__untar='cpio -i -H $1 -d'
988     ;;
989   none)
990     am__tar=false
991     am__tar_=false
992     am__untar=false
993     ;;
994   esac
995
996   # If the value was cached, stop now.  We just wanted to have am__tar
997   # and am__untar set.
998   test -n "${am_cv_prog_tar_$1}" && break
999
1000   # tar/untar a dummy directory, and stop if the command works
1001   rm -rf conftest.dir
1002   mkdir conftest.dir
1003   echo GrepMe > conftest.dir/file
1004   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005   rm -rf conftest.dir
1006   if test -s conftest.tar; then
1007     AM_RUN_LOG([$am__untar <conftest.tar])
1008     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009   fi
1010 done
1011 rm -rf conftest.dir
1012
1013 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015 AC_SUBST([am__tar])
1016 AC_SUBST([am__untar])
1017 ]) # _AM_PROG_TAR
1018
1019 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1020
1021 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
1022 #
1023 # This program is free software; you can redistribute it and/or modify
1024 # it under the terms of the GNU General Public License as published by
1025 # the Free Software Foundation; either version 2 of the License, or
1026 # (at your option) any later version.
1027 #
1028 # This program is distributed in the hope that it will be useful, but
1029 # WITHOUT ANY WARRANTY; without even the implied warranty of
1030 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1031 # General Public License for more details.
1032 #
1033 # You should have received a copy of the GNU General Public License
1034 # along with this program; if not, write to the Free Software
1035 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1036 #
1037 # As a special exception to the GNU General Public License, if you
1038 # distribute this file as part of a program that contains a
1039 # configuration script generated by Autoconf, you may include it under
1040 # the same distribution terms that you use for the rest of that program.
1041
1042 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
1043 # ----------------------------------
1044 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1045 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1046 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1047 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1048 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1049         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1050 fi
1051 if test -n "$PKG_CONFIG"; then
1052         _pkg_min_version=m4_default([$1], [0.9.0])
1053         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1054         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1055                 AC_MSG_RESULT([yes])
1056         else
1057                 AC_MSG_RESULT([no])
1058                 PKG_CONFIG=""
1059         fi
1060                 
1061 fi[]dnl
1062 ])# PKG_PROG_PKG_CONFIG
1063
1064 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1065 #
1066 # Check to see whether a particular set of modules exists.  Similar
1067 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
1068 #
1069 #
1070 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
1071 # this or PKG_CHECK_MODULES is called, or make sure to call
1072 # PKG_CHECK_EXISTS manually
1073 # --------------------------------------------------------------
1074 AC_DEFUN([PKG_CHECK_EXISTS],
1075 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1076 if test -n "$PKG_CONFIG" && \
1077     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1078   m4_ifval([$2], [$2], [:])
1079 m4_ifvaln([$3], [else
1080   $3])dnl
1081 fi])
1082
1083
1084 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1085 # ---------------------------------------------
1086 m4_define([_PKG_CONFIG],
1087 [if test -n "$$1"; then
1088     pkg_cv_[]$1="$$1"
1089  elif test -n "$PKG_CONFIG"; then
1090     PKG_CHECK_EXISTS([$3],
1091                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1092                      [pkg_failed=yes])
1093  else
1094     pkg_failed=untried
1095 fi[]dnl
1096 ])# _PKG_CONFIG
1097
1098 # _PKG_SHORT_ERRORS_SUPPORTED
1099 # -----------------------------
1100 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1101 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1102 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1103         _pkg_short_errors_supported=yes
1104 else
1105         _pkg_short_errors_supported=no
1106 fi[]dnl
1107 ])# _PKG_SHORT_ERRORS_SUPPORTED
1108
1109
1110 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1111 # [ACTION-IF-NOT-FOUND])
1112 #
1113 #
1114 # Note that if there is a possibility the first call to
1115 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1116 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1117 #
1118 #
1119 # --------------------------------------------------------------
1120 AC_DEFUN([PKG_CHECK_MODULES],
1121 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1122 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1123 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1124
1125 pkg_failed=no
1126 AC_MSG_CHECKING([for $1])
1127
1128 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1129 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1130
1131 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1132 and $1[]_LIBS to avoid the need to call pkg-config.
1133 See the pkg-config man page for more details.])
1134
1135 if test $pkg_failed = yes; then
1136         _PKG_SHORT_ERRORS_SUPPORTED
1137         if test $_pkg_short_errors_supported = yes; then
1138                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1139         else 
1140                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1141         fi
1142         # Put the nasty error message in config.log where it belongs
1143         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1144
1145         ifelse([$4], , [AC_MSG_ERROR(dnl
1146 [Package requirements ($2) were not met:
1147
1148 $$1_PKG_ERRORS
1149
1150 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1151 installed software in a non-standard prefix.
1152
1153 _PKG_TEXT
1154 ])],
1155                 [AC_MSG_RESULT([no])
1156                 $4])
1157 elif test $pkg_failed = untried; then
1158         ifelse([$4], , [AC_MSG_FAILURE(dnl
1159 [The pkg-config script could not be found or is too old.  Make sure it
1160 is in your PATH or set the PKG_CONFIG environment variable to the full
1161 path to pkg-config.
1162
1163 _PKG_TEXT
1164
1165 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1166                 [$4])
1167 else
1168         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1169         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1170         AC_MSG_RESULT([yes])
1171         ifelse([$3], , :, [$3])
1172 fi[]dnl
1173 ])# PKG_CHECK_MODULES
1174
1175 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1176 #
1177 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1178 #                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
1179 #                 Inc.
1180 #   Written by Gordon Matzigkeit, 1996
1181 #
1182 # This file is free software; the Free Software Foundation gives
1183 # unlimited permission to copy and/or distribute it, with or without
1184 # modifications, as long as this notice is preserved.
1185
1186 m4_define([_LT_COPYING], [dnl
1187 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1188 #                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
1189 #                 Inc.
1190 #   Written by Gordon Matzigkeit, 1996
1191 #
1192 #   This file is part of GNU Libtool.
1193 #
1194 # GNU Libtool is free software; you can redistribute it and/or
1195 # modify it under the terms of the GNU General Public License as
1196 # published by the Free Software Foundation; either version 2 of
1197 # the License, or (at your option) any later version.
1198 #
1199 # As a special exception to the GNU General Public License,
1200 # if you distribute this file as part of a program or library that
1201 # is built using GNU Libtool, you may include this file under the
1202 # same distribution terms that you use for the rest of that program.
1203 #
1204 # GNU Libtool is distributed in the hope that it will be useful,
1205 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1206 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1207 # GNU General Public License for more details.
1208 #
1209 # You should have received a copy of the GNU General Public License
1210 # along with GNU Libtool; see the file COPYING.  If not, a copy
1211 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1212 # obtained by writing to the Free Software Foundation, Inc.,
1213 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1214 ])
1215
1216 # serial 57 LT_INIT
1217
1218
1219 # LT_PREREQ(VERSION)
1220 # ------------------
1221 # Complain and exit if this libtool version is less that VERSION.
1222 m4_defun([LT_PREREQ],
1223 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1224        [m4_default([$3],
1225                    [m4_fatal([Libtool version $1 or higher is required],
1226                              63)])],
1227        [$2])])
1228
1229
1230 # _LT_CHECK_BUILDDIR
1231 # ------------------
1232 # Complain if the absolute build directory name contains unusual characters
1233 m4_defun([_LT_CHECK_BUILDDIR],
1234 [case `pwd` in
1235   *\ * | *\     *)
1236     AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1237 esac
1238 ])
1239
1240
1241 # LT_INIT([OPTIONS])
1242 # ------------------
1243 AC_DEFUN([LT_INIT],
1244 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1245 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1246 AC_BEFORE([$0], [LT_LANG])dnl
1247 AC_BEFORE([$0], [LT_OUTPUT])dnl
1248 AC_BEFORE([$0], [LTDL_INIT])dnl
1249 m4_require([_LT_CHECK_BUILDDIR])dnl
1250
1251 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1252 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1253 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1254 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1255 dnl unless we require an AC_DEFUNed macro:
1256 AC_REQUIRE([LTOPTIONS_VERSION])dnl
1257 AC_REQUIRE([LTSUGAR_VERSION])dnl
1258 AC_REQUIRE([LTVERSION_VERSION])dnl
1259 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1260 m4_require([_LT_PROG_LTMAIN])dnl
1261
1262 _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1263
1264 dnl Parse OPTIONS
1265 _LT_SET_OPTIONS([$0], [$1])
1266
1267 # This can be used to rebuild libtool when needed
1268 LIBTOOL_DEPS="$ltmain"
1269
1270 # Always use our own libtool.
1271 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1272 AC_SUBST(LIBTOOL)dnl
1273
1274 _LT_SETUP
1275
1276 # Only expand once:
1277 m4_define([LT_INIT])
1278 ])# LT_INIT
1279
1280 # Old names:
1281 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1282 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1283 dnl aclocal-1.4 backwards compatibility:
1284 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1285 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1286
1287
1288 # _LT_CC_BASENAME(CC)
1289 # -------------------
1290 # Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1291 m4_defun([_LT_CC_BASENAME],
1292 [for cc_temp in $1""; do
1293   case $cc_temp in
1294     compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1295     distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1296     \-*) ;;
1297     *) break;;
1298   esac
1299 done
1300 cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1301 ])
1302
1303
1304 # _LT_FILEUTILS_DEFAULTS
1305 # ----------------------
1306 # It is okay to use these file commands and assume they have been set
1307 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1308 m4_defun([_LT_FILEUTILS_DEFAULTS],
1309 [: ${CP="cp -f"}
1310 : ${MV="mv -f"}
1311 : ${RM="rm -f"}
1312 ])# _LT_FILEUTILS_DEFAULTS
1313
1314
1315 # _LT_SETUP
1316 # ---------
1317 m4_defun([_LT_SETUP],
1318 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1319 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1320 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1321 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1322
1323 _LT_DECL([], [host_alias], [0], [The host system])dnl
1324 _LT_DECL([], [host], [0])dnl
1325 _LT_DECL([], [host_os], [0])dnl
1326 dnl
1327 _LT_DECL([], [build_alias], [0], [The build system])dnl
1328 _LT_DECL([], [build], [0])dnl
1329 _LT_DECL([], [build_os], [0])dnl
1330 dnl
1331 AC_REQUIRE([AC_PROG_CC])dnl
1332 AC_REQUIRE([LT_PATH_LD])dnl
1333 AC_REQUIRE([LT_PATH_NM])dnl
1334 dnl
1335 AC_REQUIRE([AC_PROG_LN_S])dnl
1336 test -z "$LN_S" && LN_S="ln -s"
1337 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1338 dnl
1339 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1340 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1341 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1342 dnl
1343 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1344 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1345 m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1346 m4_require([_LT_CMD_RELOAD])dnl
1347 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1348 m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1349 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1350 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1351 m4_require([_LT_WITH_SYSROOT])dnl
1352
1353 _LT_CONFIG_LIBTOOL_INIT([
1354 # See if we are running on zsh, and set the options which allow our
1355 # commands through without removal of \ escapes INIT.
1356 if test -n "\${ZSH_VERSION+set}" ; then
1357    setopt NO_GLOB_SUBST
1358 fi
1359 ])
1360 if test -n "${ZSH_VERSION+set}" ; then
1361    setopt NO_GLOB_SUBST
1362 fi
1363
1364 _LT_CHECK_OBJDIR
1365
1366 m4_require([_LT_TAG_COMPILER])dnl
1367
1368 case $host_os in
1369 aix3*)
1370   # AIX sometimes has problems with the GCC collect2 program.  For some
1371   # reason, if we set the COLLECT_NAMES environment variable, the problems
1372   # vanish in a puff of smoke.
1373   if test "X${COLLECT_NAMES+set}" != Xset; then
1374     COLLECT_NAMES=
1375     export COLLECT_NAMES
1376   fi
1377   ;;
1378 esac
1379
1380 # Global variables:
1381 ofile=libtool
1382 can_build_shared=yes
1383
1384 # All known linkers require a `.a' archive for static linking (except MSVC,
1385 # which needs '.lib').
1386 libext=a
1387
1388 with_gnu_ld="$lt_cv_prog_gnu_ld"
1389
1390 old_CC="$CC"
1391 old_CFLAGS="$CFLAGS"
1392
1393 # Set sane defaults for various variables
1394 test -z "$CC" && CC=cc
1395 test -z "$LTCC" && LTCC=$CC
1396 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1397 test -z "$LD" && LD=ld
1398 test -z "$ac_objext" && ac_objext=o
1399
1400 _LT_CC_BASENAME([$compiler])
1401
1402 # Only perform the check for file, if the check method requires it
1403 test -z "$MAGIC_CMD" && MAGIC_CMD=file
1404 case $deplibs_check_method in
1405 file_magic*)
1406   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1407     _LT_PATH_MAGIC
1408   fi
1409   ;;
1410 esac
1411
1412 # Use C for the default configuration in the libtool script
1413 LT_SUPPORTED_TAG([CC])
1414 _LT_LANG_C_CONFIG
1415 _LT_LANG_DEFAULT_CONFIG
1416 _LT_CONFIG_COMMANDS
1417 ])# _LT_SETUP
1418
1419
1420 # _LT_PREPARE_SED_QUOTE_VARS
1421 # --------------------------
1422 # Define a few sed substitution that help us do robust quoting.
1423 m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1424 [# Backslashify metacharacters that are still active within
1425 # double-quoted strings.
1426 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1427
1428 # Same as above, but do not quote variable references.
1429 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1430
1431 # Sed substitution to delay expansion of an escaped shell variable in a
1432 # double_quote_subst'ed string.
1433 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1434
1435 # Sed substitution to delay expansion of an escaped single quote.
1436 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1437
1438 # Sed substitution to avoid accidental globbing in evaled expressions
1439 no_glob_subst='s/\*/\\\*/g'
1440 ])
1441
1442 # _LT_PROG_LTMAIN
1443 # ---------------
1444 # Note that this code is called both from `configure', and `config.status'
1445 # now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1446 # `config.status' has no value for ac_aux_dir unless we are using Automake,
1447 # so we pass a copy along to make sure it has a sensible value anyway.
1448 m4_defun([_LT_PROG_LTMAIN],
1449 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1450 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1451 ltmain="$ac_aux_dir/ltmain.sh"
1452 ])# _LT_PROG_LTMAIN
1453
1454
1455
1456 # So that we can recreate a full libtool script including additional
1457 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1458 # in macros and then make a single call at the end using the `libtool'
1459 # label.
1460
1461
1462 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1463 # ----------------------------------------
1464 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1465 m4_define([_LT_CONFIG_LIBTOOL_INIT],
1466 [m4_ifval([$1],
1467           [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1468                      [$1
1469 ])])])
1470
1471 # Initialize.
1472 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1473
1474
1475 # _LT_CONFIG_LIBTOOL([COMMANDS])
1476 # ------------------------------
1477 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1478 m4_define([_LT_CONFIG_LIBTOOL],
1479 [m4_ifval([$1],
1480           [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1481                      [$1
1482 ])])])
1483
1484 # Initialize.
1485 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1486
1487
1488 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1489 # -----------------------------------------------------
1490 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1491 [_LT_CONFIG_LIBTOOL([$1])
1492 _LT_CONFIG_LIBTOOL_INIT([$2])
1493 ])
1494
1495
1496 # _LT_FORMAT_COMMENT([COMMENT])
1497 # -----------------------------
1498 # Add leading comment marks to the start of each line, and a trailing
1499 # full-stop to the whole comment if one is not present already.
1500 m4_define([_LT_FORMAT_COMMENT],
1501 [m4_ifval([$1], [
1502 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1503               [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1504 )])
1505
1506
1507
1508
1509
1510 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1511 # -------------------------------------------------------------------
1512 # CONFIGNAME is the name given to the value in the libtool script.
1513 # VARNAME is the (base) name used in the configure script.
1514 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1515 # VARNAME.  Any other value will be used directly.
1516 m4_define([_LT_DECL],
1517 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1518     [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1519         [m4_ifval([$1], [$1], [$2])])
1520     lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1521     m4_ifval([$4],
1522         [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1523     lt_dict_add_subkey([lt_decl_dict], [$2],
1524         [tagged?], [m4_ifval([$5], [yes], [no])])])
1525 ])
1526
1527
1528 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1529 # --------------------------------------------------------
1530 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1531
1532
1533 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1534 # ------------------------------------------------
1535 m4_define([lt_decl_tag_varnames],
1536 [_lt_decl_filter([tagged?], [yes], $@)])
1537
1538
1539 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1540 # ---------------------------------------------------------
1541 m4_define([_lt_decl_filter],
1542 [m4_case([$#],
1543   [0], [m4_fatal([$0: too few arguments: $#])],
1544   [1], [m4_fatal([$0: too few arguments: $#: $1])],
1545   [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1546   [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1547   [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1548 ])
1549
1550
1551 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1552 # --------------------------------------------------
1553 m4_define([lt_decl_quote_varnames],
1554 [_lt_decl_filter([value], [1], $@)])
1555
1556
1557 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1558 # ---------------------------------------------------
1559 m4_define([lt_decl_dquote_varnames],
1560 [_lt_decl_filter([value], [2], $@)])
1561
1562
1563 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1564 # ---------------------------------------------------
1565 m4_define([lt_decl_varnames_tagged],
1566 [m4_assert([$# <= 2])dnl
1567 _$0(m4_quote(m4_default([$1], [[, ]])),
1568     m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1569     m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1570 m4_define([_lt_decl_varnames_tagged],
1571 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1572
1573
1574 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1575 # ------------------------------------------------
1576 m4_define([lt_decl_all_varnames],
1577 [_$0(m4_quote(m4_default([$1], [[, ]])),
1578      m4_if([$2], [],
1579            m4_quote(lt_decl_varnames),
1580         m4_quote(m4_shift($@))))[]dnl
1581 ])
1582 m4_define([_lt_decl_all_varnames],
1583 [lt_join($@, lt_decl_varnames_tagged([$1],
1584                         lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1585 ])
1586
1587
1588 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
1589 # ------------------------------------
1590 # Quote a variable value, and forward it to `config.status' so that its
1591 # declaration there will have the same value as in `configure'.  VARNAME
1592 # must have a single quote delimited value for this to work.
1593 m4_define([_LT_CONFIG_STATUS_DECLARE],
1594 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1595
1596
1597 # _LT_CONFIG_STATUS_DECLARATIONS
1598 # ------------------------------
1599 # We delimit libtool config variables with single quotes, so when
1600 # we write them to config.status, we have to be sure to quote all
1601 # embedded single quotes properly.  In configure, this macro expands
1602 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1603 #
1604 #    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1605 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1606 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1607     [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1608
1609
1610 # _LT_LIBTOOL_TAGS
1611 # ----------------
1612 # Output comment and list of tags supported by the script
1613 m4_defun([_LT_LIBTOOL_TAGS],
1614 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1615 available_tags="_LT_TAGS"dnl
1616 ])
1617
1618
1619 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1620 # -----------------------------------
1621 # Extract the dictionary values for VARNAME (optionally with TAG) and
1622 # expand to a commented shell variable setting:
1623 #
1624 #    # Some comment about what VAR is for.
1625 #    visible_name=$lt_internal_name
1626 m4_define([_LT_LIBTOOL_DECLARE],
1627 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1628                                            [description])))[]dnl
1629 m4_pushdef([_libtool_name],
1630     m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1631 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1632     [0], [_libtool_name=[$]$1],
1633     [1], [_libtool_name=$lt_[]$1],
1634     [2], [_libtool_name=$lt_[]$1],
1635     [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1636 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1637 ])
1638
1639
1640 # _LT_LIBTOOL_CONFIG_VARS
1641 # -----------------------
1642 # Produce commented declarations of non-tagged libtool config variables
1643 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1644 # script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1645 # section) are produced by _LT_LIBTOOL_TAG_VARS.
1646 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1647 [m4_foreach([_lt_var],
1648     m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1649     [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1650
1651
1652 # _LT_LIBTOOL_TAG_VARS(TAG)
1653 # -------------------------
1654 m4_define([_LT_LIBTOOL_TAG_VARS],
1655 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1656     [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1657
1658
1659 # _LT_TAGVAR(VARNAME, [TAGNAME])
1660 # ------------------------------
1661 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1662
1663
1664 # _LT_CONFIG_COMMANDS
1665 # -------------------
1666 # Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1667 # variables for single and double quote escaping we saved from calls
1668 # to _LT_DECL, we can put quote escaped variables declarations
1669 # into `config.status', and then the shell code to quote escape them in
1670 # for loops in `config.status'.  Finally, any additional code accumulated
1671 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1672 m4_defun([_LT_CONFIG_COMMANDS],
1673 [AC_PROVIDE_IFELSE([LT_OUTPUT],
1674         dnl If the libtool generation code has been placed in $CONFIG_LT,
1675         dnl instead of duplicating it all over again into config.status,
1676         dnl then we will have config.status run $CONFIG_LT later, so it
1677         dnl needs to know what name is stored there:
1678         [AC_CONFIG_COMMANDS([libtool],
1679             [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1680     dnl If the libtool generation code is destined for config.status,
1681     dnl expand the accumulated commands and init code now:
1682     [AC_CONFIG_COMMANDS([libtool],
1683         [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1684 ])#_LT_CONFIG_COMMANDS
1685
1686
1687 # Initialize.
1688 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1689 [
1690
1691 # The HP-UX ksh and POSIX shell print the target directory to stdout
1692 # if CDPATH is set.
1693 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1694
1695 sed_quote_subst='$sed_quote_subst'
1696 double_quote_subst='$double_quote_subst'
1697 delay_variable_subst='$delay_variable_subst'
1698 _LT_CONFIG_STATUS_DECLARATIONS
1699 LTCC='$LTCC'
1700 LTCFLAGS='$LTCFLAGS'
1701 compiler='$compiler_DEFAULT'
1702
1703 # A function that is used when there is no print builtin or printf.
1704 func_fallback_echo ()
1705 {
1706   eval 'cat <<_LTECHO_EOF
1707 \$[]1
1708 _LTECHO_EOF'
1709 }
1710
1711 # Quote evaled strings.
1712 for var in lt_decl_all_varnames([[ \
1713 ]], lt_decl_quote_varnames); do
1714     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1715     *[[\\\\\\\`\\"\\\$]]*)
1716       eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1717       ;;
1718     *)
1719       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1720       ;;
1721     esac
1722 done
1723
1724 # Double-quote double-evaled strings.
1725 for var in lt_decl_all_varnames([[ \
1726 ]], lt_decl_dquote_varnames); do
1727     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1728     *[[\\\\\\\`\\"\\\$]]*)
1729       eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1730       ;;
1731     *)
1732       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1733       ;;
1734     esac
1735 done
1736
1737 _LT_OUTPUT_LIBTOOL_INIT
1738 ])
1739
1740 # _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1741 # ------------------------------------
1742 # Generate a child script FILE with all initialization necessary to
1743 # reuse the environment learned by the parent script, and make the
1744 # file executable.  If COMMENT is supplied, it is inserted after the
1745 # `#!' sequence but before initialization text begins.  After this
1746 # macro, additional text can be appended to FILE to form the body of
1747 # the child script.  The macro ends with non-zero status if the
1748 # file could not be fully written (such as if the disk is full).
1749 m4_ifdef([AS_INIT_GENERATED],
1750 [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1751 [m4_defun([_LT_GENERATED_FILE_INIT],
1752 [m4_require([AS_PREPARE])]dnl
1753 [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1754 [lt_write_fail=0
1755 cat >$1 <<_ASEOF || lt_write_fail=1
1756 #! $SHELL
1757 # Generated by $as_me.
1758 $2
1759 SHELL=\${CONFIG_SHELL-$SHELL}
1760 export SHELL
1761 _ASEOF
1762 cat >>$1 <<\_ASEOF || lt_write_fail=1
1763 AS_SHELL_SANITIZE
1764 _AS_PREPARE
1765 exec AS_MESSAGE_FD>&1
1766 _ASEOF
1767 test $lt_write_fail = 0 && chmod +x $1[]dnl
1768 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1769
1770 # LT_OUTPUT
1771 # ---------
1772 # This macro allows early generation of the libtool script (before
1773 # AC_OUTPUT is called), incase it is used in configure for compilation
1774 # tests.
1775 AC_DEFUN([LT_OUTPUT],
1776 [: ${CONFIG_LT=./config.lt}
1777 AC_MSG_NOTICE([creating $CONFIG_LT])
1778 _LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1779 [# Run this file to recreate a libtool stub with the current configuration.])
1780
1781 cat >>"$CONFIG_LT" <<\_LTEOF
1782 lt_cl_silent=false
1783 exec AS_MESSAGE_LOG_FD>>config.log
1784 {
1785   echo
1786   AS_BOX([Running $as_me.])
1787 } >&AS_MESSAGE_LOG_FD
1788
1789 lt_cl_help="\
1790 \`$as_me' creates a local libtool stub from the current configuration,
1791 for use in further configure time tests before the real libtool is
1792 generated.
1793
1794 Usage: $[0] [[OPTIONS]]
1795
1796   -h, --help      print this help, then exit
1797   -V, --version   print version number, then exit
1798   -q, --quiet     do not print progress messages
1799   -d, --debug     don't remove temporary files
1800
1801 Report bugs to <bug-libtool@gnu.org>."
1802
1803 lt_cl_version="\
1804 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1805 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1806 configured by $[0], generated by m4_PACKAGE_STRING.
1807
1808 Copyright (C) 2010 Free Software Foundation, Inc.
1809 This config.lt script is free software; the Free Software Foundation
1810 gives unlimited permision to copy, distribute and modify it."
1811
1812 while test $[#] != 0
1813 do
1814   case $[1] in
1815     --version | --v* | -V )
1816       echo "$lt_cl_version"; exit 0 ;;
1817     --help | --h* | -h )
1818       echo "$lt_cl_help"; exit 0 ;;
1819     --debug | --d* | -d )
1820       debug=: ;;
1821     --quiet | --q* | --silent | --s* | -q )
1822       lt_cl_silent=: ;;
1823
1824     -*) AC_MSG_ERROR([unrecognized option: $[1]
1825 Try \`$[0] --help' for more information.]) ;;
1826
1827     *) AC_MSG_ERROR([unrecognized argument: $[1]
1828 Try \`$[0] --help' for more information.]) ;;
1829   esac
1830   shift
1831 done
1832
1833 if $lt_cl_silent; then
1834   exec AS_MESSAGE_FD>/dev/null
1835 fi
1836 _LTEOF
1837
1838 cat >>"$CONFIG_LT" <<_LTEOF
1839 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1840 _LTEOF
1841
1842 cat >>"$CONFIG_LT" <<\_LTEOF
1843 AC_MSG_NOTICE([creating $ofile])
1844 _LT_OUTPUT_LIBTOOL_COMMANDS
1845 AS_EXIT(0)
1846 _LTEOF
1847 chmod +x "$CONFIG_LT"
1848
1849 # configure is writing to config.log, but config.lt does its own redirection,
1850 # appending to config.log, which fails on DOS, as config.log is still kept
1851 # open by configure.  Here we exec the FD to /dev/null, effectively closing
1852 # config.log, so it can be properly (re)opened and appended to by config.lt.
1853 lt_cl_success=:
1854 test "$silent" = yes &&
1855   lt_config_lt_args="$lt_config_lt_args --quiet"
1856 exec AS_MESSAGE_LOG_FD>/dev/null
1857 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1858 exec AS_MESSAGE_LOG_FD>>config.log
1859 $lt_cl_success || AS_EXIT(1)
1860 ])# LT_OUTPUT
1861
1862
1863 # _LT_CONFIG(TAG)
1864 # ---------------
1865 # If TAG is the built-in tag, create an initial libtool script with a
1866 # default configuration from the untagged config vars.  Otherwise add code
1867 # to config.status for appending the configuration named by TAG from the
1868 # matching tagged config vars.
1869 m4_defun([_LT_CONFIG],
1870 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1871 _LT_CONFIG_SAVE_COMMANDS([
1872   m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1873   m4_if(_LT_TAG, [C], [
1874     # See if we are running on zsh, and set the options which allow our
1875     # commands through without removal of \ escapes.
1876     if test -n "${ZSH_VERSION+set}" ; then
1877       setopt NO_GLOB_SUBST
1878     fi
1879
1880     cfgfile="${ofile}T"
1881     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1882     $RM "$cfgfile"
1883
1884     cat <<_LT_EOF >> "$cfgfile"
1885 #! $SHELL
1886
1887 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1888 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1889 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1890 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
1891 #
1892 _LT_COPYING
1893 _LT_LIBTOOL_TAGS
1894
1895 # ### BEGIN LIBTOOL CONFIG
1896 _LT_LIBTOOL_CONFIG_VARS
1897 _LT_LIBTOOL_TAG_VARS
1898 # ### END LIBTOOL CONFIG
1899
1900 _LT_EOF
1901
1902   case $host_os in
1903   aix3*)
1904     cat <<\_LT_EOF >> "$cfgfile"
1905 # AIX sometimes has problems with the GCC collect2 program.  For some
1906 # reason, if we set the COLLECT_NAMES environment variable, the problems
1907 # vanish in a puff of smoke.
1908 if test "X${COLLECT_NAMES+set}" != Xset; then
1909   COLLECT_NAMES=
1910   export COLLECT_NAMES
1911 fi
1912 _LT_EOF
1913     ;;
1914   esac
1915
1916   _LT_PROG_LTMAIN
1917
1918   # We use sed instead of cat because bash on DJGPP gets confused if
1919   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1920   # text mode, it properly converts lines to CR/LF.  This bash problem
1921   # is reportedly fixed, but why not run on old versions too?
1922   sed '$q' "$ltmain" >> "$cfgfile" \
1923      || (rm -f "$cfgfile"; exit 1)
1924
1925   _LT_PROG_REPLACE_SHELLFNS
1926
1927    mv -f "$cfgfile" "$ofile" ||
1928     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1929   chmod +x "$ofile"
1930 ],
1931 [cat <<_LT_EOF >> "$ofile"
1932
1933 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1934 dnl in a comment (ie after a #).
1935 # ### BEGIN LIBTOOL TAG CONFIG: $1
1936 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
1937 # ### END LIBTOOL TAG CONFIG: $1
1938 _LT_EOF
1939 ])dnl /m4_if
1940 ],
1941 [m4_if([$1], [], [
1942     PACKAGE='$PACKAGE'
1943     VERSION='$VERSION'
1944     TIMESTAMP='$TIMESTAMP'
1945     RM='$RM'
1946     ofile='$ofile'], [])
1947 ])dnl /_LT_CONFIG_SAVE_COMMANDS
1948 ])# _LT_CONFIG
1949
1950
1951 # LT_SUPPORTED_TAG(TAG)
1952 # ---------------------
1953 # Trace this macro to discover what tags are supported by the libtool
1954 # --tag option, using:
1955 #    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1956 AC_DEFUN([LT_SUPPORTED_TAG], [])
1957
1958
1959 # C support is built-in for now
1960 m4_define([_LT_LANG_C_enabled], [])
1961 m4_define([_LT_TAGS], [])
1962
1963
1964 # LT_LANG(LANG)
1965 # -------------
1966 # Enable libtool support for the given language if not already enabled.
1967 AC_DEFUN([LT_LANG],
1968 [AC_BEFORE([$0], [LT_OUTPUT])dnl
1969 m4_case([$1],
1970   [C],                  [_LT_LANG(C)],
1971   [C++],                [_LT_LANG(CXX)],
1972   [Java],               [_LT_LANG(GCJ)],
1973   [Fortran 77],         [_LT_LANG(F77)],
1974   [Fortran],            [_LT_LANG(FC)],
1975   [Windows Resource],   [_LT_LANG(RC)],
1976   [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1977     [_LT_LANG($1)],
1978     [m4_fatal([$0: unsupported language: "$1"])])])dnl
1979 ])# LT_LANG
1980
1981
1982 # _LT_LANG(LANGNAME)
1983 # ------------------
1984 m4_defun([_LT_LANG],
1985 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
1986   [LT_SUPPORTED_TAG([$1])dnl
1987   m4_append([_LT_TAGS], [$1 ])dnl
1988   m4_define([_LT_LANG_]$1[_enabled], [])dnl
1989   _LT_LANG_$1_CONFIG($1)])dnl
1990 ])# _LT_LANG
1991
1992
1993 # _LT_LANG_DEFAULT_CONFIG
1994 # -----------------------
1995 m4_defun([_LT_LANG_DEFAULT_CONFIG],
1996 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
1997   [LT_LANG(CXX)],
1998   [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1999
2000 AC_PROVIDE_IFELSE([AC_PROG_F77],
2001   [LT_LANG(F77)],
2002   [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
2003
2004 AC_PROVIDE_IFELSE([AC_PROG_FC],
2005   [LT_LANG(FC)],
2006   [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
2007
2008 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
2009 dnl pulling things in needlessly.
2010 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
2011   [LT_LANG(GCJ)],
2012   [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
2013     [LT_LANG(GCJ)],
2014     [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
2015       [LT_LANG(GCJ)],
2016       [m4_ifdef([AC_PROG_GCJ],
2017         [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
2018        m4_ifdef([A][M_PROG_GCJ],
2019         [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
2020        m4_ifdef([LT_PROG_GCJ],
2021         [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
2022
2023 AC_PROVIDE_IFELSE([LT_PROG_RC],
2024   [LT_LANG(RC)],
2025   [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
2026 ])# _LT_LANG_DEFAULT_CONFIG
2027
2028 # Obsolete macros:
2029 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
2030 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
2031 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
2032 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
2033 AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
2034 dnl aclocal-1.4 backwards compatibility:
2035 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
2036 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
2037 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
2038 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
2039 dnl AC_DEFUN([AC_LIBTOOL_RC], [])
2040
2041
2042 # _LT_TAG_COMPILER
2043 # ----------------
2044 m4_defun([_LT_TAG_COMPILER],
2045 [AC_REQUIRE([AC_PROG_CC])dnl
2046
2047 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
2048 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
2049 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
2050 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
2051
2052 # If no C compiler was specified, use CC.
2053 LTCC=${LTCC-"$CC"}
2054
2055 # If no C compiler flags were specified, use CFLAGS.
2056 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2057
2058 # Allow CC to be a program name with arguments.
2059 compiler=$CC
2060 ])# _LT_TAG_COMPILER
2061
2062
2063 # _LT_COMPILER_BOILERPLATE
2064 # ------------------------
2065 # Check for compiler boilerplate output or warnings with
2066 # the simple compiler test code.
2067 m4_defun([_LT_COMPILER_BOILERPLATE],
2068 [m4_require([_LT_DECL_SED])dnl
2069 ac_outfile=conftest.$ac_objext
2070 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
2071 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2072 _lt_compiler_boilerplate=`cat conftest.err`
2073 $RM conftest*
2074 ])# _LT_COMPILER_BOILERPLATE
2075
2076
2077 # _LT_LINKER_BOILERPLATE
2078 # ----------------------
2079 # Check for linker boilerplate output or warnings with
2080 # the simple link test code.
2081 m4_defun([_LT_LINKER_BOILERPLATE],
2082 [m4_require([_LT_DECL_SED])dnl
2083 ac_outfile=conftest.$ac_objext
2084 echo "$lt_simple_link_test_code" >conftest.$ac_ext
2085 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2086 _lt_linker_boilerplate=`cat conftest.err`
2087 $RM -r conftest*
2088 ])# _LT_LINKER_BOILERPLATE
2089
2090 # _LT_REQUIRED_DARWIN_CHECKS
2091 # -------------------------
2092 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
2093   case $host_os in
2094     rhapsody* | darwin*)
2095     AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
2096     AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
2097     AC_CHECK_TOOL([LIPO], [lipo], [:])
2098     AC_CHECK_TOOL([OTOOL], [otool], [:])
2099     AC_CHECK_TOOL([OTOOL64], [otool64], [:])
2100     _LT_DECL([], [DSYMUTIL], [1],
2101       [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
2102     _LT_DECL([], [NMEDIT], [1],
2103       [Tool to change global to local symbols on Mac OS X])
2104     _LT_DECL([], [LIPO], [1],
2105       [Tool to manipulate fat objects and archives on Mac OS X])
2106     _LT_DECL([], [OTOOL], [1],
2107       [ldd/readelf like tool for Mach-O binaries on Mac OS X])
2108     _LT_DECL([], [OTOOL64], [1],
2109       [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2110
2111     AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
2112       [lt_cv_apple_cc_single_mod=no
2113       if test -z "${LT_MULTI_MODULE}"; then
2114         # By default we will add the -single_module flag. You can override
2115         # by either setting the environment variable LT_MULTI_MODULE
2116         # non-empty at configure time, or by adding -multi_module to the
2117         # link flags.
2118         rm -rf libconftest.dylib*
2119         echo "int foo(void){return 1;}" > conftest.c
2120         echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2121 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
2122         $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
2123           -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
2124         _lt_result=$?
2125         if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
2126           lt_cv_apple_cc_single_mod=yes
2127         else
2128           cat conftest.err >&AS_MESSAGE_LOG_FD
2129         fi
2130         rm -rf libconftest.dylib*
2131         rm -f conftest.*
2132       fi])
2133     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
2134       [lt_cv_ld_exported_symbols_list],
2135       [lt_cv_ld_exported_symbols_list=no
2136       save_LDFLAGS=$LDFLAGS
2137       echo "_main" > conftest.sym
2138       LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
2139       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2140         [lt_cv_ld_exported_symbols_list=yes],
2141         [lt_cv_ld_exported_symbols_list=no])
2142         LDFLAGS="$save_LDFLAGS"
2143     ])
2144     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2145       [lt_cv_ld_force_load=no
2146       cat > conftest.c << _LT_EOF
2147 int forced_loaded() { return 2;}
2148 _LT_EOF
2149       echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2150       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2151       echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2152       $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2153       echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2154       $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2155       cat > conftest.c << _LT_EOF
2156 int main() { return 0;}
2157 _LT_EOF
2158       echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2159       $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2160       _lt_result=$?
2161       if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
2162         lt_cv_ld_force_load=yes
2163       else
2164         cat conftest.err >&AS_MESSAGE_LOG_FD
2165       fi
2166         rm -f conftest.err libconftest.a conftest conftest.c
2167         rm -rf conftest.dSYM
2168     ])
2169     case $host_os in
2170     rhapsody* | darwin1.[[012]])
2171       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2172     darwin1.*)
2173       _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2174     darwin*) # darwin 5.x on
2175       # if running on 10.5 or later, the deployment target defaults
2176       # to the OS version, if on x86, and 10.4, the deployment
2177       # target defaults to 10.4. Don't you love it?
2178       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2179         10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2180           _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2181         10.[[012]]*)
2182           _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2183         10.*)
2184           _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2185       esac
2186     ;;
2187   esac
2188     if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2189       _lt_dar_single_mod='$single_module'
2190     fi
2191     if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2192       _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2193     else
2194       _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2195     fi
2196     if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2197       _lt_dsymutil='~$DSYMUTIL $lib || :'
2198     else
2199       _lt_dsymutil=
2200     fi
2201     ;;
2202   esac
2203 ])
2204
2205
2206 # _LT_DARWIN_LINKER_FEATURES
2207 # --------------------------
2208 # Checks for linker and compiler features on darwin
2209 m4_defun([_LT_DARWIN_LINKER_FEATURES],
2210 [
2211   m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2212   _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2213   _LT_TAGVAR(hardcode_direct, $1)=no
2214   _LT_TAGVAR(hardcode_automatic, $1)=yes
2215   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2216   if test "$lt_cv_ld_force_load" = "yes"; then
2217     _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\"`'
2218   else
2219     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2220   fi
2221   _LT_TAGVAR(link_all_deplibs, $1)=yes
2222   _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2223   case $cc_basename in
2224      ifort*) _lt_dar_can_shared=yes ;;
2225      *) _lt_dar_can_shared=$GCC ;;
2226   esac
2227   if test "$_lt_dar_can_shared" = "yes"; then
2228     output_verbose_link_cmd=func_echo_all
2229     _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}"
2230     _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2231     _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}"
2232     _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}"
2233     m4_if([$1], [CXX],
2234 [   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2235       _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}"
2236       _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}"
2237     fi
2238 ],[])
2239   else
2240   _LT_TAGVAR(ld_shlibs, $1)=no
2241   fi
2242 ])
2243
2244 # _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2245 # ----------------------------------
2246 # Links a minimal program and checks the executable
2247 # for the system default hardcoded library path. In most cases,
2248 # this is /usr/lib:/lib, but when the MPI compilers are used
2249 # the location of the communication and MPI libs are included too.
2250 # If we don't find anything, use the default library path according
2251 # to the aix ld manual.
2252 # Store the results from the different compilers for each TAGNAME.
2253 # Allow to override them for all tags through lt_cv_aix_libpath.
2254 m4_defun([_LT_SYS_MODULE_PATH_AIX],
2255 [m4_require([_LT_DECL_SED])dnl
2256 if test "${lt_cv_aix_libpath+set}" = set; then
2257   aix_libpath=$lt_cv_aix_libpath
2258 else
2259   AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2260   [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2261   lt_aix_libpath_sed='[
2262       /Import File Strings/,/^$/ {
2263           /^0/ {
2264               s/^0  *\([^ ]*\) *$/\1/
2265               p
2266           }
2267       }]'
2268   _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2269   # Check for a 64-bit object if we didn't find anything.
2270   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2271     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2272   fi],[])
2273   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2274     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2275   fi
2276   ])
2277   aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2278 fi
2279 ])# _LT_SYS_MODULE_PATH_AIX
2280
2281
2282 # _LT_SHELL_INIT(ARG)
2283 # -------------------
2284 m4_define([_LT_SHELL_INIT],
2285 [m4_divert_text([M4SH-INIT], [$1
2286 ])])# _LT_SHELL_INIT
2287
2288
2289
2290 # _LT_PROG_ECHO_BACKSLASH
2291 # -----------------------
2292 # Find how we can fake an echo command that does not interpret backslash.
2293 # In particular, with Autoconf 2.60 or later we add some code to the start
2294 # of the generated configure script which will find a shell with a builtin
2295 # printf (which we can use as an echo command).
2296 m4_defun([_LT_PROG_ECHO_BACKSLASH],
2297 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2298 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2299 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2300
2301 AC_MSG_CHECKING([how to print strings])
2302 # Test print first, because it will be a builtin if present.
2303 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2304    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2305   ECHO='print -r --'
2306 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2307   ECHO='printf %s\n'
2308 else
2309   # Use this function as a fallback that always works.
2310   func_fallback_echo ()
2311   {
2312     eval 'cat <<_LTECHO_EOF
2313 $[]1
2314 _LTECHO_EOF'
2315   }
2316   ECHO='func_fallback_echo'
2317 fi
2318
2319 # func_echo_all arg...
2320 # Invoke $ECHO with all args, space-separated.
2321 func_echo_all ()
2322 {
2323     $ECHO "$*" 
2324 }
2325
2326 case "$ECHO" in
2327   printf*) AC_MSG_RESULT([printf]) ;;
2328   print*) AC_MSG_RESULT([print -r]) ;;
2329   *) AC_MSG_RESULT([cat]) ;;
2330 esac
2331
2332 m4_ifdef([_AS_DETECT_SUGGESTED],
2333 [_AS_DETECT_SUGGESTED([
2334   test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2335     ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2336     ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2337     ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2338     PATH=/empty FPATH=/empty; export PATH FPATH
2339     test "X`printf %s $ECHO`" = "X$ECHO" \
2340       || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2341
2342 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2343 _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2344 ])# _LT_PROG_ECHO_BACKSLASH
2345
2346
2347 # _LT_WITH_SYSROOT
2348 # ----------------
2349 AC_DEFUN([_LT_WITH_SYSROOT],
2350 [AC_MSG_CHECKING([for sysroot])
2351 AC_ARG_WITH([sysroot],
2352 [  --with-sysroot[=DIR] Search for dependent libraries within DIR
2353                         (or the compiler's sysroot if not specified).],
2354 [], [with_sysroot=no])
2355
2356 dnl lt_sysroot will always be passed unquoted.  We quote it here
2357 dnl in case the user passed a directory name.
2358 lt_sysroot=
2359 case ${with_sysroot} in #(
2360  yes)
2361    if test "$GCC" = yes; then
2362      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2363    fi
2364    ;; #(
2365  /*)
2366    lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2367    ;; #(
2368  no|'')
2369    ;; #(
2370  *)
2371    AC_MSG_RESULT([${with_sysroot}])
2372    AC_MSG_ERROR([The sysroot must be an absolute path.])
2373    ;;
2374 esac
2375
2376  AC_MSG_RESULT([${lt_sysroot:-no}])
2377 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2378 [dependent libraries, and in which our libraries should be installed.])])
2379
2380 # _LT_ENABLE_LOCK
2381 # ---------------
2382 m4_defun([_LT_ENABLE_LOCK],
2383 [AC_ARG_ENABLE([libtool-lock],
2384   [AS_HELP_STRING([--disable-libtool-lock],
2385     [avoid locking (might break parallel builds)])])
2386 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2387
2388 # Some flags need to be propagated to the compiler or linker for good
2389 # libtool support.
2390 case $host in
2391 ia64-*-hpux*)
2392   # Find out which ABI we are using.
2393   echo 'int i;' > conftest.$ac_ext
2394   if AC_TRY_EVAL(ac_compile); then
2395     case `/usr/bin/file conftest.$ac_objext` in
2396       *ELF-32*)
2397         HPUX_IA64_MODE="32"
2398         ;;
2399       *ELF-64*)
2400         HPUX_IA64_MODE="64"
2401         ;;
2402     esac
2403   fi
2404   rm -rf conftest*
2405   ;;
2406 *-*-irix6*)
2407   # Find out which ABI we are using.
2408   echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2409   if AC_TRY_EVAL(ac_compile); then
2410     if test "$lt_cv_prog_gnu_ld" = yes; then
2411       case `/usr/bin/file conftest.$ac_objext` in
2412         *32-bit*)
2413           LD="${LD-ld} -melf32bsmip"
2414           ;;
2415         *N32*)
2416           LD="${LD-ld} -melf32bmipn32"
2417           ;;
2418         *64-bit*)
2419           LD="${LD-ld} -melf64bmip"
2420         ;;
2421       esac
2422     else
2423       case `/usr/bin/file conftest.$ac_objext` in
2424         *32-bit*)
2425           LD="${LD-ld} -32"
2426           ;;
2427         *N32*)
2428           LD="${LD-ld} -n32"
2429           ;;
2430         *64-bit*)
2431           LD="${LD-ld} -64"
2432           ;;
2433       esac
2434     fi
2435   fi
2436   rm -rf conftest*
2437   ;;
2438
2439 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2440 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2441   # Find out which ABI we are using.
2442   echo 'int i;' > conftest.$ac_ext
2443   if AC_TRY_EVAL(ac_compile); then
2444     case `/usr/bin/file conftest.o` in
2445       *32-bit*)
2446         case $host in
2447           x86_64-*kfreebsd*-gnu)
2448             LD="${LD-ld} -m elf_i386_fbsd"
2449             ;;
2450           x86_64-*linux*)
2451             LD="${LD-ld} -m elf_i386"
2452             ;;
2453           ppc64-*linux*|powerpc64-*linux*)
2454             LD="${LD-ld} -m elf32ppclinux"
2455             ;;
2456           s390x-*linux*)
2457             LD="${LD-ld} -m elf_s390"
2458             ;;
2459           sparc64-*linux*)
2460             LD="${LD-ld} -m elf32_sparc"
2461             ;;
2462         esac
2463         ;;
2464       *64-bit*)
2465         case $host in
2466           x86_64-*kfreebsd*-gnu)
2467             LD="${LD-ld} -m elf_x86_64_fbsd"
2468             ;;
2469           x86_64-*linux*)
2470             LD="${LD-ld} -m elf_x86_64"
2471             ;;
2472           ppc*-*linux*|powerpc*-*linux*)
2473             LD="${LD-ld} -m elf64ppc"
2474             ;;
2475           s390*-*linux*|s390*-*tpf*)
2476             LD="${LD-ld} -m elf64_s390"
2477             ;;
2478           sparc*-*linux*)
2479             LD="${LD-ld} -m elf64_sparc"
2480             ;;
2481         esac
2482         ;;
2483     esac
2484   fi
2485   rm -rf conftest*
2486   ;;
2487
2488 *-*-sco3.2v5*)
2489   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2490   SAVE_CFLAGS="$CFLAGS"
2491   CFLAGS="$CFLAGS -belf"
2492   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2493     [AC_LANG_PUSH(C)
2494      AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2495      AC_LANG_POP])
2496   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2497     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2498     CFLAGS="$SAVE_CFLAGS"
2499   fi
2500   ;;
2501 sparc*-*solaris*)
2502   # Find out which ABI we are using.
2503   echo 'int i;' > conftest.$ac_ext
2504   if AC_TRY_EVAL(ac_compile); then
2505     case `/usr/bin/file conftest.o` in
2506     *64-bit*)
2507       case $lt_cv_prog_gnu_ld in
2508       yes*) LD="${LD-ld} -m elf64_sparc" ;;
2509       *)
2510         if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2511           LD="${LD-ld} -64"
2512         fi
2513         ;;
2514       esac
2515       ;;
2516     esac
2517   fi
2518   rm -rf conftest*
2519   ;;
2520 esac
2521
2522 need_locks="$enable_libtool_lock"
2523 ])# _LT_ENABLE_LOCK
2524
2525
2526 # _LT_PROG_AR
2527 # -----------
2528 m4_defun([_LT_PROG_AR],
2529 [AC_CHECK_TOOLS(AR, [ar], false)
2530 : ${AR=ar}
2531 : ${AR_FLAGS=cru}
2532 _LT_DECL([], [AR], [1], [The archiver])
2533 _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2534
2535 AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2536   [lt_cv_ar_at_file=no
2537    AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2538      [echo conftest.$ac_objext > conftest.lst
2539       lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2540       AC_TRY_EVAL([lt_ar_try])
2541       if test "$ac_status" -eq 0; then
2542         # Ensure the archiver fails upon bogus file names.
2543         rm -f conftest.$ac_objext libconftest.a
2544         AC_TRY_EVAL([lt_ar_try])
2545         if test "$ac_status" -ne 0; then
2546           lt_cv_ar_at_file=@
2547         fi
2548       fi
2549       rm -f conftest.* libconftest.a
2550      ])
2551   ])
2552
2553 if test "x$lt_cv_ar_at_file" = xno; then
2554   archiver_list_spec=
2555 else
2556   archiver_list_spec=$lt_cv_ar_at_file
2557 fi
2558 _LT_DECL([], [archiver_list_spec], [1],
2559   [How to feed a file listing to the archiver])
2560 ])# _LT_PROG_AR
2561
2562
2563 # _LT_CMD_OLD_ARCHIVE
2564 # -------------------
2565 m4_defun([_LT_CMD_OLD_ARCHIVE],
2566 [_LT_PROG_AR
2567
2568 AC_CHECK_TOOL(STRIP, strip, :)
2569 test -z "$STRIP" && STRIP=:
2570 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
2571
2572 AC_CHECK_TOOL(RANLIB, ranlib, :)
2573 test -z "$RANLIB" && RANLIB=:
2574 _LT_DECL([], [RANLIB], [1],
2575     [Commands used to install an old-style archive])
2576
2577 # Determine commands to create old-style static archives.
2578 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2579 old_postinstall_cmds='chmod 644 $oldlib'
2580 old_postuninstall_cmds=
2581
2582 if test -n "$RANLIB"; then
2583   case $host_os in
2584   openbsd*)
2585     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
2586     ;;
2587   *)
2588     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
2589     ;;
2590   esac
2591   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
2592 fi
2593
2594 case $host_os in
2595   darwin*)
2596     lock_old_archive_extraction=yes ;;
2597   *)
2598     lock_old_archive_extraction=no ;;
2599 esac
2600 _LT_DECL([], [old_postinstall_cmds], [2])
2601 _LT_DECL([], [old_postuninstall_cmds], [2])
2602 _LT_TAGDECL([], [old_archive_cmds], [2],
2603     [Commands used to build an old-style archive])
2604 _LT_DECL([], [lock_old_archive_extraction], [0],
2605     [Whether to use a lock for old archive extraction])
2606 ])# _LT_CMD_OLD_ARCHIVE
2607
2608
2609 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2610 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2611 # ----------------------------------------------------------------
2612 # Check whether the given compiler option works
2613 AC_DEFUN([_LT_COMPILER_OPTION],
2614 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2615 m4_require([_LT_DECL_SED])dnl
2616 AC_CACHE_CHECK([$1], [$2],
2617   [$2=no
2618    m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2619    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2620    lt_compiler_flag="$3"
2621    # Insert the option either (1) after the last *FLAGS variable, or
2622    # (2) before a word containing "conftest.", or (3) at the end.
2623    # Note that $ac_compile itself does not contain backslashes and begins
2624    # with a dollar sign (not a hyphen), so the echo should work correctly.
2625    # The option is referenced via a variable to avoid confusing sed.
2626    lt_compile=`echo "$ac_compile" | $SED \
2627    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2628    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2629    -e 's:$: $lt_compiler_flag:'`
2630    (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2631    (eval "$lt_compile" 2>conftest.err)
2632    ac_status=$?
2633    cat conftest.err >&AS_MESSAGE_LOG_FD
2634    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2635    if (exit $ac_status) && test -s "$ac_outfile"; then
2636      # The compiler can only warn and ignore the option if not recognized
2637      # So say no if there are warnings other than the usual output.
2638      $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2639      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2640      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2641        $2=yes
2642      fi
2643    fi
2644    $RM conftest*
2645 ])
2646
2647 if test x"[$]$2" = xyes; then
2648     m4_if([$5], , :, [$5])
2649 else
2650     m4_if([$6], , :, [$6])
2651 fi
2652 ])# _LT_COMPILER_OPTION
2653
2654 # Old name:
2655 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2656 dnl aclocal-1.4 backwards compatibility:
2657 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2658
2659
2660 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2661 #                  [ACTION-SUCCESS], [ACTION-FAILURE])
2662 # ----------------------------------------------------
2663 # Check whether the given linker option works
2664 AC_DEFUN([_LT_LINKER_OPTION],
2665 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2666 m4_require([_LT_DECL_SED])dnl
2667 AC_CACHE_CHECK([$1], [$2],
2668   [$2=no
2669    save_LDFLAGS="$LDFLAGS"
2670    LDFLAGS="$LDFLAGS $3"
2671    echo "$lt_simple_link_test_code" > conftest.$ac_ext
2672    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2673      # The linker can only warn and ignore the option if not recognized
2674      # So say no if there are warnings
2675      if test -s conftest.err; then
2676        # Append any errors to the config.log.
2677        cat conftest.err 1>&AS_MESSAGE_LOG_FD
2678        $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2679        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2680        if diff conftest.exp conftest.er2 >/dev/null; then
2681          $2=yes
2682        fi
2683      else
2684        $2=yes
2685      fi
2686    fi
2687    $RM -r conftest*
2688    LDFLAGS="$save_LDFLAGS"
2689 ])
2690
2691 if test x"[$]$2" = xyes; then
2692     m4_if([$4], , :, [$4])
2693 else
2694     m4_if([$5], , :, [$5])
2695 fi
2696 ])# _LT_LINKER_OPTION
2697
2698 # Old name:
2699 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2700 dnl aclocal-1.4 backwards compatibility:
2701 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2702
2703
2704 # LT_CMD_MAX_LEN
2705 #---------------
2706 AC_DEFUN([LT_CMD_MAX_LEN],
2707 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2708 # find the maximum length of command line arguments
2709 AC_MSG_CHECKING([the maximum length of command line arguments])
2710 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2711   i=0
2712   teststring="ABCD"
2713
2714   case $build_os in
2715   msdosdjgpp*)
2716     # On DJGPP, this test can blow up pretty badly due to problems in libc
2717     # (any single argument exceeding 2000 bytes causes a buffer overrun
2718     # during glob expansion).  Even if it were fixed, the result of this
2719     # check would be larger than it should be.
2720     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2721     ;;
2722
2723   gnu*)
2724     # Under GNU Hurd, this test is not required because there is
2725     # no limit to the length of command line arguments.
2726     # Libtool will interpret -1 as no limit whatsoever
2727     lt_cv_sys_max_cmd_len=-1;
2728     ;;
2729
2730   cygwin* | mingw* | cegcc*)
2731     # On Win9x/ME, this test blows up -- it succeeds, but takes
2732     # about 5 minutes as the teststring grows exponentially.
2733     # Worse, since 9x/ME are not pre-emptively multitasking,
2734     # you end up with a "frozen" computer, even though with patience
2735     # the test eventually succeeds (with a max line length of 256k).
2736     # Instead, let's just punt: use the minimum linelength reported by
2737     # all of the supported platforms: 8192 (on NT/2K/XP).
2738     lt_cv_sys_max_cmd_len=8192;
2739     ;;
2740
2741   mint*)
2742     # On MiNT this can take a long time and run out of memory.
2743     lt_cv_sys_max_cmd_len=8192;
2744     ;;
2745
2746   amigaos*)
2747     # On AmigaOS with pdksh, this test takes hours, literally.
2748     # So we just punt and use a minimum line length of 8192.
2749     lt_cv_sys_max_cmd_len=8192;
2750     ;;
2751
2752   netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2753     # This has been around since 386BSD, at least.  Likely further.
2754     if test -x /sbin/sysctl; then
2755       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2756     elif test -x /usr/sbin/sysctl; then
2757       lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2758     else
2759       lt_cv_sys_max_cmd_len=65536       # usable default for all BSDs
2760     fi
2761     # And add a safety zone
2762     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2763     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2764     ;;
2765
2766   interix*)
2767     # We know the value 262144 and hardcode it with a safety zone (like BSD)
2768     lt_cv_sys_max_cmd_len=196608
2769     ;;
2770
2771   osf*)
2772     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2773     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2774     # nice to cause kernel panics so lets avoid the loop below.
2775     # First set a reasonable default.
2776     lt_cv_sys_max_cmd_len=16384
2777     #
2778     if test -x /sbin/sysconfig; then
2779       case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2780         *1*) lt_cv_sys_max_cmd_len=-1 ;;
2781       esac
2782     fi
2783     ;;
2784   sco3.2v5*)
2785     lt_cv_sys_max_cmd_len=102400
2786     ;;
2787   sysv5* | sco5v6* | sysv4.2uw2*)
2788     kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2789     if test -n "$kargmax"; then
2790       lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[         ]]//'`
2791     else
2792       lt_cv_sys_max_cmd_len=32768
2793     fi
2794     ;;
2795   *)
2796     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2797     if test -n "$lt_cv_sys_max_cmd_len"; then
2798       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2799       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2800     else
2801       # Make teststring a little bigger before we do anything with it.
2802       # a 1K string should be a reasonable start.
2803       for i in 1 2 3 4 5 6 7 8 ; do
2804         teststring=$teststring$teststring
2805       done
2806       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2807       # If test is not a shell built-in, we'll probably end up computing a
2808       # maximum length that is only half of the actual maximum length, but
2809       # we can't tell.
2810       while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
2811                  = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2812               test $i != 17 # 1/2 MB should be enough
2813       do
2814         i=`expr $i + 1`
2815         teststring=$teststring$teststring
2816       done
2817       # Only check the string length outside the loop.
2818       lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2819       teststring=
2820       # Add a significant safety factor because C++ compilers can tack on
2821       # massive amounts of additional arguments before passing them to the
2822       # linker.  It appears as though 1/2 is a usable value.
2823       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2824     fi
2825     ;;
2826   esac
2827 ])
2828 if test -n $lt_cv_sys_max_cmd_len ; then
2829   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2830 else
2831   AC_MSG_RESULT(none)
2832 fi
2833 max_cmd_len=$lt_cv_sys_max_cmd_len
2834 _LT_DECL([], [max_cmd_len], [0],
2835     [What is the maximum length of a command?])
2836 ])# LT_CMD_MAX_LEN
2837
2838 # Old name:
2839 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2840 dnl aclocal-1.4 backwards compatibility:
2841 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2842
2843
2844 # _LT_HEADER_DLFCN
2845 # ----------------
2846 m4_defun([_LT_HEADER_DLFCN],
2847 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2848 ])# _LT_HEADER_DLFCN
2849
2850
2851 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2852 #                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2853 # ----------------------------------------------------------------
2854 m4_defun([_LT_TRY_DLOPEN_SELF],
2855 [m4_require([_LT_HEADER_DLFCN])dnl
2856 if test "$cross_compiling" = yes; then :
2857   [$4]
2858 else
2859   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2860   lt_status=$lt_dlunknown
2861   cat > conftest.$ac_ext <<_LT_EOF
2862 [#line $LINENO "configure"
2863 #include "confdefs.h"
2864
2865 #if HAVE_DLFCN_H
2866 #include <dlfcn.h>
2867 #endif
2868
2869 #include <stdio.h>
2870
2871 #ifdef RTLD_GLOBAL
2872 #  define LT_DLGLOBAL           RTLD_GLOBAL
2873 #else
2874 #  ifdef DL_GLOBAL
2875 #    define LT_DLGLOBAL         DL_GLOBAL
2876 #  else
2877 #    define LT_DLGLOBAL         0
2878 #  endif
2879 #endif
2880
2881 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2882    find out it does not work in some platform. */
2883 #ifndef LT_DLLAZY_OR_NOW
2884 #  ifdef RTLD_LAZY
2885 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
2886 #  else
2887 #    ifdef DL_LAZY
2888 #      define LT_DLLAZY_OR_NOW          DL_LAZY
2889 #    else
2890 #      ifdef RTLD_NOW
2891 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
2892 #      else
2893 #        ifdef DL_NOW
2894 #          define LT_DLLAZY_OR_NOW      DL_NOW
2895 #        else
2896 #          define LT_DLLAZY_OR_NOW      0
2897 #        endif
2898 #      endif
2899 #    endif
2900 #  endif
2901 #endif
2902
2903 /* When -fvisbility=hidden is used, assume the code has been annotated
2904    correspondingly for the symbols needed.  */
2905 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2906 int fnord () __attribute__((visibility("default")));
2907 #endif
2908
2909 int fnord () { return 42; }
2910 int main ()
2911 {
2912   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2913   int status = $lt_dlunknown;
2914
2915   if (self)
2916     {
2917       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2918       else
2919         {
2920           if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2921           else puts (dlerror ());
2922         }
2923       /* dlclose (self); */
2924     }
2925   else
2926     puts (dlerror ());
2927
2928   return status;
2929 }]
2930 _LT_EOF
2931   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2932     (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2933     lt_status=$?
2934     case x$lt_status in
2935       x$lt_dlno_uscore) $1 ;;
2936       x$lt_dlneed_uscore) $2 ;;
2937       x$lt_dlunknown|x*) $3 ;;
2938     esac
2939   else :
2940     # compilation failed
2941     $3
2942   fi
2943 fi
2944 rm -fr conftest*
2945 ])# _LT_TRY_DLOPEN_SELF
2946
2947
2948 # LT_SYS_DLOPEN_SELF
2949 # ------------------
2950 AC_DEFUN([LT_SYS_DLOPEN_SELF],
2951 [m4_require([_LT_HEADER_DLFCN])dnl
2952 if test "x$enable_dlopen" != xyes; then
2953   enable_dlopen=unknown
2954   enable_dlopen_self=unknown
2955   enable_dlopen_self_static=unknown
2956 else
2957   lt_cv_dlopen=no
2958   lt_cv_dlopen_libs=
2959
2960   case $host_os in
2961   beos*)
2962     lt_cv_dlopen="load_add_on"
2963     lt_cv_dlopen_libs=
2964     lt_cv_dlopen_self=yes
2965     ;;
2966
2967   mingw* | pw32* | cegcc*)
2968     lt_cv_dlopen="LoadLibrary"
2969     lt_cv_dlopen_libs=
2970     ;;
2971
2972   cygwin*)
2973     lt_cv_dlopen="dlopen"
2974     lt_cv_dlopen_libs=
2975     ;;
2976
2977   darwin*)
2978   # if libdl is installed we need to link against it
2979     AC_CHECK_LIB([dl], [dlopen],
2980                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2981     lt_cv_dlopen="dyld"
2982     lt_cv_dlopen_libs=
2983     lt_cv_dlopen_self=yes
2984     ])
2985     ;;
2986
2987   *)
2988     AC_CHECK_FUNC([shl_load],
2989           [lt_cv_dlopen="shl_load"],
2990       [AC_CHECK_LIB([dld], [shl_load],
2991             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2992         [AC_CHECK_FUNC([dlopen],
2993               [lt_cv_dlopen="dlopen"],
2994           [AC_CHECK_LIB([dl], [dlopen],
2995                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2996             [AC_CHECK_LIB([svld], [dlopen],
2997                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2998               [AC_CHECK_LIB([dld], [dld_link],
2999                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
3000               ])
3001             ])
3002           ])
3003         ])
3004       ])
3005     ;;
3006   esac
3007
3008   if test "x$lt_cv_dlopen" != xno; then
3009     enable_dlopen=yes
3010   else
3011     enable_dlopen=no
3012   fi
3013
3014   case $lt_cv_dlopen in
3015   dlopen)
3016     save_CPPFLAGS="$CPPFLAGS"
3017     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
3018
3019     save_LDFLAGS="$LDFLAGS"
3020     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
3021
3022     save_LIBS="$LIBS"
3023     LIBS="$lt_cv_dlopen_libs $LIBS"
3024
3025     AC_CACHE_CHECK([whether a program can dlopen itself],
3026           lt_cv_dlopen_self, [dnl
3027           _LT_TRY_DLOPEN_SELF(
3028             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
3029             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
3030     ])
3031
3032     if test "x$lt_cv_dlopen_self" = xyes; then
3033       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
3034       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
3035           lt_cv_dlopen_self_static, [dnl
3036           _LT_TRY_DLOPEN_SELF(
3037             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
3038             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
3039       ])
3040     fi
3041
3042     CPPFLAGS="$save_CPPFLAGS"
3043     LDFLAGS="$save_LDFLAGS"
3044     LIBS="$save_LIBS"
3045     ;;
3046   esac
3047
3048   case $lt_cv_dlopen_self in
3049   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
3050   *) enable_dlopen_self=unknown ;;
3051   esac
3052
3053   case $lt_cv_dlopen_self_static in
3054   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
3055   *) enable_dlopen_self_static=unknown ;;
3056   esac
3057 fi
3058 _LT_DECL([dlopen_support], [enable_dlopen], [0],
3059          [Whether dlopen is supported])
3060 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
3061          [Whether dlopen of programs is supported])
3062 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
3063          [Whether dlopen of statically linked programs is supported])
3064 ])# LT_SYS_DLOPEN_SELF
3065
3066 # Old name:
3067 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
3068 dnl aclocal-1.4 backwards compatibility:
3069 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
3070
3071
3072 # _LT_COMPILER_C_O([TAGNAME])
3073 # ---------------------------
3074 # Check to see if options -c and -o are simultaneously supported by compiler.
3075 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
3076 m4_defun([_LT_COMPILER_C_O],
3077 [m4_require([_LT_DECL_SED])dnl
3078 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3079 m4_require([_LT_TAG_COMPILER])dnl
3080 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3081   [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3082   [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3083    $RM -r conftest 2>/dev/null
3084    mkdir conftest
3085    cd conftest
3086    mkdir out
3087    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3088
3089    lt_compiler_flag="-o out/conftest2.$ac_objext"
3090    # Insert the option either (1) after the last *FLAGS variable, or
3091    # (2) before a word containing "conftest.", or (3) at the end.
3092    # Note that $ac_compile itself does not contain backslashes and begins
3093    # with a dollar sign (not a hyphen), so the echo should work correctly.
3094    lt_compile=`echo "$ac_compile" | $SED \
3095    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3096    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3097    -e 's:$: $lt_compiler_flag:'`
3098    (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3099    (eval "$lt_compile" 2>out/conftest.err)
3100    ac_status=$?
3101    cat out/conftest.err >&AS_MESSAGE_LOG_FD
3102    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3103    if (exit $ac_status) && test -s out/conftest2.$ac_objext
3104    then
3105      # The compiler can only warn and ignore the option if not recognized
3106      # So say no if there are warnings
3107      $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
3108      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3109      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3110        _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3111      fi
3112    fi
3113    chmod u+w . 2>&AS_MESSAGE_LOG_FD
3114    $RM conftest*
3115    # SGI C++ compiler will create directory out/ii_files/ for
3116    # template instantiation
3117    test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3118    $RM out/* && rmdir out
3119    cd ..
3120    $RM -r conftest
3121    $RM conftest*
3122 ])
3123 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3124         [Does compiler simultaneously support -c and -o options?])
3125 ])# _LT_COMPILER_C_O
3126
3127
3128 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
3129 # ----------------------------------
3130 # Check to see if we can do hard links to lock some files if needed
3131 m4_defun([_LT_COMPILER_FILE_LOCKS],
3132 [m4_require([_LT_ENABLE_LOCK])dnl
3133 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3134 _LT_COMPILER_C_O([$1])
3135
3136 hard_links="nottested"
3137 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3138   # do not overwrite the value of need_locks provided by the user
3139   AC_MSG_CHECKING([if we can lock with hard links])
3140   hard_links=yes
3141   $RM conftest*
3142   ln conftest.a conftest.b 2>/dev/null && hard_links=no
3143   touch conftest.a
3144   ln conftest.a conftest.b 2>&5 || hard_links=no
3145   ln conftest.a conftest.b 2>/dev/null && hard_links=no
3146   AC_MSG_RESULT([$hard_links])
3147   if test "$hard_links" = no; then
3148     AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3149     need_locks=warn
3150   fi
3151 else
3152   need_locks=no
3153 fi
3154 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3155 ])# _LT_COMPILER_FILE_LOCKS
3156
3157
3158 # _LT_CHECK_OBJDIR
3159 # ----------------
3160 m4_defun([_LT_CHECK_OBJDIR],
3161 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3162 [rm -f .libs 2>/dev/null
3163 mkdir .libs 2>/dev/null
3164 if test -d .libs; then
3165   lt_cv_objdir=.libs
3166 else
3167   # MS-DOS does not allow filenames that begin with a dot.
3168   lt_cv_objdir=_libs
3169 fi
3170 rmdir .libs 2>/dev/null])
3171 objdir=$lt_cv_objdir
3172 _LT_DECL([], [objdir], [0],
3173          [The name of the directory that contains temporary libtool files])dnl
3174 m4_pattern_allow([LT_OBJDIR])dnl
3175 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3176   [Define to the sub-directory in which libtool stores uninstalled libraries.])
3177 ])# _LT_CHECK_OBJDIR
3178
3179
3180 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3181 # --------------------------------------
3182 # Check hardcoding attributes.
3183 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3184 [AC_MSG_CHECKING([how to hardcode library paths into programs])
3185 _LT_TAGVAR(hardcode_action, $1)=
3186 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3187    test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3188    test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3189
3190   # We can hardcode non-existent directories.
3191   if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3192      # If the only mechanism to avoid hardcoding is shlibpath_var, we
3193      # have to relink, otherwise we might link with an installed library
3194      # when we should be linking with a yet-to-be-installed one
3195      ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3196      test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3197     # Linking always hardcodes the temporary library directory.
3198     _LT_TAGVAR(hardcode_action, $1)=relink
3199   else
3200     # We can link without hardcoding, and we can hardcode nonexisting dirs.
3201     _LT_TAGVAR(hardcode_action, $1)=immediate
3202   fi
3203 else
3204   # We cannot hardcode anything, or else we can only hardcode existing
3205   # directories.
3206   _LT_TAGVAR(hardcode_action, $1)=unsupported
3207 fi
3208 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3209
3210 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3211    test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3212   # Fast installation is not supported
3213   enable_fast_install=no
3214 elif test "$shlibpath_overrides_runpath" = yes ||
3215      test "$enable_shared" = no; then
3216   # Fast installation is not necessary
3217   enable_fast_install=needless
3218 fi
3219 _LT_TAGDECL([], [hardcode_action], [0],
3220     [How to hardcode a shared library path into an executable])
3221 ])# _LT_LINKER_HARDCODE_LIBPATH
3222
3223
3224 # _LT_CMD_STRIPLIB
3225 # ----------------
3226 m4_defun([_LT_CMD_STRIPLIB],
3227 [m4_require([_LT_DECL_EGREP])
3228 striplib=
3229 old_striplib=
3230 AC_MSG_CHECKING([whether stripping libraries is possible])
3231 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3232   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3233   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3234   AC_MSG_RESULT([yes])
3235 else
3236 # FIXME - insert some real tests, host_os isn't really good enough
3237   case $host_os in
3238   darwin*)
3239     if test -n "$STRIP" ; then
3240       striplib="$STRIP -x"
3241       old_striplib="$STRIP -S"
3242       AC_MSG_RESULT([yes])
3243     else
3244       AC_MSG_RESULT([no])
3245     fi
3246     ;;
3247   *)
3248     AC_MSG_RESULT([no])
3249     ;;
3250   esac
3251 fi
3252 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3253 _LT_DECL([], [striplib], [1])
3254 ])# _LT_CMD_STRIPLIB
3255
3256
3257 # _LT_SYS_DYNAMIC_LINKER([TAG])
3258 # -----------------------------
3259 # PORTME Fill in your ld.so characteristics
3260 m4_defun([_LT_SYS_DYNAMIC_LINKER],
3261 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3262 m4_require([_LT_DECL_EGREP])dnl
3263 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3264 m4_require([_LT_DECL_OBJDUMP])dnl
3265 m4_require([_LT_DECL_SED])dnl
3266 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3267 AC_MSG_CHECKING([dynamic linker characteristics])
3268 m4_if([$1],
3269         [], [
3270 if test "$GCC" = yes; then
3271   case $host_os in
3272     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3273     *) lt_awk_arg="/^libraries:/" ;;
3274   esac
3275   case $host_os in
3276     mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3277     *) lt_sed_strip_eq="s,=/,/,g" ;;
3278   esac
3279   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3280   case $lt_search_path_spec in
3281   *\;*)
3282     # if the path contains ";" then we assume it to be the separator
3283     # otherwise default to the standard path separator (i.e. ":") - it is
3284     # assumed that no part of a normal pathname contains ";" but that should
3285     # okay in the real world where ";" in dirpaths is itself problematic.
3286     lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3287     ;;
3288   *)
3289     lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3290     ;;
3291   esac
3292   # Ok, now we have the path, separated by spaces, we can step through it
3293   # and add multilib dir if necessary.
3294   lt_tmp_lt_search_path_spec=
3295   lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3296   for lt_sys_path in $lt_search_path_spec; do
3297     if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3298       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3299     else
3300       test -d "$lt_sys_path" && \
3301         lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3302     fi
3303   done
3304   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3305 BEGIN {RS=" "; FS="/|\n";} {
3306   lt_foo="";
3307   lt_count=0;
3308   for (lt_i = NF; lt_i > 0; lt_i--) {
3309     if ($lt_i != "" && $lt_i != ".") {
3310       if ($lt_i == "..") {
3311         lt_count++;
3312       } else {
3313         if (lt_count == 0) {
3314           lt_foo="/" $lt_i lt_foo;
3315         } else {
3316           lt_count--;
3317         }
3318       }
3319     }
3320   }
3321   if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3322   if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3323 }'`
3324   # AWK program above erroneously prepends '/' to C:/dos/paths
3325   # for these hosts.
3326   case $host_os in
3327     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3328       $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3329   esac
3330   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3331 else
3332   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3333 fi])
3334 library_names_spec=
3335 libname_spec='lib$name'
3336 soname_spec=
3337 shrext_cmds=".so"
3338 postinstall_cmds=
3339 postuninstall_cmds=
3340 finish_cmds=
3341 finish_eval=
3342 shlibpath_var=
3343 shlibpath_overrides_runpath=unknown
3344 version_type=none
3345 dynamic_linker="$host_os ld.so"
3346 sys_lib_dlsearch_path_spec="/lib /usr/lib"
3347 need_lib_prefix=unknown
3348 hardcode_into_libs=no
3349
3350 # when you set need_version to no, make sure it does not cause -set_version
3351 # flags to be left without arguments
3352 need_version=unknown
3353
3354 case $host_os in
3355 aix3*)
3356   version_type=linux
3357   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3358   shlibpath_var=LIBPATH
3359
3360   # AIX 3 has no versioning support, so we append a major version to the name.
3361   soname_spec='${libname}${release}${shared_ext}$major'
3362   ;;
3363
3364 aix[[4-9]]*)
3365   version_type=linux
3366   need_lib_prefix=no
3367   need_version=no
3368   hardcode_into_libs=yes
3369   if test "$host_cpu" = ia64; then
3370     # AIX 5 supports IA64
3371     library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3372     shlibpath_var=LD_LIBRARY_PATH
3373   else
3374     # With GCC up to 2.95.x, collect2 would create an import file
3375     # for dependence libraries.  The import file would start with
3376     # the line `#! .'.  This would cause the generated library to
3377     # depend on `.', always an invalid library.  This was fixed in
3378     # development snapshots of GCC prior to 3.0.
3379     case $host_os in
3380       aix4 | aix4.[[01]] | aix4.[[01]].*)
3381       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3382            echo ' yes '
3383            echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3384         :
3385       else
3386         can_build_shared=no
3387       fi
3388       ;;
3389     esac
3390     # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3391     # soname into executable. Probably we can add versioning support to
3392     # collect2, so additional links can be useful in future.
3393     if test "$aix_use_runtimelinking" = yes; then
3394       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3395       # instead of lib<name>.a to let people know that these are not
3396       # typical AIX shared libraries.
3397       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3398     else
3399       # We preserve .a as extension for shared libraries through AIX4.2
3400       # and later when we are not doing run time linking.
3401       library_names_spec='${libname}${release}.a $libname.a'
3402       soname_spec='${libname}${release}${shared_ext}$major'
3403     fi
3404     shlibpath_var=LIBPATH
3405   fi
3406   ;;
3407
3408 amigaos*)
3409   case $host_cpu in
3410   powerpc)
3411     # Since July 2007 AmigaOS4 officially supports .so libraries.
3412     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3413     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3414     ;;
3415   m68k)
3416     library_names_spec='$libname.ixlibrary $libname.a'
3417     # Create ${libname}_ixlibrary.a entries in /sys/libs.
3418     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'
3419     ;;
3420   esac
3421   ;;
3422
3423 beos*)
3424   library_names_spec='${libname}${shared_ext}'
3425   dynamic_linker="$host_os ld.so"
3426   shlibpath_var=LIBRARY_PATH
3427   ;;
3428
3429 bsdi[[45]]*)
3430   version_type=linux
3431   need_version=no
3432   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3433   soname_spec='${libname}${release}${shared_ext}$major'
3434   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3435   shlibpath_var=LD_LIBRARY_PATH
3436   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3437   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3438   # the default ld.so.conf also contains /usr/contrib/lib and
3439   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3440   # libtool to hard-code these into programs
3441   ;;
3442
3443 cygwin* | mingw* | pw32* | cegcc*)
3444   version_type=windows
3445   shrext_cmds=".dll"
3446   need_version=no
3447   need_lib_prefix=no
3448
3449   case $GCC,$cc_basename in
3450   yes,*)
3451     # gcc
3452     library_names_spec='$libname.dll.a'
3453     # DLL is installed to $(libdir)/../bin by postinstall_cmds
3454     postinstall_cmds='base_file=`basename \${file}`~
3455       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3456       dldir=$destdir/`dirname \$dlpath`~
3457       test -d \$dldir || mkdir -p \$dldir~
3458       $install_prog $dir/$dlname \$dldir/$dlname~
3459       chmod a+x \$dldir/$dlname~
3460       if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3461         eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3462       fi'
3463     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3464       dlpath=$dir/\$dldll~
3465        $RM \$dlpath'
3466     shlibpath_overrides_runpath=yes
3467
3468     case $host_os in
3469     cygwin*)
3470       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3471       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3472 m4_if([$1], [],[
3473       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3474       ;;
3475     mingw* | cegcc*)
3476       # MinGW DLLs use traditional 'lib' prefix
3477       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3478       ;;
3479     pw32*)
3480       # pw32 DLLs use 'pw' prefix rather than 'lib'
3481       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3482       ;;
3483     esac
3484     dynamic_linker='Win32 ld.exe'
3485     ;;
3486
3487   *,cl*)
3488     # Native MSVC
3489     libname_spec='$name'
3490     soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3491     library_names_spec='${libname}.dll.lib'
3492
3493     case $build_os in
3494     mingw*)
3495       sys_lib_search_path_spec=
3496       lt_save_ifs=$IFS
3497       IFS=';'
3498       for lt_path in $LIB
3499       do
3500         IFS=$lt_save_ifs
3501         # Let DOS variable expansion print the short 8.3 style file name.
3502         lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3503         sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3504       done
3505       IFS=$lt_save_ifs
3506       # Convert to MSYS style.
3507       sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3508       ;;
3509     cygwin*)
3510       # Convert to unix form, then to dos form, then back to unix form
3511       # but this time dos style (no spaces!) so that the unix form looks
3512       # like /cygdrive/c/PROGRA~1:/cygdr...
3513       sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3514       sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3515       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3516       ;;
3517     *)
3518       sys_lib_search_path_spec="$LIB"
3519       if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3520         # It is most probably a Windows format PATH.
3521         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3522       else
3523         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3524       fi
3525       # FIXME: find the short name or the path components, as spaces are
3526       # common. (e.g. "Program Files" -> "PROGRA~1")
3527       ;;
3528     esac
3529
3530     # DLL is installed to $(libdir)/../bin by postinstall_cmds
3531     postinstall_cmds='base_file=`basename \${file}`~
3532       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3533       dldir=$destdir/`dirname \$dlpath`~
3534       test -d \$dldir || mkdir -p \$dldir~
3535       $install_prog $dir/$dlname \$dldir/$dlname'
3536     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3537       dlpath=$dir/\$dldll~
3538        $RM \$dlpath'
3539     shlibpath_overrides_runpath=yes
3540     dynamic_linker='Win32 link.exe'
3541     ;;
3542
3543   *)
3544     # Assume MSVC wrapper
3545     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3546     dynamic_linker='Win32 ld.exe'
3547     ;;
3548   esac
3549   # FIXME: first we should search . and the directory the executable is in
3550   shlibpath_var=PATH
3551   ;;
3552
3553 darwin* | rhapsody*)
3554   dynamic_linker="$host_os dyld"
3555   version_type=darwin
3556   need_lib_prefix=no
3557   need_version=no
3558   library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3559   soname_spec='${libname}${release}${major}$shared_ext'
3560   shlibpath_overrides_runpath=yes
3561   shlibpath_var=DYLD_LIBRARY_PATH
3562   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3563 m4_if([$1], [],[
3564   sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3565   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3566   ;;
3567
3568 dgux*)
3569   version_type=linux
3570   need_lib_prefix=no
3571   need_version=no
3572   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3573   soname_spec='${libname}${release}${shared_ext}$major'
3574   shlibpath_var=LD_LIBRARY_PATH
3575   ;;
3576
3577 freebsd1*)
3578   dynamic_linker=no
3579   ;;
3580
3581 freebsd* | dragonfly*)
3582   # DragonFly does not have aout.  When/if they implement a new
3583   # versioning mechanism, adjust this.
3584   if test -x /usr/bin/objformat; then
3585     objformat=`/usr/bin/objformat`
3586   else
3587     case $host_os in
3588     freebsd[[123]]*) objformat=aout ;;
3589     *) objformat=elf ;;
3590     esac
3591   fi
3592   version_type=freebsd-$objformat
3593   case $version_type in
3594     freebsd-elf*)
3595       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3596       need_version=no
3597       need_lib_prefix=no
3598       ;;
3599     freebsd-*)
3600       library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3601       need_version=yes
3602       ;;
3603   esac
3604   shlibpath_var=LD_LIBRARY_PATH
3605   case $host_os in
3606   freebsd2*)
3607     shlibpath_overrides_runpath=yes
3608     ;;
3609   freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3610     shlibpath_overrides_runpath=yes
3611     hardcode_into_libs=yes
3612     ;;
3613   freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3614   freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3615     shlibpath_overrides_runpath=no
3616     hardcode_into_libs=yes
3617     ;;
3618   *) # from 4.6 on, and DragonFly
3619     shlibpath_overrides_runpath=yes
3620     hardcode_into_libs=yes
3621     ;;
3622   esac
3623   ;;
3624
3625 gnu*)
3626   version_type=linux
3627   need_lib_prefix=no
3628   need_version=no
3629   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3630   soname_spec='${libname}${release}${shared_ext}$major'
3631   shlibpath_var=LD_LIBRARY_PATH
3632   hardcode_into_libs=yes
3633   ;;
3634
3635 haiku*)
3636   version_type=linux
3637   need_lib_prefix=no
3638   need_version=no
3639   dynamic_linker="$host_os runtime_loader"
3640   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3641   soname_spec='${libname}${release}${shared_ext}$major'
3642   shlibpath_var=LIBRARY_PATH
3643   shlibpath_overrides_runpath=yes
3644   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3645   hardcode_into_libs=yes
3646   ;;
3647
3648 hpux9* | hpux10* | hpux11*)
3649   # Give a soname corresponding to the major version so that dld.sl refuses to
3650   # link against other versions.
3651   version_type=sunos
3652   need_lib_prefix=no
3653   need_version=no
3654   case $host_cpu in
3655   ia64*)
3656     shrext_cmds='.so'
3657     hardcode_into_libs=yes
3658     dynamic_linker="$host_os dld.so"
3659     shlibpath_var=LD_LIBRARY_PATH
3660     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3661     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3662     soname_spec='${libname}${release}${shared_ext}$major'
3663     if test "X$HPUX_IA64_MODE" = X32; then
3664       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3665     else
3666       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3667     fi
3668     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3669     ;;
3670   hppa*64*)
3671     shrext_cmds='.sl'
3672     hardcode_into_libs=yes
3673     dynamic_linker="$host_os dld.sl"
3674     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3675     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3676     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3677     soname_spec='${libname}${release}${shared_ext}$major'
3678     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3679     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3680     ;;
3681   *)
3682     shrext_cmds='.sl'
3683     dynamic_linker="$host_os dld.sl"
3684     shlibpath_var=SHLIB_PATH
3685     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3686     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3687     soname_spec='${libname}${release}${shared_ext}$major'
3688     ;;
3689   esac
3690   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3691   postinstall_cmds='chmod 555 $lib'
3692   # or fails outright, so override atomically:
3693   install_override_mode=555
3694   ;;
3695
3696 interix[[3-9]]*)
3697   version_type=linux
3698   need_lib_prefix=no
3699   need_version=no
3700   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3701   soname_spec='${libname}${release}${shared_ext}$major'
3702   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3703   shlibpath_var=LD_LIBRARY_PATH
3704   shlibpath_overrides_runpath=no
3705   hardcode_into_libs=yes
3706   ;;
3707
3708 irix5* | irix6* | nonstopux*)
3709   case $host_os in
3710     nonstopux*) version_type=nonstopux ;;
3711     *)
3712         if test "$lt_cv_prog_gnu_ld" = yes; then
3713                 version_type=linux
3714         else
3715                 version_type=irix
3716         fi ;;
3717   esac
3718   need_lib_prefix=no
3719   need_version=no
3720   soname_spec='${libname}${release}${shared_ext}$major'
3721   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3722   case $host_os in
3723   irix5* | nonstopux*)
3724     libsuff= shlibsuff=
3725     ;;
3726   *)
3727     case $LD in # libtool.m4 will add one of these switches to LD
3728     *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3729       libsuff= shlibsuff= libmagic=32-bit;;
3730     *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3731       libsuff=32 shlibsuff=N32 libmagic=N32;;
3732     *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3733       libsuff=64 shlibsuff=64 libmagic=64-bit;;
3734     *) libsuff= shlibsuff= libmagic=never-match;;
3735     esac
3736     ;;
3737   esac
3738   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3739   shlibpath_overrides_runpath=no
3740   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3741   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3742   hardcode_into_libs=yes
3743   ;;
3744
3745 # No shared lib support for Linux oldld, aout, or coff.
3746 linux*oldld* | linux*aout* | linux*coff*)
3747   dynamic_linker=no
3748   ;;
3749
3750 # This must be Linux ELF.
3751 linux* | k*bsd*-gnu | kopensolaris*-gnu)
3752   version_type=linux
3753   need_lib_prefix=no
3754   need_version=no
3755   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3756   soname_spec='${libname}${release}${shared_ext}$major'
3757   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3758   shlibpath_var=LD_LIBRARY_PATH
3759   shlibpath_overrides_runpath=no
3760
3761   # Some binutils ld are patched to set DT_RUNPATH
3762   AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3763     [lt_cv_shlibpath_overrides_runpath=no
3764     save_LDFLAGS=$LDFLAGS
3765     save_libdir=$libdir
3766     eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3767          LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3768     AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3769       [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3770          [lt_cv_shlibpath_overrides_runpath=yes])])
3771     LDFLAGS=$save_LDFLAGS
3772     libdir=$save_libdir
3773     ])
3774   shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3775
3776   # This implies no fast_install, which is unacceptable.
3777   # Some rework will be needed to allow for fast_install
3778   # before this can be enabled.
3779   hardcode_into_libs=yes
3780
3781   # Append ld.so.conf contents to the search path
3782   if test -f /etc/ld.so.conf; then
3783     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' ' '`
3784     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3785   fi
3786
3787   # We used to test for /lib/ld.so.1 and disable shared libraries on
3788   # powerpc, because MkLinux only supported shared libraries with the
3789   # GNU dynamic linker.  Since this was broken with cross compilers,
3790   # most powerpc-linux boxes support dynamic linking these days and
3791   # people can always --disable-shared, the test was removed, and we
3792   # assume the GNU/Linux dynamic linker is in use.
3793   dynamic_linker='GNU/Linux ld.so'
3794   ;;
3795
3796 netbsd*)
3797   version_type=sunos
3798   need_lib_prefix=no
3799   need_version=no
3800   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3801     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3802     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3803     dynamic_linker='NetBSD (a.out) ld.so'
3804   else
3805     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3806     soname_spec='${libname}${release}${shared_ext}$major'
3807     dynamic_linker='NetBSD ld.elf_so'
3808   fi
3809   shlibpath_var=LD_LIBRARY_PATH
3810   shlibpath_overrides_runpath=yes
3811   hardcode_into_libs=yes
3812   ;;
3813
3814 newsos6)
3815   version_type=linux
3816   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3817   shlibpath_var=LD_LIBRARY_PATH
3818   shlibpath_overrides_runpath=yes
3819   ;;
3820
3821 *nto* | *qnx*)
3822   version_type=qnx
3823   need_lib_prefix=no
3824   need_version=no
3825   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3826   soname_spec='${libname}${release}${shared_ext}$major'
3827   shlibpath_var=LD_LIBRARY_PATH
3828   shlibpath_overrides_runpath=no
3829   hardcode_into_libs=yes
3830   dynamic_linker='ldqnx.so'
3831   ;;
3832
3833 openbsd*)
3834   version_type=sunos
3835   sys_lib_dlsearch_path_spec="/usr/lib"
3836   need_lib_prefix=no
3837   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3838   case $host_os in
3839     openbsd3.3 | openbsd3.3.*)  need_version=yes ;;
3840     *)                          need_version=no  ;;
3841   esac
3842   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3843   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3844   shlibpath_var=LD_LIBRARY_PATH
3845   if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3846     case $host_os in
3847       openbsd2.[[89]] | openbsd2.[[89]].*)
3848         shlibpath_overrides_runpath=no
3849         ;;
3850       *)
3851         shlibpath_overrides_runpath=yes
3852         ;;
3853       esac
3854   else
3855     shlibpath_overrides_runpath=yes
3856   fi
3857   ;;
3858
3859 os2*)
3860   libname_spec='$name'
3861   shrext_cmds=".dll"
3862   need_lib_prefix=no
3863   library_names_spec='$libname${shared_ext} $libname.a'
3864   dynamic_linker='OS/2 ld.exe'
3865   shlibpath_var=LIBPATH
3866   ;;
3867
3868 osf3* | osf4* | osf5*)
3869   version_type=osf
3870   need_lib_prefix=no
3871   need_version=no
3872   soname_spec='${libname}${release}${shared_ext}$major'
3873   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3874   shlibpath_var=LD_LIBRARY_PATH
3875   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3876   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3877   ;;
3878
3879 rdos*)
3880   dynamic_linker=no
3881   ;;
3882
3883 solaris*)
3884   version_type=linux
3885   need_lib_prefix=no
3886   need_version=no
3887   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3888   soname_spec='${libname}${release}${shared_ext}$major'
3889   shlibpath_var=LD_LIBRARY_PATH
3890   shlibpath_overrides_runpath=yes
3891   hardcode_into_libs=yes
3892   # ldd complains unless libraries are executable
3893   postinstall_cmds='chmod +x $lib'
3894   ;;
3895
3896 sunos4*)
3897   version_type=sunos
3898   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3899   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3900   shlibpath_var=LD_LIBRARY_PATH
3901   shlibpath_overrides_runpath=yes
3902   if test "$with_gnu_ld" = yes; then
3903     need_lib_prefix=no
3904   fi
3905   need_version=yes
3906   ;;
3907
3908 sysv4 | sysv4.3*)
3909   version_type=linux
3910   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3911   soname_spec='${libname}${release}${shared_ext}$major'
3912   shlibpath_var=LD_LIBRARY_PATH
3913   case $host_vendor in
3914     sni)
3915       shlibpath_overrides_runpath=no
3916       need_lib_prefix=no
3917       runpath_var=LD_RUN_PATH
3918       ;;
3919     siemens)
3920       need_lib_prefix=no
3921       ;;
3922     motorola)
3923       need_lib_prefix=no
3924       need_version=no
3925       shlibpath_overrides_runpath=no
3926       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3927       ;;
3928   esac
3929   ;;
3930
3931 sysv4*MP*)
3932   if test -d /usr/nec ;then
3933     version_type=linux
3934     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3935     soname_spec='$libname${shared_ext}.$major'
3936     shlibpath_var=LD_LIBRARY_PATH
3937   fi
3938   ;;
3939
3940 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3941   version_type=freebsd-elf
3942   need_lib_prefix=no
3943   need_version=no
3944   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3945   soname_spec='${libname}${release}${shared_ext}$major'
3946   shlibpath_var=LD_LIBRARY_PATH
3947   shlibpath_overrides_runpath=yes
3948   hardcode_into_libs=yes
3949   if test "$with_gnu_ld" = yes; then
3950     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3951   else
3952     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3953     case $host_os in
3954       sco3.2v5*)
3955         sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3956         ;;
3957     esac
3958   fi
3959   sys_lib_dlsearch_path_spec='/usr/lib'
3960   ;;
3961
3962 tpf*)
3963   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3964   version_type=linux
3965   need_lib_prefix=no
3966   need_version=no
3967   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3968   shlibpath_var=LD_LIBRARY_PATH
3969   shlibpath_overrides_runpath=no
3970   hardcode_into_libs=yes
3971   ;;
3972
3973 uts4*)
3974   version_type=linux
3975   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3976   soname_spec='${libname}${release}${shared_ext}$major'
3977   shlibpath_var=LD_LIBRARY_PATH
3978   ;;
3979
3980 *)
3981   dynamic_linker=no
3982   ;;
3983 esac
3984 AC_MSG_RESULT([$dynamic_linker])
3985 test "$dynamic_linker" = no && can_build_shared=no
3986
3987 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3988 if test "$GCC" = yes; then
3989   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3990 fi
3991
3992 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3993   sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3994 fi
3995 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3996   sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3997 fi
3998
3999 _LT_DECL([], [variables_saved_for_relink], [1],
4000     [Variables whose values should be saved in libtool wrapper scripts and
4001     restored at link time])
4002 _LT_DECL([], [need_lib_prefix], [0],
4003     [Do we need the "lib" prefix for modules?])
4004 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
4005 _LT_DECL([], [version_type], [0], [Library versioning type])
4006 _LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
4007 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
4008 _LT_DECL([], [shlibpath_overrides_runpath], [0],
4009     [Is shlibpath searched before the hard-coded library search path?])
4010 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
4011 _LT_DECL([], [library_names_spec], [1],
4012     [[List of archive names.  First name is the real one, the rest are links.
4013     The last name is the one that the linker finds with -lNAME]])
4014 _LT_DECL([], [soname_spec], [1],
4015     [[The coded name of the library, if different from the real name]])
4016 _LT_DECL([], [install_override_mode], [1],
4017     [Permission mode override for installation of shared libraries])
4018 _LT_DECL([], [postinstall_cmds], [2],
4019     [Command to use after installation of a shared archive])
4020 _LT_DECL([], [postuninstall_cmds], [2],
4021     [Command to use after uninstallation of a shared archive])
4022 _LT_DECL([], [finish_cmds], [2],
4023     [Commands used to finish a libtool library installation in a directory])
4024 _LT_DECL([], [finish_eval], [1],
4025     [[As "finish_cmds", except a single script fragment to be evaled but
4026     not shown]])
4027 _LT_DECL([], [hardcode_into_libs], [0],
4028     [Whether we should hardcode library paths into libraries])
4029 _LT_DECL([], [sys_lib_search_path_spec], [2],
4030     [Compile-time system search path for libraries])
4031 _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
4032     [Run-time system search path for libraries])
4033 ])# _LT_SYS_DYNAMIC_LINKER
4034
4035
4036 # _LT_PATH_TOOL_PREFIX(TOOL)
4037 # --------------------------
4038 # find a file program which can recognize shared library
4039 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
4040 [m4_require([_LT_DECL_EGREP])dnl
4041 AC_MSG_CHECKING([for $1])
4042 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4043 [case $MAGIC_CMD in
4044 [[\\/*] |  ?:[\\/]*])
4045   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4046   ;;
4047 *)
4048   lt_save_MAGIC_CMD="$MAGIC_CMD"
4049   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4050 dnl $ac_dummy forces splitting on constant user-supplied paths.
4051 dnl POSIX.2 word splitting is done only on the output of word expansions,
4052 dnl not every word.  This closes a longstanding sh security hole.
4053   ac_dummy="m4_if([$2], , $PATH, [$2])"
4054   for ac_dir in $ac_dummy; do
4055     IFS="$lt_save_ifs"
4056     test -z "$ac_dir" && ac_dir=.
4057     if test -f $ac_dir/$1; then
4058       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4059       if test -n "$file_magic_test_file"; then
4060         case $deplibs_check_method in
4061         "file_magic "*)
4062           file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
4063           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4064           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4065             $EGREP "$file_magic_regex" > /dev/null; then
4066             :
4067           else
4068             cat <<_LT_EOF 1>&2
4069
4070 *** Warning: the command libtool uses to detect shared libraries,
4071 *** $file_magic_cmd, produces output that libtool cannot recognize.
4072 *** The result is that libtool may fail to recognize shared libraries
4073 *** as such.  This will affect the creation of libtool libraries that
4074 *** depend on shared libraries, but programs linked with such libtool
4075 *** libraries will work regardless of this problem.  Nevertheless, you
4076 *** may want to report the problem to your system manager and/or to
4077 *** bug-libtool@gnu.org
4078
4079 _LT_EOF
4080           fi ;;
4081         esac
4082       fi
4083       break
4084     fi
4085   done
4086   IFS="$lt_save_ifs"
4087   MAGIC_CMD="$lt_save_MAGIC_CMD"
4088   ;;
4089 esac])
4090 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4091 if test -n "$MAGIC_CMD"; then
4092   AC_MSG_RESULT($MAGIC_CMD)
4093 else
4094   AC_MSG_RESULT(no)
4095 fi
4096 _LT_DECL([], [MAGIC_CMD], [0],
4097          [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4098 ])# _LT_PATH_TOOL_PREFIX
4099
4100 # Old name:
4101 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4102 dnl aclocal-1.4 backwards compatibility:
4103 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4104
4105
4106 # _LT_PATH_MAGIC
4107 # --------------
4108 # find a file program which can recognize a shared library
4109 m4_defun([_LT_PATH_MAGIC],
4110 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4111 if test -z "$lt_cv_path_MAGIC_CMD"; then
4112   if test -n "$ac_tool_prefix"; then
4113     _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4114   else
4115     MAGIC_CMD=:
4116   fi
4117 fi
4118 ])# _LT_PATH_MAGIC
4119
4120
4121 # LT_PATH_LD
4122 # ----------
4123 # find the pathname to the GNU or non-GNU linker
4124 AC_DEFUN([LT_PATH_LD],
4125 [AC_REQUIRE([AC_PROG_CC])dnl
4126 AC_REQUIRE([AC_CANONICAL_HOST])dnl
4127 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4128 m4_require([_LT_DECL_SED])dnl
4129 m4_require([_LT_DECL_EGREP])dnl
4130 m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4131
4132 AC_ARG_WITH([gnu-ld],
4133     [AS_HELP_STRING([--with-gnu-ld],
4134         [assume the C compiler uses GNU ld @<:@default=no@:>@])],
4135     [test "$withval" = no || with_gnu_ld=yes],
4136     [with_gnu_ld=no])dnl
4137
4138 ac_prog=ld
4139 if test "$GCC" = yes; then
4140   # Check if gcc -print-prog-name=ld gives a path.
4141   AC_MSG_CHECKING([for ld used by $CC])
4142   case $host in
4143   *-*-mingw*)
4144     # gcc leaves a trailing carriage return which upsets mingw
4145     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4146   *)
4147     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4148   esac
4149   case $ac_prog in
4150     # Accept absolute paths.
4151     [[\\/]]* | ?:[[\\/]]*)
4152       re_direlt='/[[^/]][[^/]]*/\.\./'
4153       # Canonicalize the pathname of ld
4154       ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4155       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4156         ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4157       done
4158       test -z "$LD" && LD="$ac_prog"
4159       ;;
4160   "")
4161     # If it fails, then pretend we aren't using GCC.
4162     ac_prog=ld
4163     ;;
4164   *)
4165     # If it is relative, then search for the first ld in PATH.
4166     with_gnu_ld=unknown
4167     ;;
4168   esac
4169 elif test "$with_gnu_ld" = yes; then
4170   AC_MSG_CHECKING([for GNU ld])
4171 else
4172   AC_MSG_CHECKING([for non-GNU ld])
4173 fi
4174 AC_CACHE_VAL(lt_cv_path_LD,
4175 [if test -z "$LD"; then
4176   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4177   for ac_dir in $PATH; do
4178     IFS="$lt_save_ifs"
4179     test -z "$ac_dir" && ac_dir=.
4180     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4181       lt_cv_path_LD="$ac_dir/$ac_prog"
4182       # Check to see if the program is GNU ld.  I'd rather use --version,
4183       # but apparently some variants of GNU ld only accept -v.
4184       # Break only if it was the GNU/non-GNU ld that we prefer.
4185       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4186       *GNU* | *'with BFD'*)
4187         test "$with_gnu_ld" != no && break
4188         ;;
4189       *)
4190         test "$with_gnu_ld" != yes && break
4191         ;;
4192       esac
4193     fi
4194   done
4195   IFS="$lt_save_ifs"
4196 else
4197   lt_cv_path_LD="$LD" # Let the user override the test with a path.
4198 fi])
4199 LD="$lt_cv_path_LD"
4200 if test -n "$LD"; then
4201   AC_MSG_RESULT($LD)
4202 else
4203   AC_MSG_RESULT(no)
4204 fi
4205 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4206 _LT_PATH_LD_GNU
4207 AC_SUBST([LD])
4208
4209 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4210 ])# LT_PATH_LD
4211
4212 # Old names:
4213 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4214 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4215 dnl aclocal-1.4 backwards compatibility:
4216 dnl AC_DEFUN([AM_PROG_LD], [])
4217 dnl AC_DEFUN([AC_PROG_LD], [])
4218
4219
4220 # _LT_PATH_LD_GNU
4221 #- --------------
4222 m4_defun([_LT_PATH_LD_GNU],
4223 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4224 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
4225 case `$LD -v 2>&1 </dev/null` in
4226 *GNU* | *'with BFD'*)
4227   lt_cv_prog_gnu_ld=yes
4228   ;;
4229 *)
4230   lt_cv_prog_gnu_ld=no
4231   ;;
4232 esac])
4233 with_gnu_ld=$lt_cv_prog_gnu_ld
4234 ])# _LT_PATH_LD_GNU
4235
4236
4237 # _LT_CMD_RELOAD
4238 # --------------
4239 # find reload flag for linker
4240 #   -- PORTME Some linkers may need a different reload flag.
4241 m4_defun([_LT_CMD_RELOAD],
4242 [AC_CACHE_CHECK([for $LD option to reload object files],
4243   lt_cv_ld_reload_flag,
4244   [lt_cv_ld_reload_flag='-r'])
4245 reload_flag=$lt_cv_ld_reload_flag
4246 case $reload_flag in
4247 "" | " "*) ;;
4248 *) reload_flag=" $reload_flag" ;;
4249 esac
4250 reload_cmds='$LD$reload_flag -o $output$reload_objs'
4251 case $host_os in
4252   cygwin* | mingw* | pw32* | cegcc*)
4253     if test "$GCC" != yes; then
4254       reload_cmds=false
4255     fi
4256     ;;
4257   darwin*)
4258     if test "$GCC" = yes; then
4259       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4260     else
4261       reload_cmds='$LD$reload_flag -o $output$reload_objs'
4262     fi
4263     ;;
4264 esac
4265 _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4266 _LT_TAGDECL([], [reload_cmds], [2])dnl
4267 ])# _LT_CMD_RELOAD
4268
4269
4270 # _LT_CHECK_MAGIC_METHOD
4271 # ----------------------
4272 # how to check for library dependencies
4273 #  -- PORTME fill in with the dynamic library characteristics
4274 m4_defun([_LT_CHECK_MAGIC_METHOD],
4275 [m4_require([_LT_DECL_EGREP])
4276 m4_require([_LT_DECL_OBJDUMP])
4277 AC_CACHE_CHECK([how to recognize dependent libraries],
4278 lt_cv_deplibs_check_method,
4279 [lt_cv_file_magic_cmd='$MAGIC_CMD'
4280 lt_cv_file_magic_test_file=
4281 lt_cv_deplibs_check_method='unknown'
4282 # Need to set the preceding variable on all platforms that support
4283 # interlibrary dependencies.
4284 # 'none' -- dependencies not supported.
4285 # `unknown' -- same as none, but documents that we really don't know.
4286 # 'pass_all' -- all dependencies passed with no checks.
4287 # 'test_compile' -- check by making test program.
4288 # 'file_magic [[regex]]' -- check by looking for files in library path
4289 # which responds to the $file_magic_cmd with a given extended regex.
4290 # If you have `file' or equivalent on your system and you're not sure
4291 # whether `pass_all' will *always* work, you probably want this one.
4292
4293 case $host_os in
4294 aix[[4-9]]*)
4295   lt_cv_deplibs_check_method=pass_all
4296   ;;
4297
4298 beos*)
4299   lt_cv_deplibs_check_method=pass_all
4300   ;;
4301
4302 bsdi[[45]]*)
4303   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4304   lt_cv_file_magic_cmd='/usr/bin/file -L'
4305   lt_cv_file_magic_test_file=/shlib/libc.so
4306   ;;
4307
4308 cygwin*)
4309   # func_win32_libid is a shell function defined in ltmain.sh
4310   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4311   lt_cv_file_magic_cmd='func_win32_libid'
4312   ;;
4313
4314 mingw* | pw32*)
4315   # Base MSYS/MinGW do not provide the 'file' command needed by
4316   # func_win32_libid shell function, so use a weaker test based on 'objdump',
4317   # unless we find 'file', for example because we are cross-compiling.
4318   # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4319   if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4320     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4321     lt_cv_file_magic_cmd='func_win32_libid'
4322   else
4323     # Keep this pattern in sync with the one in func_win32_libid.
4324     lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4325     lt_cv_file_magic_cmd='$OBJDUMP -f'
4326   fi
4327   ;;
4328
4329 cegcc*)
4330   # use the weaker test based on 'objdump'. See mingw*.
4331   lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4332   lt_cv_file_magic_cmd='$OBJDUMP -f'
4333   ;;
4334
4335 darwin* | rhapsody*)
4336   lt_cv_deplibs_check_method=pass_all
4337   ;;
4338
4339 freebsd* | dragonfly*)
4340   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4341     case $host_cpu in
4342     i*86 )
4343       # Not sure whether the presence of OpenBSD here was a mistake.
4344       # Let's accept both of them until this is cleared up.
4345       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4346       lt_cv_file_magic_cmd=/usr/bin/file
4347       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4348       ;;
4349     esac
4350   else
4351     lt_cv_deplibs_check_method=pass_all
4352   fi
4353   ;;
4354
4355 gnu*)
4356   lt_cv_deplibs_check_method=pass_all
4357   ;;
4358
4359 haiku*)
4360   lt_cv_deplibs_check_method=pass_all
4361   ;;
4362
4363 hpux10.20* | hpux11*)
4364   lt_cv_file_magic_cmd=/usr/bin/file
4365   case $host_cpu in
4366   ia64*)
4367     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4368     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4369     ;;
4370   hppa*64*)
4371     [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]']
4372     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4373     ;;
4374   *)
4375     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4376     lt_cv_file_magic_test_file=/usr/lib/libc.sl
4377     ;;
4378   esac
4379   ;;
4380
4381 interix[[3-9]]*)
4382   # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4383   lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4384   ;;
4385
4386 irix5* | irix6* | nonstopux*)
4387   case $LD in
4388   *-32|*"-32 ") libmagic=32-bit;;
4389   *-n32|*"-n32 ") libmagic=N32;;
4390   *-64|*"-64 ") libmagic=64-bit;;
4391   *) libmagic=never-match;;
4392   esac
4393   lt_cv_deplibs_check_method=pass_all
4394   ;;
4395
4396 # This must be Linux ELF.
4397 linux* | k*bsd*-gnu | kopensolaris*-gnu)
4398   lt_cv_deplibs_check_method=pass_all
4399   ;;
4400
4401 netbsd*)
4402   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4403     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4404   else
4405     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4406   fi
4407   ;;
4408
4409 newos6*)
4410   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4411   lt_cv_file_magic_cmd=/usr/bin/file
4412   lt_cv_file_magic_test_file=/usr/lib/libnls.so
4413   ;;
4414
4415 *nto* | *qnx*)
4416   lt_cv_deplibs_check_method=pass_all
4417   ;;
4418
4419 openbsd*)
4420   if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4421     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4422   else
4423     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4424   fi
4425   ;;
4426
4427 osf3* | osf4* | osf5*)
4428   lt_cv_deplibs_check_method=pass_all
4429   ;;
4430
4431 rdos*)
4432   lt_cv_deplibs_check_method=pass_all
4433   ;;
4434
4435 solaris*)
4436   lt_cv_deplibs_check_method=pass_all
4437   ;;
4438
4439 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4440   lt_cv_deplibs_check_method=pass_all
4441   ;;
4442
4443 sysv4 | sysv4.3*)
4444   case $host_vendor in
4445   motorola)
4446     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]]'
4447     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4448     ;;
4449   ncr)
4450     lt_cv_deplibs_check_method=pass_all
4451     ;;
4452   sequent)
4453     lt_cv_file_magic_cmd='/bin/file'
4454     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4455     ;;
4456   sni)
4457     lt_cv_file_magic_cmd='/bin/file'
4458     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4459     lt_cv_file_magic_test_file=/lib/libc.so
4460     ;;
4461   siemens)
4462     lt_cv_deplibs_check_method=pass_all
4463     ;;
4464   pc)
4465     lt_cv_deplibs_check_method=pass_all
4466     ;;
4467   esac
4468   ;;
4469
4470 tpf*)
4471   lt_cv_deplibs_check_method=pass_all
4472   ;;
4473 esac
4474 ])
4475
4476 file_magic_glob=
4477 want_nocaseglob=no
4478 if test "$build" = "$host"; then
4479   case $host_os in
4480   mingw* | pw32*)
4481     if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4482       want_nocaseglob=yes
4483     else
4484       file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4485     fi
4486     ;;
4487   esac
4488 fi
4489
4490 file_magic_cmd=$lt_cv_file_magic_cmd
4491 deplibs_check_method=$lt_cv_deplibs_check_method
4492 test -z "$deplibs_check_method" && deplibs_check_method=unknown
4493
4494 _LT_DECL([], [deplibs_check_method], [1],
4495     [Method to check whether dependent libraries are shared objects])
4496 _LT_DECL([], [file_magic_cmd], [1],
4497     [Command to use when deplibs_check_method = "file_magic"])
4498 _LT_DECL([], [file_magic_glob], [1],
4499     [How to find potential files when deplibs_check_method = "file_magic"])
4500 _LT_DECL([], [want_nocaseglob], [1],
4501     [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4502 ])# _LT_CHECK_MAGIC_METHOD
4503
4504
4505 # LT_PATH_NM
4506 # ----------
4507 # find the pathname to a BSD- or MS-compatible name lister
4508 AC_DEFUN([LT_PATH_NM],
4509 [AC_REQUIRE([AC_PROG_CC])dnl
4510 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4511 [if test -n "$NM"; then
4512   # Let the user override the test.
4513   lt_cv_path_NM="$NM"
4514 else
4515   lt_nm_to_check="${ac_tool_prefix}nm"
4516   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4517     lt_nm_to_check="$lt_nm_to_check nm"
4518   fi
4519   for lt_tmp_nm in $lt_nm_to_check; do
4520     lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4521     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4522       IFS="$lt_save_ifs"
4523       test -z "$ac_dir" && ac_dir=.
4524       tmp_nm="$ac_dir/$lt_tmp_nm"
4525       if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4526         # Check to see if the nm accepts a BSD-compat flag.
4527         # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4528         #   nm: unknown option "B" ignored
4529         # Tru64's nm complains that /dev/null is an invalid object file
4530         case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4531         */dev/null* | *'Invalid file or object type'*)
4532           lt_cv_path_NM="$tmp_nm -B"
4533           break
4534           ;;
4535         *)
4536           case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4537           */dev/null*)
4538             lt_cv_path_NM="$tmp_nm -p"
4539             break
4540             ;;
4541           *)
4542             lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4543             continue # so that we can try to find one that supports BSD flags
4544             ;;
4545           esac
4546           ;;
4547         esac
4548       fi
4549     done
4550     IFS="$lt_save_ifs"
4551   done
4552   : ${lt_cv_path_NM=no}
4553 fi])
4554 if test "$lt_cv_path_NM" != "no"; then
4555   NM="$lt_cv_path_NM"
4556 else
4557   # Didn't find any BSD compatible name lister, look for dumpbin.
4558   if test -n "$DUMPBIN"; then :
4559     # Let the user override the test.
4560   else
4561     AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4562     case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4563     *COFF*)
4564       DUMPBIN="$DUMPBIN -symbols"
4565       ;;
4566     *)
4567       DUMPBIN=:
4568       ;;
4569     esac
4570   fi
4571   AC_SUBST([DUMPBIN])
4572   if test "$DUMPBIN" != ":"; then
4573     NM="$DUMPBIN"
4574   fi
4575 fi
4576 test -z "$NM" && NM=nm
4577 AC_SUBST([NM])
4578 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4579
4580 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4581   [lt_cv_nm_interface="BSD nm"
4582   echo "int some_variable = 0;" > conftest.$ac_ext
4583   (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4584   (eval "$ac_compile" 2>conftest.err)
4585   cat conftest.err >&AS_MESSAGE_LOG_FD
4586   (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4587   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4588   cat conftest.err >&AS_MESSAGE_LOG_FD
4589   (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4590   cat conftest.out >&AS_MESSAGE_LOG_FD
4591   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4592     lt_cv_nm_interface="MS dumpbin"
4593   fi
4594   rm -f conftest*])
4595 ])# LT_PATH_NM
4596
4597 # Old names:
4598 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4599 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4600 dnl aclocal-1.4 backwards compatibility:
4601 dnl AC_DEFUN([AM_PROG_NM], [])
4602 dnl AC_DEFUN([AC_PROG_NM], [])
4603
4604 # _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4605 # --------------------------------
4606 # how to determine the name of the shared library
4607 # associated with a specific link library.
4608 #  -- PORTME fill in with the dynamic library characteristics
4609 m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4610 [m4_require([_LT_DECL_EGREP])
4611 m4_require([_LT_DECL_OBJDUMP])
4612 m4_require([_LT_DECL_DLLTOOL])
4613 AC_CACHE_CHECK([how to associate runtime and link libraries],
4614 lt_cv_sharedlib_from_linklib_cmd,
4615 [lt_cv_sharedlib_from_linklib_cmd='unknown'
4616
4617 case $host_os in
4618 cygwin* | mingw* | pw32* | cegcc*)
4619   # two different shell functions defined in ltmain.sh
4620   # decide which to use based on capabilities of $DLLTOOL
4621   case `$DLLTOOL --help 2>&1` in
4622   *--identify-strict*)
4623     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4624     ;;
4625   *)
4626     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4627     ;;
4628   esac
4629   ;;
4630 *)
4631   # fallback: assume linklib IS sharedlib
4632   lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4633   ;;
4634 esac
4635 ])
4636 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4637 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4638
4639 _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4640     [Command to associate shared and link libraries])
4641 ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4642
4643
4644 # _LT_PATH_MANIFEST_TOOL
4645 # ----------------------
4646 # locate the manifest tool
4647 m4_defun([_LT_PATH_MANIFEST_TOOL],
4648 [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4649 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4650 AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4651   [lt_cv_path_mainfest_tool=no
4652   echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4653   $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4654   cat conftest.err >&AS_MESSAGE_LOG_FD
4655   if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4656     lt_cv_path_mainfest_tool=yes
4657   fi
4658   rm -f conftest*])
4659 if test "x$lt_cv_path_mainfest_tool" != xyes; then
4660   MANIFEST_TOOL=:
4661 fi
4662 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4663 ])# _LT_PATH_MANIFEST_TOOL
4664
4665
4666 # LT_LIB_M
4667 # --------
4668 # check for math library
4669 AC_DEFUN([LT_LIB_M],
4670 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
4671 LIBM=
4672 case $host in
4673 *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4674   # These system don't have libm, or don't need it
4675   ;;
4676 *-ncr-sysv4.3*)
4677   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4678   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4679   ;;
4680 *)
4681   AC_CHECK_LIB(m, cos, LIBM="-lm")
4682   ;;
4683 esac
4684 AC_SUBST([LIBM])
4685 ])# LT_LIB_M
4686
4687 # Old name:
4688 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4689 dnl aclocal-1.4 backwards compatibility:
4690 dnl AC_DEFUN([AC_CHECK_LIBM], [])
4691
4692
4693 # _LT_COMPILER_NO_RTTI([TAGNAME])
4694 # -------------------------------
4695 m4_defun([_LT_COMPILER_NO_RTTI],
4696 [m4_require([_LT_TAG_COMPILER])dnl
4697
4698 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4699
4700 if test "$GCC" = yes; then
4701   case $cc_basename in
4702   nvcc*)
4703     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4704   *)
4705     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4706   esac
4707
4708   _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4709     lt_cv_prog_compiler_rtti_exceptions,
4710     [-fno-rtti -fno-exceptions], [],
4711     [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4712 fi
4713 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4714         [Compiler flag to turn off builtin functions])
4715 ])# _LT_COMPILER_NO_RTTI
4716
4717
4718 # _LT_CMD_GLOBAL_SYMBOLS
4719 # ----------------------
4720 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4721 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
4722 AC_REQUIRE([AC_PROG_CC])dnl
4723 AC_REQUIRE([AC_PROG_AWK])dnl
4724 AC_REQUIRE([LT_PATH_NM])dnl
4725 AC_REQUIRE([LT_PATH_LD])dnl
4726 m4_require([_LT_DECL_SED])dnl
4727 m4_require([_LT_DECL_EGREP])dnl
4728 m4_require([_LT_TAG_COMPILER])dnl
4729
4730 # Check for command to grab the raw symbol name followed by C symbol from nm.
4731 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4732 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4733 [
4734 # These are sane defaults that work on at least a few old systems.
4735 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4736
4737 # Character class describing NM global symbol codes.
4738 symcode='[[BCDEGRST]]'
4739
4740 # Regexp to match symbols that can be accessed directly from C.
4741 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4742
4743 # Define system-specific variables.
4744 case $host_os in
4745 aix*)
4746   symcode='[[BCDT]]'
4747   ;;
4748 cygwin* | mingw* | pw32* | cegcc*)
4749   symcode='[[ABCDGISTW]]'
4750   ;;
4751 hpux*)
4752   if test "$host_cpu" = ia64; then
4753     symcode='[[ABCDEGRST]]'
4754   fi
4755   ;;
4756 irix* | nonstopux*)
4757   symcode='[[BCDEGRST]]'
4758   ;;
4759 osf*)
4760   symcode='[[BCDEGQRST]]'
4761   ;;
4762 solaris*)
4763   symcode='[[BDRT]]'
4764   ;;
4765 sco3.2v5*)
4766   symcode='[[DT]]'
4767   ;;
4768 sysv4.2uw2*)
4769   symcode='[[DT]]'
4770   ;;
4771 sysv5* | sco5v6* | unixware* | OpenUNIX*)
4772   symcode='[[ABDT]]'
4773   ;;
4774 sysv4)
4775   symcode='[[DFNSTU]]'
4776   ;;
4777 esac
4778
4779 # If we're using GNU nm, then use its standard symbol codes.
4780 case `$NM -V 2>&1` in
4781 *GNU* | *'with BFD'*)
4782   symcode='[[ABCDGIRSTW]]' ;;
4783 esac
4784
4785 # Transform an extracted symbol line into a proper C declaration.
4786 # Some systems (esp. on ia64) link data and code symbols differently,
4787 # so use this general approach.
4788 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4789
4790 # Transform an extracted symbol line into symbol name and symbol address
4791 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4792 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'"
4793
4794 # Handle CRLF in mingw tool chain
4795 opt_cr=
4796 case $build_os in
4797 mingw*)
4798   opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4799   ;;
4800 esac
4801
4802 # Try without a prefix underscore, then with it.
4803 for ac_symprfx in "" "_"; do
4804
4805   # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4806   symxfrm="\\1 $ac_symprfx\\2 \\2"
4807
4808   # Write the raw and C identifiers.
4809   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4810     # Fake it for dumpbin and say T for any non-static function
4811     # and D for any global variable.
4812     # Also find C++ and __fastcall symbols from MSVC++,
4813     # which start with @ or ?.
4814     lt_cv_sys_global_symbol_pipe="$AWK ['"\
4815 "     {last_section=section; section=\$ 3};"\
4816 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4817 "     \$ 0!~/External *\|/{next};"\
4818 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4819 "     {if(hide[section]) next};"\
4820 "     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4821 "     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4822 "     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4823 "     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4824 "     ' prfx=^$ac_symprfx]"
4825   else
4826     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4827   fi
4828   lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4829
4830   # Check to see that the pipe works correctly.
4831   pipe_works=no
4832
4833   rm -f conftest*
4834   cat > conftest.$ac_ext <<_LT_EOF
4835 #ifdef __cplusplus
4836 extern "C" {
4837 #endif
4838 char nm_test_var;
4839 void nm_test_func(void);
4840 void nm_test_func(void){}
4841 #ifdef __cplusplus
4842 }
4843 #endif
4844 int main(){nm_test_var='a';nm_test_func();return(0);}
4845 _LT_EOF
4846
4847   if AC_TRY_EVAL(ac_compile); then
4848     # Now try to grab the symbols.
4849     nlist=conftest.nm
4850     if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4851       # Try sorting and uniquifying the output.
4852       if sort "$nlist" | uniq > "$nlist"T; then
4853         mv -f "$nlist"T "$nlist"
4854       else
4855         rm -f "$nlist"T
4856       fi
4857
4858       # Make sure that we snagged all the symbols we need.
4859       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4860         if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4861           cat <<_LT_EOF > conftest.$ac_ext
4862 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4863 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4864 /* DATA imports from DLLs on WIN32 con't be const, because runtime
4865    relocations are performed -- see ld's documentation on pseudo-relocs.  */
4866 # define LT@&t@_DLSYM_CONST
4867 #elif defined(__osf__)
4868 /* This system does not cope well with relocations in const data.  */
4869 # define LT@&t@_DLSYM_CONST
4870 #else
4871 # define LT@&t@_DLSYM_CONST const
4872 #endif
4873
4874 #ifdef __cplusplus
4875 extern "C" {
4876 #endif
4877
4878 _LT_EOF
4879           # Now generate the symbol file.
4880           eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4881
4882           cat <<_LT_EOF >> conftest.$ac_ext
4883
4884 /* The mapping between symbol names and symbols.  */
4885 LT@&t@_DLSYM_CONST struct {
4886   const char *name;
4887   void       *address;
4888 }
4889 lt__PROGRAM__LTX_preloaded_symbols[[]] =
4890 {
4891   { "@PROGRAM@", (void *) 0 },
4892 _LT_EOF
4893           $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4894           cat <<\_LT_EOF >> conftest.$ac_ext
4895   {0, (void *) 0}
4896 };
4897
4898 /* This works around a problem in FreeBSD linker */
4899 #ifdef FREEBSD_WORKAROUND
4900 static const void *lt_preloaded_setup() {
4901   return lt__PROGRAM__LTX_preloaded_symbols;
4902 }
4903 #endif
4904
4905 #ifdef __cplusplus
4906 }
4907 #endif
4908 _LT_EOF
4909           # Now try linking the two files.
4910           mv conftest.$ac_objext conftstm.$ac_objext
4911           lt_globsym_save_LIBS=$LIBS
4912           lt_globsym_save_CFLAGS=$CFLAGS
4913           LIBS="conftstm.$ac_objext"
4914           CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4915           if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4916             pipe_works=yes
4917           fi
4918           LIBS=$lt_globsym_save_LIBS
4919           CFLAGS=$lt_globsym_save_CFLAGS
4920         else
4921           echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4922         fi
4923       else
4924         echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4925       fi
4926     else
4927       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4928     fi
4929   else
4930     echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4931     cat conftest.$ac_ext >&5
4932   fi
4933   rm -rf conftest* conftst*
4934
4935   # Do not use the global_symbol_pipe unless it works.
4936   if test "$pipe_works" = yes; then
4937     break
4938   else
4939     lt_cv_sys_global_symbol_pipe=
4940   fi
4941 done
4942 ])
4943 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4944   lt_cv_sys_global_symbol_to_cdecl=
4945 fi
4946 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4947   AC_MSG_RESULT(failed)
4948 else
4949   AC_MSG_RESULT(ok)
4950 fi
4951
4952 # Response file support.
4953 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4954   nm_file_list_spec='@'
4955 elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4956   nm_file_list_spec='@'
4957 fi
4958
4959 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4960     [Take the output of nm and produce a listing of raw symbols and C names])
4961 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4962     [Transform the output of nm in a proper C declaration])
4963 _LT_DECL([global_symbol_to_c_name_address],
4964     [lt_cv_sys_global_symbol_to_c_name_address], [1],
4965     [Transform the output of nm in a C name address pair])
4966 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4967     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4968     [Transform the output of nm in a C name address pair when lib prefix is needed])
4969 _LT_DECL([], [nm_file_list_spec], [1],
4970     [Specify filename containing input files for $NM])
4971 ]) # _LT_CMD_GLOBAL_SYMBOLS
4972
4973
4974 # _LT_COMPILER_PIC([TAGNAME])
4975 # ---------------------------
4976 m4_defun([_LT_COMPILER_PIC],
4977 [m4_require([_LT_TAG_COMPILER])dnl
4978 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
4979 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4980 _LT_TAGVAR(lt_prog_compiler_static, $1)=
4981
4982 m4_if([$1], [CXX], [
4983   # C++ specific cases for pic, static, wl, etc.
4984   if test "$GXX" = yes; then
4985     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4986     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4987
4988     case $host_os in
4989     aix*)
4990       # All AIX code is PIC.
4991       if test "$host_cpu" = ia64; then
4992         # AIX 5 now supports IA64 processor
4993         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4994       fi
4995       ;;
4996
4997     amigaos*)
4998       case $host_cpu in
4999       powerpc)
5000             # see comment about AmigaOS4 .so support
5001             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5002         ;;
5003       m68k)
5004             # FIXME: we need at least 68020 code to build shared libraries, but
5005             # adding the `-m68020' flag to GCC prevents building anything better,
5006             # like `-m68040'.
5007             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5008         ;;
5009       esac
5010       ;;
5011
5012     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5013       # PIC is the default for these OSes.
5014       ;;
5015     mingw* | cygwin* | os2* | pw32* | cegcc*)
5016       # This hack is so that the source file can tell whether it is being
5017       # built for inclusion in a dll (and should export symbols for example).
5018       # Although the cygwin gcc ignores -fPIC, still need this for old-style
5019       # (--disable-auto-import) libraries
5020       m4_if([$1], [GCJ], [],
5021         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5022       ;;
5023     darwin* | rhapsody*)
5024       # PIC is the default on this platform
5025       # Common symbols not allowed in MH_DYLIB files
5026       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5027       ;;
5028     *djgpp*)
5029       # DJGPP does not support shared libraries at all
5030       _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5031       ;;
5032     haiku*)
5033       # PIC is the default for Haiku.
5034       # The "-static" flag exists, but is broken.
5035       _LT_TAGVAR(lt_prog_compiler_static, $1)=
5036       ;;
5037     interix[[3-9]]*)
5038       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5039       # Instead, we relocate shared libraries at runtime.
5040       ;;
5041     sysv4*MP*)
5042       if test -d /usr/nec; then
5043         _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5044       fi
5045       ;;
5046     hpux*)
5047       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5048       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5049       # sets the default TLS model and affects inlining.
5050       case $host_cpu in
5051       hppa*64*)
5052         ;;
5053       *)
5054         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5055         ;;
5056       esac
5057       ;;
5058     *qnx* | *nto*)
5059       # QNX uses GNU C++, but need to define -shared option too, otherwise
5060       # it will coredump.
5061       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5062       ;;
5063     *)
5064       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5065       ;;
5066     esac
5067   else
5068     case $host_os in
5069       aix[[4-9]]*)
5070         # All AIX code is PIC.
5071         if test "$host_cpu" = ia64; then
5072           # AIX 5 now supports IA64 processor
5073           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5074         else
5075           _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5076         fi
5077         ;;
5078       chorus*)
5079         case $cc_basename in
5080         cxch68*)
5081           # Green Hills C++ Compiler
5082           # _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"
5083           ;;
5084         esac
5085         ;;
5086       mingw* | cygwin* | os2* | pw32* | cegcc*)
5087         # This hack is so that the source file can tell whether it is being
5088         # built for inclusion in a dll (and should export symbols for example).
5089         m4_if([$1], [GCJ], [],
5090           [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5091         ;;
5092       dgux*)
5093         case $cc_basename in
5094           ec++*)
5095             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5096             ;;
5097           ghcx*)
5098             # Green Hills C++ Compiler
5099             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5100             ;;
5101           *)
5102             ;;
5103         esac
5104         ;;
5105       freebsd* | dragonfly*)
5106         # FreeBSD uses GNU C++
5107         ;;
5108       hpux9* | hpux10* | hpux11*)
5109         case $cc_basename in
5110           CC*)
5111             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5112             _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5113             if test "$host_cpu" != ia64; then
5114               _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5115             fi
5116             ;;
5117           aCC*)
5118             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5119             _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5120             case $host_cpu in
5121             hppa*64*|ia64*)
5122               # +Z the default
5123               ;;
5124             *)
5125               _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5126               ;;
5127             esac
5128             ;;
5129           *)
5130             ;;
5131         esac
5132         ;;
5133       interix*)
5134         # This is c89, which is MS Visual C++ (no shared libs)
5135         # Anyone wants to do a port?
5136         ;;
5137       irix5* | irix6* | nonstopux*)
5138         case $cc_basename in
5139           CC*)
5140             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5141             _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5142             # CC pic flag -KPIC is the default.
5143             ;;
5144           *)
5145             ;;
5146         esac
5147         ;;
5148       linux* | k*bsd*-gnu | kopensolaris*-gnu)
5149         case $cc_basename in
5150           KCC*)
5151             # KAI C++ Compiler
5152             _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5153             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5154             ;;
5155           ecpc* )
5156             # old Intel C++ for x86_64 which still supported -KPIC.
5157             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5158             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5159             _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5160             ;;
5161           icpc* )
5162             # Intel C++, used to be incompatible with GCC.
5163             # ICC 10 doesn't accept -KPIC any more.
5164             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5165             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5166             _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5167             ;;
5168           pgCC* | pgcpp*)
5169             # Portland Group C++ compiler
5170             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5171             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5172             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5173             ;;
5174           cxx*)
5175             # Compaq C++
5176             # Make sure the PIC flag is empty.  It appears that all Alpha
5177             # Linux and Compaq Tru64 Unix objects are PIC.
5178             _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5179             _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5180             ;;
5181           xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5182             # IBM XL 8.0, 9.0 on PPC and BlueGene
5183             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5184             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5185             _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5186             ;;
5187           *)
5188             case `$CC -V 2>&1 | sed 5q` in
5189             *Sun\ C*)
5190               # Sun C++ 5.9
5191               _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5192               _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5193               _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5194               ;;
5195             esac
5196             ;;
5197         esac
5198         ;;
5199       lynxos*)
5200         ;;
5201       m88k*)
5202         ;;
5203       mvs*)
5204         case $cc_basename in
5205           cxx*)
5206             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5207             ;;
5208           *)
5209             ;;
5210         esac
5211         ;;
5212       netbsd*)
5213         ;;
5214       *qnx* | *nto*)
5215         # QNX uses GNU C++, but need to define -shared option too, otherwise
5216         # it will coredump.
5217         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5218         ;;
5219       osf3* | osf4* | osf5*)
5220         case $cc_basename in
5221           KCC*)
5222             _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5223             ;;
5224           RCC*)
5225             # Rational C++ 2.4.1
5226             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5227             ;;
5228           cxx*)
5229             # Digital/Compaq C++
5230             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5231             # Make sure the PIC flag is empty.  It appears that all Alpha
5232             # Linux and Compaq Tru64 Unix objects are PIC.
5233             _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5234             _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5235             ;;
5236           *)
5237             ;;
5238         esac
5239         ;;
5240       psos*)
5241         ;;
5242       solaris*)
5243         case $cc_basename in
5244           CC* | sunCC*)
5245             # Sun C++ 4.2, 5.x and Centerline C++
5246             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5247             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5248             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5249             ;;
5250           gcx*)
5251             # Green Hills C++ Compiler
5252             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5253             ;;
5254           *)
5255             ;;
5256         esac
5257         ;;
5258       sunos4*)
5259         case $cc_basename in
5260           CC*)
5261             # Sun C++ 4.x
5262             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5263             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5264             ;;
5265           lcc*)
5266             # Lucid
5267             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5268             ;;
5269           *)
5270             ;;
5271         esac
5272         ;;
5273       sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5274         case $cc_basename in
5275           CC*)
5276             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5277             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5278             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5279             ;;
5280         esac
5281         ;;
5282       tandem*)
5283         case $cc_basename in
5284           NCC*)
5285             # NonStop-UX NCC 3.20
5286             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5287             ;;
5288           *)
5289             ;;
5290         esac
5291         ;;
5292       vxworks*)
5293         ;;
5294       *)
5295         _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5296         ;;
5297     esac
5298   fi
5299 ],
5300 [
5301   if test "$GCC" = yes; then
5302     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5303     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5304
5305     case $host_os in
5306       aix*)
5307       # All AIX code is PIC.
5308       if test "$host_cpu" = ia64; then
5309         # AIX 5 now supports IA64 processor
5310         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5311       fi
5312       ;;
5313
5314     amigaos*)
5315       case $host_cpu in
5316       powerpc)
5317             # see comment about AmigaOS4 .so support
5318             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5319         ;;
5320       m68k)
5321             # FIXME: we need at least 68020 code to build shared libraries, but
5322             # adding the `-m68020' flag to GCC prevents building anything better,
5323             # like `-m68040'.
5324             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5325         ;;
5326       esac
5327       ;;
5328
5329     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5330       # PIC is the default for these OSes.
5331       ;;
5332
5333     mingw* | cygwin* | pw32* | os2* | cegcc*)
5334       # This hack is so that the source file can tell whether it is being
5335       # built for inclusion in a dll (and should export symbols for example).
5336       # Although the cygwin gcc ignores -fPIC, still need this for old-style
5337       # (--disable-auto-import) libraries
5338       m4_if([$1], [GCJ], [],
5339         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5340       ;;
5341
5342     darwin* | rhapsody*)
5343       # PIC is the default on this platform
5344       # Common symbols not allowed in MH_DYLIB files
5345       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5346       ;;
5347
5348     haiku*)
5349       # PIC is the default for Haiku.
5350       # The "-static" flag exists, but is broken.
5351       _LT_TAGVAR(lt_prog_compiler_static, $1)=
5352       ;;
5353
5354     hpux*)
5355       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5356       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5357       # sets the default TLS model and affects inlining.
5358       case $host_cpu in
5359       hppa*64*)
5360         # +Z the default
5361         ;;
5362       *)
5363         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5364         ;;
5365       esac
5366       ;;
5367
5368     interix[[3-9]]*)
5369       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5370       # Instead, we relocate shared libraries at runtime.
5371       ;;
5372
5373     msdosdjgpp*)
5374       # Just because we use GCC doesn't mean we suddenly get shared libraries
5375       # on systems that don't support them.
5376       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5377       enable_shared=no
5378       ;;
5379
5380     *nto* | *qnx*)
5381       # QNX uses GNU C++, but need to define -shared option too, otherwise
5382       # it will coredump.
5383       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5384       ;;
5385
5386     sysv4*MP*)
5387       if test -d /usr/nec; then
5388         _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5389       fi
5390       ;;
5391
5392     *)
5393       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5394       ;;
5395     esac
5396
5397     case $cc_basename in
5398     nvcc*) # Cuda Compiler Driver 2.2
5399       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5400       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
5401       ;;
5402     esac
5403   else
5404     # PORTME Check for flag to pass linker flags through the system compiler.
5405     case $host_os in
5406     aix*)
5407       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5408       if test "$host_cpu" = ia64; then
5409         # AIX 5 now supports IA64 processor
5410         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5411       else
5412         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5413       fi
5414       ;;
5415
5416     mingw* | cygwin* | pw32* | os2* | cegcc*)
5417       # This hack is so that the source file can tell whether it is being
5418       # built for inclusion in a dll (and should export symbols for example).
5419       m4_if([$1], [GCJ], [],
5420         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5421       ;;
5422
5423     hpux9* | hpux10* | hpux11*)
5424       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5425       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5426       # not for PA HP-UX.
5427       case $host_cpu in
5428       hppa*64*|ia64*)
5429         # +Z the default
5430         ;;
5431       *)
5432         _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5433         ;;
5434       esac
5435       # Is there a better lt_prog_compiler_static that works with the bundled CC?
5436       _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5437       ;;
5438
5439     irix5* | irix6* | nonstopux*)
5440       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5441       # PIC (with -KPIC) is the default.
5442       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5443       ;;
5444
5445     linux* | k*bsd*-gnu | kopensolaris*-gnu)
5446       case $cc_basename in
5447       # old Intel for x86_64 which still supported -KPIC.
5448       ecc*)
5449         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5450         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5451         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5452         ;;
5453       # icc used to be incompatible with GCC.
5454       # ICC 10 doesn't accept -KPIC any more.
5455       icc* | ifort*)
5456         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5457         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5458         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5459         ;;
5460       # Lahey Fortran 8.1.
5461       lf95*)
5462         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5463         _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5464         _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5465         ;;
5466       nagfor*)
5467         # NAG Fortran compiler
5468         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5469         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5470         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5471         ;;
5472       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5473         # Portland Group compilers (*not* the Pentium gcc compiler,
5474         # which looks to be a dead project)
5475         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5476         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5477         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5478         ;;
5479       ccc*)
5480         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5481         # All Alpha code is PIC.
5482         _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5483         ;;
5484       xl* | bgxl* | bgf* | mpixl*)
5485         # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5486         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5487         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5488         _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5489         ;;
5490       *)
5491         case `$CC -V 2>&1 | sed 5q` in
5492         *Sun\ F* | *Sun*Fortran*)
5493           # Sun Fortran 8.3 passes all unrecognized flags to the linker
5494           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5495           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5496           _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5497           ;;
5498         *Sun\ C*)
5499           # Sun C 5.9
5500           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5501           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5502           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5503           ;;
5504         esac
5505         ;;
5506       esac
5507       ;;
5508
5509     newsos6)
5510       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5511       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5512       ;;
5513
5514     *nto* | *qnx*)
5515       # QNX uses GNU C++, but need to define -shared option too, otherwise
5516       # it will coredump.
5517       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5518       ;;
5519
5520     osf3* | osf4* | osf5*)
5521       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5522       # All OSF/1 code is PIC.
5523       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5524       ;;
5525
5526     rdos*)
5527       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5528       ;;
5529
5530     solaris*)
5531       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5532       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5533       case $cc_basename in
5534       f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5535         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5536       *)
5537         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5538       esac
5539       ;;
5540
5541     sunos4*)
5542       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5543       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5544       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5545       ;;
5546
5547     sysv4 | sysv4.2uw2* | sysv4.3*)
5548       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5549       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5550       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5551       ;;
5552
5553     sysv4*MP*)
5554       if test -d /usr/nec ;then
5555         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5556         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5557       fi
5558       ;;
5559
5560     sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5561       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5562       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5563       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5564       ;;
5565
5566     unicos*)
5567       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5568       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5569       ;;
5570
5571     uts4*)
5572       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5573       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5574       ;;
5575
5576     *)
5577       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5578       ;;
5579     esac
5580   fi
5581 ])
5582 case $host_os in
5583   # For platforms which do not support PIC, -DPIC is meaningless:
5584   *djgpp*)
5585     _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5586     ;;
5587   *)
5588     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5589     ;;
5590 esac
5591
5592 AC_CACHE_CHECK([for $compiler option to produce PIC],
5593   [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5594   [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5595 _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5596
5597 #
5598 # Check to make sure the PIC flag actually works.
5599 #
5600 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5601   _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5602     [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5603     [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5604     [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5605      "" | " "*) ;;
5606      *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5607      esac],
5608     [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5609      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5610 fi
5611 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5612         [Additional compiler flags for building library objects])
5613
5614 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5615         [How to pass a linker flag through the compiler])
5616 #
5617 # Check to make sure the static flag actually works.
5618 #
5619 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5620 _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5621   _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5622   $lt_tmp_static_flag,
5623   [],
5624   [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5625 _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5626         [Compiler flag to prevent dynamic linking])
5627 ])# _LT_COMPILER_PIC
5628
5629
5630 # _LT_LINKER_SHLIBS([TAGNAME])
5631 # ----------------------------
5632 # See if the linker supports building shared libraries.
5633 m4_defun([_LT_LINKER_SHLIBS],
5634 [AC_REQUIRE([LT_PATH_LD])dnl
5635 AC_REQUIRE([LT_PATH_NM])dnl
5636 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5637 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5638 m4_require([_LT_DECL_EGREP])dnl
5639 m4_require([_LT_DECL_SED])dnl
5640 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5641 m4_require([_LT_TAG_COMPILER])dnl
5642 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5643 m4_if([$1], [CXX], [
5644   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5645   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5646   case $host_os in
5647   aix[[4-9]]*)
5648     # If we're using GNU nm, then we don't want the "-C" option.
5649     # -C means demangle to AIX nm, but means don't demangle with GNU nm
5650     # Also, AIX nm treats weak defined symbols like other global defined
5651     # symbols, whereas GNU nm marks them as "W".
5652     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5653       _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'
5654     else
5655       _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'
5656     fi
5657     ;;
5658   pw32*)
5659     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5660     ;;
5661   cygwin* | mingw* | cegcc*)
5662     case $cc_basename in
5663     cl*) ;;
5664     *)
5665       _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'
5666       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5667       ;;
5668     esac
5669     ;;
5670   *)
5671     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5672     ;;
5673   esac
5674 ], [
5675   runpath_var=
5676   _LT_TAGVAR(allow_undefined_flag, $1)=
5677   _LT_TAGVAR(always_export_symbols, $1)=no
5678   _LT_TAGVAR(archive_cmds, $1)=
5679   _LT_TAGVAR(archive_expsym_cmds, $1)=
5680   _LT_TAGVAR(compiler_needs_object, $1)=no
5681   _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5682   _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5683   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5684   _LT_TAGVAR(hardcode_automatic, $1)=no
5685   _LT_TAGVAR(hardcode_direct, $1)=no
5686   _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5687   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5688   _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5689   _LT_TAGVAR(hardcode_libdir_separator, $1)=
5690   _LT_TAGVAR(hardcode_minus_L, $1)=no
5691   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5692   _LT_TAGVAR(inherit_rpath, $1)=no
5693   _LT_TAGVAR(link_all_deplibs, $1)=unknown
5694   _LT_TAGVAR(module_cmds, $1)=
5695   _LT_TAGVAR(module_expsym_cmds, $1)=
5696   _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5697   _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5698   _LT_TAGVAR(thread_safe_flag_spec, $1)=
5699   _LT_TAGVAR(whole_archive_flag_spec, $1)=
5700   # include_expsyms should be a list of space-separated symbols to be *always*
5701   # included in the symbol list
5702   _LT_TAGVAR(include_expsyms, $1)=
5703   # exclude_expsyms can be an extended regexp of symbols to exclude
5704   # it will be wrapped by ` (' and `)$', so one must not match beginning or
5705   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5706   # as well as any symbol that contains `d'.
5707   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5708   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5709   # platforms (ab)use it in PIC code, but their linkers get confused if
5710   # the symbol is explicitly referenced.  Since portable code cannot
5711   # rely on this symbol name, it's probably fine to never include it in
5712   # preloaded symbol tables.
5713   # Exclude shared library initialization/finalization symbols.
5714 dnl Note also adjust exclude_expsyms for C++ above.
5715   extract_expsyms_cmds=
5716
5717   case $host_os in
5718   cygwin* | mingw* | pw32* | cegcc*)
5719     # FIXME: the MSVC++ port hasn't been tested in a loooong time
5720     # When not using gcc, we currently assume that we are using
5721     # Microsoft Visual C++.
5722     if test "$GCC" != yes; then
5723       with_gnu_ld=no
5724     fi
5725     ;;
5726   interix*)
5727     # we just hope/assume this is gcc and not c89 (= MSVC++)
5728     with_gnu_ld=yes
5729     ;;
5730   openbsd*)
5731     with_gnu_ld=no
5732     ;;
5733   esac
5734
5735   _LT_TAGVAR(ld_shlibs, $1)=yes
5736
5737   # On some targets, GNU ld is compatible enough with the native linker
5738   # that we're better off using the native interface for both.
5739   lt_use_gnu_ld_interface=no
5740   if test "$with_gnu_ld" = yes; then
5741     case $host_os in
5742       aix*)
5743         # The AIX port of GNU ld has always aspired to compatibility
5744         # with the native linker.  However, as the warning in the GNU ld
5745         # block says, versions before 2.19.5* couldn't really create working
5746         # shared libraries, regardless of the interface used.
5747         case `$LD -v 2>&1` in
5748           *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5749           *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5750           *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5751           *)
5752             lt_use_gnu_ld_interface=yes
5753             ;;
5754         esac
5755         ;;
5756       *)
5757         lt_use_gnu_ld_interface=yes
5758         ;;
5759     esac
5760   fi
5761
5762   if test "$lt_use_gnu_ld_interface" = yes; then
5763     # If archive_cmds runs LD, not CC, wlarc should be empty
5764     wlarc='${wl}'
5765
5766     # Set some defaults for GNU ld with shared library support. These
5767     # are reset later if shared libraries are not supported. Putting them
5768     # here allows them to be overridden if necessary.
5769     runpath_var=LD_RUN_PATH
5770     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5771     _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5772     # ancient GNU ld didn't support --whole-archive et. al.
5773     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5774       _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5775     else
5776       _LT_TAGVAR(whole_archive_flag_spec, $1)=
5777     fi
5778     supports_anon_versioning=no
5779     case `$LD -v 2>&1` in
5780       *GNU\ gold*) supports_anon_versioning=yes ;;
5781       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5782       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5783       *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5784       *\ 2.11.*) ;; # other 2.11 versions
5785       *) supports_anon_versioning=yes ;;
5786     esac
5787
5788     # See if GNU ld supports shared libraries.
5789     case $host_os in
5790     aix[[3-9]]*)
5791       # On AIX/PPC, the GNU linker is very broken
5792       if test "$host_cpu" != ia64; then
5793         _LT_TAGVAR(ld_shlibs, $1)=no
5794         cat <<_LT_EOF 1>&2
5795
5796 *** Warning: the GNU linker, at least up to release 2.19, is reported
5797 *** to be unable to reliably create shared libraries on AIX.
5798 *** Therefore, libtool is disabling shared libraries support.  If you
5799 *** really care for shared libraries, you may want to install binutils
5800 *** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5801 *** You will then need to restart the configuration process.
5802
5803 _LT_EOF
5804       fi
5805       ;;
5806
5807     amigaos*)
5808       case $host_cpu in
5809       powerpc)
5810             # see comment about AmigaOS4 .so support
5811             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5812             _LT_TAGVAR(archive_expsym_cmds, $1)=''
5813         ;;
5814       m68k)
5815             _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)'
5816             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5817             _LT_TAGVAR(hardcode_minus_L, $1)=yes
5818         ;;
5819       esac
5820       ;;
5821
5822     beos*)
5823       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5824         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5825         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5826         # support --undefined.  This deserves some investigation.  FIXME
5827         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5828       else
5829         _LT_TAGVAR(ld_shlibs, $1)=no
5830       fi
5831       ;;
5832
5833     cygwin* | mingw* | pw32* | cegcc*)
5834       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5835       # as there is no search path for DLLs.
5836       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5837       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5838       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5839       _LT_TAGVAR(always_export_symbols, $1)=no
5840       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5841       _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'
5842       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5843
5844       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5845         _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'
5846         # If the export-symbols file already is a .def file (1st line
5847         # is EXPORTS), use it as is; otherwise, prepend...
5848         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5849           cp $export_symbols $output_objdir/$soname.def;
5850         else
5851           echo EXPORTS > $output_objdir/$soname.def;
5852           cat $export_symbols >> $output_objdir/$soname.def;
5853         fi~
5854         $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5855       else
5856         _LT_TAGVAR(ld_shlibs, $1)=no
5857       fi
5858       ;;
5859
5860     haiku*)
5861       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5862       _LT_TAGVAR(link_all_deplibs, $1)=yes
5863       ;;
5864
5865     interix[[3-9]]*)
5866       _LT_TAGVAR(hardcode_direct, $1)=no
5867       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5868       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5869       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5870       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5871       # Instead, shared libraries are loaded at an image base (0x10000000 by
5872       # default) and relocated if they conflict, which is a slow very memory
5873       # consuming and fragmenting process.  To avoid this, we pick a random,
5874       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5875       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5876       _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'
5877       _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'
5878       ;;
5879
5880     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5881       tmp_diet=no
5882       if test "$host_os" = linux-dietlibc; then
5883         case $cc_basename in
5884           diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
5885         esac
5886       fi
5887       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5888          && test "$tmp_diet" = no
5889       then
5890         tmp_addflag=' $pic_flag'
5891         tmp_sharedflag='-shared'
5892         case $cc_basename,$host_cpu in
5893         pgcc*)                          # Portland Group C compiler
5894           _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'
5895           tmp_addflag=' $pic_flag'
5896           ;;
5897         pgf77* | pgf90* | pgf95* | pgfortran*)
5898                                         # Portland Group f77 and f90 compilers
5899           _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'
5900           tmp_addflag=' $pic_flag -Mnomain' ;;
5901         ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
5902           tmp_addflag=' -i_dynamic' ;;
5903         efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
5904           tmp_addflag=' -i_dynamic -nofor_main' ;;
5905         ifc* | ifort*)                  # Intel Fortran compiler
5906           tmp_addflag=' -nofor_main' ;;
5907         lf95*)                          # Lahey Fortran 8.1
5908           _LT_TAGVAR(whole_archive_flag_spec, $1)=
5909           tmp_sharedflag='--shared' ;;
5910         xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5911           tmp_sharedflag='-qmkshrobj'
5912           tmp_addflag= ;;
5913         nvcc*)  # Cuda Compiler Driver 2.2
5914           _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'
5915           _LT_TAGVAR(compiler_needs_object, $1)=yes
5916           ;;
5917         esac
5918         case `$CC -V 2>&1 | sed 5q` in
5919         *Sun\ C*)                       # Sun C 5.9
5920           _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'
5921           _LT_TAGVAR(compiler_needs_object, $1)=yes
5922           tmp_sharedflag='-G' ;;
5923         *Sun\ F*)                       # Sun Fortran 8.3
5924           tmp_sharedflag='-G' ;;
5925         esac
5926         _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5927
5928         if test "x$supports_anon_versioning" = xyes; then
5929           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5930             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5931             echo "local: *; };" >> $output_objdir/$libname.ver~
5932             $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5933         fi
5934
5935         case $cc_basename in
5936         xlf* | bgf* | bgxlf* | mpixlf*)
5937           # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5938           _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5939           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5940           _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
5941           _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5942           if test "x$supports_anon_versioning" = xyes; then
5943             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5944               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5945               echo "local: *; };" >> $output_objdir/$libname.ver~
5946               $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5947           fi
5948           ;;
5949         esac
5950       else
5951         _LT_TAGVAR(ld_shlibs, $1)=no
5952       fi
5953       ;;
5954
5955     netbsd*)
5956       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5957         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5958         wlarc=
5959       else
5960         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5961         _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'
5962       fi
5963       ;;
5964
5965     solaris*)
5966       if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5967         _LT_TAGVAR(ld_shlibs, $1)=no
5968         cat <<_LT_EOF 1>&2
5969
5970 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5971 *** create shared libraries on Solaris systems.  Therefore, libtool
5972 *** is disabling shared libraries support.  We urge you to upgrade GNU
5973 *** binutils to release 2.9.1 or newer.  Another option is to modify
5974 *** your PATH or compiler configuration so that the native linker is
5975 *** used, and then restart.
5976
5977 _LT_EOF
5978       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5979         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5980         _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'
5981       else
5982         _LT_TAGVAR(ld_shlibs, $1)=no
5983       fi
5984       ;;
5985
5986     sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5987       case `$LD -v 2>&1` in
5988         *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5989         _LT_TAGVAR(ld_shlibs, $1)=no
5990         cat <<_LT_EOF 1>&2
5991
5992 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5993 *** reliably create shared libraries on SCO systems.  Therefore, libtool
5994 *** is disabling shared libraries support.  We urge you to upgrade GNU
5995 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5996 *** your PATH or compiler configuration so that the native linker is
5997 *** used, and then restart.
5998
5999 _LT_EOF
6000         ;;
6001         *)
6002           # For security reasons, it is highly recommended that you always
6003           # use absolute paths for naming shared libraries, and exclude the
6004           # DT_RUNPATH tag from executables and libraries.  But doing so
6005           # requires that you compile everything twice, which is a pain.
6006           if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6007             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6008             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6009             _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'
6010           else
6011             _LT_TAGVAR(ld_shlibs, $1)=no
6012           fi
6013         ;;
6014       esac
6015       ;;
6016
6017     sunos4*)
6018       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6019       wlarc=
6020       _LT_TAGVAR(hardcode_direct, $1)=yes
6021       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6022       ;;
6023
6024     *)
6025       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6026         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6027         _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'
6028       else
6029         _LT_TAGVAR(ld_shlibs, $1)=no
6030       fi
6031       ;;
6032     esac
6033
6034     if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
6035       runpath_var=
6036       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6037       _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6038       _LT_TAGVAR(whole_archive_flag_spec, $1)=
6039     fi
6040   else
6041     # PORTME fill in a description of your system's linker (not GNU ld)
6042     case $host_os in
6043     aix3*)
6044       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6045       _LT_TAGVAR(always_export_symbols, $1)=yes
6046       _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'
6047       # Note: this linker hardcodes the directories in LIBPATH if there
6048       # are no directories specified by -L.
6049       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6050       if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6051         # Neither direct hardcoding nor static linking is supported with a
6052         # broken collect2.
6053         _LT_TAGVAR(hardcode_direct, $1)=unsupported
6054       fi
6055       ;;
6056
6057     aix[[4-9]]*)
6058       if test "$host_cpu" = ia64; then
6059         # On IA64, the linker does run time linking by default, so we don't
6060         # have to do anything special.
6061         aix_use_runtimelinking=no
6062         exp_sym_flag='-Bexport'
6063         no_entry_flag=""
6064       else
6065         # If we're using GNU nm, then we don't want the "-C" option.
6066         # -C means demangle to AIX nm, but means don't demangle with GNU nm
6067         # Also, AIX nm treats weak defined symbols like other global
6068         # defined symbols, whereas GNU nm marks them as "W".
6069         if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
6070           _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'
6071         else
6072           _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'
6073         fi
6074         aix_use_runtimelinking=no
6075
6076         # Test if we are trying to use run time linking or normal
6077         # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6078         # need to do runtime linking.
6079         case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6080           for ld_flag in $LDFLAGS; do
6081           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6082             aix_use_runtimelinking=yes
6083             break
6084           fi
6085           done
6086           ;;
6087         esac
6088
6089         exp_sym_flag='-bexport'
6090         no_entry_flag='-bnoentry'
6091       fi
6092
6093       # When large executables or shared objects are built, AIX ld can
6094       # have problems creating the table of contents.  If linking a library
6095       # or program results in "error TOC overflow" add -mminimal-toc to
6096       # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6097       # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6098
6099       _LT_TAGVAR(archive_cmds, $1)=''
6100       _LT_TAGVAR(hardcode_direct, $1)=yes
6101       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6102       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6103       _LT_TAGVAR(link_all_deplibs, $1)=yes
6104       _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6105
6106       if test "$GCC" = yes; then
6107         case $host_os in aix4.[[012]]|aix4.[[012]].*)
6108         # We only want to do this on AIX 4.2 and lower, the check
6109         # below for broken collect2 doesn't work under 4.3+
6110           collect2name=`${CC} -print-prog-name=collect2`
6111           if test -f "$collect2name" &&
6112            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6113           then
6114           # We have reworked collect2
6115           :
6116           else
6117           # We have old collect2
6118           _LT_TAGVAR(hardcode_direct, $1)=unsupported
6119           # It fails to find uninstalled libraries when the uninstalled
6120           # path is not listed in the libpath.  Setting hardcode_minus_L
6121           # to unsupported forces relinking
6122           _LT_TAGVAR(hardcode_minus_L, $1)=yes
6123           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6124           _LT_TAGVAR(hardcode_libdir_separator, $1)=
6125           fi
6126           ;;
6127         esac
6128         shared_flag='-shared'
6129         if test "$aix_use_runtimelinking" = yes; then
6130           shared_flag="$shared_flag "'${wl}-G'
6131         fi
6132       else
6133         # not using gcc
6134         if test "$host_cpu" = ia64; then
6135         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6136         # chokes on -Wl,-G. The following line is correct:
6137           shared_flag='-G'
6138         else
6139           if test "$aix_use_runtimelinking" = yes; then
6140             shared_flag='${wl}-G'
6141           else
6142             shared_flag='${wl}-bM:SRE'
6143           fi
6144         fi
6145       fi
6146
6147       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6148       # It seems that -bexpall does not export symbols beginning with
6149       # underscore (_), so it is better to generate a list of symbols to export.
6150       _LT_TAGVAR(always_export_symbols, $1)=yes
6151       if test "$aix_use_runtimelinking" = yes; then
6152         # Warning - without using the other runtime loading flags (-brtl),
6153         # -berok will link without error, but may produce a broken library.
6154         _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6155         # Determine the default libpath from the value encoded in an
6156         # empty executable.
6157         _LT_SYS_MODULE_PATH_AIX([$1])
6158         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6159         _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"
6160       else
6161         if test "$host_cpu" = ia64; then
6162           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6163           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6164           _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"
6165         else
6166          # Determine the default libpath from the value encoded in an
6167          # empty executable.
6168          _LT_SYS_MODULE_PATH_AIX([$1])
6169          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6170           # Warning - without using the other run time loading flags,
6171           # -berok will link without error, but may produce a broken library.
6172           _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6173           _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6174           if test "$with_gnu_ld" = yes; then
6175             # We only use this code for GNU lds that support --whole-archive.
6176             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6177           else
6178             # Exported symbols can be pulled into shared objects from archives
6179             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6180           fi
6181           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6182           # This is similar to how AIX traditionally builds its shared libraries.
6183           _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'
6184         fi
6185       fi
6186       ;;
6187
6188     amigaos*)
6189       case $host_cpu in
6190       powerpc)
6191             # see comment about AmigaOS4 .so support
6192             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6193             _LT_TAGVAR(archive_expsym_cmds, $1)=''
6194         ;;
6195       m68k)
6196             _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)'
6197             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6198             _LT_TAGVAR(hardcode_minus_L, $1)=yes
6199         ;;
6200       esac
6201       ;;
6202
6203     bsdi[[45]]*)
6204       _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6205       ;;
6206
6207     cygwin* | mingw* | pw32* | cegcc*)
6208       # When not using gcc, we currently assume that we are using
6209       # Microsoft Visual C++.
6210       # hardcode_libdir_flag_spec is actually meaningless, as there is
6211       # no search path for DLLs.
6212       case $cc_basename in
6213       cl*)
6214         # Native MSVC
6215         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6216         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6217         _LT_TAGVAR(always_export_symbols, $1)=yes
6218         _LT_TAGVAR(file_list_spec, $1)='@'
6219         # Tell ltmain to make .lib files, not .a files.
6220         libext=lib
6221         # Tell ltmain to make .dll files, not .so files.
6222         shrext_cmds=".dll"
6223         # FIXME: Setting linknames here is a bad hack.
6224         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6225         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6226             sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6227           else
6228             sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6229           fi~
6230           $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6231           linknames='
6232         # The linker will not automatically build a static lib if we build a DLL.
6233         # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6234         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6235         _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'
6236         # Don't use ranlib
6237         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6238         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6239           lt_tool_outputfile="@TOOL_OUTPUT@"~
6240           case $lt_outputfile in
6241             *.exe|*.EXE) ;;
6242             *)
6243               lt_outputfile="$lt_outputfile.exe"
6244               lt_tool_outputfile="$lt_tool_outputfile.exe"
6245               ;;
6246           esac~
6247           if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6248             $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6249             $RM "$lt_outputfile.manifest";
6250           fi'
6251         ;;
6252       *)
6253         # Assume MSVC wrapper
6254         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6255         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6256         # Tell ltmain to make .lib files, not .a files.
6257         libext=lib
6258         # Tell ltmain to make .dll files, not .so files.
6259         shrext_cmds=".dll"
6260         # FIXME: Setting linknames here is a bad hack.
6261         _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6262         # The linker will automatically build a .lib file if we build a DLL.
6263         _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6264         # FIXME: Should let the user specify the lib program.
6265         _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6266         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6267         ;;
6268       esac
6269       ;;
6270
6271     darwin* | rhapsody*)
6272       _LT_DARWIN_LINKER_FEATURES($1)
6273       ;;
6274
6275     dgux*)
6276       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6277       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6278       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6279       ;;
6280
6281     freebsd1*)
6282       _LT_TAGVAR(ld_shlibs, $1)=no
6283       ;;
6284
6285     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6286     # support.  Future versions do this automatically, but an explicit c++rt0.o
6287     # does not break anything, and helps significantly (at the cost of a little
6288     # extra space).
6289     freebsd2.2*)
6290       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6291       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6292       _LT_TAGVAR(hardcode_direct, $1)=yes
6293       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6294       ;;
6295
6296     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6297     freebsd2*)
6298       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6299       _LT_TAGVAR(hardcode_direct, $1)=yes
6300       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6301       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6302       ;;
6303
6304     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6305     freebsd* | dragonfly*)
6306       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6307       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6308       _LT_TAGVAR(hardcode_direct, $1)=yes
6309       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6310       ;;
6311
6312     hpux9*)
6313       if test "$GCC" = yes; then
6314         _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'
6315       else
6316         _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'
6317       fi
6318       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6319       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6320       _LT_TAGVAR(hardcode_direct, $1)=yes
6321
6322       # hardcode_minus_L: Not really in the search PATH,
6323       # but as the default location of the library.
6324       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6325       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6326       ;;
6327
6328     hpux10*)
6329       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6330         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6331       else
6332         _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6333       fi
6334       if test "$with_gnu_ld" = no; then
6335         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6336         _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
6337         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6338         _LT_TAGVAR(hardcode_direct, $1)=yes
6339         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6340         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6341         # hardcode_minus_L: Not really in the search PATH,
6342         # but as the default location of the library.
6343         _LT_TAGVAR(hardcode_minus_L, $1)=yes
6344       fi
6345       ;;
6346
6347     hpux11*)
6348       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6349         case $host_cpu in
6350         hppa*64*)
6351           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6352           ;;
6353         ia64*)
6354           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6355           ;;
6356         *)
6357           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6358           ;;
6359         esac
6360       else
6361         case $host_cpu in
6362         hppa*64*)
6363           _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6364           ;;
6365         ia64*)
6366           _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6367           ;;
6368         *)
6369         m4_if($1, [], [
6370           # Older versions of the 11.00 compiler do not understand -b yet
6371           # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6372           _LT_LINKER_OPTION([if $CC understands -b],
6373             _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6374             [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6375             [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6376           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6377           ;;
6378         esac
6379       fi
6380       if test "$with_gnu_ld" = no; then
6381         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6382         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6383
6384         case $host_cpu in
6385         hppa*64*|ia64*)
6386           _LT_TAGVAR(hardcode_direct, $1)=no
6387           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6388           ;;
6389         *)
6390           _LT_TAGVAR(hardcode_direct, $1)=yes
6391           _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6392           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6393
6394           # hardcode_minus_L: Not really in the search PATH,
6395           # but as the default location of the library.
6396           _LT_TAGVAR(hardcode_minus_L, $1)=yes
6397           ;;
6398         esac
6399       fi
6400       ;;
6401
6402     irix5* | irix6* | nonstopux*)
6403       if test "$GCC" = yes; then
6404         _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'
6405         # Try to use the -exported_symbol ld option, if it does not
6406         # work, assume that -exports_file does not work either and
6407         # implicitly export all symbols.
6408         # This should be the same for all languages, so no per-tag cache variable.
6409         AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6410           [lt_cv_irix_exported_symbol],
6411           [save_LDFLAGS="$LDFLAGS"
6412            LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6413            AC_LINK_IFELSE(
6414              [AC_LANG_SOURCE(
6415                 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6416                               [C++], [[int foo (void) { return 0; }]],
6417                               [Fortran 77], [[
6418       subroutine foo
6419       end]],
6420                               [Fortran], [[
6421       subroutine foo
6422       end]])])],
6423               [lt_cv_irix_exported_symbol=yes],
6424               [lt_cv_irix_exported_symbol=no])
6425            LDFLAGS="$save_LDFLAGS"])
6426         if test "$lt_cv_irix_exported_symbol" = yes; then
6427           _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'
6428         fi
6429       else
6430         _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'
6431         _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'
6432       fi
6433       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6434       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6435       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6436       _LT_TAGVAR(inherit_rpath, $1)=yes
6437       _LT_TAGVAR(link_all_deplibs, $1)=yes
6438       ;;
6439
6440     netbsd*)
6441       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6442         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6443       else
6444         _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6445       fi
6446       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6447       _LT_TAGVAR(hardcode_direct, $1)=yes
6448       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6449       ;;
6450
6451     newsos6)
6452       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6453       _LT_TAGVAR(hardcode_direct, $1)=yes
6454       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6455       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6456       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6457       ;;
6458
6459     *nto* | *qnx*)
6460       ;;
6461
6462     openbsd*)
6463       if test -f /usr/libexec/ld.so; then
6464         _LT_TAGVAR(hardcode_direct, $1)=yes
6465         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6466         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6467         if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6468           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6469           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6470           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6471           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6472         else
6473           case $host_os in
6474            openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6475              _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6476              _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6477              ;;
6478            *)
6479              _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6480              _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6481              ;;
6482           esac
6483         fi
6484       else
6485         _LT_TAGVAR(ld_shlibs, $1)=no
6486       fi
6487       ;;
6488
6489     os2*)
6490       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6491       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6492       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6493       _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'
6494       _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6495       ;;
6496
6497     osf3*)
6498       if test "$GCC" = yes; then
6499         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6500         _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'
6501       else
6502         _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6503         _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'
6504       fi
6505       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6506       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6507       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6508       ;;
6509
6510     osf4* | osf5*)      # as osf3* with the addition of -msym flag
6511       if test "$GCC" = yes; then
6512         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6513         _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'
6514         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6515       else
6516         _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6517         _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'
6518         _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~
6519         $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'
6520
6521         # Both c and cxx compiler support -rpath directly
6522         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6523       fi
6524       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6525       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6526       ;;
6527
6528     solaris*)
6529       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6530       if test "$GCC" = yes; then
6531         wlarc='${wl}'
6532         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6533         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6534           $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'
6535       else
6536         case `$CC -V 2>&1` in
6537         *"Compilers 5.0"*)
6538           wlarc=''
6539           _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6540           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6541           $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6542           ;;
6543         *)
6544           wlarc='${wl}'
6545           _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6546           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6547           $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6548           ;;
6549         esac
6550       fi
6551       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6552       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6553       case $host_os in
6554       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6555       *)
6556         # The compiler driver will combine and reorder linker options,
6557         # but understands `-z linker_flag'.  GCC discards it without `$wl',
6558         # but is careful enough not to reorder.
6559         # Supported since Solaris 2.6 (maybe 2.5.1?)
6560         if test "$GCC" = yes; then
6561           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6562         else
6563           _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6564         fi
6565         ;;
6566       esac
6567       _LT_TAGVAR(link_all_deplibs, $1)=yes
6568       ;;
6569
6570     sunos4*)
6571       if test "x$host_vendor" = xsequent; then
6572         # Use $CC to link under sequent, because it throws in some extra .o
6573         # files that make .init and .fini sections work.
6574         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6575       else
6576         _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6577       fi
6578       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6579       _LT_TAGVAR(hardcode_direct, $1)=yes
6580       _LT_TAGVAR(hardcode_minus_L, $1)=yes
6581       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6582       ;;
6583
6584     sysv4)
6585       case $host_vendor in
6586         sni)
6587           _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6588           _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6589         ;;
6590         siemens)
6591           ## LD is ld it makes a PLAMLIB
6592           ## CC just makes a GrossModule.
6593           _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6594           _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6595           _LT_TAGVAR(hardcode_direct, $1)=no
6596         ;;
6597         motorola)
6598           _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6599           _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6600         ;;
6601       esac
6602       runpath_var='LD_RUN_PATH'
6603       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6604       ;;
6605
6606     sysv4.3*)
6607       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6608       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6609       _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6610       ;;
6611
6612     sysv4*MP*)
6613       if test -d /usr/nec; then
6614         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6615         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6616         runpath_var=LD_RUN_PATH
6617         hardcode_runpath_var=yes
6618         _LT_TAGVAR(ld_shlibs, $1)=yes
6619       fi
6620       ;;
6621
6622     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6623       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6624       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6625       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6626       runpath_var='LD_RUN_PATH'
6627
6628       if test "$GCC" = yes; then
6629         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6630         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6631       else
6632         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6633         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6634       fi
6635       ;;
6636
6637     sysv5* | sco3.2v5* | sco5v6*)
6638       # Note: We can NOT use -z defs as we might desire, because we do not
6639       # link with -lc, and that would cause any symbols used from libc to
6640       # always be unresolved, which means just about no library would
6641       # ever link correctly.  If we're not using GNU ld we use -z text
6642       # though, which does catch some bad symbols but isn't as heavy-handed
6643       # as -z defs.
6644       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6645       _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6646       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6647       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6648       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6649       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6650       _LT_TAGVAR(link_all_deplibs, $1)=yes
6651       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6652       runpath_var='LD_RUN_PATH'
6653
6654       if test "$GCC" = yes; then
6655         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6656         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6657       else
6658         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6659         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6660       fi
6661       ;;
6662
6663     uts4*)
6664       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6665       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6666       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6667       ;;
6668
6669     *)
6670       _LT_TAGVAR(ld_shlibs, $1)=no
6671       ;;
6672     esac
6673
6674     if test x$host_vendor = xsni; then
6675       case $host in
6676       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6677         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6678         ;;
6679       esac
6680     fi
6681   fi
6682 ])
6683 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6684 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6685
6686 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6687
6688 _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6689 _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6690 _LT_DECL([], [extract_expsyms_cmds], [2],
6691     [The commands to extract the exported symbol list from a shared archive])
6692
6693 #
6694 # Do we need to explicitly link libc?
6695 #
6696 case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6697 x|xyes)
6698   # Assume -lc should be added
6699   _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6700
6701   if test "$enable_shared" = yes && test "$GCC" = yes; then
6702     case $_LT_TAGVAR(archive_cmds, $1) in
6703     *'~'*)
6704       # FIXME: we may have to deal with multi-command sequences.
6705       ;;
6706     '$CC '*)
6707       # Test whether the compiler implicitly links with -lc since on some
6708       # systems, -lgcc has to come before -lc. If gcc already passes -lc
6709       # to ld, don't add -lc before -lgcc.
6710       AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6711         [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6712         [$RM conftest*
6713         echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6714
6715         if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6716           soname=conftest
6717           lib=conftest
6718           libobjs=conftest.$ac_objext
6719           deplibs=
6720           wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6721           pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6722           compiler_flags=-v
6723           linker_flags=-v
6724           verstring=
6725           output_objdir=.
6726           libname=conftest
6727           lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6728           _LT_TAGVAR(allow_undefined_flag, $1)=
6729           if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6730           then
6731             lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6732           else
6733             lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6734           fi
6735           _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6736         else
6737           cat conftest.err 1>&5
6738         fi
6739         $RM conftest*
6740         ])
6741       _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6742       ;;
6743     esac
6744   fi
6745   ;;
6746 esac
6747
6748 _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6749     [Whether or not to add -lc for building shared libraries])
6750 _LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6751     [enable_shared_with_static_runtimes], [0],
6752     [Whether or not to disallow shared libs when runtime libs are static])
6753 _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6754     [Compiler flag to allow reflexive dlopens])
6755 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
6756     [Compiler flag to generate shared objects directly from archives])
6757 _LT_TAGDECL([], [compiler_needs_object], [1],
6758     [Whether the compiler copes with passing no objects directly])
6759 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6760     [Create an old-style archive from a shared archive])
6761 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6762     [Create a temporary old-style archive to link instead of a shared archive])
6763 _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6764 _LT_TAGDECL([], [archive_expsym_cmds], [2])
6765 _LT_TAGDECL([], [module_cmds], [2],
6766     [Commands used to build a loadable module if different from building
6767     a shared archive.])
6768 _LT_TAGDECL([], [module_expsym_cmds], [2])
6769 _LT_TAGDECL([], [with_gnu_ld], [1],
6770     [Whether we are building with GNU ld or not])
6771 _LT_TAGDECL([], [allow_undefined_flag], [1],
6772     [Flag that allows shared libraries with undefined symbols to be built])
6773 _LT_TAGDECL([], [no_undefined_flag], [1],
6774     [Flag that enforces no undefined symbols])
6775 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6776     [Flag to hardcode $libdir into a binary during linking.
6777     This must work even if $libdir does not exist])
6778 _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
6779     [[If ld is used when linking, flag to hardcode $libdir into a binary
6780     during linking.  This must work even if $libdir does not exist]])
6781 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
6782     [Whether we need a single "-rpath" flag with a separated argument])
6783 _LT_TAGDECL([], [hardcode_direct], [0],
6784     [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6785     DIR into the resulting binary])
6786 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
6787     [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6788     DIR into the resulting binary and the resulting library dependency is
6789     "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6790     library is relocated])
6791 _LT_TAGDECL([], [hardcode_minus_L], [0],
6792     [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6793     into the resulting binary])
6794 _LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6795     [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6796     into the resulting binary])
6797 _LT_TAGDECL([], [hardcode_automatic], [0],
6798     [Set to "yes" if building a shared library automatically hardcodes DIR
6799     into the library and all subsequent libraries and executables linked
6800     against it])
6801 _LT_TAGDECL([], [inherit_rpath], [0],
6802     [Set to yes if linker adds runtime paths of dependent libraries
6803     to runtime path list])
6804 _LT_TAGDECL([], [link_all_deplibs], [0],
6805     [Whether libtool must link a program against all its dependency libraries])
6806 _LT_TAGDECL([], [always_export_symbols], [0],
6807     [Set to "yes" if exported symbols are required])
6808 _LT_TAGDECL([], [export_symbols_cmds], [2],
6809     [The commands to list exported symbols])
6810 _LT_TAGDECL([], [exclude_expsyms], [1],
6811     [Symbols that should not be listed in the preloaded symbols])
6812 _LT_TAGDECL([], [include_expsyms], [1],
6813     [Symbols that must always be exported])
6814 _LT_TAGDECL([], [prelink_cmds], [2],
6815     [Commands necessary for linking programs (against libraries) with templates])
6816 _LT_TAGDECL([], [postlink_cmds], [2],
6817     [Commands necessary for finishing linking programs])
6818 _LT_TAGDECL([], [file_list_spec], [1],
6819     [Specify filename containing input files])
6820 dnl FIXME: Not yet implemented
6821 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6822 dnl    [Compiler flag to generate thread safe objects])
6823 ])# _LT_LINKER_SHLIBS
6824
6825
6826 # _LT_LANG_C_CONFIG([TAG])
6827 # ------------------------
6828 # Ensure that the configuration variables for a C compiler are suitably
6829 # defined.  These variables are subsequently used by _LT_CONFIG to write
6830 # the compiler configuration to `libtool'.
6831 m4_defun([_LT_LANG_C_CONFIG],
6832 [m4_require([_LT_DECL_EGREP])dnl
6833 lt_save_CC="$CC"
6834 AC_LANG_PUSH(C)
6835
6836 # Source file extension for C test sources.
6837 ac_ext=c
6838
6839 # Object file extension for compiled C test sources.
6840 objext=o
6841 _LT_TAGVAR(objext, $1)=$objext
6842
6843 # Code to be used in simple compile tests
6844 lt_simple_compile_test_code="int some_variable = 0;"
6845
6846 # Code to be used in simple link tests
6847 lt_simple_link_test_code='int main(){return(0);}'
6848
6849 _LT_TAG_COMPILER
6850 # Save the default compiler, since it gets overwritten when the other
6851 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6852 compiler_DEFAULT=$CC
6853
6854 # save warnings/boilerplate of simple test code
6855 _LT_COMPILER_BOILERPLATE
6856 _LT_LINKER_BOILERPLATE
6857
6858 if test -n "$compiler"; then
6859   _LT_COMPILER_NO_RTTI($1)
6860   _LT_COMPILER_PIC($1)
6861   _LT_COMPILER_C_O($1)
6862   _LT_COMPILER_FILE_LOCKS($1)
6863   _LT_LINKER_SHLIBS($1)
6864   _LT_SYS_DYNAMIC_LINKER($1)
6865   _LT_LINKER_HARDCODE_LIBPATH($1)
6866   LT_SYS_DLOPEN_SELF
6867   _LT_CMD_STRIPLIB
6868
6869   # Report which library types will actually be built
6870   AC_MSG_CHECKING([if libtool supports shared libraries])
6871   AC_MSG_RESULT([$can_build_shared])
6872
6873   AC_MSG_CHECKING([whether to build shared libraries])
6874   test "$can_build_shared" = "no" && enable_shared=no
6875
6876   # On AIX, shared libraries and static libraries use the same namespace, and
6877   # are all built from PIC.
6878   case $host_os in
6879   aix3*)
6880     test "$enable_shared" = yes && enable_static=no
6881     if test -n "$RANLIB"; then
6882       archive_cmds="$archive_cmds~\$RANLIB \$lib"
6883       postinstall_cmds='$RANLIB $lib'
6884     fi
6885     ;;
6886
6887   aix[[4-9]]*)
6888     if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6889       test "$enable_shared" = yes && enable_static=no
6890     fi
6891     ;;
6892   esac
6893   AC_MSG_RESULT([$enable_shared])
6894
6895   AC_MSG_CHECKING([whether to build static libraries])
6896   # Make sure either enable_shared or enable_static is yes.
6897   test "$enable_shared" = yes || enable_static=yes
6898   AC_MSG_RESULT([$enable_static])
6899
6900   _LT_CONFIG($1)
6901 fi
6902 AC_LANG_POP
6903 CC="$lt_save_CC"
6904 ])# _LT_LANG_C_CONFIG
6905
6906
6907 # _LT_LANG_CXX_CONFIG([TAG])
6908 # --------------------------
6909 # Ensure that the configuration variables for a C++ compiler are suitably
6910 # defined.  These variables are subsequently used by _LT_CONFIG to write
6911 # the compiler configuration to `libtool'.
6912 m4_defun([_LT_LANG_CXX_CONFIG],
6913 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6914 m4_require([_LT_DECL_EGREP])dnl
6915 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6916 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6917     ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6918     (test "X$CXX" != "Xg++"))) ; then
6919   AC_PROG_CXXCPP
6920 else
6921   _lt_caught_CXX_error=yes
6922 fi
6923
6924 AC_LANG_PUSH(C++)
6925 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6926 _LT_TAGVAR(allow_undefined_flag, $1)=
6927 _LT_TAGVAR(always_export_symbols, $1)=no
6928 _LT_TAGVAR(archive_expsym_cmds, $1)=
6929 _LT_TAGVAR(compiler_needs_object, $1)=no
6930 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6931 _LT_TAGVAR(hardcode_direct, $1)=no
6932 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6933 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6934 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6935 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6936 _LT_TAGVAR(hardcode_minus_L, $1)=no
6937 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6938 _LT_TAGVAR(hardcode_automatic, $1)=no
6939 _LT_TAGVAR(inherit_rpath, $1)=no
6940 _LT_TAGVAR(module_cmds, $1)=
6941 _LT_TAGVAR(module_expsym_cmds, $1)=
6942 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6943 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6944 _LT_TAGVAR(reload_flag, $1)=$reload_flag
6945 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6946 _LT_TAGVAR(no_undefined_flag, $1)=
6947 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6948 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6949
6950 # Source file extension for C++ test sources.
6951 ac_ext=cpp
6952
6953 # Object file extension for compiled C++ test sources.
6954 objext=o
6955 _LT_TAGVAR(objext, $1)=$objext
6956
6957 # No sense in running all these tests if we already determined that
6958 # the CXX compiler isn't working.  Some variables (like enable_shared)
6959 # are currently assumed to apply to all compilers on this platform,
6960 # and will be corrupted by setting them based on a non-working compiler.
6961 if test "$_lt_caught_CXX_error" != yes; then
6962   # Code to be used in simple compile tests
6963   lt_simple_compile_test_code="int some_variable = 0;"
6964
6965   # Code to be used in simple link tests
6966   lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6967
6968   # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6969   _LT_TAG_COMPILER
6970
6971   # save warnings/boilerplate of simple test code
6972   _LT_COMPILER_BOILERPLATE
6973   _LT_LINKER_BOILERPLATE
6974
6975   # Allow CC to be a program name with arguments.
6976   lt_save_CC=$CC
6977   lt_save_CFLAGS=$CFLAGS
6978   lt_save_LD=$LD
6979   lt_save_GCC=$GCC
6980   GCC=$GXX
6981   lt_save_with_gnu_ld=$with_gnu_ld
6982   lt_save_path_LD=$lt_cv_path_LD
6983   if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6984     lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6985   else
6986     $as_unset lt_cv_prog_gnu_ld
6987   fi
6988   if test -n "${lt_cv_path_LDCXX+set}"; then
6989     lt_cv_path_LD=$lt_cv_path_LDCXX
6990   else
6991     $as_unset lt_cv_path_LD
6992   fi
6993   test -z "${LDCXX+set}" || LD=$LDCXX
6994   CC=${CXX-"c++"}
6995   CFLAGS=$CXXFLAGS
6996   compiler=$CC
6997   _LT_TAGVAR(compiler, $1)=$CC
6998   _LT_CC_BASENAME([$compiler])
6999
7000   if test -n "$compiler"; then
7001     # We don't want -fno-exception when compiling C++ code, so set the
7002     # no_builtin_flag separately
7003     if test "$GXX" = yes; then
7004       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7005     else
7006       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7007     fi
7008
7009     if test "$GXX" = yes; then
7010       # Set up default GNU C++ configuration
7011
7012       LT_PATH_LD
7013
7014       # Check if GNU C++ uses GNU ld as the underlying linker, since the
7015       # archiving commands below assume that GNU ld is being used.
7016       if test "$with_gnu_ld" = yes; then
7017         _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7018         _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'
7019
7020         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7021         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7022
7023         # If archive_cmds runs LD, not CC, wlarc should be empty
7024         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
7025         #     investigate it a little bit more. (MM)
7026         wlarc='${wl}'
7027
7028         # ancient GNU ld didn't support --whole-archive et. al.
7029         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
7030           $GREP 'no-whole-archive' > /dev/null; then
7031           _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7032         else
7033           _LT_TAGVAR(whole_archive_flag_spec, $1)=
7034         fi
7035       else
7036         with_gnu_ld=no
7037         wlarc=
7038
7039         # A generic and very simple default shared library creation
7040         # command for GNU C++ for the case where it uses the native
7041         # linker, instead of GNU ld.  If possible, this setting should
7042         # overridden to take advantage of the native linker features on
7043         # the platform it is being used on.
7044         _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7045       fi
7046
7047       # Commands to make compiler produce verbose output that lists
7048       # what "hidden" libraries, object files and flags are used when
7049       # linking a shared library.
7050       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7051
7052     else
7053       GXX=no
7054       with_gnu_ld=no
7055       wlarc=
7056     fi
7057
7058     # PORTME: fill in a description of your system's C++ link characteristics
7059     AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7060     _LT_TAGVAR(ld_shlibs, $1)=yes
7061     case $host_os in
7062       aix3*)
7063         # FIXME: insert proper C++ library support
7064         _LT_TAGVAR(ld_shlibs, $1)=no
7065         ;;
7066       aix[[4-9]]*)
7067         if test "$host_cpu" = ia64; then
7068           # On IA64, the linker does run time linking by default, so we don't
7069           # have to do anything special.
7070           aix_use_runtimelinking=no
7071           exp_sym_flag='-Bexport'
7072           no_entry_flag=""
7073         else
7074           aix_use_runtimelinking=no
7075
7076           # Test if we are trying to use run time linking or normal
7077           # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7078           # need to do runtime linking.
7079           case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7080             for ld_flag in $LDFLAGS; do
7081               case $ld_flag in
7082               *-brtl*)
7083                 aix_use_runtimelinking=yes
7084                 break
7085                 ;;
7086               esac
7087             done
7088             ;;
7089           esac
7090
7091           exp_sym_flag='-bexport'
7092           no_entry_flag='-bnoentry'
7093         fi
7094
7095         # When large executables or shared objects are built, AIX ld can
7096         # have problems creating the table of contents.  If linking a library
7097         # or program results in "error TOC overflow" add -mminimal-toc to
7098         # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7099         # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7100
7101         _LT_TAGVAR(archive_cmds, $1)=''
7102         _LT_TAGVAR(hardcode_direct, $1)=yes
7103         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7104         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7105         _LT_TAGVAR(link_all_deplibs, $1)=yes
7106         _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7107
7108         if test "$GXX" = yes; then
7109           case $host_os in aix4.[[012]]|aix4.[[012]].*)
7110           # We only want to do this on AIX 4.2 and lower, the check
7111           # below for broken collect2 doesn't work under 4.3+
7112           collect2name=`${CC} -print-prog-name=collect2`
7113           if test -f "$collect2name" &&
7114              strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7115           then
7116             # We have reworked collect2
7117             :
7118           else
7119             # We have old collect2
7120             _LT_TAGVAR(hardcode_direct, $1)=unsupported
7121             # It fails to find uninstalled libraries when the uninstalled
7122             # path is not listed in the libpath.  Setting hardcode_minus_L
7123             # to unsupported forces relinking
7124             _LT_TAGVAR(hardcode_minus_L, $1)=yes
7125             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7126             _LT_TAGVAR(hardcode_libdir_separator, $1)=
7127           fi
7128           esac
7129           shared_flag='-shared'
7130           if test "$aix_use_runtimelinking" = yes; then
7131             shared_flag="$shared_flag "'${wl}-G'
7132           fi
7133         else
7134           # not using gcc
7135           if test "$host_cpu" = ia64; then
7136           # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7137           # chokes on -Wl,-G. The following line is correct:
7138           shared_flag='-G'
7139           else
7140             if test "$aix_use_runtimelinking" = yes; then
7141               shared_flag='${wl}-G'
7142             else
7143               shared_flag='${wl}-bM:SRE'
7144             fi
7145           fi
7146         fi
7147
7148         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7149         # It seems that -bexpall does not export symbols beginning with
7150         # underscore (_), so it is better to generate a list of symbols to
7151         # export.
7152         _LT_TAGVAR(always_export_symbols, $1)=yes
7153         if test "$aix_use_runtimelinking" = yes; then
7154           # Warning - without using the other runtime loading flags (-brtl),
7155           # -berok will link without error, but may produce a broken library.
7156           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7157           # Determine the default libpath from the value encoded in an empty
7158           # executable.
7159           _LT_SYS_MODULE_PATH_AIX([$1])
7160           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7161
7162           _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"
7163         else
7164           if test "$host_cpu" = ia64; then
7165             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7166             _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7167             _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"
7168           else
7169             # Determine the default libpath from the value encoded in an
7170             # empty executable.
7171             _LT_SYS_MODULE_PATH_AIX([$1])
7172             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7173             # Warning - without using the other run time loading flags,
7174             # -berok will link without error, but may produce a broken library.
7175             _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7176             _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7177             if test "$with_gnu_ld" = yes; then
7178               # We only use this code for GNU lds that support --whole-archive.
7179               _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7180             else
7181               # Exported symbols can be pulled into shared objects from archives
7182               _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7183             fi
7184             _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7185             # This is similar to how AIX traditionally builds its shared
7186             # libraries.
7187             _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'
7188           fi
7189         fi
7190         ;;
7191
7192       beos*)
7193         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7194           _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7195           # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7196           # support --undefined.  This deserves some investigation.  FIXME
7197           _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7198         else
7199           _LT_TAGVAR(ld_shlibs, $1)=no
7200         fi
7201         ;;
7202
7203       chorus*)
7204         case $cc_basename in
7205           *)
7206           # FIXME: insert proper C++ library support
7207           _LT_TAGVAR(ld_shlibs, $1)=no
7208           ;;
7209         esac
7210         ;;
7211
7212       cygwin* | mingw* | pw32* | cegcc*)
7213         case $GXX,$cc_basename in
7214         ,cl* | no,cl*)
7215           # Native MSVC
7216           # hardcode_libdir_flag_spec is actually meaningless, as there is
7217           # no search path for DLLs.
7218           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7219           _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7220           _LT_TAGVAR(always_export_symbols, $1)=yes
7221           _LT_TAGVAR(file_list_spec, $1)='@'
7222           # Tell ltmain to make .lib files, not .a files.
7223           libext=lib
7224           # Tell ltmain to make .dll files, not .so files.
7225           shrext_cmds=".dll"
7226           # FIXME: Setting linknames here is a bad hack.
7227           _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7228           _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7229               $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7230             else
7231               $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7232             fi~
7233             $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7234             linknames='
7235           # The linker will not automatically build a static lib if we build a DLL.
7236           # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7237           _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7238           # Don't use ranlib
7239           _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7240           _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7241             lt_tool_outputfile="@TOOL_OUTPUT@"~
7242             case $lt_outputfile in
7243               *.exe|*.EXE) ;;
7244               *)
7245                 lt_outputfile="$lt_outputfile.exe"
7246                 lt_tool_outputfile="$lt_tool_outputfile.exe"
7247                 ;;
7248             esac~
7249             func_to_tool_file "$lt_outputfile"~
7250             if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7251               $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7252               $RM "$lt_outputfile.manifest";
7253             fi'
7254           ;;
7255         *)
7256           # g++
7257           # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7258           # as there is no search path for DLLs.
7259           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7260           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7261           _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7262           _LT_TAGVAR(always_export_symbols, $1)=no
7263           _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7264
7265           if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7266             _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'
7267             # If the export-symbols file already is a .def file (1st line
7268             # is EXPORTS), use it as is; otherwise, prepend...
7269             _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7270               cp $export_symbols $output_objdir/$soname.def;
7271             else
7272               echo EXPORTS > $output_objdir/$soname.def;
7273               cat $export_symbols >> $output_objdir/$soname.def;
7274             fi~
7275             $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'
7276           else
7277             _LT_TAGVAR(ld_shlibs, $1)=no
7278           fi
7279           ;;
7280         esac
7281         ;;
7282       darwin* | rhapsody*)
7283         _LT_DARWIN_LINKER_FEATURES($1)
7284         ;;
7285
7286       dgux*)
7287         case $cc_basename in
7288           ec++*)
7289             # FIXME: insert proper C++ library support
7290             _LT_TAGVAR(ld_shlibs, $1)=no
7291             ;;
7292           ghcx*)
7293             # Green Hills C++ Compiler
7294             # FIXME: insert proper C++ library support
7295             _LT_TAGVAR(ld_shlibs, $1)=no
7296             ;;
7297           *)
7298             # FIXME: insert proper C++ library support
7299             _LT_TAGVAR(ld_shlibs, $1)=no
7300             ;;
7301         esac
7302         ;;
7303
7304       freebsd[[12]]*)
7305         # C++ shared libraries reported to be fairly broken before
7306         # switch to ELF
7307         _LT_TAGVAR(ld_shlibs, $1)=no
7308         ;;
7309
7310       freebsd-elf*)
7311         _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7312         ;;
7313
7314       freebsd* | dragonfly*)
7315         # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7316         # conventions
7317         _LT_TAGVAR(ld_shlibs, $1)=yes
7318         ;;
7319
7320       gnu*)
7321         ;;
7322
7323       haiku*)
7324         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7325         _LT_TAGVAR(link_all_deplibs, $1)=yes
7326         ;;
7327
7328       hpux9*)
7329         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7330         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7331         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7332         _LT_TAGVAR(hardcode_direct, $1)=yes
7333         _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7334                                              # but as the default
7335                                              # location of the library.
7336
7337         case $cc_basename in
7338           CC*)
7339             # FIXME: insert proper C++ library support
7340             _LT_TAGVAR(ld_shlibs, $1)=no
7341             ;;
7342           aCC*)
7343             _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'
7344             # Commands to make compiler produce verbose output that lists
7345             # what "hidden" libraries, object files and flags are used when
7346             # linking a shared library.
7347             #
7348             # There doesn't appear to be a way to prevent this compiler from
7349             # explicitly linking system object files so we need to strip them
7350             # from the output so that they don't get included in the library
7351             # dependencies.
7352             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"'
7353             ;;
7354           *)
7355             if test "$GXX" = yes; then
7356               _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'
7357             else
7358               # FIXME: insert proper C++ library support
7359               _LT_TAGVAR(ld_shlibs, $1)=no
7360             fi
7361             ;;
7362         esac
7363         ;;
7364
7365       hpux10*|hpux11*)
7366         if test $with_gnu_ld = no; then
7367           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7368           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7369
7370           case $host_cpu in
7371             hppa*64*|ia64*)
7372               ;;
7373             *)
7374               _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7375               ;;
7376           esac
7377         fi
7378         case $host_cpu in
7379           hppa*64*|ia64*)
7380             _LT_TAGVAR(hardcode_direct, $1)=no
7381             _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7382             ;;
7383           *)
7384             _LT_TAGVAR(hardcode_direct, $1)=yes
7385             _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7386             _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7387                                                  # but as the default
7388                                                  # location of the library.
7389             ;;
7390         esac
7391
7392         case $cc_basename in
7393           CC*)
7394             # FIXME: insert proper C++ library support
7395             _LT_TAGVAR(ld_shlibs, $1)=no
7396             ;;
7397           aCC*)
7398             case $host_cpu in
7399               hppa*64*)
7400                 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7401                 ;;
7402               ia64*)
7403                 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7404                 ;;
7405               *)
7406                 _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'
7407                 ;;
7408             esac
7409             # Commands to make compiler produce verbose output that lists
7410             # what "hidden" libraries, object files and flags are used when
7411             # linking a shared library.
7412             #
7413             # There doesn't appear to be a way to prevent this compiler from
7414             # explicitly linking system object files so we need to strip them
7415             # from the output so that they don't get included in the library
7416             # dependencies.
7417             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"'
7418             ;;
7419           *)
7420             if test "$GXX" = yes; then
7421               if test $with_gnu_ld = no; then
7422                 case $host_cpu in
7423                   hppa*64*)
7424                     _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7425                     ;;
7426                   ia64*)
7427                     _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'
7428                     ;;
7429                   *)
7430                     _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'
7431                     ;;
7432                 esac
7433               fi
7434             else
7435               # FIXME: insert proper C++ library support
7436               _LT_TAGVAR(ld_shlibs, $1)=no
7437             fi
7438             ;;
7439         esac
7440         ;;
7441
7442       interix[[3-9]]*)
7443         _LT_TAGVAR(hardcode_direct, $1)=no
7444         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7445         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7446         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7447         # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7448         # Instead, shared libraries are loaded at an image base (0x10000000 by
7449         # default) and relocated if they conflict, which is a slow very memory
7450         # consuming and fragmenting process.  To avoid this, we pick a random,
7451         # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7452         # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7453         _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'
7454         _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'
7455         ;;
7456       irix5* | irix6*)
7457         case $cc_basename in
7458           CC*)
7459             # SGI C++
7460             _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'
7461
7462             # Archives containing C++ object files must be created using
7463             # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7464             # necessary to make sure instantiated templates are included
7465             # in the archive.
7466             _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7467             ;;
7468           *)
7469             if test "$GXX" = yes; then
7470               if test "$with_gnu_ld" = no; then
7471                 _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'
7472               else
7473                 _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'
7474               fi
7475             fi
7476             _LT_TAGVAR(link_all_deplibs, $1)=yes
7477             ;;
7478         esac
7479         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7480         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7481         _LT_TAGVAR(inherit_rpath, $1)=yes
7482         ;;
7483
7484       linux* | k*bsd*-gnu | kopensolaris*-gnu)
7485         case $cc_basename in
7486           KCC*)
7487             # Kuck and Associates, Inc. (KAI) C++ Compiler
7488
7489             # KCC will only create a shared library if the output file
7490             # ends with ".so" (or ".sl" for HP-UX), so rename the library
7491             # to its proper name (with version) after linking.
7492             _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'
7493             _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'
7494             # Commands to make compiler produce verbose output that lists
7495             # what "hidden" libraries, object files and flags are used when
7496             # linking a shared library.
7497             #
7498             # There doesn't appear to be a way to prevent this compiler from
7499             # explicitly linking system object files so we need to strip them
7500             # from the output so that they don't get included in the library
7501             # dependencies.
7502             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"'
7503
7504             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7505             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7506
7507             # Archives containing C++ object files must be created using
7508             # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7509             _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7510             ;;
7511           icpc* | ecpc* )
7512             # Intel C++
7513             with_gnu_ld=yes
7514             # version 8.0 and above of icpc choke on multiply defined symbols
7515             # if we add $predep_objects and $postdep_objects, however 7.1 and
7516             # earlier do not add the objects themselves.
7517             case `$CC -V 2>&1` in
7518               *"Version 7."*)
7519                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7520                 _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'
7521                 ;;
7522               *)  # Version 8.0 or newer
7523                 tmp_idyn=
7524                 case $host_cpu in
7525                   ia64*) tmp_idyn=' -i_dynamic';;
7526                 esac
7527                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7528                 _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'
7529                 ;;
7530             esac
7531             _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7532             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7533             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7534             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7535             ;;
7536           pgCC* | pgcpp*)
7537             # Portland Group C++ compiler
7538             case `$CC -V` in
7539             *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7540               _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7541                 rm -rf $tpldir~
7542                 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7543                 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7544               _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7545                 rm -rf $tpldir~
7546                 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7547                 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7548                 $RANLIB $oldlib'
7549               _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7550                 rm -rf $tpldir~
7551                 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7552                 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7553               _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7554                 rm -rf $tpldir~
7555                 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7556                 $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'
7557               ;;
7558             *) # Version 6 and above use weak symbols
7559               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7560               _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'
7561               ;;
7562             esac
7563
7564             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7565             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7566             _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'
7567             ;;
7568           cxx*)
7569             # Compaq C++
7570             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7571             _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'
7572
7573             runpath_var=LD_RUN_PATH
7574             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7575             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7576
7577             # Commands to make compiler produce verbose output that lists
7578             # what "hidden" libraries, object files and flags are used when
7579             # linking a shared library.
7580             #
7581             # There doesn't appear to be a way to prevent this compiler from
7582             # explicitly linking system object files so we need to strip them
7583             # from the output so that they don't get included in the library
7584             # dependencies.
7585             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'
7586             ;;
7587           xl* | mpixl* | bgxl*)
7588             # IBM XL 8.0 on PPC, with GNU ld
7589             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7590             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7591             _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7592             if test "x$supports_anon_versioning" = xyes; then
7593               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7594                 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7595                 echo "local: *; };" >> $output_objdir/$libname.ver~
7596                 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7597             fi
7598             ;;
7599           *)
7600             case `$CC -V 2>&1 | sed 5q` in
7601             *Sun\ C*)
7602               # Sun C++ 5.9
7603               _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7604               _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7605               _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'
7606               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7607               _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'
7608               _LT_TAGVAR(compiler_needs_object, $1)=yes
7609
7610               # Not sure whether something based on
7611               # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7612               # would be better.
7613               output_verbose_link_cmd='func_echo_all'
7614
7615               # Archives containing C++ object files must be created using
7616               # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7617               # necessary to make sure instantiated templates are included
7618               # in the archive.
7619               _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7620               ;;
7621             esac
7622             ;;
7623         esac
7624         ;;
7625
7626       lynxos*)
7627         # FIXME: insert proper C++ library support
7628         _LT_TAGVAR(ld_shlibs, $1)=no
7629         ;;
7630
7631       m88k*)
7632         # FIXME: insert proper C++ library support
7633         _LT_TAGVAR(ld_shlibs, $1)=no
7634         ;;
7635
7636       mvs*)
7637         case $cc_basename in
7638           cxx*)
7639             # FIXME: insert proper C++ library support
7640             _LT_TAGVAR(ld_shlibs, $1)=no
7641             ;;
7642           *)
7643             # FIXME: insert proper C++ library support
7644             _LT_TAGVAR(ld_shlibs, $1)=no
7645             ;;
7646         esac
7647         ;;
7648
7649       netbsd*)
7650         if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7651           _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7652           wlarc=
7653           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7654           _LT_TAGVAR(hardcode_direct, $1)=yes
7655           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7656         fi
7657         # Workaround some broken pre-1.5 toolchains
7658         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7659         ;;
7660
7661       *nto* | *qnx*)
7662         _LT_TAGVAR(ld_shlibs, $1)=yes
7663         ;;
7664
7665       openbsd2*)
7666         # C++ shared libraries are fairly broken
7667         _LT_TAGVAR(ld_shlibs, $1)=no
7668         ;;
7669
7670       openbsd*)
7671         if test -f /usr/libexec/ld.so; then
7672           _LT_TAGVAR(hardcode_direct, $1)=yes
7673           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7674           _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7675           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7676           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7677           if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7678             _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'
7679             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7680             _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7681           fi
7682           output_verbose_link_cmd=func_echo_all
7683         else
7684           _LT_TAGVAR(ld_shlibs, $1)=no
7685         fi
7686         ;;
7687
7688       osf3* | osf4* | osf5*)
7689         case $cc_basename in
7690           KCC*)
7691             # Kuck and Associates, Inc. (KAI) C++ Compiler
7692
7693             # KCC will only create a shared library if the output file
7694             # ends with ".so" (or ".sl" for HP-UX), so rename the library
7695             # to its proper name (with version) after linking.
7696             _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'
7697
7698             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7699             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7700
7701             # Archives containing C++ object files must be created using
7702             # the KAI C++ compiler.
7703             case $host in
7704               osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7705               *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7706             esac
7707             ;;
7708           RCC*)
7709             # Rational C++ 2.4.1
7710             # FIXME: insert proper C++ library support
7711             _LT_TAGVAR(ld_shlibs, $1)=no
7712             ;;
7713           cxx*)
7714             case $host in
7715               osf3*)
7716                 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7717                 _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'
7718                 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7719                 ;;
7720               *)
7721                 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7722                 _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'
7723                 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7724                   echo "-hidden">> $lib.exp~
7725                   $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~
7726                   $RM $lib.exp'
7727                 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7728                 ;;
7729             esac
7730
7731             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7732
7733             # Commands to make compiler produce verbose output that lists
7734             # what "hidden" libraries, object files and flags are used when
7735             # linking a shared library.
7736             #
7737             # There doesn't appear to be a way to prevent this compiler from
7738             # explicitly linking system object files so we need to strip them
7739             # from the output so that they don't get included in the library
7740             # dependencies.
7741             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"'
7742             ;;
7743           *)
7744             if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7745               _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7746               case $host in
7747                 osf3*)
7748                   _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'
7749                   ;;
7750                 *)
7751                   _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'
7752                   ;;
7753               esac
7754
7755               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7756               _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7757
7758               # Commands to make compiler produce verbose output that lists
7759               # what "hidden" libraries, object files and flags are used when
7760               # linking a shared library.
7761               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7762
7763             else
7764               # FIXME: insert proper C++ library support
7765               _LT_TAGVAR(ld_shlibs, $1)=no
7766             fi
7767             ;;
7768         esac
7769         ;;
7770
7771       psos*)
7772         # FIXME: insert proper C++ library support
7773         _LT_TAGVAR(ld_shlibs, $1)=no
7774         ;;
7775
7776       sunos4*)
7777         case $cc_basename in
7778           CC*)
7779             # Sun C++ 4.x
7780             # FIXME: insert proper C++ library support
7781             _LT_TAGVAR(ld_shlibs, $1)=no
7782             ;;
7783           lcc*)
7784             # Lucid
7785             # FIXME: insert proper C++ library support
7786             _LT_TAGVAR(ld_shlibs, $1)=no
7787             ;;
7788           *)
7789             # FIXME: insert proper C++ library support
7790             _LT_TAGVAR(ld_shlibs, $1)=no
7791             ;;
7792         esac
7793         ;;
7794
7795       solaris*)
7796         case $cc_basename in
7797           CC* | sunCC*)
7798             # Sun C++ 4.2, 5.x and Centerline C++
7799             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7800             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7801             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7802             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7803               $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'
7804
7805             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7806             _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7807             case $host_os in
7808               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7809               *)
7810                 # The compiler driver will combine and reorder linker options,
7811                 # but understands `-z linker_flag'.
7812                 # Supported since Solaris 2.6 (maybe 2.5.1?)
7813                 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7814                 ;;
7815             esac
7816             _LT_TAGVAR(link_all_deplibs, $1)=yes
7817
7818             output_verbose_link_cmd='func_echo_all'
7819
7820             # Archives containing C++ object files must be created using
7821             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7822             # necessary to make sure instantiated templates are included
7823             # in the archive.
7824             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7825             ;;
7826           gcx*)
7827             # Green Hills C++ Compiler
7828             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7829
7830             # The C++ compiler must be used to create the archive.
7831             _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7832             ;;
7833           *)
7834             # GNU C++ compiler with Solaris linker
7835             if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7836               _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7837               if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7838                 _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'
7839                 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7840                   $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7841
7842                 # Commands to make compiler produce verbose output that lists
7843                 # what "hidden" libraries, object files and flags are used when
7844                 # linking a shared library.
7845                 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7846               else
7847                 # g++ 2.7 appears to require `-G' NOT `-shared' on this
7848                 # platform.
7849                 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7850                 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7851                   $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7852
7853                 # Commands to make compiler produce verbose output that lists
7854                 # what "hidden" libraries, object files and flags are used when
7855                 # linking a shared library.
7856                 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7857               fi
7858
7859               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7860               case $host_os in
7861                 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7862                 *)
7863                   _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7864                   ;;
7865               esac
7866             fi
7867             ;;
7868         esac
7869         ;;
7870
7871     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7872       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7873       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7874       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7875       runpath_var='LD_RUN_PATH'
7876
7877       case $cc_basename in
7878         CC*)
7879           _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7880           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7881           ;;
7882         *)
7883           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7884           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7885           ;;
7886       esac
7887       ;;
7888
7889       sysv5* | sco3.2v5* | sco5v6*)
7890         # Note: We can NOT use -z defs as we might desire, because we do not
7891         # link with -lc, and that would cause any symbols used from libc to
7892         # always be unresolved, which means just about no library would
7893         # ever link correctly.  If we're not using GNU ld we use -z text
7894         # though, which does catch some bad symbols but isn't as heavy-handed
7895         # as -z defs.
7896         _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7897         _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7898         _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7899         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7900         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7901         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7902         _LT_TAGVAR(link_all_deplibs, $1)=yes
7903         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7904         runpath_var='LD_RUN_PATH'
7905
7906         case $cc_basename in
7907           CC*)
7908             _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7909             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7910             _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7911               '"$_LT_TAGVAR(old_archive_cmds, $1)"
7912             _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7913               '"$_LT_TAGVAR(reload_cmds, $1)"
7914             ;;
7915           *)
7916             _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7917             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7918             ;;
7919         esac
7920       ;;
7921
7922       tandem*)
7923         case $cc_basename in
7924           NCC*)
7925             # NonStop-UX NCC 3.20
7926             # FIXME: insert proper C++ library support
7927             _LT_TAGVAR(ld_shlibs, $1)=no
7928             ;;
7929           *)
7930             # FIXME: insert proper C++ library support
7931             _LT_TAGVAR(ld_shlibs, $1)=no
7932             ;;
7933         esac
7934         ;;
7935
7936       vxworks*)
7937         # FIXME: insert proper C++ library support
7938         _LT_TAGVAR(ld_shlibs, $1)=no
7939         ;;
7940
7941       *)
7942         # FIXME: insert proper C++ library support
7943         _LT_TAGVAR(ld_shlibs, $1)=no
7944         ;;
7945     esac
7946
7947     AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7948     test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7949
7950     _LT_TAGVAR(GCC, $1)="$GXX"
7951     _LT_TAGVAR(LD, $1)="$LD"
7952
7953     ## CAVEAT EMPTOR:
7954     ## There is no encapsulation within the following macros, do not change
7955     ## the running order or otherwise move them around unless you know exactly
7956     ## what you are doing...
7957     _LT_SYS_HIDDEN_LIBDEPS($1)
7958     _LT_COMPILER_PIC($1)
7959     _LT_COMPILER_C_O($1)
7960     _LT_COMPILER_FILE_LOCKS($1)
7961     _LT_LINKER_SHLIBS($1)
7962     _LT_SYS_DYNAMIC_LINKER($1)
7963     _LT_LINKER_HARDCODE_LIBPATH($1)
7964
7965     _LT_CONFIG($1)
7966   fi # test -n "$compiler"
7967
7968   CC=$lt_save_CC
7969   CFLAGS=$lt_save_CFLAGS
7970   LDCXX=$LD
7971   LD=$lt_save_LD
7972   GCC=$lt_save_GCC
7973   with_gnu_ld=$lt_save_with_gnu_ld
7974   lt_cv_path_LDCXX=$lt_cv_path_LD
7975   lt_cv_path_LD=$lt_save_path_LD
7976   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7977   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7978 fi # test "$_lt_caught_CXX_error" != yes
7979
7980 AC_LANG_POP
7981 ])# _LT_LANG_CXX_CONFIG
7982
7983
7984 # _LT_FUNC_STRIPNAME_CNF
7985 # ----------------------
7986 # func_stripname_cnf prefix suffix name
7987 # strip PREFIX and SUFFIX off of NAME.
7988 # PREFIX and SUFFIX must not contain globbing or regex special
7989 # characters, hashes, percent signs, but SUFFIX may contain a leading
7990 # dot (in which case that matches only a dot).
7991 #
7992 # This function is identical to the (non-XSI) version of func_stripname,
7993 # except this one can be used by m4 code that may be executed by configure,
7994 # rather than the libtool script.
7995 m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7996 AC_REQUIRE([_LT_DECL_SED])
7997 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7998 func_stripname_cnf ()
7999 {
8000   case ${2} in
8001   .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
8002   *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
8003   esac
8004 } # func_stripname_cnf
8005 ])# _LT_FUNC_STRIPNAME_CNF
8006
8007 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
8008 # ---------------------------------
8009 # Figure out "hidden" library dependencies from verbose
8010 # compiler output when linking a shared library.
8011 # Parse the compiler output and extract the necessary
8012 # objects, libraries and library flags.
8013 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
8014 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
8015 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
8016 # Dependencies to place before and after the object being linked:
8017 _LT_TAGVAR(predep_objects, $1)=
8018 _LT_TAGVAR(postdep_objects, $1)=
8019 _LT_TAGVAR(predeps, $1)=
8020 _LT_TAGVAR(postdeps, $1)=
8021 _LT_TAGVAR(compiler_lib_search_path, $1)=
8022
8023 dnl we can't use the lt_simple_compile_test_code here,
8024 dnl because it contains code intended for an executable,
8025 dnl not a library.  It's possible we should let each
8026 dnl tag define a new lt_????_link_test_code variable,
8027 dnl but it's only used here...
8028 m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
8029 int a;
8030 void foo (void) { a = 0; }
8031 _LT_EOF
8032 ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
8033 class Foo
8034 {
8035 public:
8036   Foo (void) { a = 0; }
8037 private:
8038   int a;
8039 };
8040 _LT_EOF
8041 ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
8042       subroutine foo
8043       implicit none
8044       integer*4 a
8045       a=0
8046       return
8047       end
8048 _LT_EOF
8049 ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
8050       subroutine foo
8051       implicit none
8052       integer a
8053       a=0
8054       return
8055       end
8056 _LT_EOF
8057 ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
8058 public class foo {
8059   private int a;
8060   public void bar (void) {
8061     a = 0;
8062   }
8063 };
8064 _LT_EOF
8065 ])
8066
8067 _lt_libdeps_save_CFLAGS=$CFLAGS
8068 case "$CC $CFLAGS " in #(
8069 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
8070 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
8071 esac
8072
8073 dnl Parse the compiler output and extract the necessary
8074 dnl objects, libraries and library flags.
8075 if AC_TRY_EVAL(ac_compile); then
8076   # Parse the compiler output and extract the necessary
8077   # objects, libraries and library flags.
8078
8079   # Sentinel used to keep track of whether or not we are before
8080   # the conftest object file.
8081   pre_test_object_deps_done=no
8082
8083   for p in `eval "$output_verbose_link_cmd"`; do
8084     case ${prev}${p} in
8085
8086     -L* | -R* | -l*)
8087        # Some compilers place space between "-{L,R}" and the path.
8088        # Remove the space.
8089        if test $p = "-L" ||
8090           test $p = "-R"; then
8091          prev=$p
8092          continue
8093        fi
8094
8095        # Expand the sysroot to ease extracting the directories later.
8096        if test -z "$prev"; then
8097          case $p in
8098          -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
8099          -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
8100          -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
8101          esac
8102        fi
8103        case $p in
8104        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8105        esac
8106        if test "$pre_test_object_deps_done" = no; then
8107          case ${prev} in
8108          -L | -R)
8109            # Internal compiler library paths should come after those
8110            # provided the user.  The postdeps already come after the
8111            # user supplied libs so there is no need to process them.
8112            if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8113              _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8114            else
8115              _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8116            fi
8117            ;;
8118          # The "-l" case would never come before the object being
8119          # linked, so don't bother handling this case.
8120          esac
8121        else
8122          if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8123            _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8124          else
8125            _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8126          fi
8127        fi
8128        prev=
8129        ;;
8130
8131     *.lto.$objext) ;; # Ignore GCC LTO objects
8132     *.$objext)
8133        # This assumes that the test object file only shows up
8134        # once in the compiler output.
8135        if test "$p" = "conftest.$objext"; then
8136          pre_test_object_deps_done=yes
8137          continue
8138        fi
8139
8140        if test "$pre_test_object_deps_done" = no; then
8141          if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8142            _LT_TAGVAR(predep_objects, $1)="$p"
8143          else
8144            _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8145          fi
8146        else
8147          if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8148            _LT_TAGVAR(postdep_objects, $1)="$p"
8149          else
8150            _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8151          fi
8152        fi
8153        ;;
8154
8155     *) ;; # Ignore the rest.
8156
8157     esac
8158   done
8159
8160   # Clean up.
8161   rm -f a.out a.exe
8162 else
8163   echo "libtool.m4: error: problem compiling $1 test program"
8164 fi
8165
8166 $RM -f confest.$objext
8167 CFLAGS=$_lt_libdeps_save_CFLAGS
8168
8169 # PORTME: override above test on systems where it is broken
8170 m4_if([$1], [CXX],
8171 [case $host_os in
8172 interix[[3-9]]*)
8173   # Interix 3.5 installs completely hosed .la files for C++, so rather than
8174   # hack all around it, let's just trust "g++" to DTRT.
8175   _LT_TAGVAR(predep_objects,$1)=
8176   _LT_TAGVAR(postdep_objects,$1)=
8177   _LT_TAGVAR(postdeps,$1)=
8178   ;;
8179
8180 linux*)
8181   case `$CC -V 2>&1 | sed 5q` in
8182   *Sun\ C*)
8183     # Sun C++ 5.9
8184
8185     # The more standards-conforming stlport4 library is
8186     # incompatible with the Cstd library. Avoid specifying
8187     # it if it's in CXXFLAGS. Ignore libCrun as
8188     # -library=stlport4 depends on it.
8189     case " $CXX $CXXFLAGS " in
8190     *" -library=stlport4 "*)
8191       solaris_use_stlport4=yes
8192       ;;
8193     esac
8194
8195     if test "$solaris_use_stlport4" != yes; then
8196       _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8197     fi
8198     ;;
8199   esac
8200   ;;
8201
8202 solaris*)
8203   case $cc_basename in
8204   CC* | sunCC*)
8205     # The more standards-conforming stlport4 library is
8206     # incompatible with the Cstd library. Avoid specifying
8207     # it if it's in CXXFLAGS. Ignore libCrun as
8208     # -library=stlport4 depends on it.
8209     case " $CXX $CXXFLAGS " in
8210     *" -library=stlport4 "*)
8211       solaris_use_stlport4=yes
8212       ;;
8213     esac
8214
8215     # Adding this requires a known-good setup of shared libraries for
8216     # Sun compiler versions before 5.6, else PIC objects from an old
8217     # archive will be linked into the output, leading to subtle bugs.
8218     if test "$solaris_use_stlport4" != yes; then
8219       _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8220     fi
8221     ;;
8222   esac
8223   ;;
8224 esac
8225 ])
8226
8227 case " $_LT_TAGVAR(postdeps, $1) " in
8228 *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8229 esac
8230  _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8231 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8232  _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8233 fi
8234 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8235     [The directories searched by this compiler when creating a shared library])
8236 _LT_TAGDECL([], [predep_objects], [1],
8237     [Dependencies to place before and after the objects being linked to
8238     create a shared library])
8239 _LT_TAGDECL([], [postdep_objects], [1])
8240 _LT_TAGDECL([], [predeps], [1])
8241 _LT_TAGDECL([], [postdeps], [1])
8242 _LT_TAGDECL([], [compiler_lib_search_path], [1],
8243     [The library search path used internally by the compiler when linking
8244     a shared library])
8245 ])# _LT_SYS_HIDDEN_LIBDEPS
8246
8247
8248 # _LT_LANG_F77_CONFIG([TAG])
8249 # --------------------------
8250 # Ensure that the configuration variables for a Fortran 77 compiler are
8251 # suitably defined.  These variables are subsequently used by _LT_CONFIG
8252 # to write the compiler configuration to `libtool'.
8253 m4_defun([_LT_LANG_F77_CONFIG],
8254 [AC_LANG_PUSH(Fortran 77)
8255 if test -z "$F77" || test "X$F77" = "Xno"; then
8256   _lt_disable_F77=yes
8257 fi
8258
8259 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8260 _LT_TAGVAR(allow_undefined_flag, $1)=
8261 _LT_TAGVAR(always_export_symbols, $1)=no
8262 _LT_TAGVAR(archive_expsym_cmds, $1)=
8263 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8264 _LT_TAGVAR(hardcode_direct, $1)=no
8265 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8266 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8267 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8268 _LT_TAGVAR(hardcode_libdir_separator, $1)=
8269 _LT_TAGVAR(hardcode_minus_L, $1)=no
8270 _LT_TAGVAR(hardcode_automatic, $1)=no
8271 _LT_TAGVAR(inherit_rpath, $1)=no
8272 _LT_TAGVAR(module_cmds, $1)=
8273 _LT_TAGVAR(module_expsym_cmds, $1)=
8274 _LT_TAGVAR(link_all_deplibs, $1)=unknown
8275 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8276 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8277 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8278 _LT_TAGVAR(no_undefined_flag, $1)=
8279 _LT_TAGVAR(whole_archive_flag_spec, $1)=
8280 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8281
8282 # Source file extension for f77 test sources.
8283 ac_ext=f
8284
8285 # Object file extension for compiled f77 test sources.
8286 objext=o
8287 _LT_TAGVAR(objext, $1)=$objext
8288
8289 # No sense in running all these tests if we already determined that
8290 # the F77 compiler isn't working.  Some variables (like enable_shared)
8291 # are currently assumed to apply to all compilers on this platform,
8292 # and will be corrupted by setting them based on a non-working compiler.
8293 if test "$_lt_disable_F77" != yes; then
8294   # Code to be used in simple compile tests
8295   lt_simple_compile_test_code="\
8296       subroutine t
8297       return
8298       end
8299 "
8300
8301   # Code to be used in simple link tests
8302   lt_simple_link_test_code="\
8303       program t
8304       end
8305 "
8306
8307   # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8308   _LT_TAG_COMPILER
8309
8310   # save warnings/boilerplate of simple test code
8311   _LT_COMPILER_BOILERPLATE
8312   _LT_LINKER_BOILERPLATE
8313
8314   # Allow CC to be a program name with arguments.
8315   lt_save_CC="$CC"
8316   lt_save_GCC=$GCC
8317   lt_save_CFLAGS=$CFLAGS
8318   CC=${F77-"f77"}
8319   CFLAGS=$FFLAGS
8320   compiler=$CC
8321   _LT_TAGVAR(compiler, $1)=$CC
8322   _LT_CC_BASENAME([$compiler])
8323   GCC=$G77
8324   if test -n "$compiler"; then
8325     AC_MSG_CHECKING([if libtool supports shared libraries])
8326     AC_MSG_RESULT([$can_build_shared])
8327
8328     AC_MSG_CHECKING([whether to build shared libraries])
8329     test "$can_build_shared" = "no" && enable_shared=no
8330
8331     # On AIX, shared libraries and static libraries use the same namespace, and
8332     # are all built from PIC.
8333     case $host_os in
8334       aix3*)
8335         test "$enable_shared" = yes && enable_static=no
8336         if test -n "$RANLIB"; then
8337           archive_cmds="$archive_cmds~\$RANLIB \$lib"
8338           postinstall_cmds='$RANLIB $lib'
8339         fi
8340         ;;
8341       aix[[4-9]]*)
8342         if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8343           test "$enable_shared" = yes && enable_static=no
8344         fi
8345         ;;
8346     esac
8347     AC_MSG_RESULT([$enable_shared])
8348
8349     AC_MSG_CHECKING([whether to build static libraries])
8350     # Make sure either enable_shared or enable_static is yes.
8351     test "$enable_shared" = yes || enable_static=yes
8352     AC_MSG_RESULT([$enable_static])
8353
8354     _LT_TAGVAR(GCC, $1)="$G77"
8355     _LT_TAGVAR(LD, $1)="$LD"
8356
8357     ## CAVEAT EMPTOR:
8358     ## There is no encapsulation within the following macros, do not change
8359     ## the running order or otherwise move them around unless you know exactly
8360     ## what you are doing...
8361     _LT_COMPILER_PIC($1)
8362     _LT_COMPILER_C_O($1)
8363     _LT_COMPILER_FILE_LOCKS($1)
8364     _LT_LINKER_SHLIBS($1)
8365     _LT_SYS_DYNAMIC_LINKER($1)
8366     _LT_LINKER_HARDCODE_LIBPATH($1)
8367
8368     _LT_CONFIG($1)
8369   fi # test -n "$compiler"
8370
8371   GCC=$lt_save_GCC
8372   CC="$lt_save_CC"
8373   CFLAGS="$lt_save_CFLAGS"
8374 fi # test "$_lt_disable_F77" != yes
8375
8376 AC_LANG_POP
8377 ])# _LT_LANG_F77_CONFIG
8378
8379
8380 # _LT_LANG_FC_CONFIG([TAG])
8381 # -------------------------
8382 # Ensure that the configuration variables for a Fortran compiler are
8383 # suitably defined.  These variables are subsequently used by _LT_CONFIG
8384 # to write the compiler configuration to `libtool'.
8385 m4_defun([_LT_LANG_FC_CONFIG],
8386 [AC_LANG_PUSH(Fortran)
8387
8388 if test -z "$FC" || test "X$FC" = "Xno"; then
8389   _lt_disable_FC=yes
8390 fi
8391
8392 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8393 _LT_TAGVAR(allow_undefined_flag, $1)=
8394 _LT_TAGVAR(always_export_symbols, $1)=no
8395 _LT_TAGVAR(archive_expsym_cmds, $1)=
8396 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
8397 _LT_TAGVAR(hardcode_direct, $1)=no
8398 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
8399 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8400 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8401 _LT_TAGVAR(hardcode_libdir_separator, $1)=
8402 _LT_TAGVAR(hardcode_minus_L, $1)=no
8403 _LT_TAGVAR(hardcode_automatic, $1)=no
8404 _LT_TAGVAR(inherit_rpath, $1)=no
8405 _LT_TAGVAR(module_cmds, $1)=
8406 _LT_TAGVAR(module_expsym_cmds, $1)=
8407 _LT_TAGVAR(link_all_deplibs, $1)=unknown
8408 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8409 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8410 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8411 _LT_TAGVAR(no_undefined_flag, $1)=
8412 _LT_TAGVAR(whole_archive_flag_spec, $1)=
8413 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8414
8415 # Source file extension for fc test sources.
8416 ac_ext=${ac_fc_srcext-f}
8417
8418 # Object file extension for compiled fc test sources.
8419 objext=o
8420 _LT_TAGVAR(objext, $1)=$objext
8421
8422 # No sense in running all these tests if we already determined that
8423 # the FC compiler isn't working.  Some variables (like enable_shared)
8424 # are currently assumed to apply to all compilers on this platform,
8425 # and will be corrupted by setting them based on a non-working compiler.
8426 if test "$_lt_disable_FC" != yes; then
8427   # Code to be used in simple compile tests
8428   lt_simple_compile_test_code="\
8429       subroutine t
8430       return
8431       end
8432 "
8433
8434   # Code to be used in simple link tests
8435   lt_simple_link_test_code="\
8436       program t
8437       end
8438 "
8439
8440   # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8441   _LT_TAG_COMPILER
8442
8443   # save warnings/boilerplate of simple test code
8444   _LT_COMPILER_BOILERPLATE
8445   _LT_LINKER_BOILERPLATE
8446
8447   # Allow CC to be a program name with arguments.
8448   lt_save_CC="$CC"
8449   lt_save_GCC=$GCC
8450   lt_save_CFLAGS=$CFLAGS
8451   CC=${FC-"f95"}
8452   CFLAGS=$FCFLAGS
8453   compiler=$CC
8454   GCC=$ac_cv_fc_compiler_gnu
8455
8456   _LT_TAGVAR(compiler, $1)=$CC
8457   _LT_CC_BASENAME([$compiler])
8458
8459   if test -n "$compiler"; then
8460     AC_MSG_CHECKING([if libtool supports shared libraries])
8461     AC_MSG_RESULT([$can_build_shared])
8462
8463     AC_MSG_CHECKING([whether to build shared libraries])
8464     test "$can_build_shared" = "no" && enable_shared=no
8465
8466     # On AIX, shared libraries and static libraries use the same namespace, and
8467     # are all built from PIC.
8468     case $host_os in
8469       aix3*)
8470         test "$enable_shared" = yes && enable_static=no
8471         if test -n "$RANLIB"; then
8472           archive_cmds="$archive_cmds~\$RANLIB \$lib"
8473           postinstall_cmds='$RANLIB $lib'
8474         fi
8475         ;;
8476       aix[[4-9]]*)
8477         if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8478           test "$enable_shared" = yes && enable_static=no
8479         fi
8480         ;;
8481     esac
8482     AC_MSG_RESULT([$enable_shared])
8483
8484     AC_MSG_CHECKING([whether to build static libraries])
8485     # Make sure either enable_shared or enable_static is yes.
8486     test "$enable_shared" = yes || enable_static=yes
8487     AC_MSG_RESULT([$enable_static])
8488
8489     _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8490     _LT_TAGVAR(LD, $1)="$LD"
8491
8492     ## CAVEAT EMPTOR:
8493     ## There is no encapsulation within the following macros, do not change
8494     ## the running order or otherwise move them around unless you know exactly
8495     ## what you are doing...
8496     _LT_SYS_HIDDEN_LIBDEPS($1)
8497     _LT_COMPILER_PIC($1)
8498     _LT_COMPILER_C_O($1)
8499     _LT_COMPILER_FILE_LOCKS($1)
8500     _LT_LINKER_SHLIBS($1)
8501     _LT_SYS_DYNAMIC_LINKER($1)
8502     _LT_LINKER_HARDCODE_LIBPATH($1)
8503
8504     _LT_CONFIG($1)
8505   fi # test -n "$compiler"
8506
8507   GCC=$lt_save_GCC
8508   CC=$lt_save_CC
8509   CFLAGS=$lt_save_CFLAGS
8510 fi # test "$_lt_disable_FC" != yes
8511
8512 AC_LANG_POP
8513 ])# _LT_LANG_FC_CONFIG
8514
8515
8516 # _LT_LANG_GCJ_CONFIG([TAG])
8517 # --------------------------
8518 # Ensure that the configuration variables for the GNU Java Compiler compiler
8519 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
8520 # to write the compiler configuration to `libtool'.
8521 m4_defun([_LT_LANG_GCJ_CONFIG],
8522 [AC_REQUIRE([LT_PROG_GCJ])dnl
8523 AC_LANG_SAVE
8524
8525 # Source file extension for Java test sources.
8526 ac_ext=java
8527
8528 # Object file extension for compiled Java test sources.
8529 objext=o
8530 _LT_TAGVAR(objext, $1)=$objext
8531
8532 # Code to be used in simple compile tests
8533 lt_simple_compile_test_code="class foo {}"
8534
8535 # Code to be used in simple link tests
8536 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8537
8538 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8539 _LT_TAG_COMPILER
8540
8541 # save warnings/boilerplate of simple test code
8542 _LT_COMPILER_BOILERPLATE
8543 _LT_LINKER_BOILERPLATE
8544
8545 # Allow CC to be a program name with arguments.
8546 lt_save_CC=$CC
8547 lt_save_CFLAGS=$CFLAGS
8548 lt_save_GCC=$GCC
8549 GCC=yes
8550 CC=${GCJ-"gcj"}
8551 CFLAGS=$GCJFLAGS
8552 compiler=$CC
8553 _LT_TAGVAR(compiler, $1)=$CC
8554 _LT_TAGVAR(LD, $1)="$LD"
8555 _LT_CC_BASENAME([$compiler])
8556
8557 # GCJ did not exist at the time GCC didn't implicitly link libc in.
8558 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8559
8560 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8561 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8562 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8563
8564 if test -n "$compiler"; then
8565   _LT_COMPILER_NO_RTTI($1)
8566   _LT_COMPILER_PIC($1)
8567   _LT_COMPILER_C_O($1)
8568   _LT_COMPILER_FILE_LOCKS($1)
8569   _LT_LINKER_SHLIBS($1)
8570   _LT_LINKER_HARDCODE_LIBPATH($1)
8571
8572   _LT_CONFIG($1)
8573 fi
8574
8575 AC_LANG_RESTORE
8576
8577 GCC=$lt_save_GCC
8578 CC=$lt_save_CC
8579 CFLAGS=$lt_save_CFLAGS
8580 ])# _LT_LANG_GCJ_CONFIG
8581
8582
8583 # _LT_LANG_RC_CONFIG([TAG])
8584 # -------------------------
8585 # Ensure that the configuration variables for the Windows resource compiler
8586 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
8587 # to write the compiler configuration to `libtool'.
8588 m4_defun([_LT_LANG_RC_CONFIG],
8589 [AC_REQUIRE([LT_PROG_RC])dnl
8590 AC_LANG_SAVE
8591
8592 # Source file extension for RC test sources.
8593 ac_ext=rc
8594
8595 # Object file extension for compiled RC test sources.
8596 objext=o
8597 _LT_TAGVAR(objext, $1)=$objext
8598
8599 # Code to be used in simple compile tests
8600 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8601
8602 # Code to be used in simple link tests
8603 lt_simple_link_test_code="$lt_simple_compile_test_code"
8604
8605 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8606 _LT_TAG_COMPILER
8607
8608 # save warnings/boilerplate of simple test code
8609 _LT_COMPILER_BOILERPLATE
8610 _LT_LINKER_BOILERPLATE
8611
8612 # Allow CC to be a program name with arguments.
8613 lt_save_CC="$CC"
8614 lt_save_CFLAGS=$CFLAGS
8615 lt_save_GCC=$GCC
8616 GCC=
8617 CC=${RC-"windres"}
8618 CFLAGS=
8619 compiler=$CC
8620 _LT_TAGVAR(compiler, $1)=$CC
8621 _LT_CC_BASENAME([$compiler])
8622 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8623
8624 if test -n "$compiler"; then
8625   :
8626   _LT_CONFIG($1)
8627 fi
8628
8629 GCC=$lt_save_GCC
8630 AC_LANG_RESTORE
8631 CC=$lt_save_CC
8632 CFLAGS=$lt_save_CFLAGS
8633 ])# _LT_LANG_RC_CONFIG
8634
8635
8636 # LT_PROG_GCJ
8637 # -----------
8638 AC_DEFUN([LT_PROG_GCJ],
8639 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8640   [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8641     [AC_CHECK_TOOL(GCJ, gcj,)
8642       test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8643       AC_SUBST(GCJFLAGS)])])[]dnl
8644 ])
8645
8646 # Old name:
8647 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8648 dnl aclocal-1.4 backwards compatibility:
8649 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8650
8651
8652 # LT_PROG_RC
8653 # ----------
8654 AC_DEFUN([LT_PROG_RC],
8655 [AC_CHECK_TOOL(RC, windres,)
8656 ])
8657
8658 # Old name:
8659 AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8660 dnl aclocal-1.4 backwards compatibility:
8661 dnl AC_DEFUN([LT_AC_PROG_RC], [])
8662
8663
8664 # _LT_DECL_EGREP
8665 # --------------
8666 # If we don't have a new enough Autoconf to choose the best grep
8667 # available, choose the one first in the user's PATH.
8668 m4_defun([_LT_DECL_EGREP],
8669 [AC_REQUIRE([AC_PROG_EGREP])dnl
8670 AC_REQUIRE([AC_PROG_FGREP])dnl
8671 test -z "$GREP" && GREP=grep
8672 _LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8673 _LT_DECL([], [EGREP], [1], [An ERE matcher])
8674 _LT_DECL([], [FGREP], [1], [A literal string matcher])
8675 dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8676 AC_SUBST([GREP])
8677 ])
8678
8679
8680 # _LT_DECL_OBJDUMP
8681 # --------------
8682 # If we don't have a new enough Autoconf to choose the best objdump
8683 # available, choose the one first in the user's PATH.
8684 m4_defun([_LT_DECL_OBJDUMP],
8685 [AC_CHECK_TOOL(OBJDUMP, objdump, false)
8686 test -z "$OBJDUMP" && OBJDUMP=objdump
8687 _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8688 AC_SUBST([OBJDUMP])
8689 ])
8690
8691 # _LT_DECL_DLLTOOL
8692 # ----------------
8693 # Ensure DLLTOOL variable is set.
8694 m4_defun([_LT_DECL_DLLTOOL],
8695 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8696 test -z "$DLLTOOL" && DLLTOOL=dlltool
8697 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8698 AC_SUBST([DLLTOOL])
8699 ])
8700
8701 # _LT_DECL_SED
8702 # ------------
8703 # Check for a fully-functional sed program, that truncates
8704 # as few characters as possible.  Prefer GNU sed if found.
8705 m4_defun([_LT_DECL_SED],
8706 [AC_PROG_SED
8707 test -z "$SED" && SED=sed
8708 Xsed="$SED -e 1s/^X//"
8709 _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8710 _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8711     [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8712 ])# _LT_DECL_SED
8713
8714 m4_ifndef([AC_PROG_SED], [
8715 # NOTE: This macro has been submitted for inclusion into   #
8716 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8717 #  a released version of Autoconf we should remove this    #
8718 #  macro and use it instead.                               #
8719
8720 m4_defun([AC_PROG_SED],
8721 [AC_MSG_CHECKING([for a sed that does not truncate output])
8722 AC_CACHE_VAL(lt_cv_path_SED,
8723 [# Loop through the user's path and test for sed and gsed.
8724 # Then use that list of sed's as ones to test for truncation.
8725 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8726 for as_dir in $PATH
8727 do
8728   IFS=$as_save_IFS
8729   test -z "$as_dir" && as_dir=.
8730   for lt_ac_prog in sed gsed; do
8731     for ac_exec_ext in '' $ac_executable_extensions; do
8732       if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8733         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8734       fi
8735     done
8736   done
8737 done
8738 IFS=$as_save_IFS
8739 lt_ac_max=0
8740 lt_ac_count=0
8741 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
8742 # along with /bin/sed that truncates output.
8743 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8744   test ! -f $lt_ac_sed && continue
8745   cat /dev/null > conftest.in
8746   lt_ac_count=0
8747   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8748   # Check for GNU sed and select it if it is found.
8749   if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8750     lt_cv_path_SED=$lt_ac_sed
8751     break
8752   fi
8753   while true; do
8754     cat conftest.in conftest.in >conftest.tmp
8755     mv conftest.tmp conftest.in
8756     cp conftest.in conftest.nl
8757     echo >>conftest.nl
8758     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8759     cmp -s conftest.out conftest.nl || break
8760     # 10000 chars as input seems more than enough
8761     test $lt_ac_count -gt 10 && break
8762     lt_ac_count=`expr $lt_ac_count + 1`
8763     if test $lt_ac_count -gt $lt_ac_max; then
8764       lt_ac_max=$lt_ac_count
8765       lt_cv_path_SED=$lt_ac_sed
8766     fi
8767   done
8768 done
8769 ])
8770 SED=$lt_cv_path_SED
8771 AC_SUBST([SED])
8772 AC_MSG_RESULT([$SED])
8773 ])#AC_PROG_SED
8774 ])#m4_ifndef
8775
8776 # Old name:
8777 AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8778 dnl aclocal-1.4 backwards compatibility:
8779 dnl AC_DEFUN([LT_AC_PROG_SED], [])
8780
8781
8782 # _LT_CHECK_SHELL_FEATURES
8783 # ------------------------
8784 # Find out whether the shell is Bourne or XSI compatible,
8785 # or has some other useful features.
8786 m4_defun([_LT_CHECK_SHELL_FEATURES],
8787 [AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8788 # Try some XSI features
8789 xsi_shell=no
8790 ( _lt_dummy="a/b/c"
8791   test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8792       = c,a/b,b/c, \
8793     && eval 'test $(( 1 + 1 )) -eq 2 \
8794     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8795   && xsi_shell=yes
8796 AC_MSG_RESULT([$xsi_shell])
8797 _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8798
8799 AC_MSG_CHECKING([whether the shell understands "+="])
8800 lt_shell_append=no
8801 ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8802     >/dev/null 2>&1 \
8803   && lt_shell_append=yes
8804 AC_MSG_RESULT([$lt_shell_append])
8805 _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8806
8807 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8808   lt_unset=unset
8809 else
8810   lt_unset=false
8811 fi
8812 _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8813
8814 # test EBCDIC or ASCII
8815 case `echo X|tr X '\101'` in
8816  A) # ASCII based system
8817     # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8818   lt_SP2NL='tr \040 \012'
8819   lt_NL2SP='tr \015\012 \040\040'
8820   ;;
8821  *) # EBCDIC based system
8822   lt_SP2NL='tr \100 \n'
8823   lt_NL2SP='tr \r\n \100\100'
8824   ;;
8825 esac
8826 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8827 _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8828 ])# _LT_CHECK_SHELL_FEATURES
8829
8830
8831 # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8832 # ------------------------------------------------------
8833 # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8834 # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8835 m4_defun([_LT_PROG_FUNCTION_REPLACE],
8836 [dnl {
8837 sed -e '/^$1 ()$/,/^} # $1 /c\
8838 $1 ()\
8839 {\
8840 m4_bpatsubsts([$2], [$], [\\], [^\([     ]\)], [\\\1])
8841 } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8842   && mv -f "$cfgfile.tmp" "$cfgfile" \
8843     || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8844 test 0 -eq $? || _lt_function_replace_fail=:
8845 ])
8846
8847
8848 # _LT_PROG_REPLACE_SHELLFNS
8849 # -------------------------
8850 # Replace existing portable implementations of several shell functions with
8851 # equivalent extended shell implementations where those features are available..
8852 m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8853 [if test x"$xsi_shell" = xyes; then
8854   _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8855     case ${1} in
8856       */*) func_dirname_result="${1%/*}${2}" ;;
8857       *  ) func_dirname_result="${3}" ;;
8858     esac])
8859
8860   _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8861     func_basename_result="${1##*/}"])
8862
8863   _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8864     case ${1} in
8865       */*) func_dirname_result="${1%/*}${2}" ;;
8866       *  ) func_dirname_result="${3}" ;;
8867     esac
8868     func_basename_result="${1##*/}"])
8869
8870   _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8871     # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8872     # positional parameters, so assign one to ordinary parameter first.
8873     func_stripname_result=${3}
8874     func_stripname_result=${func_stripname_result#"${1}"}
8875     func_stripname_result=${func_stripname_result%"${2}"}])
8876
8877   _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8878     func_split_long_opt_name=${1%%=*}
8879     func_split_long_opt_arg=${1#*=}])
8880
8881   _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8882     func_split_short_opt_arg=${1#??}
8883     func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8884
8885   _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8886     case ${1} in
8887       *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8888       *)    func_lo2o_result=${1} ;;
8889     esac])
8890
8891   _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8892
8893   _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8894
8895   _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8896 fi
8897
8898 if test x"$lt_shell_append" = xyes; then
8899   _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8900
8901   _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8902     func_quote_for_eval "${2}"
8903 dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8904     eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8905
8906   # Save a `func_append' function call where possible by direct use of '+='
8907   sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8908     && mv -f "$cfgfile.tmp" "$cfgfile" \
8909       || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8910   test 0 -eq $? || _lt_function_replace_fail=:
8911 else
8912   # Save a `func_append' function call even when '+=' is not available
8913   sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8914     && mv -f "$cfgfile.tmp" "$cfgfile" \
8915       || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8916   test 0 -eq $? || _lt_function_replace_fail=:
8917 fi
8918
8919 if test x"$_lt_function_replace_fail" = x":"; then
8920   AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8921 fi
8922 ])
8923
8924 # _LT_PATH_CONVERSION_FUNCTIONS
8925 # -----------------------------
8926 # Determine which file name conversion functions should be used by
8927 # func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8928 # for certain cross-compile configurations and native mingw.
8929 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8930 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
8931 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8932 AC_MSG_CHECKING([how to convert $build file names to $host format])
8933 AC_CACHE_VAL(lt_cv_to_host_file_cmd,
8934 [case $host in
8935   *-*-mingw* )
8936     case $build in
8937       *-*-mingw* ) # actually msys
8938         lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8939         ;;
8940       *-*-cygwin* )
8941         lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8942         ;;
8943       * ) # otherwise, assume *nix
8944         lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8945         ;;
8946     esac
8947     ;;
8948   *-*-cygwin* )
8949     case $build in
8950       *-*-mingw* ) # actually msys
8951         lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8952         ;;
8953       *-*-cygwin* )
8954         lt_cv_to_host_file_cmd=func_convert_file_noop
8955         ;;
8956       * ) # otherwise, assume *nix
8957         lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8958         ;;
8959     esac
8960     ;;
8961   * ) # unhandled hosts (and "normal" native builds)
8962     lt_cv_to_host_file_cmd=func_convert_file_noop
8963     ;;
8964 esac
8965 ])
8966 to_host_file_cmd=$lt_cv_to_host_file_cmd
8967 AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8968 _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8969          [0], [convert $build file names to $host format])dnl
8970
8971 AC_MSG_CHECKING([how to convert $build file names to toolchain format])
8972 AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8973 [#assume ordinary cross tools, or native build.
8974 lt_cv_to_tool_file_cmd=func_convert_file_noop
8975 case $host in
8976   *-*-mingw* )
8977     case $build in
8978       *-*-mingw* ) # actually msys
8979         lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8980         ;;
8981     esac
8982     ;;
8983 esac
8984 ])
8985 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
8986 AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8987 _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8988          [0], [convert $build files to toolchain format])dnl
8989 ])# _LT_PATH_CONVERSION_FUNCTIONS
8990
8991 # Helper functions for option handling.                    -*- Autoconf -*-
8992 #
8993 #   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
8994 #   Inc.
8995 #   Written by Gary V. Vaughan, 2004
8996 #
8997 # This file is free software; the Free Software Foundation gives
8998 # unlimited permission to copy and/or distribute it, with or without
8999 # modifications, as long as this notice is preserved.
9000
9001 # serial 7 ltoptions.m4
9002
9003 # This is to help aclocal find these macros, as it can't see m4_define.
9004 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9005
9006
9007 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9008 # ------------------------------------------
9009 m4_define([_LT_MANGLE_OPTION],
9010 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9011
9012
9013 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9014 # ---------------------------------------
9015 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9016 # matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9017 # saved as a flag.
9018 m4_define([_LT_SET_OPTION],
9019 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9020 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9021         _LT_MANGLE_DEFUN([$1], [$2]),
9022     [m4_warning([Unknown $1 option `$2'])])[]dnl
9023 ])
9024
9025
9026 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9027 # ------------------------------------------------------------
9028 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9029 m4_define([_LT_IF_OPTION],
9030 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9031
9032
9033 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9034 # -------------------------------------------------------
9035 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9036 # are set.
9037 m4_define([_LT_UNLESS_OPTIONS],
9038 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9039             [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9040                       [m4_define([$0_found])])])[]dnl
9041 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9042 ])[]dnl
9043 ])
9044
9045
9046 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9047 # ----------------------------------------
9048 # OPTION-LIST is a space-separated list of Libtool options associated
9049 # with MACRO-NAME.  If any OPTION has a matching handler declared with
9050 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9051 # the unknown option and exit.
9052 m4_defun([_LT_SET_OPTIONS],
9053 [# Set options
9054 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9055     [_LT_SET_OPTION([$1], _LT_Option)])
9056
9057 m4_if([$1],[LT_INIT],[
9058   dnl
9059   dnl Simply set some default values (i.e off) if boolean options were not
9060   dnl specified:
9061   _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9062   ])
9063   _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9064   ])
9065   dnl
9066   dnl If no reference was made to various pairs of opposing options, then
9067   dnl we run the default mode handler for the pair.  For example, if neither
9068   dnl `shared' nor `disable-shared' was passed, we enable building of shared
9069   dnl archives by default:
9070   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9071   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9072   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9073   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9074                    [_LT_ENABLE_FAST_INSTALL])
9075   ])
9076 ])# _LT_SET_OPTIONS
9077
9078
9079
9080 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9081 # -----------------------------------------
9082 m4_define([_LT_MANGLE_DEFUN],
9083 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9084
9085
9086 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9087 # -----------------------------------------------
9088 m4_define([LT_OPTION_DEFINE],
9089 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9090 ])# LT_OPTION_DEFINE
9091
9092
9093 # dlopen
9094 # ------
9095 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9096 ])
9097
9098 AU_DEFUN([AC_LIBTOOL_DLOPEN],
9099 [_LT_SET_OPTION([LT_INIT], [dlopen])
9100 AC_DIAGNOSE([obsolete],
9101 [$0: Remove this warning and the call to _LT_SET_OPTION when you
9102 put the `dlopen' option into LT_INIT's first parameter.])
9103 ])
9104
9105 dnl aclocal-1.4 backwards compatibility:
9106 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9107
9108
9109 # win32-dll
9110 # ---------
9111 # Declare package support for building win32 dll's.
9112 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9113 [enable_win32_dll=yes
9114
9115 case $host in
9116 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9117   AC_CHECK_TOOL(AS, as, false)
9118   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9119   AC_CHECK_TOOL(OBJDUMP, objdump, false)
9120   ;;
9121 esac
9122
9123 test -z "$AS" && AS=as
9124 _LT_DECL([], [AS],      [1], [Assembler program])dnl
9125
9126 test -z "$DLLTOOL" && DLLTOOL=dlltool
9127 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9128
9129 test -z "$OBJDUMP" && OBJDUMP=objdump
9130 _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9131 ])# win32-dll
9132
9133 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9134 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
9135 _LT_SET_OPTION([LT_INIT], [win32-dll])
9136 AC_DIAGNOSE([obsolete],
9137 [$0: Remove this warning and the call to _LT_SET_OPTION when you
9138 put the `win32-dll' option into LT_INIT's first parameter.])
9139 ])
9140
9141 dnl aclocal-1.4 backwards compatibility:
9142 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9143
9144
9145 # _LT_ENABLE_SHARED([DEFAULT])
9146 # ----------------------------
9147 # implement the --enable-shared flag, and supports the `shared' and
9148 # `disable-shared' LT_INIT options.
9149 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9150 m4_define([_LT_ENABLE_SHARED],
9151 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9152 AC_ARG_ENABLE([shared],
9153     [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9154         [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9155     [p=${PACKAGE-default}
9156     case $enableval in
9157     yes) enable_shared=yes ;;
9158     no) enable_shared=no ;;
9159     *)
9160       enable_shared=no
9161       # Look at the argument we got.  We use all the common list separators.
9162       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9163       for pkg in $enableval; do
9164         IFS="$lt_save_ifs"
9165         if test "X$pkg" = "X$p"; then
9166           enable_shared=yes
9167         fi
9168       done
9169       IFS="$lt_save_ifs"
9170       ;;
9171     esac],
9172     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9173
9174     _LT_DECL([build_libtool_libs], [enable_shared], [0],
9175         [Whether or not to build shared libraries])
9176 ])# _LT_ENABLE_SHARED
9177
9178 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9179 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9180
9181 # Old names:
9182 AC_DEFUN([AC_ENABLE_SHARED],
9183 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9184 ])
9185
9186 AC_DEFUN([AC_DISABLE_SHARED],
9187 [_LT_SET_OPTION([LT_INIT], [disable-shared])
9188 ])
9189
9190 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9191 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9192
9193 dnl aclocal-1.4 backwards compatibility:
9194 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9195 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9196
9197
9198
9199 # _LT_ENABLE_STATIC([DEFAULT])
9200 # ----------------------------
9201 # implement the --enable-static flag, and support the `static' and
9202 # `disable-static' LT_INIT options.
9203 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9204 m4_define([_LT_ENABLE_STATIC],
9205 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9206 AC_ARG_ENABLE([static],
9207     [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9208         [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9209     [p=${PACKAGE-default}
9210     case $enableval in
9211     yes) enable_static=yes ;;
9212     no) enable_static=no ;;
9213     *)
9214      enable_static=no
9215       # Look at the argument we got.  We use all the common list separators.
9216       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9217       for pkg in $enableval; do
9218         IFS="$lt_save_ifs"
9219         if test "X$pkg" = "X$p"; then
9220           enable_static=yes
9221         fi
9222       done
9223       IFS="$lt_save_ifs"
9224       ;;
9225     esac],
9226     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9227
9228     _LT_DECL([build_old_libs], [enable_static], [0],
9229         [Whether or not to build static libraries])
9230 ])# _LT_ENABLE_STATIC
9231
9232 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9233 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9234
9235 # Old names:
9236 AC_DEFUN([AC_ENABLE_STATIC],
9237 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9238 ])
9239
9240 AC_DEFUN([AC_DISABLE_STATIC],
9241 [_LT_SET_OPTION([LT_INIT], [disable-static])
9242 ])
9243
9244 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9245 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9246
9247 dnl aclocal-1.4 backwards compatibility:
9248 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9249 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9250
9251
9252
9253 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
9254 # ----------------------------------
9255 # implement the --enable-fast-install flag, and support the `fast-install'
9256 # and `disable-fast-install' LT_INIT options.
9257 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9258 m4_define([_LT_ENABLE_FAST_INSTALL],
9259 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9260 AC_ARG_ENABLE([fast-install],
9261     [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9262     [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9263     [p=${PACKAGE-default}
9264     case $enableval in
9265     yes) enable_fast_install=yes ;;
9266     no) enable_fast_install=no ;;
9267     *)
9268       enable_fast_install=no
9269       # Look at the argument we got.  We use all the common list separators.
9270       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9271       for pkg in $enableval; do
9272         IFS="$lt_save_ifs"
9273         if test "X$pkg" = "X$p"; then
9274           enable_fast_install=yes
9275         fi
9276       done
9277       IFS="$lt_save_ifs"
9278       ;;
9279     esac],
9280     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9281
9282 _LT_DECL([fast_install], [enable_fast_install], [0],
9283          [Whether or not to optimize for fast installation])dnl
9284 ])# _LT_ENABLE_FAST_INSTALL
9285
9286 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9287 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9288
9289 # Old names:
9290 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9291 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9292 AC_DIAGNOSE([obsolete],
9293 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
9294 the `fast-install' option into LT_INIT's first parameter.])
9295 ])
9296
9297 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9298 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9299 AC_DIAGNOSE([obsolete],
9300 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
9301 the `disable-fast-install' option into LT_INIT's first parameter.])
9302 ])
9303
9304 dnl aclocal-1.4 backwards compatibility:
9305 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9306 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9307
9308
9309 # _LT_WITH_PIC([MODE])
9310 # --------------------
9311 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
9312 # LT_INIT options.
9313 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9314 m4_define([_LT_WITH_PIC],
9315 [AC_ARG_WITH([pic],
9316     [AS_HELP_STRING([--with-pic],
9317         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9318     [pic_mode="$withval"],
9319     [pic_mode=default])
9320
9321 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9322
9323 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9324 ])# _LT_WITH_PIC
9325
9326 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9327 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9328
9329 # Old name:
9330 AU_DEFUN([AC_LIBTOOL_PICMODE],
9331 [_LT_SET_OPTION([LT_INIT], [pic-only])
9332 AC_DIAGNOSE([obsolete],
9333 [$0: Remove this warning and the call to _LT_SET_OPTION when you
9334 put the `pic-only' option into LT_INIT's first parameter.])
9335 ])
9336
9337 dnl aclocal-1.4 backwards compatibility:
9338 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9339
9340
9341 m4_define([_LTDL_MODE], [])
9342 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9343                  [m4_define([_LTDL_MODE], [nonrecursive])])
9344 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9345                  [m4_define([_LTDL_MODE], [recursive])])
9346 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9347                  [m4_define([_LTDL_MODE], [subproject])])
9348
9349 m4_define([_LTDL_TYPE], [])
9350 LT_OPTION_DEFINE([LTDL_INIT], [installable],
9351                  [m4_define([_LTDL_TYPE], [installable])])
9352 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9353                  [m4_define([_LTDL_TYPE], [convenience])])
9354
9355 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9356 #
9357 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9358 # Written by Gary V. Vaughan, 2004
9359 #
9360 # This file is free software; the Free Software Foundation gives
9361 # unlimited permission to copy and/or distribute it, with or without
9362 # modifications, as long as this notice is preserved.
9363
9364 # serial 6 ltsugar.m4
9365
9366 # This is to help aclocal find these macros, as it can't see m4_define.
9367 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9368
9369
9370 # lt_join(SEP, ARG1, [ARG2...])
9371 # -----------------------------
9372 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9373 # associated separator.
9374 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9375 # versions in m4sugar had bugs.
9376 m4_define([lt_join],
9377 [m4_if([$#], [1], [],
9378        [$#], [2], [[$2]],
9379        [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9380 m4_define([_lt_join],
9381 [m4_if([$#$2], [2], [],
9382        [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9383
9384
9385 # lt_car(LIST)
9386 # lt_cdr(LIST)
9387 # ------------
9388 # Manipulate m4 lists.
9389 # These macros are necessary as long as will still need to support
9390 # Autoconf-2.59 which quotes differently.
9391 m4_define([lt_car], [[$1]])
9392 m4_define([lt_cdr],
9393 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9394        [$#], 1, [],
9395        [m4_dquote(m4_shift($@))])])
9396 m4_define([lt_unquote], $1)
9397
9398
9399 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
9400 # ------------------------------------------
9401 # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9402 # Note that neither SEPARATOR nor STRING are expanded; they are appended
9403 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9404 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
9405 # than defined and empty).
9406 #
9407 # This macro is needed until we can rely on Autoconf 2.62, since earlier
9408 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9409 m4_define([lt_append],
9410 [m4_define([$1],
9411            m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9412
9413
9414
9415 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9416 # ----------------------------------------------------------
9417 # Produce a SEP delimited list of all paired combinations of elements of
9418 # PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9419 # has the form PREFIXmINFIXSUFFIXn.
9420 # Needed until we can rely on m4_combine added in Autoconf 2.62.
9421 m4_define([lt_combine],
9422 [m4_if(m4_eval([$# > 3]), [1],
9423        [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9424 [[m4_foreach([_Lt_prefix], [$2],
9425              [m4_foreach([_Lt_suffix],
9426                 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9427         [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9428
9429
9430 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9431 # -----------------------------------------------------------------------
9432 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9433 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9434 m4_define([lt_if_append_uniq],
9435 [m4_ifdef([$1],
9436           [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9437                  [lt_append([$1], [$2], [$3])$4],
9438                  [$5])],
9439           [lt_append([$1], [$2], [$3])$4])])
9440
9441
9442 # lt_dict_add(DICT, KEY, VALUE)
9443 # -----------------------------
9444 m4_define([lt_dict_add],
9445 [m4_define([$1($2)], [$3])])
9446
9447
9448 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9449 # --------------------------------------------
9450 m4_define([lt_dict_add_subkey],
9451 [m4_define([$1($2:$3)], [$4])])
9452
9453
9454 # lt_dict_fetch(DICT, KEY, [SUBKEY])
9455 # ----------------------------------
9456 m4_define([lt_dict_fetch],
9457 [m4_ifval([$3],
9458         m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9459     m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9460
9461
9462 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9463 # -----------------------------------------------------------------
9464 m4_define([lt_if_dict_fetch],
9465 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9466         [$5],
9467     [$6])])
9468
9469
9470 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9471 # --------------------------------------------------------------
9472 m4_define([lt_dict_filter],
9473 [m4_if([$5], [], [],
9474   [lt_join(m4_quote(m4_default([$4], [[, ]])),
9475            lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9476                       [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9477 ])
9478
9479 # ltversion.m4 -- version numbers                       -*- Autoconf -*-
9480 #
9481 #   Copyright (C) 2004 Free Software Foundation, Inc.
9482 #   Written by Scott James Remnant, 2004
9483 #
9484 # This file is free software; the Free Software Foundation gives
9485 # unlimited permission to copy and/or distribute it, with or without
9486 # modifications, as long as this notice is preserved.
9487
9488 # @configure_input@
9489
9490 # serial 3293 ltversion.m4
9491 # This file is part of GNU Libtool
9492
9493 m4_define([LT_PACKAGE_VERSION], [2.4])
9494 m4_define([LT_PACKAGE_REVISION], [1.3293])
9495
9496 AC_DEFUN([LTVERSION_VERSION],
9497 [macro_version='2.4'
9498 macro_revision='1.3293'
9499 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9500 _LT_DECL(, macro_revision, 0)
9501 ])
9502
9503 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9504 #
9505 #   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9506 #   Written by Scott James Remnant, 2004.
9507 #
9508 # This file is free software; the Free Software Foundation gives
9509 # unlimited permission to copy and/or distribute it, with or without
9510 # modifications, as long as this notice is preserved.
9511
9512 # serial 5 lt~obsolete.m4
9513
9514 # These exist entirely to fool aclocal when bootstrapping libtool.
9515 #
9516 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9517 # which have later been changed to m4_define as they aren't part of the
9518 # exported API, or moved to Autoconf or Automake where they belong.
9519 #
9520 # The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9521 # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9522 # using a macro with the same name in our local m4/libtool.m4 it'll
9523 # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9524 # and doesn't know about Autoconf macros at all.)
9525 #
9526 # So we provide this file, which has a silly filename so it's always
9527 # included after everything else.  This provides aclocal with the
9528 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9529 # because those macros already exist, or will be overwritten later.
9530 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9531 #
9532 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9533 # Yes, that means every name once taken will need to remain here until
9534 # we give up compatibility with versions before 1.7, at which point
9535 # we need to keep only those names which we still refer to.
9536
9537 # This is to help aclocal find these macros, as it can't see m4_define.
9538 AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9539
9540 m4_ifndef([AC_LIBTOOL_LINKER_OPTION],   [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9541 m4_ifndef([AC_PROG_EGREP],              [AC_DEFUN([AC_PROG_EGREP])])
9542 m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9543 m4_ifndef([_LT_AC_SHELL_INIT],          [AC_DEFUN([_LT_AC_SHELL_INIT])])
9544 m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],     [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9545 m4_ifndef([_LT_PROG_LTMAIN],            [AC_DEFUN([_LT_PROG_LTMAIN])])
9546 m4_ifndef([_LT_AC_TAGVAR],              [AC_DEFUN([_LT_AC_TAGVAR])])
9547 m4_ifndef([AC_LTDL_ENABLE_INSTALL],     [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9548 m4_ifndef([AC_LTDL_PREOPEN],            [AC_DEFUN([AC_LTDL_PREOPEN])])
9549 m4_ifndef([_LT_AC_SYS_COMPILER],        [AC_DEFUN([_LT_AC_SYS_COMPILER])])
9550 m4_ifndef([_LT_AC_LOCK],                [AC_DEFUN([_LT_AC_LOCK])])
9551 m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9552 m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],     [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9553 m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],     [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9554 m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9555 m4_ifndef([AC_LIBTOOL_OBJDIR],          [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9556 m4_ifndef([AC_LTDL_OBJDIR],             [AC_DEFUN([AC_LTDL_OBJDIR])])
9557 m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9558 m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],   [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9559 m4_ifndef([AC_PATH_MAGIC],              [AC_DEFUN([AC_PATH_MAGIC])])
9560 m4_ifndef([AC_PROG_LD_GNU],             [AC_DEFUN([AC_PROG_LD_GNU])])
9561 m4_ifndef([AC_PROG_LD_RELOAD_FLAG],     [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9562 m4_ifndef([AC_DEPLIBS_CHECK_METHOD],    [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9563 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9564 m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9565 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9566 m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],  [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9567 m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],  [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9568 m4_ifndef([LT_AC_PROG_EGREP],           [AC_DEFUN([LT_AC_PROG_EGREP])])
9569 m4_ifndef([LT_AC_PROG_SED],             [AC_DEFUN([LT_AC_PROG_SED])])
9570 m4_ifndef([_LT_CC_BASENAME],            [AC_DEFUN([_LT_CC_BASENAME])])
9571 m4_ifndef([_LT_COMPILER_BOILERPLATE],   [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9572 m4_ifndef([_LT_LINKER_BOILERPLATE],     [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9573 m4_ifndef([_AC_PROG_LIBTOOL],           [AC_DEFUN([_AC_PROG_LIBTOOL])])
9574 m4_ifndef([AC_LIBTOOL_SETUP],           [AC_DEFUN([AC_LIBTOOL_SETUP])])
9575 m4_ifndef([_LT_AC_CHECK_DLFCN],         [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9576 m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],      [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9577 m4_ifndef([_LT_AC_TAGCONFIG],           [AC_DEFUN([_LT_AC_TAGCONFIG])])
9578 m4_ifndef([AC_DISABLE_FAST_INSTALL],    [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9579 m4_ifndef([_LT_AC_LANG_CXX],            [AC_DEFUN([_LT_AC_LANG_CXX])])
9580 m4_ifndef([_LT_AC_LANG_F77],            [AC_DEFUN([_LT_AC_LANG_F77])])
9581 m4_ifndef([_LT_AC_LANG_GCJ],            [AC_DEFUN([_LT_AC_LANG_GCJ])])
9582 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],   [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9583 m4_ifndef([_LT_AC_LANG_C_CONFIG],       [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9584 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9585 m4_ifndef([_LT_AC_LANG_CXX_CONFIG],     [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9586 m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9587 m4_ifndef([_LT_AC_LANG_F77_CONFIG],     [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9588 m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9589 m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],     [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9590 m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9591 m4_ifndef([_LT_AC_LANG_RC_CONFIG],      [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9592 m4_ifndef([AC_LIBTOOL_CONFIG],          [AC_DEFUN([AC_LIBTOOL_CONFIG])])
9593 m4_ifndef([_LT_AC_FILE_LTDLL_C],        [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9594 m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9595 m4_ifndef([_LT_AC_PROG_CXXCPP],         [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9596 m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9597 m4_ifndef([_LT_PROG_ECHO_BACKSLASH],    [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9598 m4_ifndef([_LT_PROG_F77],               [AC_DEFUN([_LT_PROG_F77])])
9599 m4_ifndef([_LT_PROG_FC],                [AC_DEFUN([_LT_PROG_FC])])
9600 m4_ifndef([_LT_PROG_CXX],               [AC_DEFUN([_LT_PROG_CXX])])
9601
9602 dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9603 dnl
9604 dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9605 dnl 
9606 dnl Permission is hereby granted, free of charge, to any person obtaining a
9607 dnl copy of this software and associated documentation files (the "Software"),
9608 dnl to deal in the Software without restriction, including without limitation
9609 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9610 dnl and/or sell copies of the Software, and to permit persons to whom the
9611 dnl Software is furnished to do so, subject to the following conditions:
9612 dnl
9613 dnl The above copyright notice and this permission notice (including the next
9614 dnl paragraph) shall be included in all copies or substantial portions of the
9615 dnl Software.
9616 dnl
9617 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9618 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9619 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9620 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9621 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9622 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9623 dnl DEALINGS IN THE SOFTWARE.
9624
9625 # XORG_MACROS_VERSION(required-version)
9626 # -------------------------------------
9627 # Minimum version: 1.1.0
9628 #
9629 # If you're using a macro added in Version 1.1 or newer, include this in
9630 # your configure.ac with the minimum required version, such as:
9631 # XORG_MACROS_VERSION(1.1)
9632 #
9633 # To ensure that this macro is defined, also add:
9634 # m4_ifndef([XORG_MACROS_VERSION],
9635 #     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9636 #
9637 #
9638 # See the "minimum version" comment for each macro you use to see what 
9639 # version you require.
9640 m4_defun([XORG_MACROS_VERSION],[
9641 m4_define([vers_have], [1.16.2])
9642 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9643 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9644 m4_if(m4_cmp(maj_have, maj_needed), 0,,
9645     [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9646 m4_if(m4_version_compare(vers_have, [$1]), -1,
9647     [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9648 m4_undefine([vers_have])
9649 m4_undefine([maj_have])
9650 m4_undefine([maj_needed])
9651 ]) # XORG_MACROS_VERSION
9652
9653 # XORG_PROG_RAWCPP()
9654 # ------------------
9655 # Minimum version: 1.0.0
9656 #
9657 # Find cpp program and necessary flags for use in pre-processing text files
9658 # such as man pages and config files
9659 AC_DEFUN([XORG_PROG_RAWCPP],[
9660 AC_REQUIRE([AC_PROG_CPP])
9661 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9662    [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9663
9664 # Check for flag to avoid builtin definitions - assumes unix is predefined,
9665 # which is not the best choice for supporting other OS'es, but covers most
9666 # of the ones we need for now.
9667 AC_MSG_CHECKING([if $RAWCPP requires -undef])
9668 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9669 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9670         AC_MSG_RESULT([no])
9671 else
9672         if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9673                 RAWCPPFLAGS=-undef
9674                 AC_MSG_RESULT([yes])
9675         # under Cygwin unix is still defined even with -undef
9676         elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9677                 RAWCPPFLAGS="-undef -ansi"
9678                 AC_MSG_RESULT([yes, with -ansi])
9679         else
9680                 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9681         fi
9682 fi
9683 rm -f conftest.$ac_ext
9684
9685 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9686 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9687 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9688         AC_MSG_RESULT([no])
9689 else
9690         if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9691                 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9692                 AC_MSG_RESULT([yes])
9693         else
9694                 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9695         fi
9696 fi
9697 rm -f conftest.$ac_ext
9698 AC_SUBST(RAWCPPFLAGS)
9699 ]) # XORG_PROG_RAWCPP
9700
9701 # XORG_MANPAGE_SECTIONS()
9702 # -----------------------
9703 # Minimum version: 1.0.0
9704 #
9705 # Determine which sections man pages go in for the different man page types
9706 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9707 # Not sure if there's any better way than just hardcoding by OS name.
9708 # Override default settings by setting environment variables
9709 # Added MAN_SUBSTS in version 1.8
9710 # Added AC_PROG_SED in version 1.8
9711
9712 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
9713 AC_REQUIRE([AC_CANONICAL_HOST])
9714 AC_REQUIRE([AC_PROG_SED])
9715
9716 if test x$APP_MAN_SUFFIX = x    ; then
9717     APP_MAN_SUFFIX=1
9718 fi
9719 if test x$APP_MAN_DIR = x    ; then
9720     APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9721 fi
9722
9723 if test x$LIB_MAN_SUFFIX = x    ; then
9724     LIB_MAN_SUFFIX=3
9725 fi
9726 if test x$LIB_MAN_DIR = x    ; then
9727     LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9728 fi
9729
9730 if test x$FILE_MAN_SUFFIX = x    ; then
9731     case $host_os in
9732         solaris*)       FILE_MAN_SUFFIX=4  ;;
9733         *)              FILE_MAN_SUFFIX=5  ;;
9734     esac
9735 fi
9736 if test x$FILE_MAN_DIR = x    ; then
9737     FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9738 fi
9739
9740 if test x$MISC_MAN_SUFFIX = x    ; then
9741     case $host_os in
9742         solaris*)       MISC_MAN_SUFFIX=5  ;;
9743         *)              MISC_MAN_SUFFIX=7  ;;
9744     esac
9745 fi
9746 if test x$MISC_MAN_DIR = x    ; then
9747     MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9748 fi
9749
9750 if test x$DRIVER_MAN_SUFFIX = x    ; then
9751     case $host_os in
9752         solaris*)       DRIVER_MAN_SUFFIX=7  ;;
9753         *)              DRIVER_MAN_SUFFIX=4  ;;
9754     esac
9755 fi
9756 if test x$DRIVER_MAN_DIR = x    ; then
9757     DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9758 fi
9759
9760 if test x$ADMIN_MAN_SUFFIX = x    ; then
9761     case $host_os in
9762         solaris*)       ADMIN_MAN_SUFFIX=1m ;;
9763         *)              ADMIN_MAN_SUFFIX=8  ;;
9764     esac
9765 fi
9766 if test x$ADMIN_MAN_DIR = x    ; then
9767     ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9768 fi
9769
9770
9771 AC_SUBST([APP_MAN_SUFFIX])
9772 AC_SUBST([LIB_MAN_SUFFIX])
9773 AC_SUBST([FILE_MAN_SUFFIX])
9774 AC_SUBST([MISC_MAN_SUFFIX])
9775 AC_SUBST([DRIVER_MAN_SUFFIX])
9776 AC_SUBST([ADMIN_MAN_SUFFIX])
9777 AC_SUBST([APP_MAN_DIR])
9778 AC_SUBST([LIB_MAN_DIR])
9779 AC_SUBST([FILE_MAN_DIR])
9780 AC_SUBST([MISC_MAN_DIR])
9781 AC_SUBST([DRIVER_MAN_DIR])
9782 AC_SUBST([ADMIN_MAN_DIR])
9783
9784 XORG_MAN_PAGE="X Version 11"
9785 AC_SUBST([XORG_MAN_PAGE])
9786 MAN_SUBSTS="\
9787         -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9788         -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9789         -e 's|__xservername__|Xorg|g' \
9790         -e 's|__xconfigfile__|xorg.conf|g' \
9791         -e 's|__projectroot__|\$(prefix)|g' \
9792         -e 's|__apploaddir__|\$(appdefaultdir)|g' \
9793         -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9794         -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9795         -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9796         -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9797         -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9798         -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9799 AC_SUBST([MAN_SUBSTS])
9800
9801 ]) # XORG_MANPAGE_SECTIONS
9802
9803 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9804 # ------------------------
9805 # Minimum version: 1.7.0
9806 #
9807 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9808 # provided by xorg-sgml-doctools, if installed.
9809 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9810 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9811 XORG_SGML_PATH=
9812 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9813     [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9814     [m4_ifval([$1],[:],
9815         [if test x"$cross_compiling" != x"yes" ; then
9816             AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9817                           [XORG_SGML_PATH=$prefix/share/sgml])
9818          fi])
9819     ])
9820
9821 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9822 # the path and the name of the doc stylesheet
9823 if test "x$XORG_SGML_PATH" != "x" ; then
9824    AC_MSG_RESULT([$XORG_SGML_PATH])
9825    STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9826    XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9827 else
9828    AC_MSG_RESULT([no])
9829 fi
9830
9831 AC_SUBST(XORG_SGML_PATH)
9832 AC_SUBST(STYLESHEET_SRCDIR)
9833 AC_SUBST(XSL_STYLESHEET)
9834 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9835 ]) # XORG_CHECK_SGML_DOCTOOLS
9836
9837 # XORG_CHECK_LINUXDOC
9838 # -------------------
9839 # Minimum version: 1.0.0
9840 #
9841 # Defines the variable MAKE_TEXT if the necessary tools and
9842 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9843 # Whether or not the necessary tools and files are found can be checked
9844 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
9845 AC_DEFUN([XORG_CHECK_LINUXDOC],[
9846 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9847 AC_REQUIRE([XORG_WITH_PS2PDF])
9848
9849 AC_PATH_PROG(LINUXDOC, linuxdoc)
9850
9851 AC_MSG_CHECKING([whether to build documentation])
9852
9853 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9854    BUILDDOC=yes
9855 else
9856    BUILDDOC=no
9857 fi
9858
9859 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9860
9861 AC_MSG_RESULT([$BUILDDOC])
9862
9863 AC_MSG_CHECKING([whether to build pdf documentation])
9864
9865 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9866    BUILDPDFDOC=yes
9867 else
9868    BUILDPDFDOC=no
9869 fi
9870
9871 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9872
9873 AC_MSG_RESULT([$BUILDPDFDOC])
9874
9875 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9876 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9877 MAKE_PDF="$PS2PDF"
9878 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9879
9880 AC_SUBST(MAKE_TEXT)
9881 AC_SUBST(MAKE_PS)
9882 AC_SUBST(MAKE_PDF)
9883 AC_SUBST(MAKE_HTML)
9884 ]) # XORG_CHECK_LINUXDOC
9885
9886 # XORG_CHECK_DOCBOOK
9887 # -------------------
9888 # Minimum version: 1.0.0
9889 #
9890 # Checks for the ability to build output formats from SGML DocBook source.
9891 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9892 # indicates whether the necessary tools and files are found and, if set,
9893 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
9894 AC_DEFUN([XORG_CHECK_DOCBOOK],[
9895 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9896
9897 BUILDTXTDOC=no
9898 BUILDPDFDOC=no
9899 BUILDPSDOC=no
9900 BUILDHTMLDOC=no
9901
9902 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
9903 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9904 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
9905 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9906
9907 AC_MSG_CHECKING([whether to build text documentation])
9908 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9909    test x$BUILD_TXTDOC != xno; then
9910         BUILDTXTDOC=yes
9911 fi
9912 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9913 AC_MSG_RESULT([$BUILDTXTDOC])
9914
9915 AC_MSG_CHECKING([whether to build PDF documentation])
9916 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9917    test x$BUILD_PDFDOC != xno; then
9918         BUILDPDFDOC=yes
9919 fi
9920 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9921 AC_MSG_RESULT([$BUILDPDFDOC])
9922
9923 AC_MSG_CHECKING([whether to build PostScript documentation])
9924 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9925    test x$BUILD_PSDOC != xno; then
9926         BUILDPSDOC=yes
9927 fi
9928 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9929 AC_MSG_RESULT([$BUILDPSDOC])
9930
9931 AC_MSG_CHECKING([whether to build HTML documentation])
9932 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9933    test x$BUILD_HTMLDOC != xno; then
9934         BUILDHTMLDOC=yes
9935 fi
9936 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9937 AC_MSG_RESULT([$BUILDHTMLDOC])
9938
9939 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9940 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9941 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9942 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9943
9944 AC_SUBST(MAKE_TEXT)
9945 AC_SUBST(MAKE_PS)
9946 AC_SUBST(MAKE_PDF)
9947 AC_SUBST(MAKE_HTML)
9948 ]) # XORG_CHECK_DOCBOOK
9949
9950 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9951 # ----------------
9952 # Minimum version: 1.5.0
9953 # Minimum version for optional DEFAULT argument: 1.11.0
9954 #
9955 # Documentation tools are not always available on all platforms and sometimes
9956 # not at the appropriate level. This macro enables a module to test for the
9957 # presence of the tool and obtain it's path in separate variables. Coupled with
9958 # the --with-xmlto option, it allows maximum flexibilty in making decisions
9959 # as whether or not to use the xmlto package. When DEFAULT is not specified,
9960 # --with-xmlto assumes 'auto'.
9961 #
9962 # Interface to module:
9963 # HAVE_XMLTO:   used in makefiles to conditionally generate documentation
9964 # XMLTO:        returns the path of the xmlto program found
9965 #               returns the path set by the user in the environment
9966 # --with-xmlto: 'yes' user instructs the module to use xmlto
9967 #               'no' user instructs the module not to use xmlto
9968 #
9969 # Added in version 1.10.0
9970 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9971 #                  xmlto for text output requires either lynx, links, or w3m browsers
9972 #
9973 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9974 #
9975 AC_DEFUN([XORG_WITH_XMLTO],[
9976 AC_ARG_VAR([XMLTO], [Path to xmlto command])
9977 m4_define([_defopt], m4_default([$2], [auto]))
9978 AC_ARG_WITH(xmlto,
9979         AS_HELP_STRING([--with-xmlto],
9980            [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9981            [use_xmlto=$withval], [use_xmlto=]_defopt)
9982 m4_undefine([_defopt])
9983
9984 if test "x$use_xmlto" = x"auto"; then
9985    AC_PATH_PROG([XMLTO], [xmlto])
9986    if test "x$XMLTO" = "x"; then
9987         AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9988         have_xmlto=no
9989    else
9990         have_xmlto=yes
9991    fi
9992 elif test "x$use_xmlto" = x"yes" ; then
9993    AC_PATH_PROG([XMLTO], [xmlto])
9994    if test "x$XMLTO" = "x"; then
9995         AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9996    fi
9997    have_xmlto=yes
9998 elif test "x$use_xmlto" = x"no" ; then
9999    if test "x$XMLTO" != "x"; then
10000       AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10001    fi
10002    have_xmlto=no
10003 else
10004    AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10005 fi
10006
10007 # Test for a minimum version of xmlto, if provided.
10008 m4_ifval([$1],
10009 [if test "$have_xmlto" = yes; then
10010     # scrape the xmlto version
10011     AC_MSG_CHECKING([the xmlto version])
10012     xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10013     AC_MSG_RESULT([$xmlto_version])
10014     AS_VERSION_COMPARE([$xmlto_version], [$1],
10015         [if test "x$use_xmlto" = xauto; then
10016             AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10017             have_xmlto=no
10018         else
10019             AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10020         fi])
10021 fi])
10022
10023 # Test for the ability of xmlto to generate a text target
10024 have_xmlto_text=no
10025 cat > conftest.xml << "EOF"
10026 EOF
10027 AS_IF([test "$have_xmlto" = yes],
10028       [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10029              [have_xmlto_text=yes],
10030              [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10031 rm -f conftest.xml
10032 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10033 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10034 ]) # XORG_WITH_XMLTO
10035
10036 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10037 # --------------------------------------------
10038 # Minimum version: 1.12.0
10039 # Minimum version for optional DEFAULT argument: 1.12.0
10040 #
10041 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10042 # XML-based language used for the transformation of XML documents.
10043 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10044 # It is used under the cover by xmlto to generate html files from DocBook/XML.
10045 # The XSLT processor is often used as a standalone tool for transformations.
10046 # It should not be assumed that this tool is used only to work with documnetation.
10047 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10048 #
10049 # Interface to module:
10050 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10051 # XSLTPROC:      returns the path of the xsltproc program found
10052 #                returns the path set by the user in the environment
10053 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
10054 #                 'no' user instructs the module not to use xsltproc
10055 # have_xsltproc: returns yes if xsltproc found in PATH or no
10056 #
10057 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10058 #
10059 AC_DEFUN([XORG_WITH_XSLTPROC],[
10060 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10061 # Preserves the interface, should it be implemented later
10062 m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10063 m4_define([_defopt], m4_default([$2], [auto]))
10064 AC_ARG_WITH(xsltproc,
10065         AS_HELP_STRING([--with-xsltproc],
10066            [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10067            [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10068 m4_undefine([_defopt])
10069
10070 if test "x$use_xsltproc" = x"auto"; then
10071    AC_PATH_PROG([XSLTPROC], [xsltproc])
10072    if test "x$XSLTPROC" = "x"; then
10073         AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10074         have_xsltproc=no
10075    else
10076         have_xsltproc=yes
10077    fi
10078 elif test "x$use_xsltproc" = x"yes" ; then
10079    AC_PATH_PROG([XSLTPROC], [xsltproc])
10080    if test "x$XSLTPROC" = "x"; then
10081         AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10082    fi
10083    have_xsltproc=yes
10084 elif test "x$use_xsltproc" = x"no" ; then
10085    if test "x$XSLTPROC" != "x"; then
10086       AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10087    fi
10088    have_xsltproc=no
10089 else
10090    AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10091 fi
10092
10093 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10094 ]) # XORG_WITH_XSLTPROC
10095
10096 # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10097 # ----------------------------------------
10098 # Minimum version: 1.15.0
10099 #
10100 # PERL (Practical Extraction and Report Language) is a language optimized for
10101 # scanning arbitrary text files, extracting information from those text files,
10102 # and printing reports based on that information.
10103 #
10104 # When DEFAULT is not specified, --with-perl assumes 'auto'.
10105 #
10106 # Interface to module:
10107 # HAVE_PERL: used in makefiles to conditionally scan text files
10108 # PERL:      returns the path of the perl program found
10109 #            returns the path set by the user in the environment
10110 # --with-perl: 'yes' user instructs the module to use perl
10111 #              'no' user instructs the module not to use perl
10112 # have_perl: returns yes if perl found in PATH or no
10113 #
10114 # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10115 #
10116 AC_DEFUN([XORG_WITH_PERL],[
10117 AC_ARG_VAR([PERL], [Path to perl command])
10118 # Preserves the interface, should it be implemented later
10119 m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10120 m4_define([_defopt], m4_default([$2], [auto]))
10121 AC_ARG_WITH(perl,
10122         AS_HELP_STRING([--with-perl],
10123            [Use perl for extracting information from files (default: ]_defopt[)]),
10124            [use_perl=$withval], [use_perl=]_defopt)
10125 m4_undefine([_defopt])
10126
10127 if test "x$use_perl" = x"auto"; then
10128    AC_PATH_PROG([PERL], [perl])
10129    if test "x$PERL" = "x"; then
10130         AC_MSG_WARN([perl not found - cannot extract information and report])
10131         have_perl=no
10132    else
10133         have_perl=yes
10134    fi
10135 elif test "x$use_perl" = x"yes" ; then
10136    AC_PATH_PROG([PERL], [perl])
10137    if test "x$PERL" = "x"; then
10138         AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10139    fi
10140    have_perl=yes
10141 elif test "x$use_perl" = x"no" ; then
10142    if test "x$PERL" != "x"; then
10143       AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10144    fi
10145    have_perl=no
10146 else
10147    AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10148 fi
10149
10150 AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10151 ]) # XORG_WITH_PERL
10152
10153 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10154 # ----------------
10155 # Minimum version: 1.5.0
10156 # Minimum version for optional DEFAULT argument: 1.11.0
10157 #
10158 # Documentation tools are not always available on all platforms and sometimes
10159 # not at the appropriate level. This macro enables a module to test for the
10160 # presence of the tool and obtain it's path in separate variables. Coupled with
10161 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
10162 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
10163 # --with-asciidoc assumes 'auto'.
10164 #
10165 # Interface to module:
10166 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10167 # ASCIIDOC:      returns the path of the asciidoc program found
10168 #                returns the path set by the user in the environment
10169 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
10170 #                 'no' user instructs the module not to use asciidoc
10171 #
10172 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10173 #
10174 AC_DEFUN([XORG_WITH_ASCIIDOC],[
10175 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10176 m4_define([_defopt], m4_default([$2], [auto]))
10177 AC_ARG_WITH(asciidoc,
10178         AS_HELP_STRING([--with-asciidoc],
10179            [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10180            [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10181 m4_undefine([_defopt])
10182
10183 if test "x$use_asciidoc" = x"auto"; then
10184    AC_PATH_PROG([ASCIIDOC], [asciidoc])
10185    if test "x$ASCIIDOC" = "x"; then
10186         AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10187         have_asciidoc=no
10188    else
10189         have_asciidoc=yes
10190    fi
10191 elif test "x$use_asciidoc" = x"yes" ; then
10192    AC_PATH_PROG([ASCIIDOC], [asciidoc])
10193    if test "x$ASCIIDOC" = "x"; then
10194         AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10195    fi
10196    have_asciidoc=yes
10197 elif test "x$use_asciidoc" = x"no" ; then
10198    if test "x$ASCIIDOC" != "x"; then
10199       AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10200    fi
10201    have_asciidoc=no
10202 else
10203    AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10204 fi
10205 m4_ifval([$1],
10206 [if test "$have_asciidoc" = yes; then
10207     # scrape the asciidoc version
10208     AC_MSG_CHECKING([the asciidoc version])
10209     asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10210     AC_MSG_RESULT([$asciidoc_version])
10211     AS_VERSION_COMPARE([$asciidoc_version], [$1],
10212         [if test "x$use_asciidoc" = xauto; then
10213             AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10214             have_asciidoc=no
10215         else
10216             AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10217         fi])
10218 fi])
10219 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10220 ]) # XORG_WITH_ASCIIDOC
10221
10222 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10223 # --------------------------------
10224 # Minimum version: 1.5.0
10225 # Minimum version for optional DEFAULT argument: 1.11.0
10226 #
10227 # Documentation tools are not always available on all platforms and sometimes
10228 # not at the appropriate level. This macro enables a module to test for the
10229 # presence of the tool and obtain it's path in separate variables. Coupled with
10230 # the --with-doxygen option, it allows maximum flexibilty in making decisions
10231 # as whether or not to use the doxygen package. When DEFAULT is not specified,
10232 # --with-doxygen assumes 'auto'.
10233 #
10234 # Interface to module:
10235 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10236 # DOXYGEN:       returns the path of the doxygen program found
10237 #                returns the path set by the user in the environment
10238 # --with-doxygen: 'yes' user instructs the module to use doxygen
10239 #                 'no' user instructs the module not to use doxygen
10240 #
10241 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10242 #
10243 AC_DEFUN([XORG_WITH_DOXYGEN],[
10244 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10245 m4_define([_defopt], m4_default([$2], [auto]))
10246 AC_ARG_WITH(doxygen,
10247         AS_HELP_STRING([--with-doxygen],
10248            [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10249            [use_doxygen=$withval], [use_doxygen=]_defopt)
10250 m4_undefine([_defopt])
10251
10252 if test "x$use_doxygen" = x"auto"; then
10253    AC_PATH_PROG([DOXYGEN], [doxygen])
10254    if test "x$DOXYGEN" = "x"; then
10255         AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10256         have_doxygen=no
10257    else
10258         have_doxygen=yes
10259    fi
10260 elif test "x$use_doxygen" = x"yes" ; then
10261    AC_PATH_PROG([DOXYGEN], [doxygen])
10262    if test "x$DOXYGEN" = "x"; then
10263         AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10264    fi
10265    have_doxygen=yes
10266 elif test "x$use_doxygen" = x"no" ; then
10267    if test "x$DOXYGEN" != "x"; then
10268       AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10269    fi
10270    have_doxygen=no
10271 else
10272    AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10273 fi
10274 m4_ifval([$1],
10275 [if test "$have_doxygen" = yes; then
10276     # scrape the doxygen version
10277     AC_MSG_CHECKING([the doxygen version])
10278     doxygen_version=`$DOXYGEN --version 2>/dev/null`
10279     AC_MSG_RESULT([$doxygen_version])
10280     AS_VERSION_COMPARE([$doxygen_version], [$1],
10281         [if test "x$use_doxygen" = xauto; then
10282             AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10283             have_doxygen=no
10284         else
10285             AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10286         fi])
10287 fi])
10288 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10289 ]) # XORG_WITH_DOXYGEN
10290
10291 # XORG_WITH_GROFF([DEFAULT])
10292 # ----------------
10293 # Minimum version: 1.6.0
10294 # Minimum version for optional DEFAULT argument: 1.11.0
10295 #
10296 # Documentation tools are not always available on all platforms and sometimes
10297 # not at the appropriate level. This macro enables a module to test for the
10298 # presence of the tool and obtain it's path in separate variables. Coupled with
10299 # the --with-groff option, it allows maximum flexibilty in making decisions
10300 # as whether or not to use the groff package. When DEFAULT is not specified,
10301 # --with-groff assumes 'auto'.
10302 #
10303 # Interface to module:
10304 # HAVE_GROFF:    used in makefiles to conditionally generate documentation
10305 # HAVE_GROFF_MM: the memorandum macros (-mm) package
10306 # HAVE_GROFF_MS: the -ms macros package
10307 # GROFF:         returns the path of the groff program found
10308 #                returns the path set by the user in the environment
10309 # --with-groff:  'yes' user instructs the module to use groff
10310 #                'no' user instructs the module not to use groff
10311 #
10312 # Added in version 1.9.0:
10313 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10314 #                  pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10315 #                  psselect from the psutils package.
10316 #                  the ghostcript package. Refer to the grohtml man pages
10317 #
10318 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10319 #
10320 # OS and distros often splits groff in a basic and full package, the former
10321 # having the groff program and the later having devices, fonts and macros
10322 # Checking for the groff executable is not enough.
10323 #
10324 # If macros are missing, we cannot assume that groff is useless, so we don't
10325 # unset HAVE_GROFF or GROFF env variables.
10326 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10327 #
10328 AC_DEFUN([XORG_WITH_GROFF],[
10329 AC_ARG_VAR([GROFF], [Path to groff command])
10330 m4_define([_defopt], m4_default([$1], [auto]))
10331 AC_ARG_WITH(groff,
10332         AS_HELP_STRING([--with-groff],
10333            [Use groff to regenerate documentation (default: ]_defopt[)]),
10334            [use_groff=$withval], [use_groff=]_defopt)
10335 m4_undefine([_defopt])
10336
10337 if test "x$use_groff" = x"auto"; then
10338    AC_PATH_PROG([GROFF], [groff])
10339    if test "x$GROFF" = "x"; then
10340         AC_MSG_WARN([groff not found - documentation targets will be skipped])
10341         have_groff=no
10342    else
10343         have_groff=yes
10344    fi
10345 elif test "x$use_groff" = x"yes" ; then
10346    AC_PATH_PROG([GROFF], [groff])
10347    if test "x$GROFF" = "x"; then
10348         AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10349    fi
10350    have_groff=yes
10351 elif test "x$use_groff" = x"no" ; then
10352    if test "x$GROFF" != "x"; then
10353       AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10354    fi
10355    have_groff=no
10356 else
10357    AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10358 fi
10359
10360 # We have groff, test for the presence of the macro packages
10361 if test "x$have_groff" = x"yes"; then
10362     AC_MSG_CHECKING([for ${GROFF} -ms macros])
10363     if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10364         groff_ms_works=yes
10365     else
10366         groff_ms_works=no
10367     fi
10368     AC_MSG_RESULT([$groff_ms_works])
10369     AC_MSG_CHECKING([for ${GROFF} -mm macros])
10370     if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10371         groff_mm_works=yes
10372     else
10373         groff_mm_works=no
10374     fi
10375     AC_MSG_RESULT([$groff_mm_works])
10376 fi
10377
10378 # We have groff, test for HTML dependencies, one command per package
10379 if test "x$have_groff" = x"yes"; then
10380    AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10381    AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10382    AC_PATH_PROG(PSSELECT_PATH, [psselect])
10383    if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10384       have_groff_html=yes
10385    else
10386       have_groff_html=no
10387       AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10388    fi
10389 fi
10390
10391 # Set Automake conditionals for Makefiles
10392 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10393 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10394 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10395 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10396 ]) # XORG_WITH_GROFF
10397
10398 # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10399 # ---------------------------------------
10400 # Minimum version: 1.6.0
10401 # Minimum version for optional DEFAULT argument: 1.11.0
10402 # Minimum version for optional MIN-VERSION argument: 1.15.0
10403 #
10404 # Documentation tools are not always available on all platforms and sometimes
10405 # not at the appropriate level. This macro enables a module to test for the
10406 # presence of the tool and obtain it's path in separate variables. Coupled with
10407 # the --with-fop option, it allows maximum flexibilty in making decisions
10408 # as whether or not to use the fop package. When DEFAULT is not specified,
10409 # --with-fop assumes 'auto'.
10410 #
10411 # Interface to module:
10412 # HAVE_FOP:     used in makefiles to conditionally generate documentation
10413 # FOP:          returns the path of the fop program found
10414 #               returns the path set by the user in the environment
10415 # --with-fop:   'yes' user instructs the module to use fop
10416 #               'no' user instructs the module not to use fop
10417 #
10418 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10419 #
10420 AC_DEFUN([XORG_WITH_FOP],[
10421 AC_ARG_VAR([FOP], [Path to fop command])
10422 m4_define([_defopt], m4_default([$2], [auto]))
10423 AC_ARG_WITH(fop,
10424         AS_HELP_STRING([--with-fop],
10425            [Use fop to regenerate documentation (default: ]_defopt[)]),
10426            [use_fop=$withval], [use_fop=]_defopt)
10427 m4_undefine([_defopt])
10428
10429 if test "x$use_fop" = x"auto"; then
10430    AC_PATH_PROG([FOP], [fop])
10431    if test "x$FOP" = "x"; then
10432         AC_MSG_WARN([fop not found - documentation targets will be skipped])
10433         have_fop=no
10434    else
10435         have_fop=yes
10436    fi
10437 elif test "x$use_fop" = x"yes" ; then
10438    AC_PATH_PROG([FOP], [fop])
10439    if test "x$FOP" = "x"; then
10440         AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10441    fi
10442    have_fop=yes
10443 elif test "x$use_fop" = x"no" ; then
10444    if test "x$FOP" != "x"; then
10445       AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10446    fi
10447    have_fop=no
10448 else
10449    AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10450 fi
10451
10452 # Test for a minimum version of fop, if provided.
10453 m4_ifval([$1],
10454 [if test "$have_fop" = yes; then
10455     # scrape the fop version
10456     AC_MSG_CHECKING([for fop minimum version])
10457     fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10458     AC_MSG_RESULT([$fop_version])
10459     AS_VERSION_COMPARE([$fop_version], [$1],
10460         [if test "x$use_fop" = xauto; then
10461             AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10462             have_fop=no
10463         else
10464             AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10465         fi])
10466 fi])
10467 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10468 ]) # XORG_WITH_FOP
10469
10470 # XORG_WITH_PS2PDF([DEFAULT])
10471 # ----------------
10472 # Minimum version: 1.6.0
10473 # Minimum version for optional DEFAULT argument: 1.11.0
10474 #
10475 # Documentation tools are not always available on all platforms and sometimes
10476 # not at the appropriate level. This macro enables a module to test for the
10477 # presence of the tool and obtain it's path in separate variables. Coupled with
10478 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10479 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10480 # --with-ps2pdf assumes 'auto'.
10481 #
10482 # Interface to module:
10483 # HAVE_PS2PDF:  used in makefiles to conditionally generate documentation
10484 # PS2PDF:       returns the path of the ps2pdf program found
10485 #               returns the path set by the user in the environment
10486 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10487 #                'no' user instructs the module not to use ps2pdf
10488 #
10489 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10490 #
10491 AC_DEFUN([XORG_WITH_PS2PDF],[
10492 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10493 m4_define([_defopt], m4_default([$1], [auto]))
10494 AC_ARG_WITH(ps2pdf,
10495         AS_HELP_STRING([--with-ps2pdf],
10496            [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10497            [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10498 m4_undefine([_defopt])
10499
10500 if test "x$use_ps2pdf" = x"auto"; then
10501    AC_PATH_PROG([PS2PDF], [ps2pdf])
10502    if test "x$PS2PDF" = "x"; then
10503         AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10504         have_ps2pdf=no
10505    else
10506         have_ps2pdf=yes
10507    fi
10508 elif test "x$use_ps2pdf" = x"yes" ; then
10509    AC_PATH_PROG([PS2PDF], [ps2pdf])
10510    if test "x$PS2PDF" = "x"; then
10511         AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10512    fi
10513    have_ps2pdf=yes
10514 elif test "x$use_ps2pdf" = x"no" ; then
10515    if test "x$PS2PDF" != "x"; then
10516       AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10517    fi
10518    have_ps2pdf=no
10519 else
10520    AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10521 fi
10522 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10523 ]) # XORG_WITH_PS2PDF
10524
10525 # XORG_ENABLE_DOCS (enable_docs=yes)
10526 # ----------------
10527 # Minimum version: 1.6.0
10528 #
10529 # Documentation tools are not always available on all platforms and sometimes
10530 # not at the appropriate level. This macro enables a builder to skip all
10531 # documentation targets except traditional man pages.
10532 # Combined with the specific tool checking macros XORG_WITH_*, it provides
10533 # maximum flexibilty in controlling documentation building.
10534 # Refer to:
10535 # XORG_WITH_XMLTO         --with-xmlto
10536 # XORG_WITH_ASCIIDOC      --with-asciidoc
10537 # XORG_WITH_DOXYGEN       --with-doxygen
10538 # XORG_WITH_FOP           --with-fop
10539 # XORG_WITH_GROFF         --with-groff
10540 # XORG_WITH_PS2PDF        --with-ps2pdf
10541 #
10542 # Interface to module:
10543 # ENABLE_DOCS:    used in makefiles to conditionally generate documentation
10544 # --enable-docs: 'yes' user instructs the module to generate docs
10545 #                'no' user instructs the module not to generate docs
10546 # parm1:        specify the default value, yes or no.
10547 #
10548 AC_DEFUN([XORG_ENABLE_DOCS],[
10549 m4_define([docs_default], m4_default([$1], [yes]))
10550 AC_ARG_ENABLE(docs,
10551         AS_HELP_STRING([--enable-docs],
10552            [Enable building the documentation (default: ]docs_default[)]),
10553            [build_docs=$enableval], [build_docs=]docs_default)
10554 m4_undefine([docs_default])
10555 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10556 AC_MSG_CHECKING([whether to build documentation])
10557 AC_MSG_RESULT([$build_docs])
10558 ]) # XORG_ENABLE_DOCS
10559
10560 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10561 # ----------------
10562 # Minimum version: 1.6.0
10563 #
10564 # This macro enables a builder to skip all developer documentation.
10565 # Combined with the specific tool checking macros XORG_WITH_*, it provides
10566 # maximum flexibilty in controlling documentation building.
10567 # Refer to:
10568 # XORG_WITH_XMLTO         --with-xmlto
10569 # XORG_WITH_ASCIIDOC      --with-asciidoc
10570 # XORG_WITH_DOXYGEN       --with-doxygen
10571 # XORG_WITH_FOP           --with-fop
10572 # XORG_WITH_GROFF         --with-groff
10573 # XORG_WITH_PS2PDF        --with-ps2pdf
10574 #
10575 # Interface to module:
10576 # ENABLE_DEVEL_DOCS:    used in makefiles to conditionally generate developer docs
10577 # --enable-devel-docs:  'yes' user instructs the module to generate developer docs
10578 #                       'no' user instructs the module not to generate developer docs
10579 # parm1:                specify the default value, yes or no.
10580 #
10581 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10582 m4_define([devel_default], m4_default([$1], [yes]))
10583 AC_ARG_ENABLE(devel-docs,
10584         AS_HELP_STRING([--enable-devel-docs],
10585            [Enable building the developer documentation (default: ]devel_default[)]),
10586            [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10587 m4_undefine([devel_default])
10588 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10589 AC_MSG_CHECKING([whether to build developer documentation])
10590 AC_MSG_RESULT([$build_devel_docs])
10591 ]) # XORG_ENABLE_DEVEL_DOCS
10592
10593 # XORG_ENABLE_SPECS (enable_specs=yes)
10594 # ----------------
10595 # Minimum version: 1.6.0
10596 #
10597 # This macro enables a builder to skip all functional specification targets.
10598 # Combined with the specific tool checking macros XORG_WITH_*, it provides
10599 # maximum flexibilty in controlling documentation building.
10600 # Refer to:
10601 # XORG_WITH_XMLTO         --with-xmlto
10602 # XORG_WITH_ASCIIDOC      --with-asciidoc
10603 # XORG_WITH_DOXYGEN       --with-doxygen
10604 # XORG_WITH_FOP           --with-fop
10605 # XORG_WITH_GROFF         --with-groff
10606 # XORG_WITH_PS2PDF        --with-ps2pdf
10607 #
10608 # Interface to module:
10609 # ENABLE_SPECS:         used in makefiles to conditionally generate specs
10610 # --enable-specs:       'yes' user instructs the module to generate specs
10611 #                       'no' user instructs the module not to generate specs
10612 # parm1:                specify the default value, yes or no.
10613 #
10614 AC_DEFUN([XORG_ENABLE_SPECS],[
10615 m4_define([spec_default], m4_default([$1], [yes]))
10616 AC_ARG_ENABLE(specs,
10617         AS_HELP_STRING([--enable-specs],
10618            [Enable building the specs (default: ]spec_default[)]),
10619            [build_specs=$enableval], [build_specs=]spec_default)
10620 m4_undefine([spec_default])
10621 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10622 AC_MSG_CHECKING([whether to build functional specifications])
10623 AC_MSG_RESULT([$build_specs])
10624 ]) # XORG_ENABLE_SPECS
10625
10626 # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10627 # ----------------------------------------------
10628 # Minimum version: 1.13.0
10629 #
10630 # This macro enables a builder to enable/disable unit testing
10631 # It makes no assumption about the test cases implementation
10632 # Test cases may or may not use Automake "Support for test suites"
10633 # They may or may not use the software utility library GLib
10634 #
10635 # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10636 # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10637 # The variable enable_unit_tests is used by other macros in this file.
10638 #
10639 # Interface to module:
10640 # ENABLE_UNIT_TESTS:    used in makefiles to conditionally build tests
10641 # enable_unit_tests:    used in configure.ac for additional configuration
10642 # --enable-unit-tests:  'yes' user instructs the module to build tests
10643 #                       'no' user instructs the module not to build tests
10644 # parm1:                specify the default value, yes or no.
10645 #
10646 AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10647 AC_BEFORE([$0], [XORG_WITH_GLIB])
10648 AC_BEFORE([$0], [XORG_LD_WRAP])
10649 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10650 m4_define([_defopt], m4_default([$1], [auto]))
10651 AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10652         [Enable building unit test cases (default: ]_defopt[)]),
10653         [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10654 m4_undefine([_defopt])
10655 AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10656 AC_MSG_CHECKING([whether to build unit test cases])
10657 AC_MSG_RESULT([$enable_unit_tests])
10658 ]) # XORG_ENABLE_UNIT_TESTS
10659
10660 # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10661 # ----------------------------------------
10662 # Minimum version: 1.13.0
10663 #
10664 # GLib is a library which provides advanced data structures and functions.
10665 # This macro enables a module to test for the presence of Glib.
10666 #
10667 # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10668 # Otherwise the value of $enable_unit_tests is blank.
10669 #
10670 # Interface to module:
10671 # HAVE_GLIB: used in makefiles to conditionally build targets
10672 # with_glib: used in configure.ac to know if GLib has been found
10673 # --with-glib:  'yes' user instructs the module to use glib
10674 #               'no' user instructs the module not to use glib
10675 #
10676 AC_DEFUN([XORG_WITH_GLIB],[
10677 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10678 m4_define([_defopt], m4_default([$2], [auto]))
10679 AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10680         [Use GLib library for unit testing (default: ]_defopt[)]),
10681         [with_glib=$withval], [with_glib=]_defopt)
10682 m4_undefine([_defopt])
10683
10684 have_glib=no
10685 # Do not probe GLib if user explicitly disabled unit testing
10686 if test "x$enable_unit_tests" != x"no"; then
10687   # Do not probe GLib if user explicitly disabled it
10688   if test "x$with_glib" != x"no"; then
10689     m4_ifval(
10690       [$1],
10691       [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10692       [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10693     )
10694   fi
10695 fi
10696
10697 # Not having GLib when unit testing has been explicitly requested is an error
10698 if test "x$enable_unit_tests" = x"yes"; then
10699   if test "x$have_glib" = x"no"; then
10700     AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10701   fi
10702 fi
10703
10704 # Having unit testing disabled when GLib has been explicitly requested is an error
10705 if test "x$enable_unit_tests" = x"no"; then
10706   if test "x$with_glib" = x"yes"; then
10707     AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10708   fi
10709 fi
10710
10711 # Not having GLib when it has been explicitly requested is an error
10712 if test "x$with_glib" = x"yes"; then
10713   if test "x$have_glib" = x"no"; then
10714     AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10715   fi
10716 fi
10717
10718 AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10719 ]) # XORG_WITH_GLIB
10720
10721 # XORG_LD_WRAP([required|optional])
10722 # ---------------------------------
10723 # Minimum version: 1.13.0
10724 #
10725 # Check if linker supports -wrap, passed via compiler flags
10726 #
10727 # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10728 # Otherwise the value of $enable_unit_tests is blank.
10729 #
10730 # Argument added in 1.16.0 - default is "required", to match existing behavior
10731 # of returning an error if enable_unit_tests is yes, and ld -wrap is not
10732 # available, an argument of "optional" allows use when some unit tests require
10733 # ld -wrap and others do not.
10734 #
10735 AC_DEFUN([XORG_LD_WRAP],[
10736 XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10737     [AC_LANG_PROGRAM([#include <stdlib.h>
10738                       void __wrap_exit(int status) { return; }],
10739                      [exit(0);])])
10740 # Not having ld wrap when unit testing has been explicitly requested is an error
10741 if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10742   if test "x$have_ld_wrap" = x"no"; then
10743     AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10744   fi
10745 fi
10746 AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10747 #
10748 ]) # XORG_LD_WRAP
10749
10750 # XORG_CHECK_LINKER_FLAGS
10751 # -----------------------
10752 # SYNOPSIS
10753 #
10754 #   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10755 #
10756 # DESCRIPTION
10757 #
10758 #   Check whether the given linker FLAGS work with the current language's
10759 #   linker, or whether they give an error.
10760 #
10761 #   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10762 #   success/failure.
10763 #
10764 #   PROGRAM-SOURCE is the program source to link with, if needed
10765 #
10766 #   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10767 #
10768 # LICENSE
10769 #
10770 #   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10771 #   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10772 #   Copyright (c) 2009 Matteo Frigo
10773 #
10774 #   This program is free software: you can redistribute it and/or modify it
10775 #   under the terms of the GNU General Public License as published by the
10776 #   Free Software Foundation, either version 3 of the License, or (at your
10777 #   option) any later version.
10778 #
10779 #   This program is distributed in the hope that it will be useful, but
10780 #   WITHOUT ANY WARRANTY; without even the implied warranty of
10781 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10782 #   Public License for more details.
10783 #
10784 #   You should have received a copy of the GNU General Public License along
10785 #   with this program. If not, see <http://www.gnu.org/licenses/>.
10786 #
10787 #   As a special exception, the respective Autoconf Macro's copyright owner
10788 #   gives unlimited permission to copy, distribute and modify the configure
10789 #   scripts that are the output of Autoconf when processing the Macro. You
10790 #   need not follow the terms of the GNU General Public License when using
10791 #   or distributing such scripts, even though portions of the text of the
10792 #   Macro appear in them. The GNU General Public License (GPL) does govern
10793 #   all other use of the material that constitutes the Autoconf Macro.
10794 #
10795 #   This special exception to the GPL applies to versions of the Autoconf
10796 #   Macro released by the Autoconf Archive. When you make and distribute a
10797 #   modified version of the Autoconf Macro, you may extend this special
10798 #   exception to the GPL to apply to your modified version as well.#
10799 AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10800 [AC_MSG_CHECKING([whether the linker accepts $1])
10801 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10802 AS_LITERAL_IF([$1],
10803   [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10804       ax_save_FLAGS=$LDFLAGS
10805       LDFLAGS="$1"
10806       AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10807         AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10808         AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10809       LDFLAGS=$ax_save_FLAGS])],
10810   [ax_save_FLAGS=$LDFLAGS
10811    LDFLAGS="$1"
10812    AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10813      eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10814      eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10815    LDFLAGS=$ax_save_FLAGS])
10816 eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10817 AC_MSG_RESULT($xorg_check_linker_flags)
10818 if test "x$xorg_check_linker_flags" = xyes; then
10819         m4_default([$2], :)
10820 else
10821         m4_default([$3], :)
10822 fi
10823 ]) # XORG_CHECK_LINKER_FLAGS
10824
10825 # XORG_MEMORY_CHECK_FLAGS
10826 # -----------------------
10827 # Minimum version: 1.16.0
10828 #
10829 # This macro attempts to find appropriate memory checking functionality
10830 # for various platforms which unit testing code may use to catch various
10831 # forms of memory allocation and access errors in testing.
10832 #
10833 # Interface to module:
10834 # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10835 #                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10836 #
10837 # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10838 #
10839 AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10840
10841 AC_REQUIRE([AC_CANONICAL_HOST])
10842 AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10843            [Environment variables to enable memory checking in tests])
10844
10845 # Check for different types of support on different platforms
10846 case $host_os in
10847     solaris*)
10848         AC_CHECK_LIB([umem], [umem_alloc],
10849             [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10850         ;;
10851     *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10852         # both directly and inverted, so should not be 0 or 255.
10853         malloc_debug_env='MALLOC_PERTURB_=15'
10854         ;;
10855     darwin*)
10856         malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10857         ;;
10858     *bsd*)
10859         malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10860         ;;
10861 esac
10862
10863 # User supplied flags override default flags
10864 if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10865     malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10866 fi
10867
10868 AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10869 ]) # XORG_WITH_LINT
10870
10871 # XORG_CHECK_MALLOC_ZERO
10872 # ----------------------
10873 # Minimum version: 1.0.0
10874 #
10875 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10876 # malloc(0) returns NULL.  Packages should add one of these cflags to
10877 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10878 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10879 AC_ARG_ENABLE(malloc0returnsnull,
10880         AS_HELP_STRING([--enable-malloc0returnsnull],
10881                        [malloc(0) returns NULL (default: auto)]),
10882         [MALLOC_ZERO_RETURNS_NULL=$enableval],
10883         [MALLOC_ZERO_RETURNS_NULL=auto])
10884
10885 AC_MSG_CHECKING([whether malloc(0) returns NULL])
10886 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10887         AC_RUN_IFELSE([AC_LANG_PROGRAM([
10888 #include <stdlib.h>
10889 ],[
10890     char *m0, *r0, *c0, *p;
10891     m0 = malloc(0);
10892     p = malloc(10);
10893     r0 = realloc(p,0);
10894     c0 = calloc(0,10);
10895     exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10896 ])],
10897                 [MALLOC_ZERO_RETURNS_NULL=yes],
10898                 [MALLOC_ZERO_RETURNS_NULL=no],
10899                 [MALLOC_ZERO_RETURNS_NULL=yes])
10900 fi
10901 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10902
10903 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10904         MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10905         XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10906         XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10907 else
10908         MALLOC_ZERO_CFLAGS=""
10909         XMALLOC_ZERO_CFLAGS=""
10910         XTMALLOC_ZERO_CFLAGS=""
10911 fi
10912
10913 AC_SUBST([MALLOC_ZERO_CFLAGS])
10914 AC_SUBST([XMALLOC_ZERO_CFLAGS])
10915 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
10916 ]) # XORG_CHECK_MALLOC_ZERO
10917
10918 # XORG_WITH_LINT()
10919 # ----------------
10920 # Minimum version: 1.1.0
10921 #
10922 # This macro enables the use of a tool that flags some suspicious and
10923 # non-portable constructs (likely to be bugs) in C language source code.
10924 # It will attempt to locate the tool and use appropriate options.
10925 # There are various lint type tools on different platforms.
10926 #
10927 # Interface to module:
10928 # LINT:         returns the path to the tool found on the platform
10929 #               or the value set to LINT on the configure cmd line
10930 #               also an Automake conditional
10931 # LINT_FLAGS:   an Automake variable with appropriate flags
10932 #
10933 # --with-lint:  'yes' user instructs the module to use lint
10934 #               'no' user instructs the module not to use lint (default)
10935 #
10936 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10937 # If the user sets the value of LINT_FLAGS, they are used verbatim.
10938 #
10939 AC_DEFUN([XORG_WITH_LINT],[
10940
10941 AC_ARG_VAR([LINT], [Path to a lint-style command])
10942 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10943 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10944                 [Use a lint-style source code checker (default: disabled)])],
10945                 [use_lint=$withval], [use_lint=no])
10946
10947 # Obtain platform specific info like program name and options
10948 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
10949 case $host_os in
10950   *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10951         lint_name=splint
10952         lint_options="-badflag"
10953         ;;
10954   *freebsd* | *netbsd*)
10955         lint_name=lint
10956         lint_options="-u -b"
10957         ;;
10958   *solaris*)
10959         lint_name=lint
10960         lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10961         ;;
10962 esac
10963
10964 # Test for the presence of the program (either guessed by the code or spelled out by the user)
10965 if test "x$use_lint" = x"yes" ; then
10966    AC_PATH_PROG([LINT], [$lint_name])
10967    if test "x$LINT" = "x"; then
10968         AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10969    fi
10970 elif test "x$use_lint" = x"no" ; then
10971    if test "x$LINT" != "x"; then
10972       AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10973    fi
10974 else
10975    AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10976 fi
10977
10978 # User supplied flags override default flags
10979 if test "x$LINT_FLAGS" != "x"; then
10980    lint_options=$LINT_FLAGS
10981 fi
10982
10983 AC_SUBST([LINT_FLAGS],[$lint_options])
10984 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
10985
10986 ]) # XORG_WITH_LINT
10987
10988 # XORG_LINT_LIBRARY(LIBNAME)
10989 # --------------------------
10990 # Minimum version: 1.1.0
10991 #
10992 # Sets up flags for building lint libraries for checking programs that call
10993 # functions in the library.
10994 #
10995 # Interface to module:
10996 # LINTLIB               - Automake variable with the name of lint library file to make
10997 # MAKE_LINT_LIB         - Automake conditional
10998 #
10999 # --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11000 #                         - 'no' user instructs the module not to create a lint library (default)
11001
11002 AC_DEFUN([XORG_LINT_LIBRARY],[
11003 AC_REQUIRE([XORG_WITH_LINT])
11004 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11005         [Create lint library (default: disabled)])],
11006         [make_lint_lib=$enableval], [make_lint_lib=no])
11007
11008 if test "x$make_lint_lib" = x"yes" ; then
11009    LINTLIB=llib-l$1.ln
11010    if test "x$LINT" = "x"; then
11011         AC_MSG_ERROR([Cannot make lint library without --with-lint])
11012    fi
11013 elif test "x$make_lint_lib" != x"no" ; then
11014    AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11015 fi
11016
11017 AC_SUBST(LINTLIB)
11018 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11019
11020 ]) # XORG_LINT_LIBRARY
11021
11022 # XORG_COMPILER_BRAND
11023 # -------------------
11024 # Minimum version: 1.14.0
11025 #
11026 # Checks for various brands of compilers and sets flags as appropriate:
11027 #   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11028 #   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11029 #   clang compiler - sets CLANGCC to "yes"
11030 #   Intel compiler - sets INTELCC to "yes"
11031 #   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11032 #
11033 AC_DEFUN([XORG_COMPILER_BRAND], [
11034 AC_LANG_CASE(
11035         [C], [
11036                 AC_REQUIRE([AC_PROG_CC_C99])
11037         ],
11038         [C++], [
11039                 AC_REQUIRE([AC_PROG_CXX])
11040         ]
11041 )
11042 AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11043 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11044 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11045 ]) # XORG_COMPILER_BRAND
11046
11047 # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11048 # ---------------
11049 # Minimum version: 1.16.0
11050 #
11051 # Test if the compiler works when passed the given flag as a command line argument.
11052 # If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11053 # next flag in the list until there are no more options.
11054 #
11055 # Note that this does not guarantee that the compiler supports the flag as some
11056 # compilers will simply ignore arguments that they do not understand, but we do
11057 # attempt to weed out false positives by using -Werror=unknown-warning-option and
11058 # -Werror=unused-command-line-argument
11059 #
11060 AC_DEFUN([XORG_TESTSET_CFLAG], [
11061 m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11062 m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11063
11064 AC_LANG_COMPILER_REQUIRE
11065
11066 AC_LANG_CASE(
11067         [C], [
11068                 AC_REQUIRE([AC_PROG_CC_C99])
11069                 define([PREFIX], [C])
11070         ],
11071         [C++], [
11072                 define([PREFIX], [CXX])
11073         ]
11074 )
11075
11076 [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11077
11078 if test "x$xorg_testset_unknown_warning_option" = "x" ; then
11079         PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11080         AC_CACHE_CHECK([if compiler supports -Werror=unknown-warning-option],
11081                         xorg_cv_compiler_flag_unknown_warning_option,
11082                         AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11083                                           [xorg_cv_compiler_flag_unknown_warning_option=yes],
11084                                           [xorg_cv_compiler_flag_unknown_warning_option=no]))
11085         xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option
11086         PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11087 fi
11088
11089 if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
11090         if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11091                 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11092         fi
11093         PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11094         AC_CACHE_CHECK([if compiler supports -Werror=unused-command-line-argument],
11095                         xorg_cv_compiler_flag_unused_command_line_argument,
11096                         AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11097                                           [xorg_cv_compiler_flag_unused_command_line_argument=yes],
11098                                           [xorg_cv_compiler_flag_unused_command_line_argument=no]))
11099         xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument
11100         PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11101 fi
11102
11103 found="no"
11104 m4_foreach([flag], m4_cdr($@), [
11105         if test $found = "no" ; then
11106                 if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11107                         PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11108                 fi
11109
11110                 if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11111                         PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11112                 fi
11113
11114                 PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11115
11116 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11117                 AC_MSG_CHECKING([if $CC supports ]flag[])
11118                 cacheid=`AS_ECHO([xorg_cv_cc_flag_]flag[])`
11119                 AC_CACHE_VAL(AS_TR_SH($cacheid),
11120                              [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11121                                              [eval AS_TR_SH($cacheid)=yes],
11122                                              [eval AS_TR_SH($cacheid)=no])])
11123
11124                 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11125
11126                 eval supported=$AS_TR_SH($cacheid)
11127                 AC_MSG_RESULT([$supported])
11128                 if test "$supported" = "yes" ; then
11129                         $1="$$1 ]flag["
11130                         found="yes"
11131                 fi
11132         fi
11133 ])
11134 ]) # XORG_TESTSET_CFLAG
11135
11136 # XORG_COMPILER_FLAGS
11137 # ---------------
11138 # Minimum version: 1.16.0
11139 #
11140 # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11141 # arguments supported by the selected compiler which do NOT alter the generated
11142 # code.  These arguments will cause the compiler to print various warnings
11143 # during compilation AND turn a conservative set of warnings into errors.
11144 #
11145 # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11146 # future versions of util-macros as options are added to new compilers.
11147 #
11148 AC_DEFUN([XORG_COMPILER_FLAGS], [
11149 AC_REQUIRE([XORG_COMPILER_BRAND])
11150
11151 AC_ARG_ENABLE(selective-werror,
11152               AS_HELP_STRING([--disable-selective-werror],
11153                              [Turn off selective compiler errors. (default: enabled)]),
11154               [SELECTIVE_WERROR=$enableval],
11155               [SELECTIVE_WERROR=yes])
11156
11157 AC_LANG_CASE(
11158         [C], [
11159                 define([PREFIX], [C])
11160         ],
11161         [C++], [
11162                 define([PREFIX], [CXX])
11163         ]
11164 )
11165 # -v is too short to test reliably with XORG_TESTSET_CFLAG
11166 if test "x$SUNCC" = "xyes"; then
11167     [BASE_]PREFIX[FLAGS]="-v"
11168 else
11169     [BASE_]PREFIX[FLAGS]=""
11170 fi
11171
11172 # This chunk of warnings were those that existed in the legacy CWARNFLAGS
11173 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11174 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11175 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11176 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11177
11178 AC_LANG_CASE(
11179         [C], [
11180                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11181                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11182                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11183                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11184                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11185                 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11186         ]
11187 )
11188
11189 # This chunk adds additional warnings that could catch undesired effects.
11190 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11191 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11192 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11193 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11194 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11195 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11196 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11197
11198 # These are currently disabled because they are noisy.  They will be enabled
11199 # in the future once the codebase is sufficiently modernized to silence
11200 # them.  For now, I don't want them to drown out the other warnings.
11201 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11202 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11203 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11204
11205 # Turn some warnings into errors, so we don't accidently get successful builds
11206 # when there are problems that should be fixed.
11207
11208 if test "x$SELECTIVE_WERROR" = "xyes" ; then
11209 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11210 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11211 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11212 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11213 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11214 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11215 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11216 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11217 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11218 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11219 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11220 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11221 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11222 else
11223 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])
11224 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11225 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11226 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11227 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11228 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11229 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11230 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11231 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11232 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11233 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11234 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11235 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11236 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11237 fi
11238
11239 AC_SUBST([BASE_]PREFIX[FLAGS])
11240 ]) # XORG_COMPILER_FLAGS
11241
11242 # XORG_CWARNFLAGS
11243 # ---------------
11244 # Minimum version: 1.2.0
11245 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11246 #
11247 # Defines CWARNFLAGS to enable C compiler warnings.
11248 #
11249 # This function is deprecated because it defines -fno-strict-aliasing
11250 # which alters the code generated by the compiler.  If -fno-strict-aliasing
11251 # is needed, then it should be added explicitly in the module when
11252 # it is updated to use BASE_CFLAGS.
11253 #
11254 AC_DEFUN([XORG_CWARNFLAGS], [
11255 AC_REQUIRE([XORG_COMPILER_FLAGS])
11256 AC_REQUIRE([XORG_COMPILER_BRAND])
11257 AC_LANG_CASE(
11258         [C], [
11259                 CWARNFLAGS="$BASE_CFLAGS"
11260                 if  test "x$GCC" = xyes ; then
11261                     CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11262                 fi
11263                 AC_SUBST(CWARNFLAGS)
11264         ]
11265 )
11266 ]) # XORG_CWARNFLAGS
11267
11268 # XORG_STRICT_OPTION
11269 # -----------------------
11270 # Minimum version: 1.3.0
11271 #
11272 # Add configure option to enable strict compilation flags, such as treating
11273 # warnings as fatal errors.
11274 # If --enable-strict-compilation is passed to configure, adds strict flags to
11275 # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11276 #
11277 # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11278 # when strict compilation is unconditionally desired.
11279 AC_DEFUN([XORG_STRICT_OPTION], [
11280 AC_REQUIRE([XORG_CWARNFLAGS])
11281 AC_REQUIRE([XORG_COMPILER_FLAGS])
11282
11283 AC_ARG_ENABLE(strict-compilation,
11284                           AS_HELP_STRING([--enable-strict-compilation],
11285                           [Enable all warnings from compiler and make them errors (default: disabled)]),
11286                           [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11287
11288 AC_LANG_CASE(
11289         [C], [
11290                 define([PREFIX], [C])
11291         ],
11292         [C++], [
11293                 define([PREFIX], [CXX])
11294         ]
11295 )
11296
11297 [STRICT_]PREFIX[FLAGS]=""
11298 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11299 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11300
11301 # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11302 # activate it with -Werror, so we add it here explicitly.
11303 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11304
11305 if test "x$STRICT_COMPILE" = "xyes"; then
11306     [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11307     AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11308 fi
11309 AC_SUBST([STRICT_]PREFIX[FLAGS])
11310 AC_SUBST([BASE_]PREFIX[FLAGS])
11311 AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11312 ]) # XORG_STRICT_OPTION
11313
11314 # XORG_DEFAULT_OPTIONS
11315 # --------------------
11316 # Minimum version: 1.3.0
11317 #
11318 # Defines default options for X.Org modules.
11319 #
11320 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11321 AC_REQUIRE([AC_PROG_INSTALL])
11322 XORG_COMPILER_FLAGS
11323 XORG_CWARNFLAGS
11324 XORG_STRICT_OPTION
11325 XORG_RELEASE_VERSION
11326 XORG_CHANGELOG
11327 XORG_INSTALL
11328 XORG_MANPAGE_SECTIONS
11329 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11330     [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11331 ]) # XORG_DEFAULT_OPTIONS
11332
11333 # XORG_INSTALL()
11334 # ----------------
11335 # Minimum version: 1.4.0
11336 #
11337 # Defines the variable INSTALL_CMD as the command to copy
11338 # INSTALL from $prefix/share/util-macros.
11339 #
11340 AC_DEFUN([XORG_INSTALL], [
11341 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11342 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11343 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11344 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11345 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11346 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11347 AC_SUBST([INSTALL_CMD])
11348 ]) # XORG_INSTALL
11349 dnl Copyright 2005 Red Hat, Inc
11350 dnl
11351 dnl Permission to use, copy, modify, distribute, and sell this software and its
11352 dnl documentation for any purpose is hereby granted without fee, provided that
11353 dnl the above copyright notice appear in all copies and that both that
11354 dnl copyright notice and this permission notice appear in supporting
11355 dnl documentation.
11356 dnl
11357 dnl The above copyright notice and this permission notice shall be included
11358 dnl in all copies or substantial portions of the Software.
11359 dnl
11360 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11361 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11362 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11363 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11364 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11365 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11366 dnl OTHER DEALINGS IN THE SOFTWARE.
11367 dnl
11368 dnl Except as contained in this notice, the name of the copyright holders shall
11369 dnl not be used in advertising or otherwise to promote the sale, use or
11370 dnl other dealings in this Software without prior written authorization
11371 dnl from the copyright holders.
11372 dnl
11373
11374 # XORG_RELEASE_VERSION
11375 # --------------------
11376 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11377  
11378 AC_DEFUN([XORG_RELEASE_VERSION],[
11379         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11380                 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
11381                 [Major version of this package])
11382         PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11383         if test "x$PVM" = "x"; then
11384                 PVM="0"
11385         fi
11386         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11387                 [$PVM],
11388                 [Minor version of this package])
11389         PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11390         if test "x$PVP" = "x"; then
11391                 PVP="0"
11392         fi
11393         AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11394                 [$PVP],
11395                 [Patch version of this package])
11396 ])
11397
11398 # XORG_CHANGELOG()
11399 # ----------------
11400 # Minimum version: 1.2.0
11401 #
11402 # Defines the variable CHANGELOG_CMD as the command to generate
11403 # ChangeLog from git.
11404 #
11405 #
11406 AC_DEFUN([XORG_CHANGELOG], [
11407 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11408 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11409 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11410 echo 'git directory not found: installing possibly empty changelog.' >&2)"
11411 AC_SUBST([CHANGELOG_CMD])
11412 ]) # XORG_CHANGELOG
11413