1dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13sinclude(../config/accross.m4)
14
15dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
16AC_DEFUN([BFD_BINARY_FOPEN],
17[AC_REQUIRE([AC_CANONICAL_SYSTEM])
18case "${host}" in
19changequote(,)dnl
20*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
21changequote([,])dnl
22  AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
23esac])dnl
24
25dnl Get a default for CC_FOR_BUILD to put into Makefile.
26AC_DEFUN([BFD_CC_FOR_BUILD],
27[# Put a plausible default for CC_FOR_BUILD in Makefile.
28if test -z "$CC_FOR_BUILD"; then
29  if test "x$cross_compiling" = "xno"; then
30    CC_FOR_BUILD='$(CC)'
31  else
32    CC_FOR_BUILD=gcc
33  fi
34fi
35AC_SUBST(CC_FOR_BUILD)
36# Also set EXEEXT_FOR_BUILD.
37if test "x$cross_compiling" = "xno"; then
38  EXEEXT_FOR_BUILD='$(EXEEXT)'
39else
40  AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
41    [rm -f conftest*
42     echo 'int main () { return 0; }' > conftest.c
43     bfd_cv_build_exeext=
44     ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
45     for file in conftest.*; do
46       case $file in
47       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
48       *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
49       esac
50     done
51     rm -f conftest*
52     test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
53  EXEEXT_FOR_BUILD=""
54  test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
55fi
56AC_SUBST(EXEEXT_FOR_BUILD)])dnl
57
58dnl See whether we need a declaration for a function.
59AC_DEFUN([BFD_NEED_DECLARATION],
60[AC_MSG_CHECKING([whether $1 must be declared])
61AC_CACHE_VAL(bfd_cv_decl_needed_$1,
62[AC_TRY_COMPILE([
63#include <stdio.h>
64#ifdef HAVE_STRING_H
65#include <string.h>
66#else
67#ifdef HAVE_STRINGS_H
68#include <strings.h>
69#endif
70#endif
71#ifdef HAVE_STDLIB_H
72#include <stdlib.h>
73#endif
74#ifdef HAVE_UNISTD_H
75#include <unistd.h>
76#endif],
77[char *(*pfn) = (char *(*)) $1],
78bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
79AC_MSG_RESULT($bfd_cv_decl_needed_$1)
80if test $bfd_cv_decl_needed_$1 = yes; then
81  AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
82	    [Define if $1 is not declared in system header files.])
83fi
84])dnl
85
86dnl Check for existence of a type $1 in sys/procfs.h
87
88AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],
89[AC_MSG_CHECKING([for $1 in sys/procfs.h])
90 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
91   [AC_TRY_COMPILE([
92#define _SYSCALL32
93#include <sys/procfs.h>],
94      [$1 avar],
95      bfd_cv_have_sys_procfs_type_$1=yes,
96      bfd_cv_have_sys_procfs_type_$1=no
97   )])
98 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
99   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
100	     [Define if <sys/procfs.h> has $1.])
101 fi
102 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
103])
104
105
106dnl Check for existence of member $2 in type $1 in sys/procfs.h
107
108AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
109[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
110 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
111   [AC_TRY_COMPILE([
112#define _SYSCALL32
113#include <sys/procfs.h>],
114      [$1 avar; void* aref = (void*) &avar.$2],
115      bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
116      bfd_cv_have_sys_procfs_type_member_$1_$2=no
117   )])
118 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
119   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
120	     [Define if <sys/procfs.h> has $1.$2.])
121 fi
122 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
123])
124
125sinclude(../libtool.m4)
126dnl The lines below arrange for aclocal not to bring libtool.m4
127dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
128dnl to add a definition of LIBTOOL to Makefile.in.
129ifelse(yes,no,[
130AC_DEFUN([AM_PROG_LIBTOOL],)
131AC_DEFUN([AM_DISABLE_SHARED],)
132AC_SUBST(LIBTOOL)
133])
134
135sinclude(../gettext.m4)
136ifelse(yes,no,[
137AC_DEFUN([CY_WITH_NLS],)
138AC_SUBST(INTLLIBS)
139])
140
141AC_DEFUN([AM_INSTALL_LIBBFD],
142[AC_MSG_CHECKING([whether to install libbfd])
143  AC_ARG_ENABLE(install-libbfd,
144[  --enable-install-libbfd controls installation of libbfd and related headers],
145      install_libbfd_p=$enableval,
146      if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
147        install_libbfd_p=yes
148      else
149        install_libbfd_p=no
150      fi)
151  AC_MSG_RESULT($install_libbfd_p)
152  AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
153  # libbfd.a is a host library containing target dependent code
154  bfdlibdir='$(libdir)'
155  bfdincludedir='$(includedir)'
156  if test "${host}" != "${target}"; then
157    bfdlibdir='$(exec_prefix)/$(host_alias)/$(target_alias)/lib'
158    bfdincludedir='$(exec_prefix)/$(host_alias)/$(target_alias)/include'
159  fi
160  AC_SUBST(bfdlibdir)
161  AC_SUBST(bfdincludedir)
162]
163)
164
165# lib-prefix.m4 serial 3 (gettext-0.13)
166dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
167dnl This file is free software, distributed under the terms of the GNU
168dnl General Public License.  As a special exception to the GNU General
169dnl Public License, this file may be distributed as part of a program
170dnl that contains a configuration script generated by Autoconf, under
171dnl the same distribution terms as the rest of that program.
172
173dnl From Bruno Haible.
174
175dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
176dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
177dnl require excessive bracketing.
178ifdef([AC_HELP_STRING],
179[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
180[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
181
182dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
183dnl to access previously installed libraries. The basic assumption is that
184dnl a user will want packages to use other packages he previously installed
185dnl with the same --prefix option.
186dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
187dnl libraries, but is otherwise very convenient.
188AC_DEFUN([AC_LIB_PREFIX],
189[
190  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
191  AC_REQUIRE([AC_PROG_CC])
192  AC_REQUIRE([AC_CANONICAL_HOST])
193  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
194  dnl By default, look in $includedir and $libdir.
195  use_additional=yes
196  AC_LIB_WITH_FINAL_PREFIX([
197    eval additional_includedir=\"$includedir\"
198    eval additional_libdir=\"$libdir\"
199  ])
200  AC_LIB_ARG_WITH([lib-prefix],
201[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
202  --without-lib-prefix    don't search for libraries in includedir and libdir],
203[
204    if test "X$withval" = "Xno"; then
205      use_additional=no
206    else
207      if test "X$withval" = "X"; then
208        AC_LIB_WITH_FINAL_PREFIX([
209          eval additional_includedir=\"$includedir\"
210          eval additional_libdir=\"$libdir\"
211        ])
212      else
213        additional_includedir="$withval/include"
214        additional_libdir="$withval/lib"
215      fi
216    fi
217])
218  if test $use_additional = yes; then
219    dnl Potentially add $additional_includedir to $CPPFLAGS.
220    dnl But don't add it
221    dnl   1. if it's the standard /usr/include,
222    dnl   2. if it's already present in $CPPFLAGS,
223    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
224    dnl   4. if it doesn't exist as a directory.
225    if test "X$additional_includedir" != "X/usr/include"; then
226      haveit=
227      for x in $CPPFLAGS; do
228        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
229        if test "X$x" = "X-I$additional_includedir"; then
230          haveit=yes
231          break
232        fi
233      done
234      if test -z "$haveit"; then
235        if test "X$additional_includedir" = "X/usr/local/include"; then
236          if test -n "$GCC"; then
237            case $host_os in
238              linux*) haveit=yes;;
239            esac
240          fi
241        fi
242        if test -z "$haveit"; then
243          if test -d "$additional_includedir"; then
244            dnl Really add $additional_includedir to $CPPFLAGS.
245            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
246          fi
247        fi
248      fi
249    fi
250    dnl Potentially add $additional_libdir to $LDFLAGS.
251    dnl But don't add it
252    dnl   1. if it's the standard /usr/lib,
253    dnl   2. if it's already present in $LDFLAGS,
254    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
255    dnl   4. if it doesn't exist as a directory.
256    if test "X$additional_libdir" != "X/usr/lib"; then
257      haveit=
258      for x in $LDFLAGS; do
259        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
260        if test "X$x" = "X-L$additional_libdir"; then
261          haveit=yes
262          break
263        fi
264      done
265      if test -z "$haveit"; then
266        if test "X$additional_libdir" = "X/usr/local/lib"; then
267          if test -n "$GCC"; then
268            case $host_os in
269              linux*) haveit=yes;;
270            esac
271          fi
272        fi
273        if test -z "$haveit"; then
274          if test -d "$additional_libdir"; then
275            dnl Really add $additional_libdir to $LDFLAGS.
276            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
277          fi
278        fi
279      fi
280    fi
281  fi
282])
283
284dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
285dnl acl_final_exec_prefix, containing the values to which $prefix and
286dnl $exec_prefix will expand at the end of the configure script.
287AC_DEFUN([AC_LIB_PREPARE_PREFIX],
288[
289  dnl Unfortunately, prefix and exec_prefix get only finally determined
290  dnl at the end of configure.
291  if test "X$prefix" = "XNONE"; then
292    acl_final_prefix="$ac_default_prefix"
293  else
294    acl_final_prefix="$prefix"
295  fi
296  if test "X$exec_prefix" = "XNONE"; then
297    acl_final_exec_prefix='${prefix}'
298  else
299    acl_final_exec_prefix="$exec_prefix"
300  fi
301  acl_save_prefix="$prefix"
302  prefix="$acl_final_prefix"
303  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
304  prefix="$acl_save_prefix"
305])
306
307dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
308dnl variables prefix and exec_prefix bound to the values they will have
309dnl at the end of the configure script.
310AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
311[
312  acl_save_prefix="$prefix"
313  prefix="$acl_final_prefix"
314  acl_save_exec_prefix="$exec_prefix"
315  exec_prefix="$acl_final_exec_prefix"
316  $1
317  exec_prefix="$acl_save_exec_prefix"
318  prefix="$acl_save_prefix"
319])
320
321# lib-link.m4 serial 4 (gettext-0.12)
322dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
323dnl This file is free software, distributed under the terms of the GNU
324dnl General Public License.  As a special exception to the GNU General
325dnl Public License, this file may be distributed as part of a program
326dnl that contains a configuration script generated by Autoconf, under
327dnl the same distribution terms as the rest of that program.
328
329dnl From Bruno Haible.
330
331dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
332dnl the libraries corresponding to explicit and implicit dependencies.
333dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
334dnl augments the CPPFLAGS variable.
335AC_DEFUN([AC_LIB_LINKFLAGS],
336[
337  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
338  AC_REQUIRE([AC_LIB_RPATH])
339  define([Name],[translit([$1],[./-], [___])])
340  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
341                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
342  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
343    AC_LIB_LINKFLAGS_BODY([$1], [$2])
344    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
345    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
346    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
347  ])
348  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
349  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
350  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
351  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
352  AC_SUBST([LIB]NAME)
353  AC_SUBST([LTLIB]NAME)
354  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
355  dnl results of this search when this library appears as a dependency.
356  HAVE_LIB[]NAME=yes
357  undefine([Name])
358  undefine([NAME])
359])
360
361dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
362dnl searches for libname and the libraries corresponding to explicit and
363dnl implicit dependencies, together with the specified include files and
364dnl the ability to compile and link the specified testcode. If found, it
365dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
366dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
367dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
368dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
369AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
370[
371  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
372  AC_REQUIRE([AC_LIB_RPATH])
373  define([Name],[translit([$1],[./-], [___])])
374  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
375                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
376
377  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
378  dnl accordingly.
379  AC_LIB_LINKFLAGS_BODY([$1], [$2])
380
381  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
382  dnl because if the user has installed lib[]Name and not disabled its use
383  dnl via --without-lib[]Name-prefix, he wants to use it.
384  ac_save_CPPFLAGS="$CPPFLAGS"
385  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
386
387  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
388    ac_save_LIBS="$LIBS"
389    LIBS="$LIBS $LIB[]NAME"
390    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
391    LIBS="$ac_save_LIBS"
392  ])
393  if test "$ac_cv_lib[]Name" = yes; then
394    HAVE_LIB[]NAME=yes
395    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
396    AC_MSG_CHECKING([how to link with lib[]$1])
397    AC_MSG_RESULT([$LIB[]NAME])
398  else
399    HAVE_LIB[]NAME=no
400    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
401    dnl $INC[]NAME either.
402    CPPFLAGS="$ac_save_CPPFLAGS"
403    LIB[]NAME=
404    LTLIB[]NAME=
405  fi
406  AC_SUBST([HAVE_LIB]NAME)
407  AC_SUBST([LIB]NAME)
408  AC_SUBST([LTLIB]NAME)
409  undefine([Name])
410  undefine([NAME])
411])
412
413dnl Determine the platform dependent parameters needed to use rpath:
414dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
415dnl hardcode_direct, hardcode_minus_L.
416AC_DEFUN([AC_LIB_RPATH],
417[
418  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
419  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
420  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
421  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
422  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
423    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
424    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
425    . ./conftest.sh
426    rm -f ./conftest.sh
427    acl_cv_rpath=done
428  ])
429  wl="$acl_cv_wl"
430  libext="$acl_cv_libext"
431  shlibext="$acl_cv_shlibext"
432  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
433  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
434  hardcode_direct="$acl_cv_hardcode_direct"
435  hardcode_minus_L="$acl_cv_hardcode_minus_L"
436  dnl Determine whether the user wants rpath handling at all.
437  AC_ARG_ENABLE(rpath,
438    [  --disable-rpath         do not hardcode runtime library paths],
439    :, enable_rpath=yes)
440])
441
442dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
443dnl the libraries corresponding to explicit and implicit dependencies.
444dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
445AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
446[
447  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
448                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
449  dnl By default, look in $includedir and $libdir.
450  use_additional=yes
451  AC_LIB_WITH_FINAL_PREFIX([
452    eval additional_includedir=\"$includedir\"
453    eval additional_libdir=\"$libdir\"
454  ])
455  AC_LIB_ARG_WITH([lib$1-prefix],
456[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
457  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
458[
459    if test "X$withval" = "Xno"; then
460      use_additional=no
461    else
462      if test "X$withval" = "X"; then
463        AC_LIB_WITH_FINAL_PREFIX([
464          eval additional_includedir=\"$includedir\"
465          eval additional_libdir=\"$libdir\"
466        ])
467      else
468        additional_includedir="$withval/include"
469        additional_libdir="$withval/lib"
470      fi
471    fi
472])
473  dnl Search the library and its dependencies in $additional_libdir and
474  dnl $LDFLAGS. Using breadth-first-seach.
475  LIB[]NAME=
476  LTLIB[]NAME=
477  INC[]NAME=
478  rpathdirs=
479  ltrpathdirs=
480  names_already_handled=
481  names_next_round='$1 $2'
482  while test -n "$names_next_round"; do
483    names_this_round="$names_next_round"
484    names_next_round=
485    for name in $names_this_round; do
486      already_handled=
487      for n in $names_already_handled; do
488        if test "$n" = "$name"; then
489          already_handled=yes
490          break
491        fi
492      done
493      if test -z "$already_handled"; then
494        names_already_handled="$names_already_handled $name"
495        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
496        dnl or AC_LIB_HAVE_LINKFLAGS call.
497        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
498        eval value=\"\$HAVE_LIB$uppername\"
499        if test -n "$value"; then
500          if test "$value" = yes; then
501            eval value=\"\$LIB$uppername\"
502            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
503            eval value=\"\$LTLIB$uppername\"
504            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
505          else
506            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
507            dnl that this library doesn't exist. So just drop it.
508            :
509          fi
510        else
511          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
512          dnl and the already constructed $LIBNAME/$LTLIBNAME.
513          found_dir=
514          found_la=
515          found_so=
516          found_a=
517          if test $use_additional = yes; then
518            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
519              found_dir="$additional_libdir"
520              found_so="$additional_libdir/lib$name.$shlibext"
521              if test -f "$additional_libdir/lib$name.la"; then
522                found_la="$additional_libdir/lib$name.la"
523              fi
524            else
525              if test -f "$additional_libdir/lib$name.$libext"; then
526                found_dir="$additional_libdir"
527                found_a="$additional_libdir/lib$name.$libext"
528                if test -f "$additional_libdir/lib$name.la"; then
529                  found_la="$additional_libdir/lib$name.la"
530                fi
531              fi
532            fi
533          fi
534          if test "X$found_dir" = "X"; then
535            for x in $LDFLAGS $LTLIB[]NAME; do
536              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
537              case "$x" in
538                -L*)
539                  dir=`echo "X$x" | sed -e 's/^X-L//'`
540                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
541                    found_dir="$dir"
542                    found_so="$dir/lib$name.$shlibext"
543                    if test -f "$dir/lib$name.la"; then
544                      found_la="$dir/lib$name.la"
545                    fi
546                  else
547                    if test -f "$dir/lib$name.$libext"; then
548                      found_dir="$dir"
549                      found_a="$dir/lib$name.$libext"
550                      if test -f "$dir/lib$name.la"; then
551                        found_la="$dir/lib$name.la"
552                      fi
553                    fi
554                  fi
555                  ;;
556              esac
557              if test "X$found_dir" != "X"; then
558                break
559              fi
560            done
561          fi
562          if test "X$found_dir" != "X"; then
563            dnl Found the library.
564            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
565            if test "X$found_so" != "X"; then
566              dnl Linking with a shared library. We attempt to hardcode its
567              dnl directory into the executable's runpath, unless it's the
568              dnl standard /usr/lib.
569              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
570                dnl No hardcoding is needed.
571                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
572              else
573                dnl Use an explicit option to hardcode DIR into the resulting
574                dnl binary.
575                dnl Potentially add DIR to ltrpathdirs.
576                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
577                haveit=
578                for x in $ltrpathdirs; do
579                  if test "X$x" = "X$found_dir"; then
580                    haveit=yes
581                    break
582                  fi
583                done
584                if test -z "$haveit"; then
585                  ltrpathdirs="$ltrpathdirs $found_dir"
586                fi
587                dnl The hardcoding into $LIBNAME is system dependent.
588                if test "$hardcode_direct" = yes; then
589                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
590                  dnl resulting binary.
591                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
592                else
593                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
594                    dnl Use an explicit option to hardcode DIR into the resulting
595                    dnl binary.
596                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
597                    dnl Potentially add DIR to rpathdirs.
598                    dnl The rpathdirs will be appended to $LIBNAME at the end.
599                    haveit=
600                    for x in $rpathdirs; do
601                      if test "X$x" = "X$found_dir"; then
602                        haveit=yes
603                        break
604                      fi
605                    done
606                    if test -z "$haveit"; then
607                      rpathdirs="$rpathdirs $found_dir"
608                    fi
609                  else
610                    dnl Rely on "-L$found_dir".
611                    dnl But don't add it if it's already contained in the LDFLAGS
612                    dnl or the already constructed $LIBNAME
613                    haveit=
614                    for x in $LDFLAGS $LIB[]NAME; do
615                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
616                      if test "X$x" = "X-L$found_dir"; then
617                        haveit=yes
618                        break
619                      fi
620                    done
621                    if test -z "$haveit"; then
622                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
623                    fi
624                    if test "$hardcode_minus_L" != no; then
625                      dnl FIXME: Not sure whether we should use
626                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
627                      dnl here.
628                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
629                    else
630                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
631                      dnl here, because this doesn't fit in flags passed to the
632                      dnl compiler. So give up. No hardcoding. This affects only
633                      dnl very old systems.
634                      dnl FIXME: Not sure whether we should use
635                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
636                      dnl here.
637                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
638                    fi
639                  fi
640                fi
641              fi
642            else
643              if test "X$found_a" != "X"; then
644                dnl Linking with a static library.
645                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
646              else
647                dnl We shouldn't come here, but anyway it's good to have a
648                dnl fallback.
649                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
650              fi
651            fi
652            dnl Assume the include files are nearby.
653            additional_includedir=
654            case "$found_dir" in
655              */lib | */lib/)
656                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
657                additional_includedir="$basedir/include"
658                ;;
659            esac
660            if test "X$additional_includedir" != "X"; then
661              dnl Potentially add $additional_includedir to $INCNAME.
662              dnl But don't add it
663              dnl   1. if it's the standard /usr/include,
664              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
665              dnl   3. if it's already present in $CPPFLAGS or the already
666              dnl      constructed $INCNAME,
667              dnl   4. if it doesn't exist as a directory.
668              if test "X$additional_includedir" != "X/usr/include"; then
669                haveit=
670                if test "X$additional_includedir" = "X/usr/local/include"; then
671                  if test -n "$GCC"; then
672                    case $host_os in
673                      linux*) haveit=yes;;
674                    esac
675                  fi
676                fi
677                if test -z "$haveit"; then
678                  for x in $CPPFLAGS $INC[]NAME; do
679                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
680                    if test "X$x" = "X-I$additional_includedir"; then
681                      haveit=yes
682                      break
683                    fi
684                  done
685                  if test -z "$haveit"; then
686                    if test -d "$additional_includedir"; then
687                      dnl Really add $additional_includedir to $INCNAME.
688                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
689                    fi
690                  fi
691                fi
692              fi
693            fi
694            dnl Look for dependencies.
695            if test -n "$found_la"; then
696              dnl Read the .la file. It defines the variables
697              dnl dlname, library_names, old_library, dependency_libs, current,
698              dnl age, revision, installed, dlopen, dlpreopen, libdir.
699              save_libdir="$libdir"
700              case "$found_la" in
701                */* | *\\*) . "$found_la" ;;
702                *) . "./$found_la" ;;
703              esac
704              libdir="$save_libdir"
705              dnl We use only dependency_libs.
706              for dep in $dependency_libs; do
707                case "$dep" in
708                  -L*)
709                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
710                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
711                    dnl But don't add it
712                    dnl   1. if it's the standard /usr/lib,
713                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
714                    dnl   3. if it's already present in $LDFLAGS or the already
715                    dnl      constructed $LIBNAME,
716                    dnl   4. if it doesn't exist as a directory.
717                    if test "X$additional_libdir" != "X/usr/lib"; then
718                      haveit=
719                      if test "X$additional_libdir" = "X/usr/local/lib"; then
720                        if test -n "$GCC"; then
721                          case $host_os in
722                            linux*) haveit=yes;;
723                          esac
724                        fi
725                      fi
726                      if test -z "$haveit"; then
727                        haveit=
728                        for x in $LDFLAGS $LIB[]NAME; do
729                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
730                          if test "X$x" = "X-L$additional_libdir"; then
731                            haveit=yes
732                            break
733                          fi
734                        done
735                        if test -z "$haveit"; then
736                          if test -d "$additional_libdir"; then
737                            dnl Really add $additional_libdir to $LIBNAME.
738                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
739                          fi
740                        fi
741                        haveit=
742                        for x in $LDFLAGS $LTLIB[]NAME; do
743                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
744                          if test "X$x" = "X-L$additional_libdir"; then
745                            haveit=yes
746                            break
747                          fi
748                        done
749                        if test -z "$haveit"; then
750                          if test -d "$additional_libdir"; then
751                            dnl Really add $additional_libdir to $LTLIBNAME.
752                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
753                          fi
754                        fi
755                      fi
756                    fi
757                    ;;
758                  -R*)
759                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
760                    if test "$enable_rpath" != no; then
761                      dnl Potentially add DIR to rpathdirs.
762                      dnl The rpathdirs will be appended to $LIBNAME at the end.
763                      haveit=
764                      for x in $rpathdirs; do
765                        if test "X$x" = "X$dir"; then
766                          haveit=yes
767                          break
768                        fi
769                      done
770                      if test -z "$haveit"; then
771                        rpathdirs="$rpathdirs $dir"
772                      fi
773                      dnl Potentially add DIR to ltrpathdirs.
774                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
775                      haveit=
776                      for x in $ltrpathdirs; do
777                        if test "X$x" = "X$dir"; then
778                          haveit=yes
779                          break
780                        fi
781                      done
782                      if test -z "$haveit"; then
783                        ltrpathdirs="$ltrpathdirs $dir"
784                      fi
785                    fi
786                    ;;
787                  -l*)
788                    dnl Handle this in the next round.
789                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
790                    ;;
791                  *.la)
792                    dnl Handle this in the next round. Throw away the .la's
793                    dnl directory; it is already contained in a preceding -L
794                    dnl option.
795                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
796                    ;;
797                  *)
798                    dnl Most likely an immediate library name.
799                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
800                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
801                    ;;
802                esac
803              done
804            fi
805          else
806            dnl Didn't find the library; assume it is in the system directories
807            dnl known to the linker and runtime loader. (All the system
808            dnl directories known to the linker should also be known to the
809            dnl runtime loader, otherwise the system is severely misconfigured.)
810            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
811            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
812          fi
813        fi
814      fi
815    done
816  done
817  if test "X$rpathdirs" != "X"; then
818    if test -n "$hardcode_libdir_separator"; then
819      dnl Weird platform: only the last -rpath option counts, the user must
820      dnl pass all path elements in one option. We can arrange that for a
821      dnl single library, but not when more than one $LIBNAMEs are used.
822      alldirs=
823      for found_dir in $rpathdirs; do
824        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
825      done
826      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
827      acl_save_libdir="$libdir"
828      libdir="$alldirs"
829      eval flag=\"$hardcode_libdir_flag_spec\"
830      libdir="$acl_save_libdir"
831      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
832    else
833      dnl The -rpath options are cumulative.
834      for found_dir in $rpathdirs; do
835        acl_save_libdir="$libdir"
836        libdir="$found_dir"
837        eval flag=\"$hardcode_libdir_flag_spec\"
838        libdir="$acl_save_libdir"
839        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
840      done
841    fi
842  fi
843  if test "X$ltrpathdirs" != "X"; then
844    dnl When using libtool, the option that works for both libraries and
845    dnl executables is -R. The -R options are cumulative.
846    for found_dir in $ltrpathdirs; do
847      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
848    done
849  fi
850])
851
852dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
853dnl unless already present in VAR.
854dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
855dnl contains two or three consecutive elements that belong together.
856AC_DEFUN([AC_LIB_APPENDTOVAR],
857[
858  for element in [$2]; do
859    haveit=
860    for x in $[$1]; do
861      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
862      if test "X$x" = "X$element"; then
863        haveit=yes
864        break
865      fi
866    done
867    if test -z "$haveit"; then
868      [$1]="${[$1]}${[$1]:+ }$element"
869    fi
870  done
871])
872
873# lib-ld.m4 serial 3 (gettext-0.13)
874dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
875dnl This file is free software, distributed under the terms of the GNU
876dnl General Public License.  As a special exception to the GNU General
877dnl Public License, this file may be distributed as part of a program
878dnl that contains a configuration script generated by Autoconf, under
879dnl the same distribution terms as the rest of that program.
880
881dnl Subroutines of libtool.m4,
882dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
883dnl with libtool.m4.
884
885dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
886AC_DEFUN([AC_LIB_PROG_LD_GNU],
887[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
888[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
889case `$LD -v 2>&1 </dev/null` in
890*GNU* | *'with BFD'*)
891  acl_cv_prog_gnu_ld=yes ;;
892*)
893  acl_cv_prog_gnu_ld=no ;;
894esac])
895with_gnu_ld=$acl_cv_prog_gnu_ld
896])
897
898dnl From libtool-1.4. Sets the variable LD.
899AC_DEFUN([AC_LIB_PROG_LD],
900[AC_ARG_WITH(gnu-ld,
901[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
902test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
903AC_REQUIRE([AC_PROG_CC])dnl
904AC_REQUIRE([AC_CANONICAL_HOST])dnl
905# Prepare PATH_SEPARATOR.
906# The user is always right.
907if test "${PATH_SEPARATOR+set}" != set; then
908  echo "#! /bin/sh" >conf$$.sh
909  echo  "exit 0"   >>conf$$.sh
910  chmod +x conf$$.sh
911  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
912    PATH_SEPARATOR=';'
913  else
914    PATH_SEPARATOR=:
915  fi
916  rm -f conf$$.sh
917fi
918ac_prog=ld
919if test "$GCC" = yes; then
920  # Check if gcc -print-prog-name=ld gives a path.
921  AC_MSG_CHECKING([for ld used by GCC])
922  case $host in
923  *-*-mingw*)
924    # gcc leaves a trailing carriage return which upsets mingw
925    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
926  *)
927    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
928  esac
929  case $ac_prog in
930    # Accept absolute paths.
931    [[\\/]* | [A-Za-z]:[\\/]*)]
932      [re_direlt='/[^/][^/]*/\.\./']
933      # Canonicalize the path of ld
934      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
935      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
936	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
937      done
938      test -z "$LD" && LD="$ac_prog"
939      ;;
940  "")
941    # If it fails, then pretend we aren't using GCC.
942    ac_prog=ld
943    ;;
944  *)
945    # If it is relative, then search for the first ld in PATH.
946    with_gnu_ld=unknown
947    ;;
948  esac
949elif test "$with_gnu_ld" = yes; then
950  AC_MSG_CHECKING([for GNU ld])
951else
952  AC_MSG_CHECKING([for non-GNU ld])
953fi
954AC_CACHE_VAL(acl_cv_path_LD,
955[if test -z "$LD"; then
956  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
957  for ac_dir in $PATH; do
958    test -z "$ac_dir" && ac_dir=.
959    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
960      acl_cv_path_LD="$ac_dir/$ac_prog"
961      # Check to see if the program is GNU ld.  I'd rather use --version,
962      # but apparently some GNU ld's only accept -v.
963      # Break only if it was the GNU/non-GNU ld that we prefer.
964      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
965      *GNU* | *'with BFD'*)
966	test "$with_gnu_ld" != no && break ;;
967      *)
968	test "$with_gnu_ld" != yes && break ;;
969      esac
970    fi
971  done
972  IFS="$ac_save_ifs"
973else
974  acl_cv_path_LD="$LD" # Let the user override the test with a path.
975fi])
976LD="$acl_cv_path_LD"
977if test -n "$LD"; then
978  AC_MSG_RESULT($LD)
979else
980  AC_MSG_RESULT(no)
981fi
982test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
983AC_LIB_PROG_LD_GNU
984])
985
986# Define a conditional.
987
988AC_DEFUN([AM_CONDITIONAL],
989[AC_SUBST($1_TRUE)
990AC_SUBST($1_FALSE)
991if $2; then
992  $1_TRUE=
993  $1_FALSE='#'
994else
995  $1_TRUE='#'
996  $1_FALSE=
997fi])
998
999# isc-posix.m4 serial 2 (gettext-0.11.2)
1000dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1001dnl This file is free software, distributed under the terms of the GNU
1002dnl General Public License.  As a special exception to the GNU General
1003dnl Public License, this file may be distributed as part of a program
1004dnl that contains a configuration script generated by Autoconf, under
1005dnl the same distribution terms as the rest of that program.
1006
1007# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
1008
1009# This test replaces the one in autoconf.
1010# Currently this macro should have the same name as the autoconf macro
1011# because gettext's gettext.m4 (distributed in the automake package)
1012# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
1013# give these diagnostics:
1014#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1015#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1016
1017undefine([AC_ISC_POSIX])
1018
1019AC_DEFUN([AC_ISC_POSIX],
1020  [
1021    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1022    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1023  ]
1024)
1025
1026# Do all the work for Automake.  This macro actually does too much --
1027# some checks are only needed if your package does certain things.
1028# But this isn't really a big deal.
1029
1030# serial 1
1031
1032dnl Usage:
1033dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1034
1035AC_DEFUN([AM_INIT_AUTOMAKE],
1036[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1037AC_REQUIRE([AC_PROG_INSTALL])
1038PACKAGE=[$1]
1039AC_SUBST(PACKAGE)
1040VERSION=[$2]
1041AC_SUBST(VERSION)
1042dnl test to see if srcdir already configured
1043if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1044  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1045fi
1046ifelse([$3],,
1047AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1048AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1049AC_REQUIRE([AM_SANITY_CHECK])
1050AC_REQUIRE([AC_ARG_PROGRAM])
1051dnl FIXME This is truly gross.
1052missing_dir=`cd $ac_aux_dir && pwd`
1053AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
1054AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1055AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
1056AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1057AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1058AC_REQUIRE([AC_PROG_MAKE_SET])])
1059
1060# Copyright 2002  Free Software Foundation, Inc.
1061
1062# This program is free software; you can redistribute it and/or modify
1063# it under the terms of the GNU General Public License as published by
1064# the Free Software Foundation; either version 2, or (at your option)
1065# any later version.
1066
1067# This program is distributed in the hope that it will be useful,
1068# but WITHOUT ANY WARRANTY; without even the implied warranty of
1069# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1070# GNU General Public License for more details.
1071
1072# You should have received a copy of the GNU General Public License
1073# along with this program; if not, write to the Free Software
1074# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1075
1076# AM_AUTOMAKE_VERSION(VERSION)
1077# ----------------------------
1078# Automake X.Y traces this macro to ensure aclocal.m4 has been
1079# generated from the m4 files accompanying Automake X.Y.
1080AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
1081
1082# AM_SET_CURRENT_AUTOMAKE_VERSION
1083# -------------------------------
1084# Call AM_AUTOMAKE_VERSION so it can be traced.
1085# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
1086AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1087	 [AM_AUTOMAKE_VERSION([1.4-p6])])
1088
1089#
1090# Check to make sure that the build environment is sane.
1091#
1092
1093AC_DEFUN([AM_SANITY_CHECK],
1094[AC_MSG_CHECKING([whether build environment is sane])
1095# Just in case
1096sleep 1
1097echo timestamp > conftestfile
1098# Do `set' in a subshell so we don't clobber the current shell's
1099# arguments.  Must try -L first in case configure is actually a
1100# symlink; some systems play weird games with the mod time of symlinks
1101# (eg FreeBSD returns the mod time of the symlink's containing
1102# directory).
1103if (
1104   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1105   if test "[$]*" = "X"; then
1106      # -L didn't work.
1107      set X `ls -t $srcdir/configure conftestfile`
1108   fi
1109   if test "[$]*" != "X $srcdir/configure conftestfile" \
1110      && test "[$]*" != "X conftestfile $srcdir/configure"; then
1111
1112      # If neither matched, then we have a broken ls.  This can happen
1113      # if, for instance, CONFIG_SHELL is bash and it inherits a
1114      # broken ls alias from the environment.  This has actually
1115      # happened.  Such a system could not be considered "sane".
1116      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1117alias in your environment])
1118   fi
1119
1120   test "[$]2" = conftestfile
1121   )
1122then
1123   # Ok.
1124   :
1125else
1126   AC_MSG_ERROR([newly created file is older than distributed files!
1127Check your system clock])
1128fi
1129rm -f conftest*
1130AC_MSG_RESULT(yes)])
1131
1132dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1133dnl The program must properly implement --version.
1134AC_DEFUN([AM_MISSING_PROG],
1135[AC_MSG_CHECKING(for working $2)
1136# Run test in a subshell; some versions of sh will print an error if
1137# an executable is not found, even if stderr is redirected.
1138# Redirect stdin to placate older versions of autoconf.  Sigh.
1139if ($2 --version) < /dev/null > /dev/null 2>&1; then
1140   $1=$2
1141   AC_MSG_RESULT(found)
1142else
1143   $1="$3/missing $2"
1144   AC_MSG_RESULT(missing)
1145fi
1146AC_SUBST($1)])
1147
1148# Like AC_CONFIG_HEADER, but automatically create stamp file.
1149
1150AC_DEFUN([AM_CONFIG_HEADER],
1151[AC_PREREQ([2.12])
1152AC_CONFIG_HEADER([$1])
1153dnl When config.status generates a header, we must update the stamp-h file.
1154dnl This file resides in the same directory as the config header
1155dnl that is generated.  We must strip everything past the first ":",
1156dnl and everything past the last "/".
1157AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1158ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1159<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1160<<am_indx=1
1161for am_file in <<$1>>; do
1162  case " <<$>>CONFIG_HEADERS " in
1163  *" <<$>>am_file "*<<)>>
1164    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1165    ;;
1166  esac
1167  am_indx=`expr "<<$>>am_indx" + 1`
1168done<<>>dnl>>)
1169changequote([,]))])
1170
1171# Add --enable-maintainer-mode option to configure.
1172# From Jim Meyering
1173
1174# serial 1
1175
1176AC_DEFUN([AM_MAINTAINER_MODE],
1177[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1178  dnl maintainer-mode is disabled by default
1179  AC_ARG_ENABLE(maintainer-mode,
1180[  --enable-maintainer-mode enable make rules and dependencies not useful
1181                          (and sometimes confusing) to the casual installer],
1182      USE_MAINTAINER_MODE=$enableval,
1183      USE_MAINTAINER_MODE=no)
1184  AC_MSG_RESULT($USE_MAINTAINER_MODE)
1185  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1186  MAINT=$MAINTAINER_MODE_TRUE
1187  AC_SUBST(MAINT)dnl
1188]
1189)
1190
1191