1# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2
3# Copyright (C) 1996-2021 Free Software Foundation, Inc.
4
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15m4_ifndef([AC_AUTOCONF_VERSION],
16  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
18[m4_warning([this file was generated for autoconf 2.71.
19You have another version of autoconf.  It may work, but is not guaranteed to.
20If you have problems, you may need to regenerate the build system entirely.
21To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22
23# Helper functions for option handling.                    -*- Autoconf -*-
24#
25#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
26#   Software Foundation, Inc.
27#   Written by Gary V. Vaughan, 2004
28#
29# This file is free software; the Free Software Foundation gives
30# unlimited permission to copy and/or distribute it, with or without
31# modifications, as long as this notice is preserved.
32
33# serial 8 ltoptions.m4
34
35# This is to help aclocal find these macros, as it can't see m4_define.
36AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
37
38
39# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
40# ------------------------------------------
41m4_define([_LT_MANGLE_OPTION],
42[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
43
44
45# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
46# ---------------------------------------
47# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
48# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
49# saved as a flag.
50m4_define([_LT_SET_OPTION],
51[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
52m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
53        _LT_MANGLE_DEFUN([$1], [$2]),
54    [m4_warning([Unknown $1 option '$2'])])[]dnl
55])
56
57
58# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
59# ------------------------------------------------------------
60# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
61m4_define([_LT_IF_OPTION],
62[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
63
64
65# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
66# -------------------------------------------------------
67# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
68# are set.
69m4_define([_LT_UNLESS_OPTIONS],
70[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
71	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
72		      [m4_define([$0_found])])])[]dnl
73m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
74])[]dnl
75])
76
77
78# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
79# ----------------------------------------
80# OPTION-LIST is a space-separated list of Libtool options associated
81# with MACRO-NAME.  If any OPTION has a matching handler declared with
82# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
83# the unknown option and exit.
84m4_defun([_LT_SET_OPTIONS],
85[# Set options
86m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
87    [_LT_SET_OPTION([$1], _LT_Option)])
88
89m4_if([$1],[LT_INIT],[
90  dnl
91  dnl Simply set some default values (i.e off) if boolean options were not
92  dnl specified:
93  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
94  ])
95  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
96  ])
97  dnl
98  dnl If no reference was made to various pairs of opposing options, then
99  dnl we run the default mode handler for the pair.  For example, if neither
100  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
101  dnl archives by default:
102  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
103  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
104  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
105  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
106		   [_LT_ENABLE_FAST_INSTALL])
107  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
108		   [_LT_WITH_AIX_SONAME([aix])])
109  ])
110])# _LT_SET_OPTIONS
111
112
113
114# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
115# -----------------------------------------
116m4_define([_LT_MANGLE_DEFUN],
117[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
118
119
120# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
121# -----------------------------------------------
122m4_define([LT_OPTION_DEFINE],
123[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
124])# LT_OPTION_DEFINE
125
126
127# dlopen
128# ------
129LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
130])
131
132AU_DEFUN([AC_LIBTOOL_DLOPEN],
133[_LT_SET_OPTION([LT_INIT], [dlopen])
134AC_DIAGNOSE([obsolete],
135[$0: Remove this warning and the call to _LT_SET_OPTION when you
136put the 'dlopen' option into LT_INIT's first parameter.])
137])
138
139dnl aclocal-1.4 backwards compatibility:
140dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
141
142
143# win32-dll
144# ---------
145# Declare package support for building win32 dll's.
146LT_OPTION_DEFINE([LT_INIT], [win32-dll],
147[enable_win32_dll=yes
148
149case $host in
150*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
151  AC_CHECK_TOOL(AS, as, false)
152  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
153  AC_CHECK_TOOL(OBJDUMP, objdump, false)
154  ;;
155esac
156
157test -z "$AS" && AS=as
158_LT_DECL([], [AS],      [1], [Assembler program])dnl
159
160test -z "$DLLTOOL" && DLLTOOL=dlltool
161_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
162
163test -z "$OBJDUMP" && OBJDUMP=objdump
164_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
165])# win32-dll
166
167AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
168[AC_REQUIRE([AC_CANONICAL_HOST])dnl
169_LT_SET_OPTION([LT_INIT], [win32-dll])
170AC_DIAGNOSE([obsolete],
171[$0: Remove this warning and the call to _LT_SET_OPTION when you
172put the 'win32-dll' option into LT_INIT's first parameter.])
173])
174
175dnl aclocal-1.4 backwards compatibility:
176dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
177
178
179# _LT_ENABLE_SHARED([DEFAULT])
180# ----------------------------
181# implement the --enable-shared flag, and supports the 'shared' and
182# 'disable-shared' LT_INIT options.
183# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
184m4_define([_LT_ENABLE_SHARED],
185[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
186AC_ARG_ENABLE([shared],
187    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
188	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
189    [p=${PACKAGE-default}
190    case $enableval in
191    yes) enable_shared=yes ;;
192    no) enable_shared=no ;;
193    *)
194      enable_shared=no
195      # Look at the argument we got.  We use all the common list separators.
196      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
197      for pkg in $enableval; do
198	IFS=$lt_save_ifs
199	if test "X$pkg" = "X$p"; then
200	  enable_shared=yes
201	fi
202      done
203      IFS=$lt_save_ifs
204      ;;
205    esac],
206    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
207
208    _LT_DECL([build_libtool_libs], [enable_shared], [0],
209	[Whether or not to build shared libraries])
210])# _LT_ENABLE_SHARED
211
212LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
213LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
214
215# Old names:
216AC_DEFUN([AC_ENABLE_SHARED],
217[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
218])
219
220AC_DEFUN([AC_DISABLE_SHARED],
221[_LT_SET_OPTION([LT_INIT], [disable-shared])
222])
223
224AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
225AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
226
227dnl aclocal-1.4 backwards compatibility:
228dnl AC_DEFUN([AM_ENABLE_SHARED], [])
229dnl AC_DEFUN([AM_DISABLE_SHARED], [])
230
231
232
233# _LT_ENABLE_STATIC([DEFAULT])
234# ----------------------------
235# implement the --enable-static flag, and support the 'static' and
236# 'disable-static' LT_INIT options.
237# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
238m4_define([_LT_ENABLE_STATIC],
239[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
240AC_ARG_ENABLE([static],
241    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
242	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
243    [p=${PACKAGE-default}
244    case $enableval in
245    yes) enable_static=yes ;;
246    no) enable_static=no ;;
247    *)
248     enable_static=no
249      # Look at the argument we got.  We use all the common list separators.
250      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
251      for pkg in $enableval; do
252	IFS=$lt_save_ifs
253	if test "X$pkg" = "X$p"; then
254	  enable_static=yes
255	fi
256      done
257      IFS=$lt_save_ifs
258      ;;
259    esac],
260    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
261
262    _LT_DECL([build_old_libs], [enable_static], [0],
263	[Whether or not to build static libraries])
264])# _LT_ENABLE_STATIC
265
266LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
267LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
268
269# Old names:
270AC_DEFUN([AC_ENABLE_STATIC],
271[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
272])
273
274AC_DEFUN([AC_DISABLE_STATIC],
275[_LT_SET_OPTION([LT_INIT], [disable-static])
276])
277
278AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
279AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
280
281dnl aclocal-1.4 backwards compatibility:
282dnl AC_DEFUN([AM_ENABLE_STATIC], [])
283dnl AC_DEFUN([AM_DISABLE_STATIC], [])
284
285
286
287# _LT_ENABLE_FAST_INSTALL([DEFAULT])
288# ----------------------------------
289# implement the --enable-fast-install flag, and support the 'fast-install'
290# and 'disable-fast-install' LT_INIT options.
291# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
292m4_define([_LT_ENABLE_FAST_INSTALL],
293[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
294AC_ARG_ENABLE([fast-install],
295    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
296    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
297    [p=${PACKAGE-default}
298    case $enableval in
299    yes) enable_fast_install=yes ;;
300    no) enable_fast_install=no ;;
301    *)
302      enable_fast_install=no
303      # Look at the argument we got.  We use all the common list separators.
304      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
305      for pkg in $enableval; do
306	IFS=$lt_save_ifs
307	if test "X$pkg" = "X$p"; then
308	  enable_fast_install=yes
309	fi
310      done
311      IFS=$lt_save_ifs
312      ;;
313    esac],
314    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
315
316_LT_DECL([fast_install], [enable_fast_install], [0],
317	 [Whether or not to optimize for fast installation])dnl
318])# _LT_ENABLE_FAST_INSTALL
319
320LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
321LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
322
323# Old names:
324AU_DEFUN([AC_ENABLE_FAST_INSTALL],
325[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
326AC_DIAGNOSE([obsolete],
327[$0: Remove this warning and the call to _LT_SET_OPTION when you put
328the 'fast-install' option into LT_INIT's first parameter.])
329])
330
331AU_DEFUN([AC_DISABLE_FAST_INSTALL],
332[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
333AC_DIAGNOSE([obsolete],
334[$0: Remove this warning and the call to _LT_SET_OPTION when you put
335the 'disable-fast-install' option into LT_INIT's first parameter.])
336])
337
338dnl aclocal-1.4 backwards compatibility:
339dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
340dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
341
342
343# _LT_WITH_AIX_SONAME([DEFAULT])
344# ----------------------------------
345# implement the --with-aix-soname flag, and support the `aix-soname=aix'
346# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
347# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
348m4_define([_LT_WITH_AIX_SONAME],
349[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
350shared_archive_member_spec=
351case $host,$enable_shared in
352power*-*-aix[[5-9]]*,yes)
353  AC_MSG_CHECKING([which variant of shared library versioning to provide])
354  AC_ARG_WITH([aix-soname],
355    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
356      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
357    [case $withval in
358    aix|svr4|both)
359      ;;
360    *)
361      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
362      ;;
363    esac
364    lt_cv_with_aix_soname=$with_aix_soname],
365    [AC_CACHE_VAL([lt_cv_with_aix_soname],
366      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
367    with_aix_soname=$lt_cv_with_aix_soname])
368  AC_MSG_RESULT([$with_aix_soname])
369  if test aix != "$with_aix_soname"; then
370    # For the AIX way of multilib, we name the shared archive member
371    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
372    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
373    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
374    # the AIX toolchain works better with OBJECT_MODE set (default 32).
375    if test 64 = "${OBJECT_MODE-32}"; then
376      shared_archive_member_spec=shr_64
377    else
378      shared_archive_member_spec=shr
379    fi
380  fi
381  ;;
382*)
383  with_aix_soname=aix
384  ;;
385esac
386
387_LT_DECL([], [shared_archive_member_spec], [0],
388    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
389])# _LT_WITH_AIX_SONAME
390
391LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
392LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
393LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
394
395
396# _LT_WITH_PIC([MODE])
397# --------------------
398# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
399# LT_INIT options.
400# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
401m4_define([_LT_WITH_PIC],
402[AC_ARG_WITH([pic],
403    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
404	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
405    [lt_p=${PACKAGE-default}
406    case $withval in
407    yes|no) pic_mode=$withval ;;
408    *)
409      pic_mode=default
410      # Look at the argument we got.  We use all the common list separators.
411      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
412      for lt_pkg in $withval; do
413	IFS=$lt_save_ifs
414	if test "X$lt_pkg" = "X$lt_p"; then
415	  pic_mode=yes
416	fi
417      done
418      IFS=$lt_save_ifs
419      ;;
420    esac],
421    [pic_mode=m4_default([$1], [default])])
422
423_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
424])# _LT_WITH_PIC
425
426LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
427LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
428
429# Old name:
430AU_DEFUN([AC_LIBTOOL_PICMODE],
431[_LT_SET_OPTION([LT_INIT], [pic-only])
432AC_DIAGNOSE([obsolete],
433[$0: Remove this warning and the call to _LT_SET_OPTION when you
434put the 'pic-only' option into LT_INIT's first parameter.])
435])
436
437dnl aclocal-1.4 backwards compatibility:
438dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
439
440
441m4_define([_LTDL_MODE], [])
442LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
443		 [m4_define([_LTDL_MODE], [nonrecursive])])
444LT_OPTION_DEFINE([LTDL_INIT], [recursive],
445		 [m4_define([_LTDL_MODE], [recursive])])
446LT_OPTION_DEFINE([LTDL_INIT], [subproject],
447		 [m4_define([_LTDL_MODE], [subproject])])
448
449m4_define([_LTDL_TYPE], [])
450LT_OPTION_DEFINE([LTDL_INIT], [installable],
451		 [m4_define([_LTDL_TYPE], [installable])])
452LT_OPTION_DEFINE([LTDL_INIT], [convenience],
453		 [m4_define([_LTDL_TYPE], [convenience])])
454
455# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
456#
457# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
458# Foundation, Inc.
459# Written by Gary V. Vaughan, 2004
460#
461# This file is free software; the Free Software Foundation gives
462# unlimited permission to copy and/or distribute it, with or without
463# modifications, as long as this notice is preserved.
464
465# serial 6 ltsugar.m4
466
467# This is to help aclocal find these macros, as it can't see m4_define.
468AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
469
470
471# lt_join(SEP, ARG1, [ARG2...])
472# -----------------------------
473# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
474# associated separator.
475# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
476# versions in m4sugar had bugs.
477m4_define([lt_join],
478[m4_if([$#], [1], [],
479       [$#], [2], [[$2]],
480       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
481m4_define([_lt_join],
482[m4_if([$#$2], [2], [],
483       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
484
485
486# lt_car(LIST)
487# lt_cdr(LIST)
488# ------------
489# Manipulate m4 lists.
490# These macros are necessary as long as will still need to support
491# Autoconf-2.59, which quotes differently.
492m4_define([lt_car], [[$1]])
493m4_define([lt_cdr],
494[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
495       [$#], 1, [],
496       [m4_dquote(m4_shift($@))])])
497m4_define([lt_unquote], $1)
498
499
500# lt_append(MACRO-NAME, STRING, [SEPARATOR])
501# ------------------------------------------
502# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
503# Note that neither SEPARATOR nor STRING are expanded; they are appended
504# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
505# No SEPARATOR is output if MACRO-NAME was previously undefined (different
506# than defined and empty).
507#
508# This macro is needed until we can rely on Autoconf 2.62, since earlier
509# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
510m4_define([lt_append],
511[m4_define([$1],
512	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
513
514
515
516# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
517# ----------------------------------------------------------
518# Produce a SEP delimited list of all paired combinations of elements of
519# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
520# has the form PREFIXmINFIXSUFFIXn.
521# Needed until we can rely on m4_combine added in Autoconf 2.62.
522m4_define([lt_combine],
523[m4_if(m4_eval([$# > 3]), [1],
524       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
525[[m4_foreach([_Lt_prefix], [$2],
526	     [m4_foreach([_Lt_suffix],
527		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
528	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
529
530
531# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
532# -----------------------------------------------------------------------
533# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
534# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
535m4_define([lt_if_append_uniq],
536[m4_ifdef([$1],
537	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
538		 [lt_append([$1], [$2], [$3])$4],
539		 [$5])],
540	  [lt_append([$1], [$2], [$3])$4])])
541
542
543# lt_dict_add(DICT, KEY, VALUE)
544# -----------------------------
545m4_define([lt_dict_add],
546[m4_define([$1($2)], [$3])])
547
548
549# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
550# --------------------------------------------
551m4_define([lt_dict_add_subkey],
552[m4_define([$1($2:$3)], [$4])])
553
554
555# lt_dict_fetch(DICT, KEY, [SUBKEY])
556# ----------------------------------
557m4_define([lt_dict_fetch],
558[m4_ifval([$3],
559	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
560    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
561
562
563# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
564# -----------------------------------------------------------------
565m4_define([lt_if_dict_fetch],
566[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
567	[$5],
568    [$6])])
569
570
571# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
572# --------------------------------------------------------------
573m4_define([lt_dict_filter],
574[m4_if([$5], [], [],
575  [lt_join(m4_quote(m4_default([$4], [[, ]])),
576           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
577		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
578])
579
580# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
581#
582#   Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
583#   Software Foundation, Inc.
584#   Written by Scott James Remnant, 2004.
585#
586# This file is free software; the Free Software Foundation gives
587# unlimited permission to copy and/or distribute it, with or without
588# modifications, as long as this notice is preserved.
589
590# serial 5 lt~obsolete.m4
591
592# These exist entirely to fool aclocal when bootstrapping libtool.
593#
594# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
595# which have later been changed to m4_define as they aren't part of the
596# exported API, or moved to Autoconf or Automake where they belong.
597#
598# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
599# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
600# using a macro with the same name in our local m4/libtool.m4 it'll
601# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
602# and doesn't know about Autoconf macros at all.)
603#
604# So we provide this file, which has a silly filename so it's always
605# included after everything else.  This provides aclocal with the
606# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
607# because those macros already exist, or will be overwritten later.
608# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
609#
610# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
611# Yes, that means every name once taken will need to remain here until
612# we give up compatibility with versions before 1.7, at which point
613# we need to keep only those names which we still refer to.
614
615# This is to help aclocal find these macros, as it can't see m4_define.
616AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
617
618m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
619m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
620m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
621m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
622m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
623m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
624m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
625m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
626m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
627m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
628m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
629m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
630m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
631m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
632m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
633m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
634m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
635m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
636m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
637m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
638m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
639m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
640m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
641m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
642m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
643m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
644m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
645m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
646m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
647m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
648m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
649m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
650m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
651m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
652m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
653m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
654m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
655m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
656m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
657m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
658m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
659m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
660m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
661m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
662m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
663m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
664m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
665m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
666m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
667m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
668m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
669m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
670m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
671m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
672m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
673m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
674m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
675m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
676m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
677m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
678m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
679
680# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
681# serial 11 (pkg-config-0.29.1)
682
683dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
684dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
685dnl
686dnl This program is free software; you can redistribute it and/or modify
687dnl it under the terms of the GNU General Public License as published by
688dnl the Free Software Foundation; either version 2 of the License, or
689dnl (at your option) any later version.
690dnl
691dnl This program is distributed in the hope that it will be useful, but
692dnl WITHOUT ANY WARRANTY; without even the implied warranty of
693dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
694dnl General Public License for more details.
695dnl
696dnl You should have received a copy of the GNU General Public License
697dnl along with this program; if not, write to the Free Software
698dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
699dnl 02111-1307, USA.
700dnl
701dnl As a special exception to the GNU General Public License, if you
702dnl distribute this file as part of a program that contains a
703dnl configuration script generated by Autoconf, you may include it under
704dnl the same distribution terms that you use for the rest of that
705dnl program.
706
707dnl PKG_PREREQ(MIN-VERSION)
708dnl -----------------------
709dnl Since: 0.29
710dnl
711dnl Verify that the version of the pkg-config macros are at least
712dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
713dnl installed version of pkg-config, this checks the developer's version
714dnl of pkg.m4 when generating configure.
715dnl
716dnl To ensure that this macro is defined, also add:
717dnl m4_ifndef([PKG_PREREQ],
718dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
719dnl
720dnl See the "Since" comment for each macro you use to see what version
721dnl of the macros you require.
722m4_defun([PKG_PREREQ],
723[m4_define([PKG_MACROS_VERSION], [0.29.1])
724m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
725    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
726])dnl PKG_PREREQ
727
728dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
729dnl ----------------------------------
730dnl Since: 0.16
731dnl
732dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
733dnl first found in the path. Checks that the version of pkg-config found
734dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
735dnl used since that's the first version where most current features of
736dnl pkg-config existed.
737AC_DEFUN([PKG_PROG_PKG_CONFIG],
738[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
739m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
740m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
741AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
742AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
743AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
744
745if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
746	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
747fi
748if test -n "$PKG_CONFIG"; then
749	_pkg_min_version=m4_default([$1], [0.9.0])
750	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
751	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
752		AC_MSG_RESULT([yes])
753	else
754		AC_MSG_RESULT([no])
755		PKG_CONFIG=""
756	fi
757fi[]dnl
758])dnl PKG_PROG_PKG_CONFIG
759
760dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
761dnl -------------------------------------------------------------------
762dnl Since: 0.18
763dnl
764dnl Check to see whether a particular set of modules exists. Similar to
765dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
766dnl
767dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
768dnl only at the first occurence in configure.ac, so if the first place
769dnl it's called might be skipped (such as if it is within an "if", you
770dnl have to call PKG_CHECK_EXISTS manually
771AC_DEFUN([PKG_CHECK_EXISTS],
772[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
773if test -n "$PKG_CONFIG" && \
774    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
775  m4_default([$2], [:])
776m4_ifvaln([$3], [else
777  $3])dnl
778fi])
779
780dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
781dnl ---------------------------------------------
782dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
783dnl pkg_failed based on the result.
784m4_define([_PKG_CONFIG],
785[if test -n "$$1"; then
786    pkg_cv_[]$1="$$1"
787 elif test -n "$PKG_CONFIG"; then
788    PKG_CHECK_EXISTS([$3],
789                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
790		      test "x$?" != "x0" && pkg_failed=yes ],
791		     [pkg_failed=yes])
792 else
793    pkg_failed=untried
794fi[]dnl
795])dnl _PKG_CONFIG
796
797dnl _PKG_SHORT_ERRORS_SUPPORTED
798dnl ---------------------------
799dnl Internal check to see if pkg-config supports short errors.
800AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
801[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
802if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
803        _pkg_short_errors_supported=yes
804else
805        _pkg_short_errors_supported=no
806fi[]dnl
807])dnl _PKG_SHORT_ERRORS_SUPPORTED
808
809
810dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
811dnl   [ACTION-IF-NOT-FOUND])
812dnl --------------------------------------------------------------
813dnl Since: 0.4.0
814dnl
815dnl Note that if there is a possibility the first call to
816dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
817dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
818AC_DEFUN([PKG_CHECK_MODULES],
819[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
820AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
821AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
822
823pkg_failed=no
824AC_MSG_CHECKING([for $1])
825
826_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
827_PKG_CONFIG([$1][_LIBS], [libs], [$2])
828
829m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
830and $1[]_LIBS to avoid the need to call pkg-config.
831See the pkg-config man page for more details.])
832
833if test $pkg_failed = yes; then
834   	AC_MSG_RESULT([no])
835        _PKG_SHORT_ERRORS_SUPPORTED
836        if test $_pkg_short_errors_supported = yes; then
837	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
838        else 
839	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
840        fi
841	# Put the nasty error message in config.log where it belongs
842	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
843
844	m4_default([$4], [AC_MSG_ERROR(
845[Package requirements ($2) were not met:
846
847$$1_PKG_ERRORS
848
849Consider adjusting the PKG_CONFIG_PATH environment variable if you
850installed software in a non-standard prefix.
851
852_PKG_TEXT])[]dnl
853        ])
854elif test $pkg_failed = untried; then
855     	AC_MSG_RESULT([no])
856	m4_default([$4], [AC_MSG_FAILURE(
857[The pkg-config script could not be found or is too old.  Make sure it
858is in your PATH or set the PKG_CONFIG environment variable to the full
859path to pkg-config.
860
861_PKG_TEXT
862
863To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
864        ])
865else
866	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
867	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
868        AC_MSG_RESULT([yes])
869	$3
870fi[]dnl
871])dnl PKG_CHECK_MODULES
872
873
874dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
875dnl   [ACTION-IF-NOT-FOUND])
876dnl ---------------------------------------------------------------------
877dnl Since: 0.29
878dnl
879dnl Checks for existence of MODULES and gathers its build flags with
880dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
881dnl and VARIABLE-PREFIX_LIBS from --libs.
882dnl
883dnl Note that if there is a possibility the first call to
884dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
885dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
886dnl configure.ac.
887AC_DEFUN([PKG_CHECK_MODULES_STATIC],
888[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
889_save_PKG_CONFIG=$PKG_CONFIG
890PKG_CONFIG="$PKG_CONFIG --static"
891PKG_CHECK_MODULES($@)
892PKG_CONFIG=$_save_PKG_CONFIG[]dnl
893])dnl PKG_CHECK_MODULES_STATIC
894
895
896dnl PKG_INSTALLDIR([DIRECTORY])
897dnl -------------------------
898dnl Since: 0.27
899dnl
900dnl Substitutes the variable pkgconfigdir as the location where a module
901dnl should install pkg-config .pc files. By default the directory is
902dnl $libdir/pkgconfig, but the default can be changed by passing
903dnl DIRECTORY. The user can override through the --with-pkgconfigdir
904dnl parameter.
905AC_DEFUN([PKG_INSTALLDIR],
906[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
907m4_pushdef([pkg_description],
908    [pkg-config installation directory @<:@]pkg_default[@:>@])
909AC_ARG_WITH([pkgconfigdir],
910    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
911    [with_pkgconfigdir=]pkg_default)
912AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
913m4_popdef([pkg_default])
914m4_popdef([pkg_description])
915])dnl PKG_INSTALLDIR
916
917
918dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
919dnl --------------------------------
920dnl Since: 0.27
921dnl
922dnl Substitutes the variable noarch_pkgconfigdir as the location where a
923dnl module should install arch-independent pkg-config .pc files. By
924dnl default the directory is $datadir/pkgconfig, but the default can be
925dnl changed by passing DIRECTORY. The user can override through the
926dnl --with-noarch-pkgconfigdir parameter.
927AC_DEFUN([PKG_NOARCH_INSTALLDIR],
928[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
929m4_pushdef([pkg_description],
930    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
931AC_ARG_WITH([noarch-pkgconfigdir],
932    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
933    [with_noarch_pkgconfigdir=]pkg_default)
934AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
935m4_popdef([pkg_default])
936m4_popdef([pkg_description])
937])dnl PKG_NOARCH_INSTALLDIR
938
939
940dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
941dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
942dnl -------------------------------------------
943dnl Since: 0.28
944dnl
945dnl Retrieves the value of the pkg-config variable for the given module.
946AC_DEFUN([PKG_CHECK_VAR],
947[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
948AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
949
950_PKG_CONFIG([$1], [variable="][$3]["], [$2])
951AS_VAR_COPY([$1], [pkg_cv_][$1])
952
953AS_VAR_IF([$1], [""], [$5], [$4])dnl
954])dnl PKG_CHECK_VAR
955
956dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
957dnl   [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
958dnl   [DESCRIPTION], [DEFAULT])
959dnl ------------------------------------------
960dnl
961dnl Prepare a "--with-" configure option using the lowercase
962dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
963dnl PKG_CHECK_MODULES in a single macro.
964AC_DEFUN([PKG_WITH_MODULES],
965[
966m4_pushdef([with_arg], m4_tolower([$1]))
967
968m4_pushdef([description],
969           [m4_default([$5], [build with ]with_arg[ support])])
970
971m4_pushdef([def_arg], [m4_default([$6], [auto])])
972m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
973m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
974
975m4_case(def_arg,
976            [yes],[m4_pushdef([with_without], [--without-]with_arg)],
977            [m4_pushdef([with_without],[--with-]with_arg)])
978
979AC_ARG_WITH(with_arg,
980     AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
981    [AS_TR_SH([with_]with_arg)=def_arg])
982
983AS_CASE([$AS_TR_SH([with_]with_arg)],
984            [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
985            [auto],[PKG_CHECK_MODULES([$1],[$2],
986                                        [m4_n([def_action_if_found]) $3],
987                                        [m4_n([def_action_if_not_found]) $4])])
988
989m4_popdef([with_arg])
990m4_popdef([description])
991m4_popdef([def_arg])
992
993])dnl PKG_WITH_MODULES
994
995dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
996dnl   [DESCRIPTION], [DEFAULT])
997dnl -----------------------------------------------
998dnl
999dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
1000dnl check._[VARIABLE-PREFIX] is exported as make variable.
1001AC_DEFUN([PKG_HAVE_WITH_MODULES],
1002[
1003PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
1004
1005AM_CONDITIONAL([HAVE_][$1],
1006               [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
1007])dnl PKG_HAVE_WITH_MODULES
1008
1009dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
1010dnl   [DESCRIPTION], [DEFAULT])
1011dnl ------------------------------------------------------
1012dnl
1013dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
1014dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
1015dnl and preprocessor variable.
1016AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
1017[
1018PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
1019
1020AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
1021        [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
1022])dnl PKG_HAVE_DEFINE_WITH_MODULES
1023
1024dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1025dnl
1026dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
1027dnl
1028dnl Permission is hereby granted, free of charge, to any person obtaining a
1029dnl copy of this software and associated documentation files (the "Software"),
1030dnl to deal in the Software without restriction, including without limitation
1031dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1032dnl and/or sell copies of the Software, and to permit persons to whom the
1033dnl Software is furnished to do so, subject to the following conditions:
1034dnl
1035dnl The above copyright notice and this permission notice (including the next
1036dnl paragraph) shall be included in all copies or substantial portions of the
1037dnl Software.
1038dnl
1039dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1040dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1041dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1042dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1043dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1044dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1045dnl DEALINGS IN THE SOFTWARE.
1046
1047# XORG_MACROS_VERSION(required-version)
1048# -------------------------------------
1049# Minimum version: 1.1.0
1050#
1051# If you're using a macro added in Version 1.1 or newer, include this in
1052# your configure.ac with the minimum required version, such as:
1053# XORG_MACROS_VERSION(1.1)
1054#
1055# To ensure that this macro is defined, also add:
1056# m4_ifndef([XORG_MACROS_VERSION],
1057#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1058#
1059#
1060# See the "minimum version" comment for each macro you use to see what
1061# version you require.
1062m4_defun([XORG_MACROS_VERSION],[
1063m4_define([vers_have], [1.19.3])
1064m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1065m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1066m4_if(m4_cmp(maj_have, maj_needed), 0,,
1067    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1068m4_if(m4_version_compare(vers_have, [$1]), -1,
1069    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1070m4_undefine([vers_have])
1071m4_undefine([maj_have])
1072m4_undefine([maj_needed])
1073]) # XORG_MACROS_VERSION
1074
1075# XORG_PROG_RAWCPP()
1076# ------------------
1077# Minimum version: 1.0.0
1078#
1079# Find cpp program and necessary flags for use in pre-processing text files
1080# such as man pages and config files
1081AC_DEFUN([XORG_PROG_RAWCPP],[
1082AC_REQUIRE([AC_PROG_CPP])
1083AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
1084   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1085
1086# Check for flag to avoid builtin definitions - assumes unix is predefined,
1087# which is not the best choice for supporting other OS'es, but covers most
1088# of the ones we need for now.
1089AC_MSG_CHECKING([if $RAWCPP requires -undef])
1090AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1091if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1092	AC_MSG_RESULT([no])
1093else
1094	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1095		RAWCPPFLAGS=-undef
1096		AC_MSG_RESULT([yes])
1097	# under Cygwin unix is still defined even with -undef
1098	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1099		RAWCPPFLAGS="-undef -ansi"
1100		AC_MSG_RESULT([yes, with -ansi])
1101	else
1102		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1103	fi
1104fi
1105rm -f conftest.$ac_ext
1106
1107AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1108AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
1109if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1110	AC_MSG_RESULT([no])
1111else
1112	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1113		TRADITIONALCPPFLAGS="-traditional"
1114		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1115		AC_MSG_RESULT([yes])
1116	else
1117		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1118	fi
1119fi
1120rm -f conftest.$ac_ext
1121AC_SUBST(RAWCPPFLAGS)
1122AC_SUBST(TRADITIONALCPPFLAGS)
1123]) # XORG_PROG_RAWCPP
1124
1125# XORG_MANPAGE_SECTIONS()
1126# -----------------------
1127# Minimum version: 1.0.0
1128#
1129# Determine which sections man pages go in for the different man page types
1130# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1131# Not sure if there's any better way than just hardcoding by OS name.
1132# Override default settings by setting environment variables
1133# Added MAN_SUBSTS in version 1.8
1134# Added AC_PROG_SED in version 1.8
1135
1136AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1137AC_REQUIRE([AC_CANONICAL_HOST])
1138AC_REQUIRE([AC_PROG_SED])
1139
1140case $host_os in
1141    solaris*)
1142        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
1143        # check for a man page file found in later versions that use
1144        # traditional section numbers instead
1145        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
1146                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
1147        ;;
1148    *) SYSV_MAN_SECTIONS=false ;;
1149esac
1150
1151if test x$APP_MAN_SUFFIX = x    ; then
1152    APP_MAN_SUFFIX=1
1153fi
1154if test x$APP_MAN_DIR = x    ; then
1155    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1156fi
1157
1158if test x$LIB_MAN_SUFFIX = x    ; then
1159    LIB_MAN_SUFFIX=3
1160fi
1161if test x$LIB_MAN_DIR = x    ; then
1162    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1163fi
1164
1165if test x$FILE_MAN_SUFFIX = x    ; then
1166    case $SYSV_MAN_SECTIONS in
1167	true)				FILE_MAN_SUFFIX=4  ;;
1168	*)				FILE_MAN_SUFFIX=5  ;;
1169    esac
1170fi
1171if test x$FILE_MAN_DIR = x    ; then
1172    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1173fi
1174
1175if test x$MISC_MAN_SUFFIX = x    ; then
1176    case $SYSV_MAN_SECTIONS in
1177	true)				MISC_MAN_SUFFIX=5  ;;
1178	*)				MISC_MAN_SUFFIX=7  ;;
1179    esac
1180fi
1181if test x$MISC_MAN_DIR = x    ; then
1182    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1183fi
1184
1185if test x$DRIVER_MAN_SUFFIX = x    ; then
1186    case $SYSV_MAN_SECTIONS in
1187	true)				DRIVER_MAN_SUFFIX=7  ;;
1188	*)				DRIVER_MAN_SUFFIX=4  ;;
1189    esac
1190fi
1191if test x$DRIVER_MAN_DIR = x    ; then
1192    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1193fi
1194
1195if test x$ADMIN_MAN_SUFFIX = x    ; then
1196    case $SYSV_MAN_SECTIONS in
1197	true)				ADMIN_MAN_SUFFIX=1m ;;
1198	*)				ADMIN_MAN_SUFFIX=8  ;;
1199    esac
1200fi
1201if test x$ADMIN_MAN_DIR = x    ; then
1202    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1203fi
1204
1205
1206AC_SUBST([APP_MAN_SUFFIX])
1207AC_SUBST([LIB_MAN_SUFFIX])
1208AC_SUBST([FILE_MAN_SUFFIX])
1209AC_SUBST([MISC_MAN_SUFFIX])
1210AC_SUBST([DRIVER_MAN_SUFFIX])
1211AC_SUBST([ADMIN_MAN_SUFFIX])
1212AC_SUBST([APP_MAN_DIR])
1213AC_SUBST([LIB_MAN_DIR])
1214AC_SUBST([FILE_MAN_DIR])
1215AC_SUBST([MISC_MAN_DIR])
1216AC_SUBST([DRIVER_MAN_DIR])
1217AC_SUBST([ADMIN_MAN_DIR])
1218
1219XORG_MAN_PAGE="X Version 11"
1220AC_SUBST([XORG_MAN_PAGE])
1221MAN_SUBSTS="\
1222	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1223	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1224	-e 's|__xservername__|Xorg|g' \
1225	-e 's|__xconfigfile__|xorg.conf|g' \
1226	-e 's|__projectroot__|\$(prefix)|g' \
1227	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1228	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1229	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1230	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1231	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1232	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1233	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1234AC_SUBST([MAN_SUBSTS])
1235
1236]) # XORG_MANPAGE_SECTIONS
1237
1238# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1239# ------------------------
1240# Minimum version: 1.7.0
1241#
1242# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1243# provided by xorg-sgml-doctools, if installed.
1244AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1245AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1246XORG_SGML_PATH=
1247PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1248    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1249    [m4_ifval([$1],[:],
1250        [if test x"$cross_compiling" != x"yes" ; then
1251            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1252                          [XORG_SGML_PATH=$prefix/share/sgml])
1253         fi])
1254    ])
1255
1256# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1257# the path and the name of the doc stylesheet
1258if test "x$XORG_SGML_PATH" != "x" ; then
1259   AC_MSG_RESULT([$XORG_SGML_PATH])
1260   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1261   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1262else
1263   AC_MSG_RESULT([no])
1264fi
1265
1266AC_SUBST(XORG_SGML_PATH)
1267AC_SUBST(STYLESHEET_SRCDIR)
1268AC_SUBST(XSL_STYLESHEET)
1269AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1270]) # XORG_CHECK_SGML_DOCTOOLS
1271
1272# XORG_CHECK_LINUXDOC
1273# -------------------
1274# Minimum version: 1.0.0
1275#
1276# Defines the variable MAKE_TEXT if the necessary tools and
1277# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1278# Whether or not the necessary tools and files are found can be checked
1279# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1280AC_DEFUN([XORG_CHECK_LINUXDOC],[
1281AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1282AC_REQUIRE([XORG_WITH_PS2PDF])
1283
1284AC_PATH_PROG(LINUXDOC, linuxdoc)
1285
1286AC_MSG_CHECKING([whether to build documentation])
1287
1288if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1289   BUILDDOC=yes
1290else
1291   BUILDDOC=no
1292fi
1293
1294AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1295
1296AC_MSG_RESULT([$BUILDDOC])
1297
1298AC_MSG_CHECKING([whether to build pdf documentation])
1299
1300if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1301   BUILDPDFDOC=yes
1302else
1303   BUILDPDFDOC=no
1304fi
1305
1306AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1307
1308AC_MSG_RESULT([$BUILDPDFDOC])
1309
1310MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1311MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1312MAKE_PDF="$PS2PDF"
1313MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1314
1315AC_SUBST(MAKE_TEXT)
1316AC_SUBST(MAKE_PS)
1317AC_SUBST(MAKE_PDF)
1318AC_SUBST(MAKE_HTML)
1319]) # XORG_CHECK_LINUXDOC
1320
1321# XORG_CHECK_DOCBOOK
1322# -------------------
1323# Minimum version: 1.0.0
1324#
1325# Checks for the ability to build output formats from SGML DocBook source.
1326# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1327# indicates whether the necessary tools and files are found and, if set,
1328# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1329AC_DEFUN([XORG_CHECK_DOCBOOK],[
1330AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1331
1332BUILDTXTDOC=no
1333BUILDPDFDOC=no
1334BUILDPSDOC=no
1335BUILDHTMLDOC=no
1336
1337AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1338AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1339AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1340AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1341
1342AC_MSG_CHECKING([whether to build text documentation])
1343if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1344   test x$BUILD_TXTDOC != xno; then
1345	BUILDTXTDOC=yes
1346fi
1347AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1348AC_MSG_RESULT([$BUILDTXTDOC])
1349
1350AC_MSG_CHECKING([whether to build PDF documentation])
1351if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1352   test x$BUILD_PDFDOC != xno; then
1353	BUILDPDFDOC=yes
1354fi
1355AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1356AC_MSG_RESULT([$BUILDPDFDOC])
1357
1358AC_MSG_CHECKING([whether to build PostScript documentation])
1359if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1360   test x$BUILD_PSDOC != xno; then
1361	BUILDPSDOC=yes
1362fi
1363AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1364AC_MSG_RESULT([$BUILDPSDOC])
1365
1366AC_MSG_CHECKING([whether to build HTML documentation])
1367if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1368   test x$BUILD_HTMLDOC != xno; then
1369	BUILDHTMLDOC=yes
1370fi
1371AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1372AC_MSG_RESULT([$BUILDHTMLDOC])
1373
1374MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1375MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1376MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1377MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1378
1379AC_SUBST(MAKE_TEXT)
1380AC_SUBST(MAKE_PS)
1381AC_SUBST(MAKE_PDF)
1382AC_SUBST(MAKE_HTML)
1383]) # XORG_CHECK_DOCBOOK
1384
1385# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1386# ----------------
1387# Minimum version: 1.5.0
1388# Minimum version for optional DEFAULT argument: 1.11.0
1389#
1390# Documentation tools are not always available on all platforms and sometimes
1391# not at the appropriate level. This macro enables a module to test for the
1392# presence of the tool and obtain it's path in separate variables. Coupled with
1393# the --with-xmlto option, it allows maximum flexibilty in making decisions
1394# as whether or not to use the xmlto package. When DEFAULT is not specified,
1395# --with-xmlto assumes 'auto'.
1396#
1397# Interface to module:
1398# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1399# XMLTO:	returns the path of the xmlto program found
1400#		returns the path set by the user in the environment
1401# --with-xmlto:	'yes' user instructs the module to use xmlto
1402#		'no' user instructs the module not to use xmlto
1403#
1404# Added in version 1.10.0
1405# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1406#                  xmlto for text output requires either lynx, links, or w3m browsers
1407#
1408# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1409#
1410AC_DEFUN([XORG_WITH_XMLTO],[
1411AC_ARG_VAR([XMLTO], [Path to xmlto command])
1412m4_define([_defopt], m4_default([$2], [auto]))
1413AC_ARG_WITH(xmlto,
1414	AS_HELP_STRING([--with-xmlto],
1415	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1416	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1417m4_undefine([_defopt])
1418
1419if test "x$use_xmlto" = x"auto"; then
1420   AC_PATH_PROG([XMLTO], [xmlto])
1421   if test "x$XMLTO" = "x"; then
1422        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1423	have_xmlto=no
1424   else
1425        have_xmlto=yes
1426   fi
1427elif test "x$use_xmlto" = x"yes" ; then
1428   AC_PATH_PROG([XMLTO], [xmlto])
1429   if test "x$XMLTO" = "x"; then
1430        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1431   fi
1432   have_xmlto=yes
1433elif test "x$use_xmlto" = x"no" ; then
1434   if test "x$XMLTO" != "x"; then
1435      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1436   fi
1437   have_xmlto=no
1438else
1439   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1440fi
1441
1442# Test for a minimum version of xmlto, if provided.
1443m4_ifval([$1],
1444[if test "$have_xmlto" = yes; then
1445    # scrape the xmlto version
1446    AC_MSG_CHECKING([the xmlto version])
1447    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1448    AC_MSG_RESULT([$xmlto_version])
1449    AS_VERSION_COMPARE([$xmlto_version], [$1],
1450        [if test "x$use_xmlto" = xauto; then
1451            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1452            have_xmlto=no
1453        else
1454            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1455        fi])
1456fi])
1457
1458# Test for the ability of xmlto to generate a text target
1459#
1460# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
1461# following test for empty XML docbook files.
1462# For compatibility reasons use the following empty XML docbook file and if
1463# it fails try it again with a non-empty XML file.
1464have_xmlto_text=no
1465cat > conftest.xml << "EOF"
1466EOF
1467AS_IF([test "$have_xmlto" = yes],
1468      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1469             [have_xmlto_text=yes],
1470             [# Try it again with a non-empty XML file.
1471              cat > conftest.xml << "EOF"
1472<x></x>
1473EOF
1474              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1475                    [have_xmlto_text=yes],
1476                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
1477rm -f conftest.xml
1478AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1479AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1480]) # XORG_WITH_XMLTO
1481
1482# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1483# --------------------------------------------
1484# Minimum version: 1.12.0
1485# Minimum version for optional DEFAULT argument: 1.12.0
1486#
1487# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1488# XML-based language used for the transformation of XML documents.
1489# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1490# It is used under the cover by xmlto to generate html files from DocBook/XML.
1491# The XSLT processor is often used as a standalone tool for transformations.
1492# It should not be assumed that this tool is used only to work with documnetation.
1493# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1494#
1495# Interface to module:
1496# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1497# XSLTPROC:	 returns the path of the xsltproc program found
1498#		 returns the path set by the user in the environment
1499# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1500#		  'no' user instructs the module not to use xsltproc
1501# have_xsltproc: returns yes if xsltproc found in PATH or no
1502#
1503# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1504#
1505AC_DEFUN([XORG_WITH_XSLTPROC],[
1506AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1507# Preserves the interface, should it be implemented later
1508m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1509m4_define([_defopt], m4_default([$2], [auto]))
1510AC_ARG_WITH(xsltproc,
1511	AS_HELP_STRING([--with-xsltproc],
1512	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1513	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1514m4_undefine([_defopt])
1515
1516if test "x$use_xsltproc" = x"auto"; then
1517   AC_PATH_PROG([XSLTPROC], [xsltproc])
1518   if test "x$XSLTPROC" = "x"; then
1519        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1520	have_xsltproc=no
1521   else
1522        have_xsltproc=yes
1523   fi
1524elif test "x$use_xsltproc" = x"yes" ; then
1525   AC_PATH_PROG([XSLTPROC], [xsltproc])
1526   if test "x$XSLTPROC" = "x"; then
1527        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1528   fi
1529   have_xsltproc=yes
1530elif test "x$use_xsltproc" = x"no" ; then
1531   if test "x$XSLTPROC" != "x"; then
1532      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1533   fi
1534   have_xsltproc=no
1535else
1536   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1537fi
1538
1539AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1540]) # XORG_WITH_XSLTPROC
1541
1542# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1543# ----------------------------------------
1544# Minimum version: 1.15.0
1545#
1546# PERL (Practical Extraction and Report Language) is a language optimized for
1547# scanning arbitrary text files, extracting information from those text files,
1548# and printing reports based on that information.
1549#
1550# When DEFAULT is not specified, --with-perl assumes 'auto'.
1551#
1552# Interface to module:
1553# HAVE_PERL: used in makefiles to conditionally scan text files
1554# PERL:	     returns the path of the perl program found
1555#	     returns the path set by the user in the environment
1556# --with-perl: 'yes' user instructs the module to use perl
1557#	       'no' user instructs the module not to use perl
1558# have_perl: returns yes if perl found in PATH or no
1559#
1560# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1561#
1562AC_DEFUN([XORG_WITH_PERL],[
1563AC_ARG_VAR([PERL], [Path to perl command])
1564# Preserves the interface, should it be implemented later
1565m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1566m4_define([_defopt], m4_default([$2], [auto]))
1567AC_ARG_WITH(perl,
1568	AS_HELP_STRING([--with-perl],
1569	   [Use perl for extracting information from files (default: ]_defopt[)]),
1570	   [use_perl=$withval], [use_perl=]_defopt)
1571m4_undefine([_defopt])
1572
1573if test "x$use_perl" = x"auto"; then
1574   AC_PATH_PROG([PERL], [perl])
1575   if test "x$PERL" = "x"; then
1576        AC_MSG_WARN([perl not found - cannot extract information and report])
1577	have_perl=no
1578   else
1579        have_perl=yes
1580   fi
1581elif test "x$use_perl" = x"yes" ; then
1582   AC_PATH_PROG([PERL], [perl])
1583   if test "x$PERL" = "x"; then
1584        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1585   fi
1586   have_perl=yes
1587elif test "x$use_perl" = x"no" ; then
1588   if test "x$PERL" != "x"; then
1589      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1590   fi
1591   have_perl=no
1592else
1593   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1594fi
1595
1596AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1597]) # XORG_WITH_PERL
1598
1599# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1600# ----------------
1601# Minimum version: 1.5.0
1602# Minimum version for optional DEFAULT argument: 1.11.0
1603#
1604# Documentation tools are not always available on all platforms and sometimes
1605# not at the appropriate level. This macro enables a module to test for the
1606# presence of the tool and obtain it's path in separate variables. Coupled with
1607# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1608# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1609# --with-asciidoc assumes 'auto'.
1610#
1611# Interface to module:
1612# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1613# ASCIIDOC:	 returns the path of the asciidoc program found
1614#		 returns the path set by the user in the environment
1615# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1616#		  'no' user instructs the module not to use asciidoc
1617#
1618# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1619#
1620AC_DEFUN([XORG_WITH_ASCIIDOC],[
1621AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1622m4_define([_defopt], m4_default([$2], [auto]))
1623AC_ARG_WITH(asciidoc,
1624	AS_HELP_STRING([--with-asciidoc],
1625	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1626	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1627m4_undefine([_defopt])
1628
1629if test "x$use_asciidoc" = x"auto"; then
1630   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1631   if test "x$ASCIIDOC" = "x"; then
1632        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1633	have_asciidoc=no
1634   else
1635        have_asciidoc=yes
1636   fi
1637elif test "x$use_asciidoc" = x"yes" ; then
1638   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1639   if test "x$ASCIIDOC" = "x"; then
1640        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1641   fi
1642   have_asciidoc=yes
1643elif test "x$use_asciidoc" = x"no" ; then
1644   if test "x$ASCIIDOC" != "x"; then
1645      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1646   fi
1647   have_asciidoc=no
1648else
1649   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1650fi
1651m4_ifval([$1],
1652[if test "$have_asciidoc" = yes; then
1653    # scrape the asciidoc version
1654    AC_MSG_CHECKING([the asciidoc version])
1655    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1656    AC_MSG_RESULT([$asciidoc_version])
1657    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1658        [if test "x$use_asciidoc" = xauto; then
1659            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1660            have_asciidoc=no
1661        else
1662            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1663        fi])
1664fi])
1665AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1666]) # XORG_WITH_ASCIIDOC
1667
1668# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1669# -------------------------------------------
1670# Minimum version: 1.5.0
1671# Minimum version for optional DEFAULT argument: 1.11.0
1672# Minimum version for optional DOT checking: 1.18.0
1673#
1674# Documentation tools are not always available on all platforms and sometimes
1675# not at the appropriate level. This macro enables a module to test for the
1676# presence of the tool and obtain it's path in separate variables. Coupled with
1677# the --with-doxygen option, it allows maximum flexibilty in making decisions
1678# as whether or not to use the doxygen package. When DEFAULT is not specified,
1679# --with-doxygen assumes 'auto'.
1680#
1681# Interface to module:
1682# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1683# DOXYGEN:	 returns the path of the doxygen program found
1684#		 returns the path set by the user in the environment
1685# --with-doxygen: 'yes' user instructs the module to use doxygen
1686#		  'no' user instructs the module not to use doxygen
1687#
1688# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1689#
1690AC_DEFUN([XORG_WITH_DOXYGEN],[
1691AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1692AC_ARG_VAR([DOT], [Path to the dot graphics utility])
1693m4_define([_defopt], m4_default([$2], [auto]))
1694AC_ARG_WITH(doxygen,
1695	AS_HELP_STRING([--with-doxygen],
1696	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1697	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1698m4_undefine([_defopt])
1699
1700if test "x$use_doxygen" = x"auto"; then
1701   AC_PATH_PROG([DOXYGEN], [doxygen])
1702   if test "x$DOXYGEN" = "x"; then
1703        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1704	have_doxygen=no
1705   else
1706        have_doxygen=yes
1707   fi
1708elif test "x$use_doxygen" = x"yes" ; then
1709   AC_PATH_PROG([DOXYGEN], [doxygen])
1710   if test "x$DOXYGEN" = "x"; then
1711        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1712   fi
1713   have_doxygen=yes
1714elif test "x$use_doxygen" = x"no" ; then
1715   if test "x$DOXYGEN" != "x"; then
1716      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1717   fi
1718   have_doxygen=no
1719else
1720   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1721fi
1722m4_ifval([$1],
1723[if test "$have_doxygen" = yes; then
1724    # scrape the doxygen version
1725    AC_MSG_CHECKING([the doxygen version])
1726    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1727    AC_MSG_RESULT([$doxygen_version])
1728    AS_VERSION_COMPARE([$doxygen_version], [$1],
1729        [if test "x$use_doxygen" = xauto; then
1730            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1731            have_doxygen=no
1732        else
1733            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1734        fi])
1735fi])
1736
1737dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1738dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1739dnl 	HAVE_DOT = @HAVE_DOT@
1740HAVE_DOT=no
1741if test "x$have_doxygen" = "xyes"; then
1742  AC_PATH_PROG([DOT], [dot])
1743    if test "x$DOT" != "x"; then
1744      HAVE_DOT=yes
1745    fi
1746fi
1747
1748AC_SUBST([HAVE_DOT])
1749AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1750AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1751]) # XORG_WITH_DOXYGEN
1752
1753# XORG_WITH_GROFF([DEFAULT])
1754# ----------------
1755# Minimum version: 1.6.0
1756# Minimum version for optional DEFAULT argument: 1.11.0
1757#
1758# Documentation tools are not always available on all platforms and sometimes
1759# not at the appropriate level. This macro enables a module to test for the
1760# presence of the tool and obtain it's path in separate variables. Coupled with
1761# the --with-groff option, it allows maximum flexibilty in making decisions
1762# as whether or not to use the groff package. When DEFAULT is not specified,
1763# --with-groff assumes 'auto'.
1764#
1765# Interface to module:
1766# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1767# HAVE_GROFF_MM: the memorandum macros (-mm) package
1768# HAVE_GROFF_MS: the -ms macros package
1769# GROFF:	 returns the path of the groff program found
1770#		 returns the path set by the user in the environment
1771# --with-groff:	 'yes' user instructs the module to use groff
1772#		 'no' user instructs the module not to use groff
1773#
1774# Added in version 1.9.0:
1775# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1776#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1777#		   psselect from the psutils package.
1778#		   the ghostcript package. Refer to the grohtml man pages
1779#
1780# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1781#
1782# OS and distros often splits groff in a basic and full package, the former
1783# having the groff program and the later having devices, fonts and macros
1784# Checking for the groff executable is not enough.
1785#
1786# If macros are missing, we cannot assume that groff is useless, so we don't
1787# unset HAVE_GROFF or GROFF env variables.
1788# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1789#
1790AC_DEFUN([XORG_WITH_GROFF],[
1791AC_ARG_VAR([GROFF], [Path to groff command])
1792m4_define([_defopt], m4_default([$1], [auto]))
1793AC_ARG_WITH(groff,
1794	AS_HELP_STRING([--with-groff],
1795	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1796	   [use_groff=$withval], [use_groff=]_defopt)
1797m4_undefine([_defopt])
1798
1799if test "x$use_groff" = x"auto"; then
1800   AC_PATH_PROG([GROFF], [groff])
1801   if test "x$GROFF" = "x"; then
1802        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1803	have_groff=no
1804   else
1805        have_groff=yes
1806   fi
1807elif test "x$use_groff" = x"yes" ; then
1808   AC_PATH_PROG([GROFF], [groff])
1809   if test "x$GROFF" = "x"; then
1810        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1811   fi
1812   have_groff=yes
1813elif test "x$use_groff" = x"no" ; then
1814   if test "x$GROFF" != "x"; then
1815      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1816   fi
1817   have_groff=no
1818else
1819   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1820fi
1821
1822# We have groff, test for the presence of the macro packages
1823if test "x$have_groff" = x"yes"; then
1824    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1825    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1826        groff_ms_works=yes
1827    else
1828        groff_ms_works=no
1829    fi
1830    AC_MSG_RESULT([$groff_ms_works])
1831    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1832    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1833        groff_mm_works=yes
1834    else
1835        groff_mm_works=no
1836    fi
1837    AC_MSG_RESULT([$groff_mm_works])
1838fi
1839
1840# We have groff, test for HTML dependencies, one command per package
1841if test "x$have_groff" = x"yes"; then
1842   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1843   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1844   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1845   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1846      have_groff_html=yes
1847   else
1848      have_groff_html=no
1849      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1850   fi
1851fi
1852
1853# Set Automake conditionals for Makefiles
1854AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1855AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1856AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1857AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1858]) # XORG_WITH_GROFF
1859
1860# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1861# ---------------------------------------
1862# Minimum version: 1.6.0
1863# Minimum version for optional DEFAULT argument: 1.11.0
1864# Minimum version for optional MIN-VERSION argument: 1.15.0
1865#
1866# Documentation tools are not always available on all platforms and sometimes
1867# not at the appropriate level. This macro enables a module to test for the
1868# presence of the tool and obtain it's path in separate variables. Coupled with
1869# the --with-fop option, it allows maximum flexibilty in making decisions
1870# as whether or not to use the fop package. When DEFAULT is not specified,
1871# --with-fop assumes 'auto'.
1872#
1873# Interface to module:
1874# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1875# FOP:	 	returns the path of the fop program found
1876#		returns the path set by the user in the environment
1877# --with-fop: 	'yes' user instructs the module to use fop
1878#		'no' user instructs the module not to use fop
1879#
1880# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1881#
1882AC_DEFUN([XORG_WITH_FOP],[
1883AC_ARG_VAR([FOP], [Path to fop command])
1884m4_define([_defopt], m4_default([$2], [auto]))
1885AC_ARG_WITH(fop,
1886	AS_HELP_STRING([--with-fop],
1887	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1888	   [use_fop=$withval], [use_fop=]_defopt)
1889m4_undefine([_defopt])
1890
1891if test "x$use_fop" = x"auto"; then
1892   AC_PATH_PROG([FOP], [fop])
1893   if test "x$FOP" = "x"; then
1894        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1895	have_fop=no
1896   else
1897        have_fop=yes
1898   fi
1899elif test "x$use_fop" = x"yes" ; then
1900   AC_PATH_PROG([FOP], [fop])
1901   if test "x$FOP" = "x"; then
1902        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1903   fi
1904   have_fop=yes
1905elif test "x$use_fop" = x"no" ; then
1906   if test "x$FOP" != "x"; then
1907      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1908   fi
1909   have_fop=no
1910else
1911   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1912fi
1913
1914# Test for a minimum version of fop, if provided.
1915m4_ifval([$1],
1916[if test "$have_fop" = yes; then
1917    # scrape the fop version
1918    AC_MSG_CHECKING([for fop minimum version])
1919    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1920    AC_MSG_RESULT([$fop_version])
1921    AS_VERSION_COMPARE([$fop_version], [$1],
1922        [if test "x$use_fop" = xauto; then
1923            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1924            have_fop=no
1925        else
1926            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1927        fi])
1928fi])
1929AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1930]) # XORG_WITH_FOP
1931
1932# XORG_WITH_M4([MIN-VERSION])
1933# ---------------------------
1934# Minimum version: 1.19.0
1935#
1936# This macro attempts to locate an m4 macro processor which supports
1937# -I option and is only useful for modules relying on M4 in order to
1938# expand macros in source code files.
1939#
1940# Interface to module:
1941# M4:	 	returns the path of the m4 program found
1942#		returns the path set by the user in the environment
1943#
1944AC_DEFUN([XORG_WITH_M4], [
1945AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1946   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1947       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1948         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1949   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1950   [$PATH:/usr/gnu/bin])])
1951
1952AC_SUBST([M4], [$ac_cv_path_M4])
1953]) # XORG_WITH_M4
1954
1955# XORG_WITH_PS2PDF([DEFAULT])
1956# ----------------
1957# Minimum version: 1.6.0
1958# Minimum version for optional DEFAULT argument: 1.11.0
1959#
1960# Documentation tools are not always available on all platforms and sometimes
1961# not at the appropriate level. This macro enables a module to test for the
1962# presence of the tool and obtain it's path in separate variables. Coupled with
1963# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1964# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1965# --with-ps2pdf assumes 'auto'.
1966#
1967# Interface to module:
1968# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1969# PS2PDF:	returns the path of the ps2pdf program found
1970#		returns the path set by the user in the environment
1971# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1972#		 'no' user instructs the module not to use ps2pdf
1973#
1974# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1975#
1976AC_DEFUN([XORG_WITH_PS2PDF],[
1977AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1978m4_define([_defopt], m4_default([$1], [auto]))
1979AC_ARG_WITH(ps2pdf,
1980	AS_HELP_STRING([--with-ps2pdf],
1981	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1982	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1983m4_undefine([_defopt])
1984
1985if test "x$use_ps2pdf" = x"auto"; then
1986   AC_PATH_PROG([PS2PDF], [ps2pdf])
1987   if test "x$PS2PDF" = "x"; then
1988        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1989	have_ps2pdf=no
1990   else
1991        have_ps2pdf=yes
1992   fi
1993elif test "x$use_ps2pdf" = x"yes" ; then
1994   AC_PATH_PROG([PS2PDF], [ps2pdf])
1995   if test "x$PS2PDF" = "x"; then
1996        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1997   fi
1998   have_ps2pdf=yes
1999elif test "x$use_ps2pdf" = x"no" ; then
2000   if test "x$PS2PDF" != "x"; then
2001      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2002   fi
2003   have_ps2pdf=no
2004else
2005   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2006fi
2007AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2008]) # XORG_WITH_PS2PDF
2009
2010# XORG_ENABLE_DOCS (enable_docs=yes)
2011# ----------------
2012# Minimum version: 1.6.0
2013#
2014# Documentation tools are not always available on all platforms and sometimes
2015# not at the appropriate level. This macro enables a builder to skip all
2016# documentation targets except traditional man pages.
2017# Combined with the specific tool checking macros XORG_WITH_*, it provides
2018# maximum flexibilty in controlling documentation building.
2019# Refer to:
2020# XORG_WITH_XMLTO         --with-xmlto
2021# XORG_WITH_ASCIIDOC      --with-asciidoc
2022# XORG_WITH_DOXYGEN       --with-doxygen
2023# XORG_WITH_FOP           --with-fop
2024# XORG_WITH_GROFF         --with-groff
2025# XORG_WITH_PS2PDF        --with-ps2pdf
2026#
2027# Interface to module:
2028# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
2029# --enable-docs: 'yes' user instructs the module to generate docs
2030#		 'no' user instructs the module not to generate docs
2031# parm1:	specify the default value, yes or no.
2032#
2033AC_DEFUN([XORG_ENABLE_DOCS],[
2034m4_define([docs_default], m4_default([$1], [yes]))
2035AC_ARG_ENABLE(docs,
2036	AS_HELP_STRING([--enable-docs],
2037	   [Enable building the documentation (default: ]docs_default[)]),
2038	   [build_docs=$enableval], [build_docs=]docs_default)
2039m4_undefine([docs_default])
2040AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2041AC_MSG_CHECKING([whether to build documentation])
2042AC_MSG_RESULT([$build_docs])
2043]) # XORG_ENABLE_DOCS
2044
2045# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2046# ----------------
2047# Minimum version: 1.6.0
2048#
2049# This macro enables a builder to skip all developer documentation.
2050# Combined with the specific tool checking macros XORG_WITH_*, it provides
2051# maximum flexibilty in controlling documentation building.
2052# Refer to:
2053# XORG_WITH_XMLTO         --with-xmlto
2054# XORG_WITH_ASCIIDOC      --with-asciidoc
2055# XORG_WITH_DOXYGEN       --with-doxygen
2056# XORG_WITH_FOP           --with-fop
2057# XORG_WITH_GROFF         --with-groff
2058# XORG_WITH_PS2PDF        --with-ps2pdf
2059#
2060# Interface to module:
2061# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
2062# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
2063#			'no' user instructs the module not to generate developer docs
2064# parm1:		specify the default value, yes or no.
2065#
2066AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2067m4_define([devel_default], m4_default([$1], [yes]))
2068AC_ARG_ENABLE(devel-docs,
2069	AS_HELP_STRING([--enable-devel-docs],
2070	   [Enable building the developer documentation (default: ]devel_default[)]),
2071	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2072m4_undefine([devel_default])
2073AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2074AC_MSG_CHECKING([whether to build developer documentation])
2075AC_MSG_RESULT([$build_devel_docs])
2076]) # XORG_ENABLE_DEVEL_DOCS
2077
2078# XORG_ENABLE_SPECS (enable_specs=yes)
2079# ----------------
2080# Minimum version: 1.6.0
2081#
2082# This macro enables a builder to skip all functional specification targets.
2083# Combined with the specific tool checking macros XORG_WITH_*, it provides
2084# maximum flexibilty in controlling documentation building.
2085# Refer to:
2086# XORG_WITH_XMLTO         --with-xmlto
2087# XORG_WITH_ASCIIDOC      --with-asciidoc
2088# XORG_WITH_DOXYGEN       --with-doxygen
2089# XORG_WITH_FOP           --with-fop
2090# XORG_WITH_GROFF         --with-groff
2091# XORG_WITH_PS2PDF        --with-ps2pdf
2092#
2093# Interface to module:
2094# ENABLE_SPECS:		used in makefiles to conditionally generate specs
2095# --enable-specs:	'yes' user instructs the module to generate specs
2096#			'no' user instructs the module not to generate specs
2097# parm1:		specify the default value, yes or no.
2098#
2099AC_DEFUN([XORG_ENABLE_SPECS],[
2100m4_define([spec_default], m4_default([$1], [yes]))
2101AC_ARG_ENABLE(specs,
2102	AS_HELP_STRING([--enable-specs],
2103	   [Enable building the specs (default: ]spec_default[)]),
2104	   [build_specs=$enableval], [build_specs=]spec_default)
2105m4_undefine([spec_default])
2106AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2107AC_MSG_CHECKING([whether to build functional specifications])
2108AC_MSG_RESULT([$build_specs])
2109]) # XORG_ENABLE_SPECS
2110
2111# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2112# ----------------------------------------------
2113# Minimum version: 1.13.0
2114#
2115# This macro enables a builder to enable/disable unit testing
2116# It makes no assumption about the test cases implementation
2117# Test cases may or may not use Automake "Support for test suites"
2118# They may or may not use the software utility library GLib
2119#
2120# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2121# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2122# The variable enable_unit_tests is used by other macros in this file.
2123#
2124# Interface to module:
2125# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2126# enable_unit_tests:    used in configure.ac for additional configuration
2127# --enable-unit-tests:	'yes' user instructs the module to build tests
2128#			'no' user instructs the module not to build tests
2129# parm1:		specify the default value, yes or no.
2130#
2131AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2132AC_BEFORE([$0], [XORG_WITH_GLIB])
2133AC_BEFORE([$0], [XORG_LD_WRAP])
2134AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2135m4_define([_defopt], m4_default([$1], [auto]))
2136AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2137	[Enable building unit test cases (default: ]_defopt[)]),
2138	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2139m4_undefine([_defopt])
2140AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2141AC_MSG_CHECKING([whether to build unit test cases])
2142AC_MSG_RESULT([$enable_unit_tests])
2143]) # XORG_ENABLE_UNIT_TESTS
2144
2145# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2146# ------------------------------------------------------
2147# Minimum version: 1.17.0
2148#
2149# This macro enables a builder to enable/disable integration testing
2150# It makes no assumption about the test cases' implementation
2151# Test cases may or may not use Automake "Support for test suites"
2152#
2153# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2154# usually requires less dependencies and may be built and run under less
2155# stringent environments than integration tests.
2156#
2157# Interface to module:
2158# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
2159# enable_integration_tests:   used in configure.ac for additional configuration
2160# --enable-integration-tests: 'yes' user instructs the module to build tests
2161#                             'no' user instructs the module not to build tests
2162# parm1:                      specify the default value, yes or no.
2163#
2164AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2165AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2166m4_define([_defopt], m4_default([$1], [auto]))
2167AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2168	[Enable building integration test cases (default: ]_defopt[)]),
2169	[enable_integration_tests=$enableval],
2170	[enable_integration_tests=]_defopt)
2171m4_undefine([_defopt])
2172AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2173	[test "x$enable_integration_tests" != xno])
2174AC_MSG_CHECKING([whether to build unit test cases])
2175AC_MSG_RESULT([$enable_integration_tests])
2176]) # XORG_ENABLE_INTEGRATION_TESTS
2177
2178# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2179# ----------------------------------------
2180# Minimum version: 1.13.0
2181#
2182# GLib is a library which provides advanced data structures and functions.
2183# This macro enables a module to test for the presence of Glib.
2184#
2185# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2186# Otherwise the value of $enable_unit_tests is blank.
2187#
2188# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2189# test support usually requires less dependencies and may be built and run under
2190# less stringent environments than integration tests.
2191#
2192# Interface to module:
2193# HAVE_GLIB: used in makefiles to conditionally build targets
2194# with_glib: used in configure.ac to know if GLib has been found
2195# --with-glib:	'yes' user instructs the module to use glib
2196#		'no' user instructs the module not to use glib
2197#
2198AC_DEFUN([XORG_WITH_GLIB],[
2199AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2200m4_define([_defopt], m4_default([$2], [auto]))
2201AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2202	[Use GLib library for unit testing (default: ]_defopt[)]),
2203	[with_glib=$withval], [with_glib=]_defopt)
2204m4_undefine([_defopt])
2205
2206have_glib=no
2207# Do not probe GLib if user explicitly disabled unit testing
2208if test "x$enable_unit_tests" != x"no"; then
2209  # Do not probe GLib if user explicitly disabled it
2210  if test "x$with_glib" != x"no"; then
2211    m4_ifval(
2212      [$1],
2213      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2214      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2215    )
2216  fi
2217fi
2218
2219# Not having GLib when unit testing has been explicitly requested is an error
2220if test "x$enable_unit_tests" = x"yes"; then
2221  if test "x$have_glib" = x"no"; then
2222    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2223  fi
2224fi
2225
2226# Having unit testing disabled when GLib has been explicitly requested is an error
2227if test "x$enable_unit_tests" = x"no"; then
2228  if test "x$with_glib" = x"yes"; then
2229    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2230  fi
2231fi
2232
2233# Not having GLib when it has been explicitly requested is an error
2234if test "x$with_glib" = x"yes"; then
2235  if test "x$have_glib" = x"no"; then
2236    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2237  fi
2238fi
2239
2240AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2241]) # XORG_WITH_GLIB
2242
2243# XORG_LD_WRAP([required|optional])
2244# ---------------------------------
2245# Minimum version: 1.13.0
2246#
2247# Check if linker supports -wrap, passed via compiler flags
2248#
2249# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2250# Otherwise the value of $enable_unit_tests is blank.
2251#
2252# Argument added in 1.16.0 - default is "required", to match existing behavior
2253# of returning an error if enable_unit_tests is yes, and ld -wrap is not
2254# available, an argument of "optional" allows use when some unit tests require
2255# ld -wrap and others do not.
2256#
2257AC_DEFUN([XORG_LD_WRAP],[
2258XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2259    [AC_LANG_PROGRAM([#include <stdlib.h>
2260                      void __wrap_exit(int status) { return; }],
2261                     [exit(0);])])
2262# Not having ld wrap when unit testing has been explicitly requested is an error
2263if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2264  if test "x$have_ld_wrap" = x"no"; then
2265    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2266  fi
2267fi
2268AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2269#
2270]) # XORG_LD_WRAP
2271
2272# XORG_CHECK_LINKER_FLAGS
2273# -----------------------
2274# SYNOPSIS
2275#
2276#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2277#
2278# DESCRIPTION
2279#
2280#   Check whether the given linker FLAGS work with the current language's
2281#   linker, or whether they give an error.
2282#
2283#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2284#   success/failure.
2285#
2286#   PROGRAM-SOURCE is the program source to link with, if needed
2287#
2288#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2289#
2290# LICENSE
2291#
2292#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2293#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2294#   Copyright (c) 2009 Matteo Frigo
2295#
2296#   This program is free software: you can redistribute it and/or modify it
2297#   under the terms of the GNU General Public License as published by the
2298#   Free Software Foundation, either version 3 of the License, or (at your
2299#   option) any later version.
2300#
2301#   This program is distributed in the hope that it will be useful, but
2302#   WITHOUT ANY WARRANTY; without even the implied warranty of
2303#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2304#   Public License for more details.
2305#
2306#   You should have received a copy of the GNU General Public License along
2307#   with this program. If not, see <http://www.gnu.org/licenses/>.
2308#
2309#   As a special exception, the respective Autoconf Macro's copyright owner
2310#   gives unlimited permission to copy, distribute and modify the configure
2311#   scripts that are the output of Autoconf when processing the Macro. You
2312#   need not follow the terms of the GNU General Public License when using
2313#   or distributing such scripts, even though portions of the text of the
2314#   Macro appear in them. The GNU General Public License (GPL) does govern
2315#   all other use of the material that constitutes the Autoconf Macro.
2316#
2317#   This special exception to the GPL applies to versions of the Autoconf
2318#   Macro released by the Autoconf Archive. When you make and distribute a
2319#   modified version of the Autoconf Macro, you may extend this special
2320#   exception to the GPL to apply to your modified version as well.#
2321AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2322[AC_MSG_CHECKING([whether the linker accepts $1])
2323dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2324AS_LITERAL_IF([$1],
2325  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2326      ax_save_FLAGS=$LDFLAGS
2327      LDFLAGS="$1"
2328      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2329        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2330        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2331      LDFLAGS=$ax_save_FLAGS])],
2332  [ax_save_FLAGS=$LDFLAGS
2333   LDFLAGS="$1"
2334   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2335     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2336     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2337   LDFLAGS=$ax_save_FLAGS])
2338eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2339AC_MSG_RESULT($xorg_check_linker_flags)
2340if test "x$xorg_check_linker_flags" = xyes; then
2341	m4_default([$2], :)
2342else
2343	m4_default([$3], :)
2344fi
2345]) # XORG_CHECK_LINKER_FLAGS
2346
2347# XORG_MEMORY_CHECK_FLAGS
2348# -----------------------
2349# Minimum version: 1.16.0
2350#
2351# This macro attempts to find appropriate memory checking functionality
2352# for various platforms which unit testing code may use to catch various
2353# forms of memory allocation and access errors in testing.
2354#
2355# Interface to module:
2356# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2357#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
2358#
2359# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2360#
2361AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
2362
2363AC_REQUIRE([AC_CANONICAL_HOST])
2364AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2365           [Environment variables to enable memory checking in tests])
2366
2367# Check for different types of support on different platforms
2368case $host_os in
2369    solaris*)
2370        AC_CHECK_LIB([umem], [umem_alloc],
2371            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2372        ;;
2373    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2374        # both directly and inverted, so should not be 0 or 255.
2375        malloc_debug_env='MALLOC_PERTURB_=15'
2376        ;;
2377    darwin*)
2378        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2379        ;;
2380    *bsd*)
2381        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2382        ;;
2383esac
2384
2385# User supplied flags override default flags
2386if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2387    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2388fi
2389
2390AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2391]) # XORG_WITH_LINT
2392
2393# XORG_CHECK_MALLOC_ZERO
2394# ----------------------
2395# Minimum version: 1.0.0
2396#
2397# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2398# malloc(0) returns NULL.  Packages should add one of these cflags to
2399# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2400AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2401AC_ARG_ENABLE(malloc0returnsnull,
2402	AS_HELP_STRING([--enable-malloc0returnsnull],
2403		       [malloc(0) returns NULL (default: auto)]),
2404	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2405	[MALLOC_ZERO_RETURNS_NULL=auto])
2406
2407AC_MSG_CHECKING([whether malloc(0) returns NULL])
2408if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2409AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
2410	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
2411#include <stdlib.h>
2412],[
2413    char *m0, *r0, *c0, *p;
2414    m0 = malloc(0);
2415    p = malloc(10);
2416    r0 = realloc(p,0);
2417    c0 = calloc(0,10);
2418    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2419])],
2420		[xorg_cv_malloc0_returns_null=yes],
2421		[xorg_cv_malloc0_returns_null=no])])
2422MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2423fi
2424AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2425
2426if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2427	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2428	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2429	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2430else
2431	MALLOC_ZERO_CFLAGS=""
2432	XMALLOC_ZERO_CFLAGS=""
2433	XTMALLOC_ZERO_CFLAGS=""
2434fi
2435
2436AC_SUBST([MALLOC_ZERO_CFLAGS])
2437AC_SUBST([XMALLOC_ZERO_CFLAGS])
2438AC_SUBST([XTMALLOC_ZERO_CFLAGS])
2439]) # XORG_CHECK_MALLOC_ZERO
2440
2441# XORG_WITH_LINT()
2442# ----------------
2443# Minimum version: 1.1.0
2444#
2445# This macro enables the use of a tool that flags some suspicious and
2446# non-portable constructs (likely to be bugs) in C language source code.
2447# It will attempt to locate the tool and use appropriate options.
2448# There are various lint type tools on different platforms.
2449#
2450# Interface to module:
2451# LINT:		returns the path to the tool found on the platform
2452#		or the value set to LINT on the configure cmd line
2453#		also an Automake conditional
2454# LINT_FLAGS:	an Automake variable with appropriate flags
2455#
2456# --with-lint:	'yes' user instructs the module to use lint
2457#		'no' user instructs the module not to use lint (default)
2458#
2459# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2460# If the user sets the value of LINT_FLAGS, they are used verbatim.
2461#
2462AC_DEFUN([XORG_WITH_LINT],[
2463
2464AC_ARG_VAR([LINT], [Path to a lint-style command])
2465AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2466AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2467		[Use a lint-style source code checker (default: disabled)])],
2468		[use_lint=$withval], [use_lint=no])
2469
2470# Obtain platform specific info like program name and options
2471# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2472case $host_os in
2473  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2474	lint_name=splint
2475	lint_options="-badflag"
2476	;;
2477  *freebsd* | *netbsd*)
2478	lint_name=lint
2479	lint_options="-u -b"
2480	;;
2481  *solaris*)
2482	lint_name=lint
2483	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2484	;;
2485esac
2486
2487# Test for the presence of the program (either guessed by the code or spelled out by the user)
2488if test "x$use_lint" = x"yes" ; then
2489   AC_PATH_PROG([LINT], [$lint_name])
2490   if test "x$LINT" = "x"; then
2491        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2492   fi
2493elif test "x$use_lint" = x"no" ; then
2494   if test "x$LINT" != "x"; then
2495      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2496   fi
2497else
2498   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2499fi
2500
2501# User supplied flags override default flags
2502if test "x$LINT_FLAGS" != "x"; then
2503   lint_options=$LINT_FLAGS
2504fi
2505
2506AC_SUBST([LINT_FLAGS],[$lint_options])
2507AM_CONDITIONAL(LINT, [test "x$LINT" != x])
2508
2509]) # XORG_WITH_LINT
2510
2511# XORG_LINT_LIBRARY(LIBNAME)
2512# --------------------------
2513# Minimum version: 1.1.0
2514#
2515# Sets up flags for building lint libraries for checking programs that call
2516# functions in the library.
2517#
2518# Interface to module:
2519# LINTLIB		- Automake variable with the name of lint library file to make
2520# MAKE_LINT_LIB		- Automake conditional
2521#
2522# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2523#			  - 'no' user instructs the module not to create a lint library (default)
2524
2525AC_DEFUN([XORG_LINT_LIBRARY],[
2526AC_REQUIRE([XORG_WITH_LINT])
2527AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2528	[Create lint library (default: disabled)])],
2529	[make_lint_lib=$enableval], [make_lint_lib=no])
2530
2531if test "x$make_lint_lib" = x"yes" ; then
2532   LINTLIB=llib-l$1.ln
2533   if test "x$LINT" = "x"; then
2534        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2535   fi
2536elif test "x$make_lint_lib" != x"no" ; then
2537   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2538fi
2539
2540AC_SUBST(LINTLIB)
2541AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2542
2543]) # XORG_LINT_LIBRARY
2544
2545# XORG_COMPILER_BRAND
2546# -------------------
2547# Minimum version: 1.14.0
2548#
2549# Checks for various brands of compilers and sets flags as appropriate:
2550#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2551#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2552#   clang compiler - sets CLANGCC to "yes"
2553#   Intel compiler - sets INTELCC to "yes"
2554#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2555#
2556AC_DEFUN([XORG_COMPILER_BRAND], [
2557AC_LANG_CASE(
2558	[C], [
2559		AC_REQUIRE([AC_PROG_CC_C99])
2560	],
2561	[C++], [
2562		AC_REQUIRE([AC_PROG_CXX])
2563	]
2564)
2565AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2566AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2567AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2568]) # XORG_COMPILER_BRAND
2569
2570# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
2571# ---------------
2572# Minimum version: 1.16.0
2573#
2574# Test if the compiler works when passed the given flag as a command line argument.
2575# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
2576# next flag in the list until there are no more options.
2577#
2578# Note that this does not guarantee that the compiler supports the flag as some
2579# compilers will simply ignore arguments that they do not understand, but we do
2580# attempt to weed out false positives by using -Werror=unknown-warning-option and
2581# -Werror=unused-command-line-argument
2582#
2583AC_DEFUN([XORG_TESTSET_CFLAG], [
2584m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2585m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2586
2587AC_LANG_COMPILER_REQUIRE
2588
2589AC_LANG_CASE(
2590	[C], [
2591		AC_REQUIRE([AC_PROG_CC_C99])
2592		define([PREFIX], [C])
2593		define([CACHE_PREFIX], [cc])
2594		define([COMPILER], [$CC])
2595	],
2596	[C++], [
2597		define([PREFIX], [CXX])
2598		define([CACHE_PREFIX], [cxx])
2599		define([COMPILER], [$CXX])
2600	]
2601)
2602
2603[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
2604
2605if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
2606	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2607	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
2608			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
2609			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2610					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
2611					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
2612	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
2613	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2614fi
2615
2616if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
2617	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
2618		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2619	fi
2620	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2621	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
2622			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
2623			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2624					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
2625					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
2626	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
2627	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2628fi
2629
2630found="no"
2631m4_foreach([flag], m4_cdr($@), [
2632	if test $found = "no" ; then
2633		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
2634			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2635		fi
2636
2637		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
2638			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2639		fi
2640
2641		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
2642
2643dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
2644		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
2645		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
2646		AC_CACHE_VAL($cacheid,
2647			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
2648					     [eval $cacheid=yes],
2649					     [eval $cacheid=no])])
2650
2651		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2652
2653		eval supported=\$$cacheid
2654		AC_MSG_RESULT([$supported])
2655		if test "$supported" = "yes" ; then
2656			$1="$$1 ]flag["
2657			found="yes"
2658		fi
2659	fi
2660])
2661]) # XORG_TESTSET_CFLAG
2662
2663# XORG_COMPILER_FLAGS
2664# ---------------
2665# Minimum version: 1.16.0
2666#
2667# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
2668# arguments supported by the selected compiler which do NOT alter the generated
2669# code.  These arguments will cause the compiler to print various warnings
2670# during compilation AND turn a conservative set of warnings into errors.
2671#
2672# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
2673# future versions of util-macros as options are added to new compilers.
2674#
2675AC_DEFUN([XORG_COMPILER_FLAGS], [
2676AC_REQUIRE([XORG_COMPILER_BRAND])
2677
2678AC_ARG_ENABLE(selective-werror,
2679              AS_HELP_STRING([--disable-selective-werror],
2680                             [Turn off selective compiler errors. (default: enabled)]),
2681              [SELECTIVE_WERROR=$enableval],
2682              [SELECTIVE_WERROR=yes])
2683
2684AC_LANG_CASE(
2685        [C], [
2686                define([PREFIX], [C])
2687        ],
2688        [C++], [
2689                define([PREFIX], [CXX])
2690        ]
2691)
2692# -v is too short to test reliably with XORG_TESTSET_CFLAG
2693if test "x$SUNCC" = "xyes"; then
2694    [BASE_]PREFIX[FLAGS]="-v"
2695else
2696    [BASE_]PREFIX[FLAGS]=""
2697fi
2698
2699# This chunk of warnings were those that existed in the legacy CWARNFLAGS
2700XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
2701XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
2702XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
2703XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
2704
2705AC_LANG_CASE(
2706	[C], [
2707		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
2708		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
2709		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
2710		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
2711		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
2712		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
2713	]
2714)
2715
2716# This chunk adds additional warnings that could catch undesired effects.
2717XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
2718XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
2719XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
2720XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
2721XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
2722XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
2723XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
2724
2725# These are currently disabled because they are noisy.  They will be enabled
2726# in the future once the codebase is sufficiently modernized to silence
2727# them.  For now, I don't want them to drown out the other warnings.
2728# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
2729# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
2730# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
2731
2732# Turn some warnings into errors, so we don't accidently get successful builds
2733# when there are problems that should be fixed.
2734
2735if test "x$SELECTIVE_WERROR" = "xyes" ; then
2736XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
2737XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
2738XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
2739XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
2740XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
2741XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
2742XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
2743XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
2744XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
2745XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
2746XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
2747XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
2748XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
2749else
2750AC_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])
2751XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
2752XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
2753XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
2754XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
2755XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
2756XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
2757XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
2758XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
2759XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
2760XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
2761XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
2762XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
2763XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
2764fi
2765
2766AC_SUBST([BASE_]PREFIX[FLAGS])
2767]) # XORG_COMPILER_FLAGS
2768
2769# XORG_CWARNFLAGS
2770# ---------------
2771# Minimum version: 1.2.0
2772# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
2773#
2774# Defines CWARNFLAGS to enable C compiler warnings.
2775#
2776# This function is deprecated because it defines -fno-strict-aliasing
2777# which alters the code generated by the compiler.  If -fno-strict-aliasing
2778# is needed, then it should be added explicitly in the module when
2779# it is updated to use BASE_CFLAGS.
2780#
2781AC_DEFUN([XORG_CWARNFLAGS], [
2782AC_REQUIRE([XORG_COMPILER_FLAGS])
2783AC_REQUIRE([XORG_COMPILER_BRAND])
2784AC_LANG_CASE(
2785	[C], [
2786		CWARNFLAGS="$BASE_CFLAGS"
2787		if  test "x$GCC" = xyes ; then
2788		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
2789		fi
2790		AC_SUBST(CWARNFLAGS)
2791	]
2792)
2793]) # XORG_CWARNFLAGS
2794
2795# XORG_STRICT_OPTION
2796# -----------------------
2797# Minimum version: 1.3.0
2798#
2799# Add configure option to enable strict compilation flags, such as treating
2800# warnings as fatal errors.
2801# If --enable-strict-compilation is passed to configure, adds strict flags to
2802# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
2803#
2804# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2805# when strict compilation is unconditionally desired.
2806AC_DEFUN([XORG_STRICT_OPTION], [
2807AC_REQUIRE([XORG_CWARNFLAGS])
2808AC_REQUIRE([XORG_COMPILER_FLAGS])
2809
2810AC_ARG_ENABLE(strict-compilation,
2811			  AS_HELP_STRING([--enable-strict-compilation],
2812			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2813			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2814
2815AC_LANG_CASE(
2816        [C], [
2817                define([PREFIX], [C])
2818        ],
2819        [C++], [
2820                define([PREFIX], [CXX])
2821        ]
2822)
2823
2824[STRICT_]PREFIX[FLAGS]=""
2825XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
2826XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
2827
2828# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
2829# activate it with -Werror, so we add it here explicitly.
2830XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
2831
2832if test "x$STRICT_COMPILE" = "xyes"; then
2833    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
2834    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
2835fi
2836AC_SUBST([STRICT_]PREFIX[FLAGS])
2837AC_SUBST([BASE_]PREFIX[FLAGS])
2838AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
2839]) # XORG_STRICT_OPTION
2840
2841# XORG_DEFAULT_OPTIONS
2842# --------------------
2843# Minimum version: 1.3.0
2844#
2845# Defines default options for X.Org modules.
2846#
2847AC_DEFUN([XORG_DEFAULT_OPTIONS], [
2848AC_REQUIRE([AC_PROG_INSTALL])
2849XORG_COMPILER_FLAGS
2850XORG_CWARNFLAGS
2851XORG_STRICT_OPTION
2852XORG_RELEASE_VERSION
2853XORG_CHANGELOG
2854XORG_INSTALL
2855XORG_MANPAGE_SECTIONS
2856m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2857    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2858]) # XORG_DEFAULT_OPTIONS
2859
2860# XORG_INSTALL()
2861# ----------------
2862# Minimum version: 1.4.0
2863#
2864# Defines the variable INSTALL_CMD as the command to copy
2865# INSTALL from $prefix/share/util-macros.
2866#
2867AC_DEFUN([XORG_INSTALL], [
2868AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2869macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2870INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2871mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2872|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
2873touch \$(top_srcdir)/INSTALL; \
2874echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
2875AC_SUBST([INSTALL_CMD])
2876]) # XORG_INSTALL
2877dnl Copyright 2005 Red Hat, Inc
2878dnl
2879dnl Permission to use, copy, modify, distribute, and sell this software and its
2880dnl documentation for any purpose is hereby granted without fee, provided that
2881dnl the above copyright notice appear in all copies and that both that
2882dnl copyright notice and this permission notice appear in supporting
2883dnl documentation.
2884dnl
2885dnl The above copyright notice and this permission notice shall be included
2886dnl in all copies or substantial portions of the Software.
2887dnl
2888dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2889dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2890dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2891dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2892dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2893dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2894dnl OTHER DEALINGS IN THE SOFTWARE.
2895dnl
2896dnl Except as contained in this notice, the name of the copyright holders shall
2897dnl not be used in advertising or otherwise to promote the sale, use or
2898dnl other dealings in this Software without prior written authorization
2899dnl from the copyright holders.
2900dnl
2901
2902# XORG_RELEASE_VERSION
2903# --------------------
2904# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2905
2906AC_DEFUN([XORG_RELEASE_VERSION],[
2907	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2908		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2909		[Major version of this package])
2910	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2911	if test "x$PVM" = "x"; then
2912		PVM="0"
2913	fi
2914	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2915		[$PVM],
2916		[Minor version of this package])
2917	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2918	if test "x$PVP" = "x"; then
2919		PVP="0"
2920	fi
2921	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2922		[$PVP],
2923		[Patch version of this package])
2924])
2925
2926# XORG_CHANGELOG()
2927# ----------------
2928# Minimum version: 1.2.0
2929#
2930# Defines the variable CHANGELOG_CMD as the command to generate
2931# ChangeLog from git.
2932#
2933#
2934AC_DEFUN([XORG_CHANGELOG], [
2935CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
2936mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2937|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
2938touch \$(top_srcdir)/ChangeLog; \
2939echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
2940AC_SUBST([CHANGELOG_CMD])
2941]) # XORG_CHANGELOG
2942
2943# Copyright (C) 2002-2021 Free Software Foundation, Inc.
2944#
2945# This file is free software; the Free Software Foundation
2946# gives unlimited permission to copy and/or distribute it,
2947# with or without modifications, as long as this notice is preserved.
2948
2949# AM_AUTOMAKE_VERSION(VERSION)
2950# ----------------------------
2951# Automake X.Y traces this macro to ensure aclocal.m4 has been
2952# generated from the m4 files accompanying Automake X.Y.
2953# (This private macro should not be called outside this file.)
2954AC_DEFUN([AM_AUTOMAKE_VERSION],
2955[am__api_version='1.16'
2956dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
2957dnl require some minimum version.  Point them to the right macro.
2958m4_if([$1], [1.16.5], [],
2959      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
2960])
2961
2962# _AM_AUTOCONF_VERSION(VERSION)
2963# -----------------------------
2964# aclocal traces this macro to find the Autoconf version.
2965# This is a private macro too.  Using m4_define simplifies
2966# the logic in aclocal, which can simply ignore this definition.
2967m4_define([_AM_AUTOCONF_VERSION], [])
2968
2969# AM_SET_CURRENT_AUTOMAKE_VERSION
2970# -------------------------------
2971# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
2972# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
2973AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2974[AM_AUTOMAKE_VERSION([1.16.5])dnl
2975m4_ifndef([AC_AUTOCONF_VERSION],
2976  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
2977_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
2978
2979# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
2980
2981# Copyright (C) 2001-2021 Free Software Foundation, Inc.
2982#
2983# This file is free software; the Free Software Foundation
2984# gives unlimited permission to copy and/or distribute it,
2985# with or without modifications, as long as this notice is preserved.
2986
2987# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2988# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
2989# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
2990#
2991# Of course, Automake must honor this variable whenever it calls a
2992# tool from the auxiliary directory.  The problem is that $srcdir (and
2993# therefore $ac_aux_dir as well) can be either absolute or relative,
2994# depending on how configure is run.  This is pretty annoying, since
2995# it makes $ac_aux_dir quite unusable in subdirectories: in the top
2996# source directory, any form will work fine, but in subdirectories a
2997# relative path needs to be adjusted first.
2998#
2999# $ac_aux_dir/missing
3000#    fails when called from a subdirectory if $ac_aux_dir is relative
3001# $top_srcdir/$ac_aux_dir/missing
3002#    fails if $ac_aux_dir is absolute,
3003#    fails when called from a subdirectory in a VPATH build with
3004#          a relative $ac_aux_dir
3005#
3006# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
3007# are both prefixed by $srcdir.  In an in-source build this is usually
3008# harmless because $srcdir is '.', but things will broke when you
3009# start a VPATH build or use an absolute $srcdir.
3010#
3011# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
3012# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
3013#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
3014# and then we would define $MISSING as
3015#   MISSING="\${SHELL} $am_aux_dir/missing"
3016# This will work as long as MISSING is not called from configure, because
3017# unfortunately $(top_srcdir) has no meaning in configure.
3018# However there are other variables, like CC, which are often used in
3019# configure, and could therefore not use this "fixed" $ac_aux_dir.
3020#
3021# Another solution, used here, is to always expand $ac_aux_dir to an
3022# absolute PATH.  The drawback is that using absolute paths prevent a
3023# configured tree to be moved without reconfiguration.
3024
3025AC_DEFUN([AM_AUX_DIR_EXPAND],
3026[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3027# Expand $ac_aux_dir to an absolute path.
3028am_aux_dir=`cd "$ac_aux_dir" && pwd`
3029])
3030
3031# AM_CONDITIONAL                                            -*- Autoconf -*-
3032
3033# Copyright (C) 1997-2021 Free Software Foundation, Inc.
3034#
3035# This file is free software; the Free Software Foundation
3036# gives unlimited permission to copy and/or distribute it,
3037# with or without modifications, as long as this notice is preserved.
3038
3039# AM_CONDITIONAL(NAME, SHELL-CONDITION)
3040# -------------------------------------
3041# Define a conditional.
3042AC_DEFUN([AM_CONDITIONAL],
3043[AC_PREREQ([2.52])dnl
3044 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
3045       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
3046AC_SUBST([$1_TRUE])dnl
3047AC_SUBST([$1_FALSE])dnl
3048_AM_SUBST_NOTMAKE([$1_TRUE])dnl
3049_AM_SUBST_NOTMAKE([$1_FALSE])dnl
3050m4_define([_AM_COND_VALUE_$1], [$2])dnl
3051if $2; then
3052  $1_TRUE=
3053  $1_FALSE='#'
3054else
3055  $1_TRUE='#'
3056  $1_FALSE=
3057fi
3058AC_CONFIG_COMMANDS_PRE(
3059[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
3060  AC_MSG_ERROR([[conditional "$1" was never defined.
3061Usually this means the macro was only invoked conditionally.]])
3062fi])])
3063
3064# Copyright (C) 1999-2021 Free Software Foundation, Inc.
3065#
3066# This file is free software; the Free Software Foundation
3067# gives unlimited permission to copy and/or distribute it,
3068# with or without modifications, as long as this notice is preserved.
3069
3070
3071# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
3072# written in clear, in which case automake, when reading aclocal.m4,
3073# will think it sees a *use*, and therefore will trigger all it's
3074# C support machinery.  Also note that it means that autoscan, seeing
3075# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
3076
3077
3078# _AM_DEPENDENCIES(NAME)
3079# ----------------------
3080# See how the compiler implements dependency checking.
3081# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
3082# We try a few techniques and use that to set a single cache variable.
3083#
3084# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
3085# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
3086# dependency, and given that the user is not expected to run this macro,
3087# just rely on AC_PROG_CC.
3088AC_DEFUN([_AM_DEPENDENCIES],
3089[AC_REQUIRE([AM_SET_DEPDIR])dnl
3090AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
3091AC_REQUIRE([AM_MAKE_INCLUDE])dnl
3092AC_REQUIRE([AM_DEP_TRACK])dnl
3093
3094m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
3095      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
3096      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
3097      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
3098      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
3099      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
3100                    [depcc="$$1"   am_compiler_list=])
3101
3102AC_CACHE_CHECK([dependency style of $depcc],
3103               [am_cv_$1_dependencies_compiler_type],
3104[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3105  # We make a subdir and do the tests there.  Otherwise we can end up
3106  # making bogus files that we don't know about and never remove.  For
3107  # instance it was reported that on HP-UX the gcc test will end up
3108  # making a dummy file named 'D' -- because '-MD' means "put the output
3109  # in D".
3110  rm -rf conftest.dir
3111  mkdir conftest.dir
3112  # Copy depcomp to subdir because otherwise we won't find it if we're
3113  # using a relative directory.
3114  cp "$am_depcomp" conftest.dir
3115  cd conftest.dir
3116  # We will build objects and dependencies in a subdirectory because
3117  # it helps to detect inapplicable dependency modes.  For instance
3118  # both Tru64's cc and ICC support -MD to output dependencies as a
3119  # side effect of compilation, but ICC will put the dependencies in
3120  # the current directory while Tru64 will put them in the object
3121  # directory.
3122  mkdir sub
3123
3124  am_cv_$1_dependencies_compiler_type=none
3125  if test "$am_compiler_list" = ""; then
3126     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
3127  fi
3128  am__universal=false
3129  m4_case([$1], [CC],
3130    [case " $depcc " in #(
3131     *\ -arch\ *\ -arch\ *) am__universal=true ;;
3132     esac],
3133    [CXX],
3134    [case " $depcc " in #(
3135     *\ -arch\ *\ -arch\ *) am__universal=true ;;
3136     esac])
3137
3138  for depmode in $am_compiler_list; do
3139    # Setup a source with many dependencies, because some compilers
3140    # like to wrap large dependency lists on column 80 (with \), and
3141    # we should not choose a depcomp mode which is confused by this.
3142    #
3143    # We need to recreate these files for each test, as the compiler may
3144    # overwrite some of them when testing with obscure command lines.
3145    # This happens at least with the AIX C compiler.
3146    : > sub/conftest.c
3147    for i in 1 2 3 4 5 6; do
3148      echo '#include "conftst'$i'.h"' >> sub/conftest.c
3149      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
3150      # Solaris 10 /bin/sh.
3151      echo '/* dummy */' > sub/conftst$i.h
3152    done
3153    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3154
3155    # We check with '-c' and '-o' for the sake of the "dashmstdout"
3156    # mode.  It turns out that the SunPro C++ compiler does not properly
3157    # handle '-M -o', and we need to detect this.  Also, some Intel
3158    # versions had trouble with output in subdirs.
3159    am__obj=sub/conftest.${OBJEXT-o}
3160    am__minus_obj="-o $am__obj"
3161    case $depmode in
3162    gcc)
3163      # This depmode causes a compiler race in universal mode.
3164      test "$am__universal" = false || continue
3165      ;;
3166    nosideeffect)
3167      # After this tag, mechanisms are not by side-effect, so they'll
3168      # only be used when explicitly requested.
3169      if test "x$enable_dependency_tracking" = xyes; then
3170	continue
3171      else
3172	break
3173      fi
3174      ;;
3175    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
3176      # This compiler won't grok '-c -o', but also, the minuso test has
3177      # not run yet.  These depmodes are late enough in the game, and
3178      # so weak that their functioning should not be impacted.
3179      am__obj=conftest.${OBJEXT-o}
3180      am__minus_obj=
3181      ;;
3182    none) break ;;
3183    esac
3184    if depmode=$depmode \
3185       source=sub/conftest.c object=$am__obj \
3186       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3187       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
3188         >/dev/null 2>conftest.err &&
3189       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3190       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3191       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
3192       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3193      # icc doesn't choke on unknown options, it will just issue warnings
3194      # or remarks (even with -Werror).  So we grep stderr for any message
3195      # that says an option was ignored or not supported.
3196      # When given -MP, icc 7.0 and 7.1 complain thusly:
3197      #   icc: Command line warning: ignoring option '-M'; no argument required
3198      # The diagnosis changed in icc 8.0:
3199      #   icc: Command line remark: option '-MP' not supported
3200      if (grep 'ignoring option' conftest.err ||
3201          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3202        am_cv_$1_dependencies_compiler_type=$depmode
3203        break
3204      fi
3205    fi
3206  done
3207
3208  cd ..
3209  rm -rf conftest.dir
3210else
3211  am_cv_$1_dependencies_compiler_type=none
3212fi
3213])
3214AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
3215AM_CONDITIONAL([am__fastdep$1], [
3216  test "x$enable_dependency_tracking" != xno \
3217  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3218])
3219
3220
3221# AM_SET_DEPDIR
3222# -------------
3223# Choose a directory name for dependency files.
3224# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
3225AC_DEFUN([AM_SET_DEPDIR],
3226[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3227AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3228])
3229
3230
3231# AM_DEP_TRACK
3232# ------------
3233AC_DEFUN([AM_DEP_TRACK],
3234[AC_ARG_ENABLE([dependency-tracking], [dnl
3235AS_HELP_STRING(
3236  [--enable-dependency-tracking],
3237  [do not reject slow dependency extractors])
3238AS_HELP_STRING(
3239  [--disable-dependency-tracking],
3240  [speeds up one-time build])])
3241if test "x$enable_dependency_tracking" != xno; then
3242  am_depcomp="$ac_aux_dir/depcomp"
3243  AMDEPBACKSLASH='\'
3244  am__nodep='_no'
3245fi
3246AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3247AC_SUBST([AMDEPBACKSLASH])dnl
3248_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3249AC_SUBST([am__nodep])dnl
3250_AM_SUBST_NOTMAKE([am__nodep])dnl
3251])
3252
3253# Generate code to set up dependency tracking.              -*- Autoconf -*-
3254
3255# Copyright (C) 1999-2021 Free Software Foundation, Inc.
3256#
3257# This file is free software; the Free Software Foundation
3258# gives unlimited permission to copy and/or distribute it,
3259# with or without modifications, as long as this notice is preserved.
3260
3261# _AM_OUTPUT_DEPENDENCY_COMMANDS
3262# ------------------------------
3263AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3264[{
3265  # Older Autoconf quotes --file arguments for eval, but not when files
3266  # are listed without --file.  Let's play safe and only enable the eval
3267  # if we detect the quoting.
3268  # TODO: see whether this extra hack can be removed once we start
3269  # requiring Autoconf 2.70 or later.
3270  AS_CASE([$CONFIG_FILES],
3271          [*\'*], [eval set x "$CONFIG_FILES"],
3272          [*], [set x $CONFIG_FILES])
3273  shift
3274  # Used to flag and report bootstrapping failures.
3275  am_rc=0
3276  for am_mf
3277  do
3278    # Strip MF so we end up with the name of the file.
3279    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
3280    # Check whether this is an Automake generated Makefile which includes
3281    # dependency-tracking related rules and includes.
3282    # Grep'ing the whole file directly is not great: AIX grep has a line
3283    # limit of 2048, but all sed's we know have understand at least 4000.
3284    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
3285      || continue
3286    am_dirpart=`AS_DIRNAME(["$am_mf"])`
3287    am_filepart=`AS_BASENAME(["$am_mf"])`
3288    AM_RUN_LOG([cd "$am_dirpart" \
3289      && sed -e '/# am--include-marker/d' "$am_filepart" \
3290        | $MAKE -f - am--depfiles]) || am_rc=$?
3291  done
3292  if test $am_rc -ne 0; then
3293    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
3294    for automatic dependency tracking.  If GNU make was not used, consider
3295    re-running the configure script with MAKE="gmake" (or whatever is
3296    necessary).  You can also try re-running configure with the
3297    '--disable-dependency-tracking' option to at least be able to build
3298    the package (albeit without support for automatic dependency tracking).])
3299  fi
3300  AS_UNSET([am_dirpart])
3301  AS_UNSET([am_filepart])
3302  AS_UNSET([am_mf])
3303  AS_UNSET([am_rc])
3304  rm -f conftest-deps.mk
3305}
3306])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3307
3308
3309# AM_OUTPUT_DEPENDENCY_COMMANDS
3310# -----------------------------
3311# This macro should only be invoked once -- use via AC_REQUIRE.
3312#
3313# This code is only required when automatic dependency tracking is enabled.
3314# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
3315# order to bootstrap the dependency handling code.
3316AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3317[AC_CONFIG_COMMANDS([depfiles],
3318     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3319     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
3320
3321# Do all the work for Automake.                             -*- Autoconf -*-
3322
3323# Copyright (C) 1996-2021 Free Software Foundation, Inc.
3324#
3325# This file is free software; the Free Software Foundation
3326# gives unlimited permission to copy and/or distribute it,
3327# with or without modifications, as long as this notice is preserved.
3328
3329# This macro actually does too much.  Some checks are only needed if
3330# your package does certain things.  But this isn't really a big deal.
3331
3332dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
3333m4_define([AC_PROG_CC],
3334m4_defn([AC_PROG_CC])
3335[_AM_PROG_CC_C_O
3336])
3337
3338# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3339# AM_INIT_AUTOMAKE([OPTIONS])
3340# -----------------------------------------------
3341# The call with PACKAGE and VERSION arguments is the old style
3342# call (pre autoconf-2.50), which is being phased out.  PACKAGE
3343# and VERSION should now be passed to AC_INIT and removed from
3344# the call to AM_INIT_AUTOMAKE.
3345# We support both call styles for the transition.  After
3346# the next Automake release, Autoconf can make the AC_INIT
3347# arguments mandatory, and then we can depend on a new Autoconf
3348# release and drop the old call support.
3349AC_DEFUN([AM_INIT_AUTOMAKE],
3350[AC_PREREQ([2.65])dnl
3351m4_ifdef([_$0_ALREADY_INIT],
3352  [m4_fatal([$0 expanded multiple times
3353]m4_defn([_$0_ALREADY_INIT]))],
3354  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
3355dnl Autoconf wants to disallow AM_ names.  We explicitly allow
3356dnl the ones we care about.
3357m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
3358AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
3359AC_REQUIRE([AC_PROG_INSTALL])dnl
3360if test "`cd $srcdir && pwd`" != "`pwd`"; then
3361  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
3362  # is not polluted with repeated "-I."
3363  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
3364  # test to see if srcdir already configured
3365  if test -f $srcdir/config.status; then
3366    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
3367  fi
3368fi
3369
3370# test whether we have cygpath
3371if test -z "$CYGPATH_W"; then
3372  if (cygpath --version) >/dev/null 2>/dev/null; then
3373    CYGPATH_W='cygpath -w'
3374  else
3375    CYGPATH_W=echo
3376  fi
3377fi
3378AC_SUBST([CYGPATH_W])
3379
3380# Define the identity of the package.
3381dnl Distinguish between old-style and new-style calls.
3382m4_ifval([$2],
3383[AC_DIAGNOSE([obsolete],
3384             [$0: two- and three-arguments forms are deprecated.])
3385m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
3386 AC_SUBST([PACKAGE], [$1])dnl
3387 AC_SUBST([VERSION], [$2])],
3388[_AM_SET_OPTIONS([$1])dnl
3389dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
3390m4_if(
3391  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
3392  [ok:ok],,
3393  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
3394 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
3395 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
3396
3397_AM_IF_OPTION([no-define],,
3398[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
3399 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
3400
3401# Some tools Automake needs.
3402AC_REQUIRE([AM_SANITY_CHECK])dnl
3403AC_REQUIRE([AC_ARG_PROGRAM])dnl
3404AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
3405AM_MISSING_PROG([AUTOCONF], [autoconf])
3406AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
3407AM_MISSING_PROG([AUTOHEADER], [autoheader])
3408AM_MISSING_PROG([MAKEINFO], [makeinfo])
3409AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3410AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
3411AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3412# For better backward compatibility.  To be removed once Automake 1.9.x
3413# dies out for good.  For more background, see:
3414# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
3415# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
3416AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
3417# We need awk for the "check" target (and possibly the TAP driver).  The
3418# system "awk" is bad on some platforms.
3419AC_REQUIRE([AC_PROG_AWK])dnl
3420AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3421AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3422_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
3423	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
3424			     [_AM_PROG_TAR([v7])])])
3425_AM_IF_OPTION([no-dependencies],,
3426[AC_PROVIDE_IFELSE([AC_PROG_CC],
3427		  [_AM_DEPENDENCIES([CC])],
3428		  [m4_define([AC_PROG_CC],
3429			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
3430AC_PROVIDE_IFELSE([AC_PROG_CXX],
3431		  [_AM_DEPENDENCIES([CXX])],
3432		  [m4_define([AC_PROG_CXX],
3433			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
3434AC_PROVIDE_IFELSE([AC_PROG_OBJC],
3435		  [_AM_DEPENDENCIES([OBJC])],
3436		  [m4_define([AC_PROG_OBJC],
3437			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
3438AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
3439		  [_AM_DEPENDENCIES([OBJCXX])],
3440		  [m4_define([AC_PROG_OBJCXX],
3441			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
3442])
3443# Variables for tags utilities; see am/tags.am
3444if test -z "$CTAGS"; then
3445  CTAGS=ctags
3446fi
3447AC_SUBST([CTAGS])
3448if test -z "$ETAGS"; then
3449  ETAGS=etags
3450fi
3451AC_SUBST([ETAGS])
3452if test -z "$CSCOPE"; then
3453  CSCOPE=cscope
3454fi
3455AC_SUBST([CSCOPE])
3456
3457AC_REQUIRE([AM_SILENT_RULES])dnl
3458dnl The testsuite driver may need to know about EXEEXT, so add the
3459dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
3460dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
3461AC_CONFIG_COMMANDS_PRE(dnl
3462[m4_provide_if([_AM_COMPILER_EXEEXT],
3463  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
3464
3465# POSIX will say in a future version that running "rm -f" with no argument
3466# is OK; and we want to be able to make that assumption in our Makefile
3467# recipes.  So use an aggressive probe to check that the usage we want is
3468# actually supported "in the wild" to an acceptable degree.
3469# See automake bug#10828.
3470# To make any issue more visible, cause the running configure to be aborted
3471# by default if the 'rm' program in use doesn't match our expectations; the
3472# user can still override this though.
3473if rm -f && rm -fr && rm -rf; then : OK; else
3474  cat >&2 <<'END'
3475Oops!
3476
3477Your 'rm' program seems unable to run without file operands specified
3478on the command line, even when the '-f' option is present.  This is contrary
3479to the behaviour of most rm programs out there, and not conforming with
3480the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
3481
3482Please tell bug-automake@gnu.org about your system, including the value
3483of your $PATH and any error possibly output before this message.  This
3484can help us improve future automake versions.
3485
3486END
3487  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
3488    echo 'Configuration will proceed anyway, since you have set the' >&2
3489    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
3490    echo >&2
3491  else
3492    cat >&2 <<'END'
3493Aborting the configuration process, to ensure you take notice of the issue.
3494
3495You can download and install GNU coreutils to get an 'rm' implementation
3496that behaves properly: <https://www.gnu.org/software/coreutils/>.
3497
3498If you want to complete the configuration process using your problematic
3499'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
3500to "yes", and re-run configure.
3501
3502END
3503    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
3504  fi
3505fi
3506dnl The trailing newline in this macro's definition is deliberate, for
3507dnl backward compatibility and to allow trailing 'dnl'-style comments
3508dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
3509])
3510
3511dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
3512dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
3513dnl mangled by Autoconf and run in a shell conditional statement.
3514m4_define([_AC_COMPILER_EXEEXT],
3515m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
3516
3517# When config.status generates a header, we must update the stamp-h file.
3518# This file resides in the same directory as the config header
3519# that is generated.  The stamp files are numbered to have different names.
3520
3521# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
3522# loop where config.status creates the headers, so we can generate
3523# our stamp files there.
3524AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
3525[# Compute $1's index in $config_headers.
3526_am_arg=$1
3527_am_stamp_count=1
3528for _am_header in $config_headers :; do
3529  case $_am_header in
3530    $_am_arg | $_am_arg:* )
3531      break ;;
3532    * )
3533      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
3534  esac
3535done
3536echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
3537
3538# Copyright (C) 2001-2021 Free Software Foundation, Inc.
3539#
3540# This file is free software; the Free Software Foundation
3541# gives unlimited permission to copy and/or distribute it,
3542# with or without modifications, as long as this notice is preserved.
3543
3544# AM_PROG_INSTALL_SH
3545# ------------------
3546# Define $install_sh.
3547AC_DEFUN([AM_PROG_INSTALL_SH],
3548[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3549if test x"${install_sh+set}" != xset; then
3550  case $am_aux_dir in
3551  *\ * | *\	*)
3552    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
3553  *)
3554    install_sh="\${SHELL} $am_aux_dir/install-sh"
3555  esac
3556fi
3557AC_SUBST([install_sh])])
3558
3559# Copyright (C) 2003-2021 Free Software Foundation, Inc.
3560#
3561# This file is free software; the Free Software Foundation
3562# gives unlimited permission to copy and/or distribute it,
3563# with or without modifications, as long as this notice is preserved.
3564
3565# Check whether the underlying file-system supports filenames
3566# with a leading dot.  For instance MS-DOS doesn't.
3567AC_DEFUN([AM_SET_LEADING_DOT],
3568[rm -rf .tst 2>/dev/null
3569mkdir .tst 2>/dev/null
3570if test -d .tst; then
3571  am__leading_dot=.
3572else
3573  am__leading_dot=_
3574fi
3575rmdir .tst 2>/dev/null
3576AC_SUBST([am__leading_dot])])
3577
3578# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
3579# From Jim Meyering
3580
3581# Copyright (C) 1996-2021 Free Software Foundation, Inc.
3582#
3583# This file is free software; the Free Software Foundation
3584# gives unlimited permission to copy and/or distribute it,
3585# with or without modifications, as long as this notice is preserved.
3586
3587# AM_MAINTAINER_MODE([DEFAULT-MODE])
3588# ----------------------------------
3589# Control maintainer-specific portions of Makefiles.
3590# Default is to disable them, unless 'enable' is passed literally.
3591# For symmetry, 'disable' may be passed as well.  Anyway, the user
3592# can override the default with the --enable/--disable switch.
3593AC_DEFUN([AM_MAINTAINER_MODE],
3594[m4_case(m4_default([$1], [disable]),
3595       [enable], [m4_define([am_maintainer_other], [disable])],
3596       [disable], [m4_define([am_maintainer_other], [enable])],
3597       [m4_define([am_maintainer_other], [enable])
3598        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
3599AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
3600  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
3601  AC_ARG_ENABLE([maintainer-mode],
3602    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
3603      am_maintainer_other[ make rules and dependencies not useful
3604      (and sometimes confusing) to the casual installer])],
3605    [USE_MAINTAINER_MODE=$enableval],
3606    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
3607  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
3608  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
3609  MAINT=$MAINTAINER_MODE_TRUE
3610  AC_SUBST([MAINT])dnl
3611]
3612)
3613
3614# Check to see how 'make' treats includes.	            -*- Autoconf -*-
3615
3616# Copyright (C) 2001-2021 Free Software Foundation, Inc.
3617#
3618# This file is free software; the Free Software Foundation
3619# gives unlimited permission to copy and/or distribute it,
3620# with or without modifications, as long as this notice is preserved.
3621
3622# AM_MAKE_INCLUDE()
3623# -----------------
3624# Check whether make has an 'include' directive that can support all
3625# the idioms we need for our automatic dependency tracking code.
3626AC_DEFUN([AM_MAKE_INCLUDE],
3627[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
3628cat > confinc.mk << 'END'
3629am__doit:
3630	@echo this is the am__doit target >confinc.out
3631.PHONY: am__doit
3632END
3633am__include="#"
3634am__quote=
3635# BSD make does it like this.
3636echo '.include "confinc.mk" # ignored' > confmf.BSD
3637# Other make implementations (GNU, Solaris 10, AIX) do it like this.
3638echo 'include confinc.mk # ignored' > confmf.GNU
3639_am_result=no
3640for s in GNU BSD; do
3641  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
3642  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
3643      ['0:this is the am__doit target'],
3644      [AS_CASE([$s],
3645          [BSD], [am__include='.include' am__quote='"'],
3646          [am__include='include' am__quote=''])])
3647  if test "$am__include" != "#"; then
3648    _am_result="yes ($s style)"
3649    break
3650  fi
3651done
3652rm -f confinc.* confmf.*
3653AC_MSG_RESULT([${_am_result}])
3654AC_SUBST([am__include])])
3655AC_SUBST([am__quote])])
3656
3657# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
3658
3659# Copyright (C) 1997-2021 Free Software Foundation, Inc.
3660#
3661# This file is free software; the Free Software Foundation
3662# gives unlimited permission to copy and/or distribute it,
3663# with or without modifications, as long as this notice is preserved.
3664
3665# AM_MISSING_PROG(NAME, PROGRAM)
3666# ------------------------------
3667AC_DEFUN([AM_MISSING_PROG],
3668[AC_REQUIRE([AM_MISSING_HAS_RUN])
3669$1=${$1-"${am_missing_run}$2"}
3670AC_SUBST($1)])
3671
3672# AM_MISSING_HAS_RUN
3673# ------------------
3674# Define MISSING if not defined so far and test if it is modern enough.
3675# If it is, set am_missing_run to use it, otherwise, to nothing.
3676AC_DEFUN([AM_MISSING_HAS_RUN],
3677[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3678AC_REQUIRE_AUX_FILE([missing])dnl
3679if test x"${MISSING+set}" != xset; then
3680  MISSING="\${SHELL} '$am_aux_dir/missing'"
3681fi
3682# Use eval to expand $SHELL
3683if eval "$MISSING --is-lightweight"; then
3684  am_missing_run="$MISSING "
3685else
3686  am_missing_run=
3687  AC_MSG_WARN(['missing' script is too old or missing])
3688fi
3689])
3690
3691# Helper functions for option handling.                     -*- Autoconf -*-
3692
3693# Copyright (C) 2001-2021 Free Software Foundation, Inc.
3694#
3695# This file is free software; the Free Software Foundation
3696# gives unlimited permission to copy and/or distribute it,
3697# with or without modifications, as long as this notice is preserved.
3698
3699# _AM_MANGLE_OPTION(NAME)
3700# -----------------------
3701AC_DEFUN([_AM_MANGLE_OPTION],
3702[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
3703
3704# _AM_SET_OPTION(NAME)
3705# --------------------
3706# Set option NAME.  Presently that only means defining a flag for this option.
3707AC_DEFUN([_AM_SET_OPTION],
3708[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
3709
3710# _AM_SET_OPTIONS(OPTIONS)
3711# ------------------------
3712# OPTIONS is a space-separated list of Automake options.
3713AC_DEFUN([_AM_SET_OPTIONS],
3714[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
3715
3716# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
3717# -------------------------------------------
3718# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
3719AC_DEFUN([_AM_IF_OPTION],
3720[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
3721
3722# Copyright (C) 1999-2021 Free Software Foundation, Inc.
3723#
3724# This file is free software; the Free Software Foundation
3725# gives unlimited permission to copy and/or distribute it,
3726# with or without modifications, as long as this notice is preserved.
3727
3728# _AM_PROG_CC_C_O
3729# ---------------
3730# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
3731# to automatically call this.
3732AC_DEFUN([_AM_PROG_CC_C_O],
3733[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3734AC_REQUIRE_AUX_FILE([compile])dnl
3735AC_LANG_PUSH([C])dnl
3736AC_CACHE_CHECK(
3737  [whether $CC understands -c and -o together],
3738  [am_cv_prog_cc_c_o],
3739  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
3740  # Make sure it works both with $CC and with simple cc.
3741  # Following AC_PROG_CC_C_O, we do the test twice because some
3742  # compilers refuse to overwrite an existing .o file with -o,
3743  # though they will create one.
3744  am_cv_prog_cc_c_o=yes
3745  for am_i in 1 2; do
3746    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
3747         && test -f conftest2.$ac_objext; then
3748      : OK
3749    else
3750      am_cv_prog_cc_c_o=no
3751      break
3752    fi
3753  done
3754  rm -f core conftest*
3755  unset am_i])
3756if test "$am_cv_prog_cc_c_o" != yes; then
3757   # Losing compiler, so override with the script.
3758   # FIXME: It is wrong to rewrite CC.
3759   # But if we don't then we get into trouble of one sort or another.
3760   # A longer-term fix would be to have automake use am__CC in this case,
3761   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3762   CC="$am_aux_dir/compile $CC"
3763fi
3764AC_LANG_POP([C])])
3765
3766# For backward compatibility.
3767AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
3768
3769# Copyright (C) 2001-2021 Free Software Foundation, Inc.
3770#
3771# This file is free software; the Free Software Foundation
3772# gives unlimited permission to copy and/or distribute it,
3773# with or without modifications, as long as this notice is preserved.
3774
3775# AM_RUN_LOG(COMMAND)
3776# -------------------
3777# Run COMMAND, save the exit status in ac_status, and log it.
3778# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
3779AC_DEFUN([AM_RUN_LOG],
3780[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
3781   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
3782   ac_status=$?
3783   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3784   (exit $ac_status); }])
3785
3786# Check to make sure that the build environment is sane.    -*- Autoconf -*-
3787
3788# Copyright (C) 1996-2021 Free Software Foundation, Inc.
3789#
3790# This file is free software; the Free Software Foundation
3791# gives unlimited permission to copy and/or distribute it,
3792# with or without modifications, as long as this notice is preserved.
3793
3794# AM_SANITY_CHECK
3795# ---------------
3796AC_DEFUN([AM_SANITY_CHECK],
3797[AC_MSG_CHECKING([whether build environment is sane])
3798# Reject unsafe characters in $srcdir or the absolute working directory
3799# name.  Accept space and tab only in the latter.
3800am_lf='
3801'
3802case `pwd` in
3803  *[[\\\"\#\$\&\'\`$am_lf]]*)
3804    AC_MSG_ERROR([unsafe absolute working directory name]);;
3805esac
3806case $srcdir in
3807  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
3808    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
3809esac
3810
3811# Do 'set' in a subshell so we don't clobber the current shell's
3812# arguments.  Must try -L first in case configure is actually a
3813# symlink; some systems play weird games with the mod time of symlinks
3814# (eg FreeBSD returns the mod time of the symlink's containing
3815# directory).
3816if (
3817   am_has_slept=no
3818   for am_try in 1 2; do
3819     echo "timestamp, slept: $am_has_slept" > conftest.file
3820     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
3821     if test "$[*]" = "X"; then
3822	# -L didn't work.
3823	set X `ls -t "$srcdir/configure" conftest.file`
3824     fi
3825     if test "$[*]" != "X $srcdir/configure conftest.file" \
3826	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
3827
3828	# If neither matched, then we have a broken ls.  This can happen
3829	# if, for instance, CONFIG_SHELL is bash and it inherits a
3830	# broken ls alias from the environment.  This has actually
3831	# happened.  Such a system could not be considered "sane".
3832	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
3833  alias in your environment])
3834     fi
3835     if test "$[2]" = conftest.file || test $am_try -eq 2; then
3836       break
3837     fi
3838     # Just in case.
3839     sleep 1
3840     am_has_slept=yes
3841   done
3842   test "$[2]" = conftest.file
3843   )
3844then
3845   # Ok.
3846   :
3847else
3848   AC_MSG_ERROR([newly created file is older than distributed files!
3849Check your system clock])
3850fi
3851AC_MSG_RESULT([yes])
3852# If we didn't sleep, we still need to ensure time stamps of config.status and
3853# generated files are strictly newer.
3854am_sleep_pid=
3855if grep 'slept: no' conftest.file >/dev/null 2>&1; then
3856  ( sleep 1 ) &
3857  am_sleep_pid=$!
3858fi
3859AC_CONFIG_COMMANDS_PRE(
3860  [AC_MSG_CHECKING([that generated files are newer than configure])
3861   if test -n "$am_sleep_pid"; then
3862     # Hide warnings about reused PIDs.
3863     wait $am_sleep_pid 2>/dev/null
3864   fi
3865   AC_MSG_RESULT([done])])
3866rm -f conftest.file
3867])
3868
3869# Copyright (C) 2009-2021 Free Software Foundation, Inc.
3870#
3871# This file is free software; the Free Software Foundation
3872# gives unlimited permission to copy and/or distribute it,
3873# with or without modifications, as long as this notice is preserved.
3874
3875# AM_SILENT_RULES([DEFAULT])
3876# --------------------------
3877# Enable less verbose build rules; with the default set to DEFAULT
3878# ("yes" being less verbose, "no" or empty being verbose).
3879AC_DEFUN([AM_SILENT_RULES],
3880[AC_ARG_ENABLE([silent-rules], [dnl
3881AS_HELP_STRING(
3882  [--enable-silent-rules],
3883  [less verbose build output (undo: "make V=1")])
3884AS_HELP_STRING(
3885  [--disable-silent-rules],
3886  [verbose build output (undo: "make V=0")])dnl
3887])
3888case $enable_silent_rules in @%:@ (((
3889  yes) AM_DEFAULT_VERBOSITY=0;;
3890   no) AM_DEFAULT_VERBOSITY=1;;
3891    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
3892esac
3893dnl
3894dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
3895dnl do not support nested variable expansions.
3896dnl See automake bug#9928 and bug#10237.
3897am_make=${MAKE-make}
3898AC_CACHE_CHECK([whether $am_make supports nested variables],
3899   [am_cv_make_support_nested_variables],
3900   [if AS_ECHO([['TRUE=$(BAR$(V))
3901BAR0=false
3902BAR1=true
3903V=1
3904am__doit:
3905	@$(TRUE)
3906.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
3907  am_cv_make_support_nested_variables=yes
3908else
3909  am_cv_make_support_nested_variables=no
3910fi])
3911if test $am_cv_make_support_nested_variables = yes; then
3912  dnl Using '$V' instead of '$(V)' breaks IRIX make.
3913  AM_V='$(V)'
3914  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
3915else
3916  AM_V=$AM_DEFAULT_VERBOSITY
3917  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
3918fi
3919AC_SUBST([AM_V])dnl
3920AM_SUBST_NOTMAKE([AM_V])dnl
3921AC_SUBST([AM_DEFAULT_V])dnl
3922AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
3923AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
3924AM_BACKSLASH='\'
3925AC_SUBST([AM_BACKSLASH])dnl
3926_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
3927])
3928
3929# Copyright (C) 2001-2021 Free Software Foundation, Inc.
3930#
3931# This file is free software; the Free Software Foundation
3932# gives unlimited permission to copy and/or distribute it,
3933# with or without modifications, as long as this notice is preserved.
3934
3935# AM_PROG_INSTALL_STRIP
3936# ---------------------
3937# One issue with vendor 'install' (even GNU) is that you can't
3938# specify the program used to strip binaries.  This is especially
3939# annoying in cross-compiling environments, where the build's strip
3940# is unlikely to handle the host's binaries.
3941# Fortunately install-sh will honor a STRIPPROG variable, so we
3942# always use install-sh in "make install-strip", and initialize
3943# STRIPPROG with the value of the STRIP variable (set by the user).
3944AC_DEFUN([AM_PROG_INSTALL_STRIP],
3945[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3946# Installed binaries are usually stripped using 'strip' when the user
3947# run "make install-strip".  However 'strip' might not be the right
3948# tool to use in cross-compilation environments, therefore Automake
3949# will honor the 'STRIP' environment variable to overrule this program.
3950dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
3951if test "$cross_compiling" != no; then
3952  AC_CHECK_TOOL([STRIP], [strip], :)
3953fi
3954INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
3955AC_SUBST([INSTALL_STRIP_PROGRAM])])
3956
3957# Copyright (C) 2006-2021 Free Software Foundation, Inc.
3958#
3959# This file is free software; the Free Software Foundation
3960# gives unlimited permission to copy and/or distribute it,
3961# with or without modifications, as long as this notice is preserved.
3962
3963# _AM_SUBST_NOTMAKE(VARIABLE)
3964# ---------------------------
3965# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
3966# This macro is traced by Automake.
3967AC_DEFUN([_AM_SUBST_NOTMAKE])
3968
3969# AM_SUBST_NOTMAKE(VARIABLE)
3970# --------------------------
3971# Public sister of _AM_SUBST_NOTMAKE.
3972AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
3973
3974# Check how to create a tarball.                            -*- Autoconf -*-
3975
3976# Copyright (C) 2004-2021 Free Software Foundation, Inc.
3977#
3978# This file is free software; the Free Software Foundation
3979# gives unlimited permission to copy and/or distribute it,
3980# with or without modifications, as long as this notice is preserved.
3981
3982# _AM_PROG_TAR(FORMAT)
3983# --------------------
3984# Check how to create a tarball in format FORMAT.
3985# FORMAT should be one of 'v7', 'ustar', or 'pax'.
3986#
3987# Substitute a variable $(am__tar) that is a command
3988# writing to stdout a FORMAT-tarball containing the directory
3989# $tardir.
3990#     tardir=directory && $(am__tar) > result.tar
3991#
3992# Substitute a variable $(am__untar) that extract such
3993# a tarball read from stdin.
3994#     $(am__untar) < result.tar
3995#
3996AC_DEFUN([_AM_PROG_TAR],
3997[# Always define AMTAR for backward compatibility.  Yes, it's still used
3998# in the wild :-(  We should find a proper way to deprecate it ...
3999AC_SUBST([AMTAR], ['$${TAR-tar}'])
4000
4001# We'll loop over all known methods to create a tar archive until one works.
4002_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
4003
4004m4_if([$1], [v7],
4005  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
4006
4007  [m4_case([$1],
4008    [ustar],
4009     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
4010      # There is notably a 21 bits limit for the UID and the GID.  In fact,
4011      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
4012      # and bug#13588).
4013      am_max_uid=2097151 # 2^21 - 1
4014      am_max_gid=$am_max_uid
4015      # The $UID and $GID variables are not portable, so we need to resort
4016      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
4017      # below are definitely unexpected, so allow the users to see them
4018      # (that is, avoid stderr redirection).
4019      am_uid=`id -u || echo unknown`
4020      am_gid=`id -g || echo unknown`
4021      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
4022      if test $am_uid -le $am_max_uid; then
4023         AC_MSG_RESULT([yes])
4024      else
4025         AC_MSG_RESULT([no])
4026         _am_tools=none
4027      fi
4028      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
4029      if test $am_gid -le $am_max_gid; then
4030         AC_MSG_RESULT([yes])
4031      else
4032        AC_MSG_RESULT([no])
4033        _am_tools=none
4034      fi],
4035
4036  [pax],
4037    [],
4038
4039  [m4_fatal([Unknown tar format])])
4040
4041  AC_MSG_CHECKING([how to create a $1 tar archive])
4042
4043  # Go ahead even if we have the value already cached.  We do so because we
4044  # need to set the values for the 'am__tar' and 'am__untar' variables.
4045  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
4046
4047  for _am_tool in $_am_tools; do
4048    case $_am_tool in
4049    gnutar)
4050      for _am_tar in tar gnutar gtar; do
4051        AM_RUN_LOG([$_am_tar --version]) && break
4052      done
4053      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
4054      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
4055      am__untar="$_am_tar -xf -"
4056      ;;
4057    plaintar)
4058      # Must skip GNU tar: if it does not support --format= it doesn't create
4059      # ustar tarball either.
4060      (tar --version) >/dev/null 2>&1 && continue
4061      am__tar='tar chf - "$$tardir"'
4062      am__tar_='tar chf - "$tardir"'
4063      am__untar='tar xf -'
4064      ;;
4065    pax)
4066      am__tar='pax -L -x $1 -w "$$tardir"'
4067      am__tar_='pax -L -x $1 -w "$tardir"'
4068      am__untar='pax -r'
4069      ;;
4070    cpio)
4071      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
4072      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
4073      am__untar='cpio -i -H $1 -d'
4074      ;;
4075    none)
4076      am__tar=false
4077      am__tar_=false
4078      am__untar=false
4079      ;;
4080    esac
4081
4082    # If the value was cached, stop now.  We just wanted to have am__tar
4083    # and am__untar set.
4084    test -n "${am_cv_prog_tar_$1}" && break
4085
4086    # tar/untar a dummy directory, and stop if the command works.
4087    rm -rf conftest.dir
4088    mkdir conftest.dir
4089    echo GrepMe > conftest.dir/file
4090    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
4091    rm -rf conftest.dir
4092    if test -s conftest.tar; then
4093      AM_RUN_LOG([$am__untar <conftest.tar])
4094      AM_RUN_LOG([cat conftest.dir/file])
4095      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
4096    fi
4097  done
4098  rm -rf conftest.dir
4099
4100  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
4101  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
4102
4103AC_SUBST([am__tar])
4104AC_SUBST([am__untar])
4105]) # _AM_PROG_TAR
4106
4107# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
4108#
4109#   Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
4110#   Foundation, Inc.
4111#   Written by Gordon Matzigkeit, 1996
4112#
4113# This file is free software; the Free Software Foundation gives
4114# unlimited permission to copy and/or distribute it, with or without
4115# modifications, as long as this notice is preserved.
4116
4117m4_define([_LT_COPYING], [dnl
4118# Copyright (C) 2014 Free Software Foundation, Inc.
4119# This is free software; see the source for copying conditions.  There is NO
4120# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
4121
4122# GNU Libtool is free software; you can redistribute it and/or modify
4123# it under the terms of the GNU General Public License as published by
4124# the Free Software Foundation; either version 2 of of the License, or
4125# (at your option) any later version.
4126#
4127# As a special exception to the GNU General Public License, if you
4128# distribute this file as part of a program or library that is built
4129# using GNU Libtool, you may include this file under the  same
4130# distribution terms that you use for the rest of that program.
4131#
4132# GNU Libtool is distributed in the hope that it will be useful, but
4133# WITHOUT ANY WARRANTY; without even the implied warranty of
4134# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4135# GNU General Public License for more details.
4136#
4137# You should have received a copy of the GNU General Public License
4138# along with this program.  If not, see <http://www.gnu.org/licenses/>.
4139])
4140
4141# serial 59 LT_INIT
4142
4143
4144# LT_PREREQ(VERSION)
4145# ------------------
4146# Complain and exit if this libtool version is less that VERSION.
4147m4_defun([LT_PREREQ],
4148[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
4149       [m4_default([$3],
4150		   [m4_fatal([Libtool version $1 or higher is required],
4151		             63)])],
4152       [$2])])
4153
4154
4155# _LT_CHECK_BUILDDIR
4156# ------------------
4157# Complain if the absolute build directory name contains unusual characters
4158m4_defun([_LT_CHECK_BUILDDIR],
4159[case `pwd` in
4160  *\ * | *\	*)
4161    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
4162esac
4163])
4164
4165
4166# LT_INIT([OPTIONS])
4167# ------------------
4168AC_DEFUN([LT_INIT],
4169[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
4170AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
4171AC_BEFORE([$0], [LT_LANG])dnl
4172AC_BEFORE([$0], [LT_OUTPUT])dnl
4173AC_BEFORE([$0], [LTDL_INIT])dnl
4174m4_require([_LT_CHECK_BUILDDIR])dnl
4175
4176dnl Autoconf doesn't catch unexpanded LT_ macros by default:
4177m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
4178m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
4179dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
4180dnl unless we require an AC_DEFUNed macro:
4181AC_REQUIRE([LTOPTIONS_VERSION])dnl
4182AC_REQUIRE([LTSUGAR_VERSION])dnl
4183AC_REQUIRE([LTVERSION_VERSION])dnl
4184AC_REQUIRE([LTOBSOLETE_VERSION])dnl
4185m4_require([_LT_PROG_LTMAIN])dnl
4186
4187_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
4188
4189dnl Parse OPTIONS
4190_LT_SET_OPTIONS([$0], [$1])
4191
4192# This can be used to rebuild libtool when needed
4193LIBTOOL_DEPS=$ltmain
4194
4195# Always use our own libtool.
4196LIBTOOL='$(SHELL) $(top_builddir)/libtool'
4197AC_SUBST(LIBTOOL)dnl
4198
4199_LT_SETUP
4200
4201# Only expand once:
4202m4_define([LT_INIT])
4203])# LT_INIT
4204
4205# Old names:
4206AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
4207AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
4208dnl aclocal-1.4 backwards compatibility:
4209dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
4210dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
4211
4212
4213# _LT_PREPARE_CC_BASENAME
4214# -----------------------
4215m4_defun([_LT_PREPARE_CC_BASENAME], [
4216# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
4217func_cc_basename ()
4218{
4219    for cc_temp in @S|@*""; do
4220      case $cc_temp in
4221        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
4222        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
4223        \-*) ;;
4224        *) break;;
4225      esac
4226    done
4227    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
4228}
4229])# _LT_PREPARE_CC_BASENAME
4230
4231
4232# _LT_CC_BASENAME(CC)
4233# -------------------
4234# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
4235# but that macro is also expanded into generated libtool script, which
4236# arranges for $SED and $ECHO to be set by different means.
4237m4_defun([_LT_CC_BASENAME],
4238[m4_require([_LT_PREPARE_CC_BASENAME])dnl
4239AC_REQUIRE([_LT_DECL_SED])dnl
4240AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
4241func_cc_basename $1
4242cc_basename=$func_cc_basename_result
4243])
4244
4245
4246# _LT_FILEUTILS_DEFAULTS
4247# ----------------------
4248# It is okay to use these file commands and assume they have been set
4249# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
4250m4_defun([_LT_FILEUTILS_DEFAULTS],
4251[: ${CP="cp -f"}
4252: ${MV="mv -f"}
4253: ${RM="rm -f"}
4254])# _LT_FILEUTILS_DEFAULTS
4255
4256
4257# _LT_SETUP
4258# ---------
4259m4_defun([_LT_SETUP],
4260[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4261AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4262AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
4263AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
4264
4265_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
4266dnl
4267_LT_DECL([], [host_alias], [0], [The host system])dnl
4268_LT_DECL([], [host], [0])dnl
4269_LT_DECL([], [host_os], [0])dnl
4270dnl
4271_LT_DECL([], [build_alias], [0], [The build system])dnl
4272_LT_DECL([], [build], [0])dnl
4273_LT_DECL([], [build_os], [0])dnl
4274dnl
4275AC_REQUIRE([AC_PROG_CC])dnl
4276AC_REQUIRE([LT_PATH_LD])dnl
4277AC_REQUIRE([LT_PATH_NM])dnl
4278dnl
4279AC_REQUIRE([AC_PROG_LN_S])dnl
4280test -z "$LN_S" && LN_S="ln -s"
4281_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
4282dnl
4283AC_REQUIRE([LT_CMD_MAX_LEN])dnl
4284_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
4285_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
4286dnl
4287m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4288m4_require([_LT_CHECK_SHELL_FEATURES])dnl
4289m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
4290m4_require([_LT_CMD_RELOAD])dnl
4291m4_require([_LT_DECL_FILECMD])dnl
4292m4_require([_LT_CHECK_MAGIC_METHOD])dnl
4293m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
4294m4_require([_LT_CMD_OLD_ARCHIVE])dnl
4295m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4296m4_require([_LT_WITH_SYSROOT])dnl
4297m4_require([_LT_CMD_TRUNCATE])dnl
4298
4299_LT_CONFIG_LIBTOOL_INIT([
4300# See if we are running on zsh, and set the options that allow our
4301# commands through without removal of \ escapes INIT.
4302if test -n "\${ZSH_VERSION+set}"; then
4303   setopt NO_GLOB_SUBST
4304fi
4305])
4306if test -n "${ZSH_VERSION+set}"; then
4307   setopt NO_GLOB_SUBST
4308fi
4309
4310_LT_CHECK_OBJDIR
4311
4312m4_require([_LT_TAG_COMPILER])dnl
4313
4314case $host_os in
4315aix3*)
4316  # AIX sometimes has problems with the GCC collect2 program.  For some
4317  # reason, if we set the COLLECT_NAMES environment variable, the problems
4318  # vanish in a puff of smoke.
4319  if test set != "${COLLECT_NAMES+set}"; then
4320    COLLECT_NAMES=
4321    export COLLECT_NAMES
4322  fi
4323  ;;
4324esac
4325
4326# Global variables:
4327ofile=libtool
4328can_build_shared=yes
4329
4330# All known linkers require a '.a' archive for static linking (except MSVC and
4331# ICC, which need '.lib').
4332libext=a
4333
4334with_gnu_ld=$lt_cv_prog_gnu_ld
4335
4336old_CC=$CC
4337old_CFLAGS=$CFLAGS
4338
4339# Set sane defaults for various variables
4340test -z "$CC" && CC=cc
4341test -z "$LTCC" && LTCC=$CC
4342test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
4343test -z "$LD" && LD=ld
4344test -z "$ac_objext" && ac_objext=o
4345
4346_LT_CC_BASENAME([$compiler])
4347
4348# Only perform the check for file, if the check method requires it
4349test -z "$MAGIC_CMD" && MAGIC_CMD=file
4350case $deplibs_check_method in
4351file_magic*)
4352  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
4353    _LT_PATH_MAGIC
4354  fi
4355  ;;
4356esac
4357
4358# Use C for the default configuration in the libtool script
4359LT_SUPPORTED_TAG([CC])
4360_LT_LANG_C_CONFIG
4361_LT_LANG_DEFAULT_CONFIG
4362_LT_CONFIG_COMMANDS
4363])# _LT_SETUP
4364
4365
4366# _LT_PREPARE_SED_QUOTE_VARS
4367# --------------------------
4368# Define a few sed substitution that help us do robust quoting.
4369m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
4370[# Backslashify metacharacters that are still active within
4371# double-quoted strings.
4372sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
4373
4374# Same as above, but do not quote variable references.
4375double_quote_subst='s/\([["`\\]]\)/\\\1/g'
4376
4377# Sed substitution to delay expansion of an escaped shell variable in a
4378# double_quote_subst'ed string.
4379delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4380
4381# Sed substitution to delay expansion of an escaped single quote.
4382delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
4383
4384# Sed substitution to avoid accidental globbing in evaled expressions
4385no_glob_subst='s/\*/\\\*/g'
4386])
4387
4388# _LT_PROG_LTMAIN
4389# ---------------
4390# Note that this code is called both from 'configure', and 'config.status'
4391# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
4392# 'config.status' has no value for ac_aux_dir unless we are using Automake,
4393# so we pass a copy along to make sure it has a sensible value anyway.
4394m4_defun([_LT_PROG_LTMAIN],
4395[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
4396_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
4397ltmain=$ac_aux_dir/ltmain.sh
4398])# _LT_PROG_LTMAIN
4399
4400
4401
4402# So that we can recreate a full libtool script including additional
4403# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
4404# in macros and then make a single call at the end using the 'libtool'
4405# label.
4406
4407
4408# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
4409# ----------------------------------------
4410# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
4411m4_define([_LT_CONFIG_LIBTOOL_INIT],
4412[m4_ifval([$1],
4413          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
4414                     [$1
4415])])])
4416
4417# Initialize.
4418m4_define([_LT_OUTPUT_LIBTOOL_INIT])
4419
4420
4421# _LT_CONFIG_LIBTOOL([COMMANDS])
4422# ------------------------------
4423# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
4424m4_define([_LT_CONFIG_LIBTOOL],
4425[m4_ifval([$1],
4426          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
4427                     [$1
4428])])])
4429
4430# Initialize.
4431m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
4432
4433
4434# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
4435# -----------------------------------------------------
4436m4_defun([_LT_CONFIG_SAVE_COMMANDS],
4437[_LT_CONFIG_LIBTOOL([$1])
4438_LT_CONFIG_LIBTOOL_INIT([$2])
4439])
4440
4441
4442# _LT_FORMAT_COMMENT([COMMENT])
4443# -----------------------------
4444# Add leading comment marks to the start of each line, and a trailing
4445# full-stop to the whole comment if one is not present already.
4446m4_define([_LT_FORMAT_COMMENT],
4447[m4_ifval([$1], [
4448m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
4449              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
4450)])
4451
4452
4453
4454
4455
4456# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
4457# -------------------------------------------------------------------
4458# CONFIGNAME is the name given to the value in the libtool script.
4459# VARNAME is the (base) name used in the configure script.
4460# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
4461# VARNAME.  Any other value will be used directly.
4462m4_define([_LT_DECL],
4463[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
4464    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
4465	[m4_ifval([$1], [$1], [$2])])
4466    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
4467    m4_ifval([$4],
4468	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
4469    lt_dict_add_subkey([lt_decl_dict], [$2],
4470	[tagged?], [m4_ifval([$5], [yes], [no])])])
4471])
4472
4473
4474# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
4475# --------------------------------------------------------
4476m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
4477
4478
4479# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
4480# ------------------------------------------------
4481m4_define([lt_decl_tag_varnames],
4482[_lt_decl_filter([tagged?], [yes], $@)])
4483
4484
4485# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
4486# ---------------------------------------------------------
4487m4_define([_lt_decl_filter],
4488[m4_case([$#],
4489  [0], [m4_fatal([$0: too few arguments: $#])],
4490  [1], [m4_fatal([$0: too few arguments: $#: $1])],
4491  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
4492  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
4493  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
4494])
4495
4496
4497# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
4498# --------------------------------------------------
4499m4_define([lt_decl_quote_varnames],
4500[_lt_decl_filter([value], [1], $@)])
4501
4502
4503# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
4504# ---------------------------------------------------
4505m4_define([lt_decl_dquote_varnames],
4506[_lt_decl_filter([value], [2], $@)])
4507
4508
4509# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
4510# ---------------------------------------------------
4511m4_define([lt_decl_varnames_tagged],
4512[m4_assert([$# <= 2])dnl
4513_$0(m4_quote(m4_default([$1], [[, ]])),
4514    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
4515    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
4516m4_define([_lt_decl_varnames_tagged],
4517[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
4518
4519
4520# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
4521# ------------------------------------------------
4522m4_define([lt_decl_all_varnames],
4523[_$0(m4_quote(m4_default([$1], [[, ]])),
4524     m4_if([$2], [],
4525	   m4_quote(lt_decl_varnames),
4526	m4_quote(m4_shift($@))))[]dnl
4527])
4528m4_define([_lt_decl_all_varnames],
4529[lt_join($@, lt_decl_varnames_tagged([$1],
4530			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4531])
4532
4533
4534# _LT_CONFIG_STATUS_DECLARE([VARNAME])
4535# ------------------------------------
4536# Quote a variable value, and forward it to 'config.status' so that its
4537# declaration there will have the same value as in 'configure'.  VARNAME
4538# must have a single quote delimited value for this to work.
4539m4_define([_LT_CONFIG_STATUS_DECLARE],
4540[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
4541
4542
4543# _LT_CONFIG_STATUS_DECLARATIONS
4544# ------------------------------
4545# We delimit libtool config variables with single quotes, so when
4546# we write them to config.status, we have to be sure to quote all
4547# embedded single quotes properly.  In configure, this macro expands
4548# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
4549#
4550#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
4551m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
4552[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
4553    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
4554
4555
4556# _LT_LIBTOOL_TAGS
4557# ----------------
4558# Output comment and list of tags supported by the script
4559m4_defun([_LT_LIBTOOL_TAGS],
4560[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4561available_tags='_LT_TAGS'dnl
4562])
4563
4564
4565# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
4566# -----------------------------------
4567# Extract the dictionary values for VARNAME (optionally with TAG) and
4568# expand to a commented shell variable setting:
4569#
4570#    # Some comment about what VAR is for.
4571#    visible_name=$lt_internal_name
4572m4_define([_LT_LIBTOOL_DECLARE],
4573[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
4574					   [description])))[]dnl
4575m4_pushdef([_libtool_name],
4576    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
4577m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
4578    [0], [_libtool_name=[$]$1],
4579    [1], [_libtool_name=$lt_[]$1],
4580    [2], [_libtool_name=$lt_[]$1],
4581    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
4582m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
4583])
4584
4585
4586# _LT_LIBTOOL_CONFIG_VARS
4587# -----------------------
4588# Produce commented declarations of non-tagged libtool config variables
4589# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
4590# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
4591# section) are produced by _LT_LIBTOOL_TAG_VARS.
4592m4_defun([_LT_LIBTOOL_CONFIG_VARS],
4593[m4_foreach([_lt_var],
4594    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
4595    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
4596
4597
4598# _LT_LIBTOOL_TAG_VARS(TAG)
4599# -------------------------
4600m4_define([_LT_LIBTOOL_TAG_VARS],
4601[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
4602    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
4603
4604
4605# _LT_TAGVAR(VARNAME, [TAGNAME])
4606# ------------------------------
4607m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
4608
4609
4610# _LT_CONFIG_COMMANDS
4611# -------------------
4612# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
4613# variables for single and double quote escaping we saved from calls
4614# to _LT_DECL, we can put quote escaped variables declarations
4615# into 'config.status', and then the shell code to quote escape them in
4616# for loops in 'config.status'.  Finally, any additional code accumulated
4617# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
4618m4_defun([_LT_CONFIG_COMMANDS],
4619[AC_PROVIDE_IFELSE([LT_OUTPUT],
4620	dnl If the libtool generation code has been placed in $CONFIG_LT,
4621	dnl instead of duplicating it all over again into config.status,
4622	dnl then we will have config.status run $CONFIG_LT later, so it
4623	dnl needs to know what name is stored there:
4624        [AC_CONFIG_COMMANDS([libtool],
4625            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
4626    dnl If the libtool generation code is destined for config.status,
4627    dnl expand the accumulated commands and init code now:
4628    [AC_CONFIG_COMMANDS([libtool],
4629        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
4630])#_LT_CONFIG_COMMANDS
4631
4632
4633# Initialize.
4634m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
4635[
4636
4637# The HP-UX ksh and POSIX shell print the target directory to stdout
4638# if CDPATH is set.
4639(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4640
4641sed_quote_subst='$sed_quote_subst'
4642double_quote_subst='$double_quote_subst'
4643delay_variable_subst='$delay_variable_subst'
4644_LT_CONFIG_STATUS_DECLARATIONS
4645LTCC='$LTCC'
4646LTCFLAGS='$LTCFLAGS'
4647compiler='$compiler_DEFAULT'
4648
4649# A function that is used when there is no print builtin or printf.
4650func_fallback_echo ()
4651{
4652  eval 'cat <<_LTECHO_EOF
4653\$[]1
4654_LTECHO_EOF'
4655}
4656
4657# Quote evaled strings.
4658for var in lt_decl_all_varnames([[ \
4659]], lt_decl_quote_varnames); do
4660    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
4661    *[[\\\\\\\`\\"\\\$]]*)
4662      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
4663      ;;
4664    *)
4665      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
4666      ;;
4667    esac
4668done
4669
4670# Double-quote double-evaled strings.
4671for var in lt_decl_all_varnames([[ \
4672]], lt_decl_dquote_varnames); do
4673    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
4674    *[[\\\\\\\`\\"\\\$]]*)
4675      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
4676      ;;
4677    *)
4678      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
4679      ;;
4680    esac
4681done
4682
4683_LT_OUTPUT_LIBTOOL_INIT
4684])
4685
4686# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
4687# ------------------------------------
4688# Generate a child script FILE with all initialization necessary to
4689# reuse the environment learned by the parent script, and make the
4690# file executable.  If COMMENT is supplied, it is inserted after the
4691# '#!' sequence but before initialization text begins.  After this
4692# macro, additional text can be appended to FILE to form the body of
4693# the child script.  The macro ends with non-zero status if the
4694# file could not be fully written (such as if the disk is full).
4695m4_ifdef([AS_INIT_GENERATED],
4696[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
4697[m4_defun([_LT_GENERATED_FILE_INIT],
4698[m4_require([AS_PREPARE])]dnl
4699[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
4700[lt_write_fail=0
4701cat >$1 <<_ASEOF || lt_write_fail=1
4702#! $SHELL
4703# Generated by $as_me.
4704$2
4705SHELL=\${CONFIG_SHELL-$SHELL}
4706export SHELL
4707_ASEOF
4708cat >>$1 <<\_ASEOF || lt_write_fail=1
4709AS_SHELL_SANITIZE
4710_AS_PREPARE
4711exec AS_MESSAGE_FD>&1
4712_ASEOF
4713test 0 = "$lt_write_fail" && chmod +x $1[]dnl
4714m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
4715
4716# LT_OUTPUT
4717# ---------
4718# This macro allows early generation of the libtool script (before
4719# AC_OUTPUT is called), incase it is used in configure for compilation
4720# tests.
4721AC_DEFUN([LT_OUTPUT],
4722[: ${CONFIG_LT=./config.lt}
4723AC_MSG_NOTICE([creating $CONFIG_LT])
4724_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
4725[# Run this file to recreate a libtool stub with the current configuration.])
4726
4727cat >>"$CONFIG_LT" <<\_LTEOF
4728lt_cl_silent=false
4729exec AS_MESSAGE_LOG_FD>>config.log
4730{
4731  echo
4732  AS_BOX([Running $as_me.])
4733} >&AS_MESSAGE_LOG_FD
4734
4735lt_cl_help="\
4736'$as_me' creates a local libtool stub from the current configuration,
4737for use in further configure time tests before the real libtool is
4738generated.
4739
4740Usage: $[0] [[OPTIONS]]
4741
4742  -h, --help      print this help, then exit
4743  -V, --version   print version number, then exit
4744  -q, --quiet     do not print progress messages
4745  -d, --debug     don't remove temporary files
4746
4747Report bugs to <bug-libtool@gnu.org>."
4748
4749lt_cl_version="\
4750m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
4751m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
4752configured by $[0], generated by m4_PACKAGE_STRING.
4753
4754Copyright (C) 2011 Free Software Foundation, Inc.
4755This config.lt script is free software; the Free Software Foundation
4756gives unlimited permision to copy, distribute and modify it."
4757
4758while test 0 != $[#]
4759do
4760  case $[1] in
4761    --version | --v* | -V )
4762      echo "$lt_cl_version"; exit 0 ;;
4763    --help | --h* | -h )
4764      echo "$lt_cl_help"; exit 0 ;;
4765    --debug | --d* | -d )
4766      debug=: ;;
4767    --quiet | --q* | --silent | --s* | -q )
4768      lt_cl_silent=: ;;
4769
4770    -*) AC_MSG_ERROR([unrecognized option: $[1]
4771Try '$[0] --help' for more information.]) ;;
4772
4773    *) AC_MSG_ERROR([unrecognized argument: $[1]
4774Try '$[0] --help' for more information.]) ;;
4775  esac
4776  shift
4777done
4778
4779if $lt_cl_silent; then
4780  exec AS_MESSAGE_FD>/dev/null
4781fi
4782_LTEOF
4783
4784cat >>"$CONFIG_LT" <<_LTEOF
4785_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
4786_LTEOF
4787
4788cat >>"$CONFIG_LT" <<\_LTEOF
4789AC_MSG_NOTICE([creating $ofile])
4790_LT_OUTPUT_LIBTOOL_COMMANDS
4791AS_EXIT(0)
4792_LTEOF
4793chmod +x "$CONFIG_LT"
4794
4795# configure is writing to config.log, but config.lt does its own redirection,
4796# appending to config.log, which fails on DOS, as config.log is still kept
4797# open by configure.  Here we exec the FD to /dev/null, effectively closing
4798# config.log, so it can be properly (re)opened and appended to by config.lt.
4799lt_cl_success=:
4800test yes = "$silent" &&
4801  lt_config_lt_args="$lt_config_lt_args --quiet"
4802exec AS_MESSAGE_LOG_FD>/dev/null
4803$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
4804exec AS_MESSAGE_LOG_FD>>config.log
4805$lt_cl_success || AS_EXIT(1)
4806])# LT_OUTPUT
4807
4808
4809# _LT_CONFIG(TAG)
4810# ---------------
4811# If TAG is the built-in tag, create an initial libtool script with a
4812# default configuration from the untagged config vars.  Otherwise add code
4813# to config.status for appending the configuration named by TAG from the
4814# matching tagged config vars.
4815m4_defun([_LT_CONFIG],
4816[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4817_LT_CONFIG_SAVE_COMMANDS([
4818  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
4819  m4_if(_LT_TAG, [C], [
4820    # See if we are running on zsh, and set the options that allow our
4821    # commands through without removal of \ escapes.
4822    if test -n "${ZSH_VERSION+set}"; then
4823      setopt NO_GLOB_SUBST
4824    fi
4825
4826    cfgfile=${ofile}T
4827    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
4828    $RM "$cfgfile"
4829
4830    cat <<_LT_EOF >> "$cfgfile"
4831#! $SHELL
4832# Generated automatically by $as_me ($PACKAGE) $VERSION
4833# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4834# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4835
4836# Provide generalized library-building support services.
4837# Written by Gordon Matzigkeit, 1996
4838
4839_LT_COPYING
4840_LT_LIBTOOL_TAGS
4841
4842# Configured defaults for sys_lib_dlsearch_path munging.
4843: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
4844
4845# ### BEGIN LIBTOOL CONFIG
4846_LT_LIBTOOL_CONFIG_VARS
4847_LT_LIBTOOL_TAG_VARS
4848# ### END LIBTOOL CONFIG
4849
4850_LT_EOF
4851
4852    cat <<'_LT_EOF' >> "$cfgfile"
4853
4854# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
4855
4856_LT_PREPARE_MUNGE_PATH_LIST
4857_LT_PREPARE_CC_BASENAME
4858
4859# ### END FUNCTIONS SHARED WITH CONFIGURE
4860
4861_LT_EOF
4862
4863  case $host_os in
4864  aix3*)
4865    cat <<\_LT_EOF >> "$cfgfile"
4866# AIX sometimes has problems with the GCC collect2 program.  For some
4867# reason, if we set the COLLECT_NAMES environment variable, the problems
4868# vanish in a puff of smoke.
4869if test set != "${COLLECT_NAMES+set}"; then
4870  COLLECT_NAMES=
4871  export COLLECT_NAMES
4872fi
4873_LT_EOF
4874    ;;
4875  esac
4876
4877  _LT_PROG_LTMAIN
4878
4879  # We use sed instead of cat because bash on DJGPP gets confused if
4880  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4881  # text mode, it properly converts lines to CR/LF.  This bash problem
4882  # is reportedly fixed, but why not run on old versions too?
4883  $SED '$q' "$ltmain" >> "$cfgfile" \
4884     || (rm -f "$cfgfile"; exit 1)
4885
4886   mv -f "$cfgfile" "$ofile" ||
4887    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4888  chmod +x "$ofile"
4889],
4890[cat <<_LT_EOF >> "$ofile"
4891
4892dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
4893dnl in a comment (ie after a #).
4894# ### BEGIN LIBTOOL TAG CONFIG: $1
4895_LT_LIBTOOL_TAG_VARS(_LT_TAG)
4896# ### END LIBTOOL TAG CONFIG: $1
4897_LT_EOF
4898])dnl /m4_if
4899],
4900[m4_if([$1], [], [
4901    PACKAGE='$PACKAGE'
4902    VERSION='$VERSION'
4903    RM='$RM'
4904    ofile='$ofile'], [])
4905])dnl /_LT_CONFIG_SAVE_COMMANDS
4906])# _LT_CONFIG
4907
4908
4909# LT_SUPPORTED_TAG(TAG)
4910# ---------------------
4911# Trace this macro to discover what tags are supported by the libtool
4912# --tag option, using:
4913#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
4914AC_DEFUN([LT_SUPPORTED_TAG], [])
4915
4916
4917# C support is built-in for now
4918m4_define([_LT_LANG_C_enabled], [])
4919m4_define([_LT_TAGS], [])
4920
4921
4922# LT_LANG(LANG)
4923# -------------
4924# Enable libtool support for the given language if not already enabled.
4925AC_DEFUN([LT_LANG],
4926[AC_BEFORE([$0], [LT_OUTPUT])dnl
4927m4_case([$1],
4928  [C],			[_LT_LANG(C)],
4929  [C++],		[_LT_LANG(CXX)],
4930  [Go],			[_LT_LANG(GO)],
4931  [Java],		[_LT_LANG(GCJ)],
4932  [Fortran 77],		[_LT_LANG(F77)],
4933  [Fortran],		[_LT_LANG(FC)],
4934  [Windows Resource],	[_LT_LANG(RC)],
4935  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
4936    [_LT_LANG($1)],
4937    [m4_fatal([$0: unsupported language: "$1"])])])dnl
4938])# LT_LANG
4939
4940
4941# _LT_LANG(LANGNAME)
4942# ------------------
4943m4_defun([_LT_LANG],
4944[m4_ifdef([_LT_LANG_]$1[_enabled], [],
4945  [LT_SUPPORTED_TAG([$1])dnl
4946  m4_append([_LT_TAGS], [$1 ])dnl
4947  m4_define([_LT_LANG_]$1[_enabled], [])dnl
4948  _LT_LANG_$1_CONFIG($1)])dnl
4949])# _LT_LANG
4950
4951
4952m4_ifndef([AC_PROG_GO], [
4953# NOTE: This macro has been submitted for inclusion into   #
4954#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
4955#  a released version of Autoconf we should remove this    #
4956#  macro and use it instead.                               #
4957m4_defun([AC_PROG_GO],
4958[AC_LANG_PUSH(Go)dnl
4959AC_ARG_VAR([GOC],     [Go compiler command])dnl
4960AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
4961_AC_ARG_VAR_LDFLAGS()dnl
4962AC_CHECK_TOOL(GOC, gccgo)
4963if test -z "$GOC"; then
4964  if test -n "$ac_tool_prefix"; then
4965    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
4966  fi
4967fi
4968if test -z "$GOC"; then
4969  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
4970fi
4971])#m4_defun
4972])#m4_ifndef
4973
4974
4975# _LT_LANG_DEFAULT_CONFIG
4976# -----------------------
4977m4_defun([_LT_LANG_DEFAULT_CONFIG],
4978[AC_PROVIDE_IFELSE([AC_PROG_CXX],
4979  [LT_LANG(CXX)],
4980  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
4981
4982AC_PROVIDE_IFELSE([AC_PROG_F77],
4983  [LT_LANG(F77)],
4984  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
4985
4986AC_PROVIDE_IFELSE([AC_PROG_FC],
4987  [LT_LANG(FC)],
4988  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
4989
4990dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
4991dnl pulling things in needlessly.
4992AC_PROVIDE_IFELSE([AC_PROG_GCJ],
4993  [LT_LANG(GCJ)],
4994  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
4995    [LT_LANG(GCJ)],
4996    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
4997      [LT_LANG(GCJ)],
4998      [m4_ifdef([AC_PROG_GCJ],
4999	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
5000       m4_ifdef([A][M_PROG_GCJ],
5001	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
5002       m4_ifdef([LT_PROG_GCJ],
5003	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
5004
5005AC_PROVIDE_IFELSE([AC_PROG_GO],
5006  [LT_LANG(GO)],
5007  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
5008
5009AC_PROVIDE_IFELSE([LT_PROG_RC],
5010  [LT_LANG(RC)],
5011  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
5012])# _LT_LANG_DEFAULT_CONFIG
5013
5014# Obsolete macros:
5015AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
5016AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
5017AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
5018AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
5019AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
5020dnl aclocal-1.4 backwards compatibility:
5021dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
5022dnl AC_DEFUN([AC_LIBTOOL_F77], [])
5023dnl AC_DEFUN([AC_LIBTOOL_FC], [])
5024dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
5025dnl AC_DEFUN([AC_LIBTOOL_RC], [])
5026
5027
5028# _LT_TAG_COMPILER
5029# ----------------
5030m4_defun([_LT_TAG_COMPILER],
5031[AC_REQUIRE([AC_PROG_CC])dnl
5032
5033_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
5034_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
5035_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
5036_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
5037
5038# If no C compiler was specified, use CC.
5039LTCC=${LTCC-"$CC"}
5040
5041# If no C compiler flags were specified, use CFLAGS.
5042LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
5043
5044# Allow CC to be a program name with arguments.
5045compiler=$CC
5046])# _LT_TAG_COMPILER
5047
5048
5049# _LT_COMPILER_BOILERPLATE
5050# ------------------------
5051# Check for compiler boilerplate output or warnings with
5052# the simple compiler test code.
5053m4_defun([_LT_COMPILER_BOILERPLATE],
5054[m4_require([_LT_DECL_SED])dnl
5055ac_outfile=conftest.$ac_objext
5056echo "$lt_simple_compile_test_code" >conftest.$ac_ext
5057eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
5058_lt_compiler_boilerplate=`cat conftest.err`
5059$RM conftest*
5060])# _LT_COMPILER_BOILERPLATE
5061
5062
5063# _LT_LINKER_BOILERPLATE
5064# ----------------------
5065# Check for linker boilerplate output or warnings with
5066# the simple link test code.
5067m4_defun([_LT_LINKER_BOILERPLATE],
5068[m4_require([_LT_DECL_SED])dnl
5069ac_outfile=conftest.$ac_objext
5070echo "$lt_simple_link_test_code" >conftest.$ac_ext
5071eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
5072_lt_linker_boilerplate=`cat conftest.err`
5073$RM -r conftest*
5074])# _LT_LINKER_BOILERPLATE
5075
5076# _LT_REQUIRED_DARWIN_CHECKS
5077# -------------------------
5078m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
5079  case $host_os in
5080    rhapsody* | darwin*)
5081    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
5082    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
5083    AC_CHECK_TOOL([LIPO], [lipo], [:])
5084    AC_CHECK_TOOL([OTOOL], [otool], [:])
5085    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
5086    _LT_DECL([], [DSYMUTIL], [1],
5087      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
5088    _LT_DECL([], [NMEDIT], [1],
5089      [Tool to change global to local symbols on Mac OS X])
5090    _LT_DECL([], [LIPO], [1],
5091      [Tool to manipulate fat objects and archives on Mac OS X])
5092    _LT_DECL([], [OTOOL], [1],
5093      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
5094    _LT_DECL([], [OTOOL64], [1],
5095      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
5096
5097    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
5098      [lt_cv_apple_cc_single_mod=no
5099      if test -z "$LT_MULTI_MODULE"; then
5100	# By default we will add the -single_module flag. You can override
5101	# by either setting the environment variable LT_MULTI_MODULE
5102	# non-empty at configure time, or by adding -multi_module to the
5103	# link flags.
5104	rm -rf libconftest.dylib*
5105	echo "int foo(void){return 1;}" > conftest.c
5106	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
5107-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
5108	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
5109	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
5110        _lt_result=$?
5111	# If there is a non-empty error log, and "single_module"
5112	# appears in it, assume the flag caused a linker warning
5113        if test -s conftest.err && $GREP single_module conftest.err; then
5114	  cat conftest.err >&AS_MESSAGE_LOG_FD
5115	# Otherwise, if the output was created with a 0 exit code from
5116	# the compiler, it worked.
5117	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
5118	  lt_cv_apple_cc_single_mod=yes
5119	else
5120	  cat conftest.err >&AS_MESSAGE_LOG_FD
5121	fi
5122	rm -rf libconftest.dylib*
5123	rm -f conftest.*
5124      fi])
5125
5126    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
5127      [lt_cv_ld_exported_symbols_list],
5128      [lt_cv_ld_exported_symbols_list=no
5129      save_LDFLAGS=$LDFLAGS
5130      echo "_main" > conftest.sym
5131      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
5132      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
5133	[lt_cv_ld_exported_symbols_list=yes],
5134	[lt_cv_ld_exported_symbols_list=no])
5135	LDFLAGS=$save_LDFLAGS
5136    ])
5137
5138    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
5139      [lt_cv_ld_force_load=no
5140      cat > conftest.c << _LT_EOF
5141int forced_loaded() { return 2;}
5142_LT_EOF
5143      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
5144      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
5145      echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
5146      $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
5147      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
5148      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
5149      cat > conftest.c << _LT_EOF
5150int main() { return 0;}
5151_LT_EOF
5152      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
5153      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
5154      _lt_result=$?
5155      if test -s conftest.err && $GREP force_load conftest.err; then
5156	cat conftest.err >&AS_MESSAGE_LOG_FD
5157      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
5158	lt_cv_ld_force_load=yes
5159      else
5160	cat conftest.err >&AS_MESSAGE_LOG_FD
5161      fi
5162        rm -f conftest.err libconftest.a conftest conftest.c
5163        rm -rf conftest.dSYM
5164    ])
5165    case $host_os in
5166    rhapsody* | darwin1.[[012]])
5167      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
5168    darwin1.*)
5169      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
5170    darwin*)
5171      case $MACOSX_DEPLOYMENT_TARGET,$host in
5172        10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
5173          _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
5174        *)
5175          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
5176      esac
5177    ;;
5178  esac
5179    if test yes = "$lt_cv_apple_cc_single_mod"; then
5180      _lt_dar_single_mod='$single_module'
5181    fi
5182    if test yes = "$lt_cv_ld_exported_symbols_list"; then
5183      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
5184    else
5185      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
5186    fi
5187    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
5188      _lt_dsymutil='~$DSYMUTIL $lib || :'
5189    else
5190      _lt_dsymutil=
5191    fi
5192    ;;
5193  esac
5194])
5195
5196
5197# _LT_DARWIN_LINKER_FEATURES([TAG])
5198# ---------------------------------
5199# Checks for linker and compiler features on darwin
5200m4_defun([_LT_DARWIN_LINKER_FEATURES],
5201[
5202  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
5203  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5204  _LT_TAGVAR(hardcode_direct, $1)=no
5205  _LT_TAGVAR(hardcode_automatic, $1)=yes
5206  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5207  if test yes = "$lt_cv_ld_force_load"; then
5208    _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\"`'
5209    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
5210                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
5211  else
5212    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
5213  fi
5214  _LT_TAGVAR(link_all_deplibs, $1)=yes
5215  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
5216  case $cc_basename in
5217     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
5218     *) _lt_dar_can_shared=$GCC ;;
5219  esac
5220  if test yes = "$_lt_dar_can_shared"; then
5221    output_verbose_link_cmd=func_echo_all
5222    _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"
5223    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
5224    _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"
5225    _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"
5226    m4_if([$1], [CXX],
5227[   if test yes != "$lt_cv_apple_cc_single_mod"; then
5228      _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"
5229      _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"
5230    fi
5231],[])
5232  else
5233  _LT_TAGVAR(ld_shlibs, $1)=no
5234  fi
5235])
5236
5237# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
5238# ----------------------------------
5239# Links a minimal program and checks the executable
5240# for the system default hardcoded library path. In most cases,
5241# this is /usr/lib:/lib, but when the MPI compilers are used
5242# the location of the communication and MPI libs are included too.
5243# If we don't find anything, use the default library path according
5244# to the aix ld manual.
5245# Store the results from the different compilers for each TAGNAME.
5246# Allow to override them for all tags through lt_cv_aix_libpath.
5247m4_defun([_LT_SYS_MODULE_PATH_AIX],
5248[m4_require([_LT_DECL_SED])dnl
5249if test set = "${lt_cv_aix_libpath+set}"; then
5250  aix_libpath=$lt_cv_aix_libpath
5251else
5252  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
5253  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
5254  lt_aix_libpath_sed='[
5255      /Import File Strings/,/^$/ {
5256	  /^0/ {
5257	      s/^0  *\([^ ]*\) *$/\1/
5258	      p
5259	  }
5260      }]'
5261  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
5262  # Check for a 64-bit object if we didn't find anything.
5263  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
5264    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
5265  fi],[])
5266  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
5267    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
5268  fi
5269  ])
5270  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
5271fi
5272])# _LT_SYS_MODULE_PATH_AIX
5273
5274
5275# _LT_SHELL_INIT(ARG)
5276# -------------------
5277m4_define([_LT_SHELL_INIT],
5278[m4_divert_text([M4SH-INIT], [$1
5279])])# _LT_SHELL_INIT
5280
5281
5282
5283# _LT_PROG_ECHO_BACKSLASH
5284# -----------------------
5285# Find how we can fake an echo command that does not interpret backslash.
5286# In particular, with Autoconf 2.60 or later we add some code to the start
5287# of the generated configure script that will find a shell with a builtin
5288# printf (that we can use as an echo command).
5289m4_defun([_LT_PROG_ECHO_BACKSLASH],
5290[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
5291ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
5292ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
5293
5294AC_MSG_CHECKING([how to print strings])
5295# Test print first, because it will be a builtin if present.
5296if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
5297   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
5298  ECHO='print -r --'
5299elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
5300  ECHO='printf %s\n'
5301else
5302  # Use this function as a fallback that always works.
5303  func_fallback_echo ()
5304  {
5305    eval 'cat <<_LTECHO_EOF
5306$[]1
5307_LTECHO_EOF'
5308  }
5309  ECHO='func_fallback_echo'
5310fi
5311
5312# func_echo_all arg...
5313# Invoke $ECHO with all args, space-separated.
5314func_echo_all ()
5315{
5316    $ECHO "$*"
5317}
5318
5319case $ECHO in
5320  printf*) AC_MSG_RESULT([printf]) ;;
5321  print*) AC_MSG_RESULT([print -r]) ;;
5322  *) AC_MSG_RESULT([cat]) ;;
5323esac
5324
5325m4_ifdef([_AS_DETECT_SUGGESTED],
5326[_AS_DETECT_SUGGESTED([
5327  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
5328    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
5329    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
5330    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
5331    PATH=/empty FPATH=/empty; export PATH FPATH
5332    test "X`printf %s $ECHO`" = "X$ECHO" \
5333      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
5334
5335_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
5336_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
5337])# _LT_PROG_ECHO_BACKSLASH
5338
5339
5340# _LT_WITH_SYSROOT
5341# ----------------
5342AC_DEFUN([_LT_WITH_SYSROOT],
5343[m4_require([_LT_DECL_SED])dnl
5344AC_MSG_CHECKING([for sysroot])
5345AC_ARG_WITH([sysroot],
5346[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
5347  [Search for dependent libraries within DIR (or the compiler's sysroot
5348   if not specified).])],
5349[], [with_sysroot=no])
5350
5351dnl lt_sysroot will always be passed unquoted.  We quote it here
5352dnl in case the user passed a directory name.
5353lt_sysroot=
5354case $with_sysroot in #(
5355 yes)
5356   if test yes = "$GCC"; then
5357     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
5358   fi
5359   ;; #(
5360 /*)
5361   lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
5362   ;; #(
5363 no|'')
5364   ;; #(
5365 *)
5366   AC_MSG_RESULT([$with_sysroot])
5367   AC_MSG_ERROR([The sysroot must be an absolute path.])
5368   ;;
5369esac
5370
5371 AC_MSG_RESULT([${lt_sysroot:-no}])
5372_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
5373[dependent libraries, and where our libraries should be installed.])])
5374
5375# _LT_ENABLE_LOCK
5376# ---------------
5377m4_defun([_LT_ENABLE_LOCK],
5378[AC_ARG_ENABLE([libtool-lock],
5379  [AS_HELP_STRING([--disable-libtool-lock],
5380    [avoid locking (might break parallel builds)])])
5381test no = "$enable_libtool_lock" || enable_libtool_lock=yes
5382
5383# Some flags need to be propagated to the compiler or linker for good
5384# libtool support.
5385case $host in
5386ia64-*-hpux*)
5387  # Find out what ABI is being produced by ac_compile, and set mode
5388  # options accordingly.
5389  echo 'int i;' > conftest.$ac_ext
5390  if AC_TRY_EVAL(ac_compile); then
5391    case `$FILECMD conftest.$ac_objext` in
5392      *ELF-32*)
5393	HPUX_IA64_MODE=32
5394	;;
5395      *ELF-64*)
5396	HPUX_IA64_MODE=64
5397	;;
5398    esac
5399  fi
5400  rm -rf conftest*
5401  ;;
5402*-*-irix6*)
5403  # Find out what ABI is being produced by ac_compile, and set linker
5404  # options accordingly.
5405  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
5406  if AC_TRY_EVAL(ac_compile); then
5407    if test yes = "$lt_cv_prog_gnu_ld"; then
5408      case `$FILECMD conftest.$ac_objext` in
5409	*32-bit*)
5410	  LD="${LD-ld} -melf32bsmip"
5411	  ;;
5412	*N32*)
5413	  LD="${LD-ld} -melf32bmipn32"
5414	  ;;
5415	*64-bit*)
5416	  LD="${LD-ld} -melf64bmip"
5417	;;
5418      esac
5419    else
5420      case `$FILECMD conftest.$ac_objext` in
5421	*32-bit*)
5422	  LD="${LD-ld} -32"
5423	  ;;
5424	*N32*)
5425	  LD="${LD-ld} -n32"
5426	  ;;
5427	*64-bit*)
5428	  LD="${LD-ld} -64"
5429	  ;;
5430      esac
5431    fi
5432  fi
5433  rm -rf conftest*
5434  ;;
5435
5436mips64*-*linux*)
5437  # Find out what ABI is being produced by ac_compile, and set linker
5438  # options accordingly.
5439  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
5440  if AC_TRY_EVAL(ac_compile); then
5441    emul=elf
5442    case `$FILECMD conftest.$ac_objext` in
5443      *32-bit*)
5444	emul="${emul}32"
5445	;;
5446      *64-bit*)
5447	emul="${emul}64"
5448	;;
5449    esac
5450    case `$FILECMD conftest.$ac_objext` in
5451      *MSB*)
5452	emul="${emul}btsmip"
5453	;;
5454      *LSB*)
5455	emul="${emul}ltsmip"
5456	;;
5457    esac
5458    case `$FILECMD conftest.$ac_objext` in
5459      *N32*)
5460	emul="${emul}n32"
5461	;;
5462    esac
5463    LD="${LD-ld} -m $emul"
5464  fi
5465  rm -rf conftest*
5466  ;;
5467
5468x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
5469s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
5470  # Find out what ABI is being produced by ac_compile, and set linker
5471  # options accordingly.  Note that the listed cases only cover the
5472  # situations where additional linker options are needed (such as when
5473  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
5474  # vice versa); the common cases where no linker options are needed do
5475  # not appear in the list.
5476  echo 'int i;' > conftest.$ac_ext
5477  if AC_TRY_EVAL(ac_compile); then
5478    case `$FILECMD conftest.o` in
5479      *32-bit*)
5480	case $host in
5481	  x86_64-*kfreebsd*-gnu)
5482	    LD="${LD-ld} -m elf_i386_fbsd"
5483	    ;;
5484	  x86_64-*linux*)
5485	    case `$FILECMD conftest.o` in
5486	      *x86-64*)
5487		LD="${LD-ld} -m elf32_x86_64"
5488		;;
5489	      *)
5490		LD="${LD-ld} -m elf_i386"
5491		;;
5492	    esac
5493	    ;;
5494	  powerpc64le-*linux*)
5495	    LD="${LD-ld} -m elf32lppclinux"
5496	    ;;
5497	  powerpc64-*linux*)
5498	    LD="${LD-ld} -m elf32ppclinux"
5499	    ;;
5500	  s390x-*linux*)
5501	    LD="${LD-ld} -m elf_s390"
5502	    ;;
5503	  sparc64-*linux*)
5504	    LD="${LD-ld} -m elf32_sparc"
5505	    ;;
5506	esac
5507	;;
5508      *64-bit*)
5509	case $host in
5510	  x86_64-*kfreebsd*-gnu)
5511	    LD="${LD-ld} -m elf_x86_64_fbsd"
5512	    ;;
5513	  x86_64-*linux*)
5514	    LD="${LD-ld} -m elf_x86_64"
5515	    ;;
5516	  powerpcle-*linux*)
5517	    LD="${LD-ld} -m elf64lppc"
5518	    ;;
5519	  powerpc-*linux*)
5520	    LD="${LD-ld} -m elf64ppc"
5521	    ;;
5522	  s390*-*linux*|s390*-*tpf*)
5523	    LD="${LD-ld} -m elf64_s390"
5524	    ;;
5525	  sparc*-*linux*)
5526	    LD="${LD-ld} -m elf64_sparc"
5527	    ;;
5528	esac
5529	;;
5530    esac
5531  fi
5532  rm -rf conftest*
5533  ;;
5534
5535*-*-sco3.2v5*)
5536  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
5537  SAVE_CFLAGS=$CFLAGS
5538  CFLAGS="$CFLAGS -belf"
5539  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
5540    [AC_LANG_PUSH(C)
5541     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
5542     AC_LANG_POP])
5543  if test yes != "$lt_cv_cc_needs_belf"; then
5544    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
5545    CFLAGS=$SAVE_CFLAGS
5546  fi
5547  ;;
5548*-*solaris*)
5549  # Find out what ABI is being produced by ac_compile, and set linker
5550  # options accordingly.
5551  echo 'int i;' > conftest.$ac_ext
5552  if AC_TRY_EVAL(ac_compile); then
5553    case `$FILECMD conftest.o` in
5554    *64-bit*)
5555      case $lt_cv_prog_gnu_ld in
5556      yes*)
5557        case $host in
5558        i?86-*-solaris*|x86_64-*-solaris*)
5559          LD="${LD-ld} -m elf_x86_64"
5560          ;;
5561        sparc*-*-solaris*)
5562          LD="${LD-ld} -m elf64_sparc"
5563          ;;
5564        esac
5565        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
5566        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
5567          LD=${LD-ld}_sol2
5568        fi
5569        ;;
5570      *)
5571	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
5572	  LD="${LD-ld} -64"
5573	fi
5574	;;
5575      esac
5576      ;;
5577    esac
5578  fi
5579  rm -rf conftest*
5580  ;;
5581esac
5582
5583need_locks=$enable_libtool_lock
5584])# _LT_ENABLE_LOCK
5585
5586
5587# _LT_PROG_AR
5588# -----------
5589m4_defun([_LT_PROG_AR],
5590[AC_CHECK_TOOLS(AR, [ar], false)
5591: ${AR=ar}
5592_LT_DECL([], [AR], [1], [The archiver])
5593
5594# Use ARFLAGS variable as AR's operation code to sync the variable naming with
5595# Automake.  If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
5596# higher priority because thats what people were doing historically (setting
5597# ARFLAGS for automake and AR_FLAGS for libtool).  FIXME: Make the AR_FLAGS
5598# variable obsoleted/removed.
5599
5600test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
5601lt_ar_flags=$AR_FLAGS
5602_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
5603
5604# Make AR_FLAGS overridable by 'make ARFLAGS='.  Don't try to run-time override
5605# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
5606_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
5607         [Flags to create an archive])
5608
5609AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
5610  [lt_cv_ar_at_file=no
5611   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
5612     [echo conftest.$ac_objext > conftest.lst
5613      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
5614      AC_TRY_EVAL([lt_ar_try])
5615      if test 0 -eq "$ac_status"; then
5616	# Ensure the archiver fails upon bogus file names.
5617	rm -f conftest.$ac_objext libconftest.a
5618	AC_TRY_EVAL([lt_ar_try])
5619	if test 0 -ne "$ac_status"; then
5620          lt_cv_ar_at_file=@
5621        fi
5622      fi
5623      rm -f conftest.* libconftest.a
5624     ])
5625  ])
5626
5627if test no = "$lt_cv_ar_at_file"; then
5628  archiver_list_spec=
5629else
5630  archiver_list_spec=$lt_cv_ar_at_file
5631fi
5632_LT_DECL([], [archiver_list_spec], [1],
5633  [How to feed a file listing to the archiver])
5634])# _LT_PROG_AR
5635
5636
5637# _LT_CMD_OLD_ARCHIVE
5638# -------------------
5639m4_defun([_LT_CMD_OLD_ARCHIVE],
5640[_LT_PROG_AR
5641
5642AC_CHECK_TOOL(STRIP, strip, :)
5643test -z "$STRIP" && STRIP=:
5644_LT_DECL([], [STRIP], [1], [A symbol stripping program])
5645
5646AC_CHECK_TOOL(RANLIB, ranlib, :)
5647test -z "$RANLIB" && RANLIB=:
5648_LT_DECL([], [RANLIB], [1],
5649    [Commands used to install an old-style archive])
5650
5651# Determine commands to create old-style static archives.
5652old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
5653old_postinstall_cmds='chmod 644 $oldlib'
5654old_postuninstall_cmds=
5655
5656if test -n "$RANLIB"; then
5657  case $host_os in
5658  bitrig* | openbsd*)
5659    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
5660    ;;
5661  *)
5662    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
5663    ;;
5664  esac
5665  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
5666fi
5667
5668case $host_os in
5669  darwin*)
5670    lock_old_archive_extraction=yes ;;
5671  *)
5672    lock_old_archive_extraction=no ;;
5673esac
5674_LT_DECL([], [old_postinstall_cmds], [2])
5675_LT_DECL([], [old_postuninstall_cmds], [2])
5676_LT_TAGDECL([], [old_archive_cmds], [2],
5677    [Commands used to build an old-style archive])
5678_LT_DECL([], [lock_old_archive_extraction], [0],
5679    [Whether to use a lock for old archive extraction])
5680])# _LT_CMD_OLD_ARCHIVE
5681
5682
5683# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
5684#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
5685# ----------------------------------------------------------------
5686# Check whether the given compiler option works
5687AC_DEFUN([_LT_COMPILER_OPTION],
5688[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5689m4_require([_LT_DECL_SED])dnl
5690AC_CACHE_CHECK([$1], [$2],
5691  [$2=no
5692   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
5693   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5694   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
5695   # Insert the option either (1) after the last *FLAGS variable, or
5696   # (2) before a word containing "conftest.", or (3) at the end.
5697   # Note that $ac_compile itself does not contain backslashes and begins
5698   # with a dollar sign (not a hyphen), so the echo should work correctly.
5699   # The option is referenced via a variable to avoid confusing sed.
5700   lt_compile=`echo "$ac_compile" | $SED \
5701   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
5702   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
5703   -e 's:$: $lt_compiler_flag:'`
5704   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
5705   (eval "$lt_compile" 2>conftest.err)
5706   ac_status=$?
5707   cat conftest.err >&AS_MESSAGE_LOG_FD
5708   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
5709   if (exit $ac_status) && test -s "$ac_outfile"; then
5710     # The compiler can only warn and ignore the option if not recognized
5711     # So say no if there are warnings other than the usual output.
5712     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
5713     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
5714     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
5715       $2=yes
5716     fi
5717   fi
5718   $RM conftest*
5719])
5720
5721if test yes = "[$]$2"; then
5722    m4_if([$5], , :, [$5])
5723else
5724    m4_if([$6], , :, [$6])
5725fi
5726])# _LT_COMPILER_OPTION
5727
5728# Old name:
5729AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
5730dnl aclocal-1.4 backwards compatibility:
5731dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
5732
5733
5734# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
5735#                  [ACTION-SUCCESS], [ACTION-FAILURE])
5736# ----------------------------------------------------
5737# Check whether the given linker option works
5738AC_DEFUN([_LT_LINKER_OPTION],
5739[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5740m4_require([_LT_DECL_SED])dnl
5741AC_CACHE_CHECK([$1], [$2],
5742  [$2=no
5743   save_LDFLAGS=$LDFLAGS
5744   LDFLAGS="$LDFLAGS $3"
5745   echo "$lt_simple_link_test_code" > conftest.$ac_ext
5746   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
5747     # The linker can only warn and ignore the option if not recognized
5748     # So say no if there are warnings
5749     if test -s conftest.err; then
5750       # Append any errors to the config.log.
5751       cat conftest.err 1>&AS_MESSAGE_LOG_FD
5752       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
5753       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
5754       if diff conftest.exp conftest.er2 >/dev/null; then
5755         $2=yes
5756       fi
5757     else
5758       $2=yes
5759     fi
5760   fi
5761   $RM -r conftest*
5762   LDFLAGS=$save_LDFLAGS
5763])
5764
5765if test yes = "[$]$2"; then
5766    m4_if([$4], , :, [$4])
5767else
5768    m4_if([$5], , :, [$5])
5769fi
5770])# _LT_LINKER_OPTION
5771
5772# Old name:
5773AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
5774dnl aclocal-1.4 backwards compatibility:
5775dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
5776
5777
5778# LT_CMD_MAX_LEN
5779#---------------
5780AC_DEFUN([LT_CMD_MAX_LEN],
5781[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5782# find the maximum length of command line arguments
5783AC_MSG_CHECKING([the maximum length of command line arguments])
5784AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
5785  i=0
5786  teststring=ABCD
5787
5788  case $build_os in
5789  msdosdjgpp*)
5790    # On DJGPP, this test can blow up pretty badly due to problems in libc
5791    # (any single argument exceeding 2000 bytes causes a buffer overrun
5792    # during glob expansion).  Even if it were fixed, the result of this
5793    # check would be larger than it should be.
5794    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
5795    ;;
5796
5797  gnu*)
5798    # Under GNU Hurd, this test is not required because there is
5799    # no limit to the length of command line arguments.
5800    # Libtool will interpret -1 as no limit whatsoever
5801    lt_cv_sys_max_cmd_len=-1;
5802    ;;
5803
5804  cygwin* | mingw* | cegcc*)
5805    # On Win9x/ME, this test blows up -- it succeeds, but takes
5806    # about 5 minutes as the teststring grows exponentially.
5807    # Worse, since 9x/ME are not pre-emptively multitasking,
5808    # you end up with a "frozen" computer, even though with patience
5809    # the test eventually succeeds (with a max line length of 256k).
5810    # Instead, let's just punt: use the minimum linelength reported by
5811    # all of the supported platforms: 8192 (on NT/2K/XP).
5812    lt_cv_sys_max_cmd_len=8192;
5813    ;;
5814
5815  mint*)
5816    # On MiNT this can take a long time and run out of memory.
5817    lt_cv_sys_max_cmd_len=8192;
5818    ;;
5819
5820  amigaos*)
5821    # On AmigaOS with pdksh, this test takes hours, literally.
5822    # So we just punt and use a minimum line length of 8192.
5823    lt_cv_sys_max_cmd_len=8192;
5824    ;;
5825
5826  bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
5827    # This has been around since 386BSD, at least.  Likely further.
5828    if test -x /sbin/sysctl; then
5829      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
5830    elif test -x /usr/sbin/sysctl; then
5831      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
5832    else
5833      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
5834    fi
5835    # And add a safety zone
5836    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5837    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5838    ;;
5839
5840  interix*)
5841    # We know the value 262144 and hardcode it with a safety zone (like BSD)
5842    lt_cv_sys_max_cmd_len=196608
5843    ;;
5844
5845  os2*)
5846    # The test takes a long time on OS/2.
5847    lt_cv_sys_max_cmd_len=8192
5848    ;;
5849
5850  osf*)
5851    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
5852    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
5853    # nice to cause kernel panics so lets avoid the loop below.
5854    # First set a reasonable default.
5855    lt_cv_sys_max_cmd_len=16384
5856    #
5857    if test -x /sbin/sysconfig; then
5858      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
5859        *1*) lt_cv_sys_max_cmd_len=-1 ;;
5860      esac
5861    fi
5862    ;;
5863  sco3.2v5*)
5864    lt_cv_sys_max_cmd_len=102400
5865    ;;
5866  sysv5* | sco5v6* | sysv4.2uw2*)
5867    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
5868    if test -n "$kargmax"; then
5869      lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[	 ]]//'`
5870    else
5871      lt_cv_sys_max_cmd_len=32768
5872    fi
5873    ;;
5874  *)
5875    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
5876    if test -n "$lt_cv_sys_max_cmd_len" && \
5877       test undefined != "$lt_cv_sys_max_cmd_len"; then
5878      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5879      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5880    else
5881      # Make teststring a little bigger before we do anything with it.
5882      # a 1K string should be a reasonable start.
5883      for i in 1 2 3 4 5 6 7 8; do
5884        teststring=$teststring$teststring
5885      done
5886      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
5887      # If test is not a shell built-in, we'll probably end up computing a
5888      # maximum length that is only half of the actual maximum length, but
5889      # we can't tell.
5890      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
5891	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
5892	      test 17 != "$i" # 1/2 MB should be enough
5893      do
5894        i=`expr $i + 1`
5895        teststring=$teststring$teststring
5896      done
5897      # Only check the string length outside the loop.
5898      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
5899      teststring=
5900      # Add a significant safety factor because C++ compilers can tack on
5901      # massive amounts of additional arguments before passing them to the
5902      # linker.  It appears as though 1/2 is a usable value.
5903      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
5904    fi
5905    ;;
5906  esac
5907])
5908if test -n "$lt_cv_sys_max_cmd_len"; then
5909  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
5910else
5911  AC_MSG_RESULT(none)
5912fi
5913max_cmd_len=$lt_cv_sys_max_cmd_len
5914_LT_DECL([], [max_cmd_len], [0],
5915    [What is the maximum length of a command?])
5916])# LT_CMD_MAX_LEN
5917
5918# Old name:
5919AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
5920dnl aclocal-1.4 backwards compatibility:
5921dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
5922
5923
5924# _LT_HEADER_DLFCN
5925# ----------------
5926m4_defun([_LT_HEADER_DLFCN],
5927[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
5928])# _LT_HEADER_DLFCN
5929
5930
5931# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
5932#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
5933# ----------------------------------------------------------------
5934m4_defun([_LT_TRY_DLOPEN_SELF],
5935[m4_require([_LT_HEADER_DLFCN])dnl
5936if test yes = "$cross_compiling"; then :
5937  [$4]
5938else
5939  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
5940  lt_status=$lt_dlunknown
5941  cat > conftest.$ac_ext <<_LT_EOF
5942[#line $LINENO "configure"
5943#include "confdefs.h"
5944
5945#if HAVE_DLFCN_H
5946#include <dlfcn.h>
5947#endif
5948
5949#include <stdio.h>
5950
5951#ifdef RTLD_GLOBAL
5952#  define LT_DLGLOBAL		RTLD_GLOBAL
5953#else
5954#  ifdef DL_GLOBAL
5955#    define LT_DLGLOBAL		DL_GLOBAL
5956#  else
5957#    define LT_DLGLOBAL		0
5958#  endif
5959#endif
5960
5961/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
5962   find out it does not work in some platform. */
5963#ifndef LT_DLLAZY_OR_NOW
5964#  ifdef RTLD_LAZY
5965#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
5966#  else
5967#    ifdef DL_LAZY
5968#      define LT_DLLAZY_OR_NOW		DL_LAZY
5969#    else
5970#      ifdef RTLD_NOW
5971#        define LT_DLLAZY_OR_NOW	RTLD_NOW
5972#      else
5973#        ifdef DL_NOW
5974#          define LT_DLLAZY_OR_NOW	DL_NOW
5975#        else
5976#          define LT_DLLAZY_OR_NOW	0
5977#        endif
5978#      endif
5979#    endif
5980#  endif
5981#endif
5982
5983/* When -fvisibility=hidden is used, assume the code has been annotated
5984   correspondingly for the symbols needed.  */
5985#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
5986int fnord () __attribute__((visibility("default")));
5987#endif
5988
5989int fnord () { return 42; }
5990int main ()
5991{
5992  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
5993  int status = $lt_dlunknown;
5994
5995  if (self)
5996    {
5997      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
5998      else
5999        {
6000	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
6001          else puts (dlerror ());
6002	}
6003      /* dlclose (self); */
6004    }
6005  else
6006    puts (dlerror ());
6007
6008  return status;
6009}]
6010_LT_EOF
6011  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
6012    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
6013    lt_status=$?
6014    case x$lt_status in
6015      x$lt_dlno_uscore) $1 ;;
6016      x$lt_dlneed_uscore) $2 ;;
6017      x$lt_dlunknown|x*) $3 ;;
6018    esac
6019  else :
6020    # compilation failed
6021    $3
6022  fi
6023fi
6024rm -fr conftest*
6025])# _LT_TRY_DLOPEN_SELF
6026
6027
6028# LT_SYS_DLOPEN_SELF
6029# ------------------
6030AC_DEFUN([LT_SYS_DLOPEN_SELF],
6031[m4_require([_LT_HEADER_DLFCN])dnl
6032if test yes != "$enable_dlopen"; then
6033  enable_dlopen=unknown
6034  enable_dlopen_self=unknown
6035  enable_dlopen_self_static=unknown
6036else
6037  lt_cv_dlopen=no
6038  lt_cv_dlopen_libs=
6039
6040  case $host_os in
6041  beos*)
6042    lt_cv_dlopen=load_add_on
6043    lt_cv_dlopen_libs=
6044    lt_cv_dlopen_self=yes
6045    ;;
6046
6047  mingw* | pw32* | cegcc*)
6048    lt_cv_dlopen=LoadLibrary
6049    lt_cv_dlopen_libs=
6050    ;;
6051
6052  cygwin*)
6053    lt_cv_dlopen=dlopen
6054    lt_cv_dlopen_libs=
6055    ;;
6056
6057  darwin*)
6058    # if libdl is installed we need to link against it
6059    AC_CHECK_LIB([dl], [dlopen],
6060		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
6061    lt_cv_dlopen=dyld
6062    lt_cv_dlopen_libs=
6063    lt_cv_dlopen_self=yes
6064    ])
6065    ;;
6066
6067  tpf*)
6068    # Don't try to run any link tests for TPF.  We know it's impossible
6069    # because TPF is a cross-compiler, and we know how we open DSOs.
6070    lt_cv_dlopen=dlopen
6071    lt_cv_dlopen_libs=
6072    lt_cv_dlopen_self=no
6073    ;;
6074
6075  *)
6076    AC_CHECK_FUNC([shl_load],
6077	  [lt_cv_dlopen=shl_load],
6078      [AC_CHECK_LIB([dld], [shl_load],
6079	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
6080	[AC_CHECK_FUNC([dlopen],
6081	      [lt_cv_dlopen=dlopen],
6082	  [AC_CHECK_LIB([dl], [dlopen],
6083		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
6084	    [AC_CHECK_LIB([svld], [dlopen],
6085		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
6086	      [AC_CHECK_LIB([dld], [dld_link],
6087		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
6088	      ])
6089	    ])
6090	  ])
6091	])
6092      ])
6093    ;;
6094  esac
6095
6096  if test no = "$lt_cv_dlopen"; then
6097    enable_dlopen=no
6098  else
6099    enable_dlopen=yes
6100  fi
6101
6102  case $lt_cv_dlopen in
6103  dlopen)
6104    save_CPPFLAGS=$CPPFLAGS
6105    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6106
6107    save_LDFLAGS=$LDFLAGS
6108    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6109
6110    save_LIBS=$LIBS
6111    LIBS="$lt_cv_dlopen_libs $LIBS"
6112
6113    AC_CACHE_CHECK([whether a program can dlopen itself],
6114	  lt_cv_dlopen_self, [dnl
6115	  _LT_TRY_DLOPEN_SELF(
6116	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
6117	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
6118    ])
6119
6120    if test yes = "$lt_cv_dlopen_self"; then
6121      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
6122      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
6123	  lt_cv_dlopen_self_static, [dnl
6124	  _LT_TRY_DLOPEN_SELF(
6125	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
6126	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
6127      ])
6128    fi
6129
6130    CPPFLAGS=$save_CPPFLAGS
6131    LDFLAGS=$save_LDFLAGS
6132    LIBS=$save_LIBS
6133    ;;
6134  esac
6135
6136  case $lt_cv_dlopen_self in
6137  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
6138  *) enable_dlopen_self=unknown ;;
6139  esac
6140
6141  case $lt_cv_dlopen_self_static in
6142  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
6143  *) enable_dlopen_self_static=unknown ;;
6144  esac
6145fi
6146_LT_DECL([dlopen_support], [enable_dlopen], [0],
6147	 [Whether dlopen is supported])
6148_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
6149	 [Whether dlopen of programs is supported])
6150_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
6151	 [Whether dlopen of statically linked programs is supported])
6152])# LT_SYS_DLOPEN_SELF
6153
6154# Old name:
6155AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
6156dnl aclocal-1.4 backwards compatibility:
6157dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
6158
6159
6160# _LT_COMPILER_C_O([TAGNAME])
6161# ---------------------------
6162# Check to see if options -c and -o are simultaneously supported by compiler.
6163# This macro does not hard code the compiler like AC_PROG_CC_C_O.
6164m4_defun([_LT_COMPILER_C_O],
6165[m4_require([_LT_DECL_SED])dnl
6166m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6167m4_require([_LT_TAG_COMPILER])dnl
6168AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
6169  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
6170  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
6171   $RM -r conftest 2>/dev/null
6172   mkdir conftest
6173   cd conftest
6174   mkdir out
6175   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6176
6177   lt_compiler_flag="-o out/conftest2.$ac_objext"
6178   # Insert the option either (1) after the last *FLAGS variable, or
6179   # (2) before a word containing "conftest.", or (3) at the end.
6180   # Note that $ac_compile itself does not contain backslashes and begins
6181   # with a dollar sign (not a hyphen), so the echo should work correctly.
6182   lt_compile=`echo "$ac_compile" | $SED \
6183   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
6184   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
6185   -e 's:$: $lt_compiler_flag:'`
6186   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
6187   (eval "$lt_compile" 2>out/conftest.err)
6188   ac_status=$?
6189   cat out/conftest.err >&AS_MESSAGE_LOG_FD
6190   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
6191   if (exit $ac_status) && test -s out/conftest2.$ac_objext
6192   then
6193     # The compiler can only warn and ignore the option if not recognized
6194     # So say no if there are warnings
6195     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
6196     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
6197     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
6198       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6199     fi
6200   fi
6201   chmod u+w . 2>&AS_MESSAGE_LOG_FD
6202   $RM conftest*
6203   # SGI C++ compiler will create directory out/ii_files/ for
6204   # template instantiation
6205   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
6206   $RM out/* && rmdir out
6207   cd ..
6208   $RM -r conftest
6209   $RM conftest*
6210])
6211_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
6212	[Does compiler simultaneously support -c and -o options?])
6213])# _LT_COMPILER_C_O
6214
6215
6216# _LT_COMPILER_FILE_LOCKS([TAGNAME])
6217# ----------------------------------
6218# Check to see if we can do hard links to lock some files if needed
6219m4_defun([_LT_COMPILER_FILE_LOCKS],
6220[m4_require([_LT_ENABLE_LOCK])dnl
6221m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6222_LT_COMPILER_C_O([$1])
6223
6224hard_links=nottested
6225if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
6226  # do not overwrite the value of need_locks provided by the user
6227  AC_MSG_CHECKING([if we can lock with hard links])
6228  hard_links=yes
6229  $RM conftest*
6230  ln conftest.a conftest.b 2>/dev/null && hard_links=no
6231  touch conftest.a
6232  ln conftest.a conftest.b 2>&5 || hard_links=no
6233  ln conftest.a conftest.b 2>/dev/null && hard_links=no
6234  AC_MSG_RESULT([$hard_links])
6235  if test no = "$hard_links"; then
6236    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
6237    need_locks=warn
6238  fi
6239else
6240  need_locks=no
6241fi
6242_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
6243])# _LT_COMPILER_FILE_LOCKS
6244
6245
6246# _LT_CHECK_OBJDIR
6247# ----------------
6248m4_defun([_LT_CHECK_OBJDIR],
6249[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
6250[rm -f .libs 2>/dev/null
6251mkdir .libs 2>/dev/null
6252if test -d .libs; then
6253  lt_cv_objdir=.libs
6254else
6255  # MS-DOS does not allow filenames that begin with a dot.
6256  lt_cv_objdir=_libs
6257fi
6258rmdir .libs 2>/dev/null])
6259objdir=$lt_cv_objdir
6260_LT_DECL([], [objdir], [0],
6261         [The name of the directory that contains temporary libtool files])dnl
6262m4_pattern_allow([LT_OBJDIR])dnl
6263AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
6264  [Define to the sub-directory where libtool stores uninstalled libraries.])
6265])# _LT_CHECK_OBJDIR
6266
6267
6268# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
6269# --------------------------------------
6270# Check hardcoding attributes.
6271m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
6272[AC_MSG_CHECKING([how to hardcode library paths into programs])
6273_LT_TAGVAR(hardcode_action, $1)=
6274if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
6275   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
6276   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
6277
6278  # We can hardcode non-existent directories.
6279  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
6280     # If the only mechanism to avoid hardcoding is shlibpath_var, we
6281     # have to relink, otherwise we might link with an installed library
6282     # when we should be linking with a yet-to-be-installed one
6283     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
6284     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
6285    # Linking always hardcodes the temporary library directory.
6286    _LT_TAGVAR(hardcode_action, $1)=relink
6287  else
6288    # We can link without hardcoding, and we can hardcode nonexisting dirs.
6289    _LT_TAGVAR(hardcode_action, $1)=immediate
6290  fi
6291else
6292  # We cannot hardcode anything, or else we can only hardcode existing
6293  # directories.
6294  _LT_TAGVAR(hardcode_action, $1)=unsupported
6295fi
6296AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
6297
6298if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
6299   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
6300  # Fast installation is not supported
6301  enable_fast_install=no
6302elif test yes = "$shlibpath_overrides_runpath" ||
6303     test no = "$enable_shared"; then
6304  # Fast installation is not necessary
6305  enable_fast_install=needless
6306fi
6307_LT_TAGDECL([], [hardcode_action], [0],
6308    [How to hardcode a shared library path into an executable])
6309])# _LT_LINKER_HARDCODE_LIBPATH
6310
6311
6312# _LT_CMD_STRIPLIB
6313# ----------------
6314m4_defun([_LT_CMD_STRIPLIB],
6315[m4_require([_LT_DECL_EGREP])
6316striplib=
6317old_striplib=
6318AC_MSG_CHECKING([whether stripping libraries is possible])
6319if test -z "$STRIP"; then
6320  AC_MSG_RESULT([no])
6321else
6322  if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
6323    old_striplib="$STRIP --strip-debug"
6324    striplib="$STRIP --strip-unneeded"
6325    AC_MSG_RESULT([yes])
6326  else
6327    case $host_os in
6328    darwin*)
6329      # FIXME - insert some real tests, host_os isn't really good enough
6330      striplib="$STRIP -x"
6331      old_striplib="$STRIP -S"
6332      AC_MSG_RESULT([yes])
6333      ;;
6334    freebsd*)
6335      if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
6336        old_striplib="$STRIP --strip-debug"
6337        striplib="$STRIP --strip-unneeded"
6338        AC_MSG_RESULT([yes])
6339      else
6340        AC_MSG_RESULT([no])
6341      fi
6342      ;;
6343    *)
6344      AC_MSG_RESULT([no])
6345      ;;
6346    esac
6347  fi
6348fi
6349_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
6350_LT_DECL([], [striplib], [1])
6351])# _LT_CMD_STRIPLIB
6352
6353
6354# _LT_PREPARE_MUNGE_PATH_LIST
6355# ---------------------------
6356# Make sure func_munge_path_list() is defined correctly.
6357m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
6358[[# func_munge_path_list VARIABLE PATH
6359# -----------------------------------
6360# VARIABLE is name of variable containing _space_ separated list of
6361# directories to be munged by the contents of PATH, which is string
6362# having a format:
6363# "DIR[:DIR]:"
6364#       string "DIR[ DIR]" will be prepended to VARIABLE
6365# ":DIR[:DIR]"
6366#       string "DIR[ DIR]" will be appended to VARIABLE
6367# "DIRP[:DIRP]::[DIRA:]DIRA"
6368#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
6369#       "DIRA[ DIRA]" will be appended to VARIABLE
6370# "DIR[:DIR]"
6371#       VARIABLE will be replaced by "DIR[ DIR]"
6372func_munge_path_list ()
6373{
6374    case x@S|@2 in
6375    x)
6376        ;;
6377    *:)
6378        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
6379        ;;
6380    x:*)
6381        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
6382        ;;
6383    *::*)
6384        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
6385        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
6386        ;;
6387    *)
6388        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
6389        ;;
6390    esac
6391}
6392]])# _LT_PREPARE_PATH_LIST
6393
6394
6395# _LT_SYS_DYNAMIC_LINKER([TAG])
6396# -----------------------------
6397# PORTME Fill in your ld.so characteristics
6398m4_defun([_LT_SYS_DYNAMIC_LINKER],
6399[AC_REQUIRE([AC_CANONICAL_HOST])dnl
6400m4_require([_LT_DECL_EGREP])dnl
6401m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6402m4_require([_LT_DECL_OBJDUMP])dnl
6403m4_require([_LT_DECL_SED])dnl
6404m4_require([_LT_CHECK_SHELL_FEATURES])dnl
6405m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
6406AC_MSG_CHECKING([dynamic linker characteristics])
6407m4_if([$1],
6408	[], [
6409if test yes = "$GCC"; then
6410  case $host_os in
6411    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
6412    *) lt_awk_arg='/^libraries:/' ;;
6413  esac
6414  case $host_os in
6415    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
6416    *) lt_sed_strip_eq='s|=/|/|g' ;;
6417  esac
6418  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
6419  case $lt_search_path_spec in
6420  *\;*)
6421    # if the path contains ";" then we assume it to be the separator
6422    # otherwise default to the standard path separator (i.e. ":") - it is
6423    # assumed that no part of a normal pathname contains ";" but that should
6424    # okay in the real world where ";" in dirpaths is itself problematic.
6425    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
6426    ;;
6427  *)
6428    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
6429    ;;
6430  esac
6431  # Ok, now we have the path, separated by spaces, we can step through it
6432  # and add multilib dir if necessary...
6433  lt_tmp_lt_search_path_spec=
6434  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
6435  # ...but if some path component already ends with the multilib dir we assume
6436  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
6437  case "$lt_multi_os_dir; $lt_search_path_spec " in
6438  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
6439    lt_multi_os_dir=
6440    ;;
6441  esac
6442  for lt_sys_path in $lt_search_path_spec; do
6443    if test -d "$lt_sys_path$lt_multi_os_dir"; then
6444      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
6445    elif test -n "$lt_multi_os_dir"; then
6446      test -d "$lt_sys_path" && \
6447	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
6448    fi
6449  done
6450  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
6451BEGIN {RS = " "; FS = "/|\n";} {
6452  lt_foo = "";
6453  lt_count = 0;
6454  for (lt_i = NF; lt_i > 0; lt_i--) {
6455    if ($lt_i != "" && $lt_i != ".") {
6456      if ($lt_i == "..") {
6457        lt_count++;
6458      } else {
6459        if (lt_count == 0) {
6460          lt_foo = "/" $lt_i lt_foo;
6461        } else {
6462          lt_count--;
6463        }
6464      }
6465    }
6466  }
6467  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
6468  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
6469}'`
6470  # AWK program above erroneously prepends '/' to C:/dos/paths
6471  # for these hosts.
6472  case $host_os in
6473    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
6474      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
6475  esac
6476  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
6477else
6478  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6479fi])
6480library_names_spec=
6481libname_spec='lib$name'
6482soname_spec=
6483shrext_cmds=.so
6484postinstall_cmds=
6485postuninstall_cmds=
6486finish_cmds=
6487finish_eval=
6488shlibpath_var=
6489shlibpath_overrides_runpath=unknown
6490version_type=none
6491dynamic_linker="$host_os ld.so"
6492sys_lib_dlsearch_path_spec="/lib /usr/lib"
6493need_lib_prefix=unknown
6494hardcode_into_libs=no
6495
6496# when you set need_version to no, make sure it does not cause -set_version
6497# flags to be left without arguments
6498need_version=unknown
6499
6500AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
6501[User-defined run-time library search path.])
6502
6503case $host_os in
6504aix3*)
6505  version_type=linux # correct to gnu/linux during the next big refactor
6506  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
6507  shlibpath_var=LIBPATH
6508
6509  # AIX 3 has no versioning support, so we append a major version to the name.
6510  soname_spec='$libname$release$shared_ext$major'
6511  ;;
6512
6513aix[[4-9]]*)
6514  version_type=linux # correct to gnu/linux during the next big refactor
6515  need_lib_prefix=no
6516  need_version=no
6517  hardcode_into_libs=yes
6518  if test ia64 = "$host_cpu"; then
6519    # AIX 5 supports IA64
6520    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
6521    shlibpath_var=LD_LIBRARY_PATH
6522  else
6523    # With GCC up to 2.95.x, collect2 would create an import file
6524    # for dependence libraries.  The import file would start with
6525    # the line '#! .'.  This would cause the generated library to
6526    # depend on '.', always an invalid library.  This was fixed in
6527    # development snapshots of GCC prior to 3.0.
6528    case $host_os in
6529      aix4 | aix4.[[01]] | aix4.[[01]].*)
6530      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6531	   echo ' yes '
6532	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
6533	:
6534      else
6535	can_build_shared=no
6536      fi
6537      ;;
6538    esac
6539    # Using Import Files as archive members, it is possible to support
6540    # filename-based versioning of shared library archives on AIX. While
6541    # this would work for both with and without runtime linking, it will
6542    # prevent static linking of such archives. So we do filename-based
6543    # shared library versioning with .so extension only, which is used
6544    # when both runtime linking and shared linking is enabled.
6545    # Unfortunately, runtime linking may impact performance, so we do
6546    # not want this to be the default eventually. Also, we use the
6547    # versioned .so libs for executables only if there is the -brtl
6548    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
6549    # To allow for filename-based versioning support, we need to create
6550    # libNAME.so.V as an archive file, containing:
6551    # *) an Import File, referring to the versioned filename of the
6552    #    archive as well as the shared archive member, telling the
6553    #    bitwidth (32 or 64) of that shared object, and providing the
6554    #    list of exported symbols of that shared object, eventually
6555    #    decorated with the 'weak' keyword
6556    # *) the shared object with the F_LOADONLY flag set, to really avoid
6557    #    it being seen by the linker.
6558    # At run time we better use the real file rather than another symlink,
6559    # but for link time we create the symlink libNAME.so -> libNAME.so.V
6560
6561    case $with_aix_soname,$aix_use_runtimelinking in
6562    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
6563    # soname into executable. Probably we can add versioning support to
6564    # collect2, so additional links can be useful in future.
6565    aix,yes) # traditional libtool
6566      dynamic_linker='AIX unversionable lib.so'
6567      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6568      # instead of lib<name>.a to let people know that these are not
6569      # typical AIX shared libraries.
6570      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6571      ;;
6572    aix,no) # traditional AIX only
6573      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
6574      # We preserve .a as extension for shared libraries through AIX4.2
6575      # and later when we are not doing run time linking.
6576      library_names_spec='$libname$release.a $libname.a'
6577      soname_spec='$libname$release$shared_ext$major'
6578      ;;
6579    svr4,*) # full svr4 only
6580      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
6581      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
6582      # We do not specify a path in Import Files, so LIBPATH fires.
6583      shlibpath_overrides_runpath=yes
6584      ;;
6585    *,yes) # both, prefer svr4
6586      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
6587      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
6588      # unpreferred sharedlib libNAME.a needs extra handling
6589      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
6590      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
6591      # We do not specify a path in Import Files, so LIBPATH fires.
6592      shlibpath_overrides_runpath=yes
6593      ;;
6594    *,no) # both, prefer aix
6595      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
6596      library_names_spec='$libname$release.a $libname.a'
6597      soname_spec='$libname$release$shared_ext$major'
6598      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
6599      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
6600      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
6601      ;;
6602    esac
6603    shlibpath_var=LIBPATH
6604  fi
6605  ;;
6606
6607amigaos*)
6608  case $host_cpu in
6609  powerpc)
6610    # Since July 2007 AmigaOS4 officially supports .so libraries.
6611    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
6612    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6613    ;;
6614  m68k)
6615    library_names_spec='$libname.ixlibrary $libname.a'
6616    # Create ${libname}_ixlibrary.a entries in /sys/libs.
6617    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
6618    ;;
6619  esac
6620  ;;
6621
6622beos*)
6623  library_names_spec='$libname$shared_ext'
6624  dynamic_linker="$host_os ld.so"
6625  shlibpath_var=LIBRARY_PATH
6626  ;;
6627
6628bsdi[[45]]*)
6629  version_type=linux # correct to gnu/linux during the next big refactor
6630  need_version=no
6631  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6632  soname_spec='$libname$release$shared_ext$major'
6633  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6634  shlibpath_var=LD_LIBRARY_PATH
6635  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6636  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6637  # the default ld.so.conf also contains /usr/contrib/lib and
6638  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6639  # libtool to hard-code these into programs
6640  ;;
6641
6642cygwin* | mingw* | pw32* | cegcc*)
6643  version_type=windows
6644  shrext_cmds=.dll
6645  need_version=no
6646  need_lib_prefix=no
6647
6648  case $GCC,$cc_basename in
6649  yes,*)
6650    # gcc
6651    library_names_spec='$libname.dll.a'
6652    # DLL is installed to $(libdir)/../bin by postinstall_cmds
6653    postinstall_cmds='base_file=`basename \$file`~
6654      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
6655      dldir=$destdir/`dirname \$dlpath`~
6656      test -d \$dldir || mkdir -p \$dldir~
6657      $install_prog $dir/$dlname \$dldir/$dlname~
6658      chmod a+x \$dldir/$dlname~
6659      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
6660        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
6661      fi'
6662    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
6663      dlpath=$dir/\$dldll~
6664       $RM \$dlpath'
6665    shlibpath_overrides_runpath=yes
6666
6667    case $host_os in
6668    cygwin*)
6669      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
6670      soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
6671m4_if([$1], [],[
6672      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
6673      ;;
6674    mingw* | cegcc*)
6675      # MinGW DLLs use traditional 'lib' prefix
6676      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
6677      ;;
6678    pw32*)
6679      # pw32 DLLs use 'pw' prefix rather than 'lib'
6680      library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
6681      ;;
6682    esac
6683    dynamic_linker='Win32 ld.exe'
6684    ;;
6685
6686  *,cl* | *,icl*)
6687    # Native MSVC or ICC
6688    libname_spec='$name'
6689    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
6690    library_names_spec='$libname.dll.lib'
6691
6692    case $build_os in
6693    mingw*)
6694      sys_lib_search_path_spec=
6695      lt_save_ifs=$IFS
6696      IFS=';'
6697      for lt_path in $LIB
6698      do
6699        IFS=$lt_save_ifs
6700        # Let DOS variable expansion print the short 8.3 style file name.
6701        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
6702        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
6703      done
6704      IFS=$lt_save_ifs
6705      # Convert to MSYS style.
6706      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
6707      ;;
6708    cygwin*)
6709      # Convert to unix form, then to dos form, then back to unix form
6710      # but this time dos style (no spaces!) so that the unix form looks
6711      # like /cygdrive/c/PROGRA~1:/cygdr...
6712      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
6713      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
6714      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
6715      ;;
6716    *)
6717      sys_lib_search_path_spec=$LIB
6718      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
6719        # It is most probably a Windows format PATH.
6720        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
6721      else
6722        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
6723      fi
6724      # FIXME: find the short name or the path components, as spaces are
6725      # common. (e.g. "Program Files" -> "PROGRA~1")
6726      ;;
6727    esac
6728
6729    # DLL is installed to $(libdir)/../bin by postinstall_cmds
6730    postinstall_cmds='base_file=`basename \$file`~
6731      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
6732      dldir=$destdir/`dirname \$dlpath`~
6733      test -d \$dldir || mkdir -p \$dldir~
6734      $install_prog $dir/$dlname \$dldir/$dlname'
6735    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
6736      dlpath=$dir/\$dldll~
6737       $RM \$dlpath'
6738    shlibpath_overrides_runpath=yes
6739    dynamic_linker='Win32 link.exe'
6740    ;;
6741
6742  *)
6743    # Assume MSVC and ICC wrapper
6744    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
6745    dynamic_linker='Win32 ld.exe'
6746    ;;
6747  esac
6748  # FIXME: first we should search . and the directory the executable is in
6749  shlibpath_var=PATH
6750  ;;
6751
6752darwin* | rhapsody*)
6753  dynamic_linker="$host_os dyld"
6754  version_type=darwin
6755  need_lib_prefix=no
6756  need_version=no
6757  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
6758  soname_spec='$libname$release$major$shared_ext'
6759  shlibpath_overrides_runpath=yes
6760  shlibpath_var=DYLD_LIBRARY_PATH
6761  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
6762m4_if([$1], [],[
6763  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
6764  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
6765  ;;
6766
6767dgux*)
6768  version_type=linux # correct to gnu/linux during the next big refactor
6769  need_lib_prefix=no
6770  need_version=no
6771  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6772  soname_spec='$libname$release$shared_ext$major'
6773  shlibpath_var=LD_LIBRARY_PATH
6774  ;;
6775
6776freebsd* | dragonfly* | midnightbsd*)
6777  # DragonFly does not have aout.  When/if they implement a new
6778  # versioning mechanism, adjust this.
6779  if test -x /usr/bin/objformat; then
6780    objformat=`/usr/bin/objformat`
6781  else
6782    case $host_os in
6783    freebsd[[23]].*) objformat=aout ;;
6784    *) objformat=elf ;;
6785    esac
6786  fi
6787  version_type=freebsd-$objformat
6788  case $version_type in
6789    freebsd-elf*)
6790      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6791      soname_spec='$libname$release$shared_ext$major'
6792      need_version=no
6793      need_lib_prefix=no
6794      ;;
6795    freebsd-*)
6796      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
6797      need_version=yes
6798      ;;
6799  esac
6800  shlibpath_var=LD_LIBRARY_PATH
6801  case $host_os in
6802  freebsd2.*)
6803    shlibpath_overrides_runpath=yes
6804    ;;
6805  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
6806    shlibpath_overrides_runpath=yes
6807    hardcode_into_libs=yes
6808    ;;
6809  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
6810  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
6811    shlibpath_overrides_runpath=no
6812    hardcode_into_libs=yes
6813    ;;
6814  *) # from 4.6 on, and DragonFly
6815    shlibpath_overrides_runpath=yes
6816    hardcode_into_libs=yes
6817    ;;
6818  esac
6819  ;;
6820
6821haiku*)
6822  version_type=linux # correct to gnu/linux during the next big refactor
6823  need_lib_prefix=no
6824  need_version=no
6825  dynamic_linker="$host_os runtime_loader"
6826  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6827  soname_spec='$libname$release$shared_ext$major'
6828  shlibpath_var=LIBRARY_PATH
6829  shlibpath_overrides_runpath=no
6830  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
6831  hardcode_into_libs=yes
6832  ;;
6833
6834hpux9* | hpux10* | hpux11*)
6835  # Give a soname corresponding to the major version so that dld.sl refuses to
6836  # link against other versions.
6837  version_type=sunos
6838  need_lib_prefix=no
6839  need_version=no
6840  case $host_cpu in
6841  ia64*)
6842    shrext_cmds='.so'
6843    hardcode_into_libs=yes
6844    dynamic_linker="$host_os dld.so"
6845    shlibpath_var=LD_LIBRARY_PATH
6846    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6847    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6848    soname_spec='$libname$release$shared_ext$major'
6849    if test 32 = "$HPUX_IA64_MODE"; then
6850      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
6851      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
6852    else
6853      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
6854      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
6855    fi
6856    ;;
6857  hppa*64*)
6858    shrext_cmds='.sl'
6859    hardcode_into_libs=yes
6860    dynamic_linker="$host_os dld.sl"
6861    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
6862    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6863    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6864    soname_spec='$libname$release$shared_ext$major'
6865    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
6866    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6867    ;;
6868  *)
6869    shrext_cmds='.sl'
6870    dynamic_linker="$host_os dld.sl"
6871    shlibpath_var=SHLIB_PATH
6872    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6873    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6874    soname_spec='$libname$release$shared_ext$major'
6875    ;;
6876  esac
6877  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
6878  postinstall_cmds='chmod 555 $lib'
6879  # or fails outright, so override atomically:
6880  install_override_mode=555
6881  ;;
6882
6883interix[[3-9]]*)
6884  version_type=linux # correct to gnu/linux during the next big refactor
6885  need_lib_prefix=no
6886  need_version=no
6887  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6888  soname_spec='$libname$release$shared_ext$major'
6889  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
6890  shlibpath_var=LD_LIBRARY_PATH
6891  shlibpath_overrides_runpath=no
6892  hardcode_into_libs=yes
6893  ;;
6894
6895irix5* | irix6* | nonstopux*)
6896  case $host_os in
6897    nonstopux*) version_type=nonstopux ;;
6898    *)
6899	if test yes = "$lt_cv_prog_gnu_ld"; then
6900		version_type=linux # correct to gnu/linux during the next big refactor
6901	else
6902		version_type=irix
6903	fi ;;
6904  esac
6905  need_lib_prefix=no
6906  need_version=no
6907  soname_spec='$libname$release$shared_ext$major'
6908  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
6909  case $host_os in
6910  irix5* | nonstopux*)
6911    libsuff= shlibsuff=
6912    ;;
6913  *)
6914    case $LD in # libtool.m4 will add one of these switches to LD
6915    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
6916      libsuff= shlibsuff= libmagic=32-bit;;
6917    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
6918      libsuff=32 shlibsuff=N32 libmagic=N32;;
6919    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
6920      libsuff=64 shlibsuff=64 libmagic=64-bit;;
6921    *) libsuff= shlibsuff= libmagic=never-match;;
6922    esac
6923    ;;
6924  esac
6925  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6926  shlibpath_overrides_runpath=no
6927  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
6928  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
6929  hardcode_into_libs=yes
6930  ;;
6931
6932# No shared lib support for Linux oldld, aout, or coff.
6933linux*oldld* | linux*aout* | linux*coff*)
6934  dynamic_linker=no
6935  ;;
6936
6937linux*android*)
6938  version_type=none # Android doesn't support versioned libraries.
6939  need_lib_prefix=no
6940  need_version=no
6941  library_names_spec='$libname$release$shared_ext'
6942  soname_spec='$libname$release$shared_ext'
6943  finish_cmds=
6944  shlibpath_var=LD_LIBRARY_PATH
6945  shlibpath_overrides_runpath=yes
6946
6947  # This implies no fast_install, which is unacceptable.
6948  # Some rework will be needed to allow for fast_install
6949  # before this can be enabled.
6950  hardcode_into_libs=yes
6951
6952  dynamic_linker='Android linker'
6953  # Don't embed -rpath directories since the linker doesn't support them.
6954  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6955  ;;
6956
6957# This must be glibc/ELF.
6958linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6959  version_type=linux # correct to gnu/linux during the next big refactor
6960  need_lib_prefix=no
6961  need_version=no
6962  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
6963  soname_spec='$libname$release$shared_ext$major'
6964  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6965  shlibpath_var=LD_LIBRARY_PATH
6966  shlibpath_overrides_runpath=no
6967
6968  # Some binutils ld are patched to set DT_RUNPATH
6969  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
6970    [lt_cv_shlibpath_overrides_runpath=no
6971    save_LDFLAGS=$LDFLAGS
6972    save_libdir=$libdir
6973    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
6974	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
6975    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
6976      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
6977	 [lt_cv_shlibpath_overrides_runpath=yes])])
6978    LDFLAGS=$save_LDFLAGS
6979    libdir=$save_libdir
6980    ])
6981  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
6982
6983  # This implies no fast_install, which is unacceptable.
6984  # Some rework will be needed to allow for fast_install
6985  # before this can be enabled.
6986  hardcode_into_libs=yes
6987
6988  # Add ABI-specific directories to the system library path.
6989  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
6990
6991  # Ideally, we could use ldconfig to report *all* directores which are
6992  # searched for libraries, however this is still not possible.  Aside from not
6993  # being certain /sbin/ldconfig is available, command
6994  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
6995  # even though it is searched at run-time.  Try to do the best guess by
6996  # appending ld.so.conf contents (and includes) to the search path.
6997  if test -f /etc/ld.so.conf; then
6998    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' ' '`
6999    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
7000  fi
7001
7002  # We used to test for /lib/ld.so.1 and disable shared libraries on
7003  # powerpc, because MkLinux only supported shared libraries with the
7004  # GNU dynamic linker.  Since this was broken with cross compilers,
7005  # most powerpc-linux boxes support dynamic linking these days and
7006  # people can always --disable-shared, the test was removed, and we
7007  # assume the GNU/Linux dynamic linker is in use.
7008  dynamic_linker='GNU/Linux ld.so'
7009  ;;
7010
7011netbsd*)
7012  version_type=sunos
7013  need_lib_prefix=no
7014  need_version=no
7015  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7016    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
7017    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
7018    dynamic_linker='NetBSD (a.out) ld.so'
7019  else
7020    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
7021    soname_spec='$libname$release$shared_ext$major'
7022    dynamic_linker='NetBSD ld.elf_so'
7023  fi
7024  shlibpath_var=LD_LIBRARY_PATH
7025  shlibpath_overrides_runpath=yes
7026  hardcode_into_libs=yes
7027  ;;
7028
7029newsos6)
7030  version_type=linux # correct to gnu/linux during the next big refactor
7031  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
7032  shlibpath_var=LD_LIBRARY_PATH
7033  shlibpath_overrides_runpath=yes
7034  ;;
7035
7036*nto* | *qnx*)
7037  version_type=qnx
7038  need_lib_prefix=no
7039  need_version=no
7040  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
7041  soname_spec='$libname$release$shared_ext$major'
7042  shlibpath_var=LD_LIBRARY_PATH
7043  shlibpath_overrides_runpath=no
7044  hardcode_into_libs=yes
7045  dynamic_linker='ldqnx.so'
7046  ;;
7047
7048openbsd* | bitrig*)
7049  version_type=sunos
7050  sys_lib_dlsearch_path_spec=/usr/lib
7051  need_lib_prefix=no
7052  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
7053    need_version=no
7054  else
7055    need_version=yes
7056  fi
7057  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
7058  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
7059  shlibpath_var=LD_LIBRARY_PATH
7060  shlibpath_overrides_runpath=yes
7061  ;;
7062
7063os2*)
7064  libname_spec='$name'
7065  version_type=windows
7066  shrext_cmds=.dll
7067  need_version=no
7068  need_lib_prefix=no
7069  # OS/2 can only load a DLL with a base name of 8 characters or less.
7070  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
7071    v=$($ECHO $release$versuffix | tr -d .-);
7072    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
7073    $ECHO $n$v`$shared_ext'
7074  library_names_spec='${libname}_dll.$libext'
7075  dynamic_linker='OS/2 ld.exe'
7076  shlibpath_var=BEGINLIBPATH
7077  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
7078  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7079  postinstall_cmds='base_file=`basename \$file`~
7080    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
7081    dldir=$destdir/`dirname \$dlpath`~
7082    test -d \$dldir || mkdir -p \$dldir~
7083    $install_prog $dir/$dlname \$dldir/$dlname~
7084    chmod a+x \$dldir/$dlname~
7085    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
7086      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
7087    fi'
7088  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
7089    dlpath=$dir/\$dldll~
7090    $RM \$dlpath'
7091  ;;
7092
7093osf3* | osf4* | osf5*)
7094  version_type=osf
7095  need_lib_prefix=no
7096  need_version=no
7097  soname_spec='$libname$release$shared_ext$major'
7098  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
7099  shlibpath_var=LD_LIBRARY_PATH
7100  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
7101  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7102  ;;
7103
7104rdos*)
7105  dynamic_linker=no
7106  ;;
7107
7108solaris*)
7109  version_type=linux # correct to gnu/linux during the next big refactor
7110  need_lib_prefix=no
7111  need_version=no
7112  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
7113  soname_spec='$libname$release$shared_ext$major'
7114  shlibpath_var=LD_LIBRARY_PATH
7115  shlibpath_overrides_runpath=yes
7116  hardcode_into_libs=yes
7117  # ldd complains unless libraries are executable
7118  postinstall_cmds='chmod +x $lib'
7119  ;;
7120
7121sunos4*)
7122  version_type=sunos
7123  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
7124  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
7125  shlibpath_var=LD_LIBRARY_PATH
7126  shlibpath_overrides_runpath=yes
7127  if test yes = "$with_gnu_ld"; then
7128    need_lib_prefix=no
7129  fi
7130  need_version=yes
7131  ;;
7132
7133sysv4 | sysv4.3*)
7134  version_type=linux # correct to gnu/linux during the next big refactor
7135  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
7136  soname_spec='$libname$release$shared_ext$major'
7137  shlibpath_var=LD_LIBRARY_PATH
7138  case $host_vendor in
7139    sni)
7140      shlibpath_overrides_runpath=no
7141      need_lib_prefix=no
7142      runpath_var=LD_RUN_PATH
7143      ;;
7144    siemens)
7145      need_lib_prefix=no
7146      ;;
7147    motorola)
7148      need_lib_prefix=no
7149      need_version=no
7150      shlibpath_overrides_runpath=no
7151      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
7152      ;;
7153  esac
7154  ;;
7155
7156sysv4*MP*)
7157  if test -d /usr/nec; then
7158    version_type=linux # correct to gnu/linux during the next big refactor
7159    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
7160    soname_spec='$libname$shared_ext.$major'
7161    shlibpath_var=LD_LIBRARY_PATH
7162  fi
7163  ;;
7164
7165sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
7166  version_type=sco
7167  need_lib_prefix=no
7168  need_version=no
7169  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
7170  soname_spec='$libname$release$shared_ext$major'
7171  shlibpath_var=LD_LIBRARY_PATH
7172  shlibpath_overrides_runpath=yes
7173  hardcode_into_libs=yes
7174  if test yes = "$with_gnu_ld"; then
7175    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
7176  else
7177    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
7178    case $host_os in
7179      sco3.2v5*)
7180        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
7181	;;
7182    esac
7183  fi
7184  sys_lib_dlsearch_path_spec='/usr/lib'
7185  ;;
7186
7187tpf*)
7188  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
7189  version_type=linux # correct to gnu/linux during the next big refactor
7190  need_lib_prefix=no
7191  need_version=no
7192  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
7193  shlibpath_var=LD_LIBRARY_PATH
7194  shlibpath_overrides_runpath=no
7195  hardcode_into_libs=yes
7196  ;;
7197
7198uts4*)
7199  version_type=linux # correct to gnu/linux during the next big refactor
7200  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
7201  soname_spec='$libname$release$shared_ext$major'
7202  shlibpath_var=LD_LIBRARY_PATH
7203  ;;
7204
7205*)
7206  dynamic_linker=no
7207  ;;
7208esac
7209AC_MSG_RESULT([$dynamic_linker])
7210test no = "$dynamic_linker" && can_build_shared=no
7211
7212variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
7213if test yes = "$GCC"; then
7214  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7215fi
7216
7217if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
7218  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
7219fi
7220
7221if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
7222  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
7223fi
7224
7225# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
7226configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
7227
7228# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
7229func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
7230
7231# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
7232configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
7233
7234_LT_DECL([], [variables_saved_for_relink], [1],
7235    [Variables whose values should be saved in libtool wrapper scripts and
7236    restored at link time])
7237_LT_DECL([], [need_lib_prefix], [0],
7238    [Do we need the "lib" prefix for modules?])
7239_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
7240_LT_DECL([], [version_type], [0], [Library versioning type])
7241_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
7242_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
7243_LT_DECL([], [shlibpath_overrides_runpath], [0],
7244    [Is shlibpath searched before the hard-coded library search path?])
7245_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
7246_LT_DECL([], [library_names_spec], [1],
7247    [[List of archive names.  First name is the real one, the rest are links.
7248    The last name is the one that the linker finds with -lNAME]])
7249_LT_DECL([], [soname_spec], [1],
7250    [[The coded name of the library, if different from the real name]])
7251_LT_DECL([], [install_override_mode], [1],
7252    [Permission mode override for installation of shared libraries])
7253_LT_DECL([], [postinstall_cmds], [2],
7254    [Command to use after installation of a shared archive])
7255_LT_DECL([], [postuninstall_cmds], [2],
7256    [Command to use after uninstallation of a shared archive])
7257_LT_DECL([], [finish_cmds], [2],
7258    [Commands used to finish a libtool library installation in a directory])
7259_LT_DECL([], [finish_eval], [1],
7260    [[As "finish_cmds", except a single script fragment to be evaled but
7261    not shown]])
7262_LT_DECL([], [hardcode_into_libs], [0],
7263    [Whether we should hardcode library paths into libraries])
7264_LT_DECL([], [sys_lib_search_path_spec], [2],
7265    [Compile-time system search path for libraries])
7266_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
7267    [Detected run-time system search path for libraries])
7268_LT_DECL([], [configure_time_lt_sys_library_path], [2],
7269    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
7270])# _LT_SYS_DYNAMIC_LINKER
7271
7272
7273# _LT_PATH_TOOL_PREFIX(TOOL)
7274# --------------------------
7275# find a file program that can recognize shared library
7276AC_DEFUN([_LT_PATH_TOOL_PREFIX],
7277[m4_require([_LT_DECL_EGREP])dnl
7278AC_MSG_CHECKING([for $1])
7279AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
7280[case $MAGIC_CMD in
7281[[\\/*] |  ?:[\\/]*])
7282  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
7283  ;;
7284*)
7285  lt_save_MAGIC_CMD=$MAGIC_CMD
7286  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7287dnl $ac_dummy forces splitting on constant user-supplied paths.
7288dnl POSIX.2 word splitting is done only on the output of word expansions,
7289dnl not every word.  This closes a longstanding sh security hole.
7290  ac_dummy="m4_if([$2], , $PATH, [$2])"
7291  for ac_dir in $ac_dummy; do
7292    IFS=$lt_save_ifs
7293    test -z "$ac_dir" && ac_dir=.
7294    if test -f "$ac_dir/$1"; then
7295      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
7296      if test -n "$file_magic_test_file"; then
7297	case $deplibs_check_method in
7298	"file_magic "*)
7299	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7300	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
7301	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7302	    $EGREP "$file_magic_regex" > /dev/null; then
7303	    :
7304	  else
7305	    cat <<_LT_EOF 1>&2
7306
7307*** Warning: the command libtool uses to detect shared libraries,
7308*** $file_magic_cmd, produces output that libtool cannot recognize.
7309*** The result is that libtool may fail to recognize shared libraries
7310*** as such.  This will affect the creation of libtool libraries that
7311*** depend on shared libraries, but programs linked with such libtool
7312*** libraries will work regardless of this problem.  Nevertheless, you
7313*** may want to report the problem to your system manager and/or to
7314*** bug-libtool@gnu.org
7315
7316_LT_EOF
7317	  fi ;;
7318	esac
7319      fi
7320      break
7321    fi
7322  done
7323  IFS=$lt_save_ifs
7324  MAGIC_CMD=$lt_save_MAGIC_CMD
7325  ;;
7326esac])
7327MAGIC_CMD=$lt_cv_path_MAGIC_CMD
7328if test -n "$MAGIC_CMD"; then
7329  AC_MSG_RESULT($MAGIC_CMD)
7330else
7331  AC_MSG_RESULT(no)
7332fi
7333_LT_DECL([], [MAGIC_CMD], [0],
7334	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
7335])# _LT_PATH_TOOL_PREFIX
7336
7337# Old name:
7338AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
7339dnl aclocal-1.4 backwards compatibility:
7340dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
7341
7342
7343# _LT_PATH_MAGIC
7344# --------------
7345# find a file program that can recognize a shared library
7346m4_defun([_LT_PATH_MAGIC],
7347[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
7348if test -z "$lt_cv_path_MAGIC_CMD"; then
7349  if test -n "$ac_tool_prefix"; then
7350    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
7351  else
7352    MAGIC_CMD=:
7353  fi
7354fi
7355])# _LT_PATH_MAGIC
7356
7357
7358# LT_PATH_LD
7359# ----------
7360# find the pathname to the GNU or non-GNU linker
7361AC_DEFUN([LT_PATH_LD],
7362[AC_REQUIRE([AC_PROG_CC])dnl
7363AC_REQUIRE([AC_CANONICAL_HOST])dnl
7364AC_REQUIRE([AC_CANONICAL_BUILD])dnl
7365m4_require([_LT_DECL_SED])dnl
7366m4_require([_LT_DECL_EGREP])dnl
7367m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
7368
7369AC_ARG_WITH([gnu-ld],
7370    [AS_HELP_STRING([--with-gnu-ld],
7371	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
7372    [test no = "$withval" || with_gnu_ld=yes],
7373    [with_gnu_ld=no])dnl
7374
7375ac_prog=ld
7376if test yes = "$GCC"; then
7377  # Check if gcc -print-prog-name=ld gives a path.
7378  AC_MSG_CHECKING([for ld used by $CC])
7379  case $host in
7380  *-*-mingw*)
7381    # gcc leaves a trailing carriage return, which upsets mingw
7382    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
7383  *)
7384    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
7385  esac
7386  case $ac_prog in
7387    # Accept absolute paths.
7388    [[\\/]]* | ?:[[\\/]]*)
7389      re_direlt='/[[^/]][[^/]]*/\.\./'
7390      # Canonicalize the pathname of ld
7391      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
7392      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
7393	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
7394      done
7395      test -z "$LD" && LD=$ac_prog
7396      ;;
7397  "")
7398    # If it fails, then pretend we aren't using GCC.
7399    ac_prog=ld
7400    ;;
7401  *)
7402    # If it is relative, then search for the first ld in PATH.
7403    with_gnu_ld=unknown
7404    ;;
7405  esac
7406elif test yes = "$with_gnu_ld"; then
7407  AC_MSG_CHECKING([for GNU ld])
7408else
7409  AC_MSG_CHECKING([for non-GNU ld])
7410fi
7411AC_CACHE_VAL(lt_cv_path_LD,
7412[if test -z "$LD"; then
7413  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7414  for ac_dir in $PATH; do
7415    IFS=$lt_save_ifs
7416    test -z "$ac_dir" && ac_dir=.
7417    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
7418      lt_cv_path_LD=$ac_dir/$ac_prog
7419      # Check to see if the program is GNU ld.  I'd rather use --version,
7420      # but apparently some variants of GNU ld only accept -v.
7421      # Break only if it was the GNU/non-GNU ld that we prefer.
7422      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
7423      *GNU* | *'with BFD'*)
7424	test no != "$with_gnu_ld" && break
7425	;;
7426      *)
7427	test yes != "$with_gnu_ld" && break
7428	;;
7429      esac
7430    fi
7431  done
7432  IFS=$lt_save_ifs
7433else
7434  lt_cv_path_LD=$LD # Let the user override the test with a path.
7435fi])
7436LD=$lt_cv_path_LD
7437if test -n "$LD"; then
7438  AC_MSG_RESULT($LD)
7439else
7440  AC_MSG_RESULT(no)
7441fi
7442test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
7443_LT_PATH_LD_GNU
7444AC_SUBST([LD])
7445
7446_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
7447])# LT_PATH_LD
7448
7449# Old names:
7450AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
7451AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
7452dnl aclocal-1.4 backwards compatibility:
7453dnl AC_DEFUN([AM_PROG_LD], [])
7454dnl AC_DEFUN([AC_PROG_LD], [])
7455
7456
7457# _LT_PATH_LD_GNU
7458#- --------------
7459m4_defun([_LT_PATH_LD_GNU],
7460[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
7461[# I'd rather use --version here, but apparently some GNU lds only accept -v.
7462case `$LD -v 2>&1 </dev/null` in
7463*GNU* | *'with BFD'*)
7464  lt_cv_prog_gnu_ld=yes
7465  ;;
7466*)
7467  lt_cv_prog_gnu_ld=no
7468  ;;
7469esac])
7470with_gnu_ld=$lt_cv_prog_gnu_ld
7471])# _LT_PATH_LD_GNU
7472
7473
7474# _LT_CMD_RELOAD
7475# --------------
7476# find reload flag for linker
7477#   -- PORTME Some linkers may need a different reload flag.
7478m4_defun([_LT_CMD_RELOAD],
7479[AC_CACHE_CHECK([for $LD option to reload object files],
7480  lt_cv_ld_reload_flag,
7481  [lt_cv_ld_reload_flag='-r'])
7482reload_flag=$lt_cv_ld_reload_flag
7483case $reload_flag in
7484"" | " "*) ;;
7485*) reload_flag=" $reload_flag" ;;
7486esac
7487reload_cmds='$LD$reload_flag -o $output$reload_objs'
7488case $host_os in
7489  cygwin* | mingw* | pw32* | cegcc*)
7490    if test yes != "$GCC"; then
7491      reload_cmds=false
7492    fi
7493    ;;
7494  darwin*)
7495    if test yes = "$GCC"; then
7496      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
7497    else
7498      reload_cmds='$LD$reload_flag -o $output$reload_objs'
7499    fi
7500    ;;
7501esac
7502_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
7503_LT_TAGDECL([], [reload_cmds], [2])dnl
7504])# _LT_CMD_RELOAD
7505
7506
7507# _LT_PATH_DD
7508# -----------
7509# find a working dd
7510m4_defun([_LT_PATH_DD],
7511[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
7512[printf 0123456789abcdef0123456789abcdef >conftest.i
7513cat conftest.i conftest.i >conftest2.i
7514: ${lt_DD:=$DD}
7515AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
7516[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
7517  cmp -s conftest.i conftest.out \
7518  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
7519fi])
7520rm -f conftest.i conftest2.i conftest.out])
7521])# _LT_PATH_DD
7522
7523
7524# _LT_CMD_TRUNCATE
7525# ----------------
7526# find command to truncate a binary pipe
7527m4_defun([_LT_CMD_TRUNCATE],
7528[m4_require([_LT_PATH_DD])
7529AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
7530[printf 0123456789abcdef0123456789abcdef >conftest.i
7531cat conftest.i conftest.i >conftest2.i
7532lt_cv_truncate_bin=
7533if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
7534  cmp -s conftest.i conftest.out \
7535  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
7536fi
7537rm -f conftest.i conftest2.i conftest.out
7538test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
7539_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
7540  [Command to truncate a binary pipe])
7541])# _LT_CMD_TRUNCATE
7542
7543
7544# _LT_CHECK_MAGIC_METHOD
7545# ----------------------
7546# how to check for library dependencies
7547#  -- PORTME fill in with the dynamic library characteristics
7548m4_defun([_LT_CHECK_MAGIC_METHOD],
7549[m4_require([_LT_DECL_EGREP])
7550m4_require([_LT_DECL_OBJDUMP])
7551AC_CACHE_CHECK([how to recognize dependent libraries],
7552lt_cv_deplibs_check_method,
7553[lt_cv_file_magic_cmd='$MAGIC_CMD'
7554lt_cv_file_magic_test_file=
7555lt_cv_deplibs_check_method='unknown'
7556# Need to set the preceding variable on all platforms that support
7557# interlibrary dependencies.
7558# 'none' -- dependencies not supported.
7559# 'unknown' -- same as none, but documents that we really don't know.
7560# 'pass_all' -- all dependencies passed with no checks.
7561# 'test_compile' -- check by making test program.
7562# 'file_magic [[regex]]' -- check by looking for files in library path
7563# that responds to the $file_magic_cmd with a given extended regex.
7564# If you have 'file' or equivalent on your system and you're not sure
7565# whether 'pass_all' will *always* work, you probably want this one.
7566
7567case $host_os in
7568aix[[4-9]]*)
7569  lt_cv_deplibs_check_method=pass_all
7570  ;;
7571
7572beos*)
7573  lt_cv_deplibs_check_method=pass_all
7574  ;;
7575
7576bsdi[[45]]*)
7577  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
7578  lt_cv_file_magic_cmd='$FILECMD -L'
7579  lt_cv_file_magic_test_file=/shlib/libc.so
7580  ;;
7581
7582cygwin*)
7583  # func_win32_libid is a shell function defined in ltmain.sh
7584  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
7585  lt_cv_file_magic_cmd='func_win32_libid'
7586  ;;
7587
7588mingw* | pw32*)
7589  # Base MSYS/MinGW do not provide the 'file' command needed by
7590  # func_win32_libid shell function, so use a weaker test based on 'objdump',
7591  # unless we find 'file', for example because we are cross-compiling.
7592  if ( file / ) >/dev/null 2>&1; then
7593    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
7594    lt_cv_file_magic_cmd='func_win32_libid'
7595  else
7596    # Keep this pattern in sync with the one in func_win32_libid.
7597    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
7598    lt_cv_file_magic_cmd='$OBJDUMP -f'
7599  fi
7600  ;;
7601
7602cegcc*)
7603  # use the weaker test based on 'objdump'. See mingw*.
7604  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
7605  lt_cv_file_magic_cmd='$OBJDUMP -f'
7606  ;;
7607
7608darwin* | rhapsody*)
7609  lt_cv_deplibs_check_method=pass_all
7610  ;;
7611
7612freebsd* | dragonfly* | midnightbsd*)
7613  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
7614    case $host_cpu in
7615    i*86 )
7616      # Not sure whether the presence of OpenBSD here was a mistake.
7617      # Let's accept both of them until this is cleared up.
7618      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
7619      lt_cv_file_magic_cmd=$FILECMD
7620      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7621      ;;
7622    esac
7623  else
7624    lt_cv_deplibs_check_method=pass_all
7625  fi
7626  ;;
7627
7628haiku*)
7629  lt_cv_deplibs_check_method=pass_all
7630  ;;
7631
7632hpux10.20* | hpux11*)
7633  lt_cv_file_magic_cmd=$FILECMD
7634  case $host_cpu in
7635  ia64*)
7636    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
7637    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
7638    ;;
7639  hppa*64*)
7640    [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]']
7641    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
7642    ;;
7643  *)
7644    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
7645    lt_cv_file_magic_test_file=/usr/lib/libc.sl
7646    ;;
7647  esac
7648  ;;
7649
7650interix[[3-9]]*)
7651  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
7652  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
7653  ;;
7654
7655irix5* | irix6* | nonstopux*)
7656  case $LD in
7657  *-32|*"-32 ") libmagic=32-bit;;
7658  *-n32|*"-n32 ") libmagic=N32;;
7659  *-64|*"-64 ") libmagic=64-bit;;
7660  *) libmagic=never-match;;
7661  esac
7662  lt_cv_deplibs_check_method=pass_all
7663  ;;
7664
7665# This must be glibc/ELF.
7666linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
7667  lt_cv_deplibs_check_method=pass_all
7668  ;;
7669
7670netbsd*)
7671  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
7672    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
7673  else
7674    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
7675  fi
7676  ;;
7677
7678newos6*)
7679  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
7680  lt_cv_file_magic_cmd=$FILECMD
7681  lt_cv_file_magic_test_file=/usr/lib/libnls.so
7682  ;;
7683
7684*nto* | *qnx*)
7685  lt_cv_deplibs_check_method=pass_all
7686  ;;
7687
7688openbsd* | bitrig*)
7689  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
7690    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
7691  else
7692    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
7693  fi
7694  ;;
7695
7696osf3* | osf4* | osf5*)
7697  lt_cv_deplibs_check_method=pass_all
7698  ;;
7699
7700rdos*)
7701  lt_cv_deplibs_check_method=pass_all
7702  ;;
7703
7704solaris*)
7705  lt_cv_deplibs_check_method=pass_all
7706  ;;
7707
7708sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
7709  lt_cv_deplibs_check_method=pass_all
7710  ;;
7711
7712sysv4 | sysv4.3*)
7713  case $host_vendor in
7714  motorola)
7715    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]]'
7716    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
7717    ;;
7718  ncr)
7719    lt_cv_deplibs_check_method=pass_all
7720    ;;
7721  sequent)
7722    lt_cv_file_magic_cmd='/bin/file'
7723    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
7724    ;;
7725  sni)
7726    lt_cv_file_magic_cmd='/bin/file'
7727    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
7728    lt_cv_file_magic_test_file=/lib/libc.so
7729    ;;
7730  siemens)
7731    lt_cv_deplibs_check_method=pass_all
7732    ;;
7733  pc)
7734    lt_cv_deplibs_check_method=pass_all
7735    ;;
7736  esac
7737  ;;
7738
7739tpf*)
7740  lt_cv_deplibs_check_method=pass_all
7741  ;;
7742os2*)
7743  lt_cv_deplibs_check_method=pass_all
7744  ;;
7745esac
7746])
7747
7748file_magic_glob=
7749want_nocaseglob=no
7750if test "$build" = "$host"; then
7751  case $host_os in
7752  mingw* | pw32*)
7753    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
7754      want_nocaseglob=yes
7755    else
7756      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
7757    fi
7758    ;;
7759  esac
7760fi
7761
7762file_magic_cmd=$lt_cv_file_magic_cmd
7763deplibs_check_method=$lt_cv_deplibs_check_method
7764test -z "$deplibs_check_method" && deplibs_check_method=unknown
7765
7766_LT_DECL([], [deplibs_check_method], [1],
7767    [Method to check whether dependent libraries are shared objects])
7768_LT_DECL([], [file_magic_cmd], [1],
7769    [Command to use when deplibs_check_method = "file_magic"])
7770_LT_DECL([], [file_magic_glob], [1],
7771    [How to find potential files when deplibs_check_method = "file_magic"])
7772_LT_DECL([], [want_nocaseglob], [1],
7773    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
7774])# _LT_CHECK_MAGIC_METHOD
7775
7776
7777# LT_PATH_NM
7778# ----------
7779# find the pathname to a BSD- or MS-compatible name lister
7780AC_DEFUN([LT_PATH_NM],
7781[AC_REQUIRE([AC_PROG_CC])dnl
7782AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
7783[if test -n "$NM"; then
7784  # Let the user override the test.
7785  lt_cv_path_NM=$NM
7786else
7787  lt_nm_to_check=${ac_tool_prefix}nm
7788  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
7789    lt_nm_to_check="$lt_nm_to_check nm"
7790  fi
7791  for lt_tmp_nm in $lt_nm_to_check; do
7792    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7793    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
7794      IFS=$lt_save_ifs
7795      test -z "$ac_dir" && ac_dir=.
7796      tmp_nm=$ac_dir/$lt_tmp_nm
7797      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
7798	# Check to see if the nm accepts a BSD-compat flag.
7799	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
7800	#   nm: unknown option "B" ignored
7801	# Tru64's nm complains that /dev/null is an invalid object file
7802	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
7803	case $build_os in
7804	mingw*) lt_bad_file=conftest.nm/nofile ;;
7805	*) lt_bad_file=/dev/null ;;
7806	esac
7807	case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
7808	*$lt_bad_file* | *'Invalid file or object type'*)
7809	  lt_cv_path_NM="$tmp_nm -B"
7810	  break 2
7811	  ;;
7812	*)
7813	  case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
7814	  */dev/null*)
7815	    lt_cv_path_NM="$tmp_nm -p"
7816	    break 2
7817	    ;;
7818	  *)
7819	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7820	    continue # so that we can try to find one that supports BSD flags
7821	    ;;
7822	  esac
7823	  ;;
7824	esac
7825      fi
7826    done
7827    IFS=$lt_save_ifs
7828  done
7829  : ${lt_cv_path_NM=no}
7830fi])
7831if test no != "$lt_cv_path_NM"; then
7832  NM=$lt_cv_path_NM
7833else
7834  # Didn't find any BSD compatible name lister, look for dumpbin.
7835  if test -n "$DUMPBIN"; then :
7836    # Let the user override the test.
7837  else
7838    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
7839    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
7840    *COFF*)
7841      DUMPBIN="$DUMPBIN -symbols -headers"
7842      ;;
7843    *)
7844      DUMPBIN=:
7845      ;;
7846    esac
7847  fi
7848  AC_SUBST([DUMPBIN])
7849  if test : != "$DUMPBIN"; then
7850    NM=$DUMPBIN
7851  fi
7852fi
7853test -z "$NM" && NM=nm
7854AC_SUBST([NM])
7855_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
7856
7857AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
7858  [lt_cv_nm_interface="BSD nm"
7859  echo "int some_variable = 0;" > conftest.$ac_ext
7860  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
7861  (eval "$ac_compile" 2>conftest.err)
7862  cat conftest.err >&AS_MESSAGE_LOG_FD
7863  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
7864  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
7865  cat conftest.err >&AS_MESSAGE_LOG_FD
7866  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
7867  cat conftest.out >&AS_MESSAGE_LOG_FD
7868  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
7869    lt_cv_nm_interface="MS dumpbin"
7870  fi
7871  rm -f conftest*])
7872])# LT_PATH_NM
7873
7874# Old names:
7875AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
7876AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
7877dnl aclocal-1.4 backwards compatibility:
7878dnl AC_DEFUN([AM_PROG_NM], [])
7879dnl AC_DEFUN([AC_PROG_NM], [])
7880
7881# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7882# --------------------------------
7883# how to determine the name of the shared library
7884# associated with a specific link library.
7885#  -- PORTME fill in with the dynamic library characteristics
7886m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
7887[m4_require([_LT_DECL_EGREP])
7888m4_require([_LT_DECL_OBJDUMP])
7889m4_require([_LT_DECL_DLLTOOL])
7890AC_CACHE_CHECK([how to associate runtime and link libraries],
7891lt_cv_sharedlib_from_linklib_cmd,
7892[lt_cv_sharedlib_from_linklib_cmd='unknown'
7893
7894case $host_os in
7895cygwin* | mingw* | pw32* | cegcc*)
7896  # two different shell functions defined in ltmain.sh;
7897  # decide which one to use based on capabilities of $DLLTOOL
7898  case `$DLLTOOL --help 2>&1` in
7899  *--identify-strict*)
7900    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
7901    ;;
7902  *)
7903    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
7904    ;;
7905  esac
7906  ;;
7907*)
7908  # fallback: assume linklib IS sharedlib
7909  lt_cv_sharedlib_from_linklib_cmd=$ECHO
7910  ;;
7911esac
7912])
7913sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
7914test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
7915
7916_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
7917    [Command to associate shared and link libraries])
7918])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
7919
7920
7921# _LT_PATH_MANIFEST_TOOL
7922# ----------------------
7923# locate the manifest tool
7924m4_defun([_LT_PATH_MANIFEST_TOOL],
7925[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
7926test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
7927AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
7928  [lt_cv_path_mainfest_tool=no
7929  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
7930  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
7931  cat conftest.err >&AS_MESSAGE_LOG_FD
7932  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
7933    lt_cv_path_mainfest_tool=yes
7934  fi
7935  rm -f conftest*])
7936if test yes != "$lt_cv_path_mainfest_tool"; then
7937  MANIFEST_TOOL=:
7938fi
7939_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
7940])# _LT_PATH_MANIFEST_TOOL
7941
7942
7943# _LT_DLL_DEF_P([FILE])
7944# ---------------------
7945# True iff FILE is a Windows DLL '.def' file.
7946# Keep in sync with func_dll_def_p in the libtool script
7947AC_DEFUN([_LT_DLL_DEF_P],
7948[dnl
7949  test DEF = "`$SED -n dnl
7950    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
7951    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
7952    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
7953    -e q dnl                          Only consider the first "real" line
7954    $1`" dnl
7955])# _LT_DLL_DEF_P
7956
7957
7958# LT_LIB_M
7959# --------
7960# check for math library
7961AC_DEFUN([LT_LIB_M],
7962[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7963LIBM=
7964case $host in
7965*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
7966  # These system don't have libm, or don't need it
7967  ;;
7968*-ncr-sysv4.3*)
7969  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
7970  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
7971  ;;
7972*)
7973  AC_CHECK_LIB(m, cos, LIBM=-lm)
7974  ;;
7975esac
7976AC_SUBST([LIBM])
7977])# LT_LIB_M
7978
7979# Old name:
7980AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
7981dnl aclocal-1.4 backwards compatibility:
7982dnl AC_DEFUN([AC_CHECK_LIBM], [])
7983
7984
7985# _LT_COMPILER_NO_RTTI([TAGNAME])
7986# -------------------------------
7987m4_defun([_LT_COMPILER_NO_RTTI],
7988[m4_require([_LT_TAG_COMPILER])dnl
7989
7990_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7991
7992if test yes = "$GCC"; then
7993  case $cc_basename in
7994  nvcc*)
7995    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
7996  *)
7997    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
7998  esac
7999
8000  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
8001    lt_cv_prog_compiler_rtti_exceptions,
8002    [-fno-rtti -fno-exceptions], [],
8003    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
8004fi
8005_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
8006	[Compiler flag to turn off builtin functions])
8007])# _LT_COMPILER_NO_RTTI
8008
8009
8010# _LT_CMD_GLOBAL_SYMBOLS
8011# ----------------------
8012m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
8013[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8014AC_REQUIRE([AC_PROG_CC])dnl
8015AC_REQUIRE([AC_PROG_AWK])dnl
8016AC_REQUIRE([LT_PATH_NM])dnl
8017AC_REQUIRE([LT_PATH_LD])dnl
8018m4_require([_LT_DECL_SED])dnl
8019m4_require([_LT_DECL_EGREP])dnl
8020m4_require([_LT_TAG_COMPILER])dnl
8021
8022# Check for command to grab the raw symbol name followed by C symbol from nm.
8023AC_MSG_CHECKING([command to parse $NM output from $compiler object])
8024AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
8025[
8026# These are sane defaults that work on at least a few old systems.
8027# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
8028
8029# Character class describing NM global symbol codes.
8030symcode='[[BCDEGRST]]'
8031
8032# Regexp to match symbols that can be accessed directly from C.
8033sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
8034
8035# Define system-specific variables.
8036case $host_os in
8037aix*)
8038  symcode='[[BCDT]]'
8039  ;;
8040cygwin* | mingw* | pw32* | cegcc*)
8041  symcode='[[ABCDGISTW]]'
8042  ;;
8043hpux*)
8044  if test ia64 = "$host_cpu"; then
8045    symcode='[[ABCDEGRST]]'
8046  fi
8047  ;;
8048irix* | nonstopux*)
8049  symcode='[[BCDEGRST]]'
8050  ;;
8051osf*)
8052  symcode='[[BCDEGQRST]]'
8053  ;;
8054solaris*)
8055  symcode='[[BDRT]]'
8056  ;;
8057sco3.2v5*)
8058  symcode='[[DT]]'
8059  ;;
8060sysv4.2uw2*)
8061  symcode='[[DT]]'
8062  ;;
8063sysv5* | sco5v6* | unixware* | OpenUNIX*)
8064  symcode='[[ABDT]]'
8065  ;;
8066sysv4)
8067  symcode='[[DFNSTU]]'
8068  ;;
8069esac
8070
8071# If we're using GNU nm, then use its standard symbol codes.
8072case `$NM -V 2>&1` in
8073*GNU* | *'with BFD'*)
8074  symcode='[[ABCDGIRSTW]]' ;;
8075esac
8076
8077if test "$lt_cv_nm_interface" = "MS dumpbin"; then
8078  # Gets list of data symbols to import.
8079  lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
8080  # Adjust the below global symbol transforms to fixup imported variables.
8081  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
8082  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
8083  lt_c_name_lib_hook="\
8084  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
8085  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
8086else
8087  # Disable hooks by default.
8088  lt_cv_sys_global_symbol_to_import=
8089  lt_cdecl_hook=
8090  lt_c_name_hook=
8091  lt_c_name_lib_hook=
8092fi
8093
8094# Transform an extracted symbol line into a proper C declaration.
8095# Some systems (esp. on ia64) link data and code symbols differently,
8096# so use this general approach.
8097lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
8098$lt_cdecl_hook\
8099" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
8100" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
8101
8102# Transform an extracted symbol line into symbol name and symbol address
8103lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
8104$lt_c_name_hook\
8105" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
8106" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
8107
8108# Transform an extracted symbol line into symbol name with lib prefix and
8109# symbol address.
8110lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
8111$lt_c_name_lib_hook\
8112" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
8113" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
8114" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
8115
8116# Handle CRLF in mingw tool chain
8117opt_cr=
8118case $build_os in
8119mingw*)
8120  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
8121  ;;
8122esac
8123
8124# Try without a prefix underscore, then with it.
8125for ac_symprfx in "" "_"; do
8126
8127  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
8128  symxfrm="\\1 $ac_symprfx\\2 \\2"
8129
8130  # Write the raw and C identifiers.
8131  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
8132    # Fake it for dumpbin and say T for any non-static function,
8133    # D for any global variable and I for any imported variable.
8134    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
8135    # which start with @ or ?.
8136    lt_cv_sys_global_symbol_pipe="$AWK ['"\
8137"     {last_section=section; section=\$ 3};"\
8138"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
8139"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
8140"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
8141"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
8142"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
8143"     \$ 0!~/External *\|/{next};"\
8144"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
8145"     {if(hide[section]) next};"\
8146"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
8147"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
8148"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
8149"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
8150"     ' prfx=^$ac_symprfx]"
8151  else
8152    lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
8153  fi
8154  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
8155
8156  # Check to see that the pipe works correctly.
8157  pipe_works=no
8158
8159  rm -f conftest*
8160  cat > conftest.$ac_ext <<_LT_EOF
8161#ifdef __cplusplus
8162extern "C" {
8163#endif
8164char nm_test_var;
8165void nm_test_func(void);
8166void nm_test_func(void){}
8167#ifdef __cplusplus
8168}
8169#endif
8170int main(){nm_test_var='a';nm_test_func();return(0);}
8171_LT_EOF
8172
8173  if AC_TRY_EVAL(ac_compile); then
8174    # Now try to grab the symbols.
8175    nlist=conftest.nm
8176    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
8177      # Try sorting and uniquifying the output.
8178      if sort "$nlist" | uniq > "$nlist"T; then
8179	mv -f "$nlist"T "$nlist"
8180      else
8181	rm -f "$nlist"T
8182      fi
8183
8184      # Make sure that we snagged all the symbols we need.
8185      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
8186	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
8187	  cat <<_LT_EOF > conftest.$ac_ext
8188/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
8189#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
8190/* DATA imports from DLLs on WIN32 can't be const, because runtime
8191   relocations are performed -- see ld's documentation on pseudo-relocs.  */
8192# define LT@&t@_DLSYM_CONST
8193#elif defined __osf__
8194/* This system does not cope well with relocations in const data.  */
8195# define LT@&t@_DLSYM_CONST
8196#else
8197# define LT@&t@_DLSYM_CONST const
8198#endif
8199
8200#ifdef __cplusplus
8201extern "C" {
8202#endif
8203
8204_LT_EOF
8205	  # Now generate the symbol file.
8206	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
8207
8208	  cat <<_LT_EOF >> conftest.$ac_ext
8209
8210/* The mapping between symbol names and symbols.  */
8211LT@&t@_DLSYM_CONST struct {
8212  const char *name;
8213  void       *address;
8214}
8215lt__PROGRAM__LTX_preloaded_symbols[[]] =
8216{
8217  { "@PROGRAM@", (void *) 0 },
8218_LT_EOF
8219	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
8220	  cat <<\_LT_EOF >> conftest.$ac_ext
8221  {0, (void *) 0}
8222};
8223
8224/* This works around a problem in FreeBSD linker */
8225#ifdef FREEBSD_WORKAROUND
8226static const void *lt_preloaded_setup() {
8227  return lt__PROGRAM__LTX_preloaded_symbols;
8228}
8229#endif
8230
8231#ifdef __cplusplus
8232}
8233#endif
8234_LT_EOF
8235	  # Now try linking the two files.
8236	  mv conftest.$ac_objext conftstm.$ac_objext
8237	  lt_globsym_save_LIBS=$LIBS
8238	  lt_globsym_save_CFLAGS=$CFLAGS
8239	  LIBS=conftstm.$ac_objext
8240	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
8241	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
8242	    pipe_works=yes
8243	  fi
8244	  LIBS=$lt_globsym_save_LIBS
8245	  CFLAGS=$lt_globsym_save_CFLAGS
8246	else
8247	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
8248	fi
8249      else
8250	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
8251      fi
8252    else
8253      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
8254    fi
8255  else
8256    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
8257    cat conftest.$ac_ext >&5
8258  fi
8259  rm -rf conftest* conftst*
8260
8261  # Do not use the global_symbol_pipe unless it works.
8262  if test yes = "$pipe_works"; then
8263    break
8264  else
8265    lt_cv_sys_global_symbol_pipe=
8266  fi
8267done
8268])
8269if test -z "$lt_cv_sys_global_symbol_pipe"; then
8270  lt_cv_sys_global_symbol_to_cdecl=
8271fi
8272if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
8273  AC_MSG_RESULT(failed)
8274else
8275  AC_MSG_RESULT(ok)
8276fi
8277
8278# Response file support.
8279if test "$lt_cv_nm_interface" = "MS dumpbin"; then
8280  nm_file_list_spec='@'
8281elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
8282  nm_file_list_spec='@'
8283fi
8284
8285_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
8286    [Take the output of nm and produce a listing of raw symbols and C names])
8287_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
8288    [Transform the output of nm in a proper C declaration])
8289_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
8290    [Transform the output of nm into a list of symbols to manually relocate])
8291_LT_DECL([global_symbol_to_c_name_address],
8292    [lt_cv_sys_global_symbol_to_c_name_address], [1],
8293    [Transform the output of nm in a C name address pair])
8294_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
8295    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
8296    [Transform the output of nm in a C name address pair when lib prefix is needed])
8297_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
8298    [The name lister interface])
8299_LT_DECL([], [nm_file_list_spec], [1],
8300    [Specify filename containing input files for $NM])
8301]) # _LT_CMD_GLOBAL_SYMBOLS
8302
8303
8304# _LT_COMPILER_PIC([TAGNAME])
8305# ---------------------------
8306m4_defun([_LT_COMPILER_PIC],
8307[m4_require([_LT_TAG_COMPILER])dnl
8308_LT_TAGVAR(lt_prog_compiler_wl, $1)=
8309_LT_TAGVAR(lt_prog_compiler_pic, $1)=
8310_LT_TAGVAR(lt_prog_compiler_static, $1)=
8311
8312m4_if([$1], [CXX], [
8313  # C++ specific cases for pic, static, wl, etc.
8314  if test yes = "$GXX"; then
8315    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8316    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8317
8318    case $host_os in
8319    aix*)
8320      # All AIX code is PIC.
8321      if test ia64 = "$host_cpu"; then
8322	# AIX 5 now supports IA64 processor
8323	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8324      fi
8325      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8326      ;;
8327
8328    amigaos*)
8329      case $host_cpu in
8330      powerpc)
8331            # see comment about AmigaOS4 .so support
8332            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8333        ;;
8334      m68k)
8335            # FIXME: we need at least 68020 code to build shared libraries, but
8336            # adding the '-m68020' flag to GCC prevents building anything better,
8337            # like '-m68040'.
8338            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
8339        ;;
8340      esac
8341      ;;
8342
8343    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
8344      # PIC is the default for these OSes.
8345      ;;
8346    mingw* | cygwin* | os2* | pw32* | cegcc*)
8347      # This hack is so that the source file can tell whether it is being
8348      # built for inclusion in a dll (and should export symbols for example).
8349      # Although the cygwin gcc ignores -fPIC, still need this for old-style
8350      # (--disable-auto-import) libraries
8351      m4_if([$1], [GCJ], [],
8352	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8353      case $host_os in
8354      os2*)
8355	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
8356	;;
8357      esac
8358      ;;
8359    darwin* | rhapsody*)
8360      # PIC is the default on this platform
8361      # Common symbols not allowed in MH_DYLIB files
8362      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8363      ;;
8364    *djgpp*)
8365      # DJGPP does not support shared libraries at all
8366      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
8367      ;;
8368    haiku*)
8369      # PIC is the default for Haiku.
8370      # The "-static" flag exists, but is broken.
8371      _LT_TAGVAR(lt_prog_compiler_static, $1)=
8372      ;;
8373    interix[[3-9]]*)
8374      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8375      # Instead, we relocate shared libraries at runtime.
8376      ;;
8377    sysv4*MP*)
8378      if test -d /usr/nec; then
8379	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
8380      fi
8381      ;;
8382    hpux*)
8383      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
8384      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
8385      # sets the default TLS model and affects inlining.
8386      case $host_cpu in
8387      hppa*64*)
8388	;;
8389      *)
8390	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8391	;;
8392      esac
8393      ;;
8394    *qnx* | *nto*)
8395      # QNX uses GNU C++, but need to define -shared option too, otherwise
8396      # it will coredump.
8397      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8398      ;;
8399    *)
8400      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8401      ;;
8402    esac
8403  else
8404    case $host_os in
8405      aix[[4-9]]*)
8406	# All AIX code is PIC.
8407	if test ia64 = "$host_cpu"; then
8408	  # AIX 5 now supports IA64 processor
8409	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8410	else
8411	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
8412	fi
8413	;;
8414      chorus*)
8415	case $cc_basename in
8416	cxch68*)
8417	  # Green Hills C++ Compiler
8418	  # _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"
8419	  ;;
8420	esac
8421	;;
8422      mingw* | cygwin* | os2* | pw32* | cegcc*)
8423	# This hack is so that the source file can tell whether it is being
8424	# built for inclusion in a dll (and should export symbols for example).
8425	m4_if([$1], [GCJ], [],
8426	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8427	;;
8428      dgux*)
8429	case $cc_basename in
8430	  ec++*)
8431	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8432	    ;;
8433	  ghcx*)
8434	    # Green Hills C++ Compiler
8435	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8436	    ;;
8437	  *)
8438	    ;;
8439	esac
8440	;;
8441      freebsd* | dragonfly* | midnightbsd*)
8442	# FreeBSD uses GNU C++
8443	;;
8444      hpux9* | hpux10* | hpux11*)
8445	case $cc_basename in
8446	  CC*)
8447	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8448	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
8449	    if test ia64 != "$host_cpu"; then
8450	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8451	    fi
8452	    ;;
8453	  aCC*)
8454	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8455	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
8456	    case $host_cpu in
8457	    hppa*64*|ia64*)
8458	      # +Z the default
8459	      ;;
8460	    *)
8461	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8462	      ;;
8463	    esac
8464	    ;;
8465	  *)
8466	    ;;
8467	esac
8468	;;
8469      interix*)
8470	# This is c89, which is MS Visual C++ (no shared libs)
8471	# Anyone wants to do a port?
8472	;;
8473      irix5* | irix6* | nonstopux*)
8474	case $cc_basename in
8475	  CC*)
8476	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8477	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8478	    # CC pic flag -KPIC is the default.
8479	    ;;
8480	  *)
8481	    ;;
8482	esac
8483	;;
8484      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
8485	case $cc_basename in
8486	  KCC*)
8487	    # KAI C++ Compiler
8488	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
8489	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8490	    ;;
8491	  ecpc* )
8492	    # old Intel C++ for x86_64, which still supported -KPIC.
8493	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8494	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8495	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8496	    ;;
8497	  icpc* )
8498	    # Intel C++, used to be incompatible with GCC.
8499	    # ICC 10 doesn't accept -KPIC any more.
8500	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8501	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8502	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8503	    ;;
8504	  pgCC* | pgcpp*)
8505	    # Portland Group C++ compiler
8506	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8507	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8508	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8509	    ;;
8510	  cxx*)
8511	    # Compaq C++
8512	    # Make sure the PIC flag is empty.  It appears that all Alpha
8513	    # Linux and Compaq Tru64 Unix objects are PIC.
8514	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
8515	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8516	    ;;
8517	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
8518	    # IBM XL 8.0, 9.0 on PPC and BlueGene
8519	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8520	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
8521	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
8522	    ;;
8523	  *)
8524	    case `$CC -V 2>&1 | $SED 5q` in
8525	    *Sun\ C*)
8526	      # Sun C++ 5.9
8527	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8528	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8529	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8530	      ;;
8531	    esac
8532	    ;;
8533	esac
8534	;;
8535      lynxos*)
8536	;;
8537      m88k*)
8538	;;
8539      mvs*)
8540	case $cc_basename in
8541	  cxx*)
8542	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
8543	    ;;
8544	  *)
8545	    ;;
8546	esac
8547	;;
8548      netbsd*)
8549	;;
8550      *qnx* | *nto*)
8551        # QNX uses GNU C++, but need to define -shared option too, otherwise
8552        # it will coredump.
8553        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8554        ;;
8555      osf3* | osf4* | osf5*)
8556	case $cc_basename in
8557	  KCC*)
8558	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
8559	    ;;
8560	  RCC*)
8561	    # Rational C++ 2.4.1
8562	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8563	    ;;
8564	  cxx*)
8565	    # Digital/Compaq C++
8566	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8567	    # Make sure the PIC flag is empty.  It appears that all Alpha
8568	    # Linux and Compaq Tru64 Unix objects are PIC.
8569	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
8570	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8571	    ;;
8572	  *)
8573	    ;;
8574	esac
8575	;;
8576      psos*)
8577	;;
8578      solaris*)
8579	case $cc_basename in
8580	  CC* | sunCC*)
8581	    # Sun C++ 4.2, 5.x and Centerline C++
8582	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8583	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8584	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8585	    ;;
8586	  gcx*)
8587	    # Green Hills C++ Compiler
8588	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8589	    ;;
8590	  *)
8591	    ;;
8592	esac
8593	;;
8594      sunos4*)
8595	case $cc_basename in
8596	  CC*)
8597	    # Sun C++ 4.x
8598	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8599	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8600	    ;;
8601	  lcc*)
8602	    # Lucid
8603	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8604	    ;;
8605	  *)
8606	    ;;
8607	esac
8608	;;
8609      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8610	case $cc_basename in
8611	  CC*)
8612	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8613	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8614	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8615	    ;;
8616	esac
8617	;;
8618      tandem*)
8619	case $cc_basename in
8620	  NCC*)
8621	    # NonStop-UX NCC 3.20
8622	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8623	    ;;
8624	  *)
8625	    ;;
8626	esac
8627	;;
8628      vxworks*)
8629	;;
8630      *)
8631	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8632	;;
8633    esac
8634  fi
8635],
8636[
8637  if test yes = "$GCC"; then
8638    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8639    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8640
8641    case $host_os in
8642      aix*)
8643      # All AIX code is PIC.
8644      if test ia64 = "$host_cpu"; then
8645	# AIX 5 now supports IA64 processor
8646	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8647      fi
8648      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8649      ;;
8650
8651    amigaos*)
8652      case $host_cpu in
8653      powerpc)
8654            # see comment about AmigaOS4 .so support
8655            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8656        ;;
8657      m68k)
8658            # FIXME: we need at least 68020 code to build shared libraries, but
8659            # adding the '-m68020' flag to GCC prevents building anything better,
8660            # like '-m68040'.
8661            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
8662        ;;
8663      esac
8664      ;;
8665
8666    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
8667      # PIC is the default for these OSes.
8668      ;;
8669
8670    mingw* | cygwin* | pw32* | os2* | cegcc*)
8671      # This hack is so that the source file can tell whether it is being
8672      # built for inclusion in a dll (and should export symbols for example).
8673      # Although the cygwin gcc ignores -fPIC, still need this for old-style
8674      # (--disable-auto-import) libraries
8675      m4_if([$1], [GCJ], [],
8676	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8677      case $host_os in
8678      os2*)
8679	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
8680	;;
8681      esac
8682      ;;
8683
8684    darwin* | rhapsody*)
8685      # PIC is the default on this platform
8686      # Common symbols not allowed in MH_DYLIB files
8687      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8688      ;;
8689
8690    haiku*)
8691      # PIC is the default for Haiku.
8692      # The "-static" flag exists, but is broken.
8693      _LT_TAGVAR(lt_prog_compiler_static, $1)=
8694      ;;
8695
8696    hpux*)
8697      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
8698      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
8699      # sets the default TLS model and affects inlining.
8700      case $host_cpu in
8701      hppa*64*)
8702	# +Z the default
8703	;;
8704      *)
8705	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8706	;;
8707      esac
8708      ;;
8709
8710    interix[[3-9]]*)
8711      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8712      # Instead, we relocate shared libraries at runtime.
8713      ;;
8714
8715    msdosdjgpp*)
8716      # Just because we use GCC doesn't mean we suddenly get shared libraries
8717      # on systems that don't support them.
8718      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8719      enable_shared=no
8720      ;;
8721
8722    *nto* | *qnx*)
8723      # QNX uses GNU C++, but need to define -shared option too, otherwise
8724      # it will coredump.
8725      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8726      ;;
8727
8728    sysv4*MP*)
8729      if test -d /usr/nec; then
8730	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
8731      fi
8732      ;;
8733
8734    *)
8735      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8736      ;;
8737    esac
8738
8739    case $cc_basename in
8740    nvcc*) # Cuda Compiler Driver 2.2
8741      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
8742      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8743        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
8744      fi
8745      ;;
8746    esac
8747  else
8748    # PORTME Check for flag to pass linker flags through the system compiler.
8749    case $host_os in
8750    aix*)
8751      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8752      if test ia64 = "$host_cpu"; then
8753	# AIX 5 now supports IA64 processor
8754	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8755      else
8756	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
8757      fi
8758      ;;
8759
8760    darwin* | rhapsody*)
8761      # PIC is the default on this platform
8762      # Common symbols not allowed in MH_DYLIB files
8763      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
8764      case $cc_basename in
8765      nagfor*)
8766        # NAG Fortran compiler
8767        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8768        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8769        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8770        ;;
8771      esac
8772      ;;
8773
8774    mingw* | cygwin* | pw32* | os2* | cegcc*)
8775      # This hack is so that the source file can tell whether it is being
8776      # built for inclusion in a dll (and should export symbols for example).
8777      m4_if([$1], [GCJ], [],
8778	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
8779      case $host_os in
8780      os2*)
8781	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
8782	;;
8783      esac
8784      ;;
8785
8786    hpux9* | hpux10* | hpux11*)
8787      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8788      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8789      # not for PA HP-UX.
8790      case $host_cpu in
8791      hppa*64*|ia64*)
8792	# +Z the default
8793	;;
8794      *)
8795	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
8796	;;
8797      esac
8798      # Is there a better lt_prog_compiler_static that works with the bundled CC?
8799      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
8800      ;;
8801
8802    irix5* | irix6* | nonstopux*)
8803      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8804      # PIC (with -KPIC) is the default.
8805      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8806      ;;
8807
8808    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
8809      case $cc_basename in
8810      # old Intel for x86_64, which still supported -KPIC.
8811      ecc*)
8812	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8813	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8814	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8815        ;;
8816      # icc used to be incompatible with GCC.
8817      # ICC 10 doesn't accept -KPIC any more.
8818      icc* | ifort*)
8819	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8820	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8821	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8822        ;;
8823      # Lahey Fortran 8.1.
8824      lf95*)
8825	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8826	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
8827	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
8828	;;
8829      nagfor*)
8830	# NAG Fortran compiler
8831	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
8832	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8833	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8834	;;
8835      tcc*)
8836	# Fabrice Bellard et al's Tiny C Compiler
8837	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8838	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8839	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8840	;;
8841      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
8842        # Portland Group compilers (*not* the Pentium gcc compiler,
8843	# which looks to be a dead project)
8844	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8845	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8846	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8847        ;;
8848      ccc*)
8849        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8850        # All Alpha code is PIC.
8851        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8852        ;;
8853      xl* | bgxl* | bgf* | mpixl*)
8854	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
8855	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8856	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
8857	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
8858	;;
8859      *)
8860	case `$CC -V 2>&1 | $SED 5q` in
8861	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
8862	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
8863	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8864	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8865	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
8866	  ;;
8867	*Sun\ F* | *Sun*Fortran*)
8868	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8869	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8870	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8871	  ;;
8872	*Sun\ C*)
8873	  # Sun C 5.9
8874	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8875	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8876	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8877	  ;;
8878        *Intel*\ [[CF]]*Compiler*)
8879	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8880	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
8881	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
8882	  ;;
8883	*Portland\ Group*)
8884	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8885	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
8886	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8887	  ;;
8888	esac
8889	;;
8890      esac
8891      ;;
8892
8893    newsos6)
8894      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8895      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8896      ;;
8897
8898    *nto* | *qnx*)
8899      # QNX uses GNU C++, but need to define -shared option too, otherwise
8900      # it will coredump.
8901      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
8902      ;;
8903
8904    osf3* | osf4* | osf5*)
8905      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8906      # All OSF/1 code is PIC.
8907      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8908      ;;
8909
8910    rdos*)
8911      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
8912      ;;
8913
8914    solaris*)
8915      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8916      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8917      case $cc_basename in
8918      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
8919	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
8920      *)
8921	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
8922      esac
8923      ;;
8924
8925    sunos4*)
8926      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
8927      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
8928      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8929      ;;
8930
8931    sysv4 | sysv4.2uw2* | sysv4.3*)
8932      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8933      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8934      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8935      ;;
8936
8937    sysv4*MP*)
8938      if test -d /usr/nec; then
8939	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
8940	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8941      fi
8942      ;;
8943
8944    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8945      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8946      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
8947      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8948      ;;
8949
8950    unicos*)
8951      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
8952      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8953      ;;
8954
8955    uts4*)
8956      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
8957      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
8958      ;;
8959
8960    *)
8961      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
8962      ;;
8963    esac
8964  fi
8965])
8966case $host_os in
8967  # For platforms that do not support PIC, -DPIC is meaningless:
8968  *djgpp*)
8969    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
8970    ;;
8971  *)
8972    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
8973    ;;
8974esac
8975
8976AC_CACHE_CHECK([for $compiler option to produce PIC],
8977  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
8978  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
8979_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
8980
8981#
8982# Check to make sure the PIC flag actually works.
8983#
8984if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
8985  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
8986    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
8987    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
8988    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
8989     "" | " "*) ;;
8990     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
8991     esac],
8992    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
8993     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
8994fi
8995_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
8996	[Additional compiler flags for building library objects])
8997
8998_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
8999	[How to pass a linker flag through the compiler])
9000#
9001# Check to make sure the static flag actually works.
9002#
9003wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
9004_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
9005  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
9006  $lt_tmp_static_flag,
9007  [],
9008  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
9009_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
9010	[Compiler flag to prevent dynamic linking])
9011])# _LT_COMPILER_PIC
9012
9013
9014# _LT_LINKER_SHLIBS([TAGNAME])
9015# ----------------------------
9016# See if the linker supports building shared libraries.
9017m4_defun([_LT_LINKER_SHLIBS],
9018[AC_REQUIRE([LT_PATH_LD])dnl
9019AC_REQUIRE([LT_PATH_NM])dnl
9020m4_require([_LT_PATH_MANIFEST_TOOL])dnl
9021m4_require([_LT_FILEUTILS_DEFAULTS])dnl
9022m4_require([_LT_DECL_EGREP])dnl
9023m4_require([_LT_DECL_SED])dnl
9024m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
9025m4_require([_LT_TAG_COMPILER])dnl
9026AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9027m4_if([$1], [CXX], [
9028  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
9029  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
9030  case $host_os in
9031  aix[[4-9]]*)
9032    # If we're using GNU nm, then we don't want the "-C" option.
9033    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
9034    # Without the "-l" option, or with the "-B" option, AIX nm treats
9035    # weak defined symbols like other global defined symbols, whereas
9036    # GNU nm marks them as "W".
9037    # While the 'weak' keyword is ignored in the Export File, we need
9038    # it in the Import File for the 'aix-soname' feature, so we have
9039    # to replace the "-B" option with "-P" for AIX nm.
9040    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
9041      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
9042    else
9043      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
9044    fi
9045    ;;
9046  pw32*)
9047    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
9048    ;;
9049  cygwin* | mingw* | cegcc*)
9050    case $cc_basename in
9051    cl* | icl*)
9052      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
9053      ;;
9054    *)
9055      _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'
9056      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
9057      ;;
9058    esac
9059    ;;
9060  *)
9061    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
9062    ;;
9063  esac
9064], [
9065  runpath_var=
9066  _LT_TAGVAR(allow_undefined_flag, $1)=
9067  _LT_TAGVAR(always_export_symbols, $1)=no
9068  _LT_TAGVAR(archive_cmds, $1)=
9069  _LT_TAGVAR(archive_expsym_cmds, $1)=
9070  _LT_TAGVAR(compiler_needs_object, $1)=no
9071  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9072  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
9073  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
9074  _LT_TAGVAR(hardcode_automatic, $1)=no
9075  _LT_TAGVAR(hardcode_direct, $1)=no
9076  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
9077  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9078  _LT_TAGVAR(hardcode_libdir_separator, $1)=
9079  _LT_TAGVAR(hardcode_minus_L, $1)=no
9080  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9081  _LT_TAGVAR(inherit_rpath, $1)=no
9082  _LT_TAGVAR(link_all_deplibs, $1)=unknown
9083  _LT_TAGVAR(module_cmds, $1)=
9084  _LT_TAGVAR(module_expsym_cmds, $1)=
9085  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
9086  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
9087  _LT_TAGVAR(thread_safe_flag_spec, $1)=
9088  _LT_TAGVAR(whole_archive_flag_spec, $1)=
9089  # include_expsyms should be a list of space-separated symbols to be *always*
9090  # included in the symbol list
9091  _LT_TAGVAR(include_expsyms, $1)=
9092  # exclude_expsyms can be an extended regexp of symbols to exclude
9093  # it will be wrapped by ' (' and ')$', so one must not match beginning or
9094  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
9095  # as well as any symbol that contains 'd'.
9096  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
9097  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
9098  # platforms (ab)use it in PIC code, but their linkers get confused if
9099  # the symbol is explicitly referenced.  Since portable code cannot
9100  # rely on this symbol name, it's probably fine to never include it in
9101  # preloaded symbol tables.
9102  # Exclude shared library initialization/finalization symbols.
9103dnl Note also adjust exclude_expsyms for C++ above.
9104  extract_expsyms_cmds=
9105
9106  case $host_os in
9107  cygwin* | mingw* | pw32* | cegcc*)
9108    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
9109    # When not using gcc, we currently assume that we are using
9110    # Microsoft Visual C++ or Intel C++ Compiler.
9111    if test yes != "$GCC"; then
9112      with_gnu_ld=no
9113    fi
9114    ;;
9115  interix*)
9116    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
9117    with_gnu_ld=yes
9118    ;;
9119  openbsd* | bitrig*)
9120    with_gnu_ld=no
9121    ;;
9122  esac
9123
9124  _LT_TAGVAR(ld_shlibs, $1)=yes
9125
9126  # On some targets, GNU ld is compatible enough with the native linker
9127  # that we're better off using the native interface for both.
9128  lt_use_gnu_ld_interface=no
9129  if test yes = "$with_gnu_ld"; then
9130    case $host_os in
9131      aix*)
9132	# The AIX port of GNU ld has always aspired to compatibility
9133	# with the native linker.  However, as the warning in the GNU ld
9134	# block says, versions before 2.19.5* couldn't really create working
9135	# shared libraries, regardless of the interface used.
9136	case `$LD -v 2>&1` in
9137	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
9138	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
9139	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
9140	  *)
9141	    lt_use_gnu_ld_interface=yes
9142	    ;;
9143	esac
9144	;;
9145      *)
9146	lt_use_gnu_ld_interface=yes
9147	;;
9148    esac
9149  fi
9150
9151  if test yes = "$lt_use_gnu_ld_interface"; then
9152    # If archive_cmds runs LD, not CC, wlarc should be empty
9153    wlarc='$wl'
9154
9155    # Set some defaults for GNU ld with shared library support. These
9156    # are reset later if shared libraries are not supported. Putting them
9157    # here allows them to be overridden if necessary.
9158    runpath_var=LD_RUN_PATH
9159    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9160    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
9161    # ancient GNU ld didn't support --whole-archive et. al.
9162    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
9163      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
9164    else
9165      _LT_TAGVAR(whole_archive_flag_spec, $1)=
9166    fi
9167    supports_anon_versioning=no
9168    case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
9169      *GNU\ gold*) supports_anon_versioning=yes ;;
9170      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
9171      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
9172      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
9173      *\ 2.11.*) ;; # other 2.11 versions
9174      *) supports_anon_versioning=yes ;;
9175    esac
9176
9177    # See if GNU ld supports shared libraries.
9178    case $host_os in
9179    aix[[3-9]]*)
9180      # On AIX/PPC, the GNU linker is very broken
9181      if test ia64 != "$host_cpu"; then
9182	_LT_TAGVAR(ld_shlibs, $1)=no
9183	cat <<_LT_EOF 1>&2
9184
9185*** Warning: the GNU linker, at least up to release 2.19, is reported
9186*** to be unable to reliably create shared libraries on AIX.
9187*** Therefore, libtool is disabling shared libraries support.  If you
9188*** really care for shared libraries, you may want to install binutils
9189*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
9190*** You will then need to restart the configuration process.
9191
9192_LT_EOF
9193      fi
9194      ;;
9195
9196    amigaos*)
9197      case $host_cpu in
9198      powerpc)
9199            # see comment about AmigaOS4 .so support
9200            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9201            _LT_TAGVAR(archive_expsym_cmds, $1)=''
9202        ;;
9203      m68k)
9204            _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)'
9205            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9206            _LT_TAGVAR(hardcode_minus_L, $1)=yes
9207        ;;
9208      esac
9209      ;;
9210
9211    beos*)
9212      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9213	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9214	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9215	# support --undefined.  This deserves some investigation.  FIXME
9216	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9217      else
9218	_LT_TAGVAR(ld_shlibs, $1)=no
9219      fi
9220      ;;
9221
9222    cygwin* | mingw* | pw32* | cegcc*)
9223      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
9224      # as there is no search path for DLLs.
9225      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9226      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
9227      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9228      _LT_TAGVAR(always_export_symbols, $1)=no
9229      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9230      _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'
9231      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
9232
9233      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
9234        _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'
9235	# If the export-symbols file already is a .def file, use it as
9236	# is; otherwise, prepend EXPORTS...
9237	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
9238          cp $export_symbols $output_objdir/$soname.def;
9239        else
9240          echo EXPORTS > $output_objdir/$soname.def;
9241          cat $export_symbols >> $output_objdir/$soname.def;
9242        fi~
9243        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9244      else
9245	_LT_TAGVAR(ld_shlibs, $1)=no
9246      fi
9247      ;;
9248
9249    haiku*)
9250      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9251      _LT_TAGVAR(link_all_deplibs, $1)=yes
9252      ;;
9253
9254    os2*)
9255      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9256      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9257      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9258      shrext_cmds=.dll
9259      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9260	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9261	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9262	$ECHO EXPORTS >> $output_objdir/$libname.def~
9263	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9264	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9265	emximp -o $lib $output_objdir/$libname.def'
9266      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9267	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9268	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9269	$ECHO EXPORTS >> $output_objdir/$libname.def~
9270	prefix_cmds="$SED"~
9271	if test EXPORTS = "`$SED 1q $export_symbols`"; then
9272	  prefix_cmds="$prefix_cmds -e 1d";
9273	fi~
9274	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9275	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9276	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9277	emximp -o $lib $output_objdir/$libname.def'
9278      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9279      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9280      _LT_TAGVAR(file_list_spec, $1)='@'
9281      ;;
9282
9283    interix[[3-9]]*)
9284      _LT_TAGVAR(hardcode_direct, $1)=no
9285      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9286      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9287      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9288      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
9289      # Instead, shared libraries are loaded at an image base (0x10000000 by
9290      # default) and relocated if they conflict, which is a slow very memory
9291      # consuming and fragmenting process.  To avoid this, we pick a random,
9292      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
9293      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
9294      _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'
9295      _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'
9296      ;;
9297
9298    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
9299      tmp_diet=no
9300      if test linux-dietlibc = "$host_os"; then
9301	case $cc_basename in
9302	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
9303	esac
9304      fi
9305      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
9306	 && test no = "$tmp_diet"
9307      then
9308	tmp_addflag=' $pic_flag'
9309	tmp_sharedflag='-shared'
9310	case $cc_basename,$host_cpu in
9311        pgcc*)				# Portland Group C compiler
9312	  _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'
9313	  tmp_addflag=' $pic_flag'
9314	  ;;
9315	pgf77* | pgf90* | pgf95* | pgfortran*)
9316					# Portland Group f77 and f90 compilers
9317	  _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'
9318	  tmp_addflag=' $pic_flag -Mnomain' ;;
9319	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
9320	  tmp_addflag=' -i_dynamic' ;;
9321	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
9322	  tmp_addflag=' -i_dynamic -nofor_main' ;;
9323	ifc* | ifort*)			# Intel Fortran compiler
9324	  tmp_addflag=' -nofor_main' ;;
9325	lf95*)				# Lahey Fortran 8.1
9326	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
9327	  tmp_sharedflag='--shared' ;;
9328        nagfor*)                        # NAGFOR 5.3
9329          tmp_sharedflag='-Wl,-shared' ;;
9330	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
9331	  tmp_sharedflag='-qmkshrobj'
9332	  tmp_addflag= ;;
9333	nvcc*)	# Cuda Compiler Driver 2.2
9334	  _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'
9335	  _LT_TAGVAR(compiler_needs_object, $1)=yes
9336	  ;;
9337	esac
9338	case `$CC -V 2>&1 | $SED 5q` in
9339	*Sun\ C*)			# Sun C 5.9
9340	  _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'
9341	  _LT_TAGVAR(compiler_needs_object, $1)=yes
9342	  tmp_sharedflag='-G' ;;
9343	*Sun\ F*)			# Sun Fortran 8.3
9344	  tmp_sharedflag='-G' ;;
9345	esac
9346	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9347
9348        if test yes = "$supports_anon_versioning"; then
9349          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
9350            cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9351            echo "local: *; };" >> $output_objdir/$libname.ver~
9352            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
9353        fi
9354
9355	case $cc_basename in
9356	tcc*)
9357	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
9358	  ;;
9359	xlf* | bgf* | bgxlf* | mpixlf*)
9360	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
9361	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
9362	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9363	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
9364	  if test yes = "$supports_anon_versioning"; then
9365	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
9366              cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9367              echo "local: *; };" >> $output_objdir/$libname.ver~
9368              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
9369	  fi
9370	  ;;
9371	esac
9372      else
9373        _LT_TAGVAR(ld_shlibs, $1)=no
9374      fi
9375      ;;
9376
9377    netbsd*)
9378      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9379	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
9380	wlarc=
9381      else
9382	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9383	_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'
9384      fi
9385      ;;
9386
9387    solaris*)
9388      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
9389	_LT_TAGVAR(ld_shlibs, $1)=no
9390	cat <<_LT_EOF 1>&2
9391
9392*** Warning: The releases 2.8.* of the GNU linker cannot reliably
9393*** create shared libraries on Solaris systems.  Therefore, libtool
9394*** is disabling shared libraries support.  We urge you to upgrade GNU
9395*** binutils to release 2.9.1 or newer.  Another option is to modify
9396*** your PATH or compiler configuration so that the native linker is
9397*** used, and then restart.
9398
9399_LT_EOF
9400      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9401	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9402	_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'
9403      else
9404	_LT_TAGVAR(ld_shlibs, $1)=no
9405      fi
9406      ;;
9407
9408    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
9409      case `$LD -v 2>&1` in
9410        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
9411	_LT_TAGVAR(ld_shlibs, $1)=no
9412	cat <<_LT_EOF 1>&2
9413
9414*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
9415*** reliably create shared libraries on SCO systems.  Therefore, libtool
9416*** is disabling shared libraries support.  We urge you to upgrade GNU
9417*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
9418*** your PATH or compiler configuration so that the native linker is
9419*** used, and then restart.
9420
9421_LT_EOF
9422	;;
9423	*)
9424	  # For security reasons, it is highly recommended that you always
9425	  # use absolute paths for naming shared libraries, and exclude the
9426	  # DT_RUNPATH tag from executables and libraries.  But doing so
9427	  # requires that you compile everything twice, which is a pain.
9428	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9429	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9430	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9431	    _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'
9432	  else
9433	    _LT_TAGVAR(ld_shlibs, $1)=no
9434	  fi
9435	;;
9436      esac
9437      ;;
9438
9439    sunos4*)
9440      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9441      wlarc=
9442      _LT_TAGVAR(hardcode_direct, $1)=yes
9443      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9444      ;;
9445
9446    *)
9447      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9448	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9449	_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'
9450      else
9451	_LT_TAGVAR(ld_shlibs, $1)=no
9452      fi
9453      ;;
9454    esac
9455
9456    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
9457      runpath_var=
9458      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
9459      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
9460      _LT_TAGVAR(whole_archive_flag_spec, $1)=
9461    fi
9462  else
9463    # PORTME fill in a description of your system's linker (not GNU ld)
9464    case $host_os in
9465    aix3*)
9466      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9467      _LT_TAGVAR(always_export_symbols, $1)=yes
9468      _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'
9469      # Note: this linker hardcodes the directories in LIBPATH if there
9470      # are no directories specified by -L.
9471      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9472      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
9473	# Neither direct hardcoding nor static linking is supported with a
9474	# broken collect2.
9475	_LT_TAGVAR(hardcode_direct, $1)=unsupported
9476      fi
9477      ;;
9478
9479    aix[[4-9]]*)
9480      if test ia64 = "$host_cpu"; then
9481	# On IA64, the linker does run time linking by default, so we don't
9482	# have to do anything special.
9483	aix_use_runtimelinking=no
9484	exp_sym_flag='-Bexport'
9485	no_entry_flag=
9486      else
9487	# If we're using GNU nm, then we don't want the "-C" option.
9488	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
9489	# Without the "-l" option, or with the "-B" option, AIX nm treats
9490	# weak defined symbols like other global defined symbols, whereas
9491	# GNU nm marks them as "W".
9492	# While the 'weak' keyword is ignored in the Export File, we need
9493	# it in the Import File for the 'aix-soname' feature, so we have
9494	# to replace the "-B" option with "-P" for AIX nm.
9495	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
9496	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
9497	else
9498	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
9499	fi
9500	aix_use_runtimelinking=no
9501
9502	# Test if we are trying to use run time linking or normal
9503	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
9504	# have runtime linking enabled, and use it for executables.
9505	# For shared libraries, we enable/disable runtime linking
9506	# depending on the kind of the shared library created -
9507	# when "with_aix_soname,aix_use_runtimelinking" is:
9508	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
9509	# "aix,yes"  lib.so          shared, rtl:yes, for executables
9510	#            lib.a           static archive
9511	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
9512	#            lib.a(lib.so.V) shared, rtl:no,  for executables
9513	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
9514	#            lib.a(lib.so.V) shared, rtl:no
9515	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
9516	#            lib.a           static archive
9517	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
9518	  for ld_flag in $LDFLAGS; do
9519	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
9520	    aix_use_runtimelinking=yes
9521	    break
9522	  fi
9523	  done
9524	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
9525	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
9526	    # so we don't have lib.a shared libs to link our executables.
9527	    # We have to force runtime linking in this case.
9528	    aix_use_runtimelinking=yes
9529	    LDFLAGS="$LDFLAGS -Wl,-brtl"
9530	  fi
9531	  ;;
9532	esac
9533
9534	exp_sym_flag='-bexport'
9535	no_entry_flag='-bnoentry'
9536      fi
9537
9538      # When large executables or shared objects are built, AIX ld can
9539      # have problems creating the table of contents.  If linking a library
9540      # or program results in "error TOC overflow" add -mminimal-toc to
9541      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
9542      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9543
9544      _LT_TAGVAR(archive_cmds, $1)=''
9545      _LT_TAGVAR(hardcode_direct, $1)=yes
9546      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9547      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
9548      _LT_TAGVAR(link_all_deplibs, $1)=yes
9549      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
9550      case $with_aix_soname,$aix_use_runtimelinking in
9551      aix,*) ;; # traditional, no import file
9552      svr4,* | *,yes) # use import file
9553	# The Import File defines what to hardcode.
9554	_LT_TAGVAR(hardcode_direct, $1)=no
9555	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
9556	;;
9557      esac
9558
9559      if test yes = "$GCC"; then
9560	case $host_os in aix4.[[012]]|aix4.[[012]].*)
9561	# We only want to do this on AIX 4.2 and lower, the check
9562	# below for broken collect2 doesn't work under 4.3+
9563	  collect2name=`$CC -print-prog-name=collect2`
9564	  if test -f "$collect2name" &&
9565	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
9566	  then
9567	  # We have reworked collect2
9568	  :
9569	  else
9570	  # We have old collect2
9571	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
9572	  # It fails to find uninstalled libraries when the uninstalled
9573	  # path is not listed in the libpath.  Setting hardcode_minus_L
9574	  # to unsupported forces relinking
9575	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
9576	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9577	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
9578	  fi
9579	  ;;
9580	esac
9581	shared_flag='-shared'
9582	if test yes = "$aix_use_runtimelinking"; then
9583	  shared_flag="$shared_flag "'$wl-G'
9584	fi
9585	# Need to ensure runtime linking is disabled for the traditional
9586	# shared library, or the linker may eventually find shared libraries
9587	# /with/ Import File - we do not want to mix them.
9588	shared_flag_aix='-shared'
9589	shared_flag_svr4='-shared $wl-G'
9590      else
9591	# not using gcc
9592	if test ia64 = "$host_cpu"; then
9593	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9594	# chokes on -Wl,-G. The following line is correct:
9595	  shared_flag='-G'
9596	else
9597	  if test yes = "$aix_use_runtimelinking"; then
9598	    shared_flag='$wl-G'
9599	  else
9600	    shared_flag='$wl-bM:SRE'
9601	  fi
9602	  shared_flag_aix='$wl-bM:SRE'
9603	  shared_flag_svr4='$wl-G'
9604	fi
9605      fi
9606
9607      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
9608      # It seems that -bexpall does not export symbols beginning with
9609      # underscore (_), so it is better to generate a list of symbols to export.
9610      _LT_TAGVAR(always_export_symbols, $1)=yes
9611      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
9612	# Warning - without using the other runtime loading flags (-brtl),
9613	# -berok will link without error, but may produce a broken library.
9614	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
9615        # Determine the default libpath from the value encoded in an
9616        # empty executable.
9617        _LT_SYS_MODULE_PATH_AIX([$1])
9618        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9619        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
9620      else
9621	if test ia64 = "$host_cpu"; then
9622	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
9623	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
9624	  _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"
9625	else
9626	 # Determine the default libpath from the value encoded in an
9627	 # empty executable.
9628	 _LT_SYS_MODULE_PATH_AIX([$1])
9629	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
9630	  # Warning - without using the other run time loading flags,
9631	  # -berok will link without error, but may produce a broken library.
9632	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
9633	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
9634	  if test yes = "$with_gnu_ld"; then
9635	    # We only use this code for GNU lds that support --whole-archive.
9636	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
9637	  else
9638	    # Exported symbols can be pulled into shared objects from archives
9639	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
9640	  fi
9641	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
9642	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
9643	  # -brtl affects multiple linker settings, -berok does not and is overridden later
9644	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
9645	  if test svr4 != "$with_aix_soname"; then
9646	    # This is similar to how AIX traditionally builds its shared libraries.
9647	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
9648	  fi
9649	  if test aix != "$with_aix_soname"; then
9650	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
9651	  else
9652	    # used by -dlpreopen to get the symbols
9653	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
9654	  fi
9655	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
9656	fi
9657      fi
9658      ;;
9659
9660    amigaos*)
9661      case $host_cpu in
9662      powerpc)
9663            # see comment about AmigaOS4 .so support
9664            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9665            _LT_TAGVAR(archive_expsym_cmds, $1)=''
9666        ;;
9667      m68k)
9668            _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)'
9669            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9670            _LT_TAGVAR(hardcode_minus_L, $1)=yes
9671        ;;
9672      esac
9673      ;;
9674
9675    bsdi[[45]]*)
9676      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
9677      ;;
9678
9679    cygwin* | mingw* | pw32* | cegcc*)
9680      # When not using gcc, we currently assume that we are using
9681      # Microsoft Visual C++ or Intel C++ Compiler.
9682      # hardcode_libdir_flag_spec is actually meaningless, as there is
9683      # no search path for DLLs.
9684      case $cc_basename in
9685      cl* | icl*)
9686	# Native MSVC or ICC
9687	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9688	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9689	_LT_TAGVAR(always_export_symbols, $1)=yes
9690	_LT_TAGVAR(file_list_spec, $1)='@'
9691	# Tell ltmain to make .lib files, not .a files.
9692	libext=lib
9693	# Tell ltmain to make .dll files, not .so files.
9694	shrext_cmds=.dll
9695	# FIXME: Setting linknames here is a bad hack.
9696	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
9697	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
9698            cp "$export_symbols" "$output_objdir/$soname.def";
9699            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
9700          else
9701            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
9702          fi~
9703          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9704          linknames='
9705	# The linker will not automatically build a static lib if we build a DLL.
9706	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9707	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9708	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
9709	_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'
9710	# Don't use ranlib
9711	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
9712	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
9713          lt_tool_outputfile="@TOOL_OUTPUT@"~
9714          case $lt_outputfile in
9715            *.exe|*.EXE) ;;
9716            *)
9717              lt_outputfile=$lt_outputfile.exe
9718              lt_tool_outputfile=$lt_tool_outputfile.exe
9719              ;;
9720          esac~
9721          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
9722            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9723            $RM "$lt_outputfile.manifest";
9724          fi'
9725	;;
9726      *)
9727	# Assume MSVC and ICC wrapper
9728	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
9729	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9730	# Tell ltmain to make .lib files, not .a files.
9731	libext=lib
9732	# Tell ltmain to make .dll files, not .so files.
9733	shrext_cmds=.dll
9734	# FIXME: Setting linknames here is a bad hack.
9735	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
9736	# The linker will automatically build a .lib file if we build a DLL.
9737	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
9738	# FIXME: Should let the user specify the lib program.
9739	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
9740	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9741	;;
9742      esac
9743      ;;
9744
9745    darwin* | rhapsody*)
9746      _LT_DARWIN_LINKER_FEATURES($1)
9747      ;;
9748
9749    dgux*)
9750      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9751      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9752      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9753      ;;
9754
9755    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
9756    # support.  Future versions do this automatically, but an explicit c++rt0.o
9757    # does not break anything, and helps significantly (at the cost of a little
9758    # extra space).
9759    freebsd2.2*)
9760      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
9761      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9762      _LT_TAGVAR(hardcode_direct, $1)=yes
9763      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9764      ;;
9765
9766    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9767    freebsd2.*)
9768      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9769      _LT_TAGVAR(hardcode_direct, $1)=yes
9770      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9771      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9772      ;;
9773
9774    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9775    freebsd* | dragonfly* | midnightbsd*)
9776      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9777      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9778      _LT_TAGVAR(hardcode_direct, $1)=yes
9779      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9780      ;;
9781
9782    hpux9*)
9783      if test yes = "$GCC"; then
9784	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9785      else
9786	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9787      fi
9788      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9789      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9790      _LT_TAGVAR(hardcode_direct, $1)=yes
9791
9792      # hardcode_minus_L: Not really in the search PATH,
9793      # but as the default location of the library.
9794      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9795      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9796      ;;
9797
9798    hpux10*)
9799      if test yes,no = "$GCC,$with_gnu_ld"; then
9800	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9801      else
9802	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9803      fi
9804      if test no = "$with_gnu_ld"; then
9805	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9806	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9807	_LT_TAGVAR(hardcode_direct, $1)=yes
9808	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9809	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9810	# hardcode_minus_L: Not really in the search PATH,
9811	# but as the default location of the library.
9812	_LT_TAGVAR(hardcode_minus_L, $1)=yes
9813      fi
9814      ;;
9815
9816    hpux11*)
9817      if test yes,no = "$GCC,$with_gnu_ld"; then
9818	case $host_cpu in
9819	hppa*64*)
9820	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9821	  ;;
9822	ia64*)
9823	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9824	  ;;
9825	*)
9826	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9827	  ;;
9828	esac
9829      else
9830	case $host_cpu in
9831	hppa*64*)
9832	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9833	  ;;
9834	ia64*)
9835	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9836	  ;;
9837	*)
9838	m4_if($1, [], [
9839	  # Older versions of the 11.00 compiler do not understand -b yet
9840	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
9841	  _LT_LINKER_OPTION([if $CC understands -b],
9842	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
9843	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
9844	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
9845	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
9846	  ;;
9847	esac
9848      fi
9849      if test no = "$with_gnu_ld"; then
9850	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
9851	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
9852
9853	case $host_cpu in
9854	hppa*64*|ia64*)
9855	  _LT_TAGVAR(hardcode_direct, $1)=no
9856	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9857	  ;;
9858	*)
9859	  _LT_TAGVAR(hardcode_direct, $1)=yes
9860	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9861	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9862
9863	  # hardcode_minus_L: Not really in the search PATH,
9864	  # but as the default location of the library.
9865	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
9866	  ;;
9867	esac
9868      fi
9869      ;;
9870
9871    irix5* | irix6* | nonstopux*)
9872      if test yes = "$GCC"; then
9873	_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'
9874	# Try to use the -exported_symbol ld option, if it does not
9875	# work, assume that -exports_file does not work either and
9876	# implicitly export all symbols.
9877	# This should be the same for all languages, so no per-tag cache variable.
9878	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
9879	  [lt_cv_irix_exported_symbol],
9880	  [save_LDFLAGS=$LDFLAGS
9881	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
9882	   AC_LINK_IFELSE(
9883	     [AC_LANG_SOURCE(
9884	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
9885			      [C++], [[int foo (void) { return 0; }]],
9886			      [Fortran 77], [[
9887      subroutine foo
9888      end]],
9889			      [Fortran], [[
9890      subroutine foo
9891      end]])])],
9892	      [lt_cv_irix_exported_symbol=yes],
9893	      [lt_cv_irix_exported_symbol=no])
9894           LDFLAGS=$save_LDFLAGS])
9895	if test yes = "$lt_cv_irix_exported_symbol"; then
9896          _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'
9897	fi
9898      else
9899	_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'
9900	_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'
9901      fi
9902      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9903      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9904      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9905      _LT_TAGVAR(inherit_rpath, $1)=yes
9906      _LT_TAGVAR(link_all_deplibs, $1)=yes
9907      ;;
9908
9909    linux*)
9910      case $cc_basename in
9911      tcc*)
9912	# Fabrice Bellard et al's Tiny C Compiler
9913	_LT_TAGVAR(ld_shlibs, $1)=yes
9914	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9915	;;
9916      esac
9917      ;;
9918
9919    netbsd*)
9920      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9921	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
9922      else
9923	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
9924      fi
9925      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9926      _LT_TAGVAR(hardcode_direct, $1)=yes
9927      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9928      ;;
9929
9930    newsos6)
9931      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9932      _LT_TAGVAR(hardcode_direct, $1)=yes
9933      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9934      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
9935      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9936      ;;
9937
9938    *nto* | *qnx*)
9939      ;;
9940
9941    openbsd* | bitrig*)
9942      if test -f /usr/libexec/ld.so; then
9943	_LT_TAGVAR(hardcode_direct, $1)=yes
9944	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
9945	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
9946	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
9947	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9948	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
9949	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9950	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
9951	else
9952	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9953	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
9954	fi
9955      else
9956	_LT_TAGVAR(ld_shlibs, $1)=no
9957      fi
9958      ;;
9959
9960    os2*)
9961      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9962      _LT_TAGVAR(hardcode_minus_L, $1)=yes
9963      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
9964      shrext_cmds=.dll
9965      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9966	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9967	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9968	$ECHO EXPORTS >> $output_objdir/$libname.def~
9969	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9970	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9971	emximp -o $lib $output_objdir/$libname.def'
9972      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9973	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9974	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9975	$ECHO EXPORTS >> $output_objdir/$libname.def~
9976	prefix_cmds="$SED"~
9977	if test EXPORTS = "`$SED 1q $export_symbols`"; then
9978	  prefix_cmds="$prefix_cmds -e 1d";
9979	fi~
9980	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9981	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9982	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9983	emximp -o $lib $output_objdir/$libname.def'
9984      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9985      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
9986      _LT_TAGVAR(file_list_spec, $1)='@'
9987      ;;
9988
9989    osf3*)
9990      if test yes = "$GCC"; then
9991	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
9992	_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'
9993      else
9994	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9995	_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'
9996      fi
9997      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
9998      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
9999      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10000      ;;
10001
10002    osf4* | osf5*)	# as osf3* with the addition of -msym flag
10003      if test yes = "$GCC"; then
10004	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
10005	_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'
10006	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10007      else
10008	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10009	_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'
10010	_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~
10011          $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'
10012
10013	# Both c and cxx compiler support -rpath directly
10014	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10015      fi
10016      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
10017      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10018      ;;
10019
10020    solaris*)
10021      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
10022      if test yes = "$GCC"; then
10023	wlarc='$wl'
10024	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
10025	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10026          $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'
10027      else
10028	case `$CC -V 2>&1` in
10029	*"Compilers 5.0"*)
10030	  wlarc=''
10031	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
10032	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10033            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
10034	  ;;
10035	*)
10036	  wlarc='$wl'
10037	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
10038	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10039            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10040	  ;;
10041	esac
10042      fi
10043      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10044      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10045      case $host_os in
10046      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10047      *)
10048	# The compiler driver will combine and reorder linker options,
10049	# but understands '-z linker_flag'.  GCC discards it without '$wl',
10050	# but is careful enough not to reorder.
10051	# Supported since Solaris 2.6 (maybe 2.5.1?)
10052	if test yes = "$GCC"; then
10053	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
10054	else
10055	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
10056	fi
10057	;;
10058      esac
10059      _LT_TAGVAR(link_all_deplibs, $1)=yes
10060      ;;
10061
10062    sunos4*)
10063      if test sequent = "$host_vendor"; then
10064	# Use $CC to link under sequent, because it throws in some extra .o
10065	# files that make .init and .fini sections work.
10066	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10067      else
10068	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
10069      fi
10070      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10071      _LT_TAGVAR(hardcode_direct, $1)=yes
10072      _LT_TAGVAR(hardcode_minus_L, $1)=yes
10073      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10074      ;;
10075
10076    sysv4)
10077      case $host_vendor in
10078	sni)
10079	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10080	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
10081	;;
10082	siemens)
10083	  ## LD is ld it makes a PLAMLIB
10084	  ## CC just makes a GrossModule.
10085	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
10086	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
10087	  _LT_TAGVAR(hardcode_direct, $1)=no
10088        ;;
10089	motorola)
10090	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10091	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
10092	;;
10093      esac
10094      runpath_var='LD_RUN_PATH'
10095      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10096      ;;
10097
10098    sysv4.3*)
10099      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10100      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10101      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
10102      ;;
10103
10104    sysv4*MP*)
10105      if test -d /usr/nec; then
10106	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10107	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10108	runpath_var=LD_RUN_PATH
10109	hardcode_runpath_var=yes
10110	_LT_TAGVAR(ld_shlibs, $1)=yes
10111      fi
10112      ;;
10113
10114    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
10115      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10116      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10117      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10118      runpath_var='LD_RUN_PATH'
10119
10120      if test yes = "$GCC"; then
10121	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10122	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10123      else
10124	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10125	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10126      fi
10127      ;;
10128
10129    sysv5* | sco3.2v5* | sco5v6*)
10130      # Note: We CANNOT use -z defs as we might desire, because we do not
10131      # link with -lc, and that would cause any symbols used from libc to
10132      # always be unresolved, which means just about no library would
10133      # ever link correctly.  If we're not using GNU ld we use -z text
10134      # though, which does catch some bad symbols but isn't as heavy-handed
10135      # as -z defs.
10136      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
10137      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
10138      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10139      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10140      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
10141      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10142      _LT_TAGVAR(link_all_deplibs, $1)=yes
10143      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
10144      runpath_var='LD_RUN_PATH'
10145
10146      if test yes = "$GCC"; then
10147	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10148	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10149      else
10150	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10151	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10152      fi
10153      ;;
10154
10155    uts4*)
10156      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10157      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10158      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10159      ;;
10160
10161    *)
10162      _LT_TAGVAR(ld_shlibs, $1)=no
10163      ;;
10164    esac
10165
10166    if test sni = "$host_vendor"; then
10167      case $host in
10168      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10169	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
10170	;;
10171      esac
10172    fi
10173  fi
10174])
10175AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
10176test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
10177
10178_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
10179
10180_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
10181_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
10182_LT_DECL([], [extract_expsyms_cmds], [2],
10183    [The commands to extract the exported symbol list from a shared archive])
10184
10185#
10186# Do we need to explicitly link libc?
10187#
10188case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
10189x|xyes)
10190  # Assume -lc should be added
10191  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10192
10193  if test yes,yes = "$GCC,$enable_shared"; then
10194    case $_LT_TAGVAR(archive_cmds, $1) in
10195    *'~'*)
10196      # FIXME: we may have to deal with multi-command sequences.
10197      ;;
10198    '$CC '*)
10199      # Test whether the compiler implicitly links with -lc since on some
10200      # systems, -lgcc has to come before -lc. If gcc already passes -lc
10201      # to ld, don't add -lc before -lgcc.
10202      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
10203	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
10204	[$RM conftest*
10205	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10206
10207	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
10208	  soname=conftest
10209	  lib=conftest
10210	  libobjs=conftest.$ac_objext
10211	  deplibs=
10212	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
10213	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
10214	  compiler_flags=-v
10215	  linker_flags=-v
10216	  verstring=
10217	  output_objdir=.
10218	  libname=conftest
10219	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
10220	  _LT_TAGVAR(allow_undefined_flag, $1)=
10221	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
10222	  then
10223	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
10224	  else
10225	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10226	  fi
10227	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
10228	else
10229	  cat conftest.err 1>&5
10230	fi
10231	$RM conftest*
10232	])
10233      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
10234      ;;
10235    esac
10236  fi
10237  ;;
10238esac
10239
10240_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
10241    [Whether or not to add -lc for building shared libraries])
10242_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
10243    [enable_shared_with_static_runtimes], [0],
10244    [Whether or not to disallow shared libs when runtime libs are static])
10245_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
10246    [Compiler flag to allow reflexive dlopens])
10247_LT_TAGDECL([], [whole_archive_flag_spec], [1],
10248    [Compiler flag to generate shared objects directly from archives])
10249_LT_TAGDECL([], [compiler_needs_object], [1],
10250    [Whether the compiler copes with passing no objects directly])
10251_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
10252    [Create an old-style archive from a shared archive])
10253_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
10254    [Create a temporary old-style archive to link instead of a shared archive])
10255_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
10256_LT_TAGDECL([], [archive_expsym_cmds], [2])
10257_LT_TAGDECL([], [module_cmds], [2],
10258    [Commands used to build a loadable module if different from building
10259    a shared archive.])
10260_LT_TAGDECL([], [module_expsym_cmds], [2])
10261_LT_TAGDECL([], [with_gnu_ld], [1],
10262    [Whether we are building with GNU ld or not])
10263_LT_TAGDECL([], [allow_undefined_flag], [1],
10264    [Flag that allows shared libraries with undefined symbols to be built])
10265_LT_TAGDECL([], [no_undefined_flag], [1],
10266    [Flag that enforces no undefined symbols])
10267_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
10268    [Flag to hardcode $libdir into a binary during linking.
10269    This must work even if $libdir does not exist])
10270_LT_TAGDECL([], [hardcode_libdir_separator], [1],
10271    [Whether we need a single "-rpath" flag with a separated argument])
10272_LT_TAGDECL([], [hardcode_direct], [0],
10273    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
10274    DIR into the resulting binary])
10275_LT_TAGDECL([], [hardcode_direct_absolute], [0],
10276    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
10277    DIR into the resulting binary and the resulting library dependency is
10278    "absolute", i.e impossible to change by setting $shlibpath_var if the
10279    library is relocated])
10280_LT_TAGDECL([], [hardcode_minus_L], [0],
10281    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
10282    into the resulting binary])
10283_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
10284    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
10285    into the resulting binary])
10286_LT_TAGDECL([], [hardcode_automatic], [0],
10287    [Set to "yes" if building a shared library automatically hardcodes DIR
10288    into the library and all subsequent libraries and executables linked
10289    against it])
10290_LT_TAGDECL([], [inherit_rpath], [0],
10291    [Set to yes if linker adds runtime paths of dependent libraries
10292    to runtime path list])
10293_LT_TAGDECL([], [link_all_deplibs], [0],
10294    [Whether libtool must link a program against all its dependency libraries])
10295_LT_TAGDECL([], [always_export_symbols], [0],
10296    [Set to "yes" if exported symbols are required])
10297_LT_TAGDECL([], [export_symbols_cmds], [2],
10298    [The commands to list exported symbols])
10299_LT_TAGDECL([], [exclude_expsyms], [1],
10300    [Symbols that should not be listed in the preloaded symbols])
10301_LT_TAGDECL([], [include_expsyms], [1],
10302    [Symbols that must always be exported])
10303_LT_TAGDECL([], [prelink_cmds], [2],
10304    [Commands necessary for linking programs (against libraries) with templates])
10305_LT_TAGDECL([], [postlink_cmds], [2],
10306    [Commands necessary for finishing linking programs])
10307_LT_TAGDECL([], [file_list_spec], [1],
10308    [Specify filename containing input files])
10309dnl FIXME: Not yet implemented
10310dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
10311dnl    [Compiler flag to generate thread safe objects])
10312])# _LT_LINKER_SHLIBS
10313
10314
10315# _LT_LANG_C_CONFIG([TAG])
10316# ------------------------
10317# Ensure that the configuration variables for a C compiler are suitably
10318# defined.  These variables are subsequently used by _LT_CONFIG to write
10319# the compiler configuration to 'libtool'.
10320m4_defun([_LT_LANG_C_CONFIG],
10321[m4_require([_LT_DECL_EGREP])dnl
10322lt_save_CC=$CC
10323AC_LANG_PUSH(C)
10324
10325# Source file extension for C test sources.
10326ac_ext=c
10327
10328# Object file extension for compiled C test sources.
10329objext=o
10330_LT_TAGVAR(objext, $1)=$objext
10331
10332# Code to be used in simple compile tests
10333lt_simple_compile_test_code="int some_variable = 0;"
10334
10335# Code to be used in simple link tests
10336lt_simple_link_test_code='int main(){return(0);}'
10337
10338_LT_TAG_COMPILER
10339# Save the default compiler, since it gets overwritten when the other
10340# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
10341compiler_DEFAULT=$CC
10342
10343# save warnings/boilerplate of simple test code
10344_LT_COMPILER_BOILERPLATE
10345_LT_LINKER_BOILERPLATE
10346
10347if test -n "$compiler"; then
10348  _LT_COMPILER_NO_RTTI($1)
10349  _LT_COMPILER_PIC($1)
10350  _LT_COMPILER_C_O($1)
10351  _LT_COMPILER_FILE_LOCKS($1)
10352  _LT_LINKER_SHLIBS($1)
10353  _LT_SYS_DYNAMIC_LINKER($1)
10354  _LT_LINKER_HARDCODE_LIBPATH($1)
10355  LT_SYS_DLOPEN_SELF
10356  _LT_CMD_STRIPLIB
10357
10358  # Report what library types will actually be built
10359  AC_MSG_CHECKING([if libtool supports shared libraries])
10360  AC_MSG_RESULT([$can_build_shared])
10361
10362  AC_MSG_CHECKING([whether to build shared libraries])
10363  test no = "$can_build_shared" && enable_shared=no
10364
10365  # On AIX, shared libraries and static libraries use the same namespace, and
10366  # are all built from PIC.
10367  case $host_os in
10368  aix3*)
10369    test yes = "$enable_shared" && enable_static=no
10370    if test -n "$RANLIB"; then
10371      archive_cmds="$archive_cmds~\$RANLIB \$lib"
10372      postinstall_cmds='$RANLIB $lib'
10373    fi
10374    ;;
10375
10376  aix[[4-9]]*)
10377    if test ia64 != "$host_cpu"; then
10378      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
10379      yes,aix,yes) ;;			# shared object as lib.so file only
10380      yes,svr4,*) ;;			# shared object as lib.so archive member only
10381      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
10382      esac
10383    fi
10384    ;;
10385  esac
10386  AC_MSG_RESULT([$enable_shared])
10387
10388  AC_MSG_CHECKING([whether to build static libraries])
10389  # Make sure either enable_shared or enable_static is yes.
10390  test yes = "$enable_shared" || enable_static=yes
10391  AC_MSG_RESULT([$enable_static])
10392
10393  _LT_CONFIG($1)
10394fi
10395AC_LANG_POP
10396CC=$lt_save_CC
10397])# _LT_LANG_C_CONFIG
10398
10399
10400# _LT_LANG_CXX_CONFIG([TAG])
10401# --------------------------
10402# Ensure that the configuration variables for a C++ compiler are suitably
10403# defined.  These variables are subsequently used by _LT_CONFIG to write
10404# the compiler configuration to 'libtool'.
10405m4_defun([_LT_LANG_CXX_CONFIG],
10406[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
10407m4_require([_LT_DECL_EGREP])dnl
10408m4_require([_LT_PATH_MANIFEST_TOOL])dnl
10409if test -n "$CXX" && ( test no != "$CXX" &&
10410    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
10411    (test g++ != "$CXX"))); then
10412  AC_PROG_CXXCPP
10413else
10414  _lt_caught_CXX_error=yes
10415fi
10416
10417AC_LANG_PUSH(C++)
10418_LT_TAGVAR(archive_cmds_need_lc, $1)=no
10419_LT_TAGVAR(allow_undefined_flag, $1)=
10420_LT_TAGVAR(always_export_symbols, $1)=no
10421_LT_TAGVAR(archive_expsym_cmds, $1)=
10422_LT_TAGVAR(compiler_needs_object, $1)=no
10423_LT_TAGVAR(export_dynamic_flag_spec, $1)=
10424_LT_TAGVAR(hardcode_direct, $1)=no
10425_LT_TAGVAR(hardcode_direct_absolute, $1)=no
10426_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
10427_LT_TAGVAR(hardcode_libdir_separator, $1)=
10428_LT_TAGVAR(hardcode_minus_L, $1)=no
10429_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
10430_LT_TAGVAR(hardcode_automatic, $1)=no
10431_LT_TAGVAR(inherit_rpath, $1)=no
10432_LT_TAGVAR(module_cmds, $1)=
10433_LT_TAGVAR(module_expsym_cmds, $1)=
10434_LT_TAGVAR(link_all_deplibs, $1)=unknown
10435_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
10436_LT_TAGVAR(reload_flag, $1)=$reload_flag
10437_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
10438_LT_TAGVAR(no_undefined_flag, $1)=
10439_LT_TAGVAR(whole_archive_flag_spec, $1)=
10440_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
10441
10442# Source file extension for C++ test sources.
10443ac_ext=cpp
10444
10445# Object file extension for compiled C++ test sources.
10446objext=o
10447_LT_TAGVAR(objext, $1)=$objext
10448
10449# No sense in running all these tests if we already determined that
10450# the CXX compiler isn't working.  Some variables (like enable_shared)
10451# are currently assumed to apply to all compilers on this platform,
10452# and will be corrupted by setting them based on a non-working compiler.
10453if test yes != "$_lt_caught_CXX_error"; then
10454  # Code to be used in simple compile tests
10455  lt_simple_compile_test_code="int some_variable = 0;"
10456
10457  # Code to be used in simple link tests
10458  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
10459
10460  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
10461  _LT_TAG_COMPILER
10462
10463  # save warnings/boilerplate of simple test code
10464  _LT_COMPILER_BOILERPLATE
10465  _LT_LINKER_BOILERPLATE
10466
10467  # Allow CC to be a program name with arguments.
10468  lt_save_CC=$CC
10469  lt_save_CFLAGS=$CFLAGS
10470  lt_save_LD=$LD
10471  lt_save_GCC=$GCC
10472  GCC=$GXX
10473  lt_save_with_gnu_ld=$with_gnu_ld
10474  lt_save_path_LD=$lt_cv_path_LD
10475  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
10476    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
10477  else
10478    $as_unset lt_cv_prog_gnu_ld
10479  fi
10480  if test -n "${lt_cv_path_LDCXX+set}"; then
10481    lt_cv_path_LD=$lt_cv_path_LDCXX
10482  else
10483    $as_unset lt_cv_path_LD
10484  fi
10485  test -z "${LDCXX+set}" || LD=$LDCXX
10486  CC=${CXX-"c++"}
10487  CFLAGS=$CXXFLAGS
10488  compiler=$CC
10489  _LT_TAGVAR(compiler, $1)=$CC
10490  _LT_CC_BASENAME([$compiler])
10491
10492  if test -n "$compiler"; then
10493    # We don't want -fno-exception when compiling C++ code, so set the
10494    # no_builtin_flag separately
10495    if test yes = "$GXX"; then
10496      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
10497    else
10498      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
10499    fi
10500
10501    if test yes = "$GXX"; then
10502      # Set up default GNU C++ configuration
10503
10504      LT_PATH_LD
10505
10506      # Check if GNU C++ uses GNU ld as the underlying linker, since the
10507      # archiving commands below assume that GNU ld is being used.
10508      if test yes = "$with_gnu_ld"; then
10509        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
10510        _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'
10511
10512        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
10513        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
10514
10515        # If archive_cmds runs LD, not CC, wlarc should be empty
10516        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
10517        #     investigate it a little bit more. (MM)
10518        wlarc='$wl'
10519
10520        # ancient GNU ld didn't support --whole-archive et. al.
10521        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
10522	  $GREP 'no-whole-archive' > /dev/null; then
10523          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
10524        else
10525          _LT_TAGVAR(whole_archive_flag_spec, $1)=
10526        fi
10527      else
10528        with_gnu_ld=no
10529        wlarc=
10530
10531        # A generic and very simple default shared library creation
10532        # command for GNU C++ for the case where it uses the native
10533        # linker, instead of GNU ld.  If possible, this setting should
10534        # overridden to take advantage of the native linker features on
10535        # the platform it is being used on.
10536        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
10537      fi
10538
10539      # Commands to make compiler produce verbose output that lists
10540      # what "hidden" libraries, object files and flags are used when
10541      # linking a shared library.
10542      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
10543
10544    else
10545      GXX=no
10546      with_gnu_ld=no
10547      wlarc=
10548    fi
10549
10550    # PORTME: fill in a description of your system's C++ link characteristics
10551    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
10552    _LT_TAGVAR(ld_shlibs, $1)=yes
10553    case $host_os in
10554      aix3*)
10555        # FIXME: insert proper C++ library support
10556        _LT_TAGVAR(ld_shlibs, $1)=no
10557        ;;
10558      aix[[4-9]]*)
10559        if test ia64 = "$host_cpu"; then
10560          # On IA64, the linker does run time linking by default, so we don't
10561          # have to do anything special.
10562          aix_use_runtimelinking=no
10563          exp_sym_flag='-Bexport'
10564          no_entry_flag=
10565        else
10566          aix_use_runtimelinking=no
10567
10568          # Test if we are trying to use run time linking or normal
10569          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
10570          # have runtime linking enabled, and use it for executables.
10571          # For shared libraries, we enable/disable runtime linking
10572          # depending on the kind of the shared library created -
10573          # when "with_aix_soname,aix_use_runtimelinking" is:
10574          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
10575          # "aix,yes"  lib.so          shared, rtl:yes, for executables
10576          #            lib.a           static archive
10577          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
10578          #            lib.a(lib.so.V) shared, rtl:no,  for executables
10579          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
10580          #            lib.a(lib.so.V) shared, rtl:no
10581          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
10582          #            lib.a           static archive
10583          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
10584	    for ld_flag in $LDFLAGS; do
10585	      case $ld_flag in
10586	      *-brtl*)
10587	        aix_use_runtimelinking=yes
10588	        break
10589	        ;;
10590	      esac
10591	    done
10592	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
10593	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
10594	      # so we don't have lib.a shared libs to link our executables.
10595	      # We have to force runtime linking in this case.
10596	      aix_use_runtimelinking=yes
10597	      LDFLAGS="$LDFLAGS -Wl,-brtl"
10598	    fi
10599	    ;;
10600          esac
10601
10602          exp_sym_flag='-bexport'
10603          no_entry_flag='-bnoentry'
10604        fi
10605
10606        # When large executables or shared objects are built, AIX ld can
10607        # have problems creating the table of contents.  If linking a library
10608        # or program results in "error TOC overflow" add -mminimal-toc to
10609        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
10610        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
10611
10612        _LT_TAGVAR(archive_cmds, $1)=''
10613        _LT_TAGVAR(hardcode_direct, $1)=yes
10614        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10615        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
10616        _LT_TAGVAR(link_all_deplibs, $1)=yes
10617        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
10618        case $with_aix_soname,$aix_use_runtimelinking in
10619        aix,*) ;;	# no import file
10620        svr4,* | *,yes) # use import file
10621          # The Import File defines what to hardcode.
10622          _LT_TAGVAR(hardcode_direct, $1)=no
10623          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
10624          ;;
10625        esac
10626
10627        if test yes = "$GXX"; then
10628          case $host_os in aix4.[[012]]|aix4.[[012]].*)
10629          # We only want to do this on AIX 4.2 and lower, the check
10630          # below for broken collect2 doesn't work under 4.3+
10631	  collect2name=`$CC -print-prog-name=collect2`
10632	  if test -f "$collect2name" &&
10633	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
10634	  then
10635	    # We have reworked collect2
10636	    :
10637	  else
10638	    # We have old collect2
10639	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
10640	    # It fails to find uninstalled libraries when the uninstalled
10641	    # path is not listed in the libpath.  Setting hardcode_minus_L
10642	    # to unsupported forces relinking
10643	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
10644	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10645	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
10646	  fi
10647          esac
10648          shared_flag='-shared'
10649	  if test yes = "$aix_use_runtimelinking"; then
10650	    shared_flag=$shared_flag' $wl-G'
10651	  fi
10652	  # Need to ensure runtime linking is disabled for the traditional
10653	  # shared library, or the linker may eventually find shared libraries
10654	  # /with/ Import File - we do not want to mix them.
10655	  shared_flag_aix='-shared'
10656	  shared_flag_svr4='-shared $wl-G'
10657        else
10658          # not using gcc
10659          if test ia64 = "$host_cpu"; then
10660	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
10661	  # chokes on -Wl,-G. The following line is correct:
10662	  shared_flag='-G'
10663          else
10664	    if test yes = "$aix_use_runtimelinking"; then
10665	      shared_flag='$wl-G'
10666	    else
10667	      shared_flag='$wl-bM:SRE'
10668	    fi
10669	    shared_flag_aix='$wl-bM:SRE'
10670	    shared_flag_svr4='$wl-G'
10671          fi
10672        fi
10673
10674        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
10675        # It seems that -bexpall does not export symbols beginning with
10676        # underscore (_), so it is better to generate a list of symbols to
10677	# export.
10678        _LT_TAGVAR(always_export_symbols, $1)=yes
10679	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
10680          # Warning - without using the other runtime loading flags (-brtl),
10681          # -berok will link without error, but may produce a broken library.
10682          # The "-G" linker flag allows undefined symbols.
10683          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
10684          # Determine the default libpath from the value encoded in an empty
10685          # executable.
10686          _LT_SYS_MODULE_PATH_AIX([$1])
10687          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
10688
10689          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
10690        else
10691          if test ia64 = "$host_cpu"; then
10692	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
10693	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
10694	    _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"
10695          else
10696	    # Determine the default libpath from the value encoded in an
10697	    # empty executable.
10698	    _LT_SYS_MODULE_PATH_AIX([$1])
10699	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
10700	    # Warning - without using the other run time loading flags,
10701	    # -berok will link without error, but may produce a broken library.
10702	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
10703	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
10704	    if test yes = "$with_gnu_ld"; then
10705	      # We only use this code for GNU lds that support --whole-archive.
10706	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
10707	    else
10708	      # Exported symbols can be pulled into shared objects from archives
10709	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
10710	    fi
10711	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
10712	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
10713	    # -brtl affects multiple linker settings, -berok does not and is overridden later
10714	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
10715	    if test svr4 != "$with_aix_soname"; then
10716	      # This is similar to how AIX traditionally builds its shared
10717	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
10718	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
10719	    fi
10720	    if test aix != "$with_aix_soname"; then
10721	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
10722	    else
10723	      # used by -dlpreopen to get the symbols
10724	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
10725	    fi
10726	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
10727          fi
10728        fi
10729        ;;
10730
10731      beos*)
10732	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
10733	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10734	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
10735	  # support --undefined.  This deserves some investigation.  FIXME
10736	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10737	else
10738	  _LT_TAGVAR(ld_shlibs, $1)=no
10739	fi
10740	;;
10741
10742      chorus*)
10743        case $cc_basename in
10744          *)
10745	  # FIXME: insert proper C++ library support
10746	  _LT_TAGVAR(ld_shlibs, $1)=no
10747	  ;;
10748        esac
10749        ;;
10750
10751      cygwin* | mingw* | pw32* | cegcc*)
10752	case $GXX,$cc_basename in
10753	,cl* | no,cl* | ,icl* | no,icl*)
10754	  # Native MSVC or ICC
10755	  # hardcode_libdir_flag_spec is actually meaningless, as there is
10756	  # no search path for DLLs.
10757	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
10758	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10759	  _LT_TAGVAR(always_export_symbols, $1)=yes
10760	  _LT_TAGVAR(file_list_spec, $1)='@'
10761	  # Tell ltmain to make .lib files, not .a files.
10762	  libext=lib
10763	  # Tell ltmain to make .dll files, not .so files.
10764	  shrext_cmds=.dll
10765	  # FIXME: Setting linknames here is a bad hack.
10766	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
10767	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10768              cp "$export_symbols" "$output_objdir/$soname.def";
10769              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
10770            else
10771              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
10772            fi~
10773            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
10774            linknames='
10775	  # The linker will not automatically build a static lib if we build a DLL.
10776	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
10777	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10778	  # Don't use ranlib
10779	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
10780	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
10781            lt_tool_outputfile="@TOOL_OUTPUT@"~
10782            case $lt_outputfile in
10783              *.exe|*.EXE) ;;
10784              *)
10785                lt_outputfile=$lt_outputfile.exe
10786                lt_tool_outputfile=$lt_tool_outputfile.exe
10787                ;;
10788            esac~
10789            func_to_tool_file "$lt_outputfile"~
10790            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
10791              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
10792              $RM "$lt_outputfile.manifest";
10793            fi'
10794	  ;;
10795	*)
10796	  # g++
10797	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
10798	  # as there is no search path for DLLs.
10799	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10800	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
10801	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10802	  _LT_TAGVAR(always_export_symbols, $1)=no
10803	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10804
10805	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
10806	    _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'
10807	    # If the export-symbols file already is a .def file, use it as
10808	    # is; otherwise, prepend EXPORTS...
10809	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
10810              cp $export_symbols $output_objdir/$soname.def;
10811            else
10812              echo EXPORTS > $output_objdir/$soname.def;
10813              cat $export_symbols >> $output_objdir/$soname.def;
10814            fi~
10815            $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'
10816	  else
10817	    _LT_TAGVAR(ld_shlibs, $1)=no
10818	  fi
10819	  ;;
10820	esac
10821	;;
10822      darwin* | rhapsody*)
10823        _LT_DARWIN_LINKER_FEATURES($1)
10824	;;
10825
10826      os2*)
10827	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10828	_LT_TAGVAR(hardcode_minus_L, $1)=yes
10829	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
10830	shrext_cmds=.dll
10831	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10832	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10833	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10834	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10835	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
10836	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10837	  emximp -o $lib $output_objdir/$libname.def'
10838	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10839	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10840	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10841	  $ECHO EXPORTS >> $output_objdir/$libname.def~
10842	  prefix_cmds="$SED"~
10843	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
10844	    prefix_cmds="$prefix_cmds -e 1d";
10845	  fi~
10846	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
10847	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
10848	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10849	  emximp -o $lib $output_objdir/$libname.def'
10850	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
10851	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10852	_LT_TAGVAR(file_list_spec, $1)='@'
10853	;;
10854
10855      dgux*)
10856        case $cc_basename in
10857          ec++*)
10858	    # FIXME: insert proper C++ library support
10859	    _LT_TAGVAR(ld_shlibs, $1)=no
10860	    ;;
10861          ghcx*)
10862	    # Green Hills C++ Compiler
10863	    # FIXME: insert proper C++ library support
10864	    _LT_TAGVAR(ld_shlibs, $1)=no
10865	    ;;
10866          *)
10867	    # FIXME: insert proper C++ library support
10868	    _LT_TAGVAR(ld_shlibs, $1)=no
10869	    ;;
10870        esac
10871        ;;
10872
10873      freebsd2.*)
10874        # C++ shared libraries reported to be fairly broken before
10875	# switch to ELF
10876        _LT_TAGVAR(ld_shlibs, $1)=no
10877        ;;
10878
10879      freebsd-elf*)
10880        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
10881        ;;
10882
10883      freebsd* | dragonfly* | midnightbsd*)
10884        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
10885        # conventions
10886        _LT_TAGVAR(ld_shlibs, $1)=yes
10887        ;;
10888
10889      haiku*)
10890        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
10891        _LT_TAGVAR(link_all_deplibs, $1)=yes
10892        ;;
10893
10894      hpux9*)
10895        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10896        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10897        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10898        _LT_TAGVAR(hardcode_direct, $1)=yes
10899        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10900				             # but as the default
10901				             # location of the library.
10902
10903        case $cc_basename in
10904          CC*)
10905            # FIXME: insert proper C++ library support
10906            _LT_TAGVAR(ld_shlibs, $1)=no
10907            ;;
10908          aCC*)
10909            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
10910            # Commands to make compiler produce verbose output that lists
10911            # what "hidden" libraries, object files and flags are used when
10912            # linking a shared library.
10913            #
10914            # There doesn't appear to be a way to prevent this compiler from
10915            # explicitly linking system object files so we need to strip them
10916            # from the output so that they don't get included in the library
10917            # dependencies.
10918            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"'
10919            ;;
10920          *)
10921            if test yes = "$GXX"; then
10922              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
10923            else
10924              # FIXME: insert proper C++ library support
10925              _LT_TAGVAR(ld_shlibs, $1)=no
10926            fi
10927            ;;
10928        esac
10929        ;;
10930
10931      hpux10*|hpux11*)
10932        if test no = "$with_gnu_ld"; then
10933	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
10934	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
10935
10936          case $host_cpu in
10937            hppa*64*|ia64*)
10938              ;;
10939            *)
10940	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
10941              ;;
10942          esac
10943        fi
10944        case $host_cpu in
10945          hppa*64*|ia64*)
10946            _LT_TAGVAR(hardcode_direct, $1)=no
10947            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
10948            ;;
10949          *)
10950            _LT_TAGVAR(hardcode_direct, $1)=yes
10951            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
10952            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
10953					         # but as the default
10954					         # location of the library.
10955            ;;
10956        esac
10957
10958        case $cc_basename in
10959          CC*)
10960	    # FIXME: insert proper C++ library support
10961	    _LT_TAGVAR(ld_shlibs, $1)=no
10962	    ;;
10963          aCC*)
10964	    case $host_cpu in
10965	      hppa*64*)
10966	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10967	        ;;
10968	      ia64*)
10969	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10970	        ;;
10971	      *)
10972	        _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'
10973	        ;;
10974	    esac
10975	    # Commands to make compiler produce verbose output that lists
10976	    # what "hidden" libraries, object files and flags are used when
10977	    # linking a shared library.
10978	    #
10979	    # There doesn't appear to be a way to prevent this compiler from
10980	    # explicitly linking system object files so we need to strip them
10981	    # from the output so that they don't get included in the library
10982	    # dependencies.
10983	    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"'
10984	    ;;
10985          *)
10986	    if test yes = "$GXX"; then
10987	      if test no = "$with_gnu_ld"; then
10988	        case $host_cpu in
10989	          hppa*64*)
10990	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
10991	            ;;
10992	          ia64*)
10993	            _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'
10994	            ;;
10995	          *)
10996	            _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'
10997	            ;;
10998	        esac
10999	      fi
11000	    else
11001	      # FIXME: insert proper C++ library support
11002	      _LT_TAGVAR(ld_shlibs, $1)=no
11003	    fi
11004	    ;;
11005        esac
11006        ;;
11007
11008      interix[[3-9]]*)
11009	_LT_TAGVAR(hardcode_direct, $1)=no
11010	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11011	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
11012	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
11013	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
11014	# Instead, shared libraries are loaded at an image base (0x10000000 by
11015	# default) and relocated if they conflict, which is a slow very memory
11016	# consuming and fragmenting process.  To avoid this, we pick a random,
11017	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
11018	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
11019	_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'
11020	_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'
11021	;;
11022      irix5* | irix6*)
11023        case $cc_basename in
11024          CC*)
11025	    # SGI C++
11026	    _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'
11027
11028	    # Archives containing C++ object files must be created using
11029	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
11030	    # necessary to make sure instantiated templates are included
11031	    # in the archive.
11032	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
11033	    ;;
11034          *)
11035	    if test yes = "$GXX"; then
11036	      if test no = "$with_gnu_ld"; then
11037	        _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'
11038	      else
11039	        _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'
11040	      fi
11041	    fi
11042	    _LT_TAGVAR(link_all_deplibs, $1)=yes
11043	    ;;
11044        esac
11045        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
11046        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11047        _LT_TAGVAR(inherit_rpath, $1)=yes
11048        ;;
11049
11050      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
11051        case $cc_basename in
11052          KCC*)
11053	    # Kuck and Associates, Inc. (KAI) C++ Compiler
11054
11055	    # KCC will only create a shared library if the output file
11056	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
11057	    # to its proper name (with version) after linking.
11058	    _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'
11059	    _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'
11060	    # Commands to make compiler produce verbose output that lists
11061	    # what "hidden" libraries, object files and flags are used when
11062	    # linking a shared library.
11063	    #
11064	    # There doesn't appear to be a way to prevent this compiler from
11065	    # explicitly linking system object files so we need to strip them
11066	    # from the output so that they don't get included in the library
11067	    # dependencies.
11068	    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"'
11069
11070	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
11071	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
11072
11073	    # Archives containing C++ object files must be created using
11074	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
11075	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
11076	    ;;
11077	  icpc* | ecpc* )
11078	    # Intel C++
11079	    with_gnu_ld=yes
11080	    # version 8.0 and above of icpc choke on multiply defined symbols
11081	    # if we add $predep_objects and $postdep_objects, however 7.1 and
11082	    # earlier do not add the objects themselves.
11083	    case `$CC -V 2>&1` in
11084	      *"Version 7."*)
11085	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
11086		_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'
11087		;;
11088	      *)  # Version 8.0 or newer
11089	        tmp_idyn=
11090	        case $host_cpu in
11091		  ia64*) tmp_idyn=' -i_dynamic';;
11092		esac
11093	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
11094		_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'
11095		;;
11096	    esac
11097	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11098	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
11099	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
11100	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
11101	    ;;
11102          pgCC* | pgcpp*)
11103            # Portland Group C++ compiler
11104	    case `$CC -V` in
11105	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
11106	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
11107               rm -rf $tpldir~
11108               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
11109               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
11110	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
11111                rm -rf $tpldir~
11112                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
11113                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
11114                $RANLIB $oldlib'
11115	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
11116                rm -rf $tpldir~
11117                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
11118                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
11119	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
11120                rm -rf $tpldir~
11121                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
11122                $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'
11123	      ;;
11124	    *) # Version 6 and above use weak symbols
11125	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
11126	      _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'
11127	      ;;
11128	    esac
11129
11130	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
11131	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
11132	    _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'
11133            ;;
11134	  cxx*)
11135	    # Compaq C++
11136	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
11137	    _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'
11138
11139	    runpath_var=LD_RUN_PATH
11140	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
11141	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11142
11143	    # Commands to make compiler produce verbose output that lists
11144	    # what "hidden" libraries, object files and flags are used when
11145	    # linking a shared library.
11146	    #
11147	    # There doesn't appear to be a way to prevent this compiler from
11148	    # explicitly linking system object files so we need to strip them
11149	    # from the output so that they don't get included in the library
11150	    # dependencies.
11151	    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'
11152	    ;;
11153	  xl* | mpixl* | bgxl*)
11154	    # IBM XL 8.0 on PPC, with GNU ld
11155	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
11156	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
11157	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
11158	    if test yes = "$supports_anon_versioning"; then
11159	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
11160                cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
11161                echo "local: *; };" >> $output_objdir/$libname.ver~
11162                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
11163	    fi
11164	    ;;
11165	  *)
11166	    case `$CC -V 2>&1 | $SED 5q` in
11167	    *Sun\ C*)
11168	      # Sun C++ 5.9
11169	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
11170	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
11171	      _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'
11172	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11173	      _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'
11174	      _LT_TAGVAR(compiler_needs_object, $1)=yes
11175
11176	      # Not sure whether something based on
11177	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
11178	      # would be better.
11179	      output_verbose_link_cmd='func_echo_all'
11180
11181	      # Archives containing C++ object files must be created using
11182	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
11183	      # necessary to make sure instantiated templates are included
11184	      # in the archive.
11185	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
11186	      ;;
11187	    esac
11188	    ;;
11189	esac
11190	;;
11191
11192      lynxos*)
11193        # FIXME: insert proper C++ library support
11194	_LT_TAGVAR(ld_shlibs, $1)=no
11195	;;
11196
11197      m88k*)
11198        # FIXME: insert proper C++ library support
11199        _LT_TAGVAR(ld_shlibs, $1)=no
11200	;;
11201
11202      mvs*)
11203        case $cc_basename in
11204          cxx*)
11205	    # FIXME: insert proper C++ library support
11206	    _LT_TAGVAR(ld_shlibs, $1)=no
11207	    ;;
11208	  *)
11209	    # FIXME: insert proper C++ library support
11210	    _LT_TAGVAR(ld_shlibs, $1)=no
11211	    ;;
11212	esac
11213	;;
11214
11215      netbsd*)
11216        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
11217	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
11218	  wlarc=
11219	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11220	  _LT_TAGVAR(hardcode_direct, $1)=yes
11221	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11222	fi
11223	# Workaround some broken pre-1.5 toolchains
11224	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
11225	;;
11226
11227      *nto* | *qnx*)
11228        _LT_TAGVAR(ld_shlibs, $1)=yes
11229	;;
11230
11231      openbsd* | bitrig*)
11232	if test -f /usr/libexec/ld.so; then
11233	  _LT_TAGVAR(hardcode_direct, $1)=yes
11234	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11235	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
11236	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
11237	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
11238	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
11239	    _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'
11240	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
11241	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
11242	  fi
11243	  output_verbose_link_cmd=func_echo_all
11244	else
11245	  _LT_TAGVAR(ld_shlibs, $1)=no
11246	fi
11247	;;
11248
11249      osf3* | osf4* | osf5*)
11250        case $cc_basename in
11251          KCC*)
11252	    # Kuck and Associates, Inc. (KAI) C++ Compiler
11253
11254	    # KCC will only create a shared library if the output file
11255	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
11256	    # to its proper name (with version) after linking.
11257	    _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'
11258
11259	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
11260	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11261
11262	    # Archives containing C++ object files must be created using
11263	    # the KAI C++ compiler.
11264	    case $host in
11265	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
11266	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
11267	    esac
11268	    ;;
11269          RCC*)
11270	    # Rational C++ 2.4.1
11271	    # FIXME: insert proper C++ library support
11272	    _LT_TAGVAR(ld_shlibs, $1)=no
11273	    ;;
11274          cxx*)
11275	    case $host in
11276	      osf3*)
11277	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
11278	        _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'
11279	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
11280		;;
11281	      *)
11282	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
11283	        _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'
11284	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
11285                  echo "-hidden">> $lib.exp~
11286                  $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~
11287                  $RM $lib.exp'
11288	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
11289		;;
11290	    esac
11291
11292	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11293
11294	    # Commands to make compiler produce verbose output that lists
11295	    # what "hidden" libraries, object files and flags are used when
11296	    # linking a shared library.
11297	    #
11298	    # There doesn't appear to be a way to prevent this compiler from
11299	    # explicitly linking system object files so we need to strip them
11300	    # from the output so that they don't get included in the library
11301	    # dependencies.
11302	    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"'
11303	    ;;
11304	  *)
11305	    if test yes,no = "$GXX,$with_gnu_ld"; then
11306	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
11307	      case $host in
11308	        osf3*)
11309	          _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'
11310		  ;;
11311	        *)
11312	          _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'
11313		  ;;
11314	      esac
11315
11316	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
11317	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
11318
11319	      # Commands to make compiler produce verbose output that lists
11320	      # what "hidden" libraries, object files and flags are used when
11321	      # linking a shared library.
11322	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
11323
11324	    else
11325	      # FIXME: insert proper C++ library support
11326	      _LT_TAGVAR(ld_shlibs, $1)=no
11327	    fi
11328	    ;;
11329        esac
11330        ;;
11331
11332      psos*)
11333        # FIXME: insert proper C++ library support
11334        _LT_TAGVAR(ld_shlibs, $1)=no
11335        ;;
11336
11337      sunos4*)
11338        case $cc_basename in
11339          CC*)
11340	    # Sun C++ 4.x
11341	    # FIXME: insert proper C++ library support
11342	    _LT_TAGVAR(ld_shlibs, $1)=no
11343	    ;;
11344          lcc*)
11345	    # Lucid
11346	    # FIXME: insert proper C++ library support
11347	    _LT_TAGVAR(ld_shlibs, $1)=no
11348	    ;;
11349          *)
11350	    # FIXME: insert proper C++ library support
11351	    _LT_TAGVAR(ld_shlibs, $1)=no
11352	    ;;
11353        esac
11354        ;;
11355
11356      solaris*)
11357        case $cc_basename in
11358          CC* | sunCC*)
11359	    # Sun C++ 4.2, 5.x and Centerline C++
11360            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
11361	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
11362	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
11363	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11364              $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'
11365
11366	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11367	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11368	    case $host_os in
11369	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
11370	      *)
11371		# The compiler driver will combine and reorder linker options,
11372		# but understands '-z linker_flag'.
11373	        # Supported since Solaris 2.6 (maybe 2.5.1?)
11374		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
11375	        ;;
11376	    esac
11377	    _LT_TAGVAR(link_all_deplibs, $1)=yes
11378
11379	    output_verbose_link_cmd='func_echo_all'
11380
11381	    # Archives containing C++ object files must be created using
11382	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
11383	    # necessary to make sure instantiated templates are included
11384	    # in the archive.
11385	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
11386	    ;;
11387          gcx*)
11388	    # Green Hills C++ Compiler
11389	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
11390
11391	    # The C++ compiler must be used to create the archive.
11392	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
11393	    ;;
11394          *)
11395	    # GNU C++ compiler with Solaris linker
11396	    if test yes,no = "$GXX,$with_gnu_ld"; then
11397	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
11398	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
11399	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
11400	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11401                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
11402
11403	        # Commands to make compiler produce verbose output that lists
11404	        # what "hidden" libraries, object files and flags are used when
11405	        # linking a shared library.
11406	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
11407	      else
11408	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
11409	        # platform.
11410	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
11411	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
11412                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
11413
11414	        # Commands to make compiler produce verbose output that lists
11415	        # what "hidden" libraries, object files and flags are used when
11416	        # linking a shared library.
11417	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
11418	      fi
11419
11420	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
11421	      case $host_os in
11422		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
11423		*)
11424		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
11425		  ;;
11426	      esac
11427	    fi
11428	    ;;
11429        esac
11430        ;;
11431
11432    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
11433      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
11434      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11435      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11436      runpath_var='LD_RUN_PATH'
11437
11438      case $cc_basename in
11439        CC*)
11440	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11441	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11442	  ;;
11443	*)
11444	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11445	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11446	  ;;
11447      esac
11448      ;;
11449
11450      sysv5* | sco3.2v5* | sco5v6*)
11451	# Note: We CANNOT use -z defs as we might desire, because we do not
11452	# link with -lc, and that would cause any symbols used from libc to
11453	# always be unresolved, which means just about no library would
11454	# ever link correctly.  If we're not using GNU ld we use -z text
11455	# though, which does catch some bad symbols but isn't as heavy-handed
11456	# as -z defs.
11457	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
11458	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
11459	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11460	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
11461	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
11462	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
11463	_LT_TAGVAR(link_all_deplibs, $1)=yes
11464	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
11465	runpath_var='LD_RUN_PATH'
11466
11467	case $cc_basename in
11468          CC*)
11469	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11470	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11471	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
11472              '"$_LT_TAGVAR(old_archive_cmds, $1)"
11473	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
11474              '"$_LT_TAGVAR(reload_cmds, $1)"
11475	    ;;
11476	  *)
11477	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11478	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
11479	    ;;
11480	esac
11481      ;;
11482
11483      tandem*)
11484        case $cc_basename in
11485          NCC*)
11486	    # NonStop-UX NCC 3.20
11487	    # FIXME: insert proper C++ library support
11488	    _LT_TAGVAR(ld_shlibs, $1)=no
11489	    ;;
11490          *)
11491	    # FIXME: insert proper C++ library support
11492	    _LT_TAGVAR(ld_shlibs, $1)=no
11493	    ;;
11494        esac
11495        ;;
11496
11497      vxworks*)
11498        # FIXME: insert proper C++ library support
11499        _LT_TAGVAR(ld_shlibs, $1)=no
11500        ;;
11501
11502      *)
11503        # FIXME: insert proper C++ library support
11504        _LT_TAGVAR(ld_shlibs, $1)=no
11505        ;;
11506    esac
11507
11508    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
11509    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
11510
11511    _LT_TAGVAR(GCC, $1)=$GXX
11512    _LT_TAGVAR(LD, $1)=$LD
11513
11514    ## CAVEAT EMPTOR:
11515    ## There is no encapsulation within the following macros, do not change
11516    ## the running order or otherwise move them around unless you know exactly
11517    ## what you are doing...
11518    _LT_SYS_HIDDEN_LIBDEPS($1)
11519    _LT_COMPILER_PIC($1)
11520    _LT_COMPILER_C_O($1)
11521    _LT_COMPILER_FILE_LOCKS($1)
11522    _LT_LINKER_SHLIBS($1)
11523    _LT_SYS_DYNAMIC_LINKER($1)
11524    _LT_LINKER_HARDCODE_LIBPATH($1)
11525
11526    _LT_CONFIG($1)
11527  fi # test -n "$compiler"
11528
11529  CC=$lt_save_CC
11530  CFLAGS=$lt_save_CFLAGS
11531  LDCXX=$LD
11532  LD=$lt_save_LD
11533  GCC=$lt_save_GCC
11534  with_gnu_ld=$lt_save_with_gnu_ld
11535  lt_cv_path_LDCXX=$lt_cv_path_LD
11536  lt_cv_path_LD=$lt_save_path_LD
11537  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
11538  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
11539fi # test yes != "$_lt_caught_CXX_error"
11540
11541AC_LANG_POP
11542])# _LT_LANG_CXX_CONFIG
11543
11544
11545# _LT_FUNC_STRIPNAME_CNF
11546# ----------------------
11547# func_stripname_cnf prefix suffix name
11548# strip PREFIX and SUFFIX off of NAME.
11549# PREFIX and SUFFIX must not contain globbing or regex special
11550# characters, hashes, percent signs, but SUFFIX may contain a leading
11551# dot (in which case that matches only a dot).
11552#
11553# This function is identical to the (non-XSI) version of func_stripname,
11554# except this one can be used by m4 code that may be executed by configure,
11555# rather than the libtool script.
11556m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
11557AC_REQUIRE([_LT_DECL_SED])
11558AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
11559func_stripname_cnf ()
11560{
11561  case @S|@2 in
11562  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
11563  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
11564  esac
11565} # func_stripname_cnf
11566])# _LT_FUNC_STRIPNAME_CNF
11567
11568
11569# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
11570# ---------------------------------
11571# Figure out "hidden" library dependencies from verbose
11572# compiler output when linking a shared library.
11573# Parse the compiler output and extract the necessary
11574# objects, libraries and library flags.
11575m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
11576[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
11577AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
11578# Dependencies to place before and after the object being linked:
11579_LT_TAGVAR(predep_objects, $1)=
11580_LT_TAGVAR(postdep_objects, $1)=
11581_LT_TAGVAR(predeps, $1)=
11582_LT_TAGVAR(postdeps, $1)=
11583_LT_TAGVAR(compiler_lib_search_path, $1)=
11584
11585dnl we can't use the lt_simple_compile_test_code here,
11586dnl because it contains code intended for an executable,
11587dnl not a library.  It's possible we should let each
11588dnl tag define a new lt_????_link_test_code variable,
11589dnl but it's only used here...
11590m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
11591int a;
11592void foo (void) { a = 0; }
11593_LT_EOF
11594], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
11595class Foo
11596{
11597public:
11598  Foo (void) { a = 0; }
11599private:
11600  int a;
11601};
11602_LT_EOF
11603], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
11604      subroutine foo
11605      implicit none
11606      integer*4 a
11607      a=0
11608      return
11609      end
11610_LT_EOF
11611], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
11612      subroutine foo
11613      implicit none
11614      integer a
11615      a=0
11616      return
11617      end
11618_LT_EOF
11619], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
11620public class foo {
11621  private int a;
11622  public void bar (void) {
11623    a = 0;
11624  }
11625};
11626_LT_EOF
11627], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
11628package foo
11629func foo() {
11630}
11631_LT_EOF
11632])
11633
11634_lt_libdeps_save_CFLAGS=$CFLAGS
11635case "$CC $CFLAGS " in #(
11636*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
11637*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
11638*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
11639esac
11640
11641dnl Parse the compiler output and extract the necessary
11642dnl objects, libraries and library flags.
11643if AC_TRY_EVAL(ac_compile); then
11644  # Parse the compiler output and extract the necessary
11645  # objects, libraries and library flags.
11646
11647  # Sentinel used to keep track of whether or not we are before
11648  # the conftest object file.
11649  pre_test_object_deps_done=no
11650
11651  for p in `eval "$output_verbose_link_cmd"`; do
11652    case $prev$p in
11653
11654    -L* | -R* | -l*)
11655       # Some compilers place space between "-{L,R}" and the path.
11656       # Remove the space.
11657       if test x-L = "$p" ||
11658          test x-R = "$p"; then
11659	 prev=$p
11660	 continue
11661       fi
11662
11663       # Expand the sysroot to ease extracting the directories later.
11664       if test -z "$prev"; then
11665         case $p in
11666         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
11667         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
11668         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
11669         esac
11670       fi
11671       case $p in
11672       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
11673       esac
11674       if test no = "$pre_test_object_deps_done"; then
11675	 case $prev in
11676	 -L | -R)
11677	   # Internal compiler library paths should come after those
11678	   # provided the user.  The postdeps already come after the
11679	   # user supplied libs so there is no need to process them.
11680	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
11681	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
11682	   else
11683	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
11684	   fi
11685	   ;;
11686	 # The "-l" case would never come before the object being
11687	 # linked, so don't bother handling this case.
11688	 esac
11689       else
11690	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
11691	   _LT_TAGVAR(postdeps, $1)=$prev$p
11692	 else
11693	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
11694	 fi
11695       fi
11696       prev=
11697       ;;
11698
11699    *.lto.$objext) ;; # Ignore GCC LTO objects
11700    *.$objext)
11701       # This assumes that the test object file only shows up
11702       # once in the compiler output.
11703       if test "$p" = "conftest.$objext"; then
11704	 pre_test_object_deps_done=yes
11705	 continue
11706       fi
11707
11708       if test no = "$pre_test_object_deps_done"; then
11709	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
11710	   _LT_TAGVAR(predep_objects, $1)=$p
11711	 else
11712	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
11713	 fi
11714       else
11715	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
11716	   _LT_TAGVAR(postdep_objects, $1)=$p
11717	 else
11718	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
11719	 fi
11720       fi
11721       ;;
11722
11723    *) ;; # Ignore the rest.
11724
11725    esac
11726  done
11727
11728  # Clean up.
11729  rm -f a.out a.exe
11730else
11731  echo "libtool.m4: error: problem compiling $1 test program"
11732fi
11733
11734$RM -f confest.$objext
11735CFLAGS=$_lt_libdeps_save_CFLAGS
11736
11737# PORTME: override above test on systems where it is broken
11738m4_if([$1], [CXX],
11739[case $host_os in
11740interix[[3-9]]*)
11741  # Interix 3.5 installs completely hosed .la files for C++, so rather than
11742  # hack all around it, let's just trust "g++" to DTRT.
11743  _LT_TAGVAR(predep_objects,$1)=
11744  _LT_TAGVAR(postdep_objects,$1)=
11745  _LT_TAGVAR(postdeps,$1)=
11746  ;;
11747esac
11748])
11749
11750case " $_LT_TAGVAR(postdeps, $1) " in
11751*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
11752esac
11753 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
11754if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
11755 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
11756fi
11757_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
11758    [The directories searched by this compiler when creating a shared library])
11759_LT_TAGDECL([], [predep_objects], [1],
11760    [Dependencies to place before and after the objects being linked to
11761    create a shared library])
11762_LT_TAGDECL([], [postdep_objects], [1])
11763_LT_TAGDECL([], [predeps], [1])
11764_LT_TAGDECL([], [postdeps], [1])
11765_LT_TAGDECL([], [compiler_lib_search_path], [1],
11766    [The library search path used internally by the compiler when linking
11767    a shared library])
11768])# _LT_SYS_HIDDEN_LIBDEPS
11769
11770
11771# _LT_LANG_F77_CONFIG([TAG])
11772# --------------------------
11773# Ensure that the configuration variables for a Fortran 77 compiler are
11774# suitably defined.  These variables are subsequently used by _LT_CONFIG
11775# to write the compiler configuration to 'libtool'.
11776m4_defun([_LT_LANG_F77_CONFIG],
11777[AC_LANG_PUSH(Fortran 77)
11778if test -z "$F77" || test no = "$F77"; then
11779  _lt_disable_F77=yes
11780fi
11781
11782_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11783_LT_TAGVAR(allow_undefined_flag, $1)=
11784_LT_TAGVAR(always_export_symbols, $1)=no
11785_LT_TAGVAR(archive_expsym_cmds, $1)=
11786_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11787_LT_TAGVAR(hardcode_direct, $1)=no
11788_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11789_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11790_LT_TAGVAR(hardcode_libdir_separator, $1)=
11791_LT_TAGVAR(hardcode_minus_L, $1)=no
11792_LT_TAGVAR(hardcode_automatic, $1)=no
11793_LT_TAGVAR(inherit_rpath, $1)=no
11794_LT_TAGVAR(module_cmds, $1)=
11795_LT_TAGVAR(module_expsym_cmds, $1)=
11796_LT_TAGVAR(link_all_deplibs, $1)=unknown
11797_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11798_LT_TAGVAR(reload_flag, $1)=$reload_flag
11799_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11800_LT_TAGVAR(no_undefined_flag, $1)=
11801_LT_TAGVAR(whole_archive_flag_spec, $1)=
11802_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11803
11804# Source file extension for f77 test sources.
11805ac_ext=f
11806
11807# Object file extension for compiled f77 test sources.
11808objext=o
11809_LT_TAGVAR(objext, $1)=$objext
11810
11811# No sense in running all these tests if we already determined that
11812# the F77 compiler isn't working.  Some variables (like enable_shared)
11813# are currently assumed to apply to all compilers on this platform,
11814# and will be corrupted by setting them based on a non-working compiler.
11815if test yes != "$_lt_disable_F77"; then
11816  # Code to be used in simple compile tests
11817  lt_simple_compile_test_code="\
11818      subroutine t
11819      return
11820      end
11821"
11822
11823  # Code to be used in simple link tests
11824  lt_simple_link_test_code="\
11825      program t
11826      end
11827"
11828
11829  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11830  _LT_TAG_COMPILER
11831
11832  # save warnings/boilerplate of simple test code
11833  _LT_COMPILER_BOILERPLATE
11834  _LT_LINKER_BOILERPLATE
11835
11836  # Allow CC to be a program name with arguments.
11837  lt_save_CC=$CC
11838  lt_save_GCC=$GCC
11839  lt_save_CFLAGS=$CFLAGS
11840  CC=${F77-"f77"}
11841  CFLAGS=$FFLAGS
11842  compiler=$CC
11843  _LT_TAGVAR(compiler, $1)=$CC
11844  _LT_CC_BASENAME([$compiler])
11845  GCC=$G77
11846  if test -n "$compiler"; then
11847    AC_MSG_CHECKING([if libtool supports shared libraries])
11848    AC_MSG_RESULT([$can_build_shared])
11849
11850    AC_MSG_CHECKING([whether to build shared libraries])
11851    test no = "$can_build_shared" && enable_shared=no
11852
11853    # On AIX, shared libraries and static libraries use the same namespace, and
11854    # are all built from PIC.
11855    case $host_os in
11856      aix3*)
11857        test yes = "$enable_shared" && enable_static=no
11858        if test -n "$RANLIB"; then
11859          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11860          postinstall_cmds='$RANLIB $lib'
11861        fi
11862        ;;
11863      aix[[4-9]]*)
11864	if test ia64 != "$host_cpu"; then
11865	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11866	  yes,aix,yes) ;;		# shared object as lib.so file only
11867	  yes,svr4,*) ;;		# shared object as lib.so archive member only
11868	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
11869	  esac
11870	fi
11871        ;;
11872    esac
11873    AC_MSG_RESULT([$enable_shared])
11874
11875    AC_MSG_CHECKING([whether to build static libraries])
11876    # Make sure either enable_shared or enable_static is yes.
11877    test yes = "$enable_shared" || enable_static=yes
11878    AC_MSG_RESULT([$enable_static])
11879
11880    _LT_TAGVAR(GCC, $1)=$G77
11881    _LT_TAGVAR(LD, $1)=$LD
11882
11883    ## CAVEAT EMPTOR:
11884    ## There is no encapsulation within the following macros, do not change
11885    ## the running order or otherwise move them around unless you know exactly
11886    ## what you are doing...
11887    _LT_COMPILER_PIC($1)
11888    _LT_COMPILER_C_O($1)
11889    _LT_COMPILER_FILE_LOCKS($1)
11890    _LT_LINKER_SHLIBS($1)
11891    _LT_SYS_DYNAMIC_LINKER($1)
11892    _LT_LINKER_HARDCODE_LIBPATH($1)
11893
11894    _LT_CONFIG($1)
11895  fi # test -n "$compiler"
11896
11897  GCC=$lt_save_GCC
11898  CC=$lt_save_CC
11899  CFLAGS=$lt_save_CFLAGS
11900fi # test yes != "$_lt_disable_F77"
11901
11902AC_LANG_POP
11903])# _LT_LANG_F77_CONFIG
11904
11905
11906# _LT_LANG_FC_CONFIG([TAG])
11907# -------------------------
11908# Ensure that the configuration variables for a Fortran compiler are
11909# suitably defined.  These variables are subsequently used by _LT_CONFIG
11910# to write the compiler configuration to 'libtool'.
11911m4_defun([_LT_LANG_FC_CONFIG],
11912[AC_LANG_PUSH(Fortran)
11913
11914if test -z "$FC" || test no = "$FC"; then
11915  _lt_disable_FC=yes
11916fi
11917
11918_LT_TAGVAR(archive_cmds_need_lc, $1)=no
11919_LT_TAGVAR(allow_undefined_flag, $1)=
11920_LT_TAGVAR(always_export_symbols, $1)=no
11921_LT_TAGVAR(archive_expsym_cmds, $1)=
11922_LT_TAGVAR(export_dynamic_flag_spec, $1)=
11923_LT_TAGVAR(hardcode_direct, $1)=no
11924_LT_TAGVAR(hardcode_direct_absolute, $1)=no
11925_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
11926_LT_TAGVAR(hardcode_libdir_separator, $1)=
11927_LT_TAGVAR(hardcode_minus_L, $1)=no
11928_LT_TAGVAR(hardcode_automatic, $1)=no
11929_LT_TAGVAR(inherit_rpath, $1)=no
11930_LT_TAGVAR(module_cmds, $1)=
11931_LT_TAGVAR(module_expsym_cmds, $1)=
11932_LT_TAGVAR(link_all_deplibs, $1)=unknown
11933_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
11934_LT_TAGVAR(reload_flag, $1)=$reload_flag
11935_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
11936_LT_TAGVAR(no_undefined_flag, $1)=
11937_LT_TAGVAR(whole_archive_flag_spec, $1)=
11938_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
11939
11940# Source file extension for fc test sources.
11941ac_ext=${ac_fc_srcext-f}
11942
11943# Object file extension for compiled fc test sources.
11944objext=o
11945_LT_TAGVAR(objext, $1)=$objext
11946
11947# No sense in running all these tests if we already determined that
11948# the FC compiler isn't working.  Some variables (like enable_shared)
11949# are currently assumed to apply to all compilers on this platform,
11950# and will be corrupted by setting them based on a non-working compiler.
11951if test yes != "$_lt_disable_FC"; then
11952  # Code to be used in simple compile tests
11953  lt_simple_compile_test_code="\
11954      subroutine t
11955      return
11956      end
11957"
11958
11959  # Code to be used in simple link tests
11960  lt_simple_link_test_code="\
11961      program t
11962      end
11963"
11964
11965  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
11966  _LT_TAG_COMPILER
11967
11968  # save warnings/boilerplate of simple test code
11969  _LT_COMPILER_BOILERPLATE
11970  _LT_LINKER_BOILERPLATE
11971
11972  # Allow CC to be a program name with arguments.
11973  lt_save_CC=$CC
11974  lt_save_GCC=$GCC
11975  lt_save_CFLAGS=$CFLAGS
11976  CC=${FC-"f95"}
11977  CFLAGS=$FCFLAGS
11978  compiler=$CC
11979  GCC=$ac_cv_fc_compiler_gnu
11980
11981  _LT_TAGVAR(compiler, $1)=$CC
11982  _LT_CC_BASENAME([$compiler])
11983
11984  if test -n "$compiler"; then
11985    AC_MSG_CHECKING([if libtool supports shared libraries])
11986    AC_MSG_RESULT([$can_build_shared])
11987
11988    AC_MSG_CHECKING([whether to build shared libraries])
11989    test no = "$can_build_shared" && enable_shared=no
11990
11991    # On AIX, shared libraries and static libraries use the same namespace, and
11992    # are all built from PIC.
11993    case $host_os in
11994      aix3*)
11995        test yes = "$enable_shared" && enable_static=no
11996        if test -n "$RANLIB"; then
11997          archive_cmds="$archive_cmds~\$RANLIB \$lib"
11998          postinstall_cmds='$RANLIB $lib'
11999        fi
12000        ;;
12001      aix[[4-9]]*)
12002	if test ia64 != "$host_cpu"; then
12003	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
12004	  yes,aix,yes) ;;		# shared object as lib.so file only
12005	  yes,svr4,*) ;;		# shared object as lib.so archive member only
12006	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
12007	  esac
12008	fi
12009        ;;
12010    esac
12011    AC_MSG_RESULT([$enable_shared])
12012
12013    AC_MSG_CHECKING([whether to build static libraries])
12014    # Make sure either enable_shared or enable_static is yes.
12015    test yes = "$enable_shared" || enable_static=yes
12016    AC_MSG_RESULT([$enable_static])
12017
12018    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
12019    _LT_TAGVAR(LD, $1)=$LD
12020
12021    ## CAVEAT EMPTOR:
12022    ## There is no encapsulation within the following macros, do not change
12023    ## the running order or otherwise move them around unless you know exactly
12024    ## what you are doing...
12025    _LT_SYS_HIDDEN_LIBDEPS($1)
12026    _LT_COMPILER_PIC($1)
12027    _LT_COMPILER_C_O($1)
12028    _LT_COMPILER_FILE_LOCKS($1)
12029    _LT_LINKER_SHLIBS($1)
12030    _LT_SYS_DYNAMIC_LINKER($1)
12031    _LT_LINKER_HARDCODE_LIBPATH($1)
12032
12033    _LT_CONFIG($1)
12034  fi # test -n "$compiler"
12035
12036  GCC=$lt_save_GCC
12037  CC=$lt_save_CC
12038  CFLAGS=$lt_save_CFLAGS
12039fi # test yes != "$_lt_disable_FC"
12040
12041AC_LANG_POP
12042])# _LT_LANG_FC_CONFIG
12043
12044
12045# _LT_LANG_GCJ_CONFIG([TAG])
12046# --------------------------
12047# Ensure that the configuration variables for the GNU Java Compiler compiler
12048# are suitably defined.  These variables are subsequently used by _LT_CONFIG
12049# to write the compiler configuration to 'libtool'.
12050m4_defun([_LT_LANG_GCJ_CONFIG],
12051[AC_REQUIRE([LT_PROG_GCJ])dnl
12052AC_LANG_SAVE
12053
12054# Source file extension for Java test sources.
12055ac_ext=java
12056
12057# Object file extension for compiled Java test sources.
12058objext=o
12059_LT_TAGVAR(objext, $1)=$objext
12060
12061# Code to be used in simple compile tests
12062lt_simple_compile_test_code="class foo {}"
12063
12064# Code to be used in simple link tests
12065lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
12066
12067# ltmain only uses $CC for tagged configurations so make sure $CC is set.
12068_LT_TAG_COMPILER
12069
12070# save warnings/boilerplate of simple test code
12071_LT_COMPILER_BOILERPLATE
12072_LT_LINKER_BOILERPLATE
12073
12074# Allow CC to be a program name with arguments.
12075lt_save_CC=$CC
12076lt_save_CFLAGS=$CFLAGS
12077lt_save_GCC=$GCC
12078GCC=yes
12079CC=${GCJ-"gcj"}
12080CFLAGS=$GCJFLAGS
12081compiler=$CC
12082_LT_TAGVAR(compiler, $1)=$CC
12083_LT_TAGVAR(LD, $1)=$LD
12084_LT_CC_BASENAME([$compiler])
12085
12086# GCJ did not exist at the time GCC didn't implicitly link libc in.
12087_LT_TAGVAR(archive_cmds_need_lc, $1)=no
12088
12089_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
12090_LT_TAGVAR(reload_flag, $1)=$reload_flag
12091_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
12092
12093if test -n "$compiler"; then
12094  _LT_COMPILER_NO_RTTI($1)
12095  _LT_COMPILER_PIC($1)
12096  _LT_COMPILER_C_O($1)
12097  _LT_COMPILER_FILE_LOCKS($1)
12098  _LT_LINKER_SHLIBS($1)
12099  _LT_LINKER_HARDCODE_LIBPATH($1)
12100
12101  _LT_CONFIG($1)
12102fi
12103
12104AC_LANG_RESTORE
12105
12106GCC=$lt_save_GCC
12107CC=$lt_save_CC
12108CFLAGS=$lt_save_CFLAGS
12109])# _LT_LANG_GCJ_CONFIG
12110
12111
12112# _LT_LANG_GO_CONFIG([TAG])
12113# --------------------------
12114# Ensure that the configuration variables for the GNU Go compiler
12115# are suitably defined.  These variables are subsequently used by _LT_CONFIG
12116# to write the compiler configuration to 'libtool'.
12117m4_defun([_LT_LANG_GO_CONFIG],
12118[AC_REQUIRE([LT_PROG_GO])dnl
12119AC_LANG_SAVE
12120
12121# Source file extension for Go test sources.
12122ac_ext=go
12123
12124# Object file extension for compiled Go test sources.
12125objext=o
12126_LT_TAGVAR(objext, $1)=$objext
12127
12128# Code to be used in simple compile tests
12129lt_simple_compile_test_code="package main; func main() { }"
12130
12131# Code to be used in simple link tests
12132lt_simple_link_test_code='package main; func main() { }'
12133
12134# ltmain only uses $CC for tagged configurations so make sure $CC is set.
12135_LT_TAG_COMPILER
12136
12137# save warnings/boilerplate of simple test code
12138_LT_COMPILER_BOILERPLATE
12139_LT_LINKER_BOILERPLATE
12140
12141# Allow CC to be a program name with arguments.
12142lt_save_CC=$CC
12143lt_save_CFLAGS=$CFLAGS
12144lt_save_GCC=$GCC
12145GCC=yes
12146CC=${GOC-"gccgo"}
12147CFLAGS=$GOFLAGS
12148compiler=$CC
12149_LT_TAGVAR(compiler, $1)=$CC
12150_LT_TAGVAR(LD, $1)=$LD
12151_LT_CC_BASENAME([$compiler])
12152
12153# Go did not exist at the time GCC didn't implicitly link libc in.
12154_LT_TAGVAR(archive_cmds_need_lc, $1)=no
12155
12156_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
12157_LT_TAGVAR(reload_flag, $1)=$reload_flag
12158_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
12159
12160if test -n "$compiler"; then
12161  _LT_COMPILER_NO_RTTI($1)
12162  _LT_COMPILER_PIC($1)
12163  _LT_COMPILER_C_O($1)
12164  _LT_COMPILER_FILE_LOCKS($1)
12165  _LT_LINKER_SHLIBS($1)
12166  _LT_LINKER_HARDCODE_LIBPATH($1)
12167
12168  _LT_CONFIG($1)
12169fi
12170
12171AC_LANG_RESTORE
12172
12173GCC=$lt_save_GCC
12174CC=$lt_save_CC
12175CFLAGS=$lt_save_CFLAGS
12176])# _LT_LANG_GO_CONFIG
12177
12178
12179# _LT_LANG_RC_CONFIG([TAG])
12180# -------------------------
12181# Ensure that the configuration variables for the Windows resource compiler
12182# are suitably defined.  These variables are subsequently used by _LT_CONFIG
12183# to write the compiler configuration to 'libtool'.
12184m4_defun([_LT_LANG_RC_CONFIG],
12185[AC_REQUIRE([LT_PROG_RC])dnl
12186AC_LANG_SAVE
12187
12188# Source file extension for RC test sources.
12189ac_ext=rc
12190
12191# Object file extension for compiled RC test sources.
12192objext=o
12193_LT_TAGVAR(objext, $1)=$objext
12194
12195# Code to be used in simple compile tests
12196lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
12197
12198# Code to be used in simple link tests
12199lt_simple_link_test_code=$lt_simple_compile_test_code
12200
12201# ltmain only uses $CC for tagged configurations so make sure $CC is set.
12202_LT_TAG_COMPILER
12203
12204# save warnings/boilerplate of simple test code
12205_LT_COMPILER_BOILERPLATE
12206_LT_LINKER_BOILERPLATE
12207
12208# Allow CC to be a program name with arguments.
12209lt_save_CC=$CC
12210lt_save_CFLAGS=$CFLAGS
12211lt_save_GCC=$GCC
12212GCC=
12213CC=${RC-"windres"}
12214CFLAGS=
12215compiler=$CC
12216_LT_TAGVAR(compiler, $1)=$CC
12217_LT_CC_BASENAME([$compiler])
12218_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
12219
12220if test -n "$compiler"; then
12221  :
12222  _LT_CONFIG($1)
12223fi
12224
12225GCC=$lt_save_GCC
12226AC_LANG_RESTORE
12227CC=$lt_save_CC
12228CFLAGS=$lt_save_CFLAGS
12229])# _LT_LANG_RC_CONFIG
12230
12231
12232# LT_PROG_GCJ
12233# -----------
12234AC_DEFUN([LT_PROG_GCJ],
12235[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
12236  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
12237    [AC_CHECK_TOOL(GCJ, gcj,)
12238      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
12239      AC_SUBST(GCJFLAGS)])])[]dnl
12240])
12241
12242# Old name:
12243AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
12244dnl aclocal-1.4 backwards compatibility:
12245dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
12246
12247
12248# LT_PROG_GO
12249# ----------
12250AC_DEFUN([LT_PROG_GO],
12251[AC_CHECK_TOOL(GOC, gccgo,)
12252])
12253
12254
12255# LT_PROG_RC
12256# ----------
12257AC_DEFUN([LT_PROG_RC],
12258[AC_CHECK_TOOL(RC, windres,)
12259])
12260
12261# Old name:
12262AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
12263dnl aclocal-1.4 backwards compatibility:
12264dnl AC_DEFUN([LT_AC_PROG_RC], [])
12265
12266
12267# _LT_DECL_EGREP
12268# --------------
12269# If we don't have a new enough Autoconf to choose the best grep
12270# available, choose the one first in the user's PATH.
12271m4_defun([_LT_DECL_EGREP],
12272[AC_REQUIRE([AC_PROG_EGREP])dnl
12273AC_REQUIRE([AC_PROG_FGREP])dnl
12274test -z "$GREP" && GREP=grep
12275_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
12276_LT_DECL([], [EGREP], [1], [An ERE matcher])
12277_LT_DECL([], [FGREP], [1], [A literal string matcher])
12278dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
12279AC_SUBST([GREP])
12280])
12281
12282
12283# _LT_DECL_OBJDUMP
12284# --------------
12285# If we don't have a new enough Autoconf to choose the best objdump
12286# available, choose the one first in the user's PATH.
12287m4_defun([_LT_DECL_OBJDUMP],
12288[AC_CHECK_TOOL(OBJDUMP, objdump, false)
12289test -z "$OBJDUMP" && OBJDUMP=objdump
12290_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
12291AC_SUBST([OBJDUMP])
12292])
12293
12294# _LT_DECL_DLLTOOL
12295# ----------------
12296# Ensure DLLTOOL variable is set.
12297m4_defun([_LT_DECL_DLLTOOL],
12298[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
12299test -z "$DLLTOOL" && DLLTOOL=dlltool
12300_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
12301AC_SUBST([DLLTOOL])
12302])
12303
12304# _LT_DECL_FILECMD
12305# ----------------
12306# Check for a file(cmd) program that can be used to detect file type and magic
12307m4_defun([_LT_DECL_FILECMD],
12308[AC_CHECK_TOOL([FILECMD], [file], [:])
12309_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
12310])# _LD_DECL_FILECMD
12311
12312# _LT_DECL_SED
12313# ------------
12314# Check for a fully-functional sed program, that truncates
12315# as few characters as possible.  Prefer GNU sed if found.
12316m4_defun([_LT_DECL_SED],
12317[AC_PROG_SED
12318test -z "$SED" && SED=sed
12319Xsed="$SED -e 1s/^X//"
12320_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
12321_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
12322    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
12323])# _LT_DECL_SED
12324
12325m4_ifndef([AC_PROG_SED], [
12326# NOTE: This macro has been submitted for inclusion into   #
12327#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
12328#  a released version of Autoconf we should remove this    #
12329#  macro and use it instead.                               #
12330
12331m4_defun([AC_PROG_SED],
12332[AC_MSG_CHECKING([for a sed that does not truncate output])
12333AC_CACHE_VAL(lt_cv_path_SED,
12334[# Loop through the user's path and test for sed and gsed.
12335# Then use that list of sed's as ones to test for truncation.
12336as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12337for as_dir in $PATH
12338do
12339  IFS=$as_save_IFS
12340  test -z "$as_dir" && as_dir=.
12341  for lt_ac_prog in sed gsed; do
12342    for ac_exec_ext in '' $ac_executable_extensions; do
12343      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
12344        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
12345      fi
12346    done
12347  done
12348done
12349IFS=$as_save_IFS
12350lt_ac_max=0
12351lt_ac_count=0
12352# Add /usr/xpg4/bin/sed as it is typically found on Solaris
12353# along with /bin/sed that truncates output.
12354for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
12355  test ! -f "$lt_ac_sed" && continue
12356  cat /dev/null > conftest.in
12357  lt_ac_count=0
12358  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
12359  # Check for GNU sed and select it if it is found.
12360  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
12361    lt_cv_path_SED=$lt_ac_sed
12362    break
12363  fi
12364  while true; do
12365    cat conftest.in conftest.in >conftest.tmp
12366    mv conftest.tmp conftest.in
12367    cp conftest.in conftest.nl
12368    echo >>conftest.nl
12369    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
12370    cmp -s conftest.out conftest.nl || break
12371    # 10000 chars as input seems more than enough
12372    test 10 -lt "$lt_ac_count" && break
12373    lt_ac_count=`expr $lt_ac_count + 1`
12374    if test "$lt_ac_count" -gt "$lt_ac_max"; then
12375      lt_ac_max=$lt_ac_count
12376      lt_cv_path_SED=$lt_ac_sed
12377    fi
12378  done
12379done
12380])
12381SED=$lt_cv_path_SED
12382AC_SUBST([SED])
12383AC_MSG_RESULT([$SED])
12384])#AC_PROG_SED
12385])#m4_ifndef
12386
12387# Old name:
12388AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
12389dnl aclocal-1.4 backwards compatibility:
12390dnl AC_DEFUN([LT_AC_PROG_SED], [])
12391
12392
12393# _LT_CHECK_SHELL_FEATURES
12394# ------------------------
12395# Find out whether the shell is Bourne or XSI compatible,
12396# or has some other useful features.
12397m4_defun([_LT_CHECK_SHELL_FEATURES],
12398[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
12399  lt_unset=unset
12400else
12401  lt_unset=false
12402fi
12403_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
12404
12405# test EBCDIC or ASCII
12406case `echo X|tr X '\101'` in
12407 A) # ASCII based system
12408    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
12409  lt_SP2NL='tr \040 \012'
12410  lt_NL2SP='tr \015\012 \040\040'
12411  ;;
12412 *) # EBCDIC based system
12413  lt_SP2NL='tr \100 \n'
12414  lt_NL2SP='tr \r\n \100\100'
12415  ;;
12416esac
12417_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
12418_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
12419])# _LT_CHECK_SHELL_FEATURES
12420
12421
12422# _LT_PATH_CONVERSION_FUNCTIONS
12423# -----------------------------
12424# Determine what file name conversion functions should be used by
12425# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
12426# for certain cross-compile configurations and native mingw.
12427m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
12428[AC_REQUIRE([AC_CANONICAL_HOST])dnl
12429AC_REQUIRE([AC_CANONICAL_BUILD])dnl
12430AC_MSG_CHECKING([how to convert $build file names to $host format])
12431AC_CACHE_VAL(lt_cv_to_host_file_cmd,
12432[case $host in
12433  *-*-mingw* )
12434    case $build in
12435      *-*-mingw* ) # actually msys
12436        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
12437        ;;
12438      *-*-cygwin* )
12439        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
12440        ;;
12441      * ) # otherwise, assume *nix
12442        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
12443        ;;
12444    esac
12445    ;;
12446  *-*-cygwin* )
12447    case $build in
12448      *-*-mingw* ) # actually msys
12449        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
12450        ;;
12451      *-*-cygwin* )
12452        lt_cv_to_host_file_cmd=func_convert_file_noop
12453        ;;
12454      * ) # otherwise, assume *nix
12455        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
12456        ;;
12457    esac
12458    ;;
12459  * ) # unhandled hosts (and "normal" native builds)
12460    lt_cv_to_host_file_cmd=func_convert_file_noop
12461    ;;
12462esac
12463])
12464to_host_file_cmd=$lt_cv_to_host_file_cmd
12465AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
12466_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
12467         [0], [convert $build file names to $host format])dnl
12468
12469AC_MSG_CHECKING([how to convert $build file names to toolchain format])
12470AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
12471[#assume ordinary cross tools, or native build.
12472lt_cv_to_tool_file_cmd=func_convert_file_noop
12473case $host in
12474  *-*-mingw* )
12475    case $build in
12476      *-*-mingw* ) # actually msys
12477        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
12478        ;;
12479    esac
12480    ;;
12481esac
12482])
12483to_tool_file_cmd=$lt_cv_to_tool_file_cmd
12484AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
12485_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
12486         [0], [convert $build files to toolchain format])dnl
12487])# _LT_PATH_CONVERSION_FUNCTIONS
12488
12489# ltversion.m4 -- version numbers			-*- Autoconf -*-
12490#
12491#   Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
12492#   Inc.
12493#   Written by Scott James Remnant, 2004
12494#
12495# This file is free software; the Free Software Foundation gives
12496# unlimited permission to copy and/or distribute it, with or without
12497# modifications, as long as this notice is preserved.
12498
12499# @configure_input@
12500
12501# serial 4245 ltversion.m4
12502# This file is part of GNU Libtool
12503
12504m4_define([LT_PACKAGE_VERSION], [2.4.7])
12505m4_define([LT_PACKAGE_REVISION], [2.4.7])
12506
12507AC_DEFUN([LTVERSION_VERSION],
12508[macro_version='2.4.7'
12509macro_revision='2.4.7'
12510_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
12511_LT_DECL(, macro_revision, 0)
12512])
12513
12514dnl Copyright 2005 Red Hat, Inc
12515dnl 
12516dnl Permission to use, copy, modify, distribute, and sell this software and its
12517dnl documentation for any purpose is hereby granted without fee, provided that
12518dnl the above copyright notice appear in all copies and that both that
12519dnl copyright notice and this permission notice appear in supporting
12520dnl documentation.
12521dnl 
12522dnl The above copyright notice and this permission notice shall be included
12523dnl in all copies or substantial portions of the Software.
12524dnl 
12525dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
12526dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12527dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
12528dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
12529dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
12530dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
12531dnl OTHER DEALINGS IN THE SOFTWARE.
12532dnl 
12533dnl Except as contained in this notice, the name of the copyright holders shall
12534dnl not be used in advertising or otherwise to promote the sale, use or
12535dnl other dealings in this Software without prior written authorization
12536dnl from the copyright holders.
12537dnl 
12538
12539# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
12540# --------------------------
12541# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
12542# is defined, then add the given PROTO to $REQUIRED_MODULES.
12543
12544AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
12545	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
12546	SAVE_CFLAGS="$CFLAGS"
12547	CFLAGS="$CFLAGS `$PKG_CONFIG --cflags xorg-server`"
12548	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12549#include "xorg-server.h"
12550#if !defined $1
12551#error $1 not defined
12552#endif
12553		]])],
12554		[_EXT_CHECK=yes],
12555		[_EXT_CHECK=no])
12556	CFLAGS="$SAVE_CFLAGS"
12557	AC_MSG_CHECKING([if $1 is defined])
12558	AC_MSG_RESULT([$_EXT_CHECK])
12559	if test "$_EXT_CHECK" != no; then
12560		REQUIRED_MODULES="$REQUIRED_MODULES $2"
12561	fi
12562])
12563
12564