OSDN Git Service

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