OSDN Git Service

2004-06-25 Artem B. Bityuckiy <dedekind@oktetlabs.ru>
[pf3gnuchains/pf3gnuchains3x.git] / newlib / libc / sys / linux / linuxthreads / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 dnl This provides configure definitions used by all the newlib
14 dnl configure.in files.
15
16 dnl Basic newlib configury.  This calls basic introductory stuff,
17 dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST.  It also runs
18 dnl configure.host.  The only argument is the relative path to the top
19 dnl newlib directory.
20
21 AC_DEFUN(NEWLIB_CONFIGURE,
22 [
23 dnl Default to --enable-multilib
24 AC_ARG_ENABLE(multilib,
25 [  --enable-multilib         build many library versions (default)],
26 [case "${enableval}" in
27   yes) multilib=yes ;;
28   no)  multilib=no ;;
29   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
30  esac], [multilib=yes])dnl
31
32 dnl Support --enable-target-optspace
33 AC_ARG_ENABLE(target-optspace,
34 [  --enable-target-optspace  optimize for space],
35 [case "${enableval}" in
36   yes) target_optspace=yes ;;
37   no)  target_optspace=no ;;
38   *)   AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
39  esac], [target_optspace=])dnl
40
41 dnl Support --enable-malloc-debugging - currently only supported for Cygwin
42 AC_ARG_ENABLE(malloc-debugging,
43 [  --enable-malloc-debugging indicate malloc debugging requested],
44 [case "${enableval}" in
45   yes) malloc_debugging=yes ;;
46   no)  malloc_debugging=no ;;
47   *)   AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;;
48  esac], [malloc_debugging=])dnl
49
50 dnl Support --enable-newlib-multithread
51 AC_ARG_ENABLE(newlib-multithread,
52 [  --enable-newlib-multithread        enable support for multiple threads],
53 [case "${enableval}" in
54   yes) newlib_multithread=yes ;;
55   no)  newlib_multithread=no ;;
56   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;;
57  esac], [newlib_multithread=yes])dnl
58
59 dnl Support --enable-newlib-elix-level
60 AC_ARG_ENABLE(newlib-elix-level,
61 [  --enable-newlib-elix-level         supply desired elix library level (1-4)],
62 [case "${enableval}" in
63   0)   newlib_elix_level=0 ;;
64   1)   newlib_elix_level=1 ;;
65   2)   newlib_elix_level=2 ;;
66   3)   newlib_elix_level=3 ;;
67   4)   newlib_elix_level=4 ;;
68   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;;
69  esac], [newlib_elix_level=0])dnl
70
71 dnl Support --disable-newlib-io-float
72 AC_ARG_ENABLE(newlib-io-float,
73 [  --disable-newlib-io-float disable printf/scanf family float support],
74 [case "${enableval}" in
75   yes) newlib_io_float=yes ;;
76   no)  newlib_io_float=no ;;
77   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;;
78  esac], [newlib_io_float=yes])dnl
79
80 dnl Support --disable-newlib-supplied-syscalls
81 AC_ARG_ENABLE(newlib-supplied-syscalls,
82 [  --disable-newlib-supplied-syscalls disable newlib from supplying syscalls],
83 [case "${enableval}" in
84   yes) newlib_may_supply_syscalls=yes ;;
85   no)  newlib_may_supply_syscalls=no ;;
86   *)   AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;;
87  esac], [newlib_may_supply_syscalls=yes])dnl
88
89 AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes)
90
91 dnl We may get other options which we don't document:
92 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
93
94 test -z "[$]{with_target_subdir}" && with_target_subdir=.
95
96 if test "[$]{srcdir}" = "."; then
97   if test "[$]{with_target_subdir}" != "."; then
98     newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
99   else
100     newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
101   fi
102 else
103   newlib_basedir="[$]{srcdir}/$1"
104 fi
105 AC_SUBST(newlib_basedir)
106
107 AC_CANONICAL_SYSTEM
108
109 AM_INIT_AUTOMAKE(newlib, 1.12.0)
110
111 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
112 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
113 # are probably using a cross compiler, which will not be able to fully
114 # link an executable.  This should really be fixed in autoconf
115 # itself.
116
117 AC_DEFUN(LIB_AC_PROG_CC,
118 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
119 AC_CHECK_PROG(CC, gcc, gcc)
120 if test -z "$CC"; then
121   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
122   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
123 fi
124
125 AC_PROG_CC_GNU
126
127 if test $ac_cv_prog_gcc = yes; then
128   GCC=yes
129 dnl Check whether -g works, even if CFLAGS is set, in case the package
130 dnl plays around with CFLAGS (such as to build both debugging and
131 dnl normal versions of a library), tasteless as that idea is.
132   ac_test_CFLAGS="${CFLAGS+set}"
133   ac_save_CFLAGS="$CFLAGS"
134   CFLAGS=
135   AC_PROG_CC_G
136   if test "$ac_test_CFLAGS" = set; then
137     CFLAGS="$ac_save_CFLAGS"
138   elif test $ac_cv_prog_cc_g = yes; then
139     CFLAGS="-g -O2"
140   else
141     CFLAGS="-O2"
142   fi
143 else
144   GCC=
145   test "${CFLAGS+set}" = set || CFLAGS="-g"
146 fi
147 ])
148
149 LIB_AC_PROG_CC
150
151 AC_CHECK_TOOL(AS, as)
152 AC_CHECK_TOOL(AR, ar)
153 AC_CHECK_TOOL(RANLIB, ranlib, :)
154
155 AC_PROG_INSTALL
156
157 AM_MAINTAINER_MODE
158
159 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
160 # at least currently, we never actually build a program, so we never
161 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
162 # fails, because we are probably configuring with a cross compiler
163 # which can't create executables.  So we include AC_EXEEXT to keep
164 # automake happy, but we don't execute it, since we don't care about
165 # the result.
166 if false; then
167   AC_EXEEXT
168 fi
169
170 . [$]{newlib_basedir}/configure.host
171
172 newlib_cflags="[$]{newlib_cflags} -fno-builtin"
173
174 NEWLIB_CFLAGS=${newlib_cflags}
175 AC_SUBST(NEWLIB_CFLAGS)
176
177 LDFLAGS=${ldflags}
178 AC_SUBST(LDFLAGS)
179
180 AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0)
181 AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1)
182 AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2)
183 AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3)
184 AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4)
185
186 AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes)
187
188 # Hard-code OBJEXT.  Normally it is set by AC_OBJEXT, but we
189 # use oext, which is set in configure.host based on the target platform.
190 OBJEXT=${oext}
191
192 AC_SUBST(OBJEXT)
193 AC_SUBST(oext)
194 AC_SUBST(aext)
195
196 AC_SUBST(libm_machine_dir)
197 AC_SUBST(machine_dir)
198 AC_SUBST(sys_dir)
199 ])
200
201 # Do all the work for Automake.  This macro actually does too much --
202 # some checks are only needed if your package does certain things.
203 # But this isn't really a big deal.
204
205 # serial 1
206
207 dnl Usage:
208 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
209
210 AC_DEFUN([AM_INIT_AUTOMAKE],
211 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
212 AC_REQUIRE([AC_PROG_INSTALL])
213 PACKAGE=[$1]
214 AC_SUBST(PACKAGE)
215 VERSION=[$2]
216 AC_SUBST(VERSION)
217 dnl test to see if srcdir already configured
218 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
219   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
220 fi
221 ifelse([$3],,
222 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
223 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
224 AC_REQUIRE([AM_SANITY_CHECK])
225 AC_REQUIRE([AC_ARG_PROGRAM])
226 dnl FIXME This is truly gross.
227 missing_dir=`cd $ac_aux_dir && pwd`
228 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
229 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
230 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
231 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
232 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
233 AC_REQUIRE([AC_PROG_MAKE_SET])])
234
235 # Copyright 2002  Free Software Foundation, Inc.
236
237 # This program is free software; you can redistribute it and/or modify
238 # it under the terms of the GNU General Public License as published by
239 # the Free Software Foundation; either version 2, or (at your option)
240 # any later version.
241
242 # This program is distributed in the hope that it will be useful,
243 # but WITHOUT ANY WARRANTY; without even the implied warranty of
244 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
245 # GNU General Public License for more details.
246
247 # You should have received a copy of the GNU General Public License
248 # along with this program; if not, write to the Free Software
249 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
250
251 # AM_AUTOMAKE_VERSION(VERSION)
252 # ----------------------------
253 # Automake X.Y traces this macro to ensure aclocal.m4 has been
254 # generated from the m4 files accompanying Automake X.Y.
255 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
256
257 # AM_SET_CURRENT_AUTOMAKE_VERSION
258 # -------------------------------
259 # Call AM_AUTOMAKE_VERSION so it can be traced.
260 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
261 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
262          [AM_AUTOMAKE_VERSION([1.4-p6])])
263
264 #
265 # Check to make sure that the build environment is sane.
266 #
267
268 AC_DEFUN([AM_SANITY_CHECK],
269 [AC_MSG_CHECKING([whether build environment is sane])
270 # Just in case
271 sleep 1
272 echo timestamp > conftestfile
273 # Do `set' in a subshell so we don't clobber the current shell's
274 # arguments.  Must try -L first in case configure is actually a
275 # symlink; some systems play weird games with the mod time of symlinks
276 # (eg FreeBSD returns the mod time of the symlink's containing
277 # directory).
278 if (
279    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
280    if test "[$]*" = "X"; then
281       # -L didn't work.
282       set X `ls -t $srcdir/configure conftestfile`
283    fi
284    if test "[$]*" != "X $srcdir/configure conftestfile" \
285       && test "[$]*" != "X conftestfile $srcdir/configure"; then
286
287       # If neither matched, then we have a broken ls.  This can happen
288       # if, for instance, CONFIG_SHELL is bash and it inherits a
289       # broken ls alias from the environment.  This has actually
290       # happened.  Such a system could not be considered "sane".
291       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
292 alias in your environment])
293    fi
294
295    test "[$]2" = conftestfile
296    )
297 then
298    # Ok.
299    :
300 else
301    AC_MSG_ERROR([newly created file is older than distributed files!
302 Check your system clock])
303 fi
304 rm -f conftest*
305 AC_MSG_RESULT(yes)])
306
307 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
308 dnl The program must properly implement --version.
309 AC_DEFUN([AM_MISSING_PROG],
310 [AC_MSG_CHECKING(for working $2)
311 # Run test in a subshell; some versions of sh will print an error if
312 # an executable is not found, even if stderr is redirected.
313 # Redirect stdin to placate older versions of autoconf.  Sigh.
314 if ($2 --version) < /dev/null > /dev/null 2>&1; then
315    $1=$2
316    AC_MSG_RESULT(found)
317 else
318    $1="$3/missing $2"
319    AC_MSG_RESULT(missing)
320 fi
321 AC_SUBST($1)])
322
323 # Define a conditional.
324
325 AC_DEFUN([AM_CONDITIONAL],
326 [AC_SUBST($1_TRUE)
327 AC_SUBST($1_FALSE)
328 if $2; then
329   $1_TRUE=
330   $1_FALSE='#'
331 else
332   $1_TRUE='#'
333   $1_FALSE=
334 fi])
335
336 # Add --enable-maintainer-mode option to configure.
337 # From Jim Meyering
338
339 # serial 1
340
341 AC_DEFUN([AM_MAINTAINER_MODE],
342 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
343   dnl maintainer-mode is disabled by default
344   AC_ARG_ENABLE(maintainer-mode,
345 [  --enable-maintainer-mode enable make rules and dependencies not useful
346                           (and sometimes confusing) to the casual installer],
347       USE_MAINTAINER_MODE=$enableval,
348       USE_MAINTAINER_MODE=no)
349   AC_MSG_RESULT($USE_MAINTAINER_MODE)
350   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
351   MAINT=$MAINTAINER_MODE_TRUE
352   AC_SUBST(MAINT)dnl
353 ]
354 )
355
356
357 # serial 46 AC_PROG_LIBTOOL
358 AC_DEFUN([AC_PROG_LIBTOOL],
359 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
360 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
361 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
362   AC_PROVIDE_IFELSE([AC_PROG_CXX],
363     [AC_LIBTOOL_CXX],
364     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
365 ])])
366
367 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
368 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
369 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
370   AC_PROVIDE_IFELSE([AC_PROG_GCJ],
371     [AC_LIBTOOL_GCJ],
372     [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
373         [AC_LIBTOOL_GCJ],
374         [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
375           [AC_LIBTOOL_GCJ],
376         [ifdef([AC_PROG_GCJ],
377                [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
378 ])])
379          ifdef([A][M_PROG_GCJ],
380                [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
381 ])])
382          ifdef([LT_AC_PROG_GCJ],
383                [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
384 ])])])])])])
385
386 AC_DEFUN([_AC_PROG_LIBTOOL],
387 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
388 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
389 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
390
391 # Save cache, so that ltconfig can load it
392 AC_CACHE_SAVE
393
394 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
395 AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
396 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
397 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
398 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
399 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
400 deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
401 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
402 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
403 || AC_MSG_ERROR([libtool configure failed])
404
405 # Reload cache, that may have been modified by ltconfig
406 AC_CACHE_LOAD
407
408 # This can be used to rebuild libtool when needed
409 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
410
411 # Always use our own libtool.
412 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
413 AC_SUBST(LIBTOOL)dnl
414
415 # Redirect the config.log output again, so that the ltconfig log is not
416 # clobbered by the next message.
417 exec 5>>./config.log
418 ])
419
420 AC_DEFUN([AC_LIBTOOL_SETUP],
421 [AC_PREREQ(2.13)dnl
422 AC_REQUIRE([AC_ENABLE_SHARED])dnl
423 AC_REQUIRE([AC_ENABLE_STATIC])dnl
424 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
425 AC_REQUIRE([AC_CANONICAL_HOST])dnl
426 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
427 AC_REQUIRE([AC_PROG_CC])dnl
428 AC_REQUIRE([AC_PROG_LD])dnl
429 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
430 AC_REQUIRE([AC_PROG_NM])dnl
431 AC_REQUIRE([AC_PROG_LN_S])dnl
432 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
433 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
434 AC_REQUIRE([AC_OBJEXT])dnl
435 AC_REQUIRE([AC_EXEEXT])dnl
436 dnl
437
438 # Only perform the check for file, if the check method requires it
439 case $deplibs_check_method in
440 file_magic*)
441   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
442     AC_PATH_MAGIC
443   fi
444   ;;
445 esac
446
447 AC_CHECK_TOOL(RANLIB, ranlib, :)
448 AC_CHECK_TOOL(STRIP, strip, :)
449
450 # Check for any special flags to pass to ltconfig.
451 libtool_flags="--cache-file=$cache_file"
452 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
453 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
454 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
455 test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
456 test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
457 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
458 [libtool_flags="$libtool_flags --enable-dlopen"])
459 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
460 [libtool_flags="$libtool_flags --enable-win32-dll"])
461 AC_ARG_ENABLE(libtool-lock,
462   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
463 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
464 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
465
466 AC_ARG_WITH(pic,
467   [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
468      pic_mode="$withval", pic_mode=default)
469 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
470 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
471
472 # Some flags need to be propagated to the compiler or linker for good
473 # libtool support.
474 case $host in
475 *-*-irix6*)
476   # Find out which ABI we are using.
477   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
478   if AC_TRY_EVAL(ac_compile); then
479     case `/usr/bin/file conftest.$ac_objext` in
480     *32-bit*)
481       LD="${LD-ld} -32"
482       ;;
483     *N32*)
484       LD="${LD-ld} -n32"
485       ;;
486     *64-bit*)
487       LD="${LD-ld} -64"
488       ;;
489     esac
490   fi
491   rm -rf conftest*
492   ;;
493
494 ia64-*-hpux*)
495   # Find out which ABI we are using.
496   echo 'int i;' > conftest.$ac_ext
497   if AC_TRY_EVAL(ac_compile); then
498     case "`/usr/bin/file conftest.o`" in
499     *ELF-32*)
500       HPUX_IA64_MODE="32"
501       ;;
502     *ELF-64*)
503       HPUX_IA64_MODE="64"
504       ;;
505     esac
506   fi
507   rm -rf conftest*
508   ;;
509
510 *-*-sco3.2v5*)
511   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
512   SAVE_CFLAGS="$CFLAGS"
513   CFLAGS="$CFLAGS -belf"
514   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
515     [AC_LANG_SAVE
516      AC_LANG_C
517      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
518      AC_LANG_RESTORE])
519   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
520     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
521     CFLAGS="$SAVE_CFLAGS"
522   fi
523   ;;
524
525 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
526 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
527   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
528   AC_CHECK_TOOL(AS, as, false)
529   AC_CHECK_TOOL(OBJDUMP, objdump, false)
530
531   # recent cygwin and mingw systems supply a stub DllMain which the user
532   # can override, but on older systems we have to supply one
533   AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
534     [AC_TRY_LINK([],
535       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
536       DllMain (0, 0, 0);],
537       [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
538
539   case $host/$CC in
540   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
541     # old mingw systems require "-dll" to link a DLL, while more recent ones
542     # require "-mdll"
543     SAVE_CFLAGS="$CFLAGS"
544     CFLAGS="$CFLAGS -mdll"
545     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
546       [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
547     CFLAGS="$SAVE_CFLAGS" ;;
548   *-*-cygwin* | *-*-pw32*)
549     # cygwin systems need to pass --dll to the linker, and not link
550     # crt.o which will require a WinMain@16 definition.
551     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
552   esac
553   ;;
554   ])
555 esac
556 ])
557
558 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
559 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
560
561 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
562 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
563
564 # AC_ENABLE_SHARED - implement the --enable-shared flag
565 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
566 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
567 #   `yes'.
568 AC_DEFUN([AC_ENABLE_SHARED],
569 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
570 AC_ARG_ENABLE(shared,
571 changequote(<<, >>)dnl
572 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
573 changequote([, ])dnl
574 [p=${PACKAGE-default}
575 case $enableval in
576 yes) enable_shared=yes ;;
577 no) enable_shared=no ;;
578 *)
579   enable_shared=no
580   # Look at the argument we got.  We use all the common list separators.
581   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
582   for pkg in $enableval; do
583     if test "X$pkg" = "X$p"; then
584       enable_shared=yes
585     fi
586   done
587   IFS="$ac_save_ifs"
588   ;;
589 esac],
590 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
591 ])
592
593 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
594 AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
595 AC_ENABLE_SHARED(no)])
596
597 # AC_ENABLE_STATIC - implement the --enable-static flag
598 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
599 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
600 #   `yes'.
601 AC_DEFUN([AC_ENABLE_STATIC],
602 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
603 AC_ARG_ENABLE(static,
604 changequote(<<, >>)dnl
605 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
606 changequote([, ])dnl
607 [p=${PACKAGE-default}
608 case $enableval in
609 yes) enable_static=yes ;;
610 no) enable_static=no ;;
611 *)
612   enable_static=no
613   # Look at the argument we got.  We use all the common list separators.
614   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
615   for pkg in $enableval; do
616     if test "X$pkg" = "X$p"; then
617       enable_static=yes
618     fi
619   done
620   IFS="$ac_save_ifs"
621   ;;
622 esac],
623 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
624 ])
625
626 # AC_DISABLE_STATIC - set the default static flag to --disable-static
627 AC_DEFUN([AC_DISABLE_STATIC],
628 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
629 AC_ENABLE_STATIC(no)])
630
631
632 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
633 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
634 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
635 #   `yes'.
636 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
637 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
638 AC_ARG_ENABLE(fast-install,
639 changequote(<<, >>)dnl
640 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
641 changequote([, ])dnl
642 [p=${PACKAGE-default}
643 case $enableval in
644 yes) enable_fast_install=yes ;;
645 no) enable_fast_install=no ;;
646 *)
647   enable_fast_install=no
648   # Look at the argument we got.  We use all the common list separators.
649   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
650   for pkg in $enableval; do
651     if test "X$pkg" = "X$p"; then
652       enable_fast_install=yes
653     fi
654   done
655   IFS="$ac_save_ifs"
656   ;;
657 esac],
658 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
659 ])
660
661 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
662 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
663 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
664 AC_ENABLE_FAST_INSTALL(no)])
665
666 # AC_LIBTOOL_PICMODE - implement the --with-pic flag
667 # Usage: AC_LIBTOOL_PICMODE[(MODE)]
668 #   Where MODE is either `yes' or `no'.  If omitted, it defaults to
669 #   `both'.
670 AC_DEFUN([AC_LIBTOOL_PICMODE],
671 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
672 pic_mode=ifelse($#,1,$1,default)])
673
674
675 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
676 AC_DEFUN([AC_PATH_TOOL_PREFIX],
677 [AC_MSG_CHECKING([for $1])
678 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
679 [case $MAGIC_CMD in
680   /*)
681   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
682   ;;
683   ?:/*)
684   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
685   ;;
686   *)
687   ac_save_MAGIC_CMD="$MAGIC_CMD"
688   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
689 dnl $ac_dummy forces splitting on constant user-supplied paths.
690 dnl POSIX.2 word splitting is done only on the output of word expansions,
691 dnl not every word.  This closes a longstanding sh security hole.
692   ac_dummy="ifelse([$2], , $PATH, [$2])"
693   for ac_dir in $ac_dummy; do
694     test -z "$ac_dir" && ac_dir=.
695     if test -f $ac_dir/$1; then
696       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
697       if test -n "$file_magic_test_file"; then
698         case $deplibs_check_method in
699         "file_magic "*)
700           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
701           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
702           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
703             egrep "$file_magic_regex" > /dev/null; then
704             :
705           else
706             cat <<EOF 1>&2
707
708 *** Warning: the command libtool uses to detect shared libraries,
709 *** $file_magic_cmd, produces output that libtool cannot recognize.
710 *** The result is that libtool may fail to recognize shared libraries
711 *** as such.  This will affect the creation of libtool libraries that
712 *** depend on shared libraries, but programs linked with such libtool
713 *** libraries will work regardless of this problem.  Nevertheless, you
714 *** may want to report the problem to your system manager and/or to
715 *** bug-libtool@gnu.org
716
717 EOF
718           fi ;;
719         esac
720       fi
721       break
722     fi
723   done
724   IFS="$ac_save_ifs"
725   MAGIC_CMD="$ac_save_MAGIC_CMD"
726   ;;
727 esac])
728 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
729 if test -n "$MAGIC_CMD"; then
730   AC_MSG_RESULT($MAGIC_CMD)
731 else
732   AC_MSG_RESULT(no)
733 fi
734 ])
735
736
737 # AC_PATH_MAGIC - find a file program which can recognise a shared library
738 AC_DEFUN([AC_PATH_MAGIC],
739 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
740 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
741 if test -z "$lt_cv_path_MAGIC_CMD"; then
742   if test -n "$ac_tool_prefix"; then
743     AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
744   else
745     MAGIC_CMD=:
746   fi
747 fi
748 ])
749
750
751 # AC_PROG_LD - find the path to the GNU or non-GNU linker
752 AC_DEFUN([AC_PROG_LD],
753 [AC_ARG_WITH(gnu-ld,
754 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
755 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
756 AC_REQUIRE([AC_PROG_CC])dnl
757 AC_REQUIRE([AC_CANONICAL_HOST])dnl
758 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
759 ac_prog=ld
760 if test "$GCC" = yes; then
761   # Check if gcc -print-prog-name=ld gives a path.
762   AC_MSG_CHECKING([for ld used by GCC])
763   case $host in
764   *-*-mingw*)
765     # gcc leaves a trailing carriage return which upsets mingw
766     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
767   *)
768     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
769   esac
770   case $ac_prog in
771     # Accept absolute paths.
772     [[\\/]* | [A-Za-z]:[\\/]*)]
773       re_direlt=['/[^/][^/]*/\.\./']
774       # Canonicalize the path of ld
775       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
776       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
777         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
778       done
779       test -z "$LD" && LD="$ac_prog"
780       ;;
781   "")
782     # If it fails, then pretend we aren't using GCC.
783     ac_prog=ld
784     ;;
785   *)
786     # If it is relative, then search for the first ld in PATH.
787     with_gnu_ld=unknown
788     ;;
789   esac
790 elif test "$with_gnu_ld" = yes; then
791   AC_MSG_CHECKING([for GNU ld])
792 else
793   AC_MSG_CHECKING([for non-GNU ld])
794 fi
795 AC_CACHE_VAL(lt_cv_path_LD,
796 [if test -z "$LD"; then
797   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
798   for ac_dir in $PATH; do
799     test -z "$ac_dir" && ac_dir=.
800     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
801       lt_cv_path_LD="$ac_dir/$ac_prog"
802       # Check to see if the program is GNU ld.  I'd rather use --version,
803       # but apparently some GNU ld's only accept -v.
804       # Break only if it was the GNU/non-GNU ld that we prefer.
805       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
806         test "$with_gnu_ld" != no && break
807       else
808         test "$with_gnu_ld" != yes && break
809       fi
810     fi
811   done
812   IFS="$ac_save_ifs"
813 else
814   lt_cv_path_LD="$LD" # Let the user override the test with a path.
815 fi])
816 LD="$lt_cv_path_LD"
817 if test -n "$LD"; then
818   AC_MSG_RESULT($LD)
819 else
820   AC_MSG_RESULT(no)
821 fi
822 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
823 AC_PROG_LD_GNU
824 ])
825
826 AC_DEFUN([AC_PROG_LD_GNU],
827 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
828 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
829 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
830   lt_cv_prog_gnu_ld=yes
831 else
832   lt_cv_prog_gnu_ld=no
833 fi])
834 with_gnu_ld=$lt_cv_prog_gnu_ld
835 ])
836
837 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
838 #   -- PORTME Some linkers may need a different reload flag.
839 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
840 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
841 [lt_cv_ld_reload_flag='-r'])
842 reload_flag=$lt_cv_ld_reload_flag
843 test -n "$reload_flag" && reload_flag=" $reload_flag"
844 ])
845
846 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
847 #  -- PORTME fill in with the dynamic library characteristics
848 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
849 [AC_CACHE_CHECK([how to recognise dependant libraries],
850 lt_cv_deplibs_check_method,
851 [lt_cv_file_magic_cmd='$MAGIC_CMD'
852 lt_cv_file_magic_test_file=
853 lt_cv_deplibs_check_method='unknown'
854 # Need to set the preceding variable on all platforms that support
855 # interlibrary dependencies.
856 # 'none' -- dependencies not supported.
857 # `unknown' -- same as none, but documents that we really don't know.
858 # 'pass_all' -- all dependencies passed with no checks.
859 # 'test_compile' -- check by making test program.
860 # 'file_magic [regex]' -- check by looking for files in library path
861 # which responds to the $file_magic_cmd with a given egrep regex.
862 # If you have `file' or equivalent on your system and you're not sure
863 # whether `pass_all' will *always* work, you probably want this one.
864
865 case $host_os in
866 aix*)
867   lt_cv_deplibs_check_method=pass_all
868   ;;
869
870 beos*)
871   lt_cv_deplibs_check_method=pass_all
872   ;;
873
874 bsdi4*)
875   lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
876   lt_cv_file_magic_cmd='/usr/bin/file -L'
877   lt_cv_file_magic_test_file=/shlib/libc.so
878   ;;
879
880 cygwin* | mingw* |pw32*)
881   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
882   lt_cv_file_magic_cmd='$OBJDUMP -f'
883   ;;
884
885 darwin* | rhapsody*)
886   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
887   lt_cv_file_magic_cmd='/usr/bin/file -L'
888   case "$host_os" in
889   rhapsody* | darwin1.[012])
890     lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
891     ;;
892   *) # Darwin 1.3 on
893     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
894     ;;
895   esac
896   ;;
897
898 freebsd* )
899   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
900     case $host_cpu in
901     i*86 )
902       # Not sure whether the presence of OpenBSD here was a mistake.
903       # Let's accept both of them until this is cleared up.
904       lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
905       lt_cv_file_magic_cmd=/usr/bin/file
906       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
907       ;;
908     esac
909   else
910     lt_cv_deplibs_check_method=pass_all
911   fi
912   ;;
913
914 gnu*)
915   lt_cv_deplibs_check_method=pass_all
916   ;;
917
918 hpux10.20*|hpux11*)
919   case $host_cpu in
920   hppa*)
921     [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
922     lt_cv_file_magic_cmd=/usr/bin/file
923     lt_cv_file_magic_test_file=/usr/lib/libc.sl
924     ;;
925   ia64*)
926     [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64']
927     lt_cv_file_magic_cmd=/usr/bin/file
928     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
929     ;;
930   esac
931   ;;
932
933 irix5* | irix6*)
934   case $host_os in
935   irix5*)
936     # this will be overridden with pass_all, but let us keep it just in case
937     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
938     ;;
939   *)
940     case $LD in
941     *-32|*"-32 ") libmagic=32-bit;;
942     *-n32|*"-n32 ") libmagic=N32;;
943     *-64|*"-64 ") libmagic=64-bit;;
944     *) libmagic=never-match;;
945     esac
946     # this will be overridden with pass_all, but let us keep it just in case
947     lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
948     ;;
949   esac
950   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
951   lt_cv_deplibs_check_method=pass_all
952   ;;
953
954 # This must be Linux ELF.
955 linux-gnu*)
956   case $host_cpu in
957   alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
958     lt_cv_deplibs_check_method=pass_all ;;
959   *)
960     # glibc up to 2.1.1 does not perform some relocations on ARM
961     lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
962   esac
963   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
964   ;;
965
966 netbsd*)
967   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
968     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
969   else
970     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
971   fi
972   ;;
973
974 newsos6)
975   [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
976   lt_cv_file_magic_cmd=/usr/bin/file
977   lt_cv_file_magic_test_file=/usr/lib/libnls.so
978   ;;
979
980 osf3* | osf4* | osf5*)
981   # this will be overridden with pass_all, but let us keep it just in case
982   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
983   lt_cv_file_magic_test_file=/shlib/libc.so
984   lt_cv_deplibs_check_method=pass_all
985   ;;
986
987 sco3.2v5*)
988   lt_cv_deplibs_check_method=pass_all
989   ;;
990
991 solaris*)
992   lt_cv_deplibs_check_method=pass_all
993   lt_cv_file_magic_test_file=/lib/libc.so
994   ;;
995
996 [sysv5uw[78]* | sysv4*uw2*)]
997   lt_cv_deplibs_check_method=pass_all
998   ;;
999
1000 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1001   case $host_vendor in
1002   ncr)
1003     lt_cv_deplibs_check_method=pass_all
1004     ;;
1005   motorola)
1006     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]']
1007     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
1008     ;;
1009   esac
1010   ;;
1011 esac
1012 ])
1013 file_magic_cmd=$lt_cv_file_magic_cmd
1014 deplibs_check_method=$lt_cv_deplibs_check_method
1015 ])
1016
1017
1018 # AC_PROG_NM - find the path to a BSD-compatible name lister
1019 AC_DEFUN([AC_PROG_NM],
1020 [AC_MSG_CHECKING([for BSD-compatible nm])
1021 AC_CACHE_VAL(lt_cv_path_NM,
1022 [if test -n "$NM"; then
1023   # Let the user override the test.
1024   lt_cv_path_NM="$NM"
1025 else
1026   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1027   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1028     test -z "$ac_dir" && ac_dir=.
1029     tmp_nm=$ac_dir/${ac_tool_prefix}nm
1030     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
1031       # Check to see if the nm accepts a BSD-compat flag.
1032       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1033       #   nm: unknown option "B" ignored
1034       # Tru64's nm complains that /dev/null is an invalid object file
1035       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
1036         lt_cv_path_NM="$tmp_nm -B"
1037         break
1038       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1039         lt_cv_path_NM="$tmp_nm -p"
1040         break
1041       else
1042         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
1043         continue # so that we can try to find one that supports BSD flags
1044       fi
1045     fi
1046   done
1047   IFS="$ac_save_ifs"
1048   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
1049 fi])
1050 NM="$lt_cv_path_NM"
1051 AC_MSG_RESULT([$NM])
1052 ])
1053
1054 # AC_CHECK_LIBM - check for math library
1055 AC_DEFUN([AC_CHECK_LIBM],
1056 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1057 LIBM=
1058 case $host in
1059 *-*-beos* | *-*-cygwin* | *-*-pw32*)
1060   # These system don't have libm
1061   ;;
1062 *-ncr-sysv4.3*)
1063   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1064   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1065   ;;
1066 *)
1067   AC_CHECK_LIB(m, main, LIBM="-lm")
1068   ;;
1069 esac
1070 ])
1071
1072 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1073 # the libltdl convenience library and INCLTDL to the include flags for
1074 # the libltdl header and adds --enable-ltdl-convenience to the
1075 # configure arguments.  Note that LIBLTDL and INCLTDL are not
1076 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
1077 # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
1078 # with '${top_builddir}/' and INCLTDL will be prefixed with
1079 # '${top_srcdir}/' (note the single quotes!).  If your package is not
1080 # flat and you're not using automake, define top_builddir and
1081 # top_srcdir appropriately in the Makefiles.
1082 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
1083 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1084   case $enable_ltdl_convenience in
1085   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1086   "") enable_ltdl_convenience=yes
1087       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1088   esac
1089   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
1090   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1091 ])
1092
1093 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1094 # the libltdl installable library and INCLTDL to the include flags for
1095 # the libltdl header and adds --enable-ltdl-install to the configure
1096 # arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
1097 # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
1098 # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
1099 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
1100 # with '${top_srcdir}/' (note the single quotes!).  If your package is
1101 # not flat and you're not using automake, define top_builddir and
1102 # top_srcdir appropriately in the Makefiles.
1103 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1104 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
1105 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1106   AC_CHECK_LIB(ltdl, main,
1107   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1108   [if test x"$enable_ltdl_install" = xno; then
1109      AC_MSG_WARN([libltdl not installed, but installation disabled])
1110    else
1111      enable_ltdl_install=yes
1112    fi
1113   ])
1114   if test x"$enable_ltdl_install" = x"yes"; then
1115     ac_configure_args="$ac_configure_args --enable-ltdl-install"
1116     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
1117     INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1118   else
1119     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1120     LIBLTDL="-lltdl"
1121     INCLTDL=
1122   fi
1123 ])
1124
1125 # If this macro is not defined by Autoconf, define it here.
1126 ifdef([AC_PROVIDE_IFELSE],
1127       [],
1128       [define([AC_PROVIDE_IFELSE],
1129               [ifdef([AC_PROVIDE_$1],
1130                      [$2], [$3])])])
1131
1132 # AC_LIBTOOL_CXX - enable support for C++ libraries
1133 AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
1134
1135 AC_DEFUN([_AC_LIBTOOL_CXX],
1136 [AC_REQUIRE([AC_PROG_CXX])
1137 AC_REQUIRE([AC_PROG_CXXCPP])
1138 LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
1139 lt_save_CC="$CC"
1140 lt_save_CFLAGS="$CFLAGS"
1141 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
1142 dnl is set to the C++ compiler.
1143 AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
1144 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1145 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1146 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1147 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1148 deplibs_check_method="$deplibs_check_method" \
1149 file_magic_cmd="$file_magic_cmd" \
1150 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
1151 --build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
1152 || AC_MSG_ERROR([libtool tag configuration failed])
1153 CC="$lt_save_CC"
1154 CFLAGS="$lt_save_CFLAGS"
1155
1156 # Redirect the config.log output again, so that the ltconfig log is not
1157 # clobbered by the next message.
1158 exec 5>>./config.log
1159 ])
1160
1161 # AC_LIBTOOL_GCJ - enable support for GCJ libraries
1162 AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
1163
1164 AC_DEFUN([_AC_LIBTOOL_GCJ],
1165 [AC_REQUIRE([AC_PROG_LIBTOOL])
1166 AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
1167   [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
1168     [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
1169       [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
1170          [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
1171            [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
1172 LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
1173 lt_save_CC="$CC"
1174 lt_save_CFLAGS="$CFLAGS"
1175 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
1176 dnl is set to the C++ compiler.
1177 AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
1178 MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1179 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1180 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1181 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1182 deplibs_check_method="$deplibs_check_method" \
1183 file_magic_cmd="$file_magic_cmd" \
1184 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
1185 --build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
1186 || AC_MSG_ERROR([libtool tag configuration failed])
1187 CC="$lt_save_CC"
1188 CFLAGS="$lt_save_CFLAGS"
1189
1190 # Redirect the config.log output again, so that the ltconfig log is not
1191 # clobbered by the next message.
1192 exec 5>>./config.log
1193 ])
1194
1195 dnl old names
1196 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
1197 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
1198 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
1199 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
1200 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
1201 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
1202 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
1203
1204 dnl This is just to silence aclocal about the macro not being used
1205 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1206
1207 AC_DEFUN([LT_AC_PROG_GCJ],
1208 [AC_CHECK_TOOL(GCJ, gcj, no)
1209   test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
1210   AC_SUBST(GCJFLAGS)
1211 ])
1212