aclocal.m4 revision 94536
1126370Sphkdnl aclocal.m4 generated automatically by aclocal 1.4-p5
2126370Sphk
3126370Sphkdnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4126370Sphkdnl This file is free software; the Free Software Foundation
5126370Sphkdnl gives unlimited permission to copy and/or distribute it,
6126370Sphkdnl with or without modifications, as long as this notice is preserved.
7126370Sphk
8126370Sphkdnl This program is distributed in the hope that it will be useful,
9126370Sphkdnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10126370Sphkdnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11126370Sphkdnl PARTICULAR PURPOSE.
12126370Sphk
13126370Sphkdnl See whether we need to use fopen-bin.h rather than fopen-same.h.
14126370SphkAC_DEFUN(BFD_BINARY_FOPEN,
15126370Sphk[AC_REQUIRE([AC_CANONICAL_SYSTEM])
16126370Sphkcase "${host}" in
17126370Sphkchangequote(,)dnl
18126370Sphk*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
19126370Sphkchangequote([,])dnl
20126370Sphk  AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
21126370Sphkesac])dnl
22126370Sphk
23126370Sphkdnl Get a default for CC_FOR_BUILD to put into Makefile.
24126370SphkAC_DEFUN(BFD_CC_FOR_BUILD,
25126370Sphk[# Put a plausible default for CC_FOR_BUILD in Makefile.
26126370Sphkif test -z "$CC_FOR_BUILD"; then
27126370Sphk  if test "x$cross_compiling" = "xno"; then
28126370Sphk    CC_FOR_BUILD='$(CC)'
29126370Sphk  else
30126370Sphk    CC_FOR_BUILD=gcc
31126370Sphk  fi
32126370Sphkfi
33126370SphkAC_SUBST(CC_FOR_BUILD)
34126370Sphk# Also set EXEEXT_FOR_BUILD.
35126370Sphkif test "x$cross_compiling" = "xno"; then
36126370Sphk  EXEEXT_FOR_BUILD='$(EXEEXT)'
37126370Sphkelse
38126370Sphk  AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
39126370Sphk    [rm -f conftest*
40126370Sphk     echo 'int main () { return 0; }' > conftest.c
41126370Sphk     bfd_cv_build_exeext=
42130585Sphk     ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
43221121Sattilio     for file in conftest.*; do
44126370Sphk       case $file in
45126370Sphk       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
46221121Sattilio       *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
47221121Sattilio       esac
48221121Sattilio     done
49221121Sattilio     rm -f conftest*
50221121Sattilio     test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
51221121Sattilio  EXEEXT_FOR_BUILD=""
52221121Sattilio  test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
53221121Sattiliofi
54221121SattilioAC_SUBST(EXEEXT_FOR_BUILD)])dnl
55221121Sattilio
56221121Sattiliodnl See whether we need a declaration for a function.
57221121SattilioAC_DEFUN(BFD_NEED_DECLARATION,
58221121Sattilio[AC_MSG_CHECKING([whether $1 must be declared])
59221121SattilioAC_CACHE_VAL(bfd_cv_decl_needed_$1,
60221121Sattilio[AC_TRY_COMPILE([
61221121Sattilio#include <stdio.h>
62221121Sattilio#ifdef HAVE_STRING_H
63221121Sattilio#include <string.h>
64221121Sattilio#else
65221121Sattilio#ifdef HAVE_STRINGS_H
66221121Sattilio#include <strings.h>
67221121Sattilio#endif
68221121Sattilio#endif
69221121Sattilio#ifdef HAVE_STDLIB_H
70221121Sattilio#include <stdlib.h>
71221121Sattilio#endif
72221121Sattilio#ifdef HAVE_UNISTD_H
73130585Sphk#include <unistd.h>
74126370Sphk#endif],
75126370Sphk[char *(*pfn) = (char *(*)) $1],
76126370Sphkbfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
77126370SphkAC_MSG_RESULT($bfd_cv_decl_needed_$1)
78126370Sphkif test $bfd_cv_decl_needed_$1 = yes; then
79126370Sphk  AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
80126370Sphk	    [Define if $1 is not declared in system header files.])
81221121Sattiliofi
82126370Sphk])dnl
83126370Sphk
84126370Sphkdnl Check for existence of a type $1 in sys/procfs.h
85221121Sattilio
86221121SattilioAC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
87167950Sn_hibma[AC_MSG_CHECKING([for $1 in sys/procfs.h])
88165260Sn_hibma AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
89165260Sn_hibma   [AC_TRY_COMPILE([
90221121Sattilio#define _SYSCALL32
91221121Sattilio#include <sys/procfs.h>],
92221121Sattilio      [$1 avar],
93126370Sphk      bfd_cv_have_sys_procfs_type_$1=yes,
94126370Sphk      bfd_cv_have_sys_procfs_type_$1=no
95221121Sattilio   )])
96221121Sattilio if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
97221121Sattilio   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
98221121Sattilio	     [Define if <sys/procfs.h> has $1.])
99221121Sattilio fi
100221121Sattilio AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
101221121Sattilio])
102221121Sattilio
103221121Sattilio
104221121Sattiliodnl Check for existence of member $2 in type $1 in sys/procfs.h
105221121Sattilio
106221121SattilioAC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
107221121Sattilio[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
108221121Sattilio AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
109221121Sattilio   [AC_TRY_COMPILE([
110221121Sattilio#define _SYSCALL32
111221121Sattilio#include <sys/procfs.h>],
112126370Sphk      [$1 avar; void* aref = (void*) &avar.$2],
113126370Sphk      bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
114126370Sphk      bfd_cv_have_sys_procfs_type_member_$1_$2=no
115126370Sphk   )])
116126370Sphk if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
117126370Sphk   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
118126370Sphk	     [Define if <sys/procfs.h> has $1.$2.])
119126370Sphk fi
120126370Sphk AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
121126370Sphk])
122126370Sphk
123126370Sphksinclude(../libtool.m4)
124126370Sphkdnl The lines below arrange for aclocal not to bring libtool.m4
125126370Sphkdnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
126126370Sphkdnl to add a definition of LIBTOOL to Makefile.in.
127126370Sphkifelse(yes,no,[
128126370SphkAC_DEFUN([AM_PROG_LIBTOOL],)
129126370SphkAC_DEFUN([AM_DISABLE_SHARED],)
130126370SphkAC_SUBST(LIBTOOL)
131126370Sphk])
132126370Sphk
133126370Sphksinclude(../gettext.m4)
134126370Sphkifelse(yes,no,[
135126370SphkAC_DEFUN([CY_WITH_NLS],)
136126370SphkAC_SUBST(INTLLIBS)
137])
138
139# Do all the work for Automake.  This macro actually does too much --
140# some checks are only needed if your package does certain things.
141# But this isn't really a big deal.
142
143# serial 1
144
145dnl Usage:
146dnl AM_INIT_AUTOMAKE(package,version, [no-define])
147
148AC_DEFUN([AM_INIT_AUTOMAKE],
149[AC_REQUIRE([AC_PROG_INSTALL])
150PACKAGE=[$1]
151AC_SUBST(PACKAGE)
152VERSION=[$2]
153AC_SUBST(VERSION)
154dnl test to see if srcdir already configured
155if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
156  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
157fi
158ifelse([$3],,
159AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
160AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
161AC_REQUIRE([AM_SANITY_CHECK])
162AC_REQUIRE([AC_ARG_PROGRAM])
163dnl FIXME This is truly gross.
164missing_dir=`cd $ac_aux_dir && pwd`
165AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
166AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
167AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
168AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
169AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
170AC_REQUIRE([AC_PROG_MAKE_SET])])
171
172#
173# Check to make sure that the build environment is sane.
174#
175
176AC_DEFUN([AM_SANITY_CHECK],
177[AC_MSG_CHECKING([whether build environment is sane])
178# Just in case
179sleep 1
180echo timestamp > conftestfile
181# Do `set' in a subshell so we don't clobber the current shell's
182# arguments.  Must try -L first in case configure is actually a
183# symlink; some systems play weird games with the mod time of symlinks
184# (eg FreeBSD returns the mod time of the symlink's containing
185# directory).
186if (
187   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
188   if test "[$]*" = "X"; then
189      # -L didn't work.
190      set X `ls -t $srcdir/configure conftestfile`
191   fi
192   if test "[$]*" != "X $srcdir/configure conftestfile" \
193      && test "[$]*" != "X conftestfile $srcdir/configure"; then
194
195      # If neither matched, then we have a broken ls.  This can happen
196      # if, for instance, CONFIG_SHELL is bash and it inherits a
197      # broken ls alias from the environment.  This has actually
198      # happened.  Such a system could not be considered "sane".
199      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
200alias in your environment])
201   fi
202
203   test "[$]2" = conftestfile
204   )
205then
206   # Ok.
207   :
208else
209   AC_MSG_ERROR([newly created file is older than distributed files!
210Check your system clock])
211fi
212rm -f conftest*
213AC_MSG_RESULT(yes)])
214
215dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
216dnl The program must properly implement --version.
217AC_DEFUN([AM_MISSING_PROG],
218[AC_MSG_CHECKING(for working $2)
219# Run test in a subshell; some versions of sh will print an error if
220# an executable is not found, even if stderr is redirected.
221# Redirect stdin to placate older versions of autoconf.  Sigh.
222if ($2 --version) < /dev/null > /dev/null 2>&1; then
223   $1=$2
224   AC_MSG_RESULT(found)
225else
226   $1="$3/missing $2"
227   AC_MSG_RESULT(missing)
228fi
229AC_SUBST($1)])
230
231# Like AC_CONFIG_HEADER, but automatically create stamp file.
232
233AC_DEFUN([AM_CONFIG_HEADER],
234[AC_PREREQ([2.12])
235AC_CONFIG_HEADER([$1])
236dnl When config.status generates a header, we must update the stamp-h file.
237dnl This file resides in the same directory as the config header
238dnl that is generated.  We must strip everything past the first ":",
239dnl and everything past the last "/".
240AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
241ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
242<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
243<<am_indx=1
244for am_file in <<$1>>; do
245  case " <<$>>CONFIG_HEADERS " in
246  *" <<$>>am_file "*<<)>>
247    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
248    ;;
249  esac
250  am_indx=`expr "<<$>>am_indx" + 1`
251done<<>>dnl>>)
252changequote([,]))])
253
254# Add --enable-maintainer-mode option to configure.
255# From Jim Meyering
256
257# serial 1
258
259AC_DEFUN([AM_MAINTAINER_MODE],
260[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
261  dnl maintainer-mode is disabled by default
262  AC_ARG_ENABLE(maintainer-mode,
263[  --enable-maintainer-mode enable make rules and dependencies not useful
264                          (and sometimes confusing) to the casual installer],
265      USE_MAINTAINER_MODE=$enableval,
266      USE_MAINTAINER_MODE=no)
267  AC_MSG_RESULT($USE_MAINTAINER_MODE)
268  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
269  MAINT=$MAINTAINER_MODE_TRUE
270  AC_SUBST(MAINT)dnl
271]
272)
273
274# Define a conditional.
275
276AC_DEFUN([AM_CONDITIONAL],
277[AC_SUBST($1_TRUE)
278AC_SUBST($1_FALSE)
279if $2; then
280  $1_TRUE=
281  $1_FALSE='#'
282else
283  $1_TRUE='#'
284  $1_FALSE=
285fi])
286
287