This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for autoconf cleanup/update in ld subdirectory


While working on a different binutils patch I learned that we have
updated the required autoconf version for binutils.  Looking around I
saw that the ld and binutils configure.in files still had some remnents
of old autoconf usage in them (mainly use of BFD_NEED_DECLARATION) even
though the require the use of newer autoconfs.  This patch fixes the ld
configure.in by replacing BFD_NEED_DECLARATION with AC_CHECK_DECLS and
by replacing the inlined version of AM_BINUTILS_WARNINGS with a real
AM_BINUTILS_WARNINGS statement.

Tested on IA64 Linux with no regressions.  I do not have binutils
write permissions so if someone could approve it and check it in,
that would be great.

Steve Ellcey
sje@cup.hp.com


ld/ChangeLog

2005-06-03  Steve Ellcey  <sje@cup.hp.com>

	configure.in (AM_BINUTILS_WARNINGS): Add.
	(BFD_NEED_DECLARATION) Replace with AC_CHECK_DECLS
	config.in: Regenerate.
	configure: Regenerate.
	sysdep.h (NEED_DECLARATION_*): Replace with 
	HAVE_DECL_*
	ldmain.c: Ditto.


*** src.orig/ld/configure.in	Fri Jun  3 13:58:09 2005
--- src/ld/configure.in	Fri Jun  3 13:57:13 2005
*************** AC_SUBST(use_sysroot)
*** 66,113 ****
  AC_SUBST(TARGET_SYSTEM_ROOT)
  AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
  
! dnl FIXME: The following is bfd/warning.m4 contents expanded
! dnl When converting to current autotools, please replace with
! dnl AM_BINUTILS_WARNINGS
! WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
! 
! AC_ARG_ENABLE(werror,
!   [  --enable-werror    treat compile warnings as errors],
!   [case "${enableval}" in
!      yes | y) ERROR_ON_WARNING="yes" ;;
!      no | n)  ERROR_ON_WARNING="no" ;;
!      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
!    esac])
! 
! # Enable -Werror by default when using gcc
! if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
!     ERROR_ON_WARNING=yes
! fi
! 
! NO_WERROR=
! if test "${ERROR_ON_WARNING}" = yes ; then
!     WARN_CFLAGS="$WARN_CFLAGS -Werror"
!     NO_WERROR="-Wno-error"
! fi
! 		   
! AC_ARG_ENABLE(build-warnings,
! [  --enable-build-warnings Enable build-time compiler warnings],
! [case "${enableval}" in
!   yes)	;;
!   no)	WARN_CFLAGS="-w";;
!   ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
!         WARN_CFLAGS="${WARN_CFLAGS} ${t}";;
!   *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
!         WARN_CFLAGS="${t} ${WARN_CFLAGS}";;
!   *)    WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;;
! esac])
! 
! if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
!   echo "Setting warning flags = $WARN_CFLAGS" 6>&1
! fi
! 
! AC_SUBST(WARN_CFLAGS)
! AC_SUBST(NO_WERROR)
  
  AM_CONFIG_HEADER(config.h:config.in)
  
--- 66,72 ----
  AC_SUBST(TARGET_SYSTEM_ROOT)
  AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
  
! AM_BINUTILS_WARNINGS
  
  AM_CONFIG_HEADER(config.h:config.in)
  
*************** fi
*** 156,166 ****
  	
  BFD_BINARY_FOPEN
  
! BFD_NEED_DECLARATION(strstr)
! BFD_NEED_DECLARATION(free)
! BFD_NEED_DECLARATION(sbrk)
! BFD_NEED_DECLARATION(getenv)
! BFD_NEED_DECLARATION(environ)
  
  # When converting linker scripts into strings for use in emulation
  # files, use astring.sed if the compiler supports ANSI string
--- 115,125 ----
  	
  BFD_BINARY_FOPEN
  
! AC_CHECK_DECLS(strstr)
! AC_CHECK_DECLS(free)
! AC_CHECK_DECLS(sbrk)
! AC_CHECK_DECLS(getenv)
! AC_CHECK_DECLS(environ)
  
  # When converting linker scripts into strings for use in emulation
  # files, use astring.sed if the compiler supports ANSI string
*** src.orig/ld/sysdep.h	Fri Jun  3 13:58:09 2005
--- src/ld/sysdep.h	Fri Jun  3 13:57:13 2005
*************** extern char *strrchr ();
*** 77,95 ****
  #include "fopen-same.h"
  #endif
  
! #ifdef NEED_DECLARATION_STRSTR
  extern char *strstr ();
  #endif
  
! #ifdef NEED_DECLARATION_FREE
  extern void free ();
  #endif
  
! #ifdef NEED_DECLARATION_GETENV
  extern char *getenv ();
  #endif
  
! #ifdef NEED_DECLARATION_ENVIRON
  extern char **environ;
  #endif
  
--- 77,95 ----
  #include "fopen-same.h"
  #endif
  
! #if !HAVE_DECL_STRSTR
  extern char *strstr ();
  #endif
  
! #if !HAVE_DECL_FREE
  extern void free ();
  #endif
  
! #if !HAVE_DECL_GETENV
  extern char *getenv ();
  #endif
  
! #if !HAVE_DECL_ENVIRON
  extern char **environ;
  #endif
  
*** src.orig/ld/ldmain.c	Fri Jun  3 13:58:09 2005
--- src/ld/ldmain.c	Fri Jun  3 13:57:13 2005
***************
*** 50,56 ****
  #include <string.h>
  
  #ifdef HAVE_SBRK
! #ifdef NEED_DECLARATION_SBRK
  extern void *sbrk ();
  #endif
  #endif
--- 50,56 ----
  #include <string.h>
  
  #ifdef HAVE_SBRK
! #if !HAVE_DECL_SBRK
  extern void *sbrk ();
  #endif
  #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]