xref: /freebsd/contrib/file/aclocal.m4 (revision 4f29da19bd44f0e99f021510460a81bf754c21d2)
1# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
2
3# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14dnl cloned from autoconf 2.13 acspecific.m4
15AC_DEFUN([AC_C_LONG_LONG],
16[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
17[if test "$GCC" = yes; then
18  ac_cv_c_long_long=yes
19else
20AC_TRY_RUN([int main() {
21long long foo = 0;
22exit(sizeof(long long) < sizeof(long)); }],
23ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
24fi])
25if test $ac_cv_c_long_long = yes; then
26  AC_DEFINE(HAVE_LONG_LONG)
27fi
28])
29
30dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
31
32AC_DEFUN([AC_STRUCT_TIMEZONE_DAYLIGHT],
33[AC_REQUIRE([AC_STRUCT_TM])dnl
34AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
35[AC_TRY_COMPILE([#include <sys/types.h>
36#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
37  ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
38if test "$ac_cv_struct_tm_zone" = yes; then
39  AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE])
40fi
41AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
42[AC_TRY_LINK(
43changequote(<<, >>)dnl
44<<#include <time.h>
45#ifndef tzname /* For SGI.  */
46extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
47#endif>>,
48changequote([, ])dnl
49[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
50  if test $ac_cv_var_tzname = yes; then
51    AC_DEFINE(HAVE_TZNAME,1,[HAVE_TZNAME])
52  fi
53
54AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
55[AC_TRY_COMPILE([#include <sys/types.h>
56#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
57  ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
58if test "$ac_cv_struct_tm_isdst" = yes; then
59  AC_DEFINE(HAVE_TM_ISDST)
60fi
61AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
62[AC_TRY_LINK(
63changequote(<<, >>)dnl
64<<#include <time.h>
65#ifndef daylight /* In case IRIX #defines this, too  */
66extern int daylight;
67#endif>>,
68changequote([, ])dnl
69[atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
70  if test $ac_cv_var_daylight = yes; then
71    AC_DEFINE(HAVE_DAYLIGHT)
72  fi
73])
74
75dnl from autoconf 2.13 acgeneral.m4, with patch:
76dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
77dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
78dnl From: eggert@twinsun.com (Paul Eggert)
79dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
80dnl Newsgroups: gnu.utils.bug
81dnl
82dnl now include <stdint.h> if available
83
84dnl AC_CHECK_TYPE2_STDC(TYPE, DEFAULT)
85AC_DEFUN([AC_CHECK_TYPE2_STDC],
86[AC_REQUIRE([AC_HEADER_STDC])dnl
87AC_REQUIRE([AC_HEADER_STDINT])dnl
88AC_MSG_CHECKING(for $1)
89AC_CACHE_VAL(ac_cv_type_$1,
90[AC_EGREP_CPP(dnl
91[(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]],
92[#if HAVE_STDINT_H
93#include <stdint.h>
94#endif
95#include <sys/types.h>
96#if STDC_HEADERS
97#include <stdlib.h>
98#include <stddef.h>
99#endif], eval "ac_cv_type_$1=yes", eval "ac_cv_type_$1=no")])dnl
100if eval "test \"`echo '$ac_cv_type_'$1`\" = yes"; then
101  AC_MSG_RESULT(yes)
102else
103  AC_MSG_RESULT(no)
104  AC_DEFINE_UNQUOTED($1, $2)
105fi
106])
107
108dnl from autoconf 2.13 acgeneral.m4, with additional third argument
109dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE [, INCLUDES]])
110AC_DEFUN([AC_CHECK_SIZEOF_INCLUDES],
111[dnl The name to #define.
112define([AC_TYPE_NAME], translit(sizeof_$1, [[[a-z *]]], [[[A-Z_P]]]))dnl
113dnl The cache variable name.
114define([AC_CV_NAME], translit(ac_cv_sizeof_$1, [[[ *]]], [[[_p]]]))dnl
115AC_MSG_CHECKING(size of $1)
116AC_CACHE_VAL(AC_CV_NAME,
117[AC_TRY_RUN([$3
118#include <stdio.h>
119main()
120{
121  FILE *f=fopen("conftestval", "w");
122  if (!f) exit(1);
123  fprintf(f, "%d\n", sizeof($1));
124  exit(0);
125}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
126AC_MSG_RESULT($AC_CV_NAME)
127AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
128undefine([AC_TYPE_NAME])dnl
129undefine([AC_CV_NAME])dnl
130])
131
132dnl AC_CHECK_SIZEOF_STDC_HEADERS(TYPE [, CROSS_SIZE])
133AC_DEFUN([AC_CHECK_SIZEOF_STDC_HEADERS],
134[AC_REQUIRE([AC_HEADER_STDC])dnl
135AC_REQUIRE([AC_HEADER_STDINT])dnl
136AC_CHECK_SIZEOF_INCLUDES($1, $2,
137[#if HAVE_STDINT_H
138#include <stdint.h>
139#endif
140#include <sys/types.h>
141#ifdef STDC_HEADERS
142#include <stdlib.h>
143#endif
144])
145])
146
147
148dnl AC_CHECK_TYPE_STDC(TYPE, DEFAULT)
149AC_DEFUN([AC_CHECK_TYPE_STDC],
150[AC_REQUIRE([AC_HEADER_STDC])dnl
151AC_REQUIRE([AC_HEADER_STDINT])dnl
152AC_MSG_CHECKING(for $1)
153AC_CACHE_VAL(ac_cv_type_$1,
154[AC_EGREP_CPP(dnl
155[(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]],
156[#if HAVE_STDINT_H
157#include <stdint.h>
158#endif
159#include <sys/types.h>
160#if STDC_HEADERS
161#include <stdlib.h>
162#include <stddef.h>
163#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
164AC_MSG_RESULT($ac_cv_type_$1)
165if test $ac_cv_type_$1 = no; then
166  AC_DEFINE($1, $2)
167fi
168])
169
170dnl AC_HEADER_STDINT
171AC_DEFUN([AC_HEADER_STDINT], [AC_CHECK_HEADERS(stdint.h)])
172
173#serial 19
174
175dnl By default, many hosts won't let programs access large files;
176dnl one must use special compiler options to get large-file access to work.
177dnl For more details about this brain damage please see:
178dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
179
180dnl Written by Paul Eggert <eggert@twinsun.com>.
181
182dnl Internal subroutine of AC_SYS_LARGEFILE.
183dnl AC_SYS_LARGEFILE_TEST_INCLUDES
184AC_DEFUN([AC_SYS_LARGEFILE_TEST_INCLUDES],
185  [[#include <sys/types.h>
186    /* Check that off_t can represent 2**63 - 1 correctly.
187       We can't simply "#define LARGE_OFF_T 9223372036854775807",
188       since some C++ compilers masquerading as C compilers
189       incorrectly reject 9223372036854775807.  */
190#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
191    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
192			&& LARGE_OFF_T % 2147483647 == 1)
193		       ? 1 : -1];
194  ]])
195
196dnl Internal subroutine of AC_SYS_LARGEFILE.
197dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLU=
198DES, FUNCTION-BODY)
199AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE],
200  [AC_CACHE_CHECK([for $1 value needed for large files], $3,
201     [$3=no
202      AC_TRY_COMPILE([$5],
203	[$6],
204	,
205	[AC_TRY_COMPILE([#define $1 $2]
206[$5]
207	   ,
208	   [$6],
209	   [$3=$2])])])
210   if test "[$]$3" != no; then
211     AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
212   fi])
213
214AC_DEFUN([AC_SYS_LARGEFILE],
215  [AC_REQUIRE([AC_PROG_CC])
216   AC_ARG_ENABLE(largefile,
217     [  --disable-largefile     omit support for large files])
218   if test "$enable_largefile" != no; then
219
220     AC_CACHE_CHECK([for special C compiler options needed for large files=
221],
222       ac_cv_sys_largefile_CC,
223       [ac_cv_sys_largefile_CC=no
224        if test "$GCC" != yes; then
225	  # IRIX 6.2 and later do not support large files by default,
226	  # so use the C compiler's -n32 option if that helps.
227	  AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
228	    [ac_save_CC="$CC"
229	     CC="$CC -n32"
230	     AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
231	       ac_cv_sys_largefile_CC=' -n32')
232	     CC="$ac_save_CC"])
233        fi])
234     if test "$ac_cv_sys_largefile_CC" != no; then
235       CC="$CC$ac_cv_sys_largefile_CC"
236     fi
237
238     AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
239       ac_cv_sys_file_offset_bits,
240       [Number of bits in a file offset, on hosts where this is settable.],
241       AC_SYS_LARGEFILE_TEST_INCLUDES)
242     AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
243       ac_cv_sys_large_files,
244       [Define for large files, on AIX-style hosts.],
245       AC_SYS_LARGEFILE_TEST_INCLUDES)
246   fi
247  ])
248
249AC_DEFUN([AC_FUNC_FSEEKO],
250  [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
251     ac_cv_sys_largefile_source,
252     [Define to make fseeko visible on some hosts (e.g. glibc 2.2).],
253     [#include <stdio.h>], [return !fseeko;])
254   # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
255   # in glibc 2.1.3, but that breaks too many other things.
256   # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
257
258   AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko,
259     [ac_cv_func_fseeko=no
260      AC_TRY_LINK([#include <stdio.h>],
261        [return fseeko && fseeko (stdin, 0, 0);],
262	[ac_cv_func_fseeko=yes])])
263   if test $ac_cv_func_fseeko != no; then
264     AC_DEFINE(HAVE_FSEEKO, 1,
265       [Define if fseeko (and presumably ftello) exists and is declared.])
266   fi])
267
268# serial 9
269
270# From Paul Eggert.
271
272# BeOS 5 has <wchar.h> but does not define mbstate_t,
273# so you can't declare an object of that type.
274# Check for this incompatibility with Standard C.
275
276# Include stdlib.h first, because otherwise this test would fail on Linux
277# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
278# a syntax error in wchar.h due to the use of undefined __int32_t.
279AC_DEFUN([AC_MBSTATE_T],
280  [
281   AC_CHECK_HEADERS(stdlib.h)
282
283   AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
284    [AC_TRY_COMPILE([
285#if HAVE_STDLIB_H
286# include <stdlib.h>
287#endif
288#include <wchar.h>],
289      [mbstate_t x; return sizeof x;],
290      ac_cv_type_mbstate_t=yes,
291      ac_cv_type_mbstate_t=no)])
292   if test $ac_cv_type_mbstate_t = no; then
293     AC_DEFINE(mbstate_t, int,
294               [Define to a type if <wchar.h> does not define.])
295   fi])
296
297
298
299# Do all the work for Automake.                            -*- Autoconf -*-
300
301# This macro actually does too much some checks are only needed if
302# your package does certain things.  But this isn't really a big deal.
303
304# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
305# Free Software Foundation, Inc.
306
307# This program is free software; you can redistribute it and/or modify
308# it under the terms of the GNU General Public License as published by
309# the Free Software Foundation; either version 2, or (at your option)
310# any later version.
311
312# This program is distributed in the hope that it will be useful,
313# but WITHOUT ANY WARRANTY; without even the implied warranty of
314# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
315# GNU General Public License for more details.
316
317# You should have received a copy of the GNU General Public License
318# along with this program; if not, write to the Free Software
319# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
320# 02111-1307, USA.
321
322# serial 8
323
324# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
325# written in clear, in which case automake, when reading aclocal.m4,
326# will think it sees a *use*, and therefore will trigger all it's
327# C support machinery.  Also note that it means that autoscan, seeing
328# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
329
330
331AC_PREREQ([2.52])
332
333# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
334# the ones we care about.
335m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
336
337# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
338# AM_INIT_AUTOMAKE([OPTIONS])
339# -----------------------------------------------
340# The call with PACKAGE and VERSION arguments is the old style
341# call (pre autoconf-2.50), which is being phased out.  PACKAGE
342# and VERSION should now be passed to AC_INIT and removed from
343# the call to AM_INIT_AUTOMAKE.
344# We support both call styles for the transition.  After
345# the next Automake release, Autoconf can make the AC_INIT
346# arguments mandatory, and then we can depend on a new Autoconf
347# release and drop the old call support.
348AC_DEFUN([AM_INIT_AUTOMAKE],
349[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
350 AC_REQUIRE([AC_PROG_INSTALL])dnl
351# test to see if srcdir already configured
352if test "`cd $srcdir && pwd`" != "`pwd`" &&
353   test -f $srcdir/config.status; then
354  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
355fi
356
357# Define the identity of the package.
358dnl Distinguish between old-style and new-style calls.
359m4_ifval([$2],
360[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
361 AC_SUBST([PACKAGE], [$1])dnl
362 AC_SUBST([VERSION], [$2])],
363[_AM_SET_OPTIONS([$1])dnl
364 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
365 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
366
367_AM_IF_OPTION([no-define],,
368[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
369 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
370
371# Some tools Automake needs.
372AC_REQUIRE([AM_SANITY_CHECK])dnl
373AC_REQUIRE([AC_ARG_PROGRAM])dnl
374AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
375AM_MISSING_PROG(AUTOCONF, autoconf)
376AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
377AM_MISSING_PROG(AUTOHEADER, autoheader)
378AM_MISSING_PROG(MAKEINFO, makeinfo)
379AM_MISSING_PROG(AMTAR, tar)
380AM_PROG_INSTALL_SH
381AM_PROG_INSTALL_STRIP
382# We need awk for the "check" target.  The system "awk" is bad on
383# some platforms.
384AC_REQUIRE([AC_PROG_AWK])dnl
385AC_REQUIRE([AC_PROG_MAKE_SET])dnl
386
387_AM_IF_OPTION([no-dependencies],,
388[AC_PROVIDE_IFELSE([AC_PROG_][CC],
389                  [_AM_DEPENDENCIES(CC)],
390                  [define([AC_PROG_][CC],
391                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
392AC_PROVIDE_IFELSE([AC_PROG_][CXX],
393                  [_AM_DEPENDENCIES(CXX)],
394                  [define([AC_PROG_][CXX],
395                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
396])
397])
398
399# Copyright 2002  Free Software Foundation, Inc.
400
401# This program is free software; you can redistribute it and/or modify
402# it under the terms of the GNU General Public License as published by
403# the Free Software Foundation; either version 2, or (at your option)
404# any later version.
405
406# This program is distributed in the hope that it will be useful,
407# but WITHOUT ANY WARRANTY; without even the implied warranty of
408# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
409# GNU General Public License for more details.
410
411# You should have received a copy of the GNU General Public License
412# along with this program; if not, write to the Free Software
413# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
414
415# AM_AUTOMAKE_VERSION(VERSION)
416# ----------------------------
417# Automake X.Y traces this macro to ensure aclocal.m4 has been
418# generated from the m4 files accompanying Automake X.Y.
419AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
420
421# AM_SET_CURRENT_AUTOMAKE_VERSION
422# -------------------------------
423# Call AM_AUTOMAKE_VERSION so it can be traced.
424# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
425AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
426	 [AM_AUTOMAKE_VERSION([1.6.3])])
427
428# Helper functions for option handling.                    -*- Autoconf -*-
429
430# Copyright 2001, 2002  Free Software Foundation, Inc.
431
432# This program is free software; you can redistribute it and/or modify
433# it under the terms of the GNU General Public License as published by
434# the Free Software Foundation; either version 2, or (at your option)
435# any later version.
436
437# This program is distributed in the hope that it will be useful,
438# but WITHOUT ANY WARRANTY; without even the implied warranty of
439# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
440# GNU General Public License for more details.
441
442# You should have received a copy of the GNU General Public License
443# along with this program; if not, write to the Free Software
444# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
445# 02111-1307, USA.
446
447# serial 2
448
449# _AM_MANGLE_OPTION(NAME)
450# -----------------------
451AC_DEFUN([_AM_MANGLE_OPTION],
452[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
453
454# _AM_SET_OPTION(NAME)
455# ------------------------------
456# Set option NAME.  Presently that only means defining a flag for this option.
457AC_DEFUN([_AM_SET_OPTION],
458[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
459
460# _AM_SET_OPTIONS(OPTIONS)
461# ----------------------------------
462# OPTIONS is a space-separated list of Automake options.
463AC_DEFUN([_AM_SET_OPTIONS],
464[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
465
466# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
467# -------------------------------------------
468# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
469AC_DEFUN([_AM_IF_OPTION],
470[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
471
472#
473# Check to make sure that the build environment is sane.
474#
475
476# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
477
478# This program is free software; you can redistribute it and/or modify
479# it under the terms of the GNU General Public License as published by
480# the Free Software Foundation; either version 2, or (at your option)
481# any later version.
482
483# This program is distributed in the hope that it will be useful,
484# but WITHOUT ANY WARRANTY; without even the implied warranty of
485# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
486# GNU General Public License for more details.
487
488# You should have received a copy of the GNU General Public License
489# along with this program; if not, write to the Free Software
490# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
491# 02111-1307, USA.
492
493# serial 3
494
495# AM_SANITY_CHECK
496# ---------------
497AC_DEFUN([AM_SANITY_CHECK],
498[AC_MSG_CHECKING([whether build environment is sane])
499# Just in case
500sleep 1
501echo timestamp > conftest.file
502# Do `set' in a subshell so we don't clobber the current shell's
503# arguments.  Must try -L first in case configure is actually a
504# symlink; some systems play weird games with the mod time of symlinks
505# (eg FreeBSD returns the mod time of the symlink's containing
506# directory).
507if (
508   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
509   if test "$[*]" = "X"; then
510      # -L didn't work.
511      set X `ls -t $srcdir/configure conftest.file`
512   fi
513   rm -f conftest.file
514   if test "$[*]" != "X $srcdir/configure conftest.file" \
515      && test "$[*]" != "X conftest.file $srcdir/configure"; then
516
517      # If neither matched, then we have a broken ls.  This can happen
518      # if, for instance, CONFIG_SHELL is bash and it inherits a
519      # broken ls alias from the environment.  This has actually
520      # happened.  Such a system could not be considered "sane".
521      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
522alias in your environment])
523   fi
524
525   test "$[2]" = conftest.file
526   )
527then
528   # Ok.
529   :
530else
531   AC_MSG_ERROR([newly created file is older than distributed files!
532Check your system clock])
533fi
534AC_MSG_RESULT(yes)])
535
536#  -*- Autoconf -*-
537
538
539# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
540
541# This program is free software; you can redistribute it and/or modify
542# it under the terms of the GNU General Public License as published by
543# the Free Software Foundation; either version 2, or (at your option)
544# any later version.
545
546# This program is distributed in the hope that it will be useful,
547# but WITHOUT ANY WARRANTY; without even the implied warranty of
548# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
549# GNU General Public License for more details.
550
551# You should have received a copy of the GNU General Public License
552# along with this program; if not, write to the Free Software
553# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
554# 02111-1307, USA.
555
556# serial 3
557
558# AM_MISSING_PROG(NAME, PROGRAM)
559# ------------------------------
560AC_DEFUN([AM_MISSING_PROG],
561[AC_REQUIRE([AM_MISSING_HAS_RUN])
562$1=${$1-"${am_missing_run}$2"}
563AC_SUBST($1)])
564
565
566# AM_MISSING_HAS_RUN
567# ------------------
568# Define MISSING if not defined so far and test if it supports --run.
569# If it does, set am_missing_run to use it, otherwise, to nothing.
570AC_DEFUN([AM_MISSING_HAS_RUN],
571[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
572test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
573# Use eval to expand $SHELL
574if eval "$MISSING --run true"; then
575  am_missing_run="$MISSING --run "
576else
577  am_missing_run=
578  AC_MSG_WARN([`missing' script is too old or missing])
579fi
580])
581
582# AM_AUX_DIR_EXPAND
583
584# Copyright 2001 Free Software Foundation, Inc.
585
586# This program is free software; you can redistribute it and/or modify
587# it under the terms of the GNU General Public License as published by
588# the Free Software Foundation; either version 2, or (at your option)
589# any later version.
590
591# This program is distributed in the hope that it will be useful,
592# but WITHOUT ANY WARRANTY; without even the implied warranty of
593# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
594# GNU General Public License for more details.
595
596# You should have received a copy of the GNU General Public License
597# along with this program; if not, write to the Free Software
598# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
599# 02111-1307, USA.
600
601# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
602# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
603# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
604#
605# Of course, Automake must honor this variable whenever it calls a
606# tool from the auxiliary directory.  The problem is that $srcdir (and
607# therefore $ac_aux_dir as well) can be either absolute or relative,
608# depending on how configure is run.  This is pretty annoying, since
609# it makes $ac_aux_dir quite unusable in subdirectories: in the top
610# source directory, any form will work fine, but in subdirectories a
611# relative path needs to be adjusted first.
612#
613# $ac_aux_dir/missing
614#    fails when called from a subdirectory if $ac_aux_dir is relative
615# $top_srcdir/$ac_aux_dir/missing
616#    fails if $ac_aux_dir is absolute,
617#    fails when called from a subdirectory in a VPATH build with
618#          a relative $ac_aux_dir
619#
620# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
621# are both prefixed by $srcdir.  In an in-source build this is usually
622# harmless because $srcdir is `.', but things will broke when you
623# start a VPATH build or use an absolute $srcdir.
624#
625# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
626# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
627#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
628# and then we would define $MISSING as
629#   MISSING="\${SHELL} $am_aux_dir/missing"
630# This will work as long as MISSING is not called from configure, because
631# unfortunately $(top_srcdir) has no meaning in configure.
632# However there are other variables, like CC, which are often used in
633# configure, and could therefore not use this "fixed" $ac_aux_dir.
634#
635# Another solution, used here, is to always expand $ac_aux_dir to an
636# absolute PATH.  The drawback is that using absolute paths prevent a
637# configured tree to be moved without reconfiguration.
638
639# Rely on autoconf to set up CDPATH properly.
640AC_PREREQ([2.50])
641
642AC_DEFUN([AM_AUX_DIR_EXPAND], [
643# expand $ac_aux_dir to an absolute path
644am_aux_dir=`cd $ac_aux_dir && pwd`
645])
646
647# AM_PROG_INSTALL_SH
648# ------------------
649# Define $install_sh.
650
651# Copyright 2001 Free Software Foundation, Inc.
652
653# This program is free software; you can redistribute it and/or modify
654# it under the terms of the GNU General Public License as published by
655# the Free Software Foundation; either version 2, or (at your option)
656# any later version.
657
658# This program is distributed in the hope that it will be useful,
659# but WITHOUT ANY WARRANTY; without even the implied warranty of
660# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
661# GNU General Public License for more details.
662
663# You should have received a copy of the GNU General Public License
664# along with this program; if not, write to the Free Software
665# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
666# 02111-1307, USA.
667
668AC_DEFUN([AM_PROG_INSTALL_SH],
669[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
670install_sh=${install_sh-"$am_aux_dir/install-sh"}
671AC_SUBST(install_sh)])
672
673# AM_PROG_INSTALL_STRIP
674
675# Copyright 2001 Free Software Foundation, Inc.
676
677# This program is free software; you can redistribute it and/or modify
678# it under the terms of the GNU General Public License as published by
679# the Free Software Foundation; either version 2, or (at your option)
680# any later version.
681
682# This program is distributed in the hope that it will be useful,
683# but WITHOUT ANY WARRANTY; without even the implied warranty of
684# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
685# GNU General Public License for more details.
686
687# You should have received a copy of the GNU General Public License
688# along with this program; if not, write to the Free Software
689# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
690# 02111-1307, USA.
691
692# One issue with vendor `install' (even GNU) is that you can't
693# specify the program used to strip binaries.  This is especially
694# annoying in cross-compiling environments, where the build's strip
695# is unlikely to handle the host's binaries.
696# Fortunately install-sh will honor a STRIPPROG variable, so we
697# always use install-sh in `make install-strip', and initialize
698# STRIPPROG with the value of the STRIP variable (set by the user).
699AC_DEFUN([AM_PROG_INSTALL_STRIP],
700[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
701# Installed binaries are usually stripped using `strip' when the user
702# run `make install-strip'.  However `strip' might not be the right
703# tool to use in cross-compilation environments, therefore Automake
704# will honor the `STRIP' environment variable to overrule this program.
705dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
706if test "$cross_compiling" != no; then
707  AC_CHECK_TOOL([STRIP], [strip], :)
708fi
709INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
710AC_SUBST([INSTALL_STRIP_PROGRAM])])
711
712# serial 4						-*- Autoconf -*-
713
714# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
715
716# This program is free software; you can redistribute it and/or modify
717# it under the terms of the GNU General Public License as published by
718# the Free Software Foundation; either version 2, or (at your option)
719# any later version.
720
721# This program is distributed in the hope that it will be useful,
722# but WITHOUT ANY WARRANTY; without even the implied warranty of
723# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
724# GNU General Public License for more details.
725
726# You should have received a copy of the GNU General Public License
727# along with this program; if not, write to the Free Software
728# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
729# 02111-1307, USA.
730
731
732# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
733# written in clear, in which case automake, when reading aclocal.m4,
734# will think it sees a *use*, and therefore will trigger all it's
735# C support machinery.  Also note that it means that autoscan, seeing
736# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
737
738
739
740# _AM_DEPENDENCIES(NAME)
741# ----------------------
742# See how the compiler implements dependency checking.
743# NAME is "CC", "CXX", "GCJ", or "OBJC".
744# We try a few techniques and use that to set a single cache variable.
745#
746# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
747# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
748# dependency, and given that the user is not expected to run this macro,
749# just rely on AC_PROG_CC.
750AC_DEFUN([_AM_DEPENDENCIES],
751[AC_REQUIRE([AM_SET_DEPDIR])dnl
752AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
753AC_REQUIRE([AM_MAKE_INCLUDE])dnl
754AC_REQUIRE([AM_DEP_TRACK])dnl
755
756ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
757       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
758       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
759       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
760                   [depcc="$$1"   am_compiler_list=])
761
762AC_CACHE_CHECK([dependency style of $depcc],
763               [am_cv_$1_dependencies_compiler_type],
764[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
765  # We make a subdir and do the tests there.  Otherwise we can end up
766  # making bogus files that we don't know about and never remove.  For
767  # instance it was reported that on HP-UX the gcc test will end up
768  # making a dummy file named `D' -- because `-MD' means `put the output
769  # in D'.
770  mkdir conftest.dir
771  # Copy depcomp to subdir because otherwise we won't find it if we're
772  # using a relative directory.
773  cp "$am_depcomp" conftest.dir
774  cd conftest.dir
775
776  am_cv_$1_dependencies_compiler_type=none
777  if test "$am_compiler_list" = ""; then
778     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
779  fi
780  for depmode in $am_compiler_list; do
781    # We need to recreate these files for each test, as the compiler may
782    # overwrite some of them when testing with obscure command lines.
783    # This happens at least with the AIX C compiler.
784    echo '#include "conftest.h"' > conftest.c
785    echo 'int i;' > conftest.h
786    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
787
788    case $depmode in
789    nosideeffect)
790      # after this tag, mechanisms are not by side-effect, so they'll
791      # only be used when explicitly requested
792      if test "x$enable_dependency_tracking" = xyes; then
793	continue
794      else
795	break
796      fi
797      ;;
798    none) break ;;
799    esac
800    # We check with `-c' and `-o' for the sake of the "dashmstdout"
801    # mode.  It turns out that the SunPro C++ compiler does not properly
802    # handle `-M -o', and we need to detect this.
803    if depmode=$depmode \
804       source=conftest.c object=conftest.o \
805       depfile=conftest.Po tmpdepfile=conftest.TPo \
806       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
807       grep conftest.h conftest.Po > /dev/null 2>&1 &&
808       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
809      am_cv_$1_dependencies_compiler_type=$depmode
810      break
811    fi
812  done
813
814  cd ..
815  rm -rf conftest.dir
816else
817  am_cv_$1_dependencies_compiler_type=none
818fi
819])
820AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
821])
822
823
824# AM_SET_DEPDIR
825# -------------
826# Choose a directory name for dependency files.
827# This macro is AC_REQUIREd in _AM_DEPENDENCIES
828AC_DEFUN([AM_SET_DEPDIR],
829[rm -f .deps 2>/dev/null
830mkdir .deps 2>/dev/null
831if test -d .deps; then
832  DEPDIR=.deps
833else
834  # MS-DOS does not allow filenames that begin with a dot.
835  DEPDIR=_deps
836fi
837rmdir .deps 2>/dev/null
838AC_SUBST([DEPDIR])
839])
840
841
842# AM_DEP_TRACK
843# ------------
844AC_DEFUN([AM_DEP_TRACK],
845[AC_ARG_ENABLE(dependency-tracking,
846[  --disable-dependency-tracking Speeds up one-time builds
847  --enable-dependency-tracking  Do not reject slow dependency extractors])
848if test "x$enable_dependency_tracking" != xno; then
849  am_depcomp="$ac_aux_dir/depcomp"
850  AMDEPBACKSLASH='\'
851fi
852AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
853AC_SUBST([AMDEPBACKSLASH])
854])
855
856# Generate code to set up dependency tracking.   -*- Autoconf -*-
857
858# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
859
860# This program is free software; you can redistribute it and/or modify
861# it under the terms of the GNU General Public License as published by
862# the Free Software Foundation; either version 2, or (at your option)
863# any later version.
864
865# This program is distributed in the hope that it will be useful,
866# but WITHOUT ANY WARRANTY; without even the implied warranty of
867# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
868# GNU General Public License for more details.
869
870# You should have received a copy of the GNU General Public License
871# along with this program; if not, write to the Free Software
872# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
873# 02111-1307, USA.
874
875#serial 2
876
877# _AM_OUTPUT_DEPENDENCY_COMMANDS
878# ------------------------------
879AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
880[for mf in $CONFIG_FILES; do
881  # Strip MF so we end up with the name of the file.
882  mf=`echo "$mf" | sed -e 's/:.*$//'`
883  # Check whether this is an Automake generated Makefile or not.
884  # We used to match only the files named `Makefile.in', but
885  # some people rename them; so instead we look at the file content.
886  # Grep'ing the first line is not enough: some people post-process
887  # each Makefile.in and add a new line on top of each file to say so.
888  # So let's grep whole file.
889  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
890    dirpart=`AS_DIRNAME("$mf")`
891  else
892    continue
893  fi
894  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
895  # Extract the definition of DEP_FILES from the Makefile without
896  # running `make'.
897  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
898  test -z "$DEPDIR" && continue
899  # When using ansi2knr, U may be empty or an underscore; expand it
900  U=`sed -n -e '/^U = / s///p' < "$mf"`
901  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
902  # We invoke sed twice because it is the simplest approach to
903  # changing $(DEPDIR) to its actual value in the expansion.
904  for file in `sed -n -e '
905    /^DEP_FILES = .*\\\\$/ {
906      s/^DEP_FILES = //
907      :loop
908	s/\\\\$//
909	p
910	n
911	/\\\\$/ b loop
912      p
913    }
914    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
915       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
916    # Make sure the directory exists.
917    test -f "$dirpart/$file" && continue
918    fdir=`AS_DIRNAME(["$file"])`
919    AS_MKDIR_P([$dirpart/$fdir])
920    # echo "creating $dirpart/$file"
921    echo '# dummy' > "$dirpart/$file"
922  done
923done
924])# _AM_OUTPUT_DEPENDENCY_COMMANDS
925
926
927# AM_OUTPUT_DEPENDENCY_COMMANDS
928# -----------------------------
929# This macro should only be invoked once -- use via AC_REQUIRE.
930#
931# This code is only required when automatic dependency tracking
932# is enabled.  FIXME.  This creates each `.P' file that we will
933# need in order to bootstrap the dependency handling code.
934AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
935[AC_CONFIG_COMMANDS([depfiles],
936     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
937     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
938])
939
940# Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
941
942# This program is free software; you can redistribute it and/or modify
943# it under the terms of the GNU General Public License as published by
944# the Free Software Foundation; either version 2, or (at your option)
945# any later version.
946
947# This program is distributed in the hope that it will be useful,
948# but WITHOUT ANY WARRANTY; without even the implied warranty of
949# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
950# GNU General Public License for more details.
951
952# You should have received a copy of the GNU General Public License
953# along with this program; if not, write to the Free Software
954# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
955# 02111-1307, USA.
956
957# serial 2
958
959# AM_MAKE_INCLUDE()
960# -----------------
961# Check to see how make treats includes.
962AC_DEFUN([AM_MAKE_INCLUDE],
963[am_make=${MAKE-make}
964cat > confinc << 'END'
965doit:
966	@echo done
967END
968# If we don't find an include directive, just comment out the code.
969AC_MSG_CHECKING([for style of include used by $am_make])
970am__include="#"
971am__quote=
972_am_result=none
973# First try GNU make style include.
974echo "include confinc" > confmf
975# We grep out `Entering directory' and `Leaving directory'
976# messages which can occur if `w' ends up in MAKEFLAGS.
977# In particular we don't look at `^make:' because GNU make might
978# be invoked under some other name (usually "gmake"), in which
979# case it prints its new name instead of `make'.
980if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
981   am__include=include
982   am__quote=
983   _am_result=GNU
984fi
985# Now try BSD make style include.
986if test "$am__include" = "#"; then
987   echo '.include "confinc"' > confmf
988   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
989      am__include=.include
990      am__quote="\""
991      _am_result=BSD
992   fi
993fi
994AC_SUBST(am__include)
995AC_SUBST(am__quote)
996AC_MSG_RESULT($_am_result)
997rm -f confinc confmf
998])
999
1000# AM_CONDITIONAL                                              -*- Autoconf -*-
1001
1002# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
1003
1004# This program is free software; you can redistribute it and/or modify
1005# it under the terms of the GNU General Public License as published by
1006# the Free Software Foundation; either version 2, or (at your option)
1007# any later version.
1008
1009# This program is distributed in the hope that it will be useful,
1010# but WITHOUT ANY WARRANTY; without even the implied warranty of
1011# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1012# GNU General Public License for more details.
1013
1014# You should have received a copy of the GNU General Public License
1015# along with this program; if not, write to the Free Software
1016# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1017# 02111-1307, USA.
1018
1019# serial 5
1020
1021AC_PREREQ(2.52)
1022
1023# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1024# -------------------------------------
1025# Define a conditional.
1026AC_DEFUN([AM_CONDITIONAL],
1027[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1028        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1029AC_SUBST([$1_TRUE])
1030AC_SUBST([$1_FALSE])
1031if $2; then
1032  $1_TRUE=
1033  $1_FALSE='#'
1034else
1035  $1_TRUE='#'
1036  $1_FALSE=
1037fi
1038AC_CONFIG_COMMANDS_PRE(
1039[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1040  AC_MSG_ERROR([conditional \"$1\" was never defined.
1041Usually this means the macro was only invoked conditionally.])
1042fi])])
1043
1044# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
1045
1046# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
1047
1048# This program is free software; you can redistribute it and/or modify
1049# it under the terms of the GNU General Public License as published by
1050# the Free Software Foundation; either version 2, or (at your option)
1051# any later version.
1052
1053# This program is distributed in the hope that it will be useful,
1054# but WITHOUT ANY WARRANTY; without even the implied warranty of
1055# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1056# GNU General Public License for more details.
1057
1058# You should have received a copy of the GNU General Public License
1059# along with this program; if not, write to the Free Software
1060# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1061# 02111-1307, USA.
1062
1063AC_PREREQ([2.52])
1064
1065# serial 6
1066
1067# When config.status generates a header, we must update the stamp-h file.
1068# This file resides in the same directory as the config header
1069# that is generated.  We must strip everything past the first ":",
1070# and everything past the last "/".
1071
1072# _AM_DIRNAME(PATH)
1073# -----------------
1074# Like AS_DIRNAME, only do it during macro expansion
1075AC_DEFUN([_AM_DIRNAME],
1076       [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
1077	      m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
1078		    m4_if(regexp([$1], [^/.*]), -1,
1079			  [.],
1080			  patsubst([$1], [^\(/\).*], [\1])),
1081		    patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
1082	      patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
1083])# _AM_DIRNAME
1084
1085
1086# The stamp files are numbered to have different names.
1087# We could number them on a directory basis, but that's additional
1088# complications, let's have a unique counter.
1089m4_define([_AM_STAMP_Count], [0])
1090
1091
1092# _AM_STAMP(HEADER)
1093# -----------------
1094# The name of the stamp file for HEADER.
1095AC_DEFUN([_AM_STAMP],
1096[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
1097AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
1098                               [:.*])))/stamp-h[]_AM_STAMP_Count])
1099
1100
1101# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
1102# ------------------------------------------------------------
1103# We used to try to get a real timestamp in stamp-h.  But the fear is that
1104# that will cause unnecessary cvs conflicts.
1105AC_DEFUN([_AM_CONFIG_HEADER],
1106[# Add the stamp file to the list of files AC keeps track of,
1107# along with our hook.
1108AC_CONFIG_HEADERS([$1],
1109                  [# update the timestamp
1110echo 'timestamp for $1' >"_AM_STAMP([$1])"
1111$2],
1112                  [$3])
1113])# _AM_CONFIG_HEADER
1114
1115
1116# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
1117# --------------------------------------------------------------
1118AC_DEFUN([AM_CONFIG_HEADER],
1119[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
1120])# AM_CONFIG_HEADER
1121
1122# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
1123
1124# serial 46 AC_PROG_LIBTOOL
1125
1126AC_DEFUN([AC_PROG_LIBTOOL],
1127[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1128
1129# This can be used to rebuild libtool when needed
1130LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
1131
1132# Always use our own libtool.
1133LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1134AC_SUBST(LIBTOOL)dnl
1135
1136# Prevent multiple expansion
1137define([AC_PROG_LIBTOOL], [])
1138])
1139
1140AC_DEFUN([AC_LIBTOOL_SETUP],
1141[AC_PREREQ(2.13)dnl
1142AC_REQUIRE([AC_ENABLE_SHARED])dnl
1143AC_REQUIRE([AC_ENABLE_STATIC])dnl
1144AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1145AC_REQUIRE([AC_CANONICAL_HOST])dnl
1146AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1147AC_REQUIRE([AC_PROG_CC])dnl
1148AC_REQUIRE([AC_PROG_LD])dnl
1149AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
1150AC_REQUIRE([AC_PROG_NM])dnl
1151AC_REQUIRE([AC_PROG_LN_S])dnl
1152AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1153AC_REQUIRE([AC_OBJEXT])dnl
1154AC_REQUIRE([AC_EXEEXT])dnl
1155dnl
1156
1157_LT_AC_PROG_ECHO_BACKSLASH
1158# Only perform the check for file, if the check method requires it
1159case $deplibs_check_method in
1160file_magic*)
1161  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1162    AC_PATH_MAGIC
1163  fi
1164  ;;
1165esac
1166
1167AC_CHECK_TOOL(RANLIB, ranlib, :)
1168AC_CHECK_TOOL(STRIP, strip, :)
1169
1170ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
1171ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1172enable_win32_dll=yes, enable_win32_dll=no)
1173
1174AC_ARG_ENABLE(libtool-lock,
1175  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
1176test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1177
1178# Some flags need to be propagated to the compiler or linker for good
1179# libtool support.
1180case $host in
1181*-*-irix6*)
1182  # Find out which ABI we are using.
1183  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1184  if AC_TRY_EVAL(ac_compile); then
1185    case `/usr/bin/file conftest.$ac_objext` in
1186    *32-bit*)
1187      LD="${LD-ld} -32"
1188      ;;
1189    *N32*)
1190      LD="${LD-ld} -n32"
1191      ;;
1192    *64-bit*)
1193      LD="${LD-ld} -64"
1194      ;;
1195    esac
1196  fi
1197  rm -rf conftest*
1198  ;;
1199
1200*-*-sco3.2v5*)
1201  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1202  SAVE_CFLAGS="$CFLAGS"
1203  CFLAGS="$CFLAGS -belf"
1204  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1205    [AC_LANG_SAVE
1206     AC_LANG_C
1207     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1208     AC_LANG_RESTORE])
1209  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1210    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1211    CFLAGS="$SAVE_CFLAGS"
1212  fi
1213  ;;
1214
1215ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1216[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1217  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1218  AC_CHECK_TOOL(AS, as, false)
1219  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1220
1221  # recent cygwin and mingw systems supply a stub DllMain which the user
1222  # can override, but on older systems we have to supply one
1223  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1224    [AC_TRY_LINK([],
1225      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1226      DllMain (0, 0, 0);],
1227      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
1228
1229  case $host/$CC in
1230  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1231    # old mingw systems require "-dll" to link a DLL, while more recent ones
1232    # require "-mdll"
1233    SAVE_CFLAGS="$CFLAGS"
1234    CFLAGS="$CFLAGS -mdll"
1235    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1236      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1237    CFLAGS="$SAVE_CFLAGS" ;;
1238  *-*-cygwin* | *-*-pw32*)
1239    # cygwin systems need to pass --dll to the linker, and not link
1240    # crt.o which will require a WinMain@16 definition.
1241    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
1242  esac
1243  ;;
1244  ])
1245esac
1246
1247_LT_AC_LTCONFIG_HACK
1248
1249])
1250
1251# AC_LIBTOOL_HEADER_ASSERT
1252# ------------------------
1253AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
1254[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
1255    [lt_cv_func_assert_works],
1256    [case $host in
1257    *-*-solaris*)
1258      if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
1259        case `$CC --version 2>/dev/null` in
1260        [[12]].*) lt_cv_func_assert_works=no ;;
1261        *)        lt_cv_func_assert_works=yes ;;
1262        esac
1263      fi
1264      ;;
1265    esac])
1266
1267if test "x$lt_cv_func_assert_works" = xyes; then
1268  AC_CHECK_HEADERS(assert.h)
1269fi
1270])# AC_LIBTOOL_HEADER_ASSERT
1271
1272# _LT_AC_CHECK_DLFCN
1273# --------------------
1274AC_DEFUN([_LT_AC_CHECK_DLFCN],
1275[AC_CHECK_HEADERS(dlfcn.h)
1276])# _LT_AC_CHECK_DLFCN
1277
1278# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1279# ---------------------------------
1280AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
1281[AC_REQUIRE([AC_CANONICAL_HOST])
1282AC_REQUIRE([AC_PROG_NM])
1283AC_REQUIRE([AC_OBJEXT])
1284# Check for command to grab the raw symbol name followed by C symbol from nm.
1285AC_MSG_CHECKING([command to parse $NM output])
1286AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
1287
1288# These are sane defaults that work on at least a few old systems.
1289# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
1290
1291# Character class describing NM global symbol codes.
1292symcode='[[BCDEGRST]]'
1293
1294# Regexp to match symbols that can be accessed directly from C.
1295sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
1296
1297# Transform the above into a raw symbol and a C symbol.
1298symxfrm='\1 \2\3 \3'
1299
1300# Transform an extracted symbol line into a proper C declaration
1301lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1302
1303# Transform an extracted symbol line into symbol name and symbol address
1304lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
1305
1306# Define system-specific variables.
1307case $host_os in
1308aix*)
1309  symcode='[[BCDT]]'
1310  ;;
1311cygwin* | mingw* | pw32*)
1312  symcode='[[ABCDGISTW]]'
1313  ;;
1314hpux*) # Its linker distinguishes data from code symbols
1315  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
1316  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
1317  ;;
1318irix*)
1319  symcode='[[BCDEGRST]]'
1320  ;;
1321solaris* | sysv5*)
1322  symcode='[[BDT]]'
1323  ;;
1324sysv4)
1325  symcode='[[DFNSTU]]'
1326  ;;
1327esac
1328
1329# Handle CRLF in mingw tool chain
1330opt_cr=
1331case $host_os in
1332mingw*)
1333  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1334  ;;
1335esac
1336
1337# If we're using GNU nm, then use its standard symbol codes.
1338if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1339  symcode='[[ABCDGISTW]]'
1340fi
1341
1342# Try without a prefix undercore, then with it.
1343for ac_symprfx in "" "_"; do
1344
1345  # Write the raw and C identifiers.
1346lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1347
1348  # Check to see that the pipe works correctly.
1349  pipe_works=no
1350  rm -f conftest*
1351  cat > conftest.$ac_ext <<EOF
1352#ifdef __cplusplus
1353extern "C" {
1354#endif
1355char nm_test_var;
1356void nm_test_func(){}
1357#ifdef __cplusplus
1358}
1359#endif
1360int main(){nm_test_var='a';nm_test_func();return(0);}
1361EOF
1362
1363  if AC_TRY_EVAL(ac_compile); then
1364    # Now try to grab the symbols.
1365    nlist=conftest.nm
1366    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
1367      # Try sorting and uniquifying the output.
1368      if sort "$nlist" | uniq > "$nlist"T; then
1369	mv -f "$nlist"T "$nlist"
1370      else
1371	rm -f "$nlist"T
1372      fi
1373
1374      # Make sure that we snagged all the symbols we need.
1375      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1376	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1377	  cat <<EOF > conftest.$ac_ext
1378#ifdef __cplusplus
1379extern "C" {
1380#endif
1381
1382EOF
1383	  # Now generate the symbol file.
1384	  eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
1385
1386	  cat <<EOF >> conftest.$ac_ext
1387#if defined (__STDC__) && __STDC__
1388# define lt_ptr void *
1389#else
1390# define lt_ptr char *
1391# define const
1392#endif
1393
1394/* The mapping between symbol names and symbols. */
1395const struct {
1396  const char *name;
1397  lt_ptr address;
1398}
1399lt_preloaded_symbols[[]] =
1400{
1401EOF
1402	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
1403	  cat <<\EOF >> conftest.$ac_ext
1404  {0, (lt_ptr) 0}
1405};
1406
1407#ifdef __cplusplus
1408}
1409#endif
1410EOF
1411	  # Now try linking the two files.
1412	  mv conftest.$ac_objext conftstm.$ac_objext
1413	  save_LIBS="$LIBS"
1414	  save_CFLAGS="$CFLAGS"
1415	  LIBS="conftstm.$ac_objext"
1416	  CFLAGS="$CFLAGS$no_builtin_flag"
1417	  if AC_TRY_EVAL(ac_link) && test -s conftest; then
1418	    pipe_works=yes
1419	  fi
1420	  LIBS="$save_LIBS"
1421	  CFLAGS="$save_CFLAGS"
1422	else
1423	  echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
1424	fi
1425      else
1426	echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
1427      fi
1428    else
1429      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
1430    fi
1431  else
1432    echo "$progname: failed program was:" >&AC_FD_CC
1433    cat conftest.$ac_ext >&5
1434  fi
1435  rm -f conftest* conftst*
1436
1437  # Do not use the global_symbol_pipe unless it works.
1438  if test "$pipe_works" = yes; then
1439    break
1440  else
1441    lt_cv_sys_global_symbol_pipe=
1442  fi
1443done
1444])
1445global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
1446if test -z "$lt_cv_sys_global_symbol_pipe"; then
1447  global_symbol_to_cdecl=
1448  global_symbol_to_c_name_address=
1449else
1450  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
1451  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
1452fi
1453if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
1454then
1455  AC_MSG_RESULT(failed)
1456else
1457  AC_MSG_RESULT(ok)
1458fi
1459]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1460
1461# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1462# ---------------------------------
1463AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
1464[# Find the correct PATH separator.  Usually this is `:', but
1465# DJGPP uses `;' like DOS.
1466if test "X${PATH_SEPARATOR+set}" != Xset; then
1467  UNAME=${UNAME-`uname 2>/dev/null`}
1468  case X$UNAME in
1469    *-DOS) lt_cv_sys_path_separator=';' ;;
1470    *)     lt_cv_sys_path_separator=':' ;;
1471  esac
1472  PATH_SEPARATOR=$lt_cv_sys_path_separator
1473fi
1474])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1475
1476# _LT_AC_PROG_ECHO_BACKSLASH
1477# --------------------------
1478# Add some code to the start of the generated configure script which
1479# will find an echo command which doesn't interpret backslashes.
1480AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
1481[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1482			      [AC_DIVERT_PUSH(NOTICE)])
1483_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1484
1485# Check that we are running under the correct shell.
1486SHELL=${CONFIG_SHELL-/bin/sh}
1487
1488case X$ECHO in
1489X*--fallback-echo)
1490  # Remove one level of quotation (which was required for Make).
1491  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1492  ;;
1493esac
1494
1495echo=${ECHO-echo}
1496if test "X[$]1" = X--no-reexec; then
1497  # Discard the --no-reexec flag, and continue.
1498  shift
1499elif test "X[$]1" = X--fallback-echo; then
1500  # Avoid inline document here, it may be left over
1501  :
1502elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
1503  # Yippee, $echo works!
1504  :
1505else
1506  # Restart under the correct shell.
1507  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1508fi
1509
1510if test "X[$]1" = X--fallback-echo; then
1511  # used as fallback echo
1512  shift
1513  cat <<EOF
1514$*
1515EOF
1516  exit 0
1517fi
1518
1519# The HP-UX ksh and POSIX shell print the target directory to stdout
1520# if CDPATH is set.
1521if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
1522
1523if test -z "$ECHO"; then
1524if test "X${echo_test_string+set}" != Xset; then
1525# find a string as large as possible, as long as the shell can cope with it
1526  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1527    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1528    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
1529       echo_test_string="`eval $cmd`" &&
1530       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
1531    then
1532      break
1533    fi
1534  done
1535fi
1536
1537if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1538   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1539   test "X$echo_testing_string" = "X$echo_test_string"; then
1540  :
1541else
1542  # The Solaris, AIX, and Digital Unix default echo programs unquote
1543  # backslashes.  This makes it impossible to quote backslashes using
1544  #   echo "$something" | sed 's/\\/\\\\/g'
1545  #
1546  # So, first we look for a working echo in the user's PATH.
1547
1548  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1549  for dir in $PATH /usr/ucb; do
1550    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1551       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1552       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1553       test "X$echo_testing_string" = "X$echo_test_string"; then
1554      echo="$dir/echo"
1555      break
1556    fi
1557  done
1558  IFS="$save_ifs"
1559
1560  if test "X$echo" = Xecho; then
1561    # We didn't find a better echo, so look for alternatives.
1562    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
1563       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
1564       test "X$echo_testing_string" = "X$echo_test_string"; then
1565      # This shell has a builtin print -r that does the trick.
1566      echo='print -r'
1567    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
1568	 test "X$CONFIG_SHELL" != X/bin/ksh; then
1569      # If we have ksh, try running configure again with it.
1570      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1571      export ORIGINAL_CONFIG_SHELL
1572      CONFIG_SHELL=/bin/ksh
1573      export CONFIG_SHELL
1574      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1575    else
1576      # Try using printf.
1577      echo='printf %s\n'
1578      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1579	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1580	 test "X$echo_testing_string" = "X$echo_test_string"; then
1581	# Cool, printf works
1582	:
1583      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1584	   test "X$echo_testing_string" = 'X\t' &&
1585	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1586	   test "X$echo_testing_string" = "X$echo_test_string"; then
1587	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1588	export CONFIG_SHELL
1589	SHELL="$CONFIG_SHELL"
1590	export SHELL
1591	echo="$CONFIG_SHELL [$]0 --fallback-echo"
1592      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1593	   test "X$echo_testing_string" = 'X\t' &&
1594	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1595	   test "X$echo_testing_string" = "X$echo_test_string"; then
1596	echo="$CONFIG_SHELL [$]0 --fallback-echo"
1597      else
1598	# maybe with a smaller string...
1599	prev=:
1600
1601	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1602	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
1603	  then
1604	    break
1605	  fi
1606	  prev="$cmd"
1607	done
1608
1609	if test "$prev" != 'sed 50q "[$]0"'; then
1610	  echo_test_string=`eval $prev`
1611	  export echo_test_string
1612	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1613	else
1614	  # Oops.  We lost completely, so just stick with echo.
1615	  echo=echo
1616	fi
1617      fi
1618    fi
1619  fi
1620fi
1621fi
1622
1623# Copy echo and quote the copy suitably for passing to libtool from
1624# the Makefile, instead of quoting the original, which is used later.
1625ECHO=$echo
1626if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1627   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1628fi
1629
1630AC_SUBST(ECHO)
1631AC_DIVERT_POP
1632])# _LT_AC_PROG_ECHO_BACKSLASH
1633
1634# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1635#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1636# ------------------------------------------------------------------
1637AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
1638[if test "$cross_compiling" = yes; then :
1639  [$4]
1640else
1641  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1642  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1643  lt_status=$lt_dlunknown
1644  cat > conftest.$ac_ext <<EOF
1645[#line __oline__ "configure"
1646#include "confdefs.h"
1647
1648#if HAVE_DLFCN_H
1649#include <dlfcn.h>
1650#endif
1651
1652#include <stdio.h>
1653
1654#ifdef RTLD_GLOBAL
1655#  define LT_DLGLOBAL		RTLD_GLOBAL
1656#else
1657#  ifdef DL_GLOBAL
1658#    define LT_DLGLOBAL		DL_GLOBAL
1659#  else
1660#    define LT_DLGLOBAL		0
1661#  endif
1662#endif
1663
1664/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1665   find out it does not work in some platform. */
1666#ifndef LT_DLLAZY_OR_NOW
1667#  ifdef RTLD_LAZY
1668#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1669#  else
1670#    ifdef DL_LAZY
1671#      define LT_DLLAZY_OR_NOW		DL_LAZY
1672#    else
1673#      ifdef RTLD_NOW
1674#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1675#      else
1676#        ifdef DL_NOW
1677#          define LT_DLLAZY_OR_NOW	DL_NOW
1678#        else
1679#          define LT_DLLAZY_OR_NOW	0
1680#        endif
1681#      endif
1682#    endif
1683#  endif
1684#endif
1685
1686#ifdef __cplusplus
1687extern "C" void exit (int);
1688#endif
1689
1690void fnord() { int i=42;}
1691int main ()
1692{
1693  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1694  int status = $lt_dlunknown;
1695
1696  if (self)
1697    {
1698      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1699      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1700      /* dlclose (self); */
1701    }
1702
1703    exit (status);
1704}]
1705EOF
1706  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1707    (./conftest; exit; ) 2>/dev/null
1708    lt_status=$?
1709    case x$lt_status in
1710      x$lt_dlno_uscore) $1 ;;
1711      x$lt_dlneed_uscore) $2 ;;
1712      x$lt_unknown|x*) $3 ;;
1713    esac
1714  else :
1715    # compilation failed
1716    $3
1717  fi
1718fi
1719rm -fr conftest*
1720])# _LT_AC_TRY_DLOPEN_SELF
1721
1722# AC_LIBTOOL_DLOPEN_SELF
1723# -------------------
1724AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
1725[if test "x$enable_dlopen" != xyes; then
1726  enable_dlopen=unknown
1727  enable_dlopen_self=unknown
1728  enable_dlopen_self_static=unknown
1729else
1730  lt_cv_dlopen=no
1731  lt_cv_dlopen_libs=
1732
1733  case $host_os in
1734  beos*)
1735    lt_cv_dlopen="load_add_on"
1736    lt_cv_dlopen_libs=
1737    lt_cv_dlopen_self=yes
1738    ;;
1739
1740  cygwin* | mingw* | pw32*)
1741    lt_cv_dlopen="LoadLibrary"
1742    lt_cv_dlopen_libs=
1743   ;;
1744
1745  *)
1746    AC_CHECK_FUNC([shl_load],
1747          [lt_cv_dlopen="shl_load"],
1748      [AC_CHECK_LIB([dld], [shl_load],
1749            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
1750	[AC_CHECK_FUNC([dlopen],
1751	      [lt_cv_dlopen="dlopen"],
1752	  [AC_CHECK_LIB([dl], [dlopen],
1753	        [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1754	    [AC_CHECK_LIB([svld], [dlopen],
1755	          [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1756	      [AC_CHECK_LIB([dld], [dld_link],
1757	            [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
1758	      ])
1759	    ])
1760	  ])
1761	])
1762      ])
1763    ;;
1764  esac
1765
1766  if test "x$lt_cv_dlopen" != xno; then
1767    enable_dlopen=yes
1768  else
1769    enable_dlopen=no
1770  fi
1771
1772  case $lt_cv_dlopen in
1773  dlopen)
1774    save_CPPFLAGS="$CPPFLAGS"
1775    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1776    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1777
1778    save_LDFLAGS="$LDFLAGS"
1779    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1780
1781    save_LIBS="$LIBS"
1782    LIBS="$lt_cv_dlopen_libs $LIBS"
1783
1784    AC_CACHE_CHECK([whether a program can dlopen itself],
1785	  lt_cv_dlopen_self, [dnl
1786	  _LT_AC_TRY_DLOPEN_SELF(
1787	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1788	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1789    ])
1790
1791    if test "x$lt_cv_dlopen_self" = xyes; then
1792      LDFLAGS="$LDFLAGS $link_static_flag"
1793      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1794    	  lt_cv_dlopen_self_static, [dnl
1795	  _LT_AC_TRY_DLOPEN_SELF(
1796	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1797	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1798      ])
1799    fi
1800
1801    CPPFLAGS="$save_CPPFLAGS"
1802    LDFLAGS="$save_LDFLAGS"
1803    LIBS="$save_LIBS"
1804    ;;
1805  esac
1806
1807  case $lt_cv_dlopen_self in
1808  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1809  *) enable_dlopen_self=unknown ;;
1810  esac
1811
1812  case $lt_cv_dlopen_self_static in
1813  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1814  *) enable_dlopen_self_static=unknown ;;
1815  esac
1816fi
1817])# AC_LIBTOOL_DLOPEN_SELF
1818
1819AC_DEFUN([_LT_AC_LTCONFIG_HACK],
1820[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
1821# Sed substitution that helps us do robust quoting.  It backslashifies
1822# metacharacters that are still active within double-quoted strings.
1823Xsed='sed -e s/^X//'
1824sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
1825
1826# Same as above, but do not quote variable references.
1827double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
1828
1829# Sed substitution to delay expansion of an escaped shell variable in a
1830# double_quote_subst'ed string.
1831delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1832
1833# Constants:
1834rm="rm -f"
1835
1836# Global variables:
1837default_ofile=libtool
1838can_build_shared=yes
1839
1840# All known linkers require a `.a' archive for static linking (except M$VC,
1841# which needs '.lib').
1842libext=a
1843ltmain="$ac_aux_dir/ltmain.sh"
1844ofile="$default_ofile"
1845with_gnu_ld="$lt_cv_prog_gnu_ld"
1846need_locks="$enable_libtool_lock"
1847
1848old_CC="$CC"
1849old_CFLAGS="$CFLAGS"
1850
1851# Set sane defaults for various variables
1852test -z "$AR" && AR=ar
1853test -z "$AR_FLAGS" && AR_FLAGS=cru
1854test -z "$AS" && AS=as
1855test -z "$CC" && CC=cc
1856test -z "$DLLTOOL" && DLLTOOL=dlltool
1857test -z "$LD" && LD=ld
1858test -z "$LN_S" && LN_S="ln -s"
1859test -z "$MAGIC_CMD" && MAGIC_CMD=file
1860test -z "$NM" && NM=nm
1861test -z "$OBJDUMP" && OBJDUMP=objdump
1862test -z "$RANLIB" && RANLIB=:
1863test -z "$STRIP" && STRIP=:
1864test -z "$ac_objext" && ac_objext=o
1865
1866if test x"$host" != x"$build"; then
1867  ac_tool_prefix=${host_alias}-
1868else
1869  ac_tool_prefix=
1870fi
1871
1872# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
1873case $host_os in
1874linux-gnu*) ;;
1875linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1876esac
1877
1878case $host_os in
1879aix3*)
1880  # AIX sometimes has problems with the GCC collect2 program.  For some
1881  # reason, if we set the COLLECT_NAMES environment variable, the problems
1882  # vanish in a puff of smoke.
1883  if test "X${COLLECT_NAMES+set}" != Xset; then
1884    COLLECT_NAMES=
1885    export COLLECT_NAMES
1886  fi
1887  ;;
1888esac
1889
1890# Determine commands to create old-style static archives.
1891old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1892old_postinstall_cmds='chmod 644 $oldlib'
1893old_postuninstall_cmds=
1894
1895if test -n "$RANLIB"; then
1896  case $host_os in
1897  openbsd*)
1898    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1899    ;;
1900  *)
1901    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1902    ;;
1903  esac
1904  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1905fi
1906
1907# Allow CC to be a program name with arguments.
1908set dummy $CC
1909compiler="[$]2"
1910
1911AC_MSG_CHECKING([for objdir])
1912rm -f .libs 2>/dev/null
1913mkdir .libs 2>/dev/null
1914if test -d .libs; then
1915  objdir=.libs
1916else
1917  # MS-DOS does not allow filenames that begin with a dot.
1918  objdir=_libs
1919fi
1920rmdir .libs 2>/dev/null
1921AC_MSG_RESULT($objdir)
1922
1923
1924AC_ARG_WITH(pic,
1925[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
1926pic_mode="$withval", pic_mode=default)
1927test -z "$pic_mode" && pic_mode=default
1928
1929# We assume here that the value for lt_cv_prog_cc_pic will not be cached
1930# in isolation, and that seeing it set (from the cache) indicates that
1931# the associated values are set (in the cache) correctly too.
1932AC_MSG_CHECKING([for $compiler option to produce PIC])
1933AC_CACHE_VAL(lt_cv_prog_cc_pic,
1934[ lt_cv_prog_cc_pic=
1935  lt_cv_prog_cc_shlib=
1936  lt_cv_prog_cc_wl=
1937  lt_cv_prog_cc_static=
1938  lt_cv_prog_cc_no_builtin=
1939  lt_cv_prog_cc_can_build_shared=$can_build_shared
1940
1941  if test "$GCC" = yes; then
1942    lt_cv_prog_cc_wl='-Wl,'
1943    lt_cv_prog_cc_static='-static'
1944
1945    case $host_os in
1946    aix*)
1947      # Below there is a dirty hack to force normal static linking with -ldl
1948      # The problem is because libdl dynamically linked with both libc and
1949      # libC (AIX C++ library), which obviously doesn't included in libraries
1950      # list by gcc. This cause undefined symbols with -static flags.
1951      # This hack allows C programs to be linked with "-static -ldl", but
1952      # not sure about C++ programs.
1953      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
1954      ;;
1955    amigaos*)
1956      # FIXME: we need at least 68020 code to build shared libraries, but
1957      # adding the `-m68020' flag to GCC prevents building anything better,
1958      # like `-m68040'.
1959      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
1960      ;;
1961    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
1962      # PIC is the default for these OSes.
1963      ;;
1964    darwin* | rhapsody*)
1965      # PIC is the default on this platform
1966      # Common symbols not allowed in MH_DYLIB files
1967      lt_cv_prog_cc_pic='-fno-common'
1968      ;;
1969    cygwin* | mingw* | pw32* | os2*)
1970      # This hack is so that the source file can tell whether it is being
1971      # built for inclusion in a dll (and should export symbols for example).
1972      lt_cv_prog_cc_pic='-DDLL_EXPORT'
1973      ;;
1974    sysv4*MP*)
1975      if test -d /usr/nec; then
1976	 lt_cv_prog_cc_pic=-Kconform_pic
1977      fi
1978      ;;
1979    *)
1980      lt_cv_prog_cc_pic='-fPIC'
1981      ;;
1982    esac
1983  else
1984    # PORTME Check for PIC flags for the system compiler.
1985    case $host_os in
1986    aix3* | aix4* | aix5*)
1987      lt_cv_prog_cc_wl='-Wl,'
1988      # All AIX code is PIC.
1989      if test "$host_cpu" = ia64; then
1990	# AIX 5 now supports IA64 processor
1991	lt_cv_prog_cc_static='-Bstatic'
1992      else
1993	lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1994      fi
1995      ;;
1996
1997    hpux9* | hpux10* | hpux11*)
1998      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1999      lt_cv_prog_cc_wl='-Wl,'
2000      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
2001      lt_cv_prog_cc_pic='+Z'
2002      ;;
2003
2004    irix5* | irix6*)
2005      lt_cv_prog_cc_wl='-Wl,'
2006      lt_cv_prog_cc_static='-non_shared'
2007      # PIC (with -KPIC) is the default.
2008      ;;
2009
2010    cygwin* | mingw* | pw32* | os2*)
2011      # This hack is so that the source file can tell whether it is being
2012      # built for inclusion in a dll (and should export symbols for example).
2013      lt_cv_prog_cc_pic='-DDLL_EXPORT'
2014      ;;
2015
2016    newsos6)
2017      lt_cv_prog_cc_pic='-KPIC'
2018      lt_cv_prog_cc_static='-Bstatic'
2019      ;;
2020
2021    osf3* | osf4* | osf5*)
2022      # All OSF/1 code is PIC.
2023      lt_cv_prog_cc_wl='-Wl,'
2024      lt_cv_prog_cc_static='-non_shared'
2025      ;;
2026
2027    sco3.2v5*)
2028      lt_cv_prog_cc_pic='-Kpic'
2029      lt_cv_prog_cc_static='-dn'
2030      lt_cv_prog_cc_shlib='-belf'
2031      ;;
2032
2033    solaris*)
2034      lt_cv_prog_cc_pic='-KPIC'
2035      lt_cv_prog_cc_static='-Bstatic'
2036      lt_cv_prog_cc_wl='-Wl,'
2037      ;;
2038
2039    sunos4*)
2040      lt_cv_prog_cc_pic='-PIC'
2041      lt_cv_prog_cc_static='-Bstatic'
2042      lt_cv_prog_cc_wl='-Qoption ld '
2043      ;;
2044
2045    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2046      lt_cv_prog_cc_pic='-KPIC'
2047      lt_cv_prog_cc_static='-Bstatic'
2048      if test "x$host_vendor" = xsni; then
2049	lt_cv_prog_cc_wl='-LD'
2050      else
2051	lt_cv_prog_cc_wl='-Wl,'
2052      fi
2053      ;;
2054
2055    uts4*)
2056      lt_cv_prog_cc_pic='-pic'
2057      lt_cv_prog_cc_static='-Bstatic'
2058      ;;
2059
2060    sysv4*MP*)
2061      if test -d /usr/nec ;then
2062	lt_cv_prog_cc_pic='-Kconform_pic'
2063	lt_cv_prog_cc_static='-Bstatic'
2064      fi
2065      ;;
2066
2067    *)
2068      lt_cv_prog_cc_can_build_shared=no
2069      ;;
2070    esac
2071  fi
2072])
2073if test -z "$lt_cv_prog_cc_pic"; then
2074  AC_MSG_RESULT([none])
2075else
2076  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
2077
2078  # Check to make sure the pic_flag actually works.
2079  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
2080  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
2081    save_CFLAGS="$CFLAGS"
2082    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
2083    AC_TRY_COMPILE([], [], [dnl
2084      case $host_os in
2085      hpux9* | hpux10* | hpux11*)
2086	# On HP-UX, both CC and GCC only warn that PIC is supported... then
2087	# they create non-PIC objects.  So, if there were any warnings, we
2088	# assume that PIC is not supported.
2089	if test -s conftest.err; then
2090	  lt_cv_prog_cc_pic_works=no
2091	else
2092	  lt_cv_prog_cc_pic_works=yes
2093	fi
2094	;;
2095      *)
2096	lt_cv_prog_cc_pic_works=yes
2097	;;
2098      esac
2099    ], [dnl
2100      lt_cv_prog_cc_pic_works=no
2101    ])
2102    CFLAGS="$save_CFLAGS"
2103  ])
2104
2105  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
2106    lt_cv_prog_cc_pic=
2107    lt_cv_prog_cc_can_build_shared=no
2108  else
2109    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
2110  fi
2111
2112  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
2113fi
2114
2115# Check for any special shared library compilation flags.
2116if test -n "$lt_cv_prog_cc_shlib"; then
2117  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
2118  if echo "$old_CC $old_CFLAGS " | egrep -e "[[ 	]]$lt_cv_prog_cc_shlib[[ 	]]" >/dev/null; then :
2119  else
2120   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
2121    lt_cv_prog_cc_can_build_shared=no
2122  fi
2123fi
2124
2125AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
2126AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
2127  lt_cv_prog_cc_static_works=no
2128  save_LDFLAGS="$LDFLAGS"
2129  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
2130  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
2131  LDFLAGS="$save_LDFLAGS"
2132])
2133
2134# Belt *and* braces to stop my trousers falling down:
2135test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
2136AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
2137
2138pic_flag="$lt_cv_prog_cc_pic"
2139special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
2140wl="$lt_cv_prog_cc_wl"
2141link_static_flag="$lt_cv_prog_cc_static"
2142no_builtin_flag="$lt_cv_prog_cc_no_builtin"
2143can_build_shared="$lt_cv_prog_cc_can_build_shared"
2144
2145
2146# Check to see if options -o and -c are simultaneously supported by compiler
2147AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
2148AC_CACHE_VAL([lt_cv_compiler_c_o], [
2149$rm -r conftest 2>/dev/null
2150mkdir conftest
2151cd conftest
2152echo "int some_variable = 0;" > conftest.$ac_ext
2153mkdir out
2154# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
2155# that will create temporary files in the current directory regardless of
2156# the output directory.  Thus, making CWD read-only will cause this test
2157# to fail, enabling locking or at least warning the user not to do parallel
2158# builds.
2159chmod -w .
2160save_CFLAGS="$CFLAGS"
2161CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
2162compiler_c_o=no
2163if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
2164  # The compiler can only warn and ignore the option if not recognized
2165  # So say no if there are warnings
2166  if test -s out/conftest.err; then
2167    lt_cv_compiler_c_o=no
2168  else
2169    lt_cv_compiler_c_o=yes
2170  fi
2171else
2172  # Append any errors to the config.log.
2173  cat out/conftest.err 1>&AC_FD_CC
2174  lt_cv_compiler_c_o=no
2175fi
2176CFLAGS="$save_CFLAGS"
2177chmod u+w .
2178$rm conftest* out/*
2179rmdir out
2180cd ..
2181rmdir conftest
2182$rm -r conftest 2>/dev/null
2183])
2184compiler_c_o=$lt_cv_compiler_c_o
2185AC_MSG_RESULT([$compiler_c_o])
2186
2187if test x"$compiler_c_o" = x"yes"; then
2188  # Check to see if we can write to a .lo
2189  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
2190  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
2191  lt_cv_compiler_o_lo=no
2192  save_CFLAGS="$CFLAGS"
2193  CFLAGS="$CFLAGS -c -o conftest.lo"
2194  save_objext="$ac_objext"
2195  ac_objext=lo
2196  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2197    # The compiler can only warn and ignore the option if not recognized
2198    # So say no if there are warnings
2199    if test -s conftest.err; then
2200      lt_cv_compiler_o_lo=no
2201    else
2202      lt_cv_compiler_o_lo=yes
2203    fi
2204  ])
2205  ac_objext="$save_objext"
2206  CFLAGS="$save_CFLAGS"
2207  ])
2208  compiler_o_lo=$lt_cv_compiler_o_lo
2209  AC_MSG_RESULT([$compiler_o_lo])
2210else
2211  compiler_o_lo=no
2212fi
2213
2214# Check to see if we can do hard links to lock some files if needed
2215hard_links="nottested"
2216if test "$compiler_c_o" = no && test "$need_locks" != no; then
2217  # do not overwrite the value of need_locks provided by the user
2218  AC_MSG_CHECKING([if we can lock with hard links])
2219  hard_links=yes
2220  $rm conftest*
2221  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2222  touch conftest.a
2223  ln conftest.a conftest.b 2>&5 || hard_links=no
2224  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2225  AC_MSG_RESULT([$hard_links])
2226  if test "$hard_links" = no; then
2227    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
2228    need_locks=warn
2229  fi
2230else
2231  need_locks=no
2232fi
2233
2234if test "$GCC" = yes; then
2235  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
2236  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
2237  echo "int some_variable = 0;" > conftest.$ac_ext
2238  save_CFLAGS="$CFLAGS"
2239  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
2240  compiler_rtti_exceptions=no
2241  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2242    # The compiler can only warn and ignore the option if not recognized
2243    # So say no if there are warnings
2244    if test -s conftest.err; then
2245      compiler_rtti_exceptions=no
2246    else
2247      compiler_rtti_exceptions=yes
2248    fi
2249  ])
2250  CFLAGS="$save_CFLAGS"
2251  AC_MSG_RESULT([$compiler_rtti_exceptions])
2252
2253  if test "$compiler_rtti_exceptions" = "yes"; then
2254    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
2255  else
2256    no_builtin_flag=' -fno-builtin'
2257  fi
2258fi
2259
2260# See if the linker supports building shared libraries.
2261AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
2262
2263allow_undefined_flag=
2264no_undefined_flag=
2265need_lib_prefix=unknown
2266need_version=unknown
2267# when you set need_version to no, make sure it does not cause -set_version
2268# flags to be left without arguments
2269archive_cmds=
2270archive_expsym_cmds=
2271old_archive_from_new_cmds=
2272old_archive_from_expsyms_cmds=
2273export_dynamic_flag_spec=
2274whole_archive_flag_spec=
2275thread_safe_flag_spec=
2276hardcode_into_libs=no
2277hardcode_libdir_flag_spec=
2278hardcode_libdir_separator=
2279hardcode_direct=no
2280hardcode_minus_L=no
2281hardcode_shlibpath_var=unsupported
2282runpath_var=
2283link_all_deplibs=unknown
2284always_export_symbols=no
2285export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
2286# include_expsyms should be a list of space-separated symbols to be *always*
2287# included in the symbol list
2288include_expsyms=
2289# exclude_expsyms can be an egrep regular expression of symbols to exclude
2290# it will be wrapped by ` (' and `)$', so one must not match beginning or
2291# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
2292# as well as any symbol that contains `d'.
2293exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
2294# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
2295# platforms (ab)use it in PIC code, but their linkers get confused if
2296# the symbol is explicitly referenced.  Since portable code cannot
2297# rely on this symbol name, it's probably fine to never include it in
2298# preloaded symbol tables.
2299extract_expsyms_cmds=
2300
2301case $host_os in
2302cygwin* | mingw* | pw32*)
2303  # FIXME: the MSVC++ port hasn't been tested in a loooong time
2304  # When not using gcc, we currently assume that we are using
2305  # Microsoft Visual C++.
2306  if test "$GCC" != yes; then
2307    with_gnu_ld=no
2308  fi
2309  ;;
2310openbsd*)
2311  with_gnu_ld=no
2312  ;;
2313esac
2314
2315ld_shlibs=yes
2316if test "$with_gnu_ld" = yes; then
2317  # If archive_cmds runs LD, not CC, wlarc should be empty
2318  wlarc='${wl}'
2319
2320  # See if GNU ld supports shared libraries.
2321  case $host_os in
2322  aix3* | aix4* | aix5*)
2323    # On AIX, the GNU linker is very broken
2324    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
2325    ld_shlibs=no
2326    cat <<EOF 1>&2
2327
2328*** Warning: the GNU linker, at least up to release 2.9.1, is reported
2329*** to be unable to reliably create shared libraries on AIX.
2330*** Therefore, libtool is disabling shared libraries support.  If you
2331*** really care for shared libraries, you may want to modify your PATH
2332*** so that a non-GNU linker is found, and then restart.
2333
2334EOF
2335    ;;
2336
2337  amigaos*)
2338    archive_cmds='$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)'
2339    hardcode_libdir_flag_spec='-L$libdir'
2340    hardcode_minus_L=yes
2341
2342    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
2343    # that the semantics of dynamic libraries on AmigaOS, at least up
2344    # to version 4, is to share data among multiple programs linked
2345    # with the same dynamic library.  Since this doesn't match the
2346    # behavior of shared libraries on other platforms, we can use
2347    # them.
2348    ld_shlibs=no
2349    ;;
2350
2351  beos*)
2352    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2353      allow_undefined_flag=unsupported
2354      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
2355      # support --undefined.  This deserves some investigation.  FIXME
2356      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2357    else
2358      ld_shlibs=no
2359    fi
2360    ;;
2361
2362  cygwin* | mingw* | pw32*)
2363    # hardcode_libdir_flag_spec is actually meaningless, as there is
2364    # no search path for DLLs.
2365    hardcode_libdir_flag_spec='-L$libdir'
2366    allow_undefined_flag=unsupported
2367    always_export_symbols=yes
2368
2369    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
2370      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
2371      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
2372      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
2373      else $CC -o impgen impgen.c ; fi)~
2374      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
2375
2376    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
2377
2378    # cygwin and mingw dlls have different entry points and sets of symbols
2379    # to exclude.
2380    # FIXME: what about values for MSVC?
2381    dll_entry=__cygwin_dll_entry@12
2382    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
2383    case $host_os in
2384    mingw*)
2385      # mingw values
2386      dll_entry=_DllMainCRTStartup@12
2387      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
2388      ;;
2389    esac
2390
2391    # mingw and cygwin differ, and it's simplest to just exclude the union
2392    # of the two symbol sets.
2393    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
2394
2395    # recent cygwin and mingw systems supply a stub DllMain which the user
2396    # can override, but on older systems we have to supply one (in ltdll.c)
2397    if test "x$lt_cv_need_dllmain" = "xyes"; then
2398      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
2399      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
2400	test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
2401    else
2402      ltdll_obj=
2403      ltdll_cmds=
2404    fi
2405
2406    # Extract the symbol export list from an `--export-all' def file,
2407    # then regenerate the def file from the symbol export list, so that
2408    # the compiled dll only exports the symbol export list.
2409    # Be careful not to strip the DATA tag left be newer dlltools.
2410    export_symbols_cmds="$ltdll_cmds"'
2411      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
2412      sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
2413
2414    # If the export-symbols file already is a .def file (1st line
2415    # is EXPORTS), use it as is.
2416    # If DATA tags from a recent dlltool are present, honour them!
2417    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
2418	cp $export_symbols $output_objdir/$soname-def;
2419      else
2420	echo EXPORTS > $output_objdir/$soname-def;
2421	_lt_hint=1;
2422	cat $export_symbols | while read symbol; do
2423	 set dummy \$symbol;
2424	 case \[$]# in
2425	   2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
2426	   *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
2427	 esac;
2428	 _lt_hint=`expr 1 + \$_lt_hint`;
2429	done;
2430      fi~
2431      '"$ltdll_cmds"'
2432      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
2433      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
2434      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
2435      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
2436      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
2437    ;;
2438
2439  netbsd*)
2440    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2441      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
2442      wlarc=
2443    else
2444      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2445      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2446    fi
2447    ;;
2448
2449  solaris* | sysv5*)
2450    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
2451      ld_shlibs=no
2452      cat <<EOF 1>&2
2453
2454*** Warning: The releases 2.8.* of the GNU linker cannot reliably
2455*** create shared libraries on Solaris systems.  Therefore, libtool
2456*** is disabling shared libraries support.  We urge you to upgrade GNU
2457*** binutils to release 2.9.1 or newer.  Another option is to modify
2458*** your PATH or compiler configuration so that the native linker is
2459*** used, and then restart.
2460
2461EOF
2462    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2463      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2464      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2465    else
2466      ld_shlibs=no
2467    fi
2468    ;;
2469
2470  sunos4*)
2471    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2472    wlarc=
2473    hardcode_direct=yes
2474    hardcode_shlibpath_var=no
2475    ;;
2476
2477  *)
2478    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2479      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2480      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2481    else
2482      ld_shlibs=no
2483    fi
2484    ;;
2485  esac
2486
2487  if test "$ld_shlibs" = yes; then
2488    runpath_var=LD_RUN_PATH
2489    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
2490    export_dynamic_flag_spec='${wl}--export-dynamic'
2491    case $host_os in
2492    cygwin* | mingw* | pw32*)
2493      # dlltool doesn't understand --whole-archive et. al.
2494      whole_archive_flag_spec=
2495      ;;
2496    *)
2497      # ancient GNU ld didn't support --whole-archive et. al.
2498      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
2499	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
2500      else
2501	whole_archive_flag_spec=
2502      fi
2503      ;;
2504    esac
2505  fi
2506else
2507  # PORTME fill in a description of your system's linker (not GNU ld)
2508  case $host_os in
2509  aix3*)
2510    allow_undefined_flag=unsupported
2511    always_export_symbols=yes
2512    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
2513    # Note: this linker hardcodes the directories in LIBPATH if there
2514    # are no directories specified by -L.
2515    hardcode_minus_L=yes
2516    if test "$GCC" = yes && test -z "$link_static_flag"; then
2517      # Neither direct hardcoding nor static linking is supported with a
2518      # broken collect2.
2519      hardcode_direct=unsupported
2520    fi
2521    ;;
2522
2523  aix4* | aix5*)
2524    if test "$host_cpu" = ia64; then
2525      # On IA64, the linker does run time linking by default, so we don't
2526      # have to do anything special.
2527      aix_use_runtimelinking=no
2528      exp_sym_flag='-Bexport'
2529      no_entry_flag=""
2530    else
2531      aix_use_runtimelinking=no
2532
2533      # Test if we are trying to use run time linking or normal
2534      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
2535      # need to do runtime linking.
2536      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
2537	for ld_flag in $LDFLAGS; do
2538	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
2539	    aix_use_runtimelinking=yes
2540	    break
2541	  fi
2542	done
2543      esac
2544
2545      exp_sym_flag='-bexport'
2546      no_entry_flag='-bnoentry'
2547    fi
2548
2549    # When large executables or shared objects are built, AIX ld can
2550    # have problems creating the table of contents.  If linking a library
2551    # or program results in "error TOC overflow" add -mminimal-toc to
2552    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
2553    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
2554
2555    hardcode_direct=yes
2556    archive_cmds=''
2557    hardcode_libdir_separator=':'
2558    if test "$GCC" = yes; then
2559      case $host_os in aix4.[[012]]|aix4.[[012]].*)
2560	collect2name=`${CC} -print-prog-name=collect2`
2561	if test -f "$collect2name" && \
2562	  strings "$collect2name" | grep resolve_lib_name >/dev/null
2563	then
2564	  # We have reworked collect2
2565	  hardcode_direct=yes
2566	else
2567	  # We have old collect2
2568	  hardcode_direct=unsupported
2569	  # It fails to find uninstalled libraries when the uninstalled
2570	  # path is not listed in the libpath.  Setting hardcode_minus_L
2571	  # to unsupported forces relinking
2572	  hardcode_minus_L=yes
2573	  hardcode_libdir_flag_spec='-L$libdir'
2574	  hardcode_libdir_separator=
2575	fi
2576      esac
2577
2578      shared_flag='-shared'
2579    else
2580      # not using gcc
2581      if test "$host_cpu" = ia64; then
2582	shared_flag='${wl}-G'
2583      else
2584	if test "$aix_use_runtimelinking" = yes; then
2585	  shared_flag='${wl}-G'
2586	else
2587	  shared_flag='${wl}-bM:SRE'
2588	fi
2589      fi
2590    fi
2591
2592    # It seems that -bexpall can do strange things, so it is better to
2593    # generate a list of symbols to export.
2594    always_export_symbols=yes
2595    if test "$aix_use_runtimelinking" = yes; then
2596      # Warning - without using the other runtime loading flags (-brtl),
2597      # -berok will link without error, but may produce a broken library.
2598      allow_undefined_flag='-berok'
2599      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
2600      archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
2601    else
2602      if test "$host_cpu" = ia64; then
2603	hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
2604	allow_undefined_flag="-z nodefs"
2605	archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
2606      else
2607	hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
2608	# Warning - without using the other run time loading flags,
2609	# -berok will link without error, but may produce a broken library.
2610	allow_undefined_flag='${wl}-berok'
2611	# This is a bit strange, but is similar to how AIX traditionally builds
2612	# it's shared libraries.
2613	archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
2614      fi
2615    fi
2616    ;;
2617
2618  amigaos*)
2619    archive_cmds='$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)'
2620    hardcode_libdir_flag_spec='-L$libdir'
2621    hardcode_minus_L=yes
2622    # see comment about different semantics on the GNU ld section
2623    ld_shlibs=no
2624    ;;
2625
2626  cygwin* | mingw* | pw32*)
2627    # When not using gcc, we currently assume that we are using
2628    # Microsoft Visual C++.
2629    # hardcode_libdir_flag_spec is actually meaningless, as there is
2630    # no search path for DLLs.
2631    hardcode_libdir_flag_spec=' '
2632    allow_undefined_flag=unsupported
2633    # Tell ltmain to make .lib files, not .a files.
2634    libext=lib
2635    # FIXME: Setting linknames here is a bad hack.
2636    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
2637    # The linker will automatically build a .lib file if we build a DLL.
2638    old_archive_from_new_cmds='true'
2639    # FIXME: Should let the user specify the lib program.
2640    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
2641    fix_srcfile_path='`cygpath -w "$srcfile"`'
2642    ;;
2643
2644  darwin* | rhapsody*)
2645    case "$host_os" in
2646    rhapsody* | darwin1.[[012]])
2647      allow_undefined_flag='-undefined suppress'
2648      ;;
2649    *) # Darwin 1.3 on
2650      allow_undefined_flag='-flat_namespace -undefined suppress'
2651      ;;
2652    esac
2653    # FIXME: Relying on posixy $() will cause problems for
2654    #        cross-compilation, but unfortunately the echo tests do not
2655    #        yet detect zsh echo's removal of \ escapes.
2656    archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
2657    # We need to add '_' to the symbols in $export_symbols first
2658    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
2659    hardcode_direct=yes
2660    hardcode_shlibpath_var=no
2661    whole_archive_flag_spec='-all_load $convenience'
2662    ;;
2663
2664  freebsd1*)
2665    ld_shlibs=no
2666    ;;
2667
2668  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
2669  # support.  Future versions do this automatically, but an explicit c++rt0.o
2670  # does not break anything, and helps significantly (at the cost of a little
2671  # extra space).
2672  freebsd2.2*)
2673    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
2674    hardcode_libdir_flag_spec='-R$libdir'
2675    hardcode_direct=yes
2676    hardcode_shlibpath_var=no
2677    ;;
2678
2679  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
2680  freebsd2*)
2681    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2682    hardcode_direct=yes
2683    hardcode_minus_L=yes
2684    hardcode_shlibpath_var=no
2685    ;;
2686
2687  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
2688  freebsd*)
2689    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
2690    hardcode_libdir_flag_spec='-R$libdir'
2691    hardcode_direct=yes
2692    hardcode_shlibpath_var=no
2693    ;;
2694
2695  hpux9* | hpux10* | hpux11*)
2696    case $host_os in
2697    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
2698    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
2699    esac
2700    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
2701    hardcode_libdir_separator=:
2702    hardcode_direct=yes
2703    hardcode_minus_L=yes # Not in the search PATH, but as the default
2704			 # location of the library.
2705    export_dynamic_flag_spec='${wl}-E'
2706    ;;
2707
2708  irix5* | irix6*)
2709    if test "$GCC" = yes; then
2710      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2711    else
2712      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2713    fi
2714    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2715    hardcode_libdir_separator=:
2716    link_all_deplibs=yes
2717    ;;
2718
2719  netbsd*)
2720    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2721      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
2722    else
2723      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
2724    fi
2725    hardcode_libdir_flag_spec='-R$libdir'
2726    hardcode_direct=yes
2727    hardcode_shlibpath_var=no
2728    ;;
2729
2730  newsos6)
2731    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2732    hardcode_direct=yes
2733    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2734    hardcode_libdir_separator=:
2735    hardcode_shlibpath_var=no
2736    ;;
2737
2738  openbsd*)
2739    hardcode_direct=yes
2740    hardcode_shlibpath_var=no
2741    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2742      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
2743      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2744      export_dynamic_flag_spec='${wl}-E'
2745    else
2746      case "$host_os" in
2747      openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
2748	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2749	hardcode_libdir_flag_spec='-R$libdir'
2750        ;;
2751      *)
2752        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
2753        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2754        ;;
2755      esac
2756    fi
2757    ;;
2758
2759  os2*)
2760    hardcode_libdir_flag_spec='-L$libdir'
2761    hardcode_minus_L=yes
2762    allow_undefined_flag=unsupported
2763    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
2764    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
2765    ;;
2766
2767  osf3*)
2768    if test "$GCC" = yes; then
2769      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2770      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2771    else
2772      allow_undefined_flag=' -expect_unresolved \*'
2773      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2774    fi
2775    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2776    hardcode_libdir_separator=:
2777    ;;
2778
2779  osf4* | osf5*)	# as osf3* with the addition of -msym flag
2780    if test "$GCC" = yes; then
2781      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2782      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2783      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2784    else
2785      allow_undefined_flag=' -expect_unresolved \*'
2786      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2787      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
2788      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
2789
2790      #Both c and cxx compiler support -rpath directly
2791      hardcode_libdir_flag_spec='-rpath $libdir'
2792    fi
2793    hardcode_libdir_separator=:
2794    ;;
2795
2796  sco3.2v5*)
2797    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2798    hardcode_shlibpath_var=no
2799    runpath_var=LD_RUN_PATH
2800    hardcode_runpath_var=yes
2801    export_dynamic_flag_spec='${wl}-Bexport'
2802    ;;
2803
2804  solaris*)
2805    # gcc --version < 3.0 without binutils cannot create self contained
2806    # shared libraries reliably, requiring libgcc.a to resolve some of
2807    # the object symbols generated in some cases.  Libraries that use
2808    # assert need libgcc.a to resolve __eprintf, for example.  Linking
2809    # a copy of libgcc.a into every shared library to guarantee resolving
2810    # such symbols causes other problems:  According to Tim Van Holder
2811    # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
2812    # (to the application) exception stack for one thing.
2813    no_undefined_flag=' -z defs'
2814    if test "$GCC" = yes; then
2815      case `$CC --version 2>/dev/null` in
2816      [[12]].*)
2817	cat <<EOF 1>&2
2818
2819*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
2820*** create self contained shared libraries on Solaris systems, without
2821*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
2822*** -no-undefined support, which will at least allow you to build shared
2823*** libraries.  However, you may find that when you link such libraries
2824*** into an application without using GCC, you have to manually add
2825*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
2826*** upgrade to a newer version of GCC.  Another option is to rebuild your
2827*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
2828
2829EOF
2830        no_undefined_flag=
2831	;;
2832      esac
2833    fi
2834    # $CC -shared without GNU ld will not create a library from C++
2835    # object files and a static libstdc++, better avoid it by now
2836    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2837    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2838		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2839    hardcode_libdir_flag_spec='-R$libdir'
2840    hardcode_shlibpath_var=no
2841    case $host_os in
2842    solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
2843    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
2844      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
2845    esac
2846    link_all_deplibs=yes
2847    ;;
2848
2849  sunos4*)
2850    if test "x$host_vendor" = xsequent; then
2851      # Use $CC to link under sequent, because it throws in some extra .o
2852      # files that make .init and .fini sections work.
2853      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
2854    else
2855      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
2856    fi
2857    hardcode_libdir_flag_spec='-L$libdir'
2858    hardcode_direct=yes
2859    hardcode_minus_L=yes
2860    hardcode_shlibpath_var=no
2861    ;;
2862
2863  sysv4)
2864    if test "x$host_vendor" = xsno; then
2865      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
2866      hardcode_direct=yes # is this really true???
2867    else
2868      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2869      hardcode_direct=no #Motorola manual says yes, but my tests say they lie
2870    fi
2871    runpath_var='LD_RUN_PATH'
2872    hardcode_shlibpath_var=no
2873    ;;
2874
2875  sysv4.3*)
2876    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2877    hardcode_shlibpath_var=no
2878    export_dynamic_flag_spec='-Bexport'
2879    ;;
2880
2881  sysv5*)
2882    no_undefined_flag=' -z text'
2883    # $CC -shared without GNU ld will not create a library from C++
2884    # object files and a static libstdc++, better avoid it by now
2885    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2886    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2887		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2888    hardcode_libdir_flag_spec=
2889    hardcode_shlibpath_var=no
2890    runpath_var='LD_RUN_PATH'
2891    ;;
2892
2893  uts4*)
2894    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2895    hardcode_libdir_flag_spec='-L$libdir'
2896    hardcode_shlibpath_var=no
2897    ;;
2898
2899  dgux*)
2900    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2901    hardcode_libdir_flag_spec='-L$libdir'
2902    hardcode_shlibpath_var=no
2903    ;;
2904
2905  sysv4*MP*)
2906    if test -d /usr/nec; then
2907      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2908      hardcode_shlibpath_var=no
2909      runpath_var=LD_RUN_PATH
2910      hardcode_runpath_var=yes
2911      ld_shlibs=yes
2912    fi
2913    ;;
2914
2915  sysv4.2uw2*)
2916    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2917    hardcode_direct=yes
2918    hardcode_minus_L=no
2919    hardcode_shlibpath_var=no
2920    hardcode_runpath_var=yes
2921    runpath_var=LD_RUN_PATH
2922    ;;
2923
2924  sysv5uw7* | unixware7*)
2925    no_undefined_flag='${wl}-z ${wl}text'
2926    if test "$GCC" = yes; then
2927      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2928    else
2929      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2930    fi
2931    runpath_var='LD_RUN_PATH'
2932    hardcode_shlibpath_var=no
2933    ;;
2934
2935  *)
2936    ld_shlibs=no
2937    ;;
2938  esac
2939fi
2940AC_MSG_RESULT([$ld_shlibs])
2941test "$ld_shlibs" = no && can_build_shared=no
2942
2943# Check hardcoding attributes.
2944AC_MSG_CHECKING([how to hardcode library paths into programs])
2945hardcode_action=
2946if test -n "$hardcode_libdir_flag_spec" || \
2947   test -n "$runpath_var"; then
2948
2949  # We can hardcode non-existant directories.
2950  if test "$hardcode_direct" != no &&
2951     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2952     # have to relink, otherwise we might link with an installed library
2953     # when we should be linking with a yet-to-be-installed one
2954     ## test "$hardcode_shlibpath_var" != no &&
2955     test "$hardcode_minus_L" != no; then
2956    # Linking always hardcodes the temporary library directory.
2957    hardcode_action=relink
2958  else
2959    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2960    hardcode_action=immediate
2961  fi
2962else
2963  # We cannot hardcode anything, or else we can only hardcode existing
2964  # directories.
2965  hardcode_action=unsupported
2966fi
2967AC_MSG_RESULT([$hardcode_action])
2968
2969striplib=
2970old_striplib=
2971AC_MSG_CHECKING([whether stripping libraries is possible])
2972if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2973  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2974  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2975  AC_MSG_RESULT([yes])
2976else
2977  AC_MSG_RESULT([no])
2978fi
2979
2980reload_cmds='$LD$reload_flag -o $output$reload_objs'
2981test -z "$deplibs_check_method" && deplibs_check_method=unknown
2982
2983# PORTME Fill in your ld.so characteristics
2984AC_MSG_CHECKING([dynamic linker characteristics])
2985library_names_spec=
2986libname_spec='lib$name'
2987soname_spec=
2988postinstall_cmds=
2989postuninstall_cmds=
2990finish_cmds=
2991finish_eval=
2992shlibpath_var=
2993shlibpath_overrides_runpath=unknown
2994version_type=none
2995dynamic_linker="$host_os ld.so"
2996sys_lib_dlsearch_path_spec="/lib /usr/lib"
2997sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2998
2999case $host_os in
3000aix3*)
3001  version_type=linux
3002  library_names_spec='${libname}${release}.so$versuffix $libname.a'
3003  shlibpath_var=LIBPATH
3004
3005  # AIX has no versioning support, so we append a major version to the name.
3006  soname_spec='${libname}${release}.so$major'
3007  ;;
3008
3009aix4* | aix5*)
3010  version_type=linux
3011  if test "$host_cpu" = ia64; then
3012    # AIX 5 supports IA64
3013    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
3014    shlibpath_var=LD_LIBRARY_PATH
3015  else
3016    # With GCC up to 2.95.x, collect2 would create an import file
3017    # for dependence libraries.  The import file would start with
3018    # the line `#! .'.  This would cause the generated library to
3019    # depend on `.', always an invalid library.  This was fixed in
3020    # development snapshots of GCC prior to 3.0.
3021    case $host_os in
3022      aix4 | aix4.[[01]] | aix4.[[01]].*)
3023	if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3024	     echo ' yes '
3025	     echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
3026	  :
3027	else
3028	  can_build_shared=no
3029	fi
3030	;;
3031    esac
3032    # AIX (on Power*) has no versioning support, so currently we can
3033    # not hardcode correct soname into executable. Probably we can
3034    # add versioning support to collect2, so additional links can
3035    # be useful in future.
3036    if test "$aix_use_runtimelinking" = yes; then
3037      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3038      # instead of lib<name>.a to let people know that these are not
3039      # typical AIX shared libraries.
3040      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3041    else
3042      # We preserve .a as extension for shared libraries through AIX4.2
3043      # and later when we are not doing run time linking.
3044      library_names_spec='${libname}${release}.a $libname.a'
3045      soname_spec='${libname}${release}.so$major'
3046    fi
3047    shlibpath_var=LIBPATH
3048  fi
3049  ;;
3050
3051amigaos*)
3052  library_names_spec='$libname.ixlibrary $libname.a'
3053  # Create ${libname}_ixlibrary.a entries in /sys/libs.
3054  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
3055  ;;
3056
3057beos*)
3058  library_names_spec='${libname}.so'
3059  dynamic_linker="$host_os ld.so"
3060  shlibpath_var=LIBRARY_PATH
3061  ;;
3062
3063bsdi4*)
3064  version_type=linux
3065  need_version=no
3066  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3067  soname_spec='${libname}${release}.so$major'
3068  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3069  shlibpath_var=LD_LIBRARY_PATH
3070  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3071  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3072  export_dynamic_flag_spec=-rdynamic
3073  # the default ld.so.conf also contains /usr/contrib/lib and
3074  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3075  # libtool to hard-code these into programs
3076  ;;
3077
3078cygwin* | mingw* | pw32*)
3079  version_type=windows
3080  need_version=no
3081  need_lib_prefix=no
3082  case $GCC,$host_os in
3083  yes,cygwin*)
3084    library_names_spec='$libname.dll.a'
3085    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
3086    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
3087      dldir=$destdir/`dirname \$dlpath`~
3088      test -d \$dldir || mkdir -p \$dldir~
3089      $install_prog .libs/$dlname \$dldir/$dlname'
3090    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
3091      dlpath=$dir/\$dldll~
3092       $rm \$dlpath'
3093    ;;
3094  yes,mingw*)
3095    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
3096    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
3097    ;;
3098  yes,pw32*)
3099    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
3100    ;;
3101  *)
3102    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
3103    ;;
3104  esac
3105  dynamic_linker='Win32 ld.exe'
3106  # FIXME: first we should search . and the directory the executable is in
3107  shlibpath_var=PATH
3108  ;;
3109
3110darwin* | rhapsody*)
3111  dynamic_linker="$host_os dyld"
3112  version_type=darwin
3113  need_lib_prefix=no
3114  need_version=no
3115  # FIXME: Relying on posixy $() will cause problems for
3116  #        cross-compilation, but unfortunately the echo tests do not
3117  #        yet detect zsh echo's removal of \ escapes.
3118  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
3119  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
3120  shlibpath_overrides_runpath=yes
3121  shlibpath_var=DYLD_LIBRARY_PATH
3122  ;;
3123
3124freebsd1*)
3125  dynamic_linker=no
3126  ;;
3127
3128freebsd*)
3129  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
3130  version_type=freebsd-$objformat
3131  case $version_type in
3132    freebsd-elf*)
3133      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
3134      need_version=no
3135      need_lib_prefix=no
3136      ;;
3137    freebsd-*)
3138      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
3139      need_version=yes
3140      ;;
3141  esac
3142  shlibpath_var=LD_LIBRARY_PATH
3143  case $host_os in
3144  freebsd2*)
3145    shlibpath_overrides_runpath=yes
3146    ;;
3147  *)
3148    shlibpath_overrides_runpath=no
3149    hardcode_into_libs=yes
3150    ;;
3151  esac
3152  ;;
3153
3154gnu*)
3155  version_type=linux
3156  need_lib_prefix=no
3157  need_version=no
3158  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
3159  soname_spec='${libname}${release}.so$major'
3160  shlibpath_var=LD_LIBRARY_PATH
3161  hardcode_into_libs=yes
3162  ;;
3163
3164hpux9* | hpux10* | hpux11*)
3165  # Give a soname corresponding to the major version so that dld.sl refuses to
3166  # link against other versions.
3167  dynamic_linker="$host_os dld.sl"
3168  version_type=sunos
3169  need_lib_prefix=no
3170  need_version=no
3171  shlibpath_var=SHLIB_PATH
3172  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3173  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
3174  soname_spec='${libname}${release}.sl$major'
3175  # HP-UX runs *really* slowly unless shared libraries are mode 555.
3176  postinstall_cmds='chmod 555 $lib'
3177  ;;
3178
3179irix5* | irix6*)
3180  version_type=irix
3181  need_lib_prefix=no
3182  need_version=no
3183  soname_spec='${libname}${release}.so$major'
3184  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
3185  case $host_os in
3186  irix5*)
3187    libsuff= shlibsuff=
3188    ;;
3189  *)
3190    case $LD in # libtool.m4 will add one of these switches to LD
3191    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
3192    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
3193    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
3194    *) libsuff= shlibsuff= libmagic=never-match;;
3195    esac
3196    ;;
3197  esac
3198  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3199  shlibpath_overrides_runpath=no
3200  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3201  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3202  ;;
3203
3204# No shared lib support for Linux oldld, aout, or coff.
3205linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
3206  dynamic_linker=no
3207  ;;
3208
3209# This must be Linux ELF.
3210linux-gnu*)
3211  version_type=linux
3212  need_lib_prefix=no
3213  need_version=no
3214  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3215  soname_spec='${libname}${release}.so$major'
3216  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3217  shlibpath_var=LD_LIBRARY_PATH
3218  shlibpath_overrides_runpath=no
3219  # This implies no fast_install, which is unacceptable.
3220  # Some rework will be needed to allow for fast_install
3221  # before this can be enabled.
3222  hardcode_into_libs=yes
3223
3224  # We used to test for /lib/ld.so.1 and disable shared libraries on
3225  # powerpc, because MkLinux only supported shared libraries with the
3226  # GNU dynamic linker.  Since this was broken with cross compilers,
3227  # most powerpc-linux boxes support dynamic linking these days and
3228  # people can always --disable-shared, the test was removed, and we
3229  # assume the GNU/Linux dynamic linker is in use.
3230  dynamic_linker='GNU/Linux ld.so'
3231  ;;
3232
3233netbsd*)
3234  version_type=sunos
3235  need_lib_prefix=no
3236  need_version=no
3237  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3238    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3239    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3240    dynamic_linker='NetBSD (a.out) ld.so'
3241  else
3242    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
3243    soname_spec='${libname}${release}.so$major'
3244    dynamic_linker='NetBSD ld.elf_so'
3245  fi
3246  shlibpath_var=LD_LIBRARY_PATH
3247  shlibpath_overrides_runpath=yes
3248  hardcode_into_libs=yes
3249  ;;
3250
3251newsos6)
3252  version_type=linux
3253  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3254  shlibpath_var=LD_LIBRARY_PATH
3255  shlibpath_overrides_runpath=yes
3256  ;;
3257
3258openbsd*)
3259  version_type=sunos
3260  need_lib_prefix=no
3261  need_version=no
3262  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3263    case "$host_os" in
3264    openbsd2.[[89]] | openbsd2.[[89]].*)
3265      shlibpath_overrides_runpath=no
3266      ;;
3267    *)
3268      shlibpath_overrides_runpath=yes
3269      ;;
3270    esac
3271  else
3272    shlibpath_overrides_runpath=yes
3273  fi
3274  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3275  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3276  shlibpath_var=LD_LIBRARY_PATH
3277  ;;
3278
3279os2*)
3280  libname_spec='$name'
3281  need_lib_prefix=no
3282  library_names_spec='$libname.dll $libname.a'
3283  dynamic_linker='OS/2 ld.exe'
3284  shlibpath_var=LIBPATH
3285  ;;
3286
3287osf3* | osf4* | osf5*)
3288  version_type=osf
3289  need_version=no
3290  soname_spec='${libname}${release}.so'
3291  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
3292  shlibpath_var=LD_LIBRARY_PATH
3293  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3294  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3295  ;;
3296
3297sco3.2v5*)
3298  version_type=osf
3299  soname_spec='${libname}${release}.so$major'
3300  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3301  shlibpath_var=LD_LIBRARY_PATH
3302  ;;
3303
3304solaris*)
3305  version_type=linux
3306  need_lib_prefix=no
3307  need_version=no
3308  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3309  soname_spec='${libname}${release}.so$major'
3310  shlibpath_var=LD_LIBRARY_PATH
3311  shlibpath_overrides_runpath=yes
3312  hardcode_into_libs=yes
3313  # ldd complains unless libraries are executable
3314  postinstall_cmds='chmod +x $lib'
3315  ;;
3316
3317sunos4*)
3318  version_type=sunos
3319  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3320  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3321  shlibpath_var=LD_LIBRARY_PATH
3322  shlibpath_overrides_runpath=yes
3323  if test "$with_gnu_ld" = yes; then
3324    need_lib_prefix=no
3325  fi
3326  need_version=yes
3327  ;;
3328
3329sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3330  version_type=linux
3331  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3332  soname_spec='${libname}${release}.so$major'
3333  shlibpath_var=LD_LIBRARY_PATH
3334  case $host_vendor in
3335    sni)
3336      shlibpath_overrides_runpath=no
3337      ;;
3338    motorola)
3339      need_lib_prefix=no
3340      need_version=no
3341      shlibpath_overrides_runpath=no
3342      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3343      ;;
3344  esac
3345  ;;
3346
3347uts4*)
3348  version_type=linux
3349  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3350  soname_spec='${libname}${release}.so$major'
3351  shlibpath_var=LD_LIBRARY_PATH
3352  ;;
3353
3354dgux*)
3355  version_type=linux
3356  need_lib_prefix=no
3357  need_version=no
3358  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3359  soname_spec='${libname}${release}.so$major'
3360  shlibpath_var=LD_LIBRARY_PATH
3361  ;;
3362
3363sysv4*MP*)
3364  if test -d /usr/nec ;then
3365    version_type=linux
3366    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
3367    soname_spec='$libname.so.$major'
3368    shlibpath_var=LD_LIBRARY_PATH
3369  fi
3370  ;;
3371
3372*)
3373  dynamic_linker=no
3374  ;;
3375esac
3376AC_MSG_RESULT([$dynamic_linker])
3377test "$dynamic_linker" = no && can_build_shared=no
3378
3379# Report the final consequences.
3380AC_MSG_CHECKING([if libtool supports shared libraries])
3381AC_MSG_RESULT([$can_build_shared])
3382
3383AC_MSG_CHECKING([whether to build shared libraries])
3384test "$can_build_shared" = "no" && enable_shared=no
3385
3386# On AIX, shared libraries and static libraries use the same namespace, and
3387# are all built from PIC.
3388case "$host_os" in
3389aix3*)
3390  test "$enable_shared" = yes && enable_static=no
3391  if test -n "$RANLIB"; then
3392    archive_cmds="$archive_cmds~\$RANLIB \$lib"
3393    postinstall_cmds='$RANLIB $lib'
3394  fi
3395  ;;
3396
3397aix4*)
3398  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3399    test "$enable_shared" = yes && enable_static=no
3400  fi
3401  ;;
3402esac
3403AC_MSG_RESULT([$enable_shared])
3404
3405AC_MSG_CHECKING([whether to build static libraries])
3406# Make sure either enable_shared or enable_static is yes.
3407test "$enable_shared" = yes || enable_static=yes
3408AC_MSG_RESULT([$enable_static])
3409
3410if test "$hardcode_action" = relink; then
3411  # Fast installation is not supported
3412  enable_fast_install=no
3413elif test "$shlibpath_overrides_runpath" = yes ||
3414     test "$enable_shared" = no; then
3415  # Fast installation is not necessary
3416  enable_fast_install=needless
3417fi
3418
3419variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3420if test "$GCC" = yes; then
3421  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3422fi
3423
3424AC_LIBTOOL_DLOPEN_SELF
3425
3426if test "$enable_shared" = yes && test "$GCC" = yes; then
3427  case $archive_cmds in
3428  *'~'*)
3429    # FIXME: we may have to deal with multi-command sequences.
3430    ;;
3431  '$CC '*)
3432    # Test whether the compiler implicitly links with -lc since on some
3433    # systems, -lgcc has to come before -lc. If gcc already passes -lc
3434    # to ld, don't add -lc before -lgcc.
3435    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
3436    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
3437    [$rm conftest*
3438    echo 'static int dummy;' > conftest.$ac_ext
3439
3440    if AC_TRY_EVAL(ac_compile); then
3441      soname=conftest
3442      lib=conftest
3443      libobjs=conftest.$ac_objext
3444      deplibs=
3445      wl=$lt_cv_prog_cc_wl
3446      compiler_flags=-v
3447      linker_flags=-v
3448      verstring=
3449      output_objdir=.
3450      libname=conftest
3451      save_allow_undefined_flag=$allow_undefined_flag
3452      allow_undefined_flag=
3453      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
3454      then
3455	lt_cv_archive_cmds_need_lc=no
3456      else
3457	lt_cv_archive_cmds_need_lc=yes
3458      fi
3459      allow_undefined_flag=$save_allow_undefined_flag
3460    else
3461      cat conftest.err 1>&5
3462    fi])
3463    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
3464    ;;
3465  esac
3466fi
3467need_lc=${lt_cv_archive_cmds_need_lc-yes}
3468
3469# The second clause should only fire when bootstrapping the
3470# libtool distribution, otherwise you forgot to ship ltmain.sh
3471# with your package, and you will get complaints that there are
3472# no rules to generate ltmain.sh.
3473if test -f "$ltmain"; then
3474  :
3475else
3476  # If there is no Makefile yet, we rely on a make rule to execute
3477  # `config.status --recheck' to rerun these tests and create the
3478  # libtool script then.
3479  test -f Makefile && make "$ltmain"
3480fi
3481
3482if test -f "$ltmain"; then
3483  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
3484  $rm -f "${ofile}T"
3485
3486  echo creating $ofile
3487
3488  # Now quote all the things that may contain metacharacters while being
3489  # careful not to overquote the AC_SUBSTed values.  We take copies of the
3490  # variables and quote the copies for generation of the libtool script.
3491  for var in echo old_CC old_CFLAGS \
3492    AR AR_FLAGS CC LD LN_S NM SHELL \
3493    reload_flag reload_cmds wl \
3494    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
3495    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
3496    library_names_spec soname_spec \
3497    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
3498    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
3499    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
3500    old_striplib striplib file_magic_cmd export_symbols_cmds \
3501    deplibs_check_method allow_undefined_flag no_undefined_flag \
3502    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
3503    global_symbol_to_c_name_address \
3504    hardcode_libdir_flag_spec hardcode_libdir_separator  \
3505    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
3506    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
3507
3508    case $var in
3509    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
3510    old_postinstall_cmds | old_postuninstall_cmds | \
3511    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
3512    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
3513    postinstall_cmds | postuninstall_cmds | \
3514    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
3515      # Double-quote double-evaled strings.
3516      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
3517      ;;
3518    *)
3519      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
3520      ;;
3521    esac
3522  done
3523
3524  cat <<__EOF__ > "${ofile}T"
3525#! $SHELL
3526
3527# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
3528# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
3529# NOTE: Changes made to this file will be lost: look at ltmain.sh.
3530#
3531# Copyright (C) 1996-2000 Free Software Foundation, Inc.
3532# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3533#
3534# This program is free software; you can redistribute it and/or modify
3535# it under the terms of the GNU General Public License as published by
3536# the Free Software Foundation; either version 2 of the License, or
3537# (at your option) any later version.
3538#
3539# This program is distributed in the hope that it will be useful, but
3540# WITHOUT ANY WARRANTY; without even the implied warranty of
3541# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3542# General Public License for more details.
3543#
3544# You should have received a copy of the GNU General Public License
3545# along with this program; if not, write to the Free Software
3546# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3547#
3548# As a special exception to the GNU General Public License, if you
3549# distribute this file as part of a program that contains a
3550# configuration script generated by Autoconf, you may include it under
3551# the same distribution terms that you use for the rest of that program.
3552
3553# Sed that helps us avoid accidentally triggering echo(1) options like -n.
3554Xsed="sed -e s/^X//"
3555
3556# The HP-UX ksh and POSIX shell print the target directory to stdout
3557# if CDPATH is set.
3558if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
3559
3560# ### BEGIN LIBTOOL CONFIG
3561
3562# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3563
3564# Shell to use when invoking shell scripts.
3565SHELL=$lt_SHELL
3566
3567# Whether or not to build shared libraries.
3568build_libtool_libs=$enable_shared
3569
3570# Whether or not to build static libraries.
3571build_old_libs=$enable_static
3572
3573# Whether or not to add -lc for building shared libraries.
3574build_libtool_need_lc=$need_lc
3575
3576# Whether or not to optimize for fast installation.
3577fast_install=$enable_fast_install
3578
3579# The host system.
3580host_alias=$host_alias
3581host=$host
3582
3583# An echo program that does not interpret backslashes.
3584echo=$lt_echo
3585
3586# The archiver.
3587AR=$lt_AR
3588AR_FLAGS=$lt_AR_FLAGS
3589
3590# The default C compiler.
3591CC=$lt_CC
3592
3593# Is the compiler the GNU C compiler?
3594with_gcc=$GCC
3595
3596# The linker used to build libraries.
3597LD=$lt_LD
3598
3599# Whether we need hard or soft links.
3600LN_S=$lt_LN_S
3601
3602# A BSD-compatible nm program.
3603NM=$lt_NM
3604
3605# A symbol stripping program
3606STRIP=$STRIP
3607
3608# Used to examine libraries when file_magic_cmd begins "file"
3609MAGIC_CMD=$MAGIC_CMD
3610
3611# Used on cygwin: DLL creation program.
3612DLLTOOL="$DLLTOOL"
3613
3614# Used on cygwin: object dumper.
3615OBJDUMP="$OBJDUMP"
3616
3617# Used on cygwin: assembler.
3618AS="$AS"
3619
3620# The name of the directory that contains temporary libtool files.
3621objdir=$objdir
3622
3623# How to create reloadable object files.
3624reload_flag=$lt_reload_flag
3625reload_cmds=$lt_reload_cmds
3626
3627# How to pass a linker flag through the compiler.
3628wl=$lt_wl
3629
3630# Object file suffix (normally "o").
3631objext="$ac_objext"
3632
3633# Old archive suffix (normally "a").
3634libext="$libext"
3635
3636# Executable file suffix (normally "").
3637exeext="$exeext"
3638
3639# Additional compiler flags for building library objects.
3640pic_flag=$lt_pic_flag
3641pic_mode=$pic_mode
3642
3643# Does compiler simultaneously support -c and -o options?
3644compiler_c_o=$lt_compiler_c_o
3645
3646# Can we write directly to a .lo ?
3647compiler_o_lo=$lt_compiler_o_lo
3648
3649# Must we lock files when doing compilation ?
3650need_locks=$lt_need_locks
3651
3652# Do we need the lib prefix for modules?
3653need_lib_prefix=$need_lib_prefix
3654
3655# Do we need a version for libraries?
3656need_version=$need_version
3657
3658# Whether dlopen is supported.
3659dlopen_support=$enable_dlopen
3660
3661# Whether dlopen of programs is supported.
3662dlopen_self=$enable_dlopen_self
3663
3664# Whether dlopen of statically linked programs is supported.
3665dlopen_self_static=$enable_dlopen_self_static
3666
3667# Compiler flag to prevent dynamic linking.
3668link_static_flag=$lt_link_static_flag
3669
3670# Compiler flag to turn off builtin functions.
3671no_builtin_flag=$lt_no_builtin_flag
3672
3673# Compiler flag to allow reflexive dlopens.
3674export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
3675
3676# Compiler flag to generate shared objects directly from archives.
3677whole_archive_flag_spec=$lt_whole_archive_flag_spec
3678
3679# Compiler flag to generate thread-safe objects.
3680thread_safe_flag_spec=$lt_thread_safe_flag_spec
3681
3682# Library versioning type.
3683version_type=$version_type
3684
3685# Format of library name prefix.
3686libname_spec=$lt_libname_spec
3687
3688# List of archive names.  First name is the real one, the rest are links.
3689# The last name is the one that the linker finds with -lNAME.
3690library_names_spec=$lt_library_names_spec
3691
3692# The coded name of the library, if different from the real name.
3693soname_spec=$lt_soname_spec
3694
3695# Commands used to build and install an old-style archive.
3696RANLIB=$lt_RANLIB
3697old_archive_cmds=$lt_old_archive_cmds
3698old_postinstall_cmds=$lt_old_postinstall_cmds
3699old_postuninstall_cmds=$lt_old_postuninstall_cmds
3700
3701# Create an old-style archive from a shared archive.
3702old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
3703
3704# Create a temporary old-style archive to link instead of a shared archive.
3705old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
3706
3707# Commands used to build and install a shared archive.
3708archive_cmds=$lt_archive_cmds
3709archive_expsym_cmds=$lt_archive_expsym_cmds
3710postinstall_cmds=$lt_postinstall_cmds
3711postuninstall_cmds=$lt_postuninstall_cmds
3712
3713# Commands to strip libraries.
3714old_striplib=$lt_old_striplib
3715striplib=$lt_striplib
3716
3717# Method to check whether dependent libraries are shared objects.
3718deplibs_check_method=$lt_deplibs_check_method
3719
3720# Command to use when deplibs_check_method == file_magic.
3721file_magic_cmd=$lt_file_magic_cmd
3722
3723# Flag that allows shared libraries with undefined symbols to be built.
3724allow_undefined_flag=$lt_allow_undefined_flag
3725
3726# Flag that forces no undefined symbols.
3727no_undefined_flag=$lt_no_undefined_flag
3728
3729# Commands used to finish a libtool library installation in a directory.
3730finish_cmds=$lt_finish_cmds
3731
3732# Same as above, but a single script fragment to be evaled but not shown.
3733finish_eval=$lt_finish_eval
3734
3735# Take the output of nm and produce a listing of raw symbols and C names.
3736global_symbol_pipe=$lt_global_symbol_pipe
3737
3738# Transform the output of nm in a proper C declaration
3739global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
3740
3741# Transform the output of nm in a C name address pair
3742global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
3743
3744# This is the shared library runtime path variable.
3745runpath_var=$runpath_var
3746
3747# This is the shared library path variable.
3748shlibpath_var=$shlibpath_var
3749
3750# Is shlibpath searched before the hard-coded library search path?
3751shlibpath_overrides_runpath=$shlibpath_overrides_runpath
3752
3753# How to hardcode a shared library path into an executable.
3754hardcode_action=$hardcode_action
3755
3756# Whether we should hardcode library paths into libraries.
3757hardcode_into_libs=$hardcode_into_libs
3758
3759# Flag to hardcode \$libdir into a binary during linking.
3760# This must work even if \$libdir does not exist.
3761hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
3762
3763# Whether we need a single -rpath flag with a separated argument.
3764hardcode_libdir_separator=$lt_hardcode_libdir_separator
3765
3766# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
3767# resulting binary.
3768hardcode_direct=$hardcode_direct
3769
3770# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
3771# resulting binary.
3772hardcode_minus_L=$hardcode_minus_L
3773
3774# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
3775# the resulting binary.
3776hardcode_shlibpath_var=$hardcode_shlibpath_var
3777
3778# Variables whose values should be saved in libtool wrapper scripts and
3779# restored at relink time.
3780variables_saved_for_relink="$variables_saved_for_relink"
3781
3782# Whether libtool must link a program against all its dependency libraries.
3783link_all_deplibs=$link_all_deplibs
3784
3785# Compile-time system search path for libraries
3786sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
3787
3788# Run-time system search path for libraries
3789sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
3790
3791# Fix the shell variable \$srcfile for the compiler.
3792fix_srcfile_path="$fix_srcfile_path"
3793
3794# Set to yes if exported symbols are required.
3795always_export_symbols=$always_export_symbols
3796
3797# The commands to list exported symbols.
3798export_symbols_cmds=$lt_export_symbols_cmds
3799
3800# The commands to extract the exported symbol list from a shared archive.
3801extract_expsyms_cmds=$lt_extract_expsyms_cmds
3802
3803# Symbols that should not be listed in the preloaded symbols.
3804exclude_expsyms=$lt_exclude_expsyms
3805
3806# Symbols that must always be exported.
3807include_expsyms=$lt_include_expsyms
3808
3809# ### END LIBTOOL CONFIG
3810
3811__EOF__
3812
3813  case $host_os in
3814  aix3*)
3815    cat <<\EOF >> "${ofile}T"
3816
3817# AIX sometimes has problems with the GCC collect2 program.  For some
3818# reason, if we set the COLLECT_NAMES environment variable, the problems
3819# vanish in a puff of smoke.
3820if test "X${COLLECT_NAMES+set}" != Xset; then
3821  COLLECT_NAMES=
3822  export COLLECT_NAMES
3823fi
3824EOF
3825    ;;
3826  esac
3827
3828  case $host_os in
3829  cygwin* | mingw* | pw32* | os2*)
3830    cat <<'EOF' >> "${ofile}T"
3831      # This is a source program that is used to create dlls on Windows
3832      # Don't remove nor modify the starting and closing comments
3833# /* ltdll.c starts here */
3834# #define WIN32_LEAN_AND_MEAN
3835# #include <windows.h>
3836# #undef WIN32_LEAN_AND_MEAN
3837# #include <stdio.h>
3838#
3839# #ifndef __CYGWIN__
3840# #  ifdef __CYGWIN32__
3841# #    define __CYGWIN__ __CYGWIN32__
3842# #  endif
3843# #endif
3844#
3845# #ifdef __cplusplus
3846# extern "C" {
3847# #endif
3848# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
3849# #ifdef __cplusplus
3850# }
3851# #endif
3852#
3853# #ifdef __CYGWIN__
3854# #include <cygwin/cygwin_dll.h>
3855# DECLARE_CYGWIN_DLL( DllMain );
3856# #endif
3857# HINSTANCE __hDllInstance_base;
3858#
3859# BOOL APIENTRY
3860# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
3861# {
3862#   __hDllInstance_base = hInst;
3863#   return TRUE;
3864# }
3865# /* ltdll.c ends here */
3866	# This is a source program that is used to create import libraries
3867	# on Windows for dlls which lack them. Don't remove nor modify the
3868	# starting and closing comments
3869# /* impgen.c starts here */
3870# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
3871#
3872#  This file is part of GNU libtool.
3873#
3874#  This program is free software; you can redistribute it and/or modify
3875#  it under the terms of the GNU General Public License as published by
3876#  the Free Software Foundation; either version 2 of the License, or
3877#  (at your option) any later version.
3878#
3879#  This program is distributed in the hope that it will be useful,
3880#  but WITHOUT ANY WARRANTY; without even the implied warranty of
3881#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3882#  GNU General Public License for more details.
3883#
3884#  You should have received a copy of the GNU General Public License
3885#  along with this program; if not, write to the Free Software
3886#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3887#  */
3888#
3889# #include <stdio.h>		/* for printf() */
3890# #include <unistd.h>		/* for open(), lseek(), read() */
3891# #include <fcntl.h>		/* for O_RDONLY, O_BINARY */
3892# #include <string.h>		/* for strdup() */
3893#
3894# /* O_BINARY isn't required (or even defined sometimes) under Unix */
3895# #ifndef O_BINARY
3896# #define O_BINARY 0
3897# #endif
3898#
3899# static unsigned int
3900# pe_get16 (fd, offset)
3901#      int fd;
3902#      int offset;
3903# {
3904#   unsigned char b[2];
3905#   lseek (fd, offset, SEEK_SET);
3906#   read (fd, b, 2);
3907#   return b[0] + (b[1]<<8);
3908# }
3909#
3910# static unsigned int
3911# pe_get32 (fd, offset)
3912#     int fd;
3913#     int offset;
3914# {
3915#   unsigned char b[4];
3916#   lseek (fd, offset, SEEK_SET);
3917#   read (fd, b, 4);
3918#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3919# }
3920#
3921# static unsigned int
3922# pe_as32 (ptr)
3923#      void *ptr;
3924# {
3925#   unsigned char *b = ptr;
3926#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3927# }
3928#
3929# int
3930# main (argc, argv)
3931#     int argc;
3932#     char *argv[];
3933# {
3934#     int dll;
3935#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
3936#     unsigned long export_rva, export_size, nsections, secptr, expptr;
3937#     unsigned long name_rvas, nexp;
3938#     unsigned char *expdata, *erva;
3939#     char *filename, *dll_name;
3940#
3941#     filename = argv[1];
3942#
3943#     dll = open(filename, O_RDONLY|O_BINARY);
3944#     if (dll < 1)
3945# 	return 1;
3946#
3947#     dll_name = filename;
3948#
3949#     for (i=0; filename[i]; i++)
3950# 	if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
3951# 	    dll_name = filename + i +1;
3952#
3953#     pe_header_offset = pe_get32 (dll, 0x3c);
3954#     opthdr_ofs = pe_header_offset + 4 + 20;
3955#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
3956#
3957#     if (num_entries < 1) /* no exports */
3958# 	return 1;
3959#
3960#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
3961#     export_size = pe_get32 (dll, opthdr_ofs + 100);
3962#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3963#     secptr = (pe_header_offset + 4 + 20 +
3964# 	      pe_get16 (dll, pe_header_offset + 4 + 16));
3965#
3966#     expptr = 0;
3967#     for (i = 0; i < nsections; i++)
3968#     {
3969# 	char sname[8];
3970# 	unsigned long secptr1 = secptr + 40 * i;
3971# 	unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3972# 	unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3973# 	unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3974# 	lseek(dll, secptr1, SEEK_SET);
3975# 	read(dll, sname, 8);
3976# 	if (vaddr <= export_rva && vaddr+vsize > export_rva)
3977# 	{
3978# 	    expptr = fptr + (export_rva - vaddr);
3979# 	    if (export_rva + export_size > vaddr + vsize)
3980# 		export_size = vsize - (export_rva - vaddr);
3981# 	    break;
3982# 	}
3983#     }
3984#
3985#     expdata = (unsigned char*)malloc(export_size);
3986#     lseek (dll, expptr, SEEK_SET);
3987#     read (dll, expdata, export_size);
3988#     erva = expdata - export_rva;
3989#
3990#     nexp = pe_as32 (expdata+24);
3991#     name_rvas = pe_as32 (expdata+32);
3992#
3993#     printf ("EXPORTS\n");
3994#     for (i = 0; i<nexp; i++)
3995#     {
3996# 	unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3997# 	printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3998#     }
3999#
4000#     return 0;
4001# }
4002# /* impgen.c ends here */
4003
4004EOF
4005    ;;
4006  esac
4007
4008  # We use sed instead of cat because bash on DJGPP gets confused if
4009  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4010  # text mode, it properly converts lines to CR/LF.  This bash problem
4011  # is reportedly fixed, but why not run on old versions too?
4012  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
4013
4014  mv -f "${ofile}T" "$ofile" || \
4015    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
4016  chmod +x "$ofile"
4017fi
4018
4019])# _LT_AC_LTCONFIG_HACK
4020
4021# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
4022AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
4023
4024# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
4025AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
4026
4027# AC_ENABLE_SHARED - implement the --enable-shared flag
4028# Usage: AC_ENABLE_SHARED[(DEFAULT)]
4029#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
4030#   `yes'.
4031AC_DEFUN([AC_ENABLE_SHARED],
4032[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
4033AC_ARG_ENABLE(shared,
4034changequote(<<, >>)dnl
4035<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
4036changequote([, ])dnl
4037[p=${PACKAGE-default}
4038case $enableval in
4039yes) enable_shared=yes ;;
4040no) enable_shared=no ;;
4041*)
4042  enable_shared=no
4043  # Look at the argument we got.  We use all the common list separators.
4044  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4045  for pkg in $enableval; do
4046    if test "X$pkg" = "X$p"; then
4047      enable_shared=yes
4048    fi
4049  done
4050  IFS="$ac_save_ifs"
4051  ;;
4052esac],
4053enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
4054])
4055
4056# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
4057AC_DEFUN([AC_DISABLE_SHARED],
4058[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4059AC_ENABLE_SHARED(no)])
4060
4061# AC_ENABLE_STATIC - implement the --enable-static flag
4062# Usage: AC_ENABLE_STATIC[(DEFAULT)]
4063#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
4064#   `yes'.
4065AC_DEFUN([AC_ENABLE_STATIC],
4066[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
4067AC_ARG_ENABLE(static,
4068changequote(<<, >>)dnl
4069<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
4070changequote([, ])dnl
4071[p=${PACKAGE-default}
4072case $enableval in
4073yes) enable_static=yes ;;
4074no) enable_static=no ;;
4075*)
4076  enable_static=no
4077  # Look at the argument we got.  We use all the common list separators.
4078  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4079  for pkg in $enableval; do
4080    if test "X$pkg" = "X$p"; then
4081      enable_static=yes
4082    fi
4083  done
4084  IFS="$ac_save_ifs"
4085  ;;
4086esac],
4087enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
4088])
4089
4090# AC_DISABLE_STATIC - set the default static flag to --disable-static
4091AC_DEFUN([AC_DISABLE_STATIC],
4092[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4093AC_ENABLE_STATIC(no)])
4094
4095
4096# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
4097# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
4098#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
4099#   `yes'.
4100AC_DEFUN([AC_ENABLE_FAST_INSTALL],
4101[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
4102AC_ARG_ENABLE(fast-install,
4103changequote(<<, >>)dnl
4104<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
4105changequote([, ])dnl
4106[p=${PACKAGE-default}
4107case $enableval in
4108yes) enable_fast_install=yes ;;
4109no) enable_fast_install=no ;;
4110*)
4111  enable_fast_install=no
4112  # Look at the argument we got.  We use all the common list separators.
4113  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4114  for pkg in $enableval; do
4115    if test "X$pkg" = "X$p"; then
4116      enable_fast_install=yes
4117    fi
4118  done
4119  IFS="$ac_save_ifs"
4120  ;;
4121esac],
4122enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
4123])
4124
4125# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
4126AC_DEFUN([AC_DISABLE_FAST_INSTALL],
4127[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4128AC_ENABLE_FAST_INSTALL(no)])
4129
4130# AC_LIBTOOL_PICMODE - implement the --with-pic flag
4131# Usage: AC_LIBTOOL_PICMODE[(MODE)]
4132#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
4133#   `both'.
4134AC_DEFUN([AC_LIBTOOL_PICMODE],
4135[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4136pic_mode=ifelse($#,1,$1,default)])
4137
4138
4139# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
4140AC_DEFUN([AC_PATH_TOOL_PREFIX],
4141[AC_MSG_CHECKING([for $1])
4142AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4143[case $MAGIC_CMD in
4144  /*)
4145  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4146  ;;
4147  ?:/*)
4148  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4149  ;;
4150  *)
4151  ac_save_MAGIC_CMD="$MAGIC_CMD"
4152  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4153dnl $ac_dummy forces splitting on constant user-supplied paths.
4154dnl POSIX.2 word splitting is done only on the output of word expansions,
4155dnl not every word.  This closes a longstanding sh security hole.
4156  ac_dummy="ifelse([$2], , $PATH, [$2])"
4157  for ac_dir in $ac_dummy; do
4158    test -z "$ac_dir" && ac_dir=.
4159    if test -f $ac_dir/$1; then
4160      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4161      if test -n "$file_magic_test_file"; then
4162	case $deplibs_check_method in
4163	"file_magic "*)
4164	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4165	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4166	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4167	    egrep "$file_magic_regex" > /dev/null; then
4168	    :
4169	  else
4170	    cat <<EOF 1>&2
4171
4172*** Warning: the command libtool uses to detect shared libraries,
4173*** $file_magic_cmd, produces output that libtool cannot recognize.
4174*** The result is that libtool may fail to recognize shared libraries
4175*** as such.  This will affect the creation of libtool libraries that
4176*** depend on shared libraries, but programs linked with such libtool
4177*** libraries will work regardless of this problem.  Nevertheless, you
4178*** may want to report the problem to your system manager and/or to
4179*** bug-libtool@gnu.org
4180
4181EOF
4182	  fi ;;
4183	esac
4184      fi
4185      break
4186    fi
4187  done
4188  IFS="$ac_save_ifs"
4189  MAGIC_CMD="$ac_save_MAGIC_CMD"
4190  ;;
4191esac])
4192MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4193if test -n "$MAGIC_CMD"; then
4194  AC_MSG_RESULT($MAGIC_CMD)
4195else
4196  AC_MSG_RESULT(no)
4197fi
4198])
4199
4200
4201# AC_PATH_MAGIC - find a file program which can recognise a shared library
4202AC_DEFUN([AC_PATH_MAGIC],
4203[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
4204AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
4205if test -z "$lt_cv_path_MAGIC_CMD"; then
4206  if test -n "$ac_tool_prefix"; then
4207    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
4208  else
4209    MAGIC_CMD=:
4210  fi
4211fi
4212])
4213
4214
4215# AC_PROG_LD - find the path to the GNU or non-GNU linker
4216AC_DEFUN([AC_PROG_LD],
4217[AC_ARG_WITH(gnu-ld,
4218[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
4219test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4220AC_REQUIRE([AC_PROG_CC])dnl
4221AC_REQUIRE([AC_CANONICAL_HOST])dnl
4222AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4223AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4224ac_prog=ld
4225if test "$GCC" = yes; then
4226  # Check if gcc -print-prog-name=ld gives a path.
4227  AC_MSG_CHECKING([for ld used by GCC])
4228  case $host in
4229  *-*-mingw*)
4230    # gcc leaves a trailing carriage return which upsets mingw
4231    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4232  *)
4233    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4234  esac
4235  case $ac_prog in
4236    # Accept absolute paths.
4237    [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
4238      re_direlt='/[[^/]][[^/]]*/\.\./'
4239      # Canonicalize the path of ld
4240      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4241      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4242	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4243      done
4244      test -z "$LD" && LD="$ac_prog"
4245      ;;
4246  "")
4247    # If it fails, then pretend we aren't using GCC.
4248    ac_prog=ld
4249    ;;
4250  *)
4251    # If it is relative, then search for the first ld in PATH.
4252    with_gnu_ld=unknown
4253    ;;
4254  esac
4255elif test "$with_gnu_ld" = yes; then
4256  AC_MSG_CHECKING([for GNU ld])
4257else
4258  AC_MSG_CHECKING([for non-GNU ld])
4259fi
4260AC_CACHE_VAL(lt_cv_path_LD,
4261[if test -z "$LD"; then
4262  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4263  for ac_dir in $PATH; do
4264    test -z "$ac_dir" && ac_dir=.
4265    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4266      lt_cv_path_LD="$ac_dir/$ac_prog"
4267      # Check to see if the program is GNU ld.  I'd rather use --version,
4268      # but apparently some GNU ld's only accept -v.
4269      # Break only if it was the GNU/non-GNU ld that we prefer.
4270      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4271	test "$with_gnu_ld" != no && break
4272      else
4273	test "$with_gnu_ld" != yes && break
4274      fi
4275    fi
4276  done
4277  IFS="$ac_save_ifs"
4278else
4279  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4280fi])
4281LD="$lt_cv_path_LD"
4282if test -n "$LD"; then
4283  AC_MSG_RESULT($LD)
4284else
4285  AC_MSG_RESULT(no)
4286fi
4287test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4288AC_PROG_LD_GNU
4289])
4290
4291# AC_PROG_LD_GNU -
4292AC_DEFUN([AC_PROG_LD_GNU],
4293[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4294[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4295if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4296  lt_cv_prog_gnu_ld=yes
4297else
4298  lt_cv_prog_gnu_ld=no
4299fi])
4300with_gnu_ld=$lt_cv_prog_gnu_ld
4301])
4302
4303# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
4304#   -- PORTME Some linkers may need a different reload flag.
4305AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
4306[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
4307[lt_cv_ld_reload_flag='-r'])
4308reload_flag=$lt_cv_ld_reload_flag
4309test -n "$reload_flag" && reload_flag=" $reload_flag"
4310])
4311
4312# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
4313#  -- PORTME fill in with the dynamic library characteristics
4314AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
4315[AC_CACHE_CHECK([how to recognise dependant libraries],
4316lt_cv_deplibs_check_method,
4317[lt_cv_file_magic_cmd='$MAGIC_CMD'
4318lt_cv_file_magic_test_file=
4319lt_cv_deplibs_check_method='unknown'
4320# Need to set the preceding variable on all platforms that support
4321# interlibrary dependencies.
4322# 'none' -- dependencies not supported.
4323# `unknown' -- same as none, but documents that we really don't know.
4324# 'pass_all' -- all dependencies passed with no checks.
4325# 'test_compile' -- check by making test program.
4326# 'file_magic [[regex]]' -- check by looking for files in library path
4327# which responds to the $file_magic_cmd with a given egrep regex.
4328# If you have `file' or equivalent on your system and you're not sure
4329# whether `pass_all' will *always* work, you probably want this one.
4330
4331case $host_os in
4332aix4* | aix5*)
4333  lt_cv_deplibs_check_method=pass_all
4334  ;;
4335
4336beos*)
4337  lt_cv_deplibs_check_method=pass_all
4338  ;;
4339
4340bsdi4*)
4341  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4342  lt_cv_file_magic_cmd='/usr/bin/file -L'
4343  lt_cv_file_magic_test_file=/shlib/libc.so
4344  ;;
4345
4346cygwin* | mingw* | pw32*)
4347  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
4348  lt_cv_file_magic_cmd='$OBJDUMP -f'
4349  ;;
4350
4351darwin* | rhapsody*)
4352  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
4353  lt_cv_file_magic_cmd='/usr/bin/file -L'
4354  case "$host_os" in
4355  rhapsody* | darwin1.[[012]])
4356    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
4357    ;;
4358  *) # Darwin 1.3 on
4359    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
4360    ;;
4361  esac
4362  ;;
4363
4364freebsd*)
4365  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4366    case $host_cpu in
4367    i*86 )
4368      # Not sure whether the presence of OpenBSD here was a mistake.
4369      # Let's accept both of them until this is cleared up.
4370      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
4371      lt_cv_file_magic_cmd=/usr/bin/file
4372      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4373      ;;
4374    esac
4375  else
4376    lt_cv_deplibs_check_method=pass_all
4377  fi
4378  ;;
4379
4380gnu*)
4381  lt_cv_deplibs_check_method=pass_all
4382  ;;
4383
4384hpux10.20*|hpux11*)
4385  lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
4386  lt_cv_file_magic_cmd=/usr/bin/file
4387  lt_cv_file_magic_test_file=/usr/lib/libc.sl
4388  ;;
4389
4390irix5* | irix6*)
4391  case $host_os in
4392  irix5*)
4393    # this will be overridden with pass_all, but let us keep it just in case
4394    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
4395    ;;
4396  *)
4397    case $LD in
4398    *-32|*"-32 ") libmagic=32-bit;;
4399    *-n32|*"-n32 ") libmagic=N32;;
4400    *-64|*"-64 ") libmagic=64-bit;;
4401    *) libmagic=never-match;;
4402    esac
4403    # this will be overridden with pass_all, but let us keep it just in case
4404    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
4405    ;;
4406  esac
4407  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
4408  lt_cv_deplibs_check_method=pass_all
4409  ;;
4410
4411# This must be Linux ELF.
4412linux-gnu*)
4413  case $host_cpu in
4414  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* )
4415    lt_cv_deplibs_check_method=pass_all ;;
4416  *)
4417    # glibc up to 2.1.1 does not perform some relocations on ARM
4418    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
4419  esac
4420  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
4421  ;;
4422
4423netbsd*)
4424  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4425    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
4426  else
4427    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
4428  fi
4429  ;;
4430
4431newos6*)
4432  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4433  lt_cv_file_magic_cmd=/usr/bin/file
4434  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4435  ;;
4436
4437openbsd*)
4438  lt_cv_file_magic_cmd=/usr/bin/file
4439  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4440  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4441    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
4442  else
4443    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
4444  fi
4445  ;;
4446
4447osf3* | osf4* | osf5*)
4448  # this will be overridden with pass_all, but let us keep it just in case
4449  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
4450  lt_cv_file_magic_test_file=/shlib/libc.so
4451  lt_cv_deplibs_check_method=pass_all
4452  ;;
4453
4454sco3.2v5*)
4455  lt_cv_deplibs_check_method=pass_all
4456  ;;
4457
4458solaris*)
4459  lt_cv_deplibs_check_method=pass_all
4460  lt_cv_file_magic_test_file=/lib/libc.so
4461  ;;
4462
4463sysv5uw[[78]]* | sysv4*uw2*)
4464  lt_cv_deplibs_check_method=pass_all
4465  ;;
4466
4467sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4468  case $host_vendor in
4469  motorola)
4470    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]]'
4471    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4472    ;;
4473  ncr)
4474    lt_cv_deplibs_check_method=pass_all
4475    ;;
4476  sequent)
4477    lt_cv_file_magic_cmd='/bin/file'
4478    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4479    ;;
4480  sni)
4481    lt_cv_file_magic_cmd='/bin/file'
4482    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4483    lt_cv_file_magic_test_file=/lib/libc.so
4484    ;;
4485  esac
4486  ;;
4487esac
4488])
4489file_magic_cmd=$lt_cv_file_magic_cmd
4490deplibs_check_method=$lt_cv_deplibs_check_method
4491])
4492
4493
4494# AC_PROG_NM - find the path to a BSD-compatible name lister
4495AC_DEFUN([AC_PROG_NM],
4496[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4497AC_MSG_CHECKING([for BSD-compatible nm])
4498AC_CACHE_VAL(lt_cv_path_NM,
4499[if test -n "$NM"; then
4500  # Let the user override the test.
4501  lt_cv_path_NM="$NM"
4502else
4503  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4504  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
4505    test -z "$ac_dir" && ac_dir=.
4506    tmp_nm=$ac_dir/${ac_tool_prefix}nm
4507    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
4508      # Check to see if the nm accepts a BSD-compat flag.
4509      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4510      #   nm: unknown option "B" ignored
4511      # Tru64's nm complains that /dev/null is an invalid object file
4512      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
4513	lt_cv_path_NM="$tmp_nm -B"
4514	break
4515      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
4516	lt_cv_path_NM="$tmp_nm -p"
4517	break
4518      else
4519	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4520	continue # so that we can try to find one that supports BSD flags
4521      fi
4522    fi
4523  done
4524  IFS="$ac_save_ifs"
4525  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
4526fi])
4527NM="$lt_cv_path_NM"
4528AC_MSG_RESULT([$NM])
4529])
4530
4531# AC_CHECK_LIBM - check for math library
4532AC_DEFUN([AC_CHECK_LIBM],
4533[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4534LIBM=
4535case $host in
4536*-*-beos* | *-*-cygwin* | *-*-pw32*)
4537  # These system don't have libm
4538  ;;
4539*-ncr-sysv4.3*)
4540  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4541  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
4542  ;;
4543*)
4544  AC_CHECK_LIB(m, main, LIBM="-lm")
4545  ;;
4546esac
4547])
4548
4549# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
4550# the libltdl convenience library and INCLTDL to the include flags for
4551# the libltdl header and adds --enable-ltdl-convenience to the
4552# configure arguments.  Note that LIBLTDL and INCLTDL are not
4553# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
4554# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
4555# with '${top_builddir}/' and INCLTDL will be prefixed with
4556# '${top_srcdir}/' (note the single quotes!).  If your package is not
4557# flat and you're not using automake, define top_builddir and
4558# top_srcdir appropriately in the Makefiles.
4559AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
4560[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4561  case $enable_ltdl_convenience in
4562  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
4563  "") enable_ltdl_convenience=yes
4564      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
4565  esac
4566  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
4567  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4568])
4569
4570# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
4571# the libltdl installable library and INCLTDL to the include flags for
4572# the libltdl header and adds --enable-ltdl-install to the configure
4573# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
4574# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
4575# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
4576# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
4577# with '${top_srcdir}/' (note the single quotes!).  If your package is
4578# not flat and you're not using automake, define top_builddir and
4579# top_srcdir appropriately in the Makefiles.
4580# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
4581AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
4582[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4583  AC_CHECK_LIB(ltdl, main,
4584  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
4585  [if test x"$enable_ltdl_install" = xno; then
4586     AC_MSG_WARN([libltdl not installed, but installation disabled])
4587   else
4588     enable_ltdl_install=yes
4589   fi
4590  ])
4591  if test x"$enable_ltdl_install" = x"yes"; then
4592    ac_configure_args="$ac_configure_args --enable-ltdl-install"
4593    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
4594    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4595  else
4596    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
4597    LIBLTDL="-lltdl"
4598    INCLTDL=
4599  fi
4600])
4601
4602# old names
4603AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
4604AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
4605AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
4606AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
4607AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
4608AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
4609AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
4610
4611# This is just to silence aclocal about the macro not being used
4612ifelse([AC_DISABLE_FAST_INSTALL])
4613
4614