OSDN Git Service

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