aclocal.m4 revision 94536
194536Sobriendnl aclocal.m4 generated automatically by aclocal 1.4-p5
238889Sjdp
394536Sobriendnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
460484Sobriendnl This file is free software; the Free Software Foundation
538889Sjdpdnl gives unlimited permission to copy and/or distribute it,
638889Sjdpdnl with or without modifications, as long as this notice is preserved.
738889Sjdp
838889Sjdpdnl This program is distributed in the hope that it will be useful,
938889Sjdpdnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1038889Sjdpdnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1138889Sjdpdnl PARTICULAR PURPOSE.
1238889Sjdp
1333965Sjdpdnl See whether we need to use fopen-bin.h rather than fopen-same.h.
1433965SjdpAC_DEFUN(BFD_BINARY_FOPEN,
1533965Sjdp[AC_REQUIRE([AC_CANONICAL_SYSTEM])
1633965Sjdpcase "${host}" in
1733965Sjdpchangequote(,)dnl
1860484Sobrien*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
1933965Sjdpchangequote([,])dnl
2060484Sobrien  AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
2133965Sjdpesac])dnl
2233965Sjdp
2333965Sjdpdnl Get a default for CC_FOR_BUILD to put into Makefile.
2433965SjdpAC_DEFUN(BFD_CC_FOR_BUILD,
2533965Sjdp[# Put a plausible default for CC_FOR_BUILD in Makefile.
2633965Sjdpif test -z "$CC_FOR_BUILD"; then
2733965Sjdp  if test "x$cross_compiling" = "xno"; then
2833965Sjdp    CC_FOR_BUILD='$(CC)'
2933965Sjdp  else
3033965Sjdp    CC_FOR_BUILD=gcc
3133965Sjdp  fi
3233965Sjdpfi
3338889SjdpAC_SUBST(CC_FOR_BUILD)
3438889Sjdp# Also set EXEEXT_FOR_BUILD.
3538889Sjdpif test "x$cross_compiling" = "xno"; then
3638889Sjdp  EXEEXT_FOR_BUILD='$(EXEEXT)'
3738889Sjdpelse
3838889Sjdp  AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
3960484Sobrien    [rm -f conftest*
4060484Sobrien     echo 'int main () { return 0; }' > conftest.c
4160484Sobrien     bfd_cv_build_exeext=
4260484Sobrien     ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
4360484Sobrien     for file in conftest.*; do
4460484Sobrien       case $file in
4560484Sobrien       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
4660484Sobrien       *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
4760484Sobrien       esac
4860484Sobrien     done
4960484Sobrien     rm -f conftest*
5060484Sobrien     test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
5138889Sjdp  EXEEXT_FOR_BUILD=""
5238889Sjdp  test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
5338889Sjdpfi
5438889SjdpAC_SUBST(EXEEXT_FOR_BUILD)])dnl
5533965Sjdp
5633965Sjdpdnl See whether we need a declaration for a function.
5733965SjdpAC_DEFUN(BFD_NEED_DECLARATION,
5833965Sjdp[AC_MSG_CHECKING([whether $1 must be declared])
5933965SjdpAC_CACHE_VAL(bfd_cv_decl_needed_$1,
6033965Sjdp[AC_TRY_COMPILE([
6133965Sjdp#include <stdio.h>
6233965Sjdp#ifdef HAVE_STRING_H
6333965Sjdp#include <string.h>
6433965Sjdp#else
6533965Sjdp#ifdef HAVE_STRINGS_H
6633965Sjdp#include <strings.h>
6733965Sjdp#endif
6833965Sjdp#endif
6933965Sjdp#ifdef HAVE_STDLIB_H
7033965Sjdp#include <stdlib.h>
7133965Sjdp#endif
7233965Sjdp#ifdef HAVE_UNISTD_H
7333965Sjdp#include <unistd.h>
7433965Sjdp#endif],
7533965Sjdp[char *(*pfn) = (char *(*)) $1],
7633965Sjdpbfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
7733965SjdpAC_MSG_RESULT($bfd_cv_decl_needed_$1)
7833965Sjdpif test $bfd_cv_decl_needed_$1 = yes; then
7960484Sobrien  AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
8060484Sobrien	    [Define if $1 is not declared in system header files.])
8133965Sjdpfi
8233965Sjdp])dnl
8338889Sjdp
8460484Sobriendnl Check for existence of a type $1 in sys/procfs.h
8560484Sobrien
8660484SobrienAC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
8760484Sobrien[AC_MSG_CHECKING([for $1 in sys/procfs.h])
8860484Sobrien AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
8977298Sobrien   [AC_TRY_COMPILE([
9077298Sobrien#define _SYSCALL32
9177298Sobrien#include <sys/procfs.h>],
9260484Sobrien      [$1 avar],
9360484Sobrien      bfd_cv_have_sys_procfs_type_$1=yes,
9460484Sobrien      bfd_cv_have_sys_procfs_type_$1=no
9560484Sobrien   )])
9660484Sobrien if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
9760484Sobrien   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
9860484Sobrien	     [Define if <sys/procfs.h> has $1.])
9960484Sobrien fi
10060484Sobrien AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
10160484Sobrien])
10260484Sobrien
10360484Sobrien
10460484Sobriendnl Check for existence of member $2 in type $1 in sys/procfs.h
10560484Sobrien
10660484SobrienAC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
10760484Sobrien[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
10860484Sobrien AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
10977298Sobrien   [AC_TRY_COMPILE([
11077298Sobrien#define _SYSCALL32
11177298Sobrien#include <sys/procfs.h>],
11260484Sobrien      [$1 avar; void* aref = (void*) &avar.$2],
11360484Sobrien      bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
11460484Sobrien      bfd_cv_have_sys_procfs_type_member_$1_$2=no
11560484Sobrien   )])
11660484Sobrien if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
11760484Sobrien   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
11860484Sobrien	     [Define if <sys/procfs.h> has $1.$2.])
11960484Sobrien fi
12060484Sobrien AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
12160484Sobrien])
12260484Sobrien
12377298Sobriensinclude(../libtool.m4)
12477298Sobriendnl The lines below arrange for aclocal not to bring libtool.m4
12577298Sobriendnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
12677298Sobriendnl to add a definition of LIBTOOL to Makefile.in.
12777298Sobrienifelse(yes,no,[
12877298SobrienAC_DEFUN([AM_PROG_LIBTOOL],)
12977298SobrienAC_DEFUN([AM_DISABLE_SHARED],)
13077298SobrienAC_SUBST(LIBTOOL)
13177298Sobrien])
13260484Sobrien
13377298Sobriensinclude(../gettext.m4)
13477298Sobrienifelse(yes,no,[
13577298SobrienAC_DEFUN([CY_WITH_NLS],)
13677298SobrienAC_SUBST(INTLLIBS)
13777298Sobrien])
13860484Sobrien
13938889Sjdp# Do all the work for Automake.  This macro actually does too much --
14038889Sjdp# some checks are only needed if your package does certain things.
14138889Sjdp# But this isn't really a big deal.
14238889Sjdp
14338889Sjdp# serial 1
14438889Sjdp
14538889Sjdpdnl Usage:
14638889Sjdpdnl AM_INIT_AUTOMAKE(package,version, [no-define])
14738889Sjdp
14894536SobrienAC_DEFUN([AM_INIT_AUTOMAKE],
14960484Sobrien[AC_REQUIRE([AC_PROG_INSTALL])
15038889SjdpPACKAGE=[$1]
15138889SjdpAC_SUBST(PACKAGE)
15238889SjdpVERSION=[$2]
15338889SjdpAC_SUBST(VERSION)
15438889Sjdpdnl test to see if srcdir already configured
15538889Sjdpif test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
15638889Sjdp  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
15738889Sjdpfi
15838889Sjdpifelse([$3],,
15960484SobrienAC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
16060484SobrienAC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
16138889SjdpAC_REQUIRE([AM_SANITY_CHECK])
16238889SjdpAC_REQUIRE([AC_ARG_PROGRAM])
16338889Sjdpdnl FIXME This is truly gross.
16438889Sjdpmissing_dir=`cd $ac_aux_dir && pwd`
16538889SjdpAM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
16638889SjdpAM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
16738889SjdpAM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
16838889SjdpAM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
16938889SjdpAM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
17038889SjdpAC_REQUIRE([AC_PROG_MAKE_SET])])
17138889Sjdp
17238889Sjdp#
17338889Sjdp# Check to make sure that the build environment is sane.
17438889Sjdp#
17538889Sjdp
17694536SobrienAC_DEFUN([AM_SANITY_CHECK],
17738889Sjdp[AC_MSG_CHECKING([whether build environment is sane])
17838889Sjdp# Just in case
17938889Sjdpsleep 1
18038889Sjdpecho timestamp > conftestfile
18138889Sjdp# Do `set' in a subshell so we don't clobber the current shell's
18238889Sjdp# arguments.  Must try -L first in case configure is actually a
18338889Sjdp# symlink; some systems play weird games with the mod time of symlinks
18438889Sjdp# (eg FreeBSD returns the mod time of the symlink's containing
18538889Sjdp# directory).
18638889Sjdpif (
18738889Sjdp   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
18838889Sjdp   if test "[$]*" = "X"; then
18938889Sjdp      # -L didn't work.
19038889Sjdp      set X `ls -t $srcdir/configure conftestfile`
19138889Sjdp   fi
19238889Sjdp   if test "[$]*" != "X $srcdir/configure conftestfile" \
19338889Sjdp      && test "[$]*" != "X conftestfile $srcdir/configure"; then
19438889Sjdp
19538889Sjdp      # If neither matched, then we have a broken ls.  This can happen
19638889Sjdp      # if, for instance, CONFIG_SHELL is bash and it inherits a
19738889Sjdp      # broken ls alias from the environment.  This has actually
19838889Sjdp      # happened.  Such a system could not be considered "sane".
19938889Sjdp      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
20038889Sjdpalias in your environment])
20138889Sjdp   fi
20238889Sjdp
20338889Sjdp   test "[$]2" = conftestfile
20438889Sjdp   )
20538889Sjdpthen
20638889Sjdp   # Ok.
20738889Sjdp   :
20838889Sjdpelse
20938889Sjdp   AC_MSG_ERROR([newly created file is older than distributed files!
21038889SjdpCheck your system clock])
21138889Sjdpfi
21238889Sjdprm -f conftest*
21338889SjdpAC_MSG_RESULT(yes)])
21438889Sjdp
21538889Sjdpdnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
21638889Sjdpdnl The program must properly implement --version.
21794536SobrienAC_DEFUN([AM_MISSING_PROG],
21838889Sjdp[AC_MSG_CHECKING(for working $2)
21938889Sjdp# Run test in a subshell; some versions of sh will print an error if
22038889Sjdp# an executable is not found, even if stderr is redirected.
22138889Sjdp# Redirect stdin to placate older versions of autoconf.  Sigh.
22238889Sjdpif ($2 --version) < /dev/null > /dev/null 2>&1; then
22338889Sjdp   $1=$2
22438889Sjdp   AC_MSG_RESULT(found)
22538889Sjdpelse
22638889Sjdp   $1="$3/missing $2"
22738889Sjdp   AC_MSG_RESULT(missing)
22838889Sjdpfi
22938889SjdpAC_SUBST($1)])
23038889Sjdp
23138889Sjdp# Like AC_CONFIG_HEADER, but automatically create stamp file.
23238889Sjdp
23394536SobrienAC_DEFUN([AM_CONFIG_HEADER],
23438889Sjdp[AC_PREREQ([2.12])
23538889SjdpAC_CONFIG_HEADER([$1])
23638889Sjdpdnl When config.status generates a header, we must update the stamp-h file.
23738889Sjdpdnl This file resides in the same directory as the config header
23838889Sjdpdnl that is generated.  We must strip everything past the first ":",
23938889Sjdpdnl and everything past the last "/".
24038889SjdpAC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
24138889Sjdpifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
24238889Sjdp<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
24338889Sjdp<<am_indx=1
24438889Sjdpfor am_file in <<$1>>; do
24538889Sjdp  case " <<$>>CONFIG_HEADERS " in
24638889Sjdp  *" <<$>>am_file "*<<)>>
24738889Sjdp    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
24838889Sjdp    ;;
24938889Sjdp  esac
25038889Sjdp  am_indx=`expr "<<$>>am_indx" + 1`
25138889Sjdpdone<<>>dnl>>)
25238889Sjdpchangequote([,]))])
25338889Sjdp
25438889Sjdp# Add --enable-maintainer-mode option to configure.
25538889Sjdp# From Jim Meyering
25638889Sjdp
25738889Sjdp# serial 1
25838889Sjdp
25994536SobrienAC_DEFUN([AM_MAINTAINER_MODE],
26038889Sjdp[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
26138889Sjdp  dnl maintainer-mode is disabled by default
26238889Sjdp  AC_ARG_ENABLE(maintainer-mode,
26338889Sjdp[  --enable-maintainer-mode enable make rules and dependencies not useful
26438889Sjdp                          (and sometimes confusing) to the casual installer],
26538889Sjdp      USE_MAINTAINER_MODE=$enableval,
26638889Sjdp      USE_MAINTAINER_MODE=no)
26738889Sjdp  AC_MSG_RESULT($USE_MAINTAINER_MODE)
26860484Sobrien  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
26960484Sobrien  MAINT=$MAINTAINER_MODE_TRUE
27038889Sjdp  AC_SUBST(MAINT)dnl
27138889Sjdp]
27238889Sjdp)
27338889Sjdp
27460484Sobrien# Define a conditional.
27538889Sjdp
27694536SobrienAC_DEFUN([AM_CONDITIONAL],
27760484Sobrien[AC_SUBST($1_TRUE)
27860484SobrienAC_SUBST($1_FALSE)
27960484Sobrienif $2; then
28060484Sobrien  $1_TRUE=
28160484Sobrien  $1_FALSE='#'
28260484Sobrienelse
28360484Sobrien  $1_TRUE='#'
28460484Sobrien  $1_FALSE=
28560484Sobrienfi])
28638889Sjdp
287