aclocal.m4 revision 104834
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
139104834SobrienAC_DEFUN([AM_INSTALL_LIBBFD],
140104834Sobrien[AC_MSG_CHECKING([whether to install libbfd])
141104834Sobrien  AC_ARG_ENABLE(install-libbfd,
142104834Sobrien[  --install-libbfd controls installation of libbfd and related headers],
143104834Sobrien      install_libbfd_p=$enableval,
144104834Sobrien      if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then
145104834Sobrien        install_libbfd_p=yes
146104834Sobrien      else
147104834Sobrien        install_libbfd_p=no
148104834Sobrien      fi)
149104834Sobrien  AC_MSG_RESULT($install_libbfd_p)
150104834Sobrien  AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
151104834Sobrien  # libbfd.a is a host library containing target dependent code
152104834Sobrien  bfdlibdir='$(libdir)'
153104834Sobrien  bfdincludedir='$(includedir)'
154104834Sobrien  if test "${host}" != "${target}"; then
155104834Sobrien    bfdlibdir='$(exec_prefix)/$(host_alias)/$(target_alias)/lib'
156104834Sobrien    bfdincludedir='$(exec_prefix)/$(host_alias)/$(target_alias)/include'
157104834Sobrien  fi
158104834Sobrien  AC_SUBST(bfdlibdir)
159104834Sobrien  AC_SUBST(bfdincludedir)
160104834Sobrien]
161104834Sobrien)
162104834Sobrien
163104834Sobrien# Define a conditional.
164104834Sobrien
165104834SobrienAC_DEFUN([AM_CONDITIONAL],
166104834Sobrien[AC_SUBST($1_TRUE)
167104834SobrienAC_SUBST($1_FALSE)
168104834Sobrienif $2; then
169104834Sobrien  $1_TRUE=
170104834Sobrien  $1_FALSE='#'
171104834Sobrienelse
172104834Sobrien  $1_TRUE='#'
173104834Sobrien  $1_FALSE=
174104834Sobrienfi])
175104834Sobrien
17638889Sjdp# Do all the work for Automake.  This macro actually does too much --
17738889Sjdp# some checks are only needed if your package does certain things.
17838889Sjdp# But this isn't really a big deal.
17938889Sjdp
18038889Sjdp# serial 1
18138889Sjdp
18238889Sjdpdnl Usage:
18338889Sjdpdnl AM_INIT_AUTOMAKE(package,version, [no-define])
18438889Sjdp
18594536SobrienAC_DEFUN([AM_INIT_AUTOMAKE],
18660484Sobrien[AC_REQUIRE([AC_PROG_INSTALL])
18738889SjdpPACKAGE=[$1]
18838889SjdpAC_SUBST(PACKAGE)
18938889SjdpVERSION=[$2]
19038889SjdpAC_SUBST(VERSION)
19138889Sjdpdnl test to see if srcdir already configured
19238889Sjdpif test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
19338889Sjdp  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
19438889Sjdpfi
19538889Sjdpifelse([$3],,
19660484SobrienAC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
19760484SobrienAC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
19838889SjdpAC_REQUIRE([AM_SANITY_CHECK])
19938889SjdpAC_REQUIRE([AC_ARG_PROGRAM])
20038889Sjdpdnl FIXME This is truly gross.
20138889Sjdpmissing_dir=`cd $ac_aux_dir && pwd`
20238889SjdpAM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
20338889SjdpAM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
20438889SjdpAM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
20538889SjdpAM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
20638889SjdpAM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
20738889SjdpAC_REQUIRE([AC_PROG_MAKE_SET])])
20838889Sjdp
20938889Sjdp#
21038889Sjdp# Check to make sure that the build environment is sane.
21138889Sjdp#
21238889Sjdp
21394536SobrienAC_DEFUN([AM_SANITY_CHECK],
21438889Sjdp[AC_MSG_CHECKING([whether build environment is sane])
21538889Sjdp# Just in case
21638889Sjdpsleep 1
21738889Sjdpecho timestamp > conftestfile
21838889Sjdp# Do `set' in a subshell so we don't clobber the current shell's
21938889Sjdp# arguments.  Must try -L first in case configure is actually a
22038889Sjdp# symlink; some systems play weird games with the mod time of symlinks
22138889Sjdp# (eg FreeBSD returns the mod time of the symlink's containing
22238889Sjdp# directory).
22338889Sjdpif (
22438889Sjdp   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
22538889Sjdp   if test "[$]*" = "X"; then
22638889Sjdp      # -L didn't work.
22738889Sjdp      set X `ls -t $srcdir/configure conftestfile`
22838889Sjdp   fi
22938889Sjdp   if test "[$]*" != "X $srcdir/configure conftestfile" \
23038889Sjdp      && test "[$]*" != "X conftestfile $srcdir/configure"; then
23138889Sjdp
23238889Sjdp      # If neither matched, then we have a broken ls.  This can happen
23338889Sjdp      # if, for instance, CONFIG_SHELL is bash and it inherits a
23438889Sjdp      # broken ls alias from the environment.  This has actually
23538889Sjdp      # happened.  Such a system could not be considered "sane".
23638889Sjdp      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
23738889Sjdpalias in your environment])
23838889Sjdp   fi
23938889Sjdp
24038889Sjdp   test "[$]2" = conftestfile
24138889Sjdp   )
24238889Sjdpthen
24338889Sjdp   # Ok.
24438889Sjdp   :
24538889Sjdpelse
24638889Sjdp   AC_MSG_ERROR([newly created file is older than distributed files!
24738889SjdpCheck your system clock])
24838889Sjdpfi
24938889Sjdprm -f conftest*
25038889SjdpAC_MSG_RESULT(yes)])
25138889Sjdp
25238889Sjdpdnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
25338889Sjdpdnl The program must properly implement --version.
25494536SobrienAC_DEFUN([AM_MISSING_PROG],
25538889Sjdp[AC_MSG_CHECKING(for working $2)
25638889Sjdp# Run test in a subshell; some versions of sh will print an error if
25738889Sjdp# an executable is not found, even if stderr is redirected.
25838889Sjdp# Redirect stdin to placate older versions of autoconf.  Sigh.
25938889Sjdpif ($2 --version) < /dev/null > /dev/null 2>&1; then
26038889Sjdp   $1=$2
26138889Sjdp   AC_MSG_RESULT(found)
26238889Sjdpelse
26338889Sjdp   $1="$3/missing $2"
26438889Sjdp   AC_MSG_RESULT(missing)
26538889Sjdpfi
26638889SjdpAC_SUBST($1)])
26738889Sjdp
26838889Sjdp# Like AC_CONFIG_HEADER, but automatically create stamp file.
26938889Sjdp
27094536SobrienAC_DEFUN([AM_CONFIG_HEADER],
27138889Sjdp[AC_PREREQ([2.12])
27238889SjdpAC_CONFIG_HEADER([$1])
27338889Sjdpdnl When config.status generates a header, we must update the stamp-h file.
27438889Sjdpdnl This file resides in the same directory as the config header
27538889Sjdpdnl that is generated.  We must strip everything past the first ":",
27638889Sjdpdnl and everything past the last "/".
27738889SjdpAC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
27838889Sjdpifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
27938889Sjdp<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
28038889Sjdp<<am_indx=1
28138889Sjdpfor am_file in <<$1>>; do
28238889Sjdp  case " <<$>>CONFIG_HEADERS " in
28338889Sjdp  *" <<$>>am_file "*<<)>>
28438889Sjdp    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
28538889Sjdp    ;;
28638889Sjdp  esac
28738889Sjdp  am_indx=`expr "<<$>>am_indx" + 1`
28838889Sjdpdone<<>>dnl>>)
28938889Sjdpchangequote([,]))])
29038889Sjdp
29138889Sjdp# Add --enable-maintainer-mode option to configure.
29238889Sjdp# From Jim Meyering
29338889Sjdp
29438889Sjdp# serial 1
29538889Sjdp
29694536SobrienAC_DEFUN([AM_MAINTAINER_MODE],
29738889Sjdp[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
29838889Sjdp  dnl maintainer-mode is disabled by default
29938889Sjdp  AC_ARG_ENABLE(maintainer-mode,
30038889Sjdp[  --enable-maintainer-mode enable make rules and dependencies not useful
30138889Sjdp                          (and sometimes confusing) to the casual installer],
30238889Sjdp      USE_MAINTAINER_MODE=$enableval,
30338889Sjdp      USE_MAINTAINER_MODE=no)
30438889Sjdp  AC_MSG_RESULT($USE_MAINTAINER_MODE)
30560484Sobrien  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
30660484Sobrien  MAINT=$MAINTAINER_MODE_TRUE
30738889Sjdp  AC_SUBST(MAINT)dnl
30838889Sjdp]
30938889Sjdp)
31038889Sjdp
311