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