OSDN Git Service

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