OSDN Git Service

* public snapshot of sid simulator
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / cfgroot / libltdl / 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
14 # serial 39 AC_PROG_LIBTOOL
15 AC_DEFUN(AC_PROG_LIBTOOL,
16 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
17
18 # Save cache, so that ltconfig can load it
19 AC_CACHE_SAVE
20 AC_CHECK_TOOL(AR, ar)
21
22 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
23 AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
24 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
25 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
26 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
27 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
28 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
29 || AC_MSG_ERROR([libtool configure failed])
30
31 # Reload cache, that may have been modified by ltconfig
32 AC_CACHE_LOAD
33
34 # This can be used to rebuild libtool when needed
35 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
36
37 # Always use our own libtool.
38 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
39 AC_SUBST(LIBTOOL)dnl
40
41 # Redirect the config.log output again, so that the ltconfig log is not
42 # clobbered by the next message.
43 exec 5>>./config.log
44 ])
45
46 AC_DEFUN(AC_LIBTOOL_SETUP,
47 [AC_PREREQ(2.13)dnl
48 AC_REQUIRE([AC_ENABLE_SHARED])dnl
49 AC_REQUIRE([AC_ENABLE_STATIC])dnl
50 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
51 AC_REQUIRE([AC_CANONICAL_HOST])dnl
52 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
53 AC_REQUIRE([AC_PROG_RANLIB])dnl
54 AC_REQUIRE([AC_PROG_CC])dnl
55 AC_REQUIRE([AC_PROG_LD])dnl
56 AC_REQUIRE([AC_PROG_NM])dnl
57 AC_REQUIRE([AC_PROG_LN_S])dnl
58 dnl
59
60 # Check for any special flags to pass to ltconfig.
61 libtool_flags="--cache-file=$cache_file"
62 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
63 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
64 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
65 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
66 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
67 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
68 [libtool_flags="$libtool_flags --enable-dlopen"])
69 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
70 [libtool_flags="$libtool_flags --enable-win32-dll"])
71 AC_ARG_ENABLE(libtool-lock,
72   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
73 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
74 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
75
76 # Some flags need to be propagated to the compiler or linker for good
77 # libtool support.
78 case "$host" in
79 *-*-irix6*)
80   # Find out which ABI we are using.
81   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
82   if AC_TRY_EVAL(ac_compile); then
83     case "`/usr/bin/file conftest.o`" in
84     *32-bit*)
85       LD="${LD-ld} -32"
86       ;;
87     *N32*)
88       LD="${LD-ld} -n32"
89       ;;
90     *64-bit*)
91       LD="${LD-ld} -64"
92       ;;
93     esac
94   fi
95   rm -rf conftest*
96   ;;
97
98 *-*-sco3.2v5*)
99   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
100   SAVE_CFLAGS="$CFLAGS"
101   CFLAGS="$CFLAGS -belf"
102   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
103     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
104   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
105     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
106     CFLAGS="$SAVE_CFLAGS"
107   fi
108   ;;
109
110 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
111 [*-*-cygwin* | *-*-mingw*)
112   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
113   AC_CHECK_TOOL(AS, as, false)
114   AC_CHECK_TOOL(OBJDUMP, objdump, false)
115   ;;
116 ])
117 esac
118 ])
119
120 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
121 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
122
123 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
124 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
125
126 # AC_ENABLE_SHARED - implement the --enable-shared flag
127 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
128 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
129 #   `yes'.
130 AC_DEFUN(AC_ENABLE_SHARED, [dnl
131 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
132 AC_ARG_ENABLE(shared,
133 changequote(<<, >>)dnl
134 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
135 changequote([, ])dnl
136 [p=${PACKAGE-default}
137 case "$enableval" in
138 yes) enable_shared=yes ;;
139 no) enable_shared=no ;;
140 *)
141   enable_shared=no
142   # Look at the argument we got.  We use all the common list separators.
143   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
144   for pkg in $enableval; do
145     if test "X$pkg" = "X$p"; then
146       enable_shared=yes
147     fi
148   done
149   IFS="$ac_save_ifs"
150   ;;
151 esac],
152 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
153 ])
154
155 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
156 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
157 AC_ENABLE_SHARED(no)])
158
159 # AC_ENABLE_STATIC - implement the --enable-static flag
160 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
161 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
162 #   `yes'.
163 AC_DEFUN(AC_ENABLE_STATIC, [dnl
164 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
165 AC_ARG_ENABLE(static,
166 changequote(<<, >>)dnl
167 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
168 changequote([, ])dnl
169 [p=${PACKAGE-default}
170 case "$enableval" in
171 yes) enable_static=yes ;;
172 no) enable_static=no ;;
173 *)
174   enable_static=no
175   # Look at the argument we got.  We use all the common list separators.
176   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
177   for pkg in $enableval; do
178     if test "X$pkg" = "X$p"; then
179       enable_static=yes
180     fi
181   done
182   IFS="$ac_save_ifs"
183   ;;
184 esac],
185 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
186 ])
187
188 # AC_DISABLE_STATIC - set the default static flag to --disable-static
189 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
190 AC_ENABLE_STATIC(no)])
191
192
193 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
194 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
195 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
196 #   `yes'.
197 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
198 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
199 AC_ARG_ENABLE(fast-install,
200 changequote(<<, >>)dnl
201 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
202 changequote([, ])dnl
203 [p=${PACKAGE-default}
204 case "$enableval" in
205 yes) enable_fast_install=yes ;;
206 no) enable_fast_install=no ;;
207 *)
208   enable_fast_install=no
209   # Look at the argument we got.  We use all the common list separators.
210   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
211   for pkg in $enableval; do
212     if test "X$pkg" = "X$p"; then
213       enable_fast_install=yes
214     fi
215   done
216   IFS="$ac_save_ifs"
217   ;;
218 esac],
219 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
220 ])
221
222 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
223 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
224 AC_ENABLE_FAST_INSTALL(no)])
225
226 # AC_PROG_LD - find the path to the GNU or non-GNU linker
227 AC_DEFUN(AC_PROG_LD,
228 [AC_ARG_WITH(gnu-ld,
229 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
230 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
231 AC_REQUIRE([AC_PROG_CC])dnl
232 AC_REQUIRE([AC_CANONICAL_HOST])dnl
233 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
234 ac_prog=ld
235 if test "$ac_cv_prog_gcc" = yes; then
236   # Check if gcc -print-prog-name=ld gives a path.
237   AC_MSG_CHECKING([for ld used by GCC])
238   ac_prog=`($CC -print-prog-name=ld) 2>&5`
239   case "$ac_prog" in
240     # Accept absolute paths.
241 changequote(,)dnl
242     [\\/]* | [A-Za-z]:[\\/]*)
243       re_direlt='/[^/][^/]*/\.\./'
244 changequote([,])dnl
245       # Canonicalize the path of ld
246       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
247       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
248         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
249       done
250       test -z "$LD" && LD="$ac_prog"
251       ;;
252   "")
253     # If it fails, then pretend we aren't using GCC.
254     ac_prog=ld
255     ;;
256   *)
257     # If it is relative, then search for the first ld in PATH.
258     with_gnu_ld=unknown
259     ;;
260   esac
261 elif test "$with_gnu_ld" = yes; then
262   AC_MSG_CHECKING([for GNU ld])
263 else
264   AC_MSG_CHECKING([for non-GNU ld])
265 fi
266 AC_CACHE_VAL(ac_cv_path_LD,
267 [if test -z "$LD"; then
268   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
269   for ac_dir in $PATH; do
270     test -z "$ac_dir" && ac_dir=.
271     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
272       ac_cv_path_LD="$ac_dir/$ac_prog"
273       # Check to see if the program is GNU ld.  I'd rather use --version,
274       # but apparently some GNU ld's only accept -v.
275       # Break only if it was the GNU/non-GNU ld that we prefer.
276       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
277         test "$with_gnu_ld" != no && break
278       else
279         test "$with_gnu_ld" != yes && break
280       fi
281     fi
282   done
283   IFS="$ac_save_ifs"
284 else
285   ac_cv_path_LD="$LD" # Let the user override the test with a path.
286 fi])
287 LD="$ac_cv_path_LD"
288 if test -n "$LD"; then
289   AC_MSG_RESULT($LD)
290 else
291   AC_MSG_RESULT(no)
292 fi
293 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
294 AC_SUBST(LD)
295 AC_PROG_LD_GNU
296 ])
297
298 AC_DEFUN(AC_PROG_LD_GNU,
299 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
300 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
301 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
302   ac_cv_prog_gnu_ld=yes
303 else
304   ac_cv_prog_gnu_ld=no
305 fi])
306 ])
307
308 # AC_PROG_NM - find the path to a BSD-compatible name lister
309 AC_DEFUN(AC_PROG_NM,
310 [AC_MSG_CHECKING([for BSD-compatible nm])
311 AC_CACHE_VAL(ac_cv_path_NM,
312 [if test -n "$NM"; then
313   # Let the user override the test.
314   ac_cv_path_NM="$NM"
315 else
316   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
317   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
318     test -z "$ac_dir" && ac_dir=.
319     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
320       # Check to see if the nm accepts a BSD-compat flag.
321       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
322       #   nm: unknown option "B" ignored
323       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
324         ac_cv_path_NM="$ac_dir/nm -B"
325         break
326       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
327         ac_cv_path_NM="$ac_dir/nm -p"
328         break
329       else
330         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
331         continue # so that we can try to find one that supports BSD flags
332       fi
333     fi
334   done
335   IFS="$ac_save_ifs"
336   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
337 fi])
338 NM="$ac_cv_path_NM"
339 AC_MSG_RESULT([$NM])
340 AC_SUBST(NM)
341 ])
342
343 # AC_CHECK_LIBM - check for math library
344 AC_DEFUN(AC_CHECK_LIBM,
345 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
346 LIBM=
347 case "$host" in
348 *-*-beos* | *-*-cygwin*)
349   # These system don't have libm
350   ;;
351 *-ncr-sysv4.3*)
352   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
353   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
354   ;;
355 *)
356   AC_CHECK_LIB(m, main, LIBM="-lm")
357   ;;
358 esac
359 ])
360
361 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
362 # the libltdl convenience library, adds --enable-ltdl-convenience to
363 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
364 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
365 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
366 # '${top_builddir}/' (note the single quotes!) if your package is not
367 # flat, and, if you're not using automake, define top_builddir as
368 # appropriate in the Makefiles.
369 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
370   case "$enable_ltdl_convenience" in
371   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
372   "") enable_ltdl_convenience=yes
373       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
374   esac
375   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
376 ])
377
378 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
379 # the libltdl installable library, and adds --enable-ltdl-install to
380 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
381 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
382 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
383 # '${top_builddir}/' (note the single quotes!) if your package is not
384 # flat, and, if you're not using automake, define top_builddir as
385 # appropriate in the Makefiles.
386 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
387 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
388   AC_CHECK_LIB(ltdl, main,
389   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
390   [if test x"$enable_ltdl_install" = xno; then
391      AC_MSG_WARN([libltdl not installed, but installation disabled])
392    else
393      enable_ltdl_install=yes
394    fi
395   ])
396   if test x"$enable_ltdl_install" = x"yes"; then
397     ac_configure_args="$ac_configure_args --enable-ltdl-install"
398     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
399   else
400     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
401     LIBLTDL="-lltdl"
402   fi
403 ])
404
405 dnl old names
406 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
407 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
408 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
409 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
410 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
411 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
412 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
413
414 dnl This is just to quiet aclocal about the macro not being used
415 dnl if(a,b,[AC_DISABLE_FAST_INSTALL])dnl
416
417 # Do all the work for Automake.  This macro actually does too much --
418 # some checks are only needed if your package does certain things.
419 # But this isn't really a big deal.
420
421 # serial 1
422
423 dnl Usage:
424 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
425
426 AC_DEFUN(AM_INIT_AUTOMAKE,
427 [AC_REQUIRE([AC_PROG_INSTALL])
428 PACKAGE=[$1]
429 AC_SUBST(PACKAGE)
430 VERSION=[$2]
431 AC_SUBST(VERSION)
432 dnl test to see if srcdir already configured
433 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
434   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
435 fi
436 ifelse([$3],,
437 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
438 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
439 AC_REQUIRE([AM_SANITY_CHECK])
440 AC_REQUIRE([AC_ARG_PROGRAM])
441 dnl FIXME This is truly gross.
442 missing_dir=`cd $ac_aux_dir && pwd`
443 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
444 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
445 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
446 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
447 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
448 AC_REQUIRE([AC_PROG_MAKE_SET])])
449
450 #
451 # Check to make sure that the build environment is sane.
452 #
453
454 AC_DEFUN(AM_SANITY_CHECK,
455 [AC_MSG_CHECKING([whether build environment is sane])
456 # Just in case
457 sleep 1
458 echo timestamp > conftestfile
459 # Do `set' in a subshell so we don't clobber the current shell's
460 # arguments.  Must try -L first in case configure is actually a
461 # symlink; some systems play weird games with the mod time of symlinks
462 # (eg FreeBSD returns the mod time of the symlink's containing
463 # directory).
464 if (
465    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
466    if test "[$]*" = "X"; then
467       # -L didn't work.
468       set X `ls -t $srcdir/configure conftestfile`
469    fi
470    if test "[$]*" != "X $srcdir/configure conftestfile" \
471       && test "[$]*" != "X conftestfile $srcdir/configure"; then
472
473       # If neither matched, then we have a broken ls.  This can happen
474       # if, for instance, CONFIG_SHELL is bash and it inherits a
475       # broken ls alias from the environment.  This has actually
476       # happened.  Such a system could not be considered "sane".
477       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
478 alias in your environment])
479    fi
480
481    test "[$]2" = conftestfile
482    )
483 then
484    # Ok.
485    :
486 else
487    AC_MSG_ERROR([newly created file is older than distributed files!
488 Check your system clock])
489 fi
490 rm -f conftest*
491 AC_MSG_RESULT(yes)])
492
493 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
494 dnl The program must properly implement --version.
495 AC_DEFUN(AM_MISSING_PROG,
496 [AC_MSG_CHECKING(for working $2)
497 # Run test in a subshell; some versions of sh will print an error if
498 # an executable is not found, even if stderr is redirected.
499 # Redirect stdin to placate older versions of autoconf.  Sigh.
500 if ($2 --version) < /dev/null > /dev/null 2>&1; then
501    $1=$2
502    AC_MSG_RESULT(found)
503 else
504    $1="$3/missing $2"
505    AC_MSG_RESULT(missing)
506 fi
507 AC_SUBST($1)])
508
509 # Like AC_CONFIG_HEADER, but automatically create stamp file.
510
511 AC_DEFUN(AM_CONFIG_HEADER,
512 [AC_PREREQ([2.12])
513 AC_CONFIG_HEADER([$1])
514 dnl When config.status generates a header, we must update the stamp-h file.
515 dnl This file resides in the same directory as the config header
516 dnl that is generated.  We must strip everything past the first ":",
517 dnl and everything past the last "/".
518 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
519 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
520 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
521 <<am_indx=1
522 for am_file in <<$1>>; do
523   case " <<$>>CONFIG_HEADERS " in
524   *" <<$>>am_file "*<<)>>
525     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
526     ;;
527   esac
528   am_indx=`expr "<<$>>am_indx" + 1`
529 done<<>>dnl>>)
530 changequote([,]))])
531
532 # Add --enable-maintainer-mode option to configure.
533 # From Jim Meyering
534
535 # serial 1
536
537 AC_DEFUN(AM_MAINTAINER_MODE,
538 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
539   dnl maintainer-mode is disabled by default
540   AC_ARG_ENABLE(maintainer-mode,
541 [  --enable-maintainer-mode enable make rules and dependencies not useful
542                           (and sometimes confusing) to the casual installer],
543       USE_MAINTAINER_MODE=$enableval,
544       USE_MAINTAINER_MODE=no)
545   AC_MSG_RESULT($USE_MAINTAINER_MODE)
546   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
547   MAINT=$MAINTAINER_MODE_TRUE
548   AC_SUBST(MAINT)dnl
549 ]
550 )
551
552 # Define a conditional.
553
554 AC_DEFUN(AM_CONDITIONAL,
555 [AC_SUBST($1_TRUE)
556 AC_SUBST($1_FALSE)
557 if $2; then
558   $1_TRUE=
559   $1_FALSE='#'
560 else
561   $1_TRUE='#'
562   $1_FALSE=
563 fi])
564
565
566 # serial 1 AC_LIB_LTDL
567
568 AC_DEFUN(AC_LIB_LTDL,
569 [AC_PREREQ(2.13)dnl
570 AC_REQUIRE([AC_PROG_CC])dnl
571 AC_REQUIRE([AC_C_CONST])dnl
572 AC_REQUIRE([AC_C_INLINE])dnl
573
574 dnl AC_LIB_LTDL must perform all the checks necessary for compilation
575 dnl of the ltdl objects -- including compiler checks (above) and header
576 dnl checks (below).
577 AC_REQUIRE([AC_HEADER_STDC])dnl
578
579 AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
580 AC_CHECK_HEADERS(string.h strings.h, break)
581 AC_CHECK_FUNCS(strchr index, break)
582 AC_CHECK_FUNCS(strrchr rindex, break)
583 AC_CHECK_FUNCS(strcmp)
584
585 AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl
586 AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl
587 AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl
588 AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl
589 AC_REQUIRE([AC_LTDL_OBJDIR])dnl
590 AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl
591 AC_REQUIRE([AC_LTDL_DLLIB])dnl
592 AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
593 ])
594
595 AC_DEFUN(AC_LTDL_ENABLE_INSTALL,
596 [AC_ARG_ENABLE(ltdl-install,
597 [  --enable-ltdl-install   install libltdl])
598
599 AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
600 AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
601 ])])
602
603
604 AC_DEFUN(AC_LTDL_SNARF_CONFIG,
605 [# Read the libtool configuration
606 rm -f conftest
607 ./libtool --config > conftest
608 . ./conftest
609 rm -f conftest
610 ])
611
612 AC_DEFUN(AC_LTDL_SHLIBEXT,
613 [AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
614 AC_CACHE_CHECK([which extension is used for shared libraries],
615   libltdl_cv_shlibext, [dnl
616 (
617   last=
618   for spec in $library_names_spec; do
619     last="$spec"
620   done
621 changequote(, )
622   echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
623 changequote([, ])
624 )
625 libltdl_cv_shlibext=`cat conftest`
626 rm -f conftest
627 ])
628 if test -n "$libltdl_cv_shlibext"; then
629   AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
630     [Define to the extension used for shared libraries, say, ".so". ])
631 fi
632 ])
633
634 AC_DEFUN(AC_LTDL_SHLIBPATH,
635 [AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
636 AC_CACHE_CHECK([which variable specifies run-time library path],
637   libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"])
638 if test -n "$libltdl_cv_shlibpath_var"; then
639   AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
640     [Define to the name of the environment variable that determines the dynamic library search path. ])
641 fi
642 ])
643
644 AC_DEFUN(AC_LTDL_SYSSEARCHPATH,
645 [AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
646 AC_CACHE_CHECK([for the default library search path],
647   libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
648 if test -n "$libltdl_cv_sys_search_path"; then
649   case "$lt_target" in
650   *-*-mingw*) pathsep=";" ;;
651   *) pathsep=":" ;;
652   esac
653   sys_search_path=
654   for dir in $libltdl_cv_sys_search_path; do
655     if test -z "$sys_search_path"; then
656       sys_search_path="$dir"
657     else
658       sys_search_path="$sys_search_path$pathsep$dir"
659     fi
660   done
661   AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
662     [Define to the system default library search path. ])
663 fi
664 ])
665
666 AC_DEFUN(AC_LTDL_OBJDIR,
667 [AC_CACHE_CHECK([for objdir],
668   libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"
669 if test -n "$objdir"; then
670   :
671 else
672   rm -f .libs 2>/dev/null
673   mkdir .libs 2>/dev/null
674   if test -d .libs; then
675     libltdl_cv_objdir=.libs
676   else
677     # MS-DOS does not allow filenames that begin with a dot.
678     libltdl_cv_objdir=_libs
679   fi
680 rmdir .libs 2>/dev/null
681 fi])
682 AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
683   [Define to the sub-directory in which libtool stores uninstalled libraries. ])
684 ])
685
686 AC_DEFUN(AC_LTDL_DLPREOPEN,
687 [AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
688 AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
689        libltdl_cv_preloaded_symbols, [dnl
690   if test -n "$global_symbol_pipe"; then
691     libltdl_cv_preloaded_symbols=yes
692   else
693     libltdl_cv_preloaded_symbols=no
694   fi
695 ])
696 if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
697   AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
698     [Define if libtool can extract symbol lists from object files. ])
699 fi
700 ])
701
702 AC_DEFUN(AC_LTDL_DLLIB,
703 [LIBADD_DL=
704 AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
705    [Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"],
706 [AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
707    [Define if you have the libdl library or equivalent.])])])
708 AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
709    [Define if you have the shl_load function.])],
710 [AC_CHECK_LIB(dld, shl_load,
711   [AC_DEFINE(HAVE_SHL_LOAD, 1,
712      [Define if you have the shl_load function.])
713    LIBADD_DL="$LIBADD_DL -ldld"])
714 ])
715 AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
716   [Define if you have the GNU dld library.])dnl
717 test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
718 AC_SUBST(LIBADD_DL)
719
720 if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
721  LIBS_SAVE="$LIBS"
722  LIBS="$LIBS $LIBADD_DL"
723  AC_CHECK_FUNCS(dlerror)
724  LIBS="$LIBS_SAVE"
725 fi
726 ])
727
728 AC_DEFUN(AC_LTDL_GLOBAL_SYMBOL_PIPE,
729 [dnl Check for command to grab the raw symbol name followed
730 dnl by C symbol name from nm.
731 AC_REQUIRE([AC_CANONICAL_HOST])dnl
732 AC_REQUIRE([AC_PROG_NM])dnl
733 # Check for command to grab the raw symbol name followed by C symbol from nm.
734 AC_MSG_CHECKING([command to parse $NM output])
735 AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
736 [# These are sane defaults that work on at least a few old systems.
737 # {They come from Ultrix.  What could be older than Ultrix?!! ;)}
738
739 changequote(,)dnl
740 # Character class describing NM global symbol codes.
741 ac_symcode='[BCDEGRST]'
742
743 # Regexp to match symbols that can be accessed directly from C.
744 ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
745
746 # Transform the above into a raw symbol and a C symbol.
747 ac_symxfrm='\1 \2\3 \3'
748
749 # Transform an extracted symbol line into a proper C declaration
750 ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
751
752 # Define system-specific variables.
753 case "$host_os" in
754 aix*)
755   ac_symcode='[BCDT]'
756   ;;
757 cygwin* | mingw*)
758   ac_symcode='[ABCDGISTW]'
759   ;;
760 hpux*)
761   ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
762   ;;
763 irix*)
764   ac_symcode='[BCDEGRST]'
765   ;;
766 solaris*)
767   ac_symcode='[BDT]'
768   ;;
769 esac
770
771 # If we're using GNU nm, then use its standard symbol codes.
772 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
773   ac_symcode='[ABCDGISTW]'
774 fi
775 changequote([,])dnl
776
777 # Try without a prefix undercore, then with it.
778 for ac_symprfx in "" "_"; do
779
780   ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[       ]\($ac_symcode\)[       ][      ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
781
782   # Check to see that the pipe works correctly.
783   ac_pipe_works=no
784   rm -f conftest.$ac_ext
785   cat > conftest.$ac_ext <<EOF
786 #ifdef __cplusplus
787 extern "C" {
788 #endif
789 char nm_test_var;
790 void nm_test_func(){}
791 #ifdef __cplusplus
792 }
793 #endif
794 int main(){nm_test_var='a';nm_test_func;return 0;}
795 EOF
796
797   if AC_TRY_EVAL(ac_compile); then
798     # Now try to grab the symbols.
799     ac_nlist=conftest.nm
800
801     if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
802
803       # Try sorting and uniquifying the output.
804       if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
805         mv -f "$ac_nlist"T "$ac_nlist"
806       else
807         rm -f "$ac_nlist"T
808       fi
809
810       # Make sure that we snagged all the symbols we need.
811       if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
812         if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
813           cat <<EOF > conftest.c
814 #ifdef __cplusplus
815 extern "C" {
816 #endif
817
818 EOF
819           # Now generate the symbol file.
820           eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
821
822           cat <<EOF >> conftest.c
823 #if defined (__STDC__) && __STDC__
824 # define lt_ptr_t void *
825 #else
826 # define lt_ptr_t char *
827 # define const
828 #endif
829
830 /* The mapping between symbol names and symbols. */
831 const struct {
832   const char *name;
833   lt_ptr_t address;
834 }
835 changequote(,)dnl
836 lt_preloaded_symbols[] =
837 changequote([,])dnl
838 {
839 EOF
840         sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
841         cat <<\EOF >> conftest.c
842   {0, (lt_ptr_t) 0}
843 };
844
845 #ifdef __cplusplus
846 }
847 #endif
848 EOF
849           # Now try linking the two files.
850           mv conftest.$ac_objext conftstm.$ac_objext
851           ac_save_LIBS="$LIBS"
852           ac_save_CFLAGS="$CFLAGS"
853           LIBS="conftstm.$ac_objext"
854           CFLAGS="$CFLAGS$no_builtin_flag"
855           if AC_TRY_EVAL(ac_link) && test -s conftest; then
856             ac_pipe_works=yes
857           else
858             echo "configure: failed program was:" >&AC_FD_CC
859             cat conftest.c >&AC_FD_CC
860           fi
861           LIBS="$ac_save_LIBS"
862           CFLAGS="$ac_save_CFLAGS"
863         else
864           echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
865         fi
866       else
867         echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
868       fi
869     else
870       echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
871     fi
872   else
873     echo "$progname: failed program was:" >&AC_FD_CC
874     cat conftest.c >&AC_FD_CC
875   fi
876   rm -rf conftest* conftst*
877
878   # Do not use the global_symbol_pipe unless it works.
879   if test "$ac_pipe_works" = yes; then
880     if test x"$ac_symprfx" = x"_"; then
881       ac_cv_sys_symbol_underscore=yes
882     else
883       ac_cv_sys_symbol_underscore=no
884     fi
885     break
886   else
887     ac_cv_sys_global_symbol_pipe=
888   fi
889 done
890 ])
891
892 ac_result=yes
893 if test -z "$ac_cv_sys_global_symbol_pipe"; then
894    ac_result=no
895 fi
896 AC_MSG_RESULT($ac_result)
897 ])
898
899 AC_DEFUN(AC_LTDL_SYMBOL_USCORE,
900 [dnl does the compiler prefix global symbols with an underscore?
901 AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
902 AC_MSG_CHECKING([for _ prefix in compiled symbols])
903 AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
904 [ac_cv_sys_symbol_underscore=no
905 cat > conftest.$ac_ext <<EOF
906 void nm_test_func(){}
907 int main(){nm_test_func;return 0;}
908 EOF
909 if AC_TRY_EVAL(ac_compile); then
910   # Now try to grab the symbols.
911   ac_nlist=conftest.nm
912   if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
913     # See whether the symbols have a leading underscore.
914     if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
915       ac_cv_sys_symbol_underscore=yes
916     else
917       if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
918         :
919       else
920         echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
921       fi
922     fi
923   else
924     echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
925   fi
926 else
927   echo "configure: failed program was:" >&AC_FD_CC
928   cat conftest.c >&AC_FD_CC
929 fi
930 rm -rf conftest*
931 ])
932 AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
933 AC_LTDL_DLSYM_USCORE
934 ])
935
936 AC_DEFUN(AC_LTDL_DLSYM_USCORE,
937 [AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
938 if test x"$ac_cv_sys_symbol_underscore" = xyes; then
939   if test x"$ac_cv_func_dlopen" = xyes ||
940      test x"$ac_cv_lib_dl_dlopen" = xyes ; then
941         AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
942                 libltdl_cv_need_uscore, [dnl
943                 AC_TRY_RUN([
944 #if HAVE_DLFCN_H
945 #include <dlfcn.h>
946 #endif
947
948 #include <stdio.h>
949
950 #ifdef RTLD_GLOBAL
951 # define LTDL_GLOBAL    RTLD_GLOBAL
952 #else
953 # ifdef DL_GLOBAL
954 #  define LTDL_GLOBAL   DL_GLOBAL
955 # else
956 #  define LTDL_GLOBAL   0
957 # endif
958 #endif
959
960 /* We may have to define LTDL_LAZY_OR_NOW in the command line if we
961    find out it does not work in some platform. */
962 #ifndef LTDL_LAZY_OR_NOW
963 # ifdef RTLD_LAZY
964 #  define LTDL_LAZY_OR_NOW      RTLD_LAZY
965 # else
966 #  ifdef DL_LAZY
967 #   define LTDL_LAZY_OR_NOW     DL_LAZY
968 #  else
969 #   ifdef RTLD_NOW
970 #    define LTDL_LAZY_OR_NOW    RTLD_NOW
971 #   else
972 #    ifdef DL_NOW
973 #     define LTDL_LAZY_OR_NOW   DL_NOW
974 #    else
975 #     define LTDL_LAZY_OR_NOW   0
976 #    endif
977 #   endif
978 #  endif
979 # endif
980 #endif
981
982 fnord() { int i=42;}
983 main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
984     if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
985                if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
986 ],      libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
987         libltdl_cv_need_uscore=cross
988 )])
989   fi
990 fi
991
992 if test x"$libltdl_cv_need_uscore" = xyes; then
993   AC_DEFINE(NEED_USCORE, 1,
994     [Define if dlsym() requires a leading underscode in symbol names. ])
995 fi
996 ])
997