OSDN Git Service

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