aclocal.m4 revision 77298
1dnl aclocal.m4 generated automatically by aclocal 1.4 2 3dnl Copyright (C) 1994, 1995-8, 1999 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 13dnl See whether we need to use fopen-bin.h rather than fopen-same.h. 14AC_DEFUN(BFD_BINARY_FOPEN, 15[AC_REQUIRE([AC_CANONICAL_SYSTEM]) 16case "${host}" in 17changequote(,)dnl 18*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) 19changequote([,])dnl 20 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;; 21esac])dnl 22 23dnl Get a default for CC_FOR_BUILD to put into Makefile. 24AC_DEFUN(BFD_CC_FOR_BUILD, 25[# Put a plausible default for CC_FOR_BUILD in Makefile. 26if test -z "$CC_FOR_BUILD"; then 27 if test "x$cross_compiling" = "xno"; then 28 CC_FOR_BUILD='$(CC)' 29 else 30 CC_FOR_BUILD=gcc 31 fi 32fi 33AC_SUBST(CC_FOR_BUILD) 34# Also set EXEEXT_FOR_BUILD. 35if test "x$cross_compiling" = "xno"; then 36 EXEEXT_FOR_BUILD='$(EXEEXT)' 37else 38 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext, 39 [rm -f conftest* 40 echo 'int main () { return 0; }' > conftest.c 41 bfd_cv_build_exeext= 42 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 43 for file in conftest.*; do 44 case $file in 45 *.c | *.o | *.obj | *.ilk | *.pdb) ;; 46 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; 47 esac 48 done 49 rm -f conftest* 50 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no]) 51 EXEEXT_FOR_BUILD="" 52 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} 53fi 54AC_SUBST(EXEEXT_FOR_BUILD)])dnl 55 56dnl See whether we need a declaration for a function. 57AC_DEFUN(BFD_NEED_DECLARATION, 58[AC_MSG_CHECKING([whether $1 must be declared]) 59AC_CACHE_VAL(bfd_cv_decl_needed_$1, 60[AC_TRY_COMPILE([ 61#include <stdio.h> 62#ifdef HAVE_STRING_H 63#include <string.h> 64#else 65#ifdef HAVE_STRINGS_H 66#include <strings.h> 67#endif 68#endif 69#ifdef HAVE_STDLIB_H 70#include <stdlib.h> 71#endif 72#ifdef HAVE_UNISTD_H 73#include <unistd.h> 74#endif], 75[char *(*pfn) = (char *(*)) $1], 76bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)]) 77AC_MSG_RESULT($bfd_cv_decl_needed_$1) 78if test $bfd_cv_decl_needed_$1 = yes; then 79 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1, 80 [Define if $1 is not declared in system header files.]) 81fi 82])dnl 83 84dnl Check for existence of a type $1 in sys/procfs.h 85 86AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, 87[AC_MSG_CHECKING([for $1 in sys/procfs.h]) 88 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, 89 [AC_TRY_COMPILE([ 90#define _SYSCALL32 91#include <sys/procfs.h>], 92 [$1 avar], 93 bfd_cv_have_sys_procfs_type_$1=yes, 94 bfd_cv_have_sys_procfs_type_$1=no 95 )]) 96 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then 97 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1, 98 [Define if <sys/procfs.h> has $1.]) 99 fi 100 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1) 101]) 102 103 104dnl Check for existence of member $2 in type $1 in sys/procfs.h 105 106AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, 107[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) 108 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, 109 [AC_TRY_COMPILE([ 110#define _SYSCALL32 111#include <sys/procfs.h>], 112 [$1 avar; void* aref = (void*) &avar.$2], 113 bfd_cv_have_sys_procfs_type_member_$1_$2=yes, 114 bfd_cv_have_sys_procfs_type_member_$1_$2=no 115 )]) 116 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then 117 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1, 118 [Define if <sys/procfs.h> has $1.$2.]) 119 fi 120 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) 121]) 122 123sinclude(../libtool.m4) 124dnl The lines below arrange for aclocal not to bring libtool.m4 125dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake 126dnl to add a definition of LIBTOOL to Makefile.in. 127ifelse(yes,no,[ 128AC_DEFUN([AM_PROG_LIBTOOL],) 129AC_DEFUN([AM_DISABLE_SHARED],) 130AC_SUBST(LIBTOOL) 131]) 132 133sinclude(../gettext.m4) 134ifelse(yes,no,[ 135AC_DEFUN([CY_WITH_NLS],) 136AC_SUBST(INTLLIBS) 137]) 138 139#serial 1 140# This test replaces the one in autoconf. 141# Currently this macro should have the same name as the autoconf macro 142# because gettext's gettext.m4 (distributed in the automake package) 143# still uses it. Otherwise, the use in gettext.m4 makes autoheader 144# give these diagnostics: 145# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX 146# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX 147 148undefine([AC_ISC_POSIX]) 149 150AC_DEFUN(AC_ISC_POSIX, 151 [ 152 dnl This test replaces the obsolescent AC_ISC_POSIX kludge. 153 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) 154 ] 155) 156 157# Do all the work for Automake. This macro actually does too much -- 158# some checks are only needed if your package does certain things. 159# But this isn't really a big deal. 160 161# serial 1 162 163dnl Usage: 164dnl AM_INIT_AUTOMAKE(package,version, [no-define]) 165 166AC_DEFUN(AM_INIT_AUTOMAKE, 167[AC_REQUIRE([AC_PROG_INSTALL]) 168PACKAGE=[$1] 169AC_SUBST(PACKAGE) 170VERSION=[$2] 171AC_SUBST(VERSION) 172dnl test to see if srcdir already configured 173if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then 174 AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 175fi 176ifelse([$3],, 177AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 178AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) 179AC_REQUIRE([AM_SANITY_CHECK]) 180AC_REQUIRE([AC_ARG_PROGRAM]) 181dnl FIXME This is truly gross. 182missing_dir=`cd $ac_aux_dir && pwd` 183AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) 184AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) 185AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) 186AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) 187AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) 188AC_REQUIRE([AC_PROG_MAKE_SET])]) 189 190# 191# Check to make sure that the build environment is sane. 192# 193 194AC_DEFUN(AM_SANITY_CHECK, 195[AC_MSG_CHECKING([whether build environment is sane]) 196# Just in case 197sleep 1 198echo timestamp > conftestfile 199# Do `set' in a subshell so we don't clobber the current shell's 200# arguments. Must try -L first in case configure is actually a 201# symlink; some systems play weird games with the mod time of symlinks 202# (eg FreeBSD returns the mod time of the symlink's containing 203# directory). 204if ( 205 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` 206 if test "[$]*" = "X"; then 207 # -L didn't work. 208 set X `ls -t $srcdir/configure conftestfile` 209 fi 210 if test "[$]*" != "X $srcdir/configure conftestfile" \ 211 && test "[$]*" != "X conftestfile $srcdir/configure"; then 212 213 # If neither matched, then we have a broken ls. This can happen 214 # if, for instance, CONFIG_SHELL is bash and it inherits a 215 # broken ls alias from the environment. This has actually 216 # happened. Such a system could not be considered "sane". 217 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 218alias in your environment]) 219 fi 220 221 test "[$]2" = conftestfile 222 ) 223then 224 # Ok. 225 : 226else 227 AC_MSG_ERROR([newly created file is older than distributed files! 228Check your system clock]) 229fi 230rm -f conftest* 231AC_MSG_RESULT(yes)]) 232 233dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) 234dnl The program must properly implement --version. 235AC_DEFUN(AM_MISSING_PROG, 236[AC_MSG_CHECKING(for working $2) 237# Run test in a subshell; some versions of sh will print an error if 238# an executable is not found, even if stderr is redirected. 239# Redirect stdin to placate older versions of autoconf. Sigh. 240if ($2 --version) < /dev/null > /dev/null 2>&1; then 241 $1=$2 242 AC_MSG_RESULT(found) 243else 244 $1="$3/missing $2" 245 AC_MSG_RESULT(missing) 246fi 247AC_SUBST($1)]) 248 249# Like AC_CONFIG_HEADER, but automatically create stamp file. 250 251AC_DEFUN(AM_CONFIG_HEADER, 252[AC_PREREQ([2.12]) 253AC_CONFIG_HEADER([$1]) 254dnl When config.status generates a header, we must update the stamp-h file. 255dnl This file resides in the same directory as the config header 256dnl that is generated. We must strip everything past the first ":", 257dnl and everything past the last "/". 258AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl 259ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, 260<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, 261<<am_indx=1 262for am_file in <<$1>>; do 263 case " <<$>>CONFIG_HEADERS " in 264 *" <<$>>am_file "*<<)>> 265 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx 266 ;; 267 esac 268 am_indx=`expr "<<$>>am_indx" + 1` 269done<<>>dnl>>) 270changequote([,]))]) 271 272# Add --enable-maintainer-mode option to configure. 273# From Jim Meyering 274 275# serial 1 276 277AC_DEFUN(AM_MAINTAINER_MODE, 278[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 279 dnl maintainer-mode is disabled by default 280 AC_ARG_ENABLE(maintainer-mode, 281[ --enable-maintainer-mode enable make rules and dependencies not useful 282 (and sometimes confusing) to the casual installer], 283 USE_MAINTAINER_MODE=$enableval, 284 USE_MAINTAINER_MODE=no) 285 AC_MSG_RESULT($USE_MAINTAINER_MODE) 286 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) 287 MAINT=$MAINTAINER_MODE_TRUE 288 AC_SUBST(MAINT)dnl 289] 290) 291 292# Define a conditional. 293 294AC_DEFUN(AM_CONDITIONAL, 295[AC_SUBST($1_TRUE) 296AC_SUBST($1_FALSE) 297if $2; then 298 $1_TRUE= 299 $1_FALSE='#' 300else 301 $1_TRUE='#' 302 $1_FALSE= 303fi]) 304 305